Correction to COINIT_MULTITHREADED test
Paul.Vriens at xs4all.nl
Tue Jan 11 01:33:31 CST 2005
On Mon, 2005-01-10 at 21:20, Bill Medland wrote:
> Bill Medland (billmedland at mercuryspeed.com)
> Correct testing for multithreaded
> (as spotted by Paul Vriens; fix suggested by Robert Shearman)
it wasn't the check that was way over my head. The thing is, that with
this code change we walk a new path in COM_CreateApartment.
I don't know what the result is but in CoInitializeEx we do:
545 if (!(apt = COM_CurrentInfo()->apt))
547 apt = COM_CreateApartment(dwCoInit);
548 if (!apt) return E_OUTOFMEMORY;
and apparently that leaves us with a E_OUTOFMEMORY all the time. Which
means that we will not come to the part:
and that leads to errors as:
trace:ole:CoInitializeEx ((nil), 4)
trace:ole:COM_CreateApartment thread 0xd is entering the multithreaded
trace:ole:CoInitializeEx ((nil), 2)
err:ole:CoInitializeEx Attempt to change threading model of this
apartment from 0x0 to 0x2
which also shows that the check is wrong. When CoInitializeEx is called
with COINIT_DISABLE_OLE1DDE it shouldn't go in.
What MSDN also says is:
Any combination of values from the COINIT enumeration can be used,
except that the COINIT_APARTMENTTHREADED and COINIT_MULTITHREADED flags
cannot both be set.
So should that be accounted for as well?
More information about the wine-devel