| Previous | Next |
| CO_E_MALFORMED_SPN | CO_E_PREMATURE_STUB_RUNDOWN |
CO_E_UNREVOKED_REGISTRATION_ON_APARTMENT_SHUTDOWN
Apartment shut down with a COM registration still active
CO_E_UNREVOKED_REGISTRATION_ON_APARTMENT_SHUTDOWN is HRESULT 2147500084 (0x80004034) from winerror.h. The documented description is “The caller failed to revoke a per-apartment registration before apartment shutdown.” The value must be interpreted at per-apartment class, callback, or interface registration tied to apartment lifetime.
The apartment began shutdown before the owner revoked a registration that must not outlive it.
Where the result appears
- This result may surface in per-apartment class, callback, or interface registration tied to apartment lifetime.
Typical causes and interpretation
Common cause categories are: cleanup was skipped on an exception; ownership moved across threads; the apartment exits while callbacks remain registered. The evidence should distinguish configuration, lifetime, input, identity, resource, and version failures rather than grouping them.
Key distinction: the apartment began shutdown before the owner revoked a registration that must not outlive it.
Correct handling and recovery
The appropriate recovery is to store the registration cookie with apartment-owned state, revoke it before CoUninitialize, stop callbacks first, and make teardown idempotent.
Practical scenario
A UI extension registers a per-apartment handler but closes the window without revoking it; teardown is updated to revoke before apartment shutdown.
Difference from related HRESULTs
CO_E_PREMATURE_STUB_RUNDOWN concerns remote object lifetime after clients exist; this code concerns a registration left active by its owner.
References
Looking for a different code? Search another status or error code.
