RFR: 8270269: Desktop.browse method fails if earlier CoInitialize call as COINIT_MULTITHREADED [v3]

Alexey Ivanov aivanov at openjdk.org
Mon Dec 11 21:04:33 UTC 2023


On Mon, 11 Dec 2023 20:38:46 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> A previous call to [CoInitializeEx](https://learn.microsoft.com/en-us/windows/desktop/api/combaseapi/nf-combaseapi-coinitializeex) specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred.

It's confusing, and [Neutral Apartments](https://learn.microsoft.com/en-us/windows/win32/cossdk/neutral-apartments) does not clarify anything. [The Apartment and the COM Threading Architecture](https://learn.microsoft.com/en-us/windows/win32/com/processes--threads--and-apartments#the-apartment-and-the-com-threading-architecture) section in “Processes, Threads, and Apartments” article doesn't mention *neutral* at all.

At the same time, I am sure the transition from STA to MTA or from MTA to STA is not possible.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17010#issuecomment-1850881527


More information about the client-libs-dev mailing list