diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index d1ac61795e1..5c3d99e99a7 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -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"); } diff --git a/server/thread.c b/server/thread.c index 4929b4ab707..0c496db7103 100644 --- a/server/thread.c +++ b/server/thread.c @@ -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 ); } }