Share via


EnableRouter (Compact 2013)

3/26/2014

This function turns on IPv4 forwarding on the local device. EnableRouter also increments a reference count that tracks the number of requests to enable IPv4 forwarding.

Syntax

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

Parameters

  • pHandle
    A pointer to a handle. This parameter is currently unused.
  • pOverlapped
    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.

Return Value

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.

Return code

Description

ERROR_INVALID_PARAMETER

One of the parameters is invalid. This error is returned if the pOverlapped parameter is NULL.

Other

Use FormatMessage to obtain the message string for the returned error.

Remarks

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 if the process had called UnenableRouter.

See Also

Reference

IP Helper Functions
UnenableRouter

Other Resources

IP Helper
OVERLAPPED
CreateEvent