Expand Minimize

EnableRouter function

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.

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference
UnenableRouter
OVERLAPPED
CreateEvent

 

 

Community Additions

ADD
Show:
© 2014 Microsoft