This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
[patch] w32 callbacks w/DEP enabled [ping]
- From: Timothy Wall <twalljava at dev dot java dot net>
- To: libffi-discuss at sourceware dot org
- Date: Thu, 17 Jul 2008 09:30:17 -0400
- Subject: [patch] w32 callbacks w/DEP enabled [ping]
2nd send:
When Data Execution Protection (DEP) is enabled, w32 callback memory
must be allocated via VirtualAlloc, with the execution bit set.
Otherwise access violation exceptions are thrown when the callback
trampoline instructions are executed. I switch some local code over
to ffi_closure_alloc thinking this was working (since the appropriate
code is in dlmalloc already). Turns out none of it is being used, so
I wound up with a bunch of crashing tests.
This patch enables the right bits when building for windows.
I notice that the mmap (vs vanilla malloc) stuff is otherwise only
enabled for linux; it should probably be part of the configury to
detect whether the mmap stuff is required or might be required on a
particular platform.
Attachment:
diff.txt
Description: Text document