History

Add x64 SEH decls. Add exports to kernel32.def

Vlad Vissoultchev committed 10 years ago

Commit d715ebd1 parent 95aac212 files · +68 −0Browse files

Unified · Split

2 files
  1. win32/include/winapi/winnt.h +65 −0
  2. win32/lib/kernel32.def +3 −0
win32/include/winapi/winnt.h+65−0
@@ -1966,6 +1966,66 @@ typedef DWORD LCID; · 1965 unmodified lines
19661966 PEXCEPTION_RECORD ExceptionRecord;
19671967 PCONTEXT ContextRecord;
19681968 } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS;
1969+
1970+#ifdef __x86_64__
1971+
1972+ typedef EXCEPTION_DISPOSITION NTAPI EXCEPTION_ROUTINE (struct _EXCEPTION_RECORD *ExceptionRecord, PVOID EstablisherFrame, struct _CONTEXT *ContextRecord, PVOID DispatcherContext);
1973+#ifndef __PEXCEPTION_ROUTINE_DEFINED
1974+#define __PEXCEPTION_ROUTINE_DEFINED
1975+ typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;
1976+#endif
1977+
1978+ /* http://msdn.microsoft.com/en-us/library/ms680597(VS.85).aspx */
1979+
1980+#define UNWIND_HISTORY_TABLE_SIZE 12
1981+
1982+ typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
1983+ ULONG64 ImageBase;
1984+ PRUNTIME_FUNCTION FunctionEntry;
1985+ } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
1986+
1987+#define UNWIND_HISTORY_TABLE_NONE 0
1988+#define UNWIND_HISTORY_TABLE_GLOBAL 1
1989+#define UNWIND_HISTORY_TABLE_LOCAL 2
1990+
1991+ typedef struct _UNWIND_HISTORY_TABLE {
1992+ ULONG Count;
1993+ UCHAR Search;
1994+ ULONG64 LowAddress;
1995+ ULONG64 HighAddress;
1996+ UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
1997+ } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
1998+
1999+ /* http://msdn.microsoft.com/en-us/library/b6sf5kbd(VS.80).aspx */
2000+
2001+ struct _DISPATCHER_CONTEXT;
2002+ typedef struct _DISPATCHER_CONTEXT DISPATCHER_CONTEXT;
2003+ typedef struct _DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT;
2004+
2005+ struct _DISPATCHER_CONTEXT {
2006+ ULONG64 ControlPc;
2007+ ULONG64 ImageBase;
2008+ PRUNTIME_FUNCTION FunctionEntry;
2009+ ULONG64 EstablisherFrame;
2010+ ULONG64 TargetIp;
2011+ PCONTEXT ContextRecord;
2012+ PEXCEPTION_ROUTINE LanguageHandler;
2013+ PVOID HandlerData;
2014+ /* http://www.nynaeve.net/?p=99 */
2015+ PUNWIND_HISTORY_TABLE HistoryTable;
2016+ ULONG ScopeIndex;
2017+ ULONG Fill0;
2018+ };
2019+
2020+ /* http://msdn.microsoft.com/en-us/library/ms680617(VS.85).aspx */
2021+
2022+ typedef struct _KNONVOLATILE_CONTEXT_POINTERS
2023+ {
2024+ PM128A FloatingContext[16];
2025+ PULONG64 IntegerContext[16];
2026+ } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
2027+#endif /* defined(__x86_64__) */
2028+
19692029 typedef PVOID PACCESS_TOKEN;
19702030 typedef PVOID PSECURITY_DESCRIPTOR;
19712031 typedef PVOID PSID;
@@ -4877,6 +4937,11 @@ typedef DWORD LCID; · 2905 unmodified lines
48774937 } IMAGE_COR20_HEADER,*PIMAGE_COR20_HEADER;
48784938 #endif
48794939
4940+#if defined (__x86_64__)
4941+ NTSYSAPI PRUNTIME_FUNCTION NTAPI RtlLookupFunctionEntry (DWORD64 ControlPc, PDWORD64 ImageBase, PUNWIND_HISTORY_TABLE HistoryTable);
4942+ NTSYSAPI VOID NTAPI RtlUnwindEx (PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable);
4943+#endif
4944+
48804945 #include <string.h>
48814946
48824947 #ifndef _SLIST_HEADER_
win32/lib/kernel32.def+3−0
@@ -288,6 +288,8 @@ GetModuleFileNameA · 287 unmodified lines
288288 GetModuleFileNameW
289289 GetModuleHandleA
290290 GetModuleHandleW
291+GetModuleHandleExA
292+GetModuleHandleExW
291293 GetNamedPipeHandleStateA
292294 GetNamedPipeHandleStateW
293295 GetNamedPipeInfo
@@ -554,6 +556,7 @@ RtlFillMemory · 260 unmodified lines
554556 RtlInstallFunctionTableCallback
555557 RtlMoveMemory
556558 RtlUnwind
559+RtlUnwindEx
557560 RtlZeroMemory
558561 SMapLS
559562 SMapLS_IP_EBP_12