Virtual Pages difference - Spotted with VirtualQuery()

Max max at veneto.com
Thu Jul 18 17:05:41 CDT 2002


As usual, AutoCAD seems to be a good test-bench for wine :-)
I spotted the problem that seemed coming from VirtualQuety function, but
that is (I guess... hmmmm) more a problem of memory handling in wine.

I made a little test app; here the results in wine and win2k, later on
the app itself :

WINE RESULTS :

Memory info about '004012F0' :
    Base Address		: 00401000
    Allocation Base	: 00400000
    Allocation Protect	: PAGE_READONLY | PAGE_WRITECOPY | 		
				  PAGE_EXECUTE_READWRITE | PAGE_NOACCESS
    Region Size		: 00017000
    State			: MEM_COMMIT
    Protect			: PAGE_WRITECOPY      <----- HERE
    Type			: MEM_PRIVATE

WIN2k RESULTS :

Memory info about '004012F0' :
    Base Address		: 00401000
    Allocation Base	: 00400000
    Allocation Protect	: PAGE_EXECUTE_WRITECOPY
    Region Size		: 00001000
    State			: MEM_COMMIT
    Protect			: PAGE_EXECUTE_READ    <---- AND HERE
    Type			: MEM_IMAGE

Well, dunno too much about Type field, I didn't find an app that check it yet;
I did find the app that uses Protect flag; I think it's poor coded, but as 
usual we should make bad apps work too :-)
The app put some data in code page, not yet spotted if hard or soft-coded,
then before reading it checks Protect field to see if it has not set the 
PAGE_GUARD, NO_ACCESS and WRITECOPY flags; if t has, it hangs some 10.000 
lines later (sigh....)
I think wine should set Protect flag quite as like as possible as windoze

For AutoCAD2000 I put a dirty hack in process.c, but is really ugly; i'd 
prefer not to put my hands (bytes ?) too deeply inside some code that I don't 
understand completely... 

Attached is the test source (compiled in Borland CBuilder, but should work 
with any compiler, apart some unuseful pragma's).
If needed I can post the compiled too :-)

Regards

Max
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VirtualQueryTest.cpp
Type: text/x-c++src
Size: 3190 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20020719/2484209c/VirtualQueryTest.cpp


More information about the wine-devel mailing list