EnableRouter function (iphlpapi.h)
The EnableRouter function turns on IPv4 forwarding on the local computer. EnableRouter also increments a reference count that tracks the number of requests to enable IPv4 forwarding.
IPHLPAPI_DLL_LINKAGE DWORD EnableRouter( HANDLE *pHandle, OVERLAPPED *pOverlapped );
A pointer to a handle. This parameter is currently unused.
A pointer to an OVERLAPPED structure. Except for the hEvent member, all members of this structure should be set to zero. The hEvent member should contain a handle to a valid event object. Use the CreateEvent function to create this event object.
If the EnableRouter function succeeds, the return value is ERROR_IO_PENDING.
If the function fails, use FormatMessage to obtain the message string for the returned error.
||One of the parameters is invalid. This error is returned if the pOverlapped parameter is NULL.|
||Use FormatMessage to obtain the message string for the returned error.|
The EnableRouter function is specific to IPv4 forwarding. If the process that calls EnableRouter terminates without calling UnenableRouter, the system decrements the reference count that tracks the number of 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]|