[PATCH 0/1] MR9612: ntdll/tests: Dynamically load RtlIsProcessorFeaturePresent.
This is to make the ntdll tests getting started at older Windows versions. [See test pattern page](https://test.winehq.org/data/patterns.html#ntdll:atom) [This is a testbot run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=161106) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9612
From: Bernhard Übelacker <bernhardu(a)mailbox.org> --- dlls/ntdll/tests/info.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 7d2a4d520b8..c56345b867a 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -57,6 +57,7 @@ static NTSTATUS (WINAPI * pDbgUiConvertStateChangeStructure)(DBGUI_WAIT_STATE_CH static HANDLE (WINAPI * pDbgUiGetThreadDebugObject)(void); static void (WINAPI * pDbgUiSetThreadDebugObject)(HANDLE); static NTSTATUS (WINAPI * pNtSystemDebugControl)(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG); +static BOOLEAN (WINAPI * pRtlIsProcessorFeaturePresent)(UINT); static BOOL is_wow64; static BOOL old_wow64; @@ -114,6 +115,7 @@ static void InitFunctionPtrs(void) NTDLL_GET_PROC(DbgUiGetThreadDebugObject); NTDLL_GET_PROC(DbgUiSetThreadDebugObject); NTDLL_GET_PROC(NtSystemDebugControl); + NTDLL_GET_PROC(RtlIsProcessorFeaturePresent); if (!IsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; @@ -424,9 +426,9 @@ static void test_query_cpu(void) ok( len == sizeof(bits), "wrong len %lu\n", len ); for (int i = 0; i < len * 8; i++) - ok( !!(bits[i / 64] & (1ull << (i % 64))) == RtlIsProcessorFeaturePresent( i + PROCESSOR_FEATURE_MAX ), + ok( !!(bits[i / 64] & (1ull << (i % 64))) == pRtlIsProcessorFeaturePresent( i + PROCESSOR_FEATURE_MAX ), "wrong feature %u: should be %u\n", i + PROCESSOR_FEATURE_MAX, - RtlIsProcessorFeaturePresent( i + PROCESSOR_FEATURE_MAX ) ); + pRtlIsProcessorFeaturePresent( i + PROCESSOR_FEATURE_MAX ) ); status = pNtQuerySystemInformation( SystemProcessorFeaturesBitMapInformation, bits, sizeof(bits) - 1, &len ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9612
participants (1)
-
Bernhard Übelacker