Commit 055c883e authored by Alexandre Julliard's avatar Alexandre Julliard

server: Fix the status code for get/set_thread_context on a terminated thread.

parent 5dc9c73c
......@@ -955,6 +955,22 @@ static void test_SetThreadContext(void)
WaitForSingleObject( thread, INFINITE );
ok( test_value == 20, "test_value %d instead of 20\n", test_value );
ctx.ContextFlags = CONTEXT_FULL;
SetLastError(0xdeadbeef);
ret = GetThreadContext( thread, &ctx );
ok( !ret, "GetThreadContext succeeded\n" );
ok( GetLastError() == ERROR_GEN_FAILURE || broken(GetLastError() == ERROR_INVALID_HANDLE), /* win2k */
"wrong error %u\n", GetLastError() );
SetLastError(0xdeadbeef);
ret = SetThreadContext( thread, &ctx );
ok( !ret, "SetThreadContext succeeded\n" );
ok( GetLastError() == ERROR_GEN_FAILURE || GetLastError() == ERROR_ACCESS_DENIED ||
broken(GetLastError() == ERROR_INVALID_HANDLE), /* win2k */
"wrong error %u\n", GetLastError() );
CloseHandle( thread );
}
#endif /* __i386__ */
......
......@@ -1493,7 +1493,7 @@ DECL_HANDLER(get_thread_context)
suspend_thread( thread );
}
}
else set_error( STATUS_ACCESS_DENIED );
else set_error( STATUS_UNSUCCESSFUL );
}
else if ((context = set_reply_data_size( sizeof(context_t) )))
{
......@@ -1535,7 +1535,7 @@ DECL_HANDLER(set_thread_context)
suspend_thread( thread );
}
}
else set_error( STATUS_ACCESS_DENIED );
else set_error( STATUS_UNSUCCESSFUL );
}
else if (context->cpu == thread->process->cpu)
{
......
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