diff dyncallback/dyncall_alloc_wx_win32.c @ 202:030fbb70aa1b

- changed allocwx code: * to introduce a call allowing to switch the written page to be executable (e.g. using mprotect) * changed mmap based code so page is always W^X
author Tassilo Philipp
date Mon, 20 Mar 2017 23:12:58 +0100
parents 3e629dc19168
children f5577f6bf97a
line wrap: on
line diff
--- a/dyncallback/dyncall_alloc_wx_win32.c	Sun Mar 19 20:26:01 2017 +0100
+++ b/dyncallback/dyncall_alloc_wx_win32.c	Mon Mar 20 23:12:58 2017 +0100
@@ -28,7 +28,7 @@
 #include <windows.h>
 #include <assert.h>
 
-int dcAllocWX(size_t size, void** ptr)
+DCerror dcAllocWX(size_t size, void** ptr)
 {
   LPVOID p = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
   if (p == NULL) return -1;
@@ -36,6 +36,11 @@
   return 0;
 }
 
+DCerror dcInitExecWX(void* p, size_t size)
+{
+  return 0;
+}
+
 void dcFreeWX(void* p, size_t size)
 {
   BOOL b = VirtualFree( p, 0, MEM_RELEASE);