Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content

UnenableRouter function

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.


DWORD WINAPI UnenableRouter(
            OVERLAPPED *pOverlapped,
  _Out_opt_ LPDWORD    lpdwEnableCount



A pointer to an OVERLAPPED structure. This structure should be the same as the one used in the call to the EnableRouter function.

lpdwEnableCount [out, optional]

An optional pointer to a DWORD variable. This variable receives the number of references remaining.

Return value

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 lpdwEnableCountparmameter 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.

After calling the UnenableRouter, use the CloseHandle call to close the handle to the event object in the OVERLAPPED structure.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







See also

IP Helper Start Page
IP Helper Function Reference



Community Additions

© 2015 Microsoft