From 4e0edaac1fa82272821a8d8e9ad96e4601e8e4b2 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 12 Jul 2016 00:35:51 +0200 Subject: [PATCH] kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests. Also enable BeingDebugged PEB tests on x86_64. Signed-off-by: Sebastian Lackner Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/debugger.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 73320c6859d..82faf3fd4d2 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -39,7 +39,6 @@ static BOOL (WINAPI *pCheckRemoteDebuggerPresent)(HANDLE,PBOOL); static BOOL (WINAPI *pDebugActiveProcessStop)(DWORD); static BOOL (WINAPI *pDebugSetProcessKillOnExit)(BOOL); static BOOL (WINAPI *pIsDebuggerPresent)(void); -static struct _TEB * (WINAPI *pNtCurrentTeb)(void); static LONG child_failures; @@ -579,18 +578,15 @@ static void doChild(int argc, char **argv) child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); child_ok(debug, "Expected debug != 0, got %#x.\n", debug); - if (pNtCurrentTeb) - { - pNtCurrentTeb()->Peb->BeingDebugged = FALSE; + NtCurrentTeb()->Peb->BeingDebugged = FALSE; - ret = pIsDebuggerPresent(); - child_ok(!ret, "Expected ret != 0, got %#x.\n", ret); - ret = pCheckRemoteDebuggerPresent(GetCurrentProcess(), &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); - child_ok(debug, "Expected debug != 0, got %#x.\n", debug); + ret = pIsDebuggerPresent(); + child_ok(!ret, "Expected ret != 0, got %#x.\n", ret); + ret = pCheckRemoteDebuggerPresent(GetCurrentProcess(), &debug); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(debug, "Expected debug != 0, got %#x.\n", debug); - pNtCurrentTeb()->Peb->BeingDebugged = TRUE; - } + NtCurrentTeb()->Peb->BeingDebugged = TRUE; blackbox.failures = child_failures; save_blackbox(blackbox_file, &blackbox, sizeof(blackbox)); @@ -815,8 +811,6 @@ START_TEST(debugger) pDebugActiveProcessStop=(void*)GetProcAddress(hdll, "DebugActiveProcessStop"); pDebugSetProcessKillOnExit=(void*)GetProcAddress(hdll, "DebugSetProcessKillOnExit"); pIsDebuggerPresent=(void*)GetProcAddress(hdll, "IsDebuggerPresent"); - hdll=GetModuleHandleA("ntdll.dll"); - if (hdll) pNtCurrentTeb = (void*)GetProcAddress(hdll, "NtCurrentTeb"); myARGC=winetest_get_mainargs(&myARGV); if (myARGC >= 3 && strcmp(myARGV[2], "crash") == 0)