What does HRESULT 0x80010140 (CO_E_CANCEL_DISABLED) mean?

 
Previous Next
CO_E_ACNOTINITIALIZED RPC_E_UNEXPECTED

CO_E_CANCEL_DISABLED

COM call cancellation is disabled

CO_E_CANCEL_DISABLED is HRESULT 2147549504 (0x80010140) from winerror.h. The documented description is “Call Cancellation is disabled.” The value must be interpreted at CoCancelCall or cancellation-aware COM call control.

The caller attempted to cancel a call on a thread or call context where cancellation has not been enabled. The operational record needs the native value, symbolic constant, component build, and call phase; the message alone is insufficient.

Where the result appears

  • This result may surface in CoCancelCall or cancellation-aware COM call control.

Separate caller state from runtime and server state first; otherwise cleanup and retry may target the wrong generation of the operation.

Typical causes and interpretation

Common cause categories are: the thread never enabled cancellation; cancellation was disabled too early; the wrong thread is targeted; no cancellable call context exists. Each possible cause of this result predicts different outputs and recovery behavior, which should be verified explicitly.

Key distinction: the caller attempted to cancel a call on a thread or call context where cancellation has not been enabled.

Correct handling and recovery

The appropriate recovery is to enable cancellation on the calling thread before the operation, balance enable and disable calls, and use operation-specific cancellation where available. Repeat the operation only after the failed condition has changed and the caller can distinguish a duplicate effect.

Practical scenario

A worker tries to cancel its long remote call without first enabling COM call cancellation; initialization is corrected at worker startup.

An automated test should verify raw HRESULT, output ownership, cleanup behavior, and the absence of an unsafe automatic retry.

Difference from related HRESULTs

RPC_E_CALL_CANCELED means cancellation actually terminated a call; this result means the cancellation mechanism was unavailable.

The comparison matters operationally: one result may permit fallback while the other requires repair, cancellation, or state reconciliation.

References


Looking for a different code? Search another status or error code.