Module: wine Branch: master Commit: 2d3b6d03fe911b3ab278634f6683a72d146e6848 URL: https://gitlab.winehq.org/wine/wine/-/commit/2d3b6d03fe911b3ab278634f6683a72...
Author: Eric Pouech eric.pouech@gmail.com Date: Wed Mar 8 11:43:22 2023 +0100
dbghelp/tests: Better use global variables.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
---
dlls/dbghelp/tests/dbghelp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/dbghelp/tests/dbghelp.c b/dlls/dbghelp/tests/dbghelp.c index f68ca8281de..07dfe6fbf6e 100644 --- a/dlls/dbghelp/tests/dbghelp.c +++ b/dlls/dbghelp/tests/dbghelp.c @@ -29,6 +29,8 @@ static const BOOL is_win64 = sizeof(void*) > sizeof(int); static WCHAR system_directory[MAX_PATH]; static WCHAR wow64_directory[MAX_PATH];
+static BOOL (*WINAPI pIsWow64Process2)(HANDLE, USHORT*, USHORT*); + #if defined(__i386__) || defined(__x86_64__)
static DWORD CALLBACK stack_walk_thread(void *arg) @@ -564,13 +566,8 @@ enum process_kind
static enum process_kind get_process_kind(HANDLE process) { - HMODULE mod; USHORT m1, m2; - BOOL (WINAPI *pIsWow64Process2)(HANDLE,USHORT*,USHORT*); - const BOOL is_win64 = sizeof(void*) == 8;
- mod = GetModuleHandleA("kernel32"); - pIsWow64Process2 = (void*)GetProcAddress(mod, "IsWow64Process2"); if (!pIsWow64Process2) { BOOL is_wow64; @@ -820,6 +817,8 @@ START_TEST(dbghelp) SetEnvironmentVariableA("_NT_SYMBOL_PATH", NULL); SetEnvironmentVariableA("_NT_ALT_SYMBOL_PATH", NULL);
+ pIsWow64Process2 = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process2"); + ret = SymInitialize(GetCurrentProcess(), NULL, TRUE); ok(ret, "got error %lu\n", GetLastError());