ntdll: Implement RtlWow64GetCurrentCpuArea().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-06-30 11:16:01 +02:00
parent c9d23a15ce
commit 17716bc7f3
3 changed files with 20 additions and 0 deletions

View File

@ -1075,6 +1075,7 @@
@ stdcall RtlWow64EnableFsRedirection(long)
@ stdcall RtlWow64EnableFsRedirectionEx(long ptr)
@ stdcall -arch=win64 RtlWow64GetCpuAreaInfo(ptr long ptr)
@ stdcall -arch=win64 RtlWow64GetCurrentCpuArea(ptr ptr ptr)
@ stdcall RtlWow64GetCurrentMachine()
@ stdcall RtlWow64GetProcessMachines(long ptr ptr)
@ stdcall -arch=win64 RtlWow64GetThreadContext(long ptr)

View File

@ -143,6 +143,24 @@ NTSTATUS WINAPI RtlWow64GetCpuAreaInfo( WOW64_CPURESERVED *cpu, ULONG reserved,
}
/**********************************************************************
* RtlWow64GetCurrentCpuArea (NTDLL.@)
*/
NTSTATUS WINAPI RtlWow64GetCurrentCpuArea( USHORT *machine, void **context, void **context_ex )
{
WOW64_CPU_AREA_INFO info;
NTSTATUS status;
if (!(status = RtlWow64GetCpuAreaInfo( NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED], 0, &info )))
{
if (machine) *machine = info.Machine;
if (context) *context = info.Context;
if (context_ex) *context_ex = *(void **)info.ContextEx;
}
return status;
}
/******************************************************************************
* RtlWow64GetThreadContext (NTDLL.@)
*/

View File

@ -4404,6 +4404,7 @@ NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t);
#ifdef _WIN64
NTSYSAPI NTSTATUS WINAPI RtlWow64GetCpuAreaInfo(WOW64_CPURESERVED*,ULONG,WOW64_CPU_AREA_INFO*);
NTSYSAPI NTSTATUS WINAPI RtlWow64GetCurrentCpuArea(USHORT*,void**,void**);
NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE,WOW64_CONTEXT*);
NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*);
#else