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

mciqtz32: Move MCIQTZ_mciGetOpenDev at the top and always use it.

parent fcceb61f
...@@ -54,6 +54,20 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) ...@@ -54,6 +54,20 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
} }
/************************************************************************** /**************************************************************************
* MCIQTZ_mciGetOpenDev [internal]
*/
static WINE_MCIQTZ* MCIQTZ_mciGetOpenDev(UINT wDevID)
{
WINE_MCIQTZ* wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
if (!wma) {
WARN("Invalid wDevID=%u\n", wDevID);
return NULL;
}
return wma;
}
/**************************************************************************
* MCIQTZ_drvOpen [internal] * MCIQTZ_drvOpen [internal]
*/ */
static DWORD MCIQTZ_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp) static DWORD MCIQTZ_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
...@@ -88,7 +102,7 @@ static DWORD MCIQTZ_drvClose(DWORD dwDevID) ...@@ -88,7 +102,7 @@ static DWORD MCIQTZ_drvClose(DWORD dwDevID)
/* finish all outstanding things */ /* finish all outstanding things */
MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL); MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID); wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) { if (wma) {
HeapFree(GetProcessHeap(), 0, wma); HeapFree(GetProcessHeap(), 0, wma);
...@@ -109,7 +123,7 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID) ...@@ -109,7 +123,7 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL); MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID); wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) { if (wma) {
MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK); MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK);
...@@ -119,20 +133,6 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID) ...@@ -119,20 +133,6 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
return 0; return 0;
} }
/**************************************************************************
* MCIQTZ_mciGetOpenDev [internal]
*/
static WINE_MCIQTZ* MCIQTZ_mciGetOpenDev(UINT wDevID)
{
WINE_MCIQTZ* wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
if (!wma) {
WARN("Invalid wDevID=%u\n", wDevID);
return 0;
}
return wma;
}
/*************************************************************************** /***************************************************************************
* MCIQTZ_mciOpen [internal] * MCIQTZ_mciOpen [internal]
*/ */
...@@ -149,7 +149,7 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags, ...@@ -149,7 +149,7 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
if (!lpOpenParms) if (!lpOpenParms)
return MCIERR_NULL_PARAMETER_BLOCK; return MCIERR_NULL_PARAMETER_BLOCK;
wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_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