Skip to content
Snippets Groups Projects
Commit 096524c5 authored by Michael McCormack's avatar Michael McCormack Committed by Alexandre Julliard
Browse files

Use alertable waits in PeekMessage16 and GetMessage16 so we can

process APCs for 16bit comms.
parent 64295971
No related branches found
No related tags found
No related merge requests found
......@@ -568,6 +568,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
COM[port].write_ov.hEvent = CreateEventA(NULL,0,0,NULL);
comm_waitread( &COM[port] );
USER16_AlertableWait++;
return port;
}
......@@ -612,6 +613,7 @@ INT16 WINAPI CloseComm16(INT16 cid)
UnMapLS( COM[cid].seg_unknown );
CloseHandle(COM[cid].read_ov.hEvent);
CloseHandle(COM[cid].write_ov.hEvent);
USER16_AlertableWait--;
/* free buffers */
free(ptr->outbuf);
......
......@@ -16,6 +16,7 @@
DEFAULT_DEBUG_CHANNEL(msg);
DWORD USER16_AlertableWait = 0;
/***********************************************************************
* SendMessage (USER.111)
......@@ -147,6 +148,8 @@ BOOL16 WINAPI PeekMessage32_16( MSG32_16 *msg16, HWND16 hwnd16,
MSG msg;
HWND hwnd = WIN_Handle32( hwnd16 );
if(USER16_AlertableWait)
MsgWaitForMultipleObjectsEx( 0, NULL, 1, 0, MWMO_ALERTABLE );
if (!PeekMessageW( &msg, hwnd, first, last, flags )) return FALSE;
msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
......@@ -183,6 +186,8 @@ BOOL16 WINAPI GetMessage32_16( MSG32_16 *msg16, HWND16 hwnd16, UINT16 first,
do
{
if(USER16_AlertableWait)
MsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, 0, MWMO_ALERTABLE );
GetMessageW( &msg, hwnd, first, last );
msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
msg16->msg.lParam = msg.lParam;
......
......@@ -120,4 +120,6 @@ extern WINE_LOOK TWEAK_WineLook;
/* gray brush cache */
extern HBRUSH CACHE_GetPattern55AABrush(void);
extern DWORD USER16_AlertableWait;
#endif /* __WINE_USER_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment