mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
mciseq: Refactor use of mciGetDriverData.
This commit is contained in:
parent
39fa94324d
commit
3ae829d11b
1 changed files with 3 additions and 4 deletions
|
@ -196,11 +196,11 @@ static DWORD MIDI_drvClose(DWORD dwDevID)
|
|||
/**************************************************************************
|
||||
* MIDI_mciGetOpenDev [internal]
|
||||
*/
|
||||
static WINE_MCIMIDI* MIDI_mciGetOpenDev(UINT wDevID)
|
||||
static WINE_MCIMIDI* MIDI_mciGetOpenDev(MCIDEVICEID wDevID, UINT wMsg)
|
||||
{
|
||||
WINE_MCIMIDI* wmm = (WINE_MCIMIDI*)mciGetDriverData(wDevID);
|
||||
|
||||
if (wmm == NULL || wmm->nUseCount == 0) {
|
||||
if (wmm == NULL || ((wmm->nUseCount == 0) ^ (wMsg == MCI_OPEN_DRIVER))) {
|
||||
WARN("Invalid wDevID=%u\n", wDevID);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1600,8 +1600,7 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
|||
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||
}
|
||||
|
||||
wmm = (wMsg == MCI_OPEN_DRIVER) ?
|
||||
(WINE_MCIMIDI*)mciGetDriverData(dwDevID) : MIDI_mciGetOpenDev(dwDevID);
|
||||
wmm = MIDI_mciGetOpenDev(dwDevID, wMsg);
|
||||
if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID;
|
||||
|
||||
switch (wMsg) {
|
||||
|
|
Loading…
Reference in a new issue