Commit b26cfe76 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed return values for some messages in DriverProc (MCI_GETDEVCAPS &

MCI_STATUS) for mciSendString.
parent 71c7efac
...@@ -44,7 +44,7 @@ static DWORD AVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) ...@@ -44,7 +44,7 @@ static DWORD AVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wma->wDevID = modp->wDeviceID; wma->wDevID = modp->wDeviceID;
mciSetDriverData(wma->wDevID, (DWORD)wma); mciSetDriverData(wma->wDevID, (DWORD)wma);
modp->wCustomCommandTable = -1; modp->wCustomCommandTable = MCI_NO_COMMAND_TABLE;
modp->wType = MCI_DEVTYPE_SEQUENCER; modp->wType = MCI_DEVTYPE_SEQUENCER;
return modp->wDeviceID; return modp->wDeviceID;
} }
...@@ -354,6 +354,7 @@ static DWORD AVI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParm ...@@ -354,6 +354,7 @@ static DWORD AVI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParm
static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpParms) static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpParms)
{ {
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
DWORD ret = 0;
TRACE("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
...@@ -376,12 +377,14 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA ...@@ -376,12 +377,14 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
break; break;
case MCI_STATUS_MODE: case MCI_STATUS_MODE:
lpParms->dwReturn = wma->wStatus; lpParms->dwReturn = MAKEMCIRESOURCE(wma->wStatus, wma->wStatus);
TRACE("MCI_STATUS_MODE => %lu\n", lpParms->dwReturn); ret = MCI_RESOURCE_RETURNED;
TRACE("MCI_STATUS_MODE => %u\n", LOWORD(lpParms->dwReturn));
break; break;
case MCI_STATUS_MEDIA_PRESENT: case MCI_STATUS_MEDIA_PRESENT:
TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE\n"); TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_STATUS_NUMBER_OF_TRACKS: case MCI_STATUS_NUMBER_OF_TRACKS:
lpParms->dwReturn = 3; lpParms->dwReturn = 3;
...@@ -394,15 +397,18 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA ...@@ -394,15 +397,18 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
(dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
break; break;
case MCI_STATUS_READY: case MCI_STATUS_READY:
lpParms->dwReturn = (wma->wStatus != MCI_MODE_NOT_READY); lpParms->dwReturn = (wma->wStatus == MCI_MODE_NOT_READY) ?
TRACE("MCI_STATUS_READY = %lu\n", lpParms->dwReturn); MAKEMCIRESOURCE(FALSE, MCI_FALSE) : MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
TRACE("MCI_STATUS_READY = %u\n", LOWORD(lpParms->dwReturn));
break; break;
case MCI_STATUS_TIME_FORMAT: case MCI_STATUS_TIME_FORMAT:
lpParms->dwReturn = wma->dwTimeFormat; lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwTimeFormat, wma->dwTimeFormat);
TRACE("MCI_STATUS_TIME_FORMAT => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_TIME_FORMAT => %u\n", LOWORD(lpParms->dwReturn));
ret = MCI_RESOURCE_RETURNED;
break; break;
default: default:
WARN("Unknowm command %08lX !\n", lpParms->dwItem); FIXME("Unknowm command %08lX !\n", lpParms->dwItem);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
} else { } else {
...@@ -415,7 +421,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA ...@@ -415,7 +421,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
wma->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); wma->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return ret;
} }
/*************************************************************************** /***************************************************************************
...@@ -424,6 +430,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA ...@@ -424,6 +430,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
{ {
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
DWORD ret;
TRACE("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
...@@ -434,49 +441,58 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P ...@@ -434,49 +441,58 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P
switch (lpParms->dwItem) { switch (lpParms->dwItem) {
case MCI_GETDEVCAPS_DEVICE_TYPE: case MCI_GETDEVCAPS_DEVICE_TYPE:
TRACE("MCI_GETDEVCAPS_DEVICE_TYPE !\n"); TRACE("MCI_GETDEVCAPS_DEVICE_TYPE !\n");
lpParms->dwReturn = MCI_DEVTYPE_DIGITAL_VIDEO; lpParms->dwReturn = MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO, MCI_DEVTYPE_DIGITAL_VIDEO);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_HAS_AUDIO: case MCI_GETDEVCAPS_HAS_AUDIO:
TRACE("MCI_GETDEVCAPS_HAS_AUDIO !\n"); TRACE("MCI_GETDEVCAPS_HAS_AUDIO !\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_HAS_VIDEO: case MCI_GETDEVCAPS_HAS_VIDEO:
TRACE("MCI_GETDEVCAPS_HAS_VIDEO !\n"); TRACE("MCI_GETDEVCAPS_HAS_VIDEO !\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_USES_FILES: case MCI_GETDEVCAPS_USES_FILES:
TRACE("MCI_GETDEVCAPS_USES_FILES !\n"); TRACE("MCI_GETDEVCAPS_USES_FILES !\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_COMPOUND_DEVICE: case MCI_GETDEVCAPS_COMPOUND_DEVICE:
TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE !\n"); TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_EJECT: case MCI_GETDEVCAPS_CAN_EJECT:
TRACE("MCI_GETDEVCAPS_CAN_EJECT !\n"); TRACE("MCI_GETDEVCAPS_CAN_EJECT !\n");
lpParms->dwReturn = FALSE; lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_PLAY: case MCI_GETDEVCAPS_CAN_PLAY:
TRACE("MCI_GETDEVCAPS_CAN_PLAY !\n"); TRACE("MCI_GETDEVCAPS_CAN_PLAY !\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_RECORD: case MCI_GETDEVCAPS_CAN_RECORD:
TRACE("MCI_GETDEVCAPS_CAN_RECORD !\n"); TRACE("MCI_GETDEVCAPS_CAN_RECORD !\n");
lpParms->dwReturn = FALSE; lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_SAVE: case MCI_GETDEVCAPS_CAN_SAVE:
TRACE("MCI_GETDEVCAPS_CAN_SAVE !\n"); TRACE("MCI_GETDEVCAPS_CAN_SAVE !\n");
lpParms->dwReturn = FALSE; lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break; break;
default: default:
TRACE("Unknown capability (%08lx) !\n", lpParms->dwItem); FIXME("Unknown capability (%08lx) !\n", lpParms->dwItem);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
} else { } else {
TRACE("No GetDevCaps-Item !\n"); WARN("No GetDevCaps-Item !\n");
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
return 0; return ret;
} }
/*************************************************************************** /***************************************************************************
...@@ -484,17 +500,15 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P ...@@ -484,17 +500,15 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P
*/ */
static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms) static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms)
{ {
DWORD ret = 0;
LPSTR str = 0; LPSTR str = 0;
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
TRACE("(%04X, %08lX, %p) : stub;\n", wDevID, dwFlags, lpParms); TRACE("(%04X, %08lX, %p) : stub;\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL || lpParms->lpstrReturn == NULL) { if (lpParms == NULL || lpParms->lpstrReturn == NULL)
ret = MCIERR_NULL_PARAMETER_BLOCK; return MCIERR_NULL_PARAMETER_BLOCK;
} else if (wma == NULL) { if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
ret = MCIERR_INVALID_DEVICE_ID;
} else {
TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
switch (dwFlags) { switch (dwFlags) {
...@@ -513,16 +527,9 @@ static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpP ...@@ -513,16 +527,9 @@ static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpP
#endif #endif
default: default:
WARN("Don't know this info command (%lu)\n", dwFlags); WARN("Don't know this info command (%lu)\n", dwFlags);
ret = MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
}
}
if (str) {
ret = MCI_WriteString(lpParms->lpstrReturn, lpParms->dwRetSize, str);
} else {
lpParms->lpstrReturn[0] = 0;
} }
return MCI_WriteString(lpParms->lpstrReturn, lpParms->dwRetSize, str);
return ret;
} }
/*************************************************************************** /***************************************************************************
...@@ -1018,14 +1025,14 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -1018,14 +1025,14 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case MCI_SPIN: case MCI_SPIN:
case MCI_ESCAPE: case MCI_ESCAPE:
WARN("Unsupported command=%s\n", MCI_CommandToString(wMsg)); WARN("Unsupported command=%s\n", MCI_MessageToString(wMsg));
break; break;
case MCI_OPEN: case MCI_OPEN:
case MCI_CLOSE: case MCI_CLOSE:
FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n"); FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
break; break;
default: default:
TRACE("Sending msg=%s to default driver proc\n", MCI_CommandToString(wMsg)); TRACE("Sending msg=%s to default driver proc\n", MCI_MessageToString(wMsg));
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
} }
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
......
...@@ -60,7 +60,7 @@ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) ...@@ -60,7 +60,7 @@ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wmw->wDevID = modp->wDeviceID; wmw->wDevID = modp->wDeviceID;
mciSetDriverData(wmw->wDevID, (DWORD)wmw); mciSetDriverData(wmw->wDevID, (DWORD)wmw);
modp->wCustomCommandTable = -1; modp->wCustomCommandTable = MCI_NO_COMMAND_TABLE;
modp->wType = MCI_DEVTYPE_WAVEFORM_AUDIO; modp->wType = MCI_DEVTYPE_WAVEFORM_AUDIO;
return modp->wDeviceID; return modp->wDeviceID;
} }
...@@ -94,7 +94,10 @@ static WINE_MCIWAVE* WAVE_mciGetOpenDev(UINT16 wDevID) ...@@ -94,7 +94,10 @@ static WINE_MCIWAVE* WAVE_mciGetOpenDev(UINT16 wDevID)
return wmw; return wmw;
} }
static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val) /**************************************************************************
* WAVE_ConvertByteToTimeFormat [internal]
*/
static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val, LPDWORD lpRet)
{ {
DWORD ret = 0; DWORD ret = 0;
...@@ -112,9 +115,13 @@ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val) ...@@ -112,9 +115,13 @@ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val)
WARN("Bad time format %lu!\n", wmw->dwMciTimeFormat); WARN("Bad time format %lu!\n", wmw->dwMciTimeFormat);
} }
TRACE("val=%lu=0x%08lx [tf=%lu] => ret=%lu\n", val, val, wmw->dwMciTimeFormat, ret); TRACE("val=%lu=0x%08lx [tf=%lu] => ret=%lu\n", val, val, wmw->dwMciTimeFormat, ret);
*lpRet = 0;
return ret; return ret;
} }
/**************************************************************************
* WAVE_ConvertTimeFormatToByte [internal]
*/
static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val) static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val)
{ {
DWORD ret = 0; DWORD ret = 0;
...@@ -136,6 +143,9 @@ static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val) ...@@ -136,6 +143,9 @@ static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val)
return ret; return ret;
} }
/**************************************************************************
* WAVE_mciReadFmt [internal]
*/
static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, MMCKINFO* pckMainRIFF) static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, MMCKINFO* pckMainRIFF)
{ {
MMCKINFO mmckInfo; MMCKINFO mmckInfo;
...@@ -741,6 +751,7 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) ...@@ -741,6 +751,7 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{ {
WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID);
DWORD ret;
TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
...@@ -754,16 +765,18 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP ...@@ -754,16 +765,18 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
break; break;
case MCI_STATUS_LENGTH: case MCI_STATUS_LENGTH:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */ /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw, wmw->dwLength); lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw, wmw->dwLength, &ret);
TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
break; break;
case MCI_STATUS_MODE: case MCI_STATUS_MODE:
lpParms->dwReturn = wmw->dwStatus; TRACE("MCI_STATUS_MODE => %u\n", wmw->dwStatus);
TRACE("MCI_STATUS_MODE => %lu\n", lpParms->dwReturn); lpParms->dwReturn = MAKEMCIRESOURCE(wmw->dwStatus, wmw->dwStatus);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_STATUS_MEDIA_PRESENT: case MCI_STATUS_MEDIA_PRESENT:
TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE!\n"); TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE!\n");
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_STATUS_NUMBER_OF_TRACKS: case MCI_STATUS_NUMBER_OF_TRACKS:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */ /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
...@@ -773,17 +786,21 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP ...@@ -773,17 +786,21 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
case MCI_STATUS_POSITION: case MCI_STATUS_POSITION:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */ /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw, lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw,
(dwFlags & MCI_STATUS_START) ? 0 : wmw->dwPosition); (dwFlags & MCI_STATUS_START) ? 0 : wmw->dwPosition,
&ret);
TRACE("MCI_STATUS_POSITION %s => %lu\n", TRACE("MCI_STATUS_POSITION %s => %lu\n",
(dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
break; break;
case MCI_STATUS_READY: case MCI_STATUS_READY:
lpParms->dwReturn = (wmw->dwStatus != MCI_MODE_NOT_READY); lpParms->dwReturn = (wmw->dwStatus == MCI_MODE_NOT_READY) ?
TRACE("MCI_STATUS_READY => %lu!\n", lpParms->dwReturn); MAKEMCIRESOURCE(FALSE, MCI_FALSE) : MAKEMCIRESOURCE(TRUE, MCI_TRUE);
TRACE("MCI_STATUS_READY => %u!\n", LOWORD(lpParms->dwReturn));
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_STATUS_TIME_FORMAT: case MCI_STATUS_TIME_FORMAT:
lpParms->dwReturn = wmw->dwMciTimeFormat; lpParms->dwReturn = MAKEMCIRESOURCE(wmw->dwMciTimeFormat, wmw->dwMciTimeFormat);
TRACE("MCI_STATUS_TIME_FORMAT => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_TIME_FORMAT => %lu\n", lpParms->dwReturn);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_WAVE_INPUT: case MCI_WAVE_INPUT:
TRACE("MCI_WAVE_INPUT !\n"); TRACE("MCI_WAVE_INPUT !\n");
...@@ -831,7 +848,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP ...@@ -831,7 +848,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
mciDriverNotify16((HWND16)LOWORD(lpParms->dwCallback), mciDriverNotify16((HWND16)LOWORD(lpParms->dwCallback),
wmw->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); wmw->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return ret;
} }
/************************************************************************** /**************************************************************************
...@@ -841,6 +858,7 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, ...@@ -841,6 +858,7 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms) LPMCI_GETDEVCAPS_PARMS lpParms)
{ {
WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID);
DWORD ret = 0;
TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
...@@ -850,31 +868,40 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, ...@@ -850,31 +868,40 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
if (dwFlags & MCI_GETDEVCAPS_ITEM) { if (dwFlags & MCI_GETDEVCAPS_ITEM) {
switch(lpParms->dwItem) { switch(lpParms->dwItem) {
case MCI_GETDEVCAPS_DEVICE_TYPE: case MCI_GETDEVCAPS_DEVICE_TYPE:
lpParms->dwReturn = MCI_DEVTYPE_WAVEFORM_AUDIO; lpParms->dwReturn = MAKEMCIRESOURCE(MCI_DEVTYPE_WAVEFORM_AUDIO, MCI_DEVTYPE_WAVEFORM_AUDIO);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_HAS_AUDIO: case MCI_GETDEVCAPS_HAS_AUDIO:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_HAS_VIDEO: case MCI_GETDEVCAPS_HAS_VIDEO:
lpParms->dwReturn = FALSE; lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_USES_FILES: case MCI_GETDEVCAPS_USES_FILES:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_COMPOUND_DEVICE: case MCI_GETDEVCAPS_COMPOUND_DEVICE:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_RECORD: case MCI_GETDEVCAPS_CAN_RECORD:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_EJECT: case MCI_GETDEVCAPS_CAN_EJECT:
lpParms->dwReturn = FALSE; lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_PLAY: case MCI_GETDEVCAPS_CAN_PLAY:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_GETDEVCAPS_CAN_SAVE: case MCI_GETDEVCAPS_CAN_SAVE:
lpParms->dwReturn = TRUE; lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_WAVE_GETDEVCAPS_INPUTS: case MCI_WAVE_GETDEVCAPS_INPUTS:
lpParms->dwReturn = 1; lpParms->dwReturn = 1;
...@@ -883,11 +910,14 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, ...@@ -883,11 +910,14 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
lpParms->dwReturn = 1; lpParms->dwReturn = 1;
break; break;
default: default:
TRACE("Unknown capability (%08lx) !\n", lpParms->dwItem); FIXME("Unknown capability (%08lx) !\n", lpParms->dwItem);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
} else {
WARN("No GetDevCaps-Item !\n");
return MCIERR_UNRECOGNIZED_COMMAND;
} }
return 0; return ret;
} }
/************************************************************************** /**************************************************************************
...@@ -972,6 +1002,7 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -972,6 +1002,7 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case MCI_GETDEVCAPS: return WAVE_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS) dwParam2); case MCI_GETDEVCAPS: return WAVE_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS) dwParam2);
case MCI_INFO: return WAVE_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMS16) dwParam2); case MCI_INFO: return WAVE_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMS16) dwParam2);
case MCI_SEEK: return WAVE_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); case MCI_SEEK: return WAVE_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2);
/* commands that should be supported */
case MCI_LOAD: case MCI_LOAD:
case MCI_SAVE: case MCI_SAVE:
case MCI_FREEZE: case MCI_FREEZE:
...@@ -980,7 +1011,6 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -980,7 +1011,6 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case MCI_UNFREEZE: case MCI_UNFREEZE:
case MCI_UPDATE: case MCI_UPDATE:
case MCI_WHERE: case MCI_WHERE:
case MCI_WINDOW:
case MCI_STEP: case MCI_STEP:
case MCI_SPIN: case MCI_SPIN:
case MCI_ESCAPE: case MCI_ESCAPE:
...@@ -988,14 +1018,17 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -988,14 +1018,17 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case MCI_CUT: case MCI_CUT:
case MCI_DELETE: case MCI_DELETE:
case MCI_PASTE: case MCI_PASTE:
WARN("Unsupported command=%s\n", MCI_CommandToString(wMsg)); FIXME("Unsupported yet command=%s\n", MCI_MessageToString(wMsg));
break;
case MCI_WINDOW:
TRACE("Unsupported command=%s\n", MCI_MessageToString(wMsg));
break; break;
case MCI_OPEN: case MCI_OPEN:
case MCI_CLOSE: case MCI_CLOSE:
FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n"); ERR("Shouldn't receive a MCI_OPEN or CLOSE message\n");
break; break;
default: default:
FIXME("is probably wrong msg=%s\n", MCI_CommandToString(wMsg)); FIXME("is probably wrong msg=%s\n", MCI_MessageToString(wMsg));
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
} }
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
......
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