Huw Davies (@huw) commented about dlls/combase/apartment.c:
- if (apt->multi_threaded)
- {
/* FIXME: should be randomly generated by in an RPC call to rpcss */
apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe;
- }
- else
- {
/* FIXME: should be randomly generated by in an RPC call to rpcss */
apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId();
- }
- /* Get a new OXID to use for this apartment. Note that re-creating
* an apartment (by calling CoUninitialize and then CoInitializeEx)
* will result in a new OXID. This ensures that we don't re-use a
* proxy_manager` that refers to a dead apartment. */
- rpcss_get_new_apartment_oxid(&apt->oxid);
We would want to test for this failing (and probably clean up and return NULL).