Dmitry Timoshkov : server: Set error to STATUS_UNSUCCESSFUL when the server fails to queue APC for a thread.
Alexandre Julliard
julliard at winehq.org
Mon Jun 7 15:02:06 CDT 2021
Module: wine
Branch: stable
Commit: b66571e730e137d3989737542b5971cc9112adf6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b66571e730e137d3989737542b5971cc9112adf6
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Mar 3 12:27:47 2021 +0300
server: Set error to STATUS_UNSUCCESSFUL when the server fails to queue APC for a thread.
I've left another case of returning STATUS_PROCESS_IS_TERMINATING since
that's not covered by the tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50704
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 050dc49b3850a9cf807d995c2c8e8c3f244b9f11)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/kernel32/tests/sync.c | 2 --
server/thread.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c
index 7d6ac030299..f1c5f01fa84 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -2737,13 +2737,11 @@ static void test_QueueUserAPC(void)
ok(ret == WAIT_OBJECT_0, "got %u\n", ret);
ret = pNtQueueApcThread(thread, call_user_apc, (ULONG_PTR)user_apc, 0, 0);
-todo_wine
ok(ret == STATUS_UNSUCCESSFUL, "got %#x\n", ret);
SetLastError(0xdeadbeef);
ret = QueueUserAPC(user_apc, thread, 0);
ok(!ret, "QueueUserAPC should fail\n");
-todo_wine
ok(GetLastError() == ERROR_GEN_FAILURE, "got %u\n", GetLastError());
CloseHandle(thread);
diff --git a/server/thread.c b/server/thread.c
index 942a8ff8389..1e32ef8e1fc 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1750,7 +1750,7 @@ DECL_HANDLER(queue_apc)
if (thread)
{
- if (!queue_apc( NULL, thread, apc )) set_error( STATUS_THREAD_IS_TERMINATING );
+ if (!queue_apc( NULL, thread, apc )) set_error( STATUS_UNSUCCESSFUL );
release_object( thread );
}
else if (process)
More information about the wine-cvs
mailing list