IServerSecurity::RevertToSelf

HRESULT IServerSecurity::RevertToSelf();

This method restores the authentication information on a thread to the process's identity.

In the apartment model, IServerSecurity::RevertToSelf only affects the current method invocation. If there are nested method invocations, they each may have there own impersonation and COM will correctly restore the impersonation before returning to them (regardless of whether or not IServerSecurity::RevertToSelf was called).

IServerSecurity::RevertToSelf may be called on threads other then the one that received the call. IServerSecurity::RevertToSelf may be called after the call completes. Calls to IServerSecurity::RevertToSelf that are not matched with an IServerSecurity::ImpersonateClient call will fail.

Argument

Type

Description

Returns

S_OK

Success.

E_FAIL

This call was not preceded by a call to IserverSecurity::ImpersonateClient on this thread of execution.