Platform SDK: Logon Authentication

QuerySecurityContextToken

The QuerySecurityContextToken function obtains the Windows NT/Windows 2000 access token for a client security context and uses it directly.

SECURITY_STATUS QuerySecurityContextToken(
  PCtxtHandle phContext,
  HANDLE *phToken
);

Parameters

phContext
[in] Handle of the context to query.
phToken
[out] Returned handle to the access token.

Return Values

If the function succeeds, the return value is SEC_E_OK.

If the function fails, the return value is a nonzero error code. One possible error code return is SEC_E_INVALID_HANDLE.

Remarks

This function is called by a security package or application to control impersonation outside the SSPI layer, such as when launching a child process. The handle returned must be closed with CloseHandle when the handle is no longer needed.

The prototype for this function can be found in Sspi.h.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Sspi.h; include Security.h.
  Library: Use Secur32.lib.