Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Dan Kegel
On Fri, Jan 8, 2010 at 6:52 AM, Alexandre Julliard wrote: > There's no reason that RtlGetNtGlobalFlags would need the TEB at all. Well, that's where native puts the flags. OK, I'll put them elsewhere.

Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Alexandre Julliard
Dan Kegel writes: > Posting a working if suboptimal implementation > is a clear way of framing questions sometimes, > but I guess when I do that it should be to wine-devel. Questions and RFCs should go to wine-devel. Sending to wine-patches means "I believe this is good enough to be committed".

Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Dan Kegel
On Fri, Jan 8, 2010 at 6:41 AM, Dan Kegel wrote: > Maybe what we want is a safe implementation of RtlGetNtGlobalFlags(), one > that returns zero if it's not safe to call NtCurrentTeb(). > We could store the global flags in a plain old global variable, > and copy it in to the peb but never referenc

Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Dan Kegel
On Fri, Jan 8, 2010 at 2:08 AM, Alexandre Julliard wrote: >> To check whether we're too early in process setup to >> check global flags, I compare the arguments of RtlCreateHeap >> with the ones used by the call in virtual_init().  This is >> not especially clean, but I couldn't think of anything

[2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Joris Huizer
Dan Kegel, you wrote: To check whether we're too early in process setup to check global flags, I compare the arguments of RtlCreateHeap with the ones used by the call in virtual_init(). This is not especially clean, but I couldn't think of anything better. I was thinking, couldn't you place the

Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Alexandre Julliard
Dan Kegel writes: > To check whether we're too early in process setup to > check global flags, I compare the arguments of RtlCreateHeap > with the ones used by the call in virtual_init(). This is > not especially clean, but I couldn't think of anything > better. I can hear Alexandre hitting the

Re: [2/3] ntdll: fill unused tails of heap blocks if HEAP_FREE_CHECKING_ENABLED (take 3)

2010-01-08 Thread Alexandre Julliard
Dan Kegel writes: > @@ -1254,14 +1291,20 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, > SIZE_T totalSize, SIZE_T c > { > SUBHEAP *subheap; > > -/* Allocate the heap block */ > +/* Check global flags unless we're being called in virtual_init before > they > + * ar