Module: wine Branch: master Commit: 1663454c4b1aa0fe11c163d2bb9691a8cb024167 URL: https://gitlab.winehq.org/wine/wine/-/commit/1663454c4b1aa0fe11c163d2bb9691a...
Author: Sven Baars sbaars@codeweavers.com Date: Tue Jul 11 16:22:59 2023 +0200
ntdll/tests: Update some more todos that succeed with the new wow64 architecture.
---
dlls/ntdll/tests/info.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 877978b6b3c..ed3e0360c86 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -37,7 +37,6 @@ static NTSTATUS (WINAPI * pNtMapViewOfSection)(HANDLE,HANDLE,PVOID*,ULONG_PTR,SI static NTSTATUS (WINAPI * pNtUnmapViewOfSection)(HANDLE,PVOID); static NTSTATUS (WINAPI * pNtClose)(HANDLE); static ULONG (WINAPI * pNtGetCurrentProcessorNumber)(void); -static BOOL (WINAPI * pIsWow64Process)(HANDLE, PBOOL); static BOOL (WINAPI * pGetLogicalProcessorInformationEx)(LOGICAL_PROCESSOR_RELATIONSHIP,SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*,DWORD*); static DEP_SYSTEM_POLICY_TYPE (WINAPI * pGetSystemDEPPolicy)(void); static NTSTATUS (WINAPI * pNtOpenThread)(HANDLE *, ACCESS_MASK, const OBJECT_ATTRIBUTES *, const CLIENT_ID *); @@ -49,6 +48,7 @@ static HANDLE (WINAPI * pDbgUiGetThreadDebugObject)(void); static void (WINAPI * pDbgUiSetThreadDebugObject)(HANDLE);
static BOOL is_wow64; +static BOOL old_wow64;
/* one_before_last_pid is used to be able to compare values of a still running process with the output of the test_query_process_times and test_query_process_handlecount tests. @@ -102,8 +102,18 @@ static void InitFunctionPtrs(void) NTDLL_GET_PROC(DbgUiGetThreadDebugObject); NTDLL_GET_PROC(DbgUiSetThreadDebugObject);
- pIsWow64Process = (void *)GetProcAddress(hkernel32, "IsWow64Process"); - if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; + if (!IsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; + + if (is_wow64) + { + TEB64 *teb64 = ULongToPtr( NtCurrentTeb()->GdiBatchCount ); + + if (teb64) + { + PEB64 *peb64 = ULongToPtr(teb64->Peb); + old_wow64 = !peb64->LdrData; + } + }
pGetSystemDEPPolicy = (void *)GetProcAddress(hkernel32, "GetSystemDEPPolicy"); pGetLogicalProcessorInformationEx = (void *) GetProcAddress(hkernel32, "GetLogicalProcessorInformationEx"); @@ -183,7 +193,7 @@ static void test_query_basic(void) (void *)sbi.HighestUserAddress, (void *)sbi2.HighestUserAddress); #else ok( sbi.HighestUserAddress == (void *)0x7ffeffff, "wrong limit %p\n", sbi.HighestUserAddress); - todo_wine_if( is_wow64 ) + todo_wine_if( old_wow64 ) ok( sbi2.HighestUserAddress == (is_wow64 ? (void *)0xfffeffff : (void *)0x7ffeffff), "wrong limit %p\n", sbi.HighestUserAddress); #endif @@ -206,7 +216,7 @@ static void test_query_basic(void) broken(status == STATUS_INVALID_INFO_CLASS) || broken(status == STATUS_NOT_IMPLEMENTED), "failed %lx\n", status ); if (!status || status == STATUS_INFO_LENGTH_MISMATCH) - todo_wine_if( is_wow64 ) + todo_wine_if( old_wow64 ) ok( !status == !is_wow64, "got wrong status %lx wow64 %u\n", status, is_wow64 ); if (!status) {