Platform SDK: Internet Protocol Helper

EnableRouter

The EnableRouter function turns on IP forwarding on the local computer. EnableRouter also increments a reference count that tracks the number of enable-IP-forwarding requests.

DWORD WINAPI EnableRouter(
    HANDLE* pHandle,
    OVERLAPPED* pOverlapped
    );

Parameters

pHandle
Pointer to a handle.
pOverlapped
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.

Remarks

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.

Return Values

If the function succeeds, the return value is ERROR_IO_PENDING.

If the function fails, use FormatMessage to obtain the message string for the returned error.

See Also

UnenableRouter, OVERLAPPED, CreateEvent