Commit 9dd1eaab authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll/tests: Return early if ThreadHideFromDebugger isn't supported.

We're not testing anything interesting in this case. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 519f86d5
......@@ -2367,19 +2367,20 @@ static void test_HideFromDebugger(void)
dummy = 0;
status = NtQueryInformationThread( GetCurrentThread(), ThreadHideFromDebugger, &dummy, sizeof(ULONG), NULL );
if (status == STATUS_INVALID_INFO_CLASS)
win_skip("ThreadHideFromDebugger not available\n");
else
{
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
dummy = 0;
status = NtQueryInformationThread( (HANDLE)0xdeadbeef, ThreadHideFromDebugger, &dummy, sizeof(ULONG), NULL );
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
dummy = 0;
status = NtQueryInformationThread( GetCurrentThread(), ThreadHideFromDebugger, &dummy, 1, NULL );
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
if (status == STATUS_SUCCESS) ok( dummy == 1, "Expected dummy == 1, got %08x\n", dummy );
win_skip("ThreadHideFromDebugger not available\n");
return;
}
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
dummy = 0;
status = NtQueryInformationThread( (HANDLE)0xdeadbeef, ThreadHideFromDebugger, &dummy, sizeof(ULONG), NULL );
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
dummy = 0;
status = NtQueryInformationThread( GetCurrentThread(), ThreadHideFromDebugger, &dummy, 1, NULL );
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
ok( dummy == 1, "Expected dummy == 1, got %08x\n", dummy );
stop_event = CreateEventA( NULL, FALSE, FALSE, NULL );
ok( stop_event != NULL, "CreateEvent failed\n" );
thread = CreateThread( NULL, 0, hide_from_debugger_thread, stop_event, 0, NULL );
......@@ -2387,18 +2388,16 @@ static void test_HideFromDebugger(void)
dummy = 0;
status = NtQueryInformationThread( thread, ThreadHideFromDebugger, &dummy, 1, NULL );
ok( status == STATUS_SUCCESS || status == STATUS_INVALID_INFO_CLASS,
"Expected STATUS_SUCCESS, got %08x\n", status );
if (status == STATUS_SUCCESS) ok( dummy == 0, "Expected dummy == 0, got %08x\n", dummy );
ok( status == STATUS_SUCCESS, "got %#x\n", status );
ok( dummy == 0, "Expected dummy == 0, got %08x\n", dummy );
status = pNtSetInformationThread( thread, ThreadHideFromDebugger, NULL, 0 );
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
dummy = 0;
status = NtQueryInformationThread( thread, ThreadHideFromDebugger, &dummy, 1, NULL );
ok( status == STATUS_SUCCESS || status == STATUS_INVALID_INFO_CLASS,
"Expected STATUS_SUCCESS, got %08x\n", status );
if (status == STATUS_SUCCESS) ok( dummy == 1, "Expected dummy == 1, got %08x\n", dummy );
ok( status == STATUS_SUCCESS, "got %#x\n", status );
ok( dummy == 1, "Expected dummy == 1, got %08x\n", dummy );
SetEvent( stop_event );
WaitForSingleObject( thread, INFINITE );
......
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