Trouble with VirtualQuery()
Gérard Patel <firstname.lastname@example.org> @s5.asi.fr
Gérard Patel <email@example.com> at s5.asi.fr
Mon Apr 23 18:54:01 CDT 2001
At 07:26 AM 22/04/2001 -0700, you wrote:
> I've been investigating the free Borland ilink32.exe , the one that
>locks under wine. Has this been discussed already? Well anyway, it
>probes several memory address with VirtualQuery(). This first location
>is 0x80000000 . On a normal windows system that would be system memory.
>Wine claims that area as free memory. Well apparently ilink32 doesn't
>want to see that region as free memory so it goes into an endless loop .
>There is a big list of memory location that it checks and if it doesn't
>get an acceptable result (Reserved) then it goes into an endless loop.
>If I set all the address to,
> info->State = MEM_RESERVED;
> info->Protect = PAGE_NOACCESS;
> info->AllocationProtect = PAGE_NOACCESS;
> info->Type = MEM_PRIVATE;
>Then ilink32 doesn't lock, but it has four internal memory errors. It
>still doesn't work, but it exit with an error.
Msdn has an article about that when they are talking about the special
version of NT that has a 3 Gig memory space. IIRC this version is breaking
some apps that are doing pointer calculations on 32 bits values
without taking in account the sign - in short, bugged apps. So they
are not letting apps see the 8000000-BFFFFFFF area without them being
marked (some special flag in the Exe).
I had posted a patch a long time ago removing the upper middle of the virtual
memory space (enabled in the config file) but it never made it in Cvs.
I have also posted another patch more recently on cemw (6 april 2001)
I don't know if it fixes the command line tool, but it fixes borland builder's
linker it seems.
Btw I have wondered for a long time why the Bcb linker works under Win9x
(where the 80000000-BFFFFFFF area is available).
Now I think it's working because of sheer luck; in this more recent patch
I have only removed the 4k page after 80000000 and the C0000000-FFFFFFFF
area and it seems to work - as it happens under Win9x this same 4k page is
not available too. I guess it's enough to work around the linker bug.
Possibly I'll send a new patch if I find where is the flag in the exe to
handle the 3 gig memory space but as I am not actively searching for
it, you are welcome to do it yourself :-)
More information about the wine-devel