RevertSecurityContext function (sspi.h)

Allows a security package to discontinue the impersonation of the caller and restore its own security context.

Syntax

KSECDDDECLSPEC SECURITY_STATUS SEC_ENTRY RevertSecurityContext(
  [in] PCtxtHandle phContext
);

Parameters

[in] phContext

Handle of the security context being impersonated. This handle must have been obtained in the call to the AcceptSecurityContext (General) function and used in the call to the ImpersonateSecurityContext function.

Return value

If the function succeeds, the return value is SEC_E_OK.

If the function fails, the return value can be one of the following error codes.

Return code Description
SEC_E_INVALID_HANDLE
The handle passed to the function is not valid.

Remarks

RevertSecurityContext is not available with all security packages on all platforms. Typically, it is implemented only on platforms and with security packages for which a call to the QuerySecurityPackageInfo function indicates impersonation support.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header sspi.h (include Security.h)
Library Secur32.lib
DLL Secur32.dll

See also

AcceptSecurityContext (General)

ImpersonateSecurityContext

SSPI Functions