Skip to content

Latest commit

 

History

History
104 lines (87 loc) · 3.25 KB

nf-combaseapi-cotestcancel.md

File metadata and controls

104 lines (87 loc) · 3.25 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:combaseapi.CoTestCancel
CoTestCancel function (combaseapi.h)
Determines whether the call being executed on the server has been canceled by the client.
CoTestCancel
CoTestCancel function [COM]
_com_CoTestCancel
com.cotestcancel
combaseapi/CoTestCancel
com\cotestcancel.htm
com
9432621a-be31-4b8b-83b6-069539ba06b4
12/05/2018
CoTestCancel, CoTestCancel function [COM], _com_CoTestCancel, com.cotestcancel, combaseapi/CoTestCancel
combaseapi.h
Objbase.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
CoTestCancel
combaseapi/CoTestCancel
c++
APIRef
kbSyntax
DllExport
Ole32.dll
API-MS-Win-Core-Com-l1-1-0.dll
ComBase.dll
API-MS-Win-Core-Com-l1-1-1.dll
API-MS-Win-DownLevel-Ole32-l1-1-1.dll
CoTestCancel

CoTestCancel function

-description

Determines whether the call being executed on the server has been canceled by the client.

-returns

This function can return the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return code Description
RPC_S_CALLPENDING
The call is still pending and has not yet been canceled by the client.
RPC_E_CALL_CANCELED
The call has been canceled by the client.

-remarks

Server objects should call CoTestCancel at least once before returning to detect client cancellation requests. Doing so can save the server unnecessary work if the client has issued a cancellation request, and it can reduce the client's wait time if it has set the cancel timeout as RPC_C_CANCEL_INFINITE_TIMEOUT. Furthermore, if the server object detects a cancellation request before returning from a pending call, it can clean up any memory, marshaled interfaces, or handles it has created or obtained.

CoTestCancel calls CoGetCallContext to obtain the ICancelMethodCalls interface on the current cancel object and then calls ICancelMethodCalls::TestCancel. Objects that implement custom marshaling should first call CoSwitchCallContext to install the appropriate call context object.

This function does not test cancellation for asynchronous calls.

-see-also

ICancelMethodCalls