[PATCH v7 4/6] commdlg: Allocate memory using VirtualAlloc instead of NtAllocateVirtualMemory
Rémi Bernon
rbernon at codeweavers.com
Fri May 31 05:02:01 CDT 2019
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>
---
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 5b72bfab100..050cddb0dd5 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++)
--
2.20.1
More information about the wine-devel
mailing list