What does Windows error code 10103 (WSAECANCELLED) mean?

 
Previous Next
WSAENOMORE WSAEINVALIDPROCTABLE

WSAECANCELLED

WSAECANCELLED is tied to the Winsock 2 namespace lookup lifecycle. Microsoft documents it when WSALookupServiceEnd is called while WSALookupServiceNext is still processing, causing that lookup call to be canceled.

The result buffer is not usable

For the canceled WSALookupServiceNext call, Microsoft states that the data in the result buffer is undefined. Code must not inspect a partially filled WSAQUERYSET and treat fields that happen to look valid as a successful result.

Compatibility detail

Winsock 2 defines both WSAECANCELLED and WSA_E_CANCELLED. The former is the legacy conflicting value. Applications that consume results from different namespace providers should recognize both.

  • Coordinate lookup-handle ownership between the worker issuing Next and the thread requesting cancellation.
  • Discard the canceled result buffer contents.
  • Distinguish deliberate shutdown from provider failure in logs and metrics.

A retry is meaningful only if the application intentionally starts a new lookup with WSALookupServiceBegin; the canceled enumeration has ended.

Microsoft: WSALookupServiceNext · Microsoft: WSALookupServiceEnd


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