The RevertSecurityContext function allows a service provider to discontinue the impersonation of the caller and restore its own security context.
SECURITY_STATUS RevertSecurityContext(
PCtxtHandle phContext // handle of the context being impersonated
);
If the function succeeds, the return value is SEC_E_OK.
If the function fails, the return value can be the following error code.
Value | Meaning |
---|---|
SEC_E_INVALID_HANDLE | The handle passed to the function is invalid. |
The service provider or an application server calls the RevertSecurityContext function when it needs to stop impersonating the caller. The server must have used this handle in the ImpersonateSecurityContext function.
AcceptSecurityContext, ImpersonateSecurityContext