From 4ad588d764be75ba447496ed8e413351c0d22499 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 19 Apr 2016 08:34:55 +0200 Subject: [PATCH] VirtualAllocEx expects 0 for size if passing MEM_RELEASE. * Thanks RangerWu (in #171) for pointing this out! --- renderdoc/os/win32/win32_process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index 2a5cf89ac..a5f54a29c 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -177,7 +177,7 @@ void InjectDLL(HANDLE hProcess, wstring libName) WaitForSingleObject(hThread, INFINITE); CloseHandle(hThread); } - VirtualFreeEx(hProcess, remoteMem, sizeof(dllPath), MEM_RELEASE); + VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE); } else { @@ -295,7 +295,7 @@ void InjectFunctionCall(HANDLE hProcess, uintptr_t renderdoc_remote, const char ReadProcessMemory(hProcess, remoteMem, data, dataLen, &numWritten); CloseHandle(hThread); - VirtualFreeEx(hProcess, remoteMem, dataLen, MEM_RELEASE); + VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE); } static PROCESS_INFORMATION RunProcess(const char *app, const char *workingDir, const char *cmdLine)