Fix for programs that store VirtualQueryEx results in signed integers (eg. The Borland Linker)

Troy Rollo wine at
Wed Mar 3 00:46:08 CST 2004

On Wed, 3 Mar 2004 16:20, Alexandre Julliard wrote:
> Actually we don't run on the main stack, so allocating the space above
> 0x80000000 would definitely be possible, the stack doesn't need to
> grow there.

In that case I could move the changes to start_process and incorporate the 
address space modifications as per the comments. The only issue then would be 
determining how far the original stack has already grown so as to know how 
many bytes to reserve (the alternative would be to deallocate the whole range 
and then reserve it, but if something else has mapped into that region in the 
interim this would not be helpful).

Options I can see for this would be:

1. Start with the expected size, and then looping until success, dropping the 
size by 65536 each iteration.

2. Start with the expected size, if that doesn't work use a binary search 
algorithm to see how many we can reserve.

3. Grovel at /proc/{pid}/mem on Linux, do nothing on others.

None of these is ideal. This might be in the "don't fix it until something's 
known to be broken" category.

More information about the wine-devel mailing list