Suspend the window locks before DefKeybEventProc and

DefMouseEventProc.
This commit is contained in:
Francois Boisvert 1999-04-03 16:27:53 +00:00 committed by Alexandre Julliard
parent 8de3ba8f6e
commit 7d7fe7c121
2 changed files with 10 additions and 0 deletions

View File

@ -79,6 +79,7 @@ void KEYBOARD_SendEvent( BYTE bVk, BYTE bScan, DWORD dwFlags,
DWORD posX, DWORD posY, DWORD time )
{
WINE_KEYBDEVENT wke;
int iWndsLocks;
if ( !DefKeybEventProc ) return;
@ -89,7 +90,11 @@ void KEYBOARD_SendEvent( BYTE bVk, BYTE bScan, DWORD dwFlags,
wke.posY = posY;
wke.time = time;
/* To avoid deadlocks, we have to suspend all locks on windows structures
before the program control is passed to the keyboard driver */
iWndsLocks = WIN_SuspendWndsLock();
DefKeybEventProc( bVk, bScan, dwFlags, (DWORD)&wke );
WIN_RestoreWndsLock(iWndsLocks);
}
/**********************************************************************

View File

@ -58,6 +58,7 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
{
int width = MONITOR_GetWidth (&MONITOR_PrimaryMonitor);
int height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
int iWndsLocks;
WINE_MOUSEEVENT wme;
BOOL bOldWarpPointer;
@ -75,6 +76,10 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
wme.hWnd = hWnd;
bOldWarpPointer = MOUSE_Driver->pEnableWarpPointer(FALSE);
/* To avoid deadlocks, we have to suspend all locks on windows structures
before the program control is passed to the mouse driver */
iWndsLocks = WIN_SuspendWndsLock();
DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
WIN_RestoreWndsLock(iWndsLocks);
MOUSE_Driver->pEnableWarpPointer(bOldWarpPointer);
}