ntdll: use MAP_FIXED when allocating dos memory

Austin English austinenglish at gmail.com
Wed May 19 15:43:20 CDT 2010


Based on a patch by John Reiser.

See http://bugs.winehq.org/show_bug.cgi?id=14360

-- 
-Austin
-------------- next part --------------
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 6fedbf3..c1bd1e0 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -978,7 +978,7 @@ static NTSTATUS allocate_dos_memory( struct file_view **view, unsigned int vprot
 
     if (wine_mmap_is_in_reserved_area( low_64k, dosmem_size - 0x10000 ) != 1)
     {
-        addr = wine_anon_mmap( low_64k, dosmem_size - 0x10000, unix_prot, 0 );
+        addr = wine_anon_mmap( low_64k, dosmem_size - 0x10000, unix_prot, MAP_FIXED );
         if (addr != low_64k)
         {
             if (addr != (void *)-1) munmap( addr, dosmem_size - 0x10000 );
@@ -990,7 +990,7 @@ static NTSTATUS allocate_dos_memory( struct file_view **view, unsigned int vprot
 
     if (wine_mmap_is_in_reserved_area( NULL, 0x10000 ) != 1)
     {
-        addr = wine_anon_mmap( (void *)page_size, 0x10000 - page_size, unix_prot, 0 );
+        addr = wine_anon_mmap( (void *)page_size, 0x10000 - page_size, unix_prot, MAP_FIXED );
         if (addr == (void *)page_size)
         {
             addr = NULL;


More information about the wine-patches mailing list