Commit 14c9f6a3 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

mciavi: Support the MCI_TEST flag.

Some apps send each command twice: first with MCI_TEST, then without. Actually, support is more complex: MCI_TEST acts per flag, not for the whole command, e.g. "status audio source test" fails while "status audio stream test" is supported.
parent 3e5c704e
...@@ -81,6 +81,7 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l ...@@ -81,6 +81,7 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (!(dwFlags & MCI_GETDEVCAPS_ITEM)) return MCIERR_MISSING_PARAMETER; if (!(dwFlags & MCI_GETDEVCAPS_ITEM)) return MCIERR_MISSING_PARAMETER;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -163,7 +164,7 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l ...@@ -163,7 +164,7 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l
break; break;
case MCI_DGV_GETDEVCAPS_CAN_TEST: case MCI_DGV_GETDEVCAPS_CAN_TEST:
TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST !\n"); TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */ lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED; ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_DGV_GETDEVCAPS_PALETTES: case MCI_DGV_GETDEVCAPS_PALETTES:
...@@ -196,6 +197,7 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms) ...@@ -196,6 +197,7 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
if (lpParms == NULL || lpParms->lpstrReturn == NULL) if (lpParms == NULL || lpParms->lpstrReturn == NULL)
return MCIERR_NULL_PARAMETER_BLOCK; return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize); TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize);
...@@ -232,6 +234,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) ...@@ -232,6 +234,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -368,6 +371,7 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpPar ...@@ -368,6 +371,7 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpPar
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
......
...@@ -398,6 +398,7 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms ...@@ -398,6 +398,7 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_DGV_PLAY_REVERSE) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_DGV_PLAY_REVERSE) return MCIERR_UNSUPPORTED_FUNCTION;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -571,6 +572,7 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa ...@@ -571,6 +572,7 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -623,6 +625,7 @@ static DWORD MCIAVI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP ...@@ -623,6 +625,7 @@ static DWORD MCIAVI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -649,6 +652,7 @@ static DWORD MCIAVI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp ...@@ -649,6 +652,7 @@ static DWORD MCIAVI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -677,6 +681,7 @@ static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms ...@@ -677,6 +681,7 @@ static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
...@@ -736,6 +741,7 @@ static DWORD MCIAVI_mciRealize(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l ...@@ -736,6 +741,7 @@ static DWORD MCIAVI_mciRealize(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
return 0; return 0;
} }
...@@ -753,6 +759,7 @@ static DWORD MCIAVI_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS ...@@ -753,6 +759,7 @@ static DWORD MCIAVI_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
/* Ignore MCI_TEST flag. */
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -777,6 +784,7 @@ static DWORD MCIAVI_mciStep(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STEP_PARMS lpP ...@@ -777,6 +784,7 @@ static DWORD MCIAVI_mciStep(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STEP_PARMS lpP
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
...@@ -797,6 +805,7 @@ static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpPar ...@@ -797,6 +805,7 @@ static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpPar
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_DGV_CUE_INPUT) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_DGV_CUE_INPUT) return MCIERR_UNSUPPORTED_FUNCTION;
if (dwFlags & MCI_TEST) return 0;
return 0; return 0;
} }
...@@ -865,6 +874,7 @@ static DWORD MCIAVI_mciConfigure(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS ...@@ -865,6 +874,7 @@ static DWORD MCIAVI_mciConfigure(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS
wma = MCIAVI_mciGetOpenDev(wDevID); wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
return 0; return 0;
} }
......
...@@ -154,6 +154,7 @@ DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms) ...@@ -154,6 +154,7 @@ DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms)
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -211,6 +212,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) ...@@ -211,6 +212,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
/* Ignore MCI_TEST flag. */
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
...@@ -283,6 +285,7 @@ DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpPar ...@@ -283,6 +285,7 @@ DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpPar
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) return 0;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
......
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