dinput/tests: Add some windows.gaming.input device tests.
[wine.git] / dlls / midimap / midimap.c
blob12555f5309a240eb8b3870714e158099a5a434b9
1 /*
2 * Wine MIDI mapper driver
4 * Copyright 1999, 2000, 2001 Eric Pouech
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 * TODO:
21 * notification has to be implemented
22 * IDF file loading
25 #include <stdarg.h>
26 #include <string.h>
27 #include <stdlib.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "mmddk.h"
33 #include "winreg.h"
34 #include "wine/debug.h"
37 * Here's how Windows stores the midiOut mapping information.
39 * Windows XP form (in HKU) is:
41 * [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap]
42 * "szPname"="TiMidity port 0"
43 * (incomplete)
45 * szPname: name of midiOut device to use.
47 * If szPname isn't defined, we use Windows 2000 form (also in HKU):
49 * [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap] 988836060
50 * "AutoScheme"=dword:00000000
51 * "ConfigureCount"=dword:00000004
52 * "CurrentInstrument"="Wine OSS midi"
53 * "CurrentScheme"="epp"
54 * "DriverList"=""
55 * "UseScheme"=dword:00000000
57 * AutoScheme: ?
58 * CurrentInstrument: name of midiOut device to use when UseScheme is 0. Wine uses an extension
59 * of the form #n to link to n'th midiOut device of the system
60 * CurrentScheme: when UseScheme is non null, it's the scheme to use (see below)
61 * DriverList: ?
62 * UseScheme: trigger for simple/complex mapping
64 * A scheme is defined (in HKLM) as:
66 * [System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes\\<nameScheme>]
67 * <nameScheme>: one key for each defined scheme (system wide)
68 * under each one of these <nameScheme> keys, there's:
69 * [...\\<nameScheme>\\<idxDevice>]
70 * "Channels"="<bitMask>"
71 * (the default value of this key also refers to the name of the device).
73 * this defines, for each midiOut device (identified by its index in <idxDevice>), which
74 * channels have to be mapped onto it. The <bitMask> defines the channels (from 0 to 15)
75 * will be mapped (mapping occurs for channel <ch> if bit <ch> is set in <bitMask>
77 * Further mapping information can also be defined in:
78 * [System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Ports\\<nameDevice>\\Instruments\\<idx>]
79 * "Definition"="<.idf file>"
80 * "FriendlyName"="#for .idx file#"
81 * "Port"="<idxPort>"
83 * This last part isn't implemented (.idf file support).
86 WINE_DEFAULT_DEBUG_CHANNEL(midi);
87 WINE_DECLARE_DEBUG_CHANNEL(winediag);
89 typedef struct tagMIDIOUTPORT
91 WCHAR name[MAXPNAMELEN];
92 int loaded;
93 HMIDIOUT hMidi;
94 unsigned short uDevID;
95 LPBYTE lpbPatch;
96 unsigned int aChn[16];
97 } MIDIOUTPORT;
99 typedef struct tagMIDIMAPDATA
101 struct tagMIDIMAPDATA* self;
102 MIDIOUTPORT* ChannelMap[16];
103 MIDIOPENDESC midiDesc;
104 WORD wCbFlags;
105 } MIDIMAPDATA;
107 static MIDIOUTPORT* midiOutPorts;
108 static unsigned numMidiOutPorts;
110 static BOOL MIDIMAP_IsBadData(MIDIMAPDATA* mm)
112 if (!IsBadReadPtr(mm, sizeof(MIDIMAPDATA)) && mm->self == mm)
113 return FALSE;
114 TRACE("Bad midimap data (%p)\n", mm);
115 return TRUE;
118 static BOOL MIDIMAP_FindPort(const WCHAR* name, unsigned* dev)
120 for (*dev = 0; *dev < numMidiOutPorts; (*dev)++)
122 TRACE("%s\n", wine_dbgstr_w(midiOutPorts[*dev].name));
123 if (lstrcmpW(midiOutPorts[*dev].name, name) == 0)
124 return TRUE;
126 /* try the form #nnn */
127 if (*name == '#' && name[1] >= '0' && name[1] <= '9')
129 const WCHAR* ptr = name + 1;
130 *dev = 0;
133 *dev = *dev * 10 + *ptr - '0';
134 ptr++;
135 } while (*ptr >= '0' && *ptr <= '9');
136 if (*dev < numMidiOutPorts)
137 return TRUE;
139 return FALSE;
142 static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA* mom, const WCHAR* port)
144 unsigned i, dev = 0;
146 if (port != NULL && !MIDIMAP_FindPort(port, &dev))
148 ERR("Registry glitch: couldn't find midi out (%s)\n", wine_dbgstr_w(port));
149 dev = 0;
152 /* this is necessary when no midi out ports are present */
153 if (dev >= numMidiOutPorts)
154 return FALSE;
155 /* sets default */
156 for (i = 0; i < 16; i++) mom->ChannelMap[i] = &midiOutPorts[dev];
158 return TRUE;
161 static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const WCHAR* scheme)
163 HKEY hSchemesKey, hKey, hPortKey;
164 unsigned i, idx, dev;
165 WCHAR buffer[256], port[256];
166 DWORD type, size, mask;
168 for (i = 0; i < 16; i++) mom->ChannelMap[i] = NULL;
170 if (RegOpenKeyA(HKEY_LOCAL_MACHINE,
171 "System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes",
172 &hSchemesKey))
174 return FALSE;
176 if (RegOpenKeyW(hSchemesKey, scheme, &hKey))
178 RegCloseKey(hSchemesKey);
179 return FALSE;
182 for (idx = 0; !RegEnumKeyW(hKey, idx, buffer, ARRAY_SIZE(buffer)); idx++)
184 if (RegOpenKeyW(hKey, buffer, &hPortKey)) continue;
186 size = sizeof(port);
187 if (RegQueryValueExW(hPortKey, NULL, 0, &type, (void*)port, &size)) continue;
189 if (!MIDIMAP_FindPort(port, &dev)) continue;
191 size = sizeof(mask);
192 if (RegQueryValueExA(hPortKey, "Channels", 0, &type, (void*)&mask, &size))
193 continue;
195 for (i = 0; i < 16; i++)
197 if (mask & (1 << i))
199 if (mom->ChannelMap[i])
200 ERR("Quirks in registry, channel %u is mapped twice\n", i);
201 mom->ChannelMap[i] = &midiOutPorts[dev];
206 RegCloseKey(hSchemesKey);
207 RegCloseKey(hKey);
209 return TRUE;
212 static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
214 HKEY hKey;
215 BOOL ret;
217 if (RegOpenKeyA(HKEY_CURRENT_USER,
218 "Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap", &hKey))
220 ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
222 else
224 DWORD type, size, out;
225 WCHAR buffer[256];
227 size = sizeof(buffer);
228 if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size))
230 ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
232 else
234 ret = 2;
235 size = sizeof(out);
236 if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
238 size = sizeof(buffer);
239 if (!RegQueryValueExW(hKey, L"CurrentScheme", 0, &type, (void*)buffer, &size))
241 if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
242 ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
244 else
246 ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
249 if (ret == 2)
251 size = sizeof(buffer);
252 if (!RegQueryValueExW(hKey, L"CurrentInstrument", 0, &type, (void*)buffer, &size) && *buffer)
254 ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
256 else
258 ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
263 RegCloseKey(hKey);
265 if (ret && TRACE_ON(midi))
267 unsigned i;
269 for (i = 0; i < 16; i++)
271 TRACE("chnMap[%2d] => %d\n",
272 i, mom->ChannelMap[i] ? mom->ChannelMap[i]->uDevID : -1);
275 return ret;
278 static void MIDIMAP_NotifyClient(MIDIMAPDATA* mom, WORD wMsg,
279 DWORD_PTR dwParam1, DWORD_PTR dwParam2)
281 DriverCallback(mom->midiDesc.dwCallback, mom->wCbFlags, (HDRVR)mom->midiDesc.hMidi,
282 wMsg, mom->midiDesc.dwInstance, dwParam1, dwParam2);
285 static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
287 MIDIMAPDATA* mom = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIMAPDATA));
289 TRACE("(%p %p %08lx)\n", lpdwUser, lpDesc, dwFlags);
291 if (!mom) return MMSYSERR_NOMEM;
292 if (!lpDesc) {
293 HeapFree(GetProcessHeap(), 0, mom);
294 return MMSYSERR_INVALPARAM;
297 if (MIDIMAP_LoadSettings(mom))
299 UINT chn;
300 *lpdwUser = (DWORD_PTR)mom;
301 mom->self = mom;
302 mom->wCbFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
303 mom->midiDesc = *lpDesc;
305 for (chn = 0; chn < 16; chn++)
307 if (mom->ChannelMap[chn]->loaded) continue;
308 if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID,
309 0L, 0L, CALLBACK_NULL) == MMSYSERR_NOERROR)
310 mom->ChannelMap[chn]->loaded = 1;
311 else
312 mom->ChannelMap[chn]->loaded = -1;
313 /* FIXME: should load here the IDF midi data... and allow channel and
314 * patch mappings
317 MIDIMAP_NotifyClient(mom, MOM_OPEN, 0L, 0L);
318 return MMSYSERR_NOERROR;
320 HeapFree(GetProcessHeap(), 0, mom);
321 return MIDIERR_INVALIDSETUP;
324 static DWORD modClose(MIDIMAPDATA* mom)
326 UINT i;
327 DWORD ret = MMSYSERR_NOERROR;
329 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
331 for (i = 0; i < 16; i++)
333 DWORD t;
334 if (mom->ChannelMap[i] && mom->ChannelMap[i]->loaded > 0)
336 t = midiOutClose(mom->ChannelMap[i]->hMidi);
337 if (t == MMSYSERR_NOERROR)
339 mom->ChannelMap[i]->loaded = 0;
340 mom->ChannelMap[i]->hMidi = 0;
342 else if (ret == MMSYSERR_NOERROR)
343 ret = t;
346 if (ret == MMSYSERR_NOERROR) {
347 MIDIMAP_NotifyClient(mom, MOM_CLOSE, 0L, 0L);
348 HeapFree(GetProcessHeap(), 0, mom);
350 return ret;
353 static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
355 WORD chn;
356 DWORD ret = MMSYSERR_NOERROR;
357 MIDIHDR mh;
359 if (MIDIMAP_IsBadData(mom))
360 return MMSYSERR_ERROR;
361 if (!(lpMidiHdr->dwFlags & MHDR_PREPARED))
362 return MIDIERR_UNPREPARED;
363 if (lpMidiHdr->dwFlags & MHDR_INQUEUE)
364 return MIDIERR_STILLPLAYING;
366 mh = *lpMidiHdr;
367 lpMidiHdr->dwFlags &= ~MHDR_DONE;
368 lpMidiHdr->dwFlags |= MHDR_INQUEUE;
369 for (chn = 0; chn < 16; chn++)
371 if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0)
373 mh.dwFlags = 0;
374 midiOutPrepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
375 ret = midiOutLongMsg(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
376 /* As of 2009, wineXYZ.drv's LongData handlers are synchronous */
377 if (!ret && !(mh.dwFlags & MHDR_DONE))
378 FIXME("wait until MHDR_DONE\n");
379 midiOutUnprepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
380 if (ret != MMSYSERR_NOERROR) break;
383 lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
384 lpMidiHdr->dwFlags |= MHDR_DONE;
385 MIDIMAP_NotifyClient(mom, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L);
386 return ret;
389 static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
391 BYTE lb = LOBYTE(LOWORD(dwParam));
392 WORD chn = lb & 0x0F;
393 DWORD ret = MMSYSERR_NOERROR;
395 if (MIDIMAP_IsBadData(mom))
396 return MMSYSERR_ERROR;
398 if (!mom->ChannelMap[chn]) return MMSYSERR_NOERROR;
400 switch (lb & 0xF0)
402 case 0x80:
403 case 0x90:
404 case 0xA0:
405 case 0xB0:
406 case 0xC0:
407 case 0xD0:
408 case 0xE0:
409 if (mom->ChannelMap[chn]->loaded > 0)
411 /* change channel */
412 dwParam &= ~0x0F;
413 dwParam |= mom->ChannelMap[chn]->aChn[chn];
415 if ((LOBYTE(LOWORD(dwParam)) & 0xF0) == 0xC0 /* program change */ &&
416 mom->ChannelMap[chn]->lpbPatch)
418 BYTE patch = HIBYTE(LOWORD(dwParam));
420 /* change patch */
421 dwParam &= ~0x0000FF00;
422 dwParam |= mom->ChannelMap[chn]->lpbPatch[patch];
424 ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam);
426 break;
427 case 0xF0:
428 for (chn = 0; chn < 16; chn++)
430 if (mom->ChannelMap[chn]->loaded > 0)
431 ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam);
433 break;
434 default:
435 FIXME("ooch %Ix\n", dwParam);
438 return ret;
441 static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwSize)
443 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
444 if (dwSize < offsetof(MIDIHDR,dwOffset) || lpMidiHdr == 0 || lpMidiHdr->lpData == 0)
445 return MMSYSERR_INVALPARAM;
446 if (lpMidiHdr->dwFlags & MHDR_PREPARED)
447 return MMSYSERR_NOERROR;
449 lpMidiHdr->dwFlags |= MHDR_PREPARED;
450 lpMidiHdr->dwFlags &= ~(MHDR_DONE|MHDR_INQUEUE); /* flags cleared since w2k */
451 return MMSYSERR_NOERROR;
454 static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwSize)
456 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
457 if (dwSize < offsetof(MIDIHDR,dwOffset) || lpMidiHdr == 0 || lpMidiHdr->lpData == 0)
458 return MMSYSERR_INVALPARAM;
459 if (!(lpMidiHdr->dwFlags & MHDR_PREPARED))
460 return MMSYSERR_NOERROR;
461 if (lpMidiHdr->dwFlags & MHDR_INQUEUE)
462 return MIDIERR_STILLPLAYING;
464 lpMidiHdr->dwFlags &= ~MHDR_PREPARED;
465 return MMSYSERR_NOERROR;
468 static DWORD modGetVolume(MIDIMAPDATA* mom, DWORD* lpdwVolume)
470 if (!lpdwVolume) return MMSYSERR_INVALPARAM;
471 *lpdwVolume = 0xFFFFFFFF; /* tests show this initial value */
472 return MMSYSERR_NOERROR;
475 static DWORD modSetVolume(MIDIMAPDATA* mom, DWORD dwVolume)
477 /* Native forwards it to some underlying device
478 * GetVolume returns what was last set here. */
479 FIXME("stub\n");
480 return MMSYSERR_NOERROR;
483 static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD_PTR size)
485 static const MIDIOUTCAPSW mappercaps = {
486 0x00FF, 0x0001, 0x0100, /* Manufacturer and Product ID */
487 L"Wine midi mapper", MOD_MAPPER, 0, 0, 0xFFFF,
488 /* Native returns volume caps of underlying device + MIDICAPS_STREAM */
489 MIDICAPS_VOLUME|MIDICAPS_LRVOLUME
491 if (lpMidiCaps == NULL) return MMSYSERR_INVALPARAM;
492 if (!numMidiOutPorts) return MMSYSERR_BADDEVICEID;
494 memcpy(lpMidiCaps, &mappercaps, min(size, sizeof(*lpMidiCaps)));
495 return MMSYSERR_NOERROR;
498 static DWORD modReset(MIDIMAPDATA* mom)
500 WORD chn;
501 DWORD ret = MMSYSERR_NOERROR;
503 if (MIDIMAP_IsBadData(mom))
504 return MMSYSERR_ERROR;
506 for (chn = 0; chn < 16; chn++)
508 if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0)
510 ret = midiOutReset(mom->ChannelMap[chn]->hMidi);
511 if (ret != MMSYSERR_NOERROR) break;
514 return ret;
517 static LRESULT MIDIMAP_drvOpen(void);
518 static LRESULT MIDIMAP_drvClose(void);
520 /**************************************************************************
521 * modMessage (MIDIMAP.@)
523 DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
524 DWORD_PTR dwParam1, DWORD_PTR dwParam2)
526 TRACE("(%u, %04X, %08IX, %08IX, %08IX);\n",
527 wDevID, wMsg, dwUser, dwParam1, dwParam2);
529 switch (wMsg)
531 case DRVM_INIT:
532 return MIDIMAP_drvOpen();
533 case DRVM_EXIT:
534 return MIDIMAP_drvClose();
535 case DRVM_ENABLE:
536 case DRVM_DISABLE:
537 /* FIXME: Pretend this is supported */
538 return 0;
540 case MODM_OPEN: return modOpen((DWORD_PTR *)dwUser, (LPMIDIOPENDESC)dwParam1, dwParam2);
541 case MODM_CLOSE: return modClose ((MIDIMAPDATA*)dwUser);
543 case MODM_DATA: return modData ((MIDIMAPDATA*)dwUser, dwParam1);
544 case MODM_LONGDATA: return modLongData ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
545 case MODM_PREPARE: return modPrepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
546 case MODM_UNPREPARE: return modUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
547 case MODM_RESET: return modReset ((MIDIMAPDATA*)dwUser);
549 case MODM_GETDEVCAPS: return modGetDevCaps (wDevID, (MIDIMAPDATA*)dwUser, (LPMIDIOUTCAPSW)dwParam1,dwParam2);
550 case MODM_GETNUMDEVS: return 1;
551 case MODM_GETVOLUME: return modGetVolume ((MIDIMAPDATA*)dwUser, (DWORD*)dwParam1);
552 case MODM_SETVOLUME: return modSetVolume ((MIDIMAPDATA*)dwUser, dwParam1);
553 default:
554 FIXME("unknown message %d!\n", wMsg);
556 return MMSYSERR_NOTSUPPORTED;
559 /*======================================================================*
560 * Driver part *
561 *======================================================================*/
563 /**************************************************************************
564 * MIDIMAP_drvOpen [internal]
566 static LRESULT MIDIMAP_drvOpen(void)
568 MIDIOUTCAPSW moc;
569 unsigned dev, i;
570 BOOL found_valid_port = FALSE;
572 if (midiOutPorts)
573 return 0;
575 numMidiOutPorts = midiOutGetNumDevs();
576 midiOutPorts = HeapAlloc(GetProcessHeap(), 0,
577 numMidiOutPorts * sizeof(MIDIOUTPORT));
578 for (dev = 0; dev < numMidiOutPorts; dev++)
580 if (midiOutGetDevCapsW(dev, &moc, sizeof(moc)) == 0L)
582 lstrcpyW(midiOutPorts[dev].name, moc.szPname);
583 midiOutPorts[dev].loaded = 0;
584 midiOutPorts[dev].hMidi = 0;
585 midiOutPorts[dev].uDevID = dev;
586 midiOutPorts[dev].lpbPatch = NULL;
587 for (i = 0; i < 16; i++)
588 midiOutPorts[dev].aChn[i] = i;
589 if (wcsncmp(midiOutPorts[dev].name, L"Midi Through", lstrlenW(L"Midi Through")) != 0)
590 found_valid_port = TRUE;
592 else
594 midiOutPorts[dev].loaded = -1;
598 if (!found_valid_port)
599 ERR_(winediag)("No software synthesizer midi port found, Midi sound output probably won't work.\n");
601 return 1;
604 /**************************************************************************
605 * MIDIMAP_drvClose [internal]
607 static LRESULT MIDIMAP_drvClose(void)
609 if (midiOutPorts)
611 HeapFree(GetProcessHeap(), 0, midiOutPorts);
612 midiOutPorts = NULL;
613 return 1;
615 return 0;
618 /**************************************************************************
619 * DriverProc (MIDIMAP.@)
621 LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
622 LPARAM dwParam1, LPARAM dwParam2)
624 /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
625 /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
627 switch (wMsg)
629 case DRV_LOAD: return 1;
630 case DRV_FREE: return 1;
631 case DRV_OPEN: return 1;
632 case DRV_CLOSE: return 1;
633 case DRV_ENABLE: return 1;
634 case DRV_DISABLE: return 1;
635 case DRV_QUERYCONFIGURE: return 1;
636 case DRV_CONFIGURE: MessageBoxA(0, "MIDIMAP MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
637 case DRV_INSTALL: return DRVCNF_RESTART;
638 case DRV_REMOVE: return DRVCNF_RESTART;
639 default:
640 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);