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@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2019-05-31 12:02:01 +02:00 committed by Alexandre Julliard
parent 398b1391ba
commit 3c9104f961
1 changed files with 1 additions and 2 deletions

View File

@ -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++)