Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

RpcRevertToSelfEx function

The RpcRevertToSelfEx function allows a server to impersonate a client and then revert in a multithreaded operation where the call to impersonate a client can come from a thread other than the thread originally dispatched from the RPC.

Syntax


RPC_STATUS RPC_ENTRY RpcRevertToSelfEx(
  RPC_BINDING_HANDLE BindingHandle
);

Parameters

BindingHandle

Binding handle on the server that represents a binding to the client that the server impersonated. A value of zero specifies the client handle of the current thread; in this case, the functionality of RpcRevertToSelfEx is identical to that of the RpcRevertToSelf function.

Return value

ValueMeaning
RPC_S_OK

The call succeeded.

RPC_S_NO_CALL_ACTIVE

The server does not have a client to impersonate.

RPC_S_INVALID_BINDING

The binding handle is invalid.

RPC_S_WRONG_KIND_OF_BINDING

This is the wrong kind of binding for this operation.

RPC_S_CANNOT_SUPPORT

The call is not supported for this operating system, this transport, or this security subsystem.

 

Note  For a list of valid error codes, see RPC Return Values.

Remarks

After calling RpcImpersonateClient and completing any tasks that require client impersonation, the server calls RpcRevertToSelfEx to end impersonation and to reestablish its own security identity. For example, consider a primary thread, called thread1, which is dispatched from a remote client and wakes up a worker thread, called thread2. If thread2 requires that the server impersonate the client, the server calls RpcImpersonateClient(THREAD1_CALL_HANDLE), performs the required task, calls RpcRevertToSelfEx(THREAD1_CALL_HANDLE) to end the impersonation, and then wakes up thread1.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Rpcdce.h (include Rpc.h)

Library

Rpcrt4.lib

DLL

Rpcrt4.dll

See also

Client Impersonation
RpcImpersonateClient
RpcRevertToSelf

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.