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

Also enable BeingDebugged PEB tests on x86_64.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-07-12 00:35:51 +02:00 committed by Alexandre Julliard
parent 5dc2626ba4
commit 4e0edaac1f
1 changed files with 7 additions and 13 deletions

View File

@ -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)