From f65a37a7d005eee7995c5ae2508398d22a6afa3a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 25 Oct 2014 22:06:13 +0000 Subject: [PATCH] [NtUser] - Do not block sending messages from a dying thread. See CORE-7447. svn path=/trunk/; revision=64999 --- reactos/win32ss/user/ntuser/msgqueue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/win32ss/user/ntuser/msgqueue.c b/reactos/win32ss/user/ntuser/msgqueue.c index 3a7f3b3549f..812c8d1ae62 100644 --- a/reactos/win32ss/user/ntuser/msgqueue.c +++ b/reactos/win32ss/user/ntuser/msgqueue.c @@ -973,8 +973,15 @@ co_MsqSendMessage(PTHREADINFO ptirec, /* Don't send from or to a dying thread */ if (pti->TIF_flags & TIF_INCLEANUP || ptirec->TIF_flags & TIF_INCLEANUP) { + // Unless we are dying and need to tell our parents. + if (pti->TIF_flags & TIF_INCLEANUP && !(ptirec->TIF_flags & TIF_INCLEANUP)) + { + // Parent notify is the big one. Fire and forget! + TRACE("Send message from dying thread %d\n",Msg); + co_MsqSendMessageAsync(ptirec, Wnd, Msg, wParam, lParam, NULL, 0, FALSE, HookMessage); + } if (uResult) *uResult = -1; - ERR("MsqSM: Current pti %lu or Rec pti %lu\n", pti->TIF_flags & TIF_INCLEANUP, ptirec->TIF_flags & TIF_INCLEANUP); + TRACE("MsqSM: Msg %d Current pti %lu or Rec pti %lu\n", Msg, pti->TIF_flags & TIF_INCLEANUP, ptirec->TIF_flags & TIF_INCLEANUP); return STATUS_UNSUCCESSFUL; }