From 096524c5bfa825cd2c3b6c7433cb4e748bf13d36 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 26 Dec 2001 19:46:40 +0000 Subject: [PATCH] Use alertable waits in PeekMessage16 and GetMessage16 so we can process APCs for 16bit comms. --- dlls/user/comm16.c | 2 ++ dlls/user/msg16.c | 5 +++++ include/user.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/dlls/user/comm16.c b/dlls/user/comm16.c index eaefe9efae6..1be95461ce1 100644 --- a/dlls/user/comm16.c +++ b/dlls/user/comm16.c @@ -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); diff --git a/dlls/user/msg16.c b/dlls/user/msg16.c index c0873a8602b..a57e3df585b 100644 --- a/dlls/user/msg16.c +++ b/dlls/user/msg16.c @@ -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; diff --git a/include/user.h b/include/user.h index 512fef0f5a4..55bdd6393f1 100644 --- a/include/user.h +++ b/include/user.h @@ -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 */