=?UTF-8?Q?R=C3=A9mi=20Bernon=20?=: commdlg: Allocate memory using VirtualAlloc instead of NtAllocateVirtualMemory.

Alexandre Julliard julliard at winehq.org
Tue Jun 4 16:28:13 CDT 2019


Module: wine
Branch: master
Commit: 3c9104f961833dd4e70c92a2f3edbd72eef2eb00
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3c9104f961833dd4e70c92a2f3edbd72eef2eb00

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri May 31 12:02:01 2019 +0200

commdlg: Allocate memory using VirtualAlloc instead of NtAllocateVirtualMemory.

NtAllocateVirtualMemory was called for its zero_bits parameter, used
as an alignment value. But it is not, so call VirtualAlloc instead.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/commdlg.dll16/filedlg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/commdlg.dll16/filedlg.c b/dlls/commdlg.dll16/filedlg.c
index 5b72bfa..050cddb 100644
--- a/dlls/commdlg.dll16/filedlg.c
+++ b/dlls/commdlg.dll16/filedlg.c
@@ -509,8 +509,7 @@ static LPOFNHOOKPROC alloc_hook( LPOFNHOOKPROC16 hook16 )
     SIZE_T size = 0x1000;
     unsigned int i;
 
-    if (!hooks && NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&hooks, 12, &size,
-                                           MEM_COMMIT, PAGE_EXECUTE_READWRITE ))
+    if (!hooks && !(hooks = VirtualAlloc( NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE )))
         return NULL;
 
     for (i = 0; i < count; i++)




More information about the wine-cvs mailing list