| Previous | Next |
| STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET | STATUS_SXS_INVALID_DEACTIVATION |
STATUS_SXS_EARLY_DEACTIVATION
Activation contexts are being deactivated out of stack order
STATUS_SXS_EARLY_DEACTIVATION is a precise activation-stack error. ActivateActCtx returns a cookie for a frame pushed on the current thread's stack. When normal deactivation is asked to remove a cookie below the top frame, Windows detects that the reverse activation order was not followed.
It differs from STATUS_SXS_INVALID_DEACTIVATION, which the current service already documents separately and which means the cookie is not active. Here the cookie was found, but another activation is above it. Forced early deactivation can remove several frames and should not be used to hide an ownership bug.
What to inspect
- Log every returned activation cookie with the thread identifier and pair it with exactly one normal deactivation.
- Audit exception, cancellation and callback paths that can skip an inner scope or attempt to unwind an outer context first.
- Do not reuse cookies across threads; active contexts and their stacks are thread-associated.
References
- Microsoft: activation contexts
- Microsoft: ActivateActCtx
- Microsoft: DeactivateActCtx
- Wine: activation-context implementation
Looking for a different code? Search another status or error code.