Commit ff870e01 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

server: Calling ResumeThread() on a terminated thread is valid.

parent 9a70306c
......@@ -450,6 +450,7 @@ static VOID test_CreateThread_suspended(void)
{
HANDLE thread;
DWORD threadId;
DWORD suspend_count;
int error;
thread = CreateThread(NULL,0,threadFunc2,NULL,
......@@ -471,6 +472,13 @@ static VOID test_CreateThread_suspended(void)
if(error!=WAIT_OBJECT_0) {
TerminateThread(thread,1);
}
suspend_count = SuspendThread(thread);
ok(suspend_count == -1, "SuspendThread returned %d, expected -1\n", suspend_count);
suspend_count = ResumeThread(thread);
ok(suspend_count == 0, "ResumeThread returned %d, expected 0\n", suspend_count);
ok(CloseHandle(thread)!=0,"CloseHandle failed\n");
}
......
......@@ -1160,8 +1160,7 @@ DECL_HANDLER(resume_thread)
if ((thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME )))
{
if (thread->state == TERMINATED) set_error( STATUS_ACCESS_DENIED );
else reply->count = resume_thread( thread );
reply->count = resume_thread( thread );
release_object( thread );
}
}
......
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