RasGetNapStatus function (ras.h)

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

Syntax

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

Parameters

[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
ERROR_NOT_NAP_CAPABLE
Connection corresponding to the hRasConn parameter is not configured for NAP.
ERROR_INVALID_SIZE
The dwSize parameter of the RASNAPSTATE structure has an invalid size value.
ERROR_INVALID_HANDLE
Handle passed to the function is either NULL or invalid.
ERROR_NO_CONNECTION
RASMAN could not find the handle in its list of handles.

Requirements

Requirement Value
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