[Bug 890] New: - Virtual Pages difference - Spotted with VirtualQuery()

wine-bugs at winehq.com wine-bugs at winehq.com
Thu Jul 18 03:06:32 CDT 2002


http://bugs.winehq.com/show_bug.cgi?id=890

           Summary: Virtual Pages difference - Spotted with VirtualQuery()
           Product: Wine
           Version: 20020509
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: wine-kernel
        AssignedTo: wine-bugs at winehq.com
        ReportedBy: maxx2 at veneto.com


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 :-)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://bugs.winehq.com/show_bug.cgi?id=890>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.



More information about the wine-bugs mailing list