Alexandre Julliard : ntdll: Replaced get_cpu_context by RtlCaptureContext. Implemented it for x86_64.

Alexandre Julliard julliard at winehq.org
Wed Jan 7 10:56:50 CST 2009


Module: wine
Branch: master
Commit: 14c452fe787deceb3776d205d7be867421a59fe1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=14c452fe787deceb3776d205d7be867421a59fe1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan  6 17:50:34 2009 +0100

ntdll: Replaced get_cpu_context by RtlCaptureContext. Implemented it for x86_64.

---

 dlls/ntdll/exception.c      |   19 -------------------
 dlls/ntdll/ntdll_misc.h     |    1 -
 dlls/ntdll/signal_i386.c    |    8 +++-----
 dlls/ntdll/signal_powerpc.c |    7 +++----
 dlls/ntdll/signal_sparc.c   |    7 +++----
 dlls/ntdll/signal_x86_64.c  |    9 ++++-----
 dlls/ntdll/thread.c         |    2 +-
 7 files changed, 14 insertions(+), 39 deletions(-)

diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c
index 0298918..607d0e2 100644
--- a/dlls/ntdll/exception.c
+++ b/dlls/ntdll/exception.c
@@ -400,25 +400,6 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
     return status;
 }
 
-/***********************************************************************
- *		RtlCaptureContext (NTDLL.@)
- */
-void WINAPI __regs_RtlCaptureContext( CONTEXT *context_out, CONTEXT *context_in )
-{
-    *context_out = *context_in;
-}
-
-/**********************************************************************/
-
-#ifdef DEFINE_REGS_ENTRYPOINT
-DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 )
-#else
-void WINAPI RtlCaptureContext( CONTEXT *context_out )
-{
-    memset( context_out, 0, sizeof(*context_out) );
-}
-#endif
-
 
 /***********************************************************************
  *		RtlRaiseException (NTDLL.@)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 831e0fc..dc121f5 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -41,7 +41,6 @@ struct drive_info
 /* exceptions */
 extern void wait_suspend( CONTEXT *context );
 extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
-extern void get_cpu_context( CONTEXT *context );
 extern void set_cpu_context( const CONTEXT *context );
 
 /* debug helper */
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 32c39f3..1543664 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -886,17 +886,15 @@ static inline void restore_context( const CONTEXT *context, SIGCONTEXT *sigconte
 
 
 /***********************************************************************
- *              get_cpu_context
- *
- * Register function to get the context of the current thread.
+ *		RtlCaptureContext (NTDLL.@)
  */
-void WINAPI __regs_get_cpu_context( CONTEXT *context, CONTEXT *regs )
+void WINAPI __regs_RtlCaptureContext( CONTEXT *context, CONTEXT *regs )
 {
     *context = *regs;
     if (fpux_support) save_fpux( context );
     else save_fpu( context );
 }
-DEFINE_REGS_ENTRYPOINT( get_cpu_context, 1 )
+DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 )
 
 
 /***********************************************************************
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
index 4fa44e7..c790f84 100644
--- a/dlls/ntdll/signal_powerpc.c
+++ b/dlls/ntdll/signal_powerpc.c
@@ -268,13 +268,12 @@ static inline void restore_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext )
 
 
 /***********************************************************************
- *              get_cpu_context
- *
- * Get the context of the current thread.
+ *		RtlCaptureContext (NTDLL.@)
  */
-void get_cpu_context( CONTEXT *context )
+void WINAPI RtlCaptureContext( CONTEXT *context )
 {
     FIXME("not implemented\n");
+    memset( context, 0, sizeof(*context) );
 }
 
 
diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c
index 4c14633..54165ee 100644
--- a/dlls/ntdll/signal_sparc.c
+++ b/dlls/ntdll/signal_sparc.c
@@ -149,13 +149,12 @@ static void restore_fpu( CONTEXT *context, ucontext_t *ucontext )
 
 
 /***********************************************************************
- *              get_cpu_context
- *
- * Get the context of the current thread.
+ *		RtlCaptureContext (NTDLL.@)
  */
-void get_cpu_context( CONTEXT *context )
+void WINAPI RtlCaptureContext( CONTEXT *context )
 {
     FIXME("not implemented\n");
+    memset( context, 0, sizeof(*context) );
 }
 
 
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 35c9f1b..8e9dd7c 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -199,14 +199,13 @@ static void restore_context( const CONTEXT *context, SIGCONTEXT *sigcontext )
 
 
 /***********************************************************************
- *              get_cpu_context
- *
- * Get the context of the current thread.
+ *		RtlCaptureContext (NTDLL.@)
  */
-void get_cpu_context( CONTEXT *context )
+void WINAPI __regs_RtlCaptureContext( CONTEXT *context, CONTEXT *regs )
 {
-    FIXME("not implemented\n");
+    *context = *regs;
 }
+DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 )
 
 
 /***********************************************************************
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 51b190a..7d4675a 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -1134,7 +1134,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
     {
         if (needed_flags)
         {
-            get_cpu_context( &ctx );
+            RtlCaptureContext( &ctx );
             copy_context( context, &ctx, ctx.ContextFlags & needed_flags );
         }
 #ifdef __i386__




More information about the wine-cvs mailing list