| Previous | Next |
| E_PENDING | E_CHANGED_STATE |
E_BOUNDS
Operation attempted to access data outside the valid range
E_BOUNDS is HRESULT 2147483659 (0x8000000B) from winerror.h. Windows describes it as “The operation attempted to access data outside the valid range.” The relevant context is the Windows Runtime metadata, object lifetime, asynchronous operation, activation, and apartment model.
The caller should keep this result intact through logging, exception translation, and RPC or language projection boundaries.
What to verify
Verify that the valid lower and upper bounds were obtained from the same object instance as the failing access and integer arithmetic did not overflow. That boundary prevents this result from being misclassified as corruption, network failure, or a reason for an unsafe automatic retry.
Where it is encountered
- This result can be returned during C++/WinRT, WRL, .NET projections, or native WinRT ABI calls.
- This result can be returned during runtime-class activation, WinMD reflection, asynchronous objects, observable state, or view lifecycle.
- It can be returned during cross-thread and cross-apartment handoff between UI, ASTA, STA, MTA, broker, and background work.
The immediate focus is an index, offset, slice, iterator position, or requested count that falls outside the current object extent.
Correct handling and recovery
Reject or clamp only when the API contract allows it, recompute the range from current data, and preserve the original index for diagnostics. Do not retry unchanged input.
An unchanged retry loop can duplicate effects, deepen reentrancy, or hide an invalid lifetime transition.
Difference from nearby HRESULTs
It describes a valid object with an invalid range; RO_E_CLOSED says the object lifetime ended, and E_CHANGED_STATE says a concurrent change invalidated a previously valid position.
Developer and administrator guidance
Change the smallest component, identity, ACL, package, or threading boundary that the evidence identifies, then reproduce the same operation.
Practical scenario
A vector has ten elements but a stale UI selection requests element twelve after filtering. The application refreshes the count, clears the selection, and records the old generation instead of masking the bug.
References
Looking for a different code? Search another status or error code.