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

mciavi: First check inputs, then (perhaps) stop and act.

parent 403a820e
......@@ -217,8 +217,6 @@ static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags,
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpOpenParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = (WINE_MCIAVI *)mciGetDriverData(wDevID);
......@@ -300,8 +298,6 @@ DWORD MCIAVI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
......@@ -676,13 +672,13 @@ static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_SEEK_TO_START) {
......@@ -718,13 +714,13 @@ static DWORD MCIAVI_mciLoad(UINT wDevID, DWORD dwFlags, LPMCI_DGV_LOAD_PARMSW lp
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
return 0;
}
......@@ -737,8 +733,6 @@ static DWORD MCIAVI_mciRealize(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......@@ -780,13 +774,13 @@ static DWORD MCIAVI_mciStep(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STEP_PARMS lpP
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
return 0;
}
......@@ -799,8 +793,6 @@ static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpPar
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......@@ -818,8 +810,6 @@ static DWORD MCIAVI_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_P
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......@@ -837,8 +827,6 @@ static DWORD MCIAVI_mciSignal(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SIGNAL_PARMS
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......@@ -856,8 +844,6 @@ static DWORD MCIAVI_mciSetVideo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETVIDEO_P
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......@@ -875,8 +861,6 @@ static DWORD MCIAVI_mciConfigure(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS
FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms);
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
......
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