| Previous | Next |
| CO_E_FAILEDTOCREATEFILE | CO_E_EXCEEDSYSACLLIMIT |
CO_E_FAILEDTOCLOSEHANDLE
COM could not close a serialization or file handle
CO_E_FAILEDTOCLOSEHANDLE is HRESULT 2147549496 (0x80010138) from winerror.h. The documented description is “Unable to close a serialization handle or a file handle.” The relevant context is the COM IAccessControl, DCOM client identity, trustee translation, token inspection, security descriptor, ACL, or serialization workflow.
Where it is encountered
- IAccessControl initialization, access checks, owner/trustee processing, and serialized ACL persistence.
- Server-side DCOM impersonation, client blanket inspection, token and SID lookup.
- Security descriptor construction, DACL canonicalization, file-backed policy storage, or legacy NetAccess migration.
The immediate focus is cleanup of an ACL serialization handle or backing file that fails because of invalid ownership, double close, asynchronous use, or underlying I/O state.
What to verify
Verify that the handle creation, transfer, final owner, outstanding I/O, and first close attempt are known. That condition determines whether the same object can continue, a new object is required, or policy must change.
Correct handling and recovery
Stop further use, record the native close error, make ownership single and scoped, and reconcile whether buffered data reached durable storage.
An unchanged retry loop can duplicate effects, deepen reentrancy, or hide an invalid lifetime transition.
Difference from nearby HRESULTs
It is cleanup failure; CO_E_SETSERLHNDLFAILED is serializer handle-state setup or reset failure.
Practical scenario
An exception path closes a file before a scope guard runs. The code adopts unique ownership and verifies flush and close exactly once.
References
Looking for a different code? Search another status or error code.