ReactOS 0.4.16-dev-306-g647d351
midimap.c
Go to the documentation of this file.
1/* -*- tab-width: 8; c-basic-offset: 4 -*- */
2/*
3 * Wine MIDI mapper driver
4 *
5 * Copyright 1999, 2000, 2001 Eric Pouech
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 * TODO:
22 * notification has to be implemented
23 * IDF file loading
24 */
25
26#include <stdarg.h>
27//#include <string.h>
28//#include <stdlib.h>
29//#include <ctype.h>
30#include <windef.h>
31//#include "winbase.h"
32//#include "wingdi.h"
33#include <winuser.h>
34#include <mmddk.h>
35#include <winreg.h>
36#include <wine/unicode.h>
37#include <wine/debug.h>
38
39/*
40 * Here's how Windows stores the midiOut mapping information.
41 *
42 * Full form (in HKU) is:
43 *
44 * [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap] 988836060
45 * "AutoScheme"=dword:00000000
46 * "ConfigureCount"=dword:00000004
47 * "CurrentInstrument"="Wine OSS midi"
48 * "CurrentScheme"="epp"
49 * "DriverList"=""
50 * "UseScheme"=dword:00000000
51 *
52 * AutoScheme: ?
53 * CurrentInstrument: name of midiOut device to use when UseScheme is 0. Wine uses an extension
54 * of the form #n to link to n'th midiOut device of the system
55 * CurrentScheme: when UseScheme is non null, it's the scheme to use (see below)
56 * DriverList: ?
57 * UseScheme: trigger for simple/complex mapping
58 *
59 * A scheme is defined (in HKLM) as:
60 *
61 * [System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes\<nameScheme>]
62 * <nameScheme>: one key for each defined scheme (system wide)
63 * under each one of these <nameScheme> keys, there's:
64 * [...\<nameScheme>\<idxDevice>]
65 * "Channels"="<bitMask>"
66 * (the default value of this key also refers to the name of the device).
67 *
68 * this defines, for each midiOut device (identified by its index in <idxDevice>), which
69 * channels have to be mapped onto it. The <bitMask> defines the channels (from 0 to 15)
70 * will be mapped (mapping occurs for channel <ch> if bit <ch> is set in <bitMask>
71 *
72 * Further mapping information can also be defined in:
73 * [System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Ports\<nameDevice>\\Instruments\<idx>]
74 * "Definition"="<.idf file>"
75 * "FriendlyName"="#for .idx file#"
76 * "Port"="<idxPort>"
77 *
78 * This last part isn't implemented (.idf file support).
79 */
80
82
83typedef struct tagMIDIOUTPORT
84{
86 int loaded;
87 HMIDIOUT hMidi;
88 unsigned short uDevID;
90 unsigned int aChn[16];
92
93typedef struct tagMIDIMAPDATA
94{
98
100static unsigned numMidiOutPorts;
101
103{
104 if (!IsBadReadPtr(mm, sizeof(MIDIMAPDATA)) && mm->self == mm)
105 return FALSE;
106 TRACE("Bad midimap data (%p)\n", mm);
107 return TRUE;
108}
109
110static BOOL MIDIMAP_FindPort(const WCHAR* name, unsigned* dev)
111{
112 for (*dev = 0; *dev < numMidiOutPorts; (*dev)++)
113 {
115 if (strcmpW(midiOutPorts[*dev].name, name) == 0)
116 return TRUE;
117 }
118 /* try the form #nnn */
119 if (*name == '#' && isdigit(name[1]))
120 {
121 const WCHAR* ptr = name + 1;
122 *dev = 0;
123 do
124 {
125 *dev = *dev * 10 + *ptr - '0';
126 } while (isdigit(*++ptr));
127 if (*dev < numMidiOutPorts)
128 return TRUE;
129 }
130 return FALSE;
131}
132
134{
135 unsigned i, dev = 0;
136
137 if (port != NULL && !MIDIMAP_FindPort(port, &dev))
138 {
139 ERR("Registry glitch: couldn't find midi out (%s)\n", wine_dbgstr_w(port));
140 dev = 0;
141 }
142
143 /* this is necessary when no midi out ports are present */
144 if (dev >= numMidiOutPorts)
145 return FALSE;
146 /* sets default */
147 for (i = 0; i < 16; i++) mom->ChannelMap[i] = &midiOutPorts[dev];
148
149 return TRUE;
150}
151
153{
154 HKEY hSchemesKey, hKey, hPortKey;
155 unsigned i, idx, dev;
156 WCHAR buffer[256], port[256];
158
159 for (i = 0; i < 16; i++) mom->ChannelMap[i] = NULL;
160
162 "System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes",
163 &hSchemesKey))
164 {
165 return FALSE;
166 }
167 if (RegOpenKeyW(hSchemesKey, scheme, &hKey))
168 {
169 RegCloseKey(hSchemesKey);
170 return FALSE;
171 }
172
173 for (idx = 0; !RegEnumKeyW(hKey, idx, buffer, sizeof(buffer)); idx++)
174 {
175 if (RegOpenKeyW(hKey, buffer, &hPortKey)) continue;
176
177 size = sizeof(port);
178 if (RegQueryValueExW(hPortKey, NULL, 0, &type, (void*)port, &size)) continue;
179
180 if (!MIDIMAP_FindPort(port, &dev)) continue;
181
182 size = sizeof(mask);
183 if (RegQueryValueExA(hPortKey, "Channels", 0, &type, (void*)&mask, &size))
184 continue;
185
186 for (i = 0; i < 16; i++)
187 {
188 if (mask & (1 << i))
189 {
190 if (mom->ChannelMap[i])
191 ERR("Quirks in registry, channel %u is mapped twice\n", i);
192 mom->ChannelMap[i] = &midiOutPorts[dev];
193 }
194 }
195 }
196
197 RegCloseKey(hSchemesKey);
199
200 return TRUE;
201}
202
204{
205 HKEY hUserKey, hKey;
206 DWORD err;
207 BOOL ret;
208
209 err = RegOpenCurrentUser(KEY_READ, &hUserKey);
210 if (err == ERROR_SUCCESS)
211 {
212 err = RegOpenKeyW(hUserKey,
213 L"Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap",
214 &hKey);
215 RegCloseKey(hUserKey);
216 }
217
218 if (err != ERROR_SUCCESS)
219 {
221 }
222 else
223 {
224 DWORD type, size, out;
225 WCHAR buffer[256];
226
227 ret = 2;
228 size = sizeof(out);
229 if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
230 {
231 static const WCHAR cs[] = {'C','u','r','r','e','n','t','S','c','h','e','m','e',0};
232 size = sizeof(buffer);
233 if (!RegQueryValueExW(hKey, cs, 0, &type, (void*)buffer, &size))
234 {
237 }
238 else
239 {
240 ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
241 }
242 }
243 if (ret == 2)
244 {
245 static const WCHAR ci[] = {'C','u','r','r','e','n','t','I','n','s','t','r','u','m','e','n','t',0};
246 size = sizeof(buffer);
247 if (!RegQueryValueExW(hKey, ci, 0, &type, (void*)buffer, &size) && *buffer)
248 {
250 }
251 else if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size) && *buffer)
252 {
253 /* Windows XP and higher setting */
255 }
256 else
257 {
259 }
260 }
261 }
263
264 if (ret && TRACE_ON(msacm))
265 {
266 unsigned i;
267
268 for (i = 0; i < 16; i++)
269 {
270 TRACE("chnMap[%2d] => %d\n",
271 i, mom->ChannelMap[i] ? mom->ChannelMap[i]->uDevID : -1);
272 }
273 }
274 return ret;
275}
276
278{
279 MIDIMAPDATA* mom = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIMAPDATA));
280
281 TRACE("(%p %p %08lx)\n", lpdwUser, lpDesc, dwFlags);
282
283 if (!mom) return MMSYSERR_NOMEM;
284
285 if (MIDIMAP_LoadSettings(mom))
286 {
287 *lpdwUser = (DWORD_PTR)mom;
288 mom->self = mom;
289
290 return MMSYSERR_NOERROR;
291 }
292 HeapFree(GetProcessHeap(), 0, mom);
294}
295
297{
298 UINT i;
300
301 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
302
303 for (i = 0; i < 16; i++)
304 {
305 DWORD t;
306 if (mom->ChannelMap[i] && mom->ChannelMap[i]->loaded > 0)
307 {
308 t = midiOutClose(mom->ChannelMap[i]->hMidi);
309 if (t == MMSYSERR_NOERROR)
310 {
311 mom->ChannelMap[i]->loaded = 0;
312 mom->ChannelMap[i]->hMidi = 0;
313 }
314 else if (ret == MMSYSERR_NOERROR)
315 ret = t;
316 }
317 }
318 if (ret == MMSYSERR_NOERROR)
319 HeapFree(GetProcessHeap(), 0, mom);
320 return ret;
321}
322
323static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
324{
325 WORD chn;
327 MIDIHDR mh;
328
329 if (MIDIMAP_IsBadData(mom))
330 return MMSYSERR_ERROR;
331
332 mh = *lpMidiHdr;
333 for (chn = 0; chn < 16; chn++)
334 {
335 if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0)
336 {
337 mh.dwFlags = 0;
338 midiOutPrepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
339 ret = midiOutLongMsg(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
340 midiOutUnprepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh));
341 if (ret != MMSYSERR_NOERROR) break;
342 }
343 }
344 return ret;
345}
346
347static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
348{
349 BYTE lb = LOBYTE(LOWORD(dwParam));
350 WORD chn = lb & 0x0F;
352
353 if (MIDIMAP_IsBadData(mom))
354 return MMSYSERR_ERROR;
355
356 if (!mom->ChannelMap[chn]) return MMSYSERR_NOERROR;
357
358 switch (lb & 0xF0)
359 {
360 case 0x80:
361 case 0x90:
362 case 0xA0:
363 case 0xB0:
364 case 0xC0:
365 case 0xD0:
366 case 0xE0:
367 if (mom->ChannelMap[chn]->loaded == 0)
368 {
369 if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID,
371 mom->ChannelMap[chn]->loaded = 1;
372 else
373 mom->ChannelMap[chn]->loaded = -1;
374 /* FIXME: should load here the IDF midi data... and allow channel and
375 * patch mappings
376 */
377 }
378 if (mom->ChannelMap[chn]->loaded > 0)
379 {
380 /* change channel */
381 dwParam &= ~0x0F;
382 dwParam |= mom->ChannelMap[chn]->aChn[chn];
383
384 if ((LOBYTE(LOWORD(dwParam)) & 0xF0) == 0xC0 /* program change */ &&
385 mom->ChannelMap[chn]->lpbPatch)
386 {
387 BYTE patch = HIBYTE(LOWORD(dwParam));
388
389 /* change patch */
390 dwParam &= ~0x0000FF00;
391 dwParam |= mom->ChannelMap[chn]->lpbPatch[patch];
392 }
393 ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam);
394 }
395 break;
396 case 0xF0:
397 for (chn = 0; chn < 16; chn++)
398 {
399 if (mom->ChannelMap[chn]->loaded > 0)
400 ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam);
401 }
402 break;
403 default:
404 FIXME("ooch %lx\n", dwParam);
405 }
406
407 return ret;
408}
409
410static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
411{
412 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
413 if (lpMidiHdr->dwFlags & (MHDR_ISSTRM|MHDR_PREPARED))
414 return MMSYSERR_INVALPARAM;
415
416 lpMidiHdr->dwFlags |= MHDR_PREPARED;
417 return MMSYSERR_NOERROR;
418}
419
420static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
421{
422 if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
423 if ((lpMidiHdr->dwFlags & MHDR_ISSTRM) || !(lpMidiHdr->dwFlags & MHDR_PREPARED))
424 return MMSYSERR_INVALPARAM;
425
426 lpMidiHdr->dwFlags &= ~MHDR_PREPARED;
427 return MMSYSERR_NOERROR;
428}
429
431{
432 static const WCHAR name[] = {'W','i','n','e',' ','m','i','d','i',' ','m','a','p','p','e','r',0};
433 lpMidiCaps->wMid = 0x00FF;
434 lpMidiCaps->wPid = 0x0001;
435 lpMidiCaps->vDriverVersion = 0x0100;
436 lstrcpyW(lpMidiCaps->szPname, name);
437 lpMidiCaps->wTechnology = MOD_MAPPER;
438 lpMidiCaps->wVoices = 0;
439 lpMidiCaps->wNotes = 0;
440 lpMidiCaps->wChannelMask = 0xFFFF;
441 lpMidiCaps->dwSupport = 0L;
442
443 return MMSYSERR_NOERROR;
444}
445
447{
448 WORD chn;
450
451 if (MIDIMAP_IsBadData(mom))
452 return MMSYSERR_ERROR;
453
454 for (chn = 0; chn < 16; chn++)
455 {
456 if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0)
457 {
458 ret = midiOutReset(mom->ChannelMap[chn]->hMidi);
459 if (ret != MMSYSERR_NOERROR) break;
460 }
461 }
462 return ret;
463}
464
465/**************************************************************************
466 * modMessage (MIDIMAP.@)
467 */
469 DWORD_PTR dwParam1, DWORD_PTR dwParam2)
470{
471 TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n",
472 wDevID, wMsg, dwUser, dwParam1, dwParam2);
473
474 switch (wMsg)
475 {
476 case DRVM_INIT:
477 case DRVM_EXIT:
478 case DRVM_ENABLE:
479 case DRVM_DISABLE:
480 /* FIXME: Pretend this is supported */
481 return 0;
482
483 case MODM_OPEN: return modOpen((DWORD_PTR *)dwUser, (LPMIDIOPENDESC)dwParam1, dwParam2);
484 case MODM_CLOSE: return modClose ((MIDIMAPDATA*)dwUser);
485
486 case MODM_DATA: return modData ((MIDIMAPDATA*)dwUser, dwParam1);
487 case MODM_LONGDATA: return modLongData ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
488 case MODM_PREPARE: return modPrepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
489 case MODM_UNPREPARE: return modUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
490 case MODM_RESET: return modReset ((MIDIMAPDATA*)dwUser);
491
492 case MODM_GETDEVCAPS: return modGetDevCaps (wDevID, (MIDIMAPDATA*)dwUser, (LPMIDIOUTCAPSW)dwParam1,dwParam2);
493 case MODM_GETNUMDEVS: return 1;
496 default:
497 FIXME("unknown message %d!\n", wMsg);
498 }
500}
501
502/*======================================================================*
503 * Driver part *
504 *======================================================================*/
505
506/**************************************************************************
507 * MIDIMAP_drvOpen [internal]
508 */
510{
511 MIDIOUTCAPSW moc;
512 unsigned dev, i;
513
514 if (midiOutPorts)
515 return 0;
516
519 numMidiOutPorts * sizeof(MIDIOUTPORT));
520 for (dev = 0; dev < numMidiOutPorts; dev++)
521 {
522 if (midiOutGetDevCapsW(dev, &moc, sizeof(moc)) == 0L)
523 {
529 for (i = 0; i < 16; i++)
530 midiOutPorts[dev].aChn[i] = i;
531 }
532 else
533 {
534 midiOutPorts[dev].loaded = -1;
535 }
536 }
537
538 return 1;
539}
540
541/**************************************************************************
542 * MIDIMAP_drvClose [internal]
543 */
545{
546 if (midiOutPorts)
547 {
550 return 1;
551 }
552 return 0;
553}
554
555/**************************************************************************
556 * DriverProc (MIDIMAP.@)
557 */
559 LPARAM dwParam1, LPARAM dwParam2)
560{
561/* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
562/* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
563
564 switch (wMsg)
565 {
566 case DRV_LOAD: return 1;
567 case DRV_FREE: return 1;
568 case DRV_OPEN: return MIDIMAP_drvOpen((LPSTR)dwParam1);
569 case DRV_CLOSE: return MIDIMAP_drvClose(dwDevID);
570 case DRV_ENABLE: return 1;
571 case DRV_DISABLE: return 1;
572 case DRV_QUERYCONFIGURE: return 1;
573 case DRV_CONFIGURE: MessageBoxA(0, "MIDIMAP MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
574 case DRV_INSTALL: return DRVCNF_RESTART;
575 case DRV_REMOVE: return DRVCNF_RESTART;
576 default:
577 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
578 }
579}
#define isdigit(c)
Definition: acclib.h:68
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3209
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define TRACE_ON(x)
Definition: compat.h:75
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:805
#define MODM_GETDEVCAPS
Definition: mmddk.h:155
#define DRVM_INIT
Definition: mmddk.h:56
#define MODM_PREPARE
Definition: mmddk.h:158
#define DRVM_DISABLE
Definition: mmddk.h:58
#define MODM_RESET
Definition: mmddk.h:162
#define MODM_GETNUMDEVS
Definition: mmddk.h:154
#define MODM_DATA
Definition: mmddk.h:160
#define MODM_GETVOLUME
Definition: mmddk.h:163
#define DRVM_ENABLE
Definition: mmddk.h:59
#define MODM_OPEN
Definition: mmddk.h:156
#define MODM_SETVOLUME
Definition: mmddk.h:164
#define MODM_UNPREPARE
Definition: mmddk.h:159
#define DRVM_EXIT
Definition: mmddk.h:57
#define MODM_LONGDATA
Definition: mmddk.h:161
#define MODM_CLOSE
Definition: mmddk.h:157
USHORT port
Definition: uri.c:228
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble t
Definition: gl.h:2047
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLenum GLint GLuint mask
Definition: glext.h:6028
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define cs
Definition: i386-dis.c:442
#define DRV_LOAD(x)
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define wine_dbgstr_w
Definition: kernel32.h:34
if(dx< 0)
Definition: linetemp.h:194
static unsigned numMidiOutPorts
Definition: midimap.c:100
static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA *mom, const WCHAR *scheme)
Definition: midimap.c:152
struct tagMIDIOUTPORT MIDIOUTPORT
DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: midimap.c:468
static MIDIOUTPORT * midiOutPorts
Definition: midimap.c:99
static DWORD modClose(MIDIMAPDATA *mom)
Definition: midimap.c:296
static LRESULT MIDIMAP_drvClose(DWORD_PTR dwDevID)
Definition: midimap.c:544
static LRESULT MIDIMAP_drvOpen(LPSTR str)
Definition: midimap.c:509
static DWORD modPrepare(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
Definition: midimap.c:410
struct tagMIDIMAPDATA MIDIMAPDATA
static BOOL MIDIMAP_FindPort(const WCHAR *name, unsigned *dev)
Definition: midimap.c:110
static DWORD modLongData(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
Definition: midimap.c:323
static DWORD modUnprepare(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
Definition: midimap.c:420
static DWORD modData(MIDIMAPDATA *mom, DWORD_PTR dwParam)
Definition: midimap.c:347
static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
Definition: midimap.c:277
static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA *mom, const WCHAR *port)
Definition: midimap.c:133
static BOOL MIDIMAP_IsBadData(MIDIMAPDATA *mm)
Definition: midimap.c:102
static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA *mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD_PTR size)
Definition: midimap.c:430
static DWORD modReset(MIDIMAPDATA *mom)
Definition: midimap.c:446
static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA *mom)
Definition: midimap.c:203
LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
Definition: midimap.c:558
#define DRV_CLOSE
Definition: mmsystem.h:122
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MIDIERR_INVALIDSETUP
Definition: mmsystem.h:236
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define MHDR_PREPARED
Definition: mmsystem.h:269
#define DRV_REMOVE
Definition: mmsystem.h:128
#define DRV_ENABLE
Definition: mmsystem.h:120
#define DRV_CONFIGURE
Definition: mmsystem.h:125
#define DRV_OPEN
Definition: mmsystem.h:121
#define DRV_INSTALL
Definition: mmsystem.h:127
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MOD_MAPPER
Definition: mmsystem.h:263
#define MMSYSERR_ERROR
Definition: mmsystem.h:97
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define MHDR_ISSTRM
Definition: mmsystem.h:271
#define DRV_FREE
Definition: mmsystem.h:124
#define CALLBACK_NULL
Definition: mmsystem.h:147
#define DRV_DISABLE
Definition: mmsystem.h:123
static PVOID ptr
Definition: dispmode.c:27
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define strcmpW(s1, s2)
Definition: unicode.h:44
#define strcpyW(d, s)
Definition: unicode.h:35
#define err(...)
static FILE * out
Definition: regtests2xml.c:44
const WCHAR * str
DWORD scheme
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwFlags
Definition: mmsystem.h:1155
Definition: name.c:39
struct tagMIDIMAPDATA * self
Definition: midimap.c:95
MIDIOUTPORT * ChannelMap[16]
Definition: midimap.c:96
MMVERSION vDriverVersion
Definition: mmsystem.h:1125
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1126
HMIDIOUT hMidi
Definition: midimap.c:87
unsigned short uDevID
Definition: midimap.c:88
unsigned int aChn[16]
Definition: midimap.c:90
LPBYTE lpbPatch
Definition: midimap.c:89
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
#define WINAPI
Definition: msvc.h:6
UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
Definition: winmm.c:1070
UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
Definition: winmm.c:1054
UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
Definition: winmm.c:1016
UINT WINAPI midiOutGetNumDevs(void)
Definition: winmm.c:806
UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
Definition: winmm.c:978
UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
Definition: winmm.c:1039
MMRESULT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Definition: winmm.c:939
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:814
UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
Definition: winmm.c:997
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:793
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193