midimap: Defer initialisation.

This commit is contained in:
Maarten Lankhorst 2010-03-17 10:50:24 +01:00 committed by Alexandre Julliard
parent d790530df3
commit 8c88b5115a
1 changed files with 9 additions and 4 deletions

View File

@ -495,6 +495,9 @@ static DWORD modReset(MIDIMAPDATA* mom)
return ret;
}
static LRESULT MIDIMAP_drvOpen(void);
static LRESULT MIDIMAP_drvClose(void);
/**************************************************************************
* modMessage (MIDIMAP.@)
*/
@ -507,7 +510,9 @@ DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
switch (wMsg)
{
case DRVM_INIT:
return MIDIMAP_drvOpen();
case DRVM_EXIT:
return MIDIMAP_drvClose();
case DRVM_ENABLE:
case DRVM_DISABLE:
/* FIXME: Pretend this is supported */
@ -539,7 +544,7 @@ DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
/**************************************************************************
* MIDIMAP_drvOpen [internal]
*/
static LRESULT MIDIMAP_drvOpen(LPSTR str)
static LRESULT MIDIMAP_drvOpen(void)
{
MIDIOUTCAPSW moc;
unsigned dev, i;
@ -574,7 +579,7 @@ static LRESULT MIDIMAP_drvOpen(LPSTR str)
/**************************************************************************
* MIDIMAP_drvClose [internal]
*/
static LRESULT MIDIMAP_drvClose(DWORD_PTR dwDevID)
static LRESULT MIDIMAP_drvClose(void)
{
if (midiOutPorts)
{
@ -598,8 +603,8 @@ LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
{
case DRV_LOAD: return 1;
case DRV_FREE: return 1;
case DRV_OPEN: return MIDIMAP_drvOpen((LPSTR)dwParam1);
case DRV_CLOSE: return MIDIMAP_drvClose(dwDevID);
case DRV_OPEN: return 1;
case DRV_CLOSE: return 1;
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;