UnenableRouter function (iphlpapi.h)
The UnenableRouter function decrements the reference count that tracks the number of requests to enable IPv4 forwarding. When this reference count reaches zero, UnenableRouter turns off IPv4 forwarding on the local computer.
IPHLPAPI_DLL_LINKAGE DWORD UnenableRouter( OVERLAPPED *pOverlapped, LPDWORD lpdwEnableCount );
An optional pointer to a DWORD variable. This variable receives the number of references remaining.
If the function succeeds, the return value is NO_ERROR.
If the function fails, use FormatMessage to obtain the message string for the returned error.
The UnenableRouter function is specific to IPv4 forwarding. Each call that a process makes to UnenableRouter must correspond to a previous call to EnableRouter by the same process. The system returns an error on extraneous calls to UnenableRouter. As a result, a given process is not able to decrement the reference count that tracks the number of requests for enabling IPv4 forwarding for another process. Also, if IPv4 forwarding was enabled by a given process, it cannot be disabled by a different process.
It is not possible to accurately determine the reference count that tracks the number of requests for enabling IPv4 forwarding since there might be other outstanding EnableRouter requests. So the value returned for the lpdwEnableCount parameter is always a large count equal to ULONG_MAX/2.
If the process that calls EnableRouter terminates without calling UnenableRouter, the system decrements the reference count that tracks requests to enable IPv4 forwarding as though the process had called UnenableRouter.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|