What does NTSTATUS 0xC0000719 (STATUS_CONTEXT_MISMATCH) mean?

 
Previous Next
STATUS_ALREADY_REGISTERED STATUS_PORT_ALREADY_HAS_COMPLETION_LIST

STATUS_CONTEXT_MISMATCH

The context belongs to a different target or operation state

STATUS_CONTEXT_MISMATCH reports that a context object, token, or saved state cannot be used with the target supplied to the current call. The context may have been created for another object, another session, another thread, or an earlier lifecycle generation.

Diagnosis

  • Track where the context was created and which target identity it captured.
  • Check whether reconnect, restart, impersonation, or object recreation invalidated it.
  • Verify thread-affinity and process-affinity requirements.
  • Do not copy opaque context storage or reconstruct it from serialized bytes unless explicitly supported.

Safer design

Store a generation number or target identifier beside cached contexts and reject stale entries before calling the native API. During teardown, clear references atomically so queued work cannot combine a new target with an old context.

References


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