IServerSecurity::ImpersonateClient
Allows a
server to impersonate a client for the duration of a call.
HRESULT ImpersonateClient()
Return Values
This method
supports the standard return value E_FAIL, as well as the following:
S_OK
Success.
Remarks
IServerSecurity::ImpersonateClient allows a server to impersonate a client for the
duration of a call. What the server may do depends on the impersonation level,
specified through one of the RPC_C_IMP_LEVEL_xxx
Traditionally,
impersonation information is not nested - the last call to any Win32 impersonation mechanism overrides any
previous impersonation. However, in the apartment model, impersonation is
maintained during nested calls. Thus if the server A receives a
call from B, impersonates, calls C, receives a call
from D, impersonates, reverts, and receives the reply from C,
the impersonation will be set back to B, not A.
Distributed
COM currently does not support dynamic impersonation. The only way to change
the client token associated with remote OLE calls is to use IClientSecurity::SetBlanket
See Also