From 76d922983d1f9eb12da1576ca6706ca7f4914eab Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 16 May 2023 20:21:09 +0200 Subject: [PATCH] dbghelp/tests: Fix process kind detection on old Windows machines. Signed-off-by: Eric Pouech --- dlls/dbghelp/tests/dbghelp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/dbghelp/tests/dbghelp.c b/dlls/dbghelp/tests/dbghelp.c index 276faf0101a..f45516c2882 100644 --- a/dlls/dbghelp/tests/dbghelp.c +++ b/dlls/dbghelp/tests/dbghelp.c @@ -571,12 +571,14 @@ static enum process_kind get_process_kind_internal(HANDLE process) { USHORT m1, m2; - if (!pIsWow64Process2) + if (!pIsWow64Process2) /* only happens on old Win 8 and early win 1064v1507 */ { BOOL is_wow64; - return is_win64 ? PCSKIND_64BIT : - IsWow64Process(process, &is_wow64) && is_wow64 ? PCSKIND_WOW64 : - PCSKIND_32BIT; + + if (!strcmp(winetest_platform, "wine") || !IsWow64Process(process, &is_wow64)) + return PCSKIND_ERROR; + if (is_wow64) return PCSKIND_WOW64; + return is_win64 ? PCSKIND_64BIT : PCSKIND_32BIT; } if (!pIsWow64Process2(process, &m1, &m2)) return PCSKIND_ERROR; if (m1 == IMAGE_FILE_MACHINE_UNKNOWN && get_machine_bitness(m2) == 32) return PCSKIND_32BIT; -- 2.11.4.GIT