Alexandre Julliard : ntdll: Implemented RtlCaptureContext.
Alexandre Julliard
julliard at winehq.org
Thu Dec 4 09:02:28 CST 2008
Module: wine
Branch: master
Commit: 31a641aa5942939b4fd79801bccd8bc16cb08fbd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=31a641aa5942939b4fd79801bccd8bc16cb08fbd
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Dec 4 12:23:13 2008 +0100
ntdll: Implemented RtlCaptureContext.
---
dlls/kernel32/kernel32.spec | 2 +-
dlls/ntdll/exception.c | 24 ++++++++++++++++++++++--
dlls/ntdll/ntdll.spec | 2 +-
include/winnt.h | 2 ++
4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 808635d..8100b92 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -920,7 +920,7 @@
@ stdcall ResetWriteWatch(ptr long)
@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error
@ stdcall ResumeThread(long)
-# @ stub RtlCaptureContext ( -> ntdll.RtlCaptureContext)
+@ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext
# @ stub RtlCaptureStackBackTrace ( -> ntdll.RtlCaptureStackBackTrace)
@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory
@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory
diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c
index 8aa906e..0c8ecda 100644
--- a/dlls/ntdll/exception.c
+++ b/dlls/ntdll/exception.c
@@ -381,6 +381,26 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
}
/***********************************************************************
+ * RtlCaptureContext (NTDLL.@)
+ */
+void WINAPI __regs_RtlCaptureContext( CONTEXT *context_out, CONTEXT *context_in )
+{
+ *context_out = *context_in;
+}
+
+/**********************************************************************/
+
+#ifdef DEFINE_REGS_ENTRYPOINT
+DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 4, 4 )
+#else
+void WINAPI RtlCaptureContext( CONTEXT *context_out )
+{
+ memset( context_out, 0, sizeof(*context_out) );
+}
+#endif
+
+
+/***********************************************************************
* RtlRaiseException (NTDLL.@)
*/
void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
@@ -405,7 +425,7 @@ DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 4, 4 )
void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
{
CONTEXT context;
- memset( &context, 0, sizeof(context) );
+ RtlCaptureContext( &context );
__regs_RtlRaiseException( rec, &context );
}
#endif
@@ -498,7 +518,7 @@ void WINAPI RtlUnwind( PVOID pEndFrame, PVOID unusedEip,
PEXCEPTION_RECORD pRecord, PVOID returnEax )
{
CONTEXT context;
- memset( &context, 0, sizeof(context) );
+ RtlCaptureContext( &context );
__regs_RtlUnwind( pEndFrame, unusedEip, pRecord, returnEax, &context );
}
#endif
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 006b1fe..c94f2fb 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -433,7 +433,7 @@
# @ stub RtlAssert2
@ stdcall RtlAssert(ptr ptr long long)
# @ stub RtlCancelTimer
-# @ stub RtlCaptureContext
+@ stdcall -register RtlCaptureContext(ptr)
@ stub RtlCaptureStackBackTrace
# @ stub RtlCaptureStackContext
@ stdcall RtlCharToInteger(ptr long ptr)
diff --git a/include/winnt.h b/include/winnt.h
index 90c4d3b..d8a5019 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -1454,6 +1454,8 @@ typedef struct _CONTEXT
typedef CONTEXT *PCONTEXT;
+NTSYSAPI void WINAPI RtlCaptureContext(CONTEXT*);
+
/*
* Language IDs
*/
More information about the wine-cvs
mailing list