Resubmitting patch for memory-mapping problem -- See VirtualQuery post in wine-devel

Tony Lambregts tony_lambregts at telusplanet.net
Mon Jul 29 19:35:20 CDT 2002


Massimo wrote:

>Was this patch lost in space or does it have some problem ?
>
>Took off in executable mapping VPROT_WRITE and VPROT_WRITECOPY flags 
>and
> added VPROT_EXEC; that looks much more close to win2k mapping.
>The only difference now is in Type field, wine maps as MEM_PRIVATE and win2k
>as MEM_IMAGE (I guess that's the right one, but no time now to check.
>
>The patch solves (partially) bug 890, and allows AutoCAD 2000 to start up (only in 
>win95 mode, because of another problem on fibers).
>
>Here the attached patch.... any comment appreciated :-)
>
>Regards
>
>Max
>
>
>  
>
>------------------------------------------------------------------------
>
>Index: virtual.c
>===================================================================
>RCS file: /home/wine/wine/memory/virtual.c,v
>retrieving revision 1.80
>diff -u -r1.80 virtual.c
>--- virtual.c	3 Jul 2002 21:10:44 -0000	1.80
>+++ virtual.c	19 Jul 2002 19:33:10 -0000
>@@ -94,7 +94,6 @@
>     PAGE_EXECUTE_WRITECOPY      /* READ | WRITE | EXEC | WRITECOPY */
> };
> 
>-
> static FILE_VIEW *VIRTUAL_FirstView;
> static CRITICAL_SECTION csVirtual = CRITICAL_SECTION_INIT("csVirtual");
> 
>@@ -345,6 +344,7 @@
> ) {
>     if (protect) {
>     	*protect = VIRTUAL_Win32Flags[vprot & 0x0f];
>+
> /*    	if (vprot & VPROT_GUARD) *protect |= PAGE_GUARD;*/
>     	if (vprot & VPROT_NOCACHE) *protect |= PAGE_NOCACHE;
> 
>@@ -650,7 +650,8 @@
> 
>     if (removable) hmapping = 0;  /* don't keep handle open on removable media */
>     if (!(view = VIRTUAL_CreateView( ptr, total_size, 0,
>-                                     VPROT_COMMITTED|VPROT_READ|VPROT_WRITE|VPROT_WRITECOPY,
>
this next line is redundant and should not be in the patch

>+// PATCH                                     VPROT_COMMITTED|VPROT_READ|VPROT_WRITE|VPROT_WRITECOPY,
>+/*PATCH*/                                     VPROT_COMMITTED|VPROT_READ|VPROT_EXEC,
>                                      hmapping )))
>
the  /*patch */ should not be in the patch file.

>     {
>         SetLastError( ERROR_OUTOFMEMORY );
>
>  
>
Looks like Alexandre was at least thinking of this (a little) when he 
wrote this patch

http://cvs.winehq.com/patch.py?id=1027987166850574216879071

You should probably try this out and see if it fixes bug 890.  <g>


Tony Lambregts




More information about the wine-patches mailing list