[PATCH 13/16] midimap: Defer initialization
Maarten Lankhorst
m.b.lankhorst at gmail.com
Wed Mar 17 04:50:24 CDT 2010
---
dlls/midimap/midimap.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/midimap/midimap.c b/dlls/midimap/midimap.c
index 5df8472..833c2f7 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;
--
1.7.0
--------------000405090506010104050502--
More information about the wine-patches
mailing list