Commit fd80a7b7 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

mciqtz32: Stop the device only after param and device checks are done.

parent 7b1b498a
......@@ -99,12 +99,12 @@ static DWORD MCIQTZ_drvClose(DWORD dwDevID)
TRACE("(%04x)\n", dwDevID);
/* finish all outstanding things */
MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) {
/* finish all outstanding things */
MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
HeapFree(GetProcessHeap(), 0, wma);
return 1;
}
......@@ -121,16 +121,15 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
TRACE("(%04x)\n", dwDevID);
MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (!wma)
return 0;
if (wma) {
MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK);
return 1;
}
MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
return 0;
MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK);
return 1;
}
/***************************************************************************
......@@ -144,8 +143,6 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
if (!lpOpenParms)
return MCIERR_NULL_PARAMETER_BLOCK;
......@@ -153,6 +150,8 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (LPVOID*)&wma->pgraph);
......@@ -211,12 +210,12 @@ static DWORD MCIQTZ_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
if (wma->opened) {
IGraphBuilder_Release(wma->pgraph);
IMediaControl_Release(wma->pmctrl);
......@@ -267,8 +266,6 @@ static DWORD MCIQTZ_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
......@@ -276,6 +273,8 @@ static DWORD MCIQTZ_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
if (dwFlags & MCI_SEEK_TO_START) {
newpos = 0;
} else if (dwFlags & MCI_SEEK_TO_END) {
......
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