Patch for memory-mapping problem -- See VirtualQuery post in wine-devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, I took off the dirty hack on virtual.c and put inside something that
seems to me much more like a real solution.
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.

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,
+// PATCH                                     VPROT_COMMITTED|VPROT_READ|VPROT_WRITE|VPROT_WRITECOPY,
+/*PATCH*/                                     VPROT_COMMITTED|VPROT_READ|VPROT_EXEC,
                                      hmapping )))
     {
         SetLastError( ERROR_OUTOFMEMORY );

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux