Correction to COINIT_MULTITHREADED test
titan.costa at wanadoo.fr
Tue Jan 11 17:42:38 CST 2005
Paul Vriens wrote:
>On Tue, 2005-01-11 at 12:19, Christian Costa wrote:
>>All the time ?
>>Looking at COM_CreateApartment it seems COINIT_APARTMENTTHREADED works but indeed COINIT_MULTITHREADED always return NULL.
>>I think the code at the beginning of COM_CreateApartment is wrong.
>> TRACE("thread 0x%lx is entering the multithreaded apartment\n", GetCurrentThreadId());
>> COM_CurrentInfo()->apt = &MTA;
>> return apt;
>>I think we should return COM_CurrentInfo()->apt rather than apt.
>With all the time, I mean that when CoInitializeEx is called with
>COINIT_MULITHREADED it itself will return E_OUTOFMEMORY (because of the
>NULL being passed back by COM_CreateApartment).
Ah! Ok! :-)
>Another thing in MSDN which is currently not accounted for (AFAIK) is:
>Multiple calls to CoInitializeEx by the same thread are allowed as long
>as they pass the same concurrency flag, but subsequent valid calls
You're right. The current code does not handle that.
I've just sent a patch to fix it.
More information about the wine-devel