| Previous | Next |
| E_FAIL | CO_E_INIT_SHARED_ALLOCATOR |
CO_E_INIT_TLS
COM initialization could not establish thread-local state
CO_E_INIT_TLS is HRESULT 2147500038 (0x80004006) from winerror.h. The documented description is “Thread local storage failure.” The value must be interpreted at the early COM runtime initialization path for the current thread or process.
COM could not create or access the thread-local storage needed to track apartment and call state.
Where the result appears
- This result may surface in the early COM runtime initialization path for the current thread or process.
Map this result to one concrete invocation and one concrete object or metadata identity before interpreting the human-readable description.
Typical causes and interpretation
Common cause categories are: TLS allocation failed; initialization occurred in a prohibited loader phase; process corruption or extreme resource pressure prevented runtime setup. The evidence should distinguish configuration, lifetime, input, identity, resource, and version failures rather than grouping them.
Key distinction: COM could not create or access the thread-local storage needed to track apartment and call state.
Correct handling and recovery
The appropriate recovery is to move COM initialization out of DllMain, simplify early startup, check process integrity and memory pressure, then restart the process rather than looping on the same thread.
Practical scenario
An in-process extension initializes COM from DllMain under loader lock and fails before any object activation; initialization is moved to the worker entry point.
Difference from related HRESULTs
CO_E_INIT_TLS_CHANNEL_CONTROL is narrower and concerns the channel-control record after the base TLS mechanism exists.
References
Looking for a different code? Search another status or error code.