COM Server Registry Paths and Threading Models
Windows registers Component Object Model (COM) servers by associating unique Class Identifiers (CLSIDs) with registry keys that define executable file locations and runtime concurrency configurations. These settings inform the Windows COM runtime where to find the server binary and how to manage thread execution when instantiating the object.
The Root CLSID Registry Locations
Registered COM classes are cataloged under the CLSID
key. In the Registry Editor (regedit.exe), these
definitions appear primarily in the merged view under:
HKEY_CLASSES_ROOT\CLSID\{GUID}
The underlying physical registry paths depend on the registration scope (machine-wide vs. user-specific) and architecture:
- Machine-Wide (64-bit or 32-bit OS):
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID} - Per-User:
HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{GUID} - 32-bit Servers on 64-bit Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID\{GUID}
Locating COM Server Local Paths
The binary path to the COM server is stored within a subkey under the
component’s unique {GUID} key, depending on whether the
server runs in-process or out-of-process:
- In-Process DLLs: Stored under the
InprocServer32subkey. The(Default)string value contains the absolute file path to the.dllfile. - Out-of-Process EXEs: Stored under the
LocalServer32subkey. The(Default)string value contains the absolute file path and any startup arguments for the.exefile. - 16-bit Legacy Servers (Rare): Stored under
InprocServerorLocalServer.
Locating the Threading Model
For in-process servers (InprocServer32), the threading
model is defined by a named string value within that subkey:
- Key:
HKEY_CLASSES_ROOT\CLSID\{GUID}\InprocServer32 - Value Name:
ThreadingModel - Common Values:
Apartment(Single-Threaded Apartment / STA)Free(Multi-Threaded Apartment / MTA)Both(Supports both STA and MTA)Neutral(Neutral-Threaded Apartment / NTA)- (Missing value/Not set): Defaults to the main legacy Single-Threaded Apartment model.
Out-of-process servers (LocalServer32) do not require a
ThreadingModel registry entry, as executable processes
initialize their own COM apartments programmatically during startup.