QueueUserAPC() should set GetLastError() to return ERROR_GEN_FAILURE in the unlikely but inevitable circumstance it's called on a thread set to STATUS_THREAD_IS_TERMINATING. It currenly returns ERROR_ACCESS_DENIED which is unexpected behavior.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50704 Signed-off-by: David Koolhoven david@koolhoven-home.net --- dlls/ntdll/error.c | 2 +- dlls/ntdll/make_errors | 2 +- dlls/ntdll/tests/error.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/error.c b/dlls/ntdll/error.c index fb630fa9864..3b6b2ecdebe 100644 --- a/dlls/ntdll/error.c +++ b/dlls/ntdll/error.c @@ -475,7 +475,7 @@ static const DWORD error_map[1579] = ERROR_INVALID_PARAMETER, /* c0000048 (STATUS_PORT_ALREADY_SET) */ ERROR_INVALID_PARAMETER, /* c0000049 (STATUS_SECTION_NOT_IMAGE) */ ERROR_SIGNAL_REFUSED, /* c000004a (STATUS_SUSPEND_COUNT_EXCEEDED) */ - ERROR_ACCESS_DENIED, /* c000004b (STATUS_THREAD_IS_TERMINATING) */ + ERROR_GEN_FAILURE, /* c000004b (STATUS_THREAD_IS_TERMINATING) */ ERROR_INVALID_PARAMETER, /* c000004c (STATUS_BAD_WORKING_SET_LIMIT) */ ERROR_INVALID_PARAMETER, /* c000004d (STATUS_INCOMPATIBLE_FILE_MAP) */ ERROR_INVALID_PARAMETER, /* c000004e (STATUS_SECTION_PROTECTION) */ diff --git a/dlls/ntdll/make_errors b/dlls/ntdll/make_errors index bedce57fe7a..b7a2a346e5c 100755 --- a/dlls/ntdll/make_errors +++ b/dlls/ntdll/make_errors @@ -307,7 +307,7 @@ my %error_map = qw( STATUS_PORT_ALREADY_SET ERROR_INVALID_PARAMETER STATUS_SECTION_NOT_IMAGE ERROR_INVALID_PARAMETER STATUS_SUSPEND_COUNT_EXCEEDED ERROR_SIGNAL_REFUSED - STATUS_THREAD_IS_TERMINATING ERROR_ACCESS_DENIED + STATUS_THREAD_IS_TERMINATING ERROR_GEN_FAILURE STATUS_BAD_WORKING_SET_LIMIT ERROR_INVALID_PARAMETER STATUS_INCOMPATIBLE_FILE_MAP ERROR_INVALID_PARAMETER STATUS_SECTION_PROTECTION ERROR_INVALID_PARAMETER diff --git a/dlls/ntdll/tests/error.c b/dlls/ntdll/tests/error.c index 05ba22223e3..d9ef1791848 100644 --- a/dlls/ntdll/tests/error.c +++ b/dlls/ntdll/tests/error.c @@ -268,7 +268,7 @@ static void run_error_tests(void) cmp2(STATUS_THREAD_WAS_SUSPENDED, ERROR_THREAD_WAS_SUSPENDED); cmp2(STATUS_TOO_MANY_THREADS, ERROR_TOO_MANY_THREADS); cmp2(STATUS_THREAD_NOT_IN_PROCESS, ERROR_THREAD_NOT_IN_PROCESS); - cmp(STATUS_THREAD_IS_TERMINATING, ERROR_ACCESS_DENIED); + cmp(STATUS_THREAD_IS_TERMINATING, ERROR_GEN_FAILURE); cmp(STATUS_PROCESS_IS_TERMINATING, ERROR_ACCESS_DENIED); cmp2(STATUS_SYSTEM_PROCESS_TERMINATED, ERROR_SYSTEM_PROCESS_TERMINATED); cmp(STATUS_INVALID_LOCK_SEQUENCE, ERROR_ACCESS_DENIED);