Use alertable waits in PeekMessage16 and GetMessage16 so we can

process APCs for 16bit comms.
This commit is contained in:
Mike McCormack 2001-12-26 19:46:40 +00:00 committed by Alexandre Julliard
parent 64295971be
commit 096524c5bf
3 changed files with 9 additions and 0 deletions

View File

@ -568,6 +568,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
COM[port].write_ov.hEvent = CreateEventA(NULL,0,0,NULL); COM[port].write_ov.hEvent = CreateEventA(NULL,0,0,NULL);
comm_waitread( &COM[port] ); comm_waitread( &COM[port] );
USER16_AlertableWait++;
return port; return port;
} }
@ -612,6 +613,7 @@ INT16 WINAPI CloseComm16(INT16 cid)
UnMapLS( COM[cid].seg_unknown ); UnMapLS( COM[cid].seg_unknown );
CloseHandle(COM[cid].read_ov.hEvent); CloseHandle(COM[cid].read_ov.hEvent);
CloseHandle(COM[cid].write_ov.hEvent); CloseHandle(COM[cid].write_ov.hEvent);
USER16_AlertableWait--;
/* free buffers */ /* free buffers */
free(ptr->outbuf); free(ptr->outbuf);

View File

@ -16,6 +16,7 @@
DEFAULT_DEBUG_CHANNEL(msg); DEFAULT_DEBUG_CHANNEL(msg);
DWORD USER16_AlertableWait = 0;
/*********************************************************************** /***********************************************************************
* SendMessage (USER.111) * SendMessage (USER.111)
@ -147,6 +148,8 @@ BOOL16 WINAPI PeekMessage32_16( MSG32_16 *msg16, HWND16 hwnd16,
MSG msg; MSG msg;
HWND hwnd = WIN_Handle32( hwnd16 ); HWND hwnd = WIN_Handle32( hwnd16 );
if(USER16_AlertableWait)
MsgWaitForMultipleObjectsEx( 0, NULL, 1, 0, MWMO_ALERTABLE );
if (!PeekMessageW( &msg, hwnd, first, last, flags )) return FALSE; if (!PeekMessageW( &msg, hwnd, first, last, flags )) return FALSE;
msg16->msg.hwnd = WIN_Handle16( msg.hwnd ); msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
@ -183,6 +186,8 @@ BOOL16 WINAPI GetMessage32_16( MSG32_16 *msg16, HWND16 hwnd16, UINT16 first,
do do
{ {
if(USER16_AlertableWait)
MsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, 0, MWMO_ALERTABLE );
GetMessageW( &msg, hwnd, first, last ); GetMessageW( &msg, hwnd, first, last );
msg16->msg.hwnd = WIN_Handle16( msg.hwnd ); msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
msg16->msg.lParam = msg.lParam; msg16->msg.lParam = msg.lParam;

View File

@ -120,4 +120,6 @@ extern WINE_LOOK TWEAK_WineLook;
/* gray brush cache */ /* gray brush cache */
extern HBRUSH CACHE_GetPattern55AABrush(void); extern HBRUSH CACHE_GetPattern55AABrush(void);
extern DWORD USER16_AlertableWait;
#endif /* __WINE_USER_H */ #endif /* __WINE_USER_H */