kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests.
Sebastian Lackner
sebastian at fds-team.de
Mon Jul 11 17:35:51 CDT 2016
Also enable BeingDebugged PEB tests on x86_64.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
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)
--
2.8.0
More information about the wine-patches
mailing list