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

This commit is contained in:
Christian Costa 2009-04-23 00:03:52 +02:00 committed by Alexandre Julliard
parent fcceb61fd0
commit aa9550e689
1 changed files with 17 additions and 17 deletions

View File

@ -53,6 +53,20 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
return TRUE;
}
/**************************************************************************
* 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]
*/
@ -88,7 +102,7 @@ static DWORD MCIQTZ_drvClose(DWORD dwDevID)
/* finish all outstanding things */
MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID);
wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) {
HeapFree(GetProcessHeap(), 0, wma);
@ -109,7 +123,7 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID);
wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) {
MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK);
@ -119,20 +133,6 @@ static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
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]
*/
@ -149,7 +149,7 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
if (!lpOpenParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma)
return MCIERR_INVALID_DEVICE_ID;