What does HRESULT 0x80072EF1 (WININET_E_OPERATION_CANCELLED) mean?

 
Previous Next
WININET_E_INVALID_OPERATION WININET_E_INCORRECT_HANDLE_TYPE

WININET_E_OPERATION_CANCELLED

WININET_E_OPERATION_CANCELLED usually means that code closed the WinINet handle while an operation using that handle was still in progress. It is commonly a normal consequence of cancellation or shutdown, rather than a response sent by the server.

Handle lifetime matters

After an asynchronous call returns ERROR_IO_PENDING, InternetCloseHandle can be used to cancel the I/O only when no later API calls will use that handle. The handle may be invalidated before pending work finishes, and the asynchronous completion path still needs to tolerate that result.

How to avoid races

  • Give one component ownership of closing a request handle.
  • Prevent new work from being queued after cancellation starts.
  • Make callbacks idempotent and able to observe that cancellation, rather than treating it as a transport fault.

Microsoft: InternetCloseHandle · Microsoft: asynchronous WinINet operations


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