In co_MsqPostKeyboardMessage(), do not forget to release lock - this should cure the "blue death" and the "black death" diseases (bug #3995, bug #3997).

svn path=/trunk/; revision=38667
This commit is contained in:
Dmitry Gorbachev 2009-01-09 15:39:28 +00:00
parent 12e91a347c
commit 92d6cc1154

View file

@ -738,12 +738,18 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
LARGE_INTEGER LargeTickCount; LARGE_INTEGER LargeTickCount;
KBDLLHOOKSTRUCT KbdHookData; KBDLLHOOKSTRUCT KbdHookData;
EVENTMSG Event; EVENTMSG Event;
BOOLEAN Entered = FALSE;
DPRINT("MsqPostKeyboardMessage(uMsg 0x%x, wParam 0x%x, lParam 0x%x)\n", DPRINT("MsqPostKeyboardMessage(uMsg 0x%x, wParam 0x%x, lParam 0x%x)\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
// Condition may arise when calling MsqPostMessage and waiting for an event. // Condition may arise when calling MsqPostMessage and waiting for an event.
if (!UserIsEntered()) UserEnterExclusive(); // Fixme: Not sure ATM if this thread is locked. if (!UserIsEntered())
{
// Fixme: Not sure ATM if this thread is locked.
UserEnterExclusive();
Entered = TRUE;
}
FocusMessageQueue = IntGetFocusMessageQueue(); FocusMessageQueue = IntGetFocusMessageQueue();
@ -781,12 +787,14 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
DPRINT("Kbd msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n", DPRINT("Kbd msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n",
Msg.message, Msg.wParam, Msg.lParam); Msg.message, Msg.wParam, Msg.lParam);
if (Entered) UserLeave();
return; return;
} }
if (FocusMessageQueue == NULL) if (FocusMessageQueue == NULL)
{ {
DPRINT("No focus message queue\n"); DPRINT("No focus message queue\n");
if (Entered) UserLeave();
return; return;
} }
@ -805,7 +813,9 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
DPRINT("Invalid focus window handle\n"); DPRINT("Invalid focus window handle\n");
} }
if (UserIsEntered()) UserLeave();
if (Entered) UserLeave();
return;
} }
VOID FASTCALL VOID FASTCALL