Correction to COINIT_MULTITHREADED test
Christian Costa
titan.costa at wanadoo.fr
Tue Jan 11 05:19:45 CST 2005
> Message du 11/01/05 08:45
> De : "Paul Vriens"
> A : "Bill Medland"
> Copie à : "wine-devel at winehq.org"
> Objet : Re: Correction to COINIT_MULTITHREADED test
> 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)
> >
> Hi Bill,
>
> 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))
> 546 {
> 547 apt = COM_CreateApartment(dwCoInit);
> 548 if (!apt) return E_OUTOFMEMORY;
> 549 }
>
> and apparently that leaves us with a E_OUTOFMEMORY all the time. Which
> means that we will not come to the part:
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.
Bye,
Christian
More information about the wine-devel
mailing list