diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 9ed5dfbccfa..1cb0b54292f 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1600,7 +1600,7 @@ @ stdcall WinExec(str long) @ stdcall Wow64EnableWow64FsRedirection(long) @ stdcall Wow64DisableWow64FsRedirection(ptr) -# @ stub Wow64GetThreadContext +@ stdcall Wow64GetThreadContext(long ptr) # @ stub Wow64GetThreadSelectorEntry @ stdcall Wow64RevertWow64FsRedirection(ptr) # @ stub Wow64SetThreadContext diff --git a/dlls/kernel32/thread.c b/dlls/kernel32/thread.c index b6ca9f260f3..5ba3190129e 100644 --- a/dlls/kernel32/thread.c +++ b/dlls/kernel32/thread.c @@ -251,6 +251,24 @@ BOOL WINAPI GetThreadContext( HANDLE handle, /* [in] Handle to thread with } +/*********************************************************************** + * Wow64GetThreadContext [KERNEL32.@] + */ +BOOL WINAPI Wow64GetThreadContext( HANDLE handle, WOW64_CONTEXT *context) +{ +#ifdef __i386__ + NTSTATUS status = NtGetContextThread( handle, (CONTEXT *)context ); +#elif defined(__x86_64__) + NTSTATUS status = RtlWow64GetThreadContext( handle, context ); +#else + NTSTATUS status = STATUS_NOT_IMPLEMENTED; + FIXME("not implemented on this platform\n"); +#endif + if (status) SetLastError( RtlNtStatusToDosError(status) ); + return !status; +} + + /********************************************************************** * SuspendThread [KERNEL32.@] Suspends a thread. * diff --git a/include/winbase.h b/include/winbase.h index 4ddc1d391d2..f7239b8ef98 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2706,6 +2706,7 @@ WINBASEAPI VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE); WINBASEAPI UINT WINAPI WinExec(LPCSTR,UINT); WINBASEAPI BOOL WINAPI Wow64DisableWow64FsRedirection(PVOID*); WINBASEAPI BOOLEAN WINAPI Wow64EnableWow64FsRedirection(BOOLEAN); +WINBASEAPI BOOL WINAPI Wow64GetThreadContext(HANDLE, WOW64_CONTEXT *); WINBASEAPI BOOL WINAPI Wow64RevertWow64FsRedirection(PVOID); WINADVAPI DWORD WINAPI WriteEncryptedFileRaw(PFE_IMPORT_FUNC,PVOID,PVOID); WINBASEAPI BOOL WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED); diff --git a/include/winternl.h b/include/winternl.h index 3ecd068ae35..411f5235e08 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2836,6 +2836,9 @@ NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *); NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*); +#ifdef __x86_64__ +NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *); +#endif NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE); NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);