RpcTestCancel function (rpcdce.h)

The RpcTestCancel function checks for a cancel indication.

Syntax

RPC_STATUS RpcTestCancel();

Return value

Value Meaning
RPC_S_OK
The call has been canceled.
Other values
The call has not been canceled.
 
Note  For a list of valid error codes, see RPC Return Values.
 
It is not unusual for the RpcTestCancel function to return the value ERROR_ACCESS_DENIED. This indicates that the remote procedure call has not been canceled.

Remarks

An application server stub calls RpcTestCancel to determine whether a call has been canceled. If the call has been canceled, RPC_S_OK is returned; otherwise, another value is returned.

This function should be called periodically by the server stub so that it can respond to cancels in a timely fashion. If the function returns RPC_S_OK, the stub should clean up its data structures and return to the client.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header rpcdce.h (include Rpc.h)
Library Rpcrt4.lib
DLL Rpcrt4.dll

See also

RpcServerTestCancel