winmm: Use PeekMessageW instead of UserYield.
This commit is contained in:
parent
910f331f8a
commit
9a43c410f9
@ -2131,37 +2131,21 @@ UINT WINAPI mciGetDeviceIDW(LPCWSTR lpwstrName)
|
|||||||
return MCI_GetDriverFromString(lpwstrName);
|
return MCI_GetDriverFromString(lpwstrName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* MyUserYield
|
|
||||||
*
|
|
||||||
* Internal wrapper to call USER.UserYield16 (in fact through a Wine only export from USER32).
|
|
||||||
*/
|
|
||||||
static void MyUserYield(void)
|
|
||||||
{
|
|
||||||
HMODULE mod = GetModuleHandleA( "user32.dll" );
|
|
||||||
if (mod)
|
|
||||||
{
|
|
||||||
FARPROC proc = GetProcAddress( mod, "UserYield16" );
|
|
||||||
if (proc) proc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* MCI_DefYieldProc [internal]
|
* MCI_DefYieldProc [internal]
|
||||||
*/
|
*/
|
||||||
static UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data)
|
static UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data)
|
||||||
{
|
{
|
||||||
INT16 ret;
|
INT16 ret;
|
||||||
|
MSG msg;
|
||||||
|
|
||||||
TRACE("(0x%04x, 0x%08x)\n", wDevID, data);
|
TRACE("(0x%04x, 0x%08x)\n", wDevID, data);
|
||||||
|
|
||||||
if ((HIWORD(data) != 0 && HWND_16(GetActiveWindow()) != HIWORD(data)) ||
|
if ((HIWORD(data) != 0 && HWND_16(GetActiveWindow()) != HIWORD(data)) ||
|
||||||
(GetAsyncKeyState(LOWORD(data)) & 1) == 0) {
|
(GetAsyncKeyState(LOWORD(data)) & 1) == 0) {
|
||||||
MyUserYield();
|
PeekMessageW(&msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
MSG msg;
|
|
||||||
|
|
||||||
msg.hwnd = HWND_32(HIWORD(data));
|
msg.hwnd = HWND_32(HIWORD(data));
|
||||||
while (!PeekMessageW(&msg, msg.hwnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE));
|
while (!PeekMessageW(&msg, msg.hwnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@ -2263,7 +2247,8 @@ UINT WINAPI mciDriverYield(MCIDEVICEID uDeviceID)
|
|||||||
TRACE("(%04x)\n", uDeviceID);
|
TRACE("(%04x)\n", uDeviceID);
|
||||||
|
|
||||||
if (!(wmd = MCI_GetDriver(uDeviceID)) || !wmd->lpfnYieldProc) {
|
if (!(wmd = MCI_GetDriver(uDeviceID)) || !wmd->lpfnYieldProc) {
|
||||||
MyUserYield();
|
MSG msg;
|
||||||
|
PeekMessageW(&msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE);
|
||||||
} else {
|
} else {
|
||||||
ret = wmd->lpfnYieldProc(uDeviceID, wmd->dwYieldData);
|
ret = wmd->lpfnYieldProc(uDeviceID, wmd->dwYieldData);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user