Fix NtAllocateVirtualMemory declaration and fix users of the
function.
diff --git a/dlls/kernel/process.c b/dlls/kernel/process.c
index 4541278..1910d72 100644
--- a/dlls/kernel/process.c
+++ b/dlls/kernel/process.c
@@ -379,6 +379,7 @@
size *= sizeof(WCHAR);
/* Now allocate the environment */
+ ptr = NULL;
if (NtAllocateVirtualMemory(NtCurrentProcess(), &ptr, 0, &size,
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) != STATUS_SUCCESS)
return FALSE;
@@ -719,7 +720,8 @@
RTL_USER_PROCESS_PARAMETERS *params;
size = info_size;
- if (NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, NULL, &size,
+ ptr = NULL;
+ if (NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, 0, &size,
MEM_COMMIT, PAGE_READWRITE ) != STATUS_SUCCESS)
return NULL;
@@ -748,7 +750,8 @@
/* environment needs to be a separate memory block */
env_size = info_size - params->Size;
if (!env_size) env_size = 1;
- if (NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, NULL, &env_size,
+ ptr = NULL;
+ if (NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, 0, &env_size,
MEM_COMMIT, PAGE_READWRITE ) != STATUS_SUCCESS)
return NULL;
memcpy( ptr, (char *)params + params->Size, info_size - params->Size );
diff --git a/dlls/kernel/virtual.c b/dlls/kernel/virtual.c
index 3b5126d..c5d8e8d 100644
--- a/dlls/kernel/virtual.c
+++ b/dlls/kernel/virtual.c
@@ -86,10 +86,10 @@
DWORD type, /* [in] Type of allocation */
DWORD protect ) /* [in] Type of access protection */
{
- LPVOID ret;
+ LPVOID ret = addr;
NTSTATUS status;
- if ((status = NtAllocateVirtualMemory( hProcess, &ret, addr, &size, type, protect )))
+ if ((status = NtAllocateVirtualMemory( hProcess, &ret, 0, &size, type, protect )))
{
SetLastError( RtlNtStatusToDosError(status) );
ret = NULL;