Sebastian Lackner : kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests.
Alexandre Julliard
julliard at winehq.org
Fri Jul 15 09:07:04 CDT 2016
Module: wine
Branch: master
Commit: 4e0edaac1fa82272821a8d8e9ad96e4601e8e4b2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e0edaac1fa82272821a8d8e9ad96e4601e8e4b2
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Tue Jul 12 00:35:51 2016 +0200
kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests.
Also enable BeingDebugged PEB tests on x86_64.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 73320c6..82faf3f 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)
More information about the wine-cvs
mailing list