Andreas Mohr <[EMAIL PROTECTED]> writes:

> Now some questions:
> I need to track the currently accessed subheap and other things by using 
> static HEAP *currentheap = NULL;
> static SUBHEAP *currentsubheap = NULL;
> static int currentregionindex = 0;
> .
> This is everything else but threadsafe :-\
> Getting this threadsafe for one process would be possible using Tls*().
> However with access by several processes concurrently it will mess up.
> Any solution on how to do this properly ?

The state must be maintained in the PROCESS_HEAP_ENTRY structure. You
must not have separate state variables.

> And some other things: I currently use a rather faked "currentregionindex"
> instead of the "real" region index of the corresponding subheap
> (I assume "region" in Windows speak means "subheap" in Wine speak)
> as used in Windows.
> Maybe we should add a region index to our subheaps ?

No, I think simply incrementing it for each subheap is
reasonable. There is no "real" region index anyway, no heap function
uses such an index.

-- 
Alexandre Julliard
[EMAIL PROTECTED]

Reply via email to