[PATCH v3 2/2] ntdll: Start find_free_area from address_space_start instead of 0.

Rémi Bernon rbernon at codeweavers.com
Thu Nov 21 06:35:26 CST 2019


The search was initiated with base == 0, which returns NULL immediately
if MEM_TOP_DOWN is not used. Use address_space_start instead.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/ntdll/virtual.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 60838c68a55..80e1c5235fe 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1204,7 +1204,7 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
 
         if (zero_bits_64)
         {
-            if (!(ptr = find_free_area( (void*)0, alloc.limit, size, mask, top_down, TRUE, unix_prot )))
+            if (!(ptr = find_free_area( address_space_start, alloc.limit, size, mask, top_down, TRUE, unix_prot )))
                 return STATUS_NO_MEMORY;
             TRACE( "got mem with find_free_area %p-%p\n", ptr, (char *)ptr + size );
             goto done;
-- 
2.24.0.rc2




More information about the wine-devel mailing list