Commit 4e0edaac authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests.

Also enable BeingDebugged PEB tests on x86_64. Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 5dc2626b
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment