Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 2.98 KB

nf-combaseapi-coenablecallcancellation.md

File metadata and controls

83 lines (65 loc) · 2.98 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.CoEnableCallCancellation
CoEnableCallCancellation function (combaseapi.h)
Enables cancellation of synchronous calls on the calling thread.
CoEnableCallCancellation
CoEnableCallCancellation function [COM]
_com_CoEnableCallCancellation
com.coenablecallcancellation
combaseapi/CoEnableCallCancellation
com\coenablecallcancellation.htm
com
59b66f33-486e-49c3-9fb8-0eab93146ed9
12/05/2018
CoEnableCallCancellation, CoEnableCallCancellation function [COM], _com_CoEnableCallCancellation, com.coenablecallcancellation, combaseapi/CoEnableCallCancellation
combaseapi.h
Objbase.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
CoEnableCallCancellation
combaseapi/CoEnableCallCancellation
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
CoEnableCallCancellation

CoEnableCallCancellation function

-description

Enables cancellation of synchronous calls on the calling thread.

-parameters

-param pReserved [in, optional]

This parameter is reserved and must be NULL.

-returns

This function can return the standard return values S_OK, E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY.

-remarks

When call cancellation is enabled on a thread, marshaled synchronous calls from that thread to objects on the same computer can suffer serious performance degradation. By default, synchronous calls cannot be canceled, even if a cancel object is available. To enable call cancellation, you must call CoEnableCallCancellation first.

Unless you want to enable call cancellation on a thread at all times, you should pair calls to CoEnableCallCancellation with calls to CoDisableCallCancellation. Call cancellation is disabled only if CoDisableCallCancellation has been called once for each time CoEnableCallCancellation was called successfully.

A call will be cancelable or not depending on the state of the thread at the time the call was made. Subsequently enabling or disabling call cancellation has no effect on any calls that are pending on the thread.

-see-also

CoEnableCallCancellation

ICancelMethodCalls