[1/5] ntdll: Unify exception function lookup on x86_64.

Sebastian Lackner sebastian at fds-team.de
Sun Apr 6 19:33:29 CDT 2014


This set of patches implements dynamic unwinding functions, required by
several 64-bit applications like Unity3D. This fixes bug:

http://bugs.winehq.org/show_bug.cgi?id=30518

The purpose of the individual patches is:

1) Unify the function lookup on x86_64. This simplifies all the
following steps
2) Implement RtlAddFunctionTable / RtlDeleteFunctionTable
3) Implement RtlInstallFunctionTableCallback
4) Add a bunch of tests for dynamic unwinding functions
5) Forward kernel32.RtlInstallFunctionTableCallback to ntdll

Some design decisions:

* On Windows there is a command RtlGetFunctionTableListHead(), see:
http://msdn.microsoft.com/en-us/library/bb432427(v=vs.85).aspx . This
strongly suggests that MS uses some linked list for storing the entries.
I doubt that any application requires the function table entries to have
exactly the same memory layout, so I decided to use wine/list.h and
create my own equivalent datastructure.

* The following blog article (
http://workblog.pilin.name/2012/10/how-to-get-x64-dynamic-function-table.html
) suggests that MS also uses a very specific critical section (or even
an SRWLock on newer operating systems) to protect the dynamic function
table datastructure. For now I decided to use a CriticalSection because
it doesn't require wineserver calls (at least if the futex syscall is
available) and moreover shows better debugging information in case of
deadlocks.

BTW: Tested only on a VM running Windows 8 (64-Bit). Unfortunately the
testbot is still down ... :(

---
 dlls/ntdll/signal_x86_64.c |  106
+++++++++++++++++++++-----------------------
 1 file changed, 50 insertions(+), 56 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ntdll-Unify-exception-function-lookup-on-x86_64.patch
Type: text/x-patch
Size: 8751 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20140407/e53f573a/attachment.bin>


More information about the wine-patches mailing list