RasGetNapStatus function (ras.h)

The RasGetNapStatus function retrieves the Network Access Protection (NAP) connection state variables for a given remote access connection.


DWORD RasGetNapStatus(
  [in]      HRASCONN      hRasconn,
  [in, out] LPRASNAPSTATE pRasNapState


[in] hRasconn

A handle to the connection. Use RasDial or RasEnumConnections to obtain this handle.

[in, out] pRasNapState

A pointer to a RASNAPSTATE structure. On input, the dwSize member of the structure must be set to sizeof(RASNAPSTATE). On output, pNapState returns the NAP state of the RAS connection.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or Winerror.h.

Return code Description
Connection corresponding to the hRasConn parameter is not configured for NAP.
The dwSize parameter of the RASNAPSTATE structure has an invalid size value.
Handle passed to the function is either NULL or invalid.
RASMAN could not find the handle in its list of handles.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header ras.h
Library Rasapi32.lib
DLL Rasapi32.dll