From 8c88b5115adf28fe14a7a247aa5811900477b1ea Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 17 Mar 2010 10:50:24 +0100 Subject: [PATCH] midimap: Defer initialisation. --- dlls/midimap/midimap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/midimap/midimap.c b/dlls/midimap/midimap.c index 5df8472e68a..833c2f75f71 100644 --- a/dlls/midimap/midimap.c +++ b/dlls/midimap/midimap.c @@ -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; -- 2.11.4.GIT