Commit 7a876582 authored by simonmar@microsoft.com's avatar simonmar@microsoft.com
Browse files

fix Win32 build

parent e3c55aeb
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* ---------------------------------------------------------------------------*/ * ---------------------------------------------------------------------------*/
#include <windows.h> #include <windows.h>
#include "Rts.h"
#include "OSMem.h"
lnat getPageSize (void) lnat getPageSize (void)
{ {
...@@ -24,11 +26,11 @@ lnat getPageSize (void) ...@@ -24,11 +26,11 @@ lnat getPageSize (void)
void setExecutable (void *p, lnat len, rtsBool exec) void setExecutable (void *p, lnat len, rtsBool exec)
{ {
DWORD dwOldProtect = 0; DWORD dwOldProtect = 0;
if (VirtualProtect (addr, len, if (VirtualProtect (p, len,
exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE,
&dwOldProtect) == 0) &dwOldProtect) == 0)
{ {
barf("makeExecutable: failed to protect 0x%p; error=%lu; old protection: %lu\n", barf("makeExecutable: failed to protect 0x%p; error=%lu; old protection: %lu\n",
addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect); p, (unsigned long)GetLastError(), (unsigned long)dwOldProtect);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment