Platform SDK: Internet Protocol Helper

UnenableRouter

The UnenableRouter function decrements the reference count that tracks the number of enable-IP-forwarding requests. When this reference count reaches zero, UneableRouter turns off IP forwarding on the local computer.

DWORD WINAPI UnenableRouter(
    OVERLAPPED* pOverlapped,
    LPDWORD lpdwEnableCount OPTIONAL
    );

Parameters

pOverlapped
Pointer to an OVERLAPPED structure. This structure should be the same as the one used in the call to EnableRouter.
lpdwEnableCount
Pointer to a DWORD variable. This variable receives the number of references remaining.

Return Values

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.

Remarks

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 IP-forwarding reference count for another process. Also, if IP forwarding was enabled by a given process, it cannot be disabled by a different process.

If the process that calls EnableRouter terminates without calling UnenableRouter, the system will decrement the IP-forwarding reference count as though the process had called UnenableRouter.

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

See Also

CloseHandle, EnableRouter, OVERLAPPED