From 14c452fe787deceb3776d205d7be867421a59fe1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 6 Jan 2009 17:50:34 +0100 Subject: [PATCH] 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 029891866ec..607d0e22f39 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 831e0fc9086..dc121f57068 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 32c39f3c7f2..154366436f8 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 4fa44e76c34..c790f845cf7 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 4c1463399f5..54165eefbce 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 35c9f1b6e81..8e9dd7c1e23 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 51b190a121f..7d4675acd89 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__