Site icon EfmSoft

What does HRESULT 0x80400001 (INPUT_E_REENTRANCY) mean?

 
Previous Next
INPUT_E_OUT_OF_ORDER INPUT_E_MULTIMODAL

INPUT_E_REENTRANCY

The scope of INPUT_E_REENTRANCY is pointer sequencing and interaction state. An input operation was invoked from inside a callback or event handler where nested processing is forbidden. Keep 0x80400001 beside the returning method because a wrapper can replace this distinction with a generic subsystem message.

Limits of this code

This is not a generic multithreading error. The same operation may be legal on the same thread immediately after the callback unwinds. Do not create a nested message loop or block waiting for a deferred operation from inside the callback; both approaches can preserve the prohibited stack and deadlock delivery.

Start with the returning API

Pointer delivery is a state machine, not a stream of interchangeable coordinates. Windows associates samples with a pointer identity, frame, device, modality, timestamp domain, and callback phase. Sequence failures are therefore diagnosed by reconstructing when the interaction began, which modality owns it, and whether the caller re-entered the same state machine before the previous notification completed.

The callback may hold internal input state while Windows is delivering an interaction result. Calling a state-changing API synchronously from that stack can recurse into the same context before the first delivery has completed.

Evidence to preserve

  • Callback name and interaction or pointer context handle
  • Thread ID, callback depth, and message or event being delivered
  • The nested API call and every argument passed to it
  • Whether a dispatcher post, queue, or deferred task is already available

Reproduce without destructive cleanup

Use one live pointer and one monotonic time source, then add replay, modality changes, or callback-triggered work separately. A test that changes timestamp generation and callback dispatch at the same time cannot identify which contract was violated.

  1. Replace the nested call with a posted operation that runs after the callback returns.
  2. Keep the same context and inputs so only call timing changes.
  3. Add a callback-depth assertion in diagnostic builds.
  4. Test cancellation and object destruction so deferral does not use a stale context.

Technical references


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

Exit mobile version