Commit 6671ea97 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Added (still incomplete) handling of MCI_BREAK command.

parent 7c0b4c3d
...@@ -100,6 +100,7 @@ extern MCI_MapType MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam); ...@@ -100,6 +100,7 @@ extern MCI_MapType MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam);
extern DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms); extern DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms);
extern DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms); extern DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms);
extern DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms); extern DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms);
extern DWORD MCI_Break(UINT uDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms);
typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD); typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD); typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
......
...@@ -558,7 +558,9 @@ MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD* lP ...@@ -558,7 +558,9 @@ MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD* lP
* MCI_SETAUDIO, MCI_SETTUNER, MCI_SETVIDEO * MCI_SETAUDIO, MCI_SETTUNER, MCI_SETVIDEO
*/ */
switch (wMsg) { switch (wMsg) {
/* case MCI_BREAK: */ case MCI_BREAK:
size = sizeof(MCI_BREAK_PARMS);
break;
/* case MCI_CAPTURE */ /* case MCI_CAPTURE */
case MCI_CLOSE: case MCI_CLOSE:
case MCI_CLOSE_DRIVER: case MCI_CLOSE_DRIVER:
...@@ -832,6 +834,8 @@ MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD l ...@@ -832,6 +834,8 @@ MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD l
DWORD map = 0; DWORD map = 0;
switch (wMsg) { switch (wMsg) {
case MCI_BREAK:
break;
/* case MCI_CAPTURE */ /* case MCI_CAPTURE */
case MCI_CLOSE: case MCI_CLOSE:
case MCI_CLOSE_DRIVER: case MCI_CLOSE_DRIVER:
...@@ -1111,11 +1115,13 @@ DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) ...@@ -1111,11 +1115,13 @@ DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms)
TRACE("(%08lX, %p)\n", dwParam, lpParms); TRACE("(%08lX, %p)\n", dwParam, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if ((dwParam & ~(MCI_OPEN_SHAREABLE|MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)) != 0) { /* only two low bytes are generic, the other ones are dev type specific */
FIXME("Unsupported yet dwFlags=%08lX\n", #define WINE_MCI_SUPP (0xFFFF0000|MCI_OPEN_SHAREABLE|MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)
(dwParam & ~(MCI_OPEN_SHAREABLE|MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT))); if ((dwParam & ~WINE_MCI_SUPP) != 0) {
FIXME("Unsupported yet dwFlags=%08lX\n", dwParam & ~WINE_MCI_SUPP);
} }
#undef WINE_MCI_SUPP
while (MCI_GetDrv(wDevID)->modp.wType != 0) { while (MCI_GetDrv(wDevID)->modp.wType != 0) {
wDevID = MCI_NextDevID(wDevID); wDevID = MCI_NextDevID(wDevID);
...@@ -1357,6 +1363,22 @@ DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms) ...@@ -1357,6 +1363,22 @@ DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms)
return ret; return ret;
} }
/**************************************************************************
* MCI_Break [internal]
*/
DWORD MCI_Break(UINT wDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms)
{
DWORD dwRet = 0;
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (dwFlags & MCI_NOTIFY)
mciDriverNotify16(lpParms->dwCallback, wDevID,
(dwRet == 0) ? MCI_NOTIFY_SUCCESSFUL : MCI_NOTIFY_FAILURE);
return dwRet;
}
struct SCA { struct SCA {
UINT wDevID; UINT wDevID;
UINT wMsg; UINT wMsg;
......
...@@ -1798,6 +1798,10 @@ DWORD WINAPI mciSendCommandA(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwPar ...@@ -1798,6 +1798,10 @@ DWORD WINAPI mciSendCommandA(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwPar
case MCI_SYSINFO: case MCI_SYSINFO:
dwRet = MCI_SysInfo(wDevID, dwParam1, (LPMCI_SYSINFO_PARMSA)dwParam2); dwRet = MCI_SysInfo(wDevID, dwParam1, (LPMCI_SYSINFO_PARMSA)dwParam2);
break; break;
case MCI_BREAK:
dwRet = MCI_Break(wDevID, dwParam1, (LPMCI_BREAK_PARMS)dwParam2);
break;
/* FIXME: it seems that MCI_BREAK and MCI_SOUND need the same handling */
default: default:
if (wDevID == MCI_ALL_DEVICE_ID) { if (wDevID == MCI_ALL_DEVICE_ID) {
FIXME("unhandled MCI_ALL_DEVICE_ID\n"); FIXME("unhandled MCI_ALL_DEVICE_ID\n");
...@@ -1839,7 +1843,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD ...@@ -1839,7 +1843,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD
dwRet = MCI_Open(dwParam1, (LPMCI_OPEN_PARMSA)dwParam2); dwRet = MCI_Open(dwParam1, (LPMCI_OPEN_PARMSA)dwParam2);
MCI_UnMapMsg16To32A(MCI_GetDrv(wDevID)->modp.wType, wMsg, dwParam2); MCI_UnMapMsg16To32A(MCI_GetDrv(wDevID)->modp.wType, wMsg, dwParam2);
break; break;
default: break; /* so that gcc does bark */ default: break; /* so that gcc does not bark */
} }
break; break;
case MCI_CLOSE: case MCI_CLOSE:
...@@ -1855,7 +1859,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD ...@@ -1855,7 +1859,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD
dwRet = MCI_Close(wDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); dwRet = MCI_Close(wDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
MCI_UnMapMsg16To32A(MCI_GetDrv(wDevID)->modp.wType, wMsg, dwParam2); MCI_UnMapMsg16To32A(MCI_GetDrv(wDevID)->modp.wType, wMsg, dwParam2);
break; break;
default: break; /* so that gcc does bark */ default: break; /* so that gcc does not bark */
} }
} }
break; break;
...@@ -1866,9 +1870,20 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD ...@@ -1866,9 +1870,20 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD
dwRet = MCI_SysInfo(wDevID, dwParam1, (LPMCI_SYSINFO_PARMSA)dwParam2); dwRet = MCI_SysInfo(wDevID, dwParam1, (LPMCI_SYSINFO_PARMSA)dwParam2);
MCI_UnMapMsg16To32A(0, wDevID, dwParam2); MCI_UnMapMsg16To32A(0, wDevID, dwParam2);
break; break;
default: break; /* so that gcc does bark */ default: break; /* so that gcc doesnot bark */
}
break;
case MCI_BREAK:
switch (MCI_MapMsg16To32A(0, wDevID, &dwParam2)) {
case MCI_MAP_OK:
case MCI_MAP_OKMEM:
dwRet = MCI_Break(wDevID, dwParam1, (LPMCI_BREAK_PARMS)dwParam2);
MCI_UnMapMsg16To32A(0, wDevID, dwParam2);
break;
default: break; /* so that gcc does not bark */
} }
break; break;
/* FIXME: it seems that MCI_BREAK and MCI_SOUND need the same handling */ /* FIXME: it seems that MCI_BREAK and MCI_SOUND need the same handling */
default: default:
if (wDevID == MCI_ALL_DEVICE_ID) { if (wDevID == MCI_ALL_DEVICE_ID) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment