Release 941107
[wine/multimedia.git] / misc / mmsystem.c
blobdb60012bd96c469cde85df482ca0fc2444384c7b
1 /*
2 * MMSYTEM functions
4 * Copyright 1993 Martin Ayotte
5 */
6 static char Copyright[] = "Copyright Martin Ayotte, 1993";
8 #ifndef WINELIB
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <fcntl.h>
14 #include <sys/ioctl.h>
15 #include "win.h"
16 #include "user.h"
17 #include "driver.h"
18 #include "mmsystem.h"
19 #include "stddebug.h"
20 /* #define DEBUG_MCI */
21 /* #undef DEBUG_MCI */
22 /* #define DEBUG_MMTIME */
23 /* #undef DEBUG_MMTIME */
24 /* #define DEBUG_MMIO */
25 /* #undef DEBUG_MMIO */
26 #include "debug.h"
29 static WORD mciActiveDev = 0;
30 static BOOL mmTimeStarted = FALSE;
31 static MMTIME mmSysTimeMS;
32 static MMTIME mmSysTimeSMPTE;
34 typedef struct tagTIMERENTRY {
35 WORD wDelay;
36 WORD wResol;
37 FARPROC lpFunc;
38 DWORD dwUser;
39 WORD wFlags;
40 WORD wTimerID;
41 WORD wCurTime;
42 struct tagTIMERENTRY *Next;
43 struct tagTIMERENTRY *Prev;
44 } TIMERENTRY;
45 typedef TIMERENTRY *LPTIMERENTRY;
47 static LPTIMERENTRY lpTimerList = NULL;
49 static MCI_OPEN_DRIVER_PARMS mciDrv[MAXMCIDRIVERS];
51 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
52 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
53 LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
54 DWORD dwParam1, DWORD dwParam2);
57 /**************************************************************************
58 * MMSYSTEM_WEP [MMSYSTEM.1]
60 int MMSYSTEM_WEP(HANDLE hInstance, WORD wDataSeg,
61 WORD cbHeapSize, LPSTR lpCmdLine)
63 printf("MMSYSTEM DLL INIT ... hInst=%04X \n", hInstance);
64 return(TRUE);
67 /**************************************************************************
68 * sndPlaySound [MMSYSTEM.2]
70 BOOL WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT uFlags)
72 HMMIO hmmio;
73 MMCKINFO mmckInfo;
74 MMCKINFO ckMainRIFF;
75 PCMWAVEFORMAT pcmWaveFormat;
76 int count;
77 WAVEHDR WaveHdr;
78 WAVEOPENDESC WaveDesc;
79 DWORD dwRet;
80 char str[128];
81 LPSTR ptr;
82 printf("sndPlaySound // SoundName='%s' uFlags=%04X !\n",
83 lpszSoundName, uFlags);
84 if (lpszSoundName == NULL) {
85 printf("sndPlaySound // Stop !\n");
86 return FALSE;
88 hmmio = mmioOpen((LPSTR)lpszSoundName, NULL,
89 MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
90 if (hmmio == 0) {
91 printf("sndPlaySound // searching in SystemSound List !\n");
92 GetProfileString("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
93 if (strlen(str) == 0) return FALSE;
94 if ( (ptr = (LPSTR)strchr(str, ',')) != NULL) *ptr = '\0';
95 hmmio = mmioOpen(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
96 if (hmmio == 0) {
97 printf("sndPlaySound // can't find SystemSound='%s' !\n", str);
98 return FALSE;
101 if (mmioDescend(hmmio, &ckMainRIFF, NULL, 0) != 0) {
102 ErrSND: if (hmmio != 0) mmioClose(hmmio, 0);
103 return FALSE;
105 printf("sndPlaySound // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
106 (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
107 ckMainRIFF.cksize);
108 if ((ckMainRIFF.ckid != FOURCC_RIFF) ||
109 (ckMainRIFF.fccType != mmioFOURCC('W', 'A', 'V', 'E'))) goto ErrSND;
110 mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
111 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) goto ErrSND;
112 printf("sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
113 (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
114 mmckInfo.cksize);
115 if (mmioRead(hmmio, (HPSTR) &pcmWaveFormat,
116 (long) sizeof(PCMWAVEFORMAT)) != (long) sizeof(PCMWAVEFORMAT)) goto ErrSND;
117 mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
118 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) goto ErrSND;
119 printf("sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
120 (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
121 mmckInfo.cksize);
122 WaveDesc.hWave = 0;
123 WaveDesc.lpFormat = (LPWAVEFORMAT)&pcmWaveFormat;
124 pcmWaveFormat.wf.wFormatTag = WAVE_FORMAT_PCM;
125 /* pcmWaveFormat.wBitsPerSample = 8;
126 pcmWaveFormat.wf.nChannels = 1;
127 pcmWaveFormat.wf.nSamplesPerSec = 11025;
128 pcmWaveFormat.wf.nBlockAlign = 1; */
129 pcmWaveFormat.wf.nAvgBytesPerSec =
130 pcmWaveFormat.wf.nSamplesPerSec * pcmWaveFormat.wf.nBlockAlign;
131 dwRet = wodMessage(0, WODM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL);
132 if (dwRet != MMSYSERR_NOERROR) {
133 printf("sndPlaySound // can't open WaveOut device !\n");
134 goto ErrSND;
136 WaveHdr.lpData = (LPSTR) malloc(64000);
137 WaveHdr.dwBufferLength = 32000;
138 WaveHdr.dwUser = 0L;
139 WaveHdr.dwFlags = 0L;
140 WaveHdr.dwLoops = 0L;
141 dwRet = wodMessage(0, WODM_PREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
142 if (dwRet != MMSYSERR_NOERROR) {
143 printf("sndPlaySound // can't prepare WaveOut device !\n");
144 free(WaveHdr.lpData);
145 goto ErrSND;
147 while(TRUE) {
148 count = mmioRead(hmmio, WaveHdr.lpData, WaveHdr.dwBufferLength);
149 if (count < 1) break;
150 WaveHdr.dwBytesRecorded = count;
151 wodMessage(0, WODM_WRITE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
153 wodMessage(0, WODM_UNPREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
154 wodMessage(0, WODM_CLOSE, 0, 0L, 0L);
155 free(WaveHdr.lpData);
156 if (hmmio != 0) mmioClose(hmmio, 0);
157 return TRUE;
160 /**************************************************************************
161 * mmsystemGetVersion [MMSYSTEM.5]
163 WORD WINAPI mmsystemGetVersion()
165 printf("mmsystemGetVersion // 0.4.0 ...?... :-) !\n");
166 return(0x0040);
169 /**************************************************************************
170 * DriverProc [MMSYSTEM.6]
172 LRESULT DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
173 DWORD dwParam1, DWORD dwParam2)
175 return DrvDefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
178 /**************************************************************************
179 * OutputDebugStr [MMSYSTEM.30]
181 void WINAPI OutputDebugStr(LPCSTR str)
183 printf("EMPTY STUB !!! OutputDebugStr('%s');\n", str);
186 /**************************************************************************
187 * DriverCallback [MMSYSTEM.31]
189 BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
190 WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
192 printf("DriverCallback(%08X, %04X, %04X, %04X, %08X, %08X, %08X); !\n",
193 dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
194 switch(uFlags & DCB_TYPEMASK) {
195 case DCB_NULL:
196 printf("DriverCallback() // CALLBACK_NULL !\n");
197 break;
198 case DCB_WINDOW:
199 printf("DriverCallback() // CALLBACK_WINDOW !\n");
200 break;
201 case DCB_TASK:
202 printf("DriverCallback() // CALLBACK_TASK !\n");
203 break;
204 case DCB_FUNCTION:
205 printf("DriverCallback() // CALLBACK_FUNCTION !\n");
206 break;
208 return TRUE;
211 /**************************************************************************
212 * JoyGetNumDevs [MMSYSTEM.101]
214 WORD JoyGetNumDevs()
216 printf("EMPTY STUB !!! JoyGetNumDevs();\n");
217 return 0;
220 /**************************************************************************
221 * JoyGetDevCaps [MMSYSTEM.102]
223 WORD JoyGetDevCaps(WORD wID, LPJOYCAPS lpCaps, WORD wSize)
225 printf("EMPTY STUB !!! JoyGetDevCaps(%04X, %08X, %d);\n",
226 wID, lpCaps, wSize);
227 return MMSYSERR_NODRIVER;
230 /**************************************************************************
231 * JoyGetPos [MMSYSTEM.103]
233 WORD JoyGetPos(WORD wID, LPJOYINFO lpInfo)
235 printf("EMPTY STUB !!! JoyGetPos(%04X, %08X);\n", wID, lpInfo);
236 return MMSYSERR_NODRIVER;
239 /**************************************************************************
240 * JoyGetThreshold [MMSYSTEM.104]
242 WORD JoyGetThreshold(WORD wID, LPWORD lpThreshold)
244 printf("EMPTY STUB !!! JoyGetThreshold(%04X, %08X);\n", wID, lpThreshold);
245 return MMSYSERR_NODRIVER;
248 /**************************************************************************
249 * JoyReleaseCapture [MMSYSTEM.105]
251 WORD JoyReleaseCapture(WORD wID)
253 printf("EMPTY STUB !!! JoyReleaseCapture(%04X);\n", wID);
254 return MMSYSERR_NODRIVER;
257 /**************************************************************************
258 * JoySetCapture [MMSYSTEM.106]
260 WORD JoySetCapture(HWND hWnd, WORD wID, WORD wPeriod, BOOL bChanged)
262 printf("EMPTY STUB !!! JoySetCapture(%04X, %04X, %d, %d);\n",
263 hWnd, wID, wPeriod, bChanged);
264 return MMSYSERR_NODRIVER;
267 /**************************************************************************
268 * JoySetThreshold [MMSYSTEM.107]
270 WORD JoySetThreshold(WORD wID, WORD wThreshold)
272 printf("EMPTY STUB !!! JoySetThreshold(%04X, %d);\n", wID, wThreshold);
273 return MMSYSERR_NODRIVER;
276 /**************************************************************************
277 * JoySetCalibration [MMSYSTEM.109]
279 WORD JoySetCalibration(WORD wID)
281 printf("EMPTY STUB !!! JoySetCalibration(%04X);\n", wID);
282 return MMSYSERR_NODRIVER;
286 /**************************************************************************
287 * auxGetNumDevs [MMSYSTEM.350]
289 UINT WINAPI auxGetNumDevs()
291 UINT count = 0;
292 printf("auxGetNumDevs !\n");
293 count += auxMessage(0, AUXDM_GETNUMDEVS, 0L, 0L, 0L);
294 printf("auxGetNumDevs return %u \n", count);
295 return count;
298 /**************************************************************************
299 * auxGetDevCaps [MMSYSTEM.351]
301 UINT WINAPI auxGetDevCaps(UINT uDeviceID, AUXCAPS FAR* lpCaps, UINT uSize)
303 printf("auxGetDevCaps(%04X, %08X, %d) !\n",
304 uDeviceID, lpCaps, uSize);
305 return auxMessage(uDeviceID, AUXDM_GETDEVCAPS,
306 0L, (DWORD)lpCaps, (DWORD)uSize);
309 /**************************************************************************
310 * auxGetVolume [MMSYSTEM.352]
312 UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
314 printf("auxGetVolume(%04X, %08X) !\n", uDeviceID, lpdwVolume);
315 return auxMessage(uDeviceID, AUXDM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L);
318 /**************************************************************************
319 * auxSetVolume [MMSYSTEM.353]
321 UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume)
323 printf("auxSetVolume(%04X, %08X) !\n", uDeviceID, dwVolume);
324 return auxMessage(uDeviceID, AUXDM_SETVOLUME, 0L, dwVolume, 0L);
327 /**************************************************************************
328 * auxOutMessage [MMSYSTEM.354]
330 DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2)
332 LPMIDIOPENDESC lpDesc;
333 printf("auxOutMessage(%04X, %04X, %08X, %08X)\n",
334 uDeviceID, uMessage, dw1, dw2);
335 return auxMessage(uDeviceID, uMessage, 0L, dw1, dw2);
338 /**************************************************************************
339 * mciGetErrorString [MMSYSTEM.706]
341 BOOL mciGetErrorString (DWORD wError, LPSTR lpstrBuffer, UINT uLength)
343 LPSTR msgptr;
344 int maxbuf;
345 printf("mciGetErrorString(%04X, %08X, %d);\n", wError, lpstrBuffer, uLength);
346 if ((lpstrBuffer == NULL) || (uLength < 1)) return(FALSE);
347 lpstrBuffer[0] = '\0';
348 switch(wError) {
349 case MCIERR_INVALID_DEVICE_ID:
350 msgptr = "Invalid MCI device ID. Use the ID returned when opening the MCI device.";
351 break;
352 case MCIERR_UNRECOGNIZED_KEYWORD:
353 msgptr = "The driver cannot recognize the specified command parameter.";
354 break;
355 case MCIERR_UNRECOGNIZED_COMMAND:
356 msgptr = "The driver cannot recognize the specified command.";
357 break;
358 case MCIERR_HARDWARE:
359 msgptr = "There is a problem with your media device. Make sure it is working correctly or contact the device manufacturer.";
360 break;
361 case MCIERR_INVALID_DEVICE_NAME:
362 msgptr = "The specified device is not open or is not recognized by MCI.";
363 break;
364 case MCIERR_OUT_OF_MEMORY:
365 msgptr = "Not enough memory available for this task. \nQuit one or more applications to increase available memory, and then try again.";
366 break;
367 case MCIERR_DEVICE_OPEN:
368 msgptr = "The device name is already being used as an alias by this application. Use a unique alias.";
369 break;
370 case MCIERR_CANNOT_LOAD_DRIVER:
371 msgptr = "There is an undetectable problem in loading the specified device driver.";
372 break;
373 case MCIERR_MISSING_COMMAND_STRING:
374 msgptr = "No command was specified.";
375 break;
376 case MCIERR_PARAM_OVERFLOW:
377 msgptr = "The output string was to large to fit in the return buffer. Increase the size of the buffer.";
378 break;
379 case MCIERR_MISSING_STRING_ARGUMENT:
380 msgptr = "The specified command requires a character-string parameter. Please provide one.";
381 break;
382 case MCIERR_BAD_INTEGER:
383 msgptr = "The specified integer is invalid for this command.";
384 break;
385 case MCIERR_PARSER_INTERNAL:
386 msgptr = "The device driver returned an invalid return type. Check with the device manufacturer about obtaining a new driver.";
387 break;
388 case MCIERR_DRIVER_INTERNAL:
389 msgptr = "There is a problem with the device driver. Check with the device manufacturer about obtaining a new driver.";
390 break;
391 case MCIERR_MISSING_PARAMETER:
392 msgptr = "The specified command requires a parameter. Please supply one.";
393 break;
394 case MCIERR_UNSUPPORTED_FUNCTION:
395 msgptr = "The MCI device you are using does not support the specified command.";
396 break;
397 case MCIERR_FILE_NOT_FOUND:
398 msgptr = "Cannot find the specified file. Make sure the path and filename are correct.";
399 break;
400 case MCIERR_DEVICE_NOT_READY:
401 msgptr = "The device driver is not ready.";
402 break;
403 case MCIERR_INTERNAL:
404 msgptr = "A problem occurred in initializing MCI. Try restarting Windows.";
405 break;
406 case MCIERR_DRIVER:
407 msgptr = "There is a problem with the device driver. The driver has closed. Cannot access error.";
408 break;
409 case MCIERR_CANNOT_USE_ALL:
410 msgptr = "Cannot use 'all' as the device name with the specified command.";
411 break;
412 case MCIERR_MULTIPLE:
413 msgptr = "Errors occurred in more than one device. Specify each command and device separately to determine which devices caused the error";
414 break;
415 case MCIERR_EXTENSION_NOT_FOUND:
416 msgptr = "Cannot determine the device type from the given filename extension.";
417 break;
418 case MCIERR_OUTOFRANGE:
419 msgptr = "The specified parameter is out of range for the specified command.";
420 break;
421 case MCIERR_FLAGS_NOT_COMPATIBLE:
422 msgptr = "The specified parameters cannot be used together.";
423 break;
424 case MCIERR_FILE_NOT_SAVED:
425 msgptr = "Cannot save the specified file. Make sure you have enough disk space or are still connected to the network.";
426 break;
427 case MCIERR_DEVICE_TYPE_REQUIRED:
428 msgptr = "Cannot find the specified device. Make sure it is installed or that the device name is spelled correctly.";
429 break;
430 case MCIERR_DEVICE_LOCKED:
431 msgptr = "The specified device is now being closed. Wait a few seconds, and then try again.";
432 break;
433 case MCIERR_DUPLICATE_ALIAS:
434 msgptr = "The specified alias is already being used in this application. Use a unique alias.";
435 break;
436 case MCIERR_BAD_CONSTANT:
437 msgptr = "The specified parameter is invalid for this command.";
438 break;
439 case MCIERR_MUST_USE_SHAREABLE:
440 msgptr = "The device driver is already in use. To share it, use the 'shareable' parameter with each 'open' command.";
441 break;
442 case MCIERR_MISSING_DEVICE_NAME:
443 msgptr = "The specified command requires an alias, file, driver, or device name. Please supply one.";
444 break;
445 case MCIERR_BAD_TIME_FORMAT:
446 msgptr = "The specified value for the time format is invalid. Refer to the MCI documentation for valid formats.";
447 break;
448 case MCIERR_NO_CLOSING_QUOTE:
449 msgptr = "A closing double-quotation mark is missing from the parameter value. Please supply one.";
450 break;
451 case MCIERR_DUPLICATE_FLAGS:
452 msgptr = "A parameter or value was specified twice. Only specify it once.";
453 break;
454 case MCIERR_INVALID_FILE:
455 msgptr = "The specified file cannot be played on the specified MCI device. The file may be corrupt, or not in the correct format.";
456 break;
457 case MCIERR_NULL_PARAMETER_BLOCK:
458 msgptr = "A null parameter block was passed to MCI.";
459 break;
460 case MCIERR_UNNAMED_RESOURCE:
461 msgptr = "Cannot save an unnamed file. Supply a filename.";
462 break;
463 case MCIERR_NEW_REQUIRES_ALIAS:
464 msgptr = "You must specify an alias when using the 'new' parameter.";
465 break;
466 case MCIERR_NOTIFY_ON_AUTO_OPEN:
467 msgptr = "Cannot use the 'notify' flag with auto-opened devices.";
468 break;
469 case MCIERR_NO_ELEMENT_ALLOWED:
470 msgptr = "Cannot use a filename with the specified device.";
471 break;
472 case MCIERR_NONAPPLICABLE_FUNCTION:
473 msgptr = "Cannot carry out the commands in the order specified. Correct the command sequence, and then try again.";
474 break;
475 case MCIERR_ILLEGAL_FOR_AUTO_OPEN:
476 msgptr = "Cannot carry out the specified command on an auto-opened device. Wait until the device is closed, and then try again.";
477 break;
478 case MCIERR_FILENAME_REQUIRED:
479 msgptr = "The filename is invalid. Make sure the filename is not longer than 8 characters, followed by a period and an extension.";
480 break;
481 case MCIERR_EXTRA_CHARACTERS:
482 msgptr = "Cannot specify extra characters after a string enclosed in quotation marks.";
483 break;
484 case MCIERR_DEVICE_NOT_INSTALLED:
485 msgptr = "The specified device is not installed on the system. Use the Drivers option in Control Panel to install the device.";
486 break;
487 case MCIERR_GET_CD:
488 msgptr = "Cannot access the specified file or MCI device. Try changing directories or restarting your computer.";
489 break;
490 case MCIERR_SET_CD:
491 msgptr = "Cannot access the specified file or MCI device because the application cannot change directories.";
492 break;
493 case MCIERR_SET_DRIVE:
494 msgptr = "Cannot access specified file or MCI device because the application cannot change drives.";
495 break;
496 case MCIERR_DEVICE_LENGTH:
497 msgptr = "Specify a device or driver name that is less than 79 characters.";
498 break;
499 case MCIERR_DEVICE_ORD_LENGTH:
500 msgptr = "Specify a device or driver name that is less than 69 characters.";
501 break;
502 case MCIERR_NO_INTEGER:
503 msgptr = "The specified command requires an integer parameter. Please provide one.";
504 break;
505 case MCIERR_WAVE_OUTPUTSINUSE:
506 msgptr = "All wave devices that can play files in the current format are in use. Wait until a wave device is free, and then try again.";
507 break;
508 case MCIERR_WAVE_SETOUTPUTINUSE:
509 msgptr = "Cannot set the current wave device for play back because it is in use. Wait until the device is free, and then try again.";
510 break;
511 case MCIERR_WAVE_INPUTSINUSE:
512 msgptr = "All wave devices that can record files in the current format are in use. Wait until a wave device is free, and then try again.";
513 break;
514 case MCIERR_WAVE_SETINPUTINUSE:
515 msgptr = "Cannot set the current wave device for recording because it is in use. Wait until the device is free, and then try again.";
516 break;
517 case MCIERR_WAVE_OUTPUTUNSPECIFIED:
518 msgptr = "Any compatible waveform playback device may be used.";
519 break;
520 case MCIERR_WAVE_INPUTUNSPECIFIED:
521 msgptr = "Any compatible waveform recording device may be used.";
522 break;
523 case MCIERR_WAVE_OUTPUTSUNSUITABLE:
524 msgptr = "No wave device that can play files in the current format is installed. Use the Drivers option to install the wave device.";
525 break;
526 case MCIERR_WAVE_SETOUTPUTUNSUITABLE:
527 msgptr = "The device you are trying to play to cannot recognize the current file format.";
528 break;
529 case MCIERR_WAVE_INPUTSUNSUITABLE:
530 msgptr = "No wave device that can record files in the current format is installed. Use the Drivers option to install the wave device.";
531 break;
532 case MCIERR_WAVE_SETINPUTUNSUITABLE:
533 msgptr = "The device you are trying to record from cannot recognize the current file format.";
534 break;
535 case MCIERR_NO_WINDOW:
536 msgptr = "There is no display window.";
537 break;
538 case MCIERR_CREATEWINDOW:
539 msgptr = "Could not create or use window.";
540 break;
541 case MCIERR_FILE_READ:
542 msgptr = "Cannot read the specified file. Make sure the file is still present, or check your disk or network connection.";
543 break;
544 case MCIERR_FILE_WRITE:
545 msgptr = "Cannot write to the specified file. Make sure you have enough disk space or are still connected to the network.";
546 break;
549 #define MCIERR_SEQ_DIV_INCOMPATIBLE (MCIERR_BASE + 80)
550 #define MCIERR_SEQ_PORT_INUSE (MCIERR_BASE + 81)
551 #define MCIERR_SEQ_PORT_NONEXISTENT (MCIERR_BASE + 82)
552 #define MCIERR_SEQ_PORT_MAPNODEVICE (MCIERR_BASE + 83)
553 #define MCIERR_SEQ_PORT_MISCERROR (MCIERR_BASE + 84)
554 #define MCIERR_SEQ_TIMER (MCIERR_BASE + 85)
555 #define MCIERR_SEQ_PORTUNSPECIFIED (MCIERR_BASE + 86)
556 #define MCIERR_SEQ_NOMIDIPRESENT (MCIERR_BASE + 87)
558 msg# 513 : vcr
559 msg# 514 : videodisc
560 msg# 515 : overlay
561 msg# 516 : cdaudio
562 msg# 517 : dat
563 msg# 518 : scanner
564 msg# 519 : animation
565 msg# 520 : digitalvideo
566 msg# 521 : other
567 msg# 522 : waveaudio
568 msg# 523 : sequencer
569 msg# 524 : not ready
570 msg# 525 : stopped
571 msg# 526 : playing
572 msg# 527 : recording
573 msg# 528 : seeking
574 msg# 529 : paused
575 msg# 530 : open
576 msg# 531 : false
577 msg# 532 : true
578 msg# 533 : milliseconds
579 msg# 534 : hms
580 msg# 535 : msf
581 msg# 536 : frames
582 msg# 537 : smpte 24
583 msg# 538 : smpte 25
584 msg# 539 : smpte 30
585 msg# 540 : smpte 30 drop
586 msg# 541 : bytes
587 msg# 542 : samples
588 msg# 543 : tmsf
590 default:
591 msgptr = "Unkown MCI Error !\n";
592 break;
594 maxbuf = min(uLength - 1, strlen(msgptr));
595 if (maxbuf > 0) strncpy(lpstrBuffer, msgptr, maxbuf);
596 lpstrBuffer[maxbuf + 1] = '\0';
597 return(TRUE);
601 /**************************************************************************
602 * mciDriverNotify [MMSYSTEM.711]
604 BOOL WINAPI mciDriverNotify(HWND hWndCallBack, UINT wDevID, UINT wStatus)
606 printf("mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
607 if (!IsWindow(hWndCallBack)) return FALSE;
608 PostMessage(hWndCallBack, MM_MCINOTIFY, wStatus,
609 MAKELONG(mciDrv[wDevID].wDeviceID, 0));
610 return TRUE;
613 /**************************************************************************
614 * mciOpen [internal]
616 DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lpParms)
618 char str[128];
619 DWORD dwDevTyp = 0;
620 UINT wDevID = 1;
621 printf("mciOpen(%08X, %08X)\n", dwParam, lpParms);
622 if (lpParms == NULL) return MCIERR_INTERNAL;
623 while(mciDrv[wDevID].wType != 0) {
624 if (++wDevID >= MAXMCIDRIVERS) {
625 printf("MCI_OPEN // MAXMCIDRIVERS reached !\n");
626 return MCIERR_INTERNAL;
629 if (dwParam & MCI_OPEN_TYPE) {
630 if (lpParms->lpstrDeviceType == NULL) return MCIERR_INTERNAL;
631 if (dwParam & MCI_OPEN_TYPE_ID) {
632 printf("MCI_OPEN // Dev=%08X !\n", lpParms->lpstrDeviceType);
633 dwDevTyp = (DWORD)lpParms->lpstrDeviceType;
635 else {
636 printf("MCI_OPEN // Dev='%s' !\n", lpParms->lpstrDeviceType);
637 strcpy(str, lpParms->lpstrDeviceType);
638 AnsiUpper(str);
639 if (strcmp(str, "CDAUDIO") == 0) {
640 dwDevTyp = MCI_DEVTYPE_CD_AUDIO;
642 else
643 if (strcmp(str, "WAVEAUDIO") == 0) {
644 dwDevTyp = MCI_DEVTYPE_WAVEFORM_AUDIO;
646 else
647 if (strcmp(str, "SEQUENCER") == 0) {
648 dwDevTyp = MCI_DEVTYPE_SEQUENCER;
650 else
651 if (strcmp(str, "ANIMATION1") == 0) {
652 dwDevTyp = MCI_DEVTYPE_ANIMATION;
655 mciDrv[wDevID].wType = dwDevTyp;
656 mciDrv[wDevID].wDeviceID = 1;
657 lpParms->wDeviceID = wDevID;
658 printf("MCI_OPEN // wDeviceID=%04X !\n", lpParms->wDeviceID);
659 switch(dwDevTyp) {
660 case MCI_DEVTYPE_CD_AUDIO:
661 #ifdef WINELIB
662 WINELIB_UNIMP ("CDAUDIO_DriverProc");
663 #else
664 return CDAUDIO_DriverProc(0, 0, MCI_OPEN_DRIVER,
666 dwParam, (DWORD)lpParms);
667 #endif
668 case MCI_DEVTYPE_WAVEFORM_AUDIO:
669 return WAVE_DriverProc(0, 0, MCI_OPEN_DRIVER,
670 dwParam, (DWORD)lpParms);
671 case MCI_DEVTYPE_SEQUENCER:
672 return MIDI_DriverProc(0, 0, MCI_OPEN_DRIVER,
673 dwParam, (DWORD)lpParms);
674 case MCI_DEVTYPE_ANIMATION:
675 return ANIM_DriverProc(0, 0, MCI_OPEN_DRIVER,
676 dwParam, (DWORD)lpParms);
677 case MCI_DEVTYPE_DIGITAL_VIDEO:
678 printf("MCI_OPEN // No DIGITAL_VIDEO yet !\n");
679 return MCIERR_DEVICE_NOT_INSTALLED;
680 default:
681 printf("MCI_OPEN // Invalid Device Name '%08X' !\n", lpParms->lpstrDeviceType);
682 return MCIERR_INVALID_DEVICE_NAME;
685 return MCIERR_INTERNAL;
689 /**************************************************************************
690 * mciClose [internal]
692 DWORD mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
694 DWORD dwRet = MCIERR_INTERNAL;
695 printf("mciClose(%u, %08X, %08X)\n", wDevID, dwParam, lpParms);
696 switch(mciDrv[wDevID].wType) {
697 case MCI_DEVTYPE_CD_AUDIO:
698 #ifndef WINELIB
699 dwRet = CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, 0,
700 MCI_CLOSE, dwParam, (DWORD)lpParms);
701 #endif
702 break;
703 case MCI_DEVTYPE_WAVEFORM_AUDIO:
704 dwRet = WAVE_DriverProc(mciDrv[wDevID].wDeviceID, 0,
705 MCI_CLOSE, dwParam, (DWORD)lpParms);
706 break;
707 case MCI_DEVTYPE_SEQUENCER:
708 dwRet = MIDI_DriverProc(mciDrv[wDevID].wDeviceID, 0,
709 MCI_CLOSE, dwParam, (DWORD)lpParms);
710 break;
711 default:
712 printf("mciClose() // unknown type=%04X !\n", mciDrv[wDevID].wType);
714 mciDrv[wDevID].wType = 0;
715 return dwRet;
719 /**************************************************************************
720 * mciSound [internal]
722 DWORD mciSound(UINT wDevID, DWORD dwParam, LPMCI_SOUND_PARMS lpParms)
724 if (lpParms == NULL) return MCIERR_INTERNAL;
725 if (dwParam & MCI_SOUND_NAME)
726 printf("MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName);
727 return MCIERR_INVALID_DEVICE_ID;
732 /**************************************************************************
733 * mciSendCommand [MMSYSTEM.701]
735 DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2)
737 HDRVR hDrv = 0;
738 dprintf_mci(stddeb, "mciSendCommand(%04X, %04X, %08X, %08X)\n",
739 wDevID, wMsg, dwParam1, dwParam2);
740 switch(wMsg) {
741 case MCI_OPEN:
742 return mciOpen(dwParam1, (LPMCI_OPEN_PARMS)dwParam2);
743 case MCI_CLOSE:
744 return mciClose(wDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
745 default:
746 switch(mciDrv[wDevID].wType) {
747 case MCI_DEVTYPE_CD_AUDIO:
748 #ifndef WINELIB
749 return CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
750 wMsg, dwParam1, dwParam2);
751 #endif
753 case MCI_DEVTYPE_WAVEFORM_AUDIO:
754 return WAVE_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
755 wMsg, dwParam1, dwParam2);
756 case MCI_DEVTYPE_SEQUENCER:
757 return MIDI_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
758 wMsg, dwParam1, dwParam2);
759 default:
760 printf("mciSendCommand() // unknown type=%04X !\n",
761 mciDrv[wDevID].wType);
764 return MMSYSERR_INVALPARAM;
767 /**************************************************************************
768 * mciGetDeviceID [MMSYSTEM.703]
770 UINT mciGetDeviceID (LPCSTR lpstrName)
772 char str[128];
773 printf("mciGetDeviceID(%s)\n", lpstrName);
774 if (lpstrName != NULL) {
775 strcpy(str, lpstrName);
776 AnsiUpper(str);
777 if (strcmp(str, "ALL") == 0) return MCI_ALL_DEVICE_ID;
779 return 0;
782 /**************************************************************************
783 * mciSendString [MMSYSTEM.702]
785 DWORD WINAPI mciSendString (LPCSTR lpstrCommand,
786 LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback)
788 printf("mciSendString('%s', %lX, %u, %X)\n",
789 lpstrCommand, lpstrReturnString,
790 uReturnLength, hwndCallback);
791 return MCIERR_MISSING_COMMAND_STRING;
794 /**************************************************************************
795 * mciSetYieldProc [MMSYSTEM.714]
797 BOOL WINAPI mciSetYieldProc (UINT uDeviceID,
798 YIELDPROC fpYieldProc, DWORD dwYieldData)
802 /**************************************************************************
803 * mciGetDeviceIDFromElementID [MMSYSTEM.715]
805 UINT WINAPI mciGetDeviceIDFromElementID(DWORD dwElementID, LPCSTR lpstrType)
809 /**************************************************************************
810 * mciGetYieldProc [MMSYSTEM.716]
812 YIELDPROC WINAPI mciGetYieldProc(UINT uDeviceID, DWORD FAR* lpdwYieldData)
816 /**************************************************************************
817 * mciGetCreatorTask [MMSYSTEM.717]
819 HTASK WINAPI mciGetCreatorTask(UINT uDeviceID)
823 /**************************************************************************
824 * midiOutGetNumDevs [MMSYSTEM.201]
826 UINT WINAPI midiOutGetNumDevs(void)
828 UINT count = 0;
829 printf("midiOutGetNumDevs\n");
830 count += modMessage(0, MODM_GETNUMDEVS, 0L, 0L, 0L);
831 printf("midiOutGetNumDevs return %u \n", count);
832 return count;
835 /**************************************************************************
836 * midiOutGetDevCaps [MMSYSTEM.202]
838 UINT WINAPI midiOutGetDevCaps(UINT uDeviceID,
839 MIDIOUTCAPS FAR* lpCaps, UINT uSize)
841 printf("midiOutGetDevCaps\n");
842 return 0;
845 /**************************************************************************
846 * midiOutGetErrorText [MMSYSTEM.203]
848 UINT WINAPI midiOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
850 printf("midiOutGetErrorText\n");
851 return(midiGetErrorText(uError, lpText, uSize));
855 /**************************************************************************
856 * midiGetErrorText [internal]
858 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
860 LPSTR msgptr;
861 int maxbuf;
862 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
863 lpText[0] = '\0';
864 switch(uError) {
865 case MIDIERR_UNPREPARED:
866 msgptr = "The MIDI header was not prepared. Use the Prepare function to prepare the header, and then try again.";
867 break;
868 case MIDIERR_STILLPLAYING:
869 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
870 break;
871 case MIDIERR_NOMAP:
872 msgptr = "A MIDI map was not found. There may be a problem with the driver, or the MIDIMAP.CFG file may be corrupt or missing.";
873 break;
874 case MIDIERR_NOTREADY:
875 msgptr = "The port is transmitting data to the device. Wait until the data has been transmitted, and then try again.";
876 break;
877 case MIDIERR_NODEVICE:
878 msgptr = "The current MIDI Mapper setup refers to a MIDI device that is not installed on the system. Use MIDI Mapper to edit the setup.";
879 break;
880 case MIDIERR_INVALIDSETUP:
881 msgptr = "The current MIDI setup is damaged. Copy the original MIDIMAP.CFG file to the Windows SYSTEM directory, and then try again.";
882 break;
884 msg# 336 : Cannot use the song-pointer time format and the SMPTE time-format together.
885 msg# 337 : The specified MIDI device is already in use. Wait until it is free, and then try again.
886 msg# 338 : The specified MIDI device is not installed on the system. Use the Drivers option in Control Panel to install the driver.
887 msg# 339 : The current MIDI Mapper setup refers to a MIDI device that is not installed on the system. Use MIDI Mapper to edit the setup.
888 msg# 340 : An error occurred using the specified port.
889 msg# 341 : All multimedia timers are being used by other applications. Quit one of these applications, and then try again.
890 msg# 342 : There is no current MIDI port.
891 msg# 343 : There are no MIDI devices installed on the system. Use the Drivers option in Control Panel to install the driver.
893 default:
894 msgptr = "Unkown MIDI Error !\n";
895 break;
897 maxbuf = min(uSize - 1, strlen(msgptr));
898 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
899 lpText[maxbuf + 1] = '\0';
900 return(TRUE);
903 /**************************************************************************
904 * midiOutOpen [MMSYSTEM.204]
906 UINT WINAPI midiOutOpen(HMIDIOUT FAR* lphMidiOut, UINT uDeviceID,
907 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
909 HMIDI hMidiOut;
910 LPMIDIOPENDESC lpDesc;
911 DWORD dwRet;
912 BOOL bMapperFlg = FALSE;
913 if (lphMidiOut != NULL) *lphMidiOut = 0;
914 printf("midiOutOpen(%08X, %d, %08X, %08X, %08X);\n",
915 lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags);
916 if (uDeviceID == (UINT)MIDI_MAPPER) {
917 printf("midiOutOpen // MIDI_MAPPER mode requested !\n");
918 bMapperFlg = TRUE;
919 uDeviceID = 0;
921 hMidiOut = GlobalAlloc(GMEM_MOVEABLE, sizeof(MIDIOPENDESC));
922 if (lphMidiOut != NULL) *lphMidiOut = hMidiOut;
923 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
924 if (lpDesc == NULL) return MMSYSERR_NOMEM;
925 lpDesc->hMidi = hMidiOut;
926 lpDesc->dwCallback = dwCallback;
927 lpDesc->dwInstance = dwInstance;
928 while(uDeviceID < MAXMIDIDRIVERS) {
929 dwRet = modMessage(uDeviceID, MODM_OPEN,
930 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
931 if (dwRet == MMSYSERR_NOERROR) break;
932 if (!bMapperFlg) break;
933 uDeviceID++;
934 printf("midiOutOpen // MIDI_MAPPER mode ! try next driver...\n");
936 return dwRet;
939 /**************************************************************************
940 * midiOutClose [MMSYSTEM.205]
942 UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
944 LPMIDIOPENDESC lpDesc;
945 printf("midiOutClose(%04X)\n", hMidiOut);
946 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
947 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
948 return modMessage(0, MODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
951 /**************************************************************************
952 * midiOutPrepareHeader [MMSYSTEM.206]
954 UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
955 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
957 LPMIDIOPENDESC lpDesc;
958 printf("midiOutPrepareHeader(%04X, %08X, %d)\n",
959 hMidiOut, lpMidiOutHdr, uSize);
960 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
961 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
962 return modMessage(0, MODM_PREPARE, lpDesc->dwInstance,
963 (DWORD)lpMidiOutHdr, (DWORD)uSize);
966 /**************************************************************************
967 * midiOutUnprepareHeader [MMSYSTEM.207]
969 UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
970 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
972 LPMIDIOPENDESC lpDesc;
973 printf("midiOutUnprepareHeader(%04X, %08X, %d)\n",
974 hMidiOut, lpMidiOutHdr, uSize);
975 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
976 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
977 return modMessage(0, MODM_UNPREPARE, lpDesc->dwInstance,
978 (DWORD)lpMidiOutHdr, (DWORD)uSize);
981 /**************************************************************************
982 * midiOutShortMsg [MMSYSTEM.208]
984 UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
986 LPMIDIOPENDESC lpDesc;
987 printf("midiOutShortMsg(%04X, %08X)\n", hMidiOut, dwMsg);
988 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
989 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
990 return modMessage(0, MODM_DATA, lpDesc->dwInstance, dwMsg, 0L);
993 /**************************************************************************
994 * midiOutLongMsg [MMSYSTEM.209]
996 UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
997 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
999 LPMIDIOPENDESC lpDesc;
1000 printf("midiOutLongMsg(%04X, %08X, %d)\n",
1001 hMidiOut, lpMidiOutHdr, uSize);
1002 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
1003 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1004 return modMessage(0, MODM_LONGDATA, lpDesc->dwInstance,
1005 (DWORD)lpMidiOutHdr, (DWORD)uSize);
1008 /**************************************************************************
1009 * midiOutReset [MMSYSTEM.210]
1011 UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
1013 printf("midiOutReset\n");
1014 return 0;
1017 /**************************************************************************
1018 * midiOutGetVolume [MMSYSTEM.211]
1020 UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
1022 printf("midiOutGetVolume\n");
1023 return 0;
1026 /**************************************************************************
1027 * midiOutSetVolume [MMSYSTEM.212]
1029 UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume)
1031 printf("midiOutSetVolume\n");
1032 return 0;
1035 /**************************************************************************
1036 * midiOutCachePatches [MMSYSTEM.213]
1038 UINT WINAPI midiOutCachePatches(HMIDIOUT hMidiOut,
1039 UINT uBank, WORD FAR* lpwPatchArray, UINT uFlags)
1041 printf("midiOutCachePatches\n");
1042 return 0;
1045 /**************************************************************************
1046 * midiOutCacheDrumPatches [MMSYSTEM.214]
1048 UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT hMidiOut,
1049 UINT uPatch, WORD FAR* lpwKeyArray, UINT uFlags)
1051 printf("midiOutCacheDrumPatches\n");
1052 return 0;
1055 /**************************************************************************
1056 * midiOutGetID [MMSYSTEM.215]
1058 UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT FAR* lpuDeviceID)
1060 printf("midiOutGetID\n");
1061 return 0;
1064 /**************************************************************************
1065 * midiOutMessage [MMSYSTEM.216]
1067 DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
1068 DWORD dwParam1, DWORD dwParam2)
1070 LPMIDIOPENDESC lpDesc;
1071 printf("midiOutMessage(%04X, %04X, %08X, %08X)\n",
1072 hMidiOut, uMessage, dwParam1, dwParam2);
1073 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
1074 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1075 return modMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1076 return 0;
1079 /**************************************************************************
1080 * midiInGetNumDevs [MMSYSTEM.301]
1082 UINT WINAPI midiInGetNumDevs(void)
1084 printf("midiInGetNumDevs\n");
1085 return 0;
1088 /**************************************************************************
1089 * midiInGetDevCaps [MMSYSTEM.302]
1091 UINT WINAPI midiInGetDevCaps(UINT uDeviceID,
1092 LPMIDIINCAPS lpCaps, UINT uSize)
1094 printf("midiInGetDevCaps\n");
1095 return 0;
1098 /**************************************************************************
1099 * midiInGetErrorText [MMSYSTEM.303]
1101 UINT WINAPI midiInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1103 printf("midiInGetErrorText\n");
1104 return (midiGetErrorText(uError, lpText, uSize));
1107 /**************************************************************************
1108 * midiInOpen [MMSYSTEM.304]
1110 UINT WINAPI midiInOpen(HMIDIIN FAR* lphMidiIn, UINT uDeviceID,
1111 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1113 HMIDI hMidiIn;
1114 LPMIDIOPENDESC lpDesc;
1115 DWORD dwRet;
1116 BOOL bMapperFlg = FALSE;
1117 if (lphMidiIn != NULL) *lphMidiIn = 0;
1118 printf("midiInOpen(%08X, %d, %08X, %08X, %08X);\n",
1119 lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags);
1120 if (uDeviceID == (UINT)MIDI_MAPPER) {
1121 printf("midiInOpen // MIDI_MAPPER mode requested !\n");
1122 bMapperFlg = TRUE;
1123 uDeviceID = 0;
1125 hMidiIn = GlobalAlloc(GMEM_MOVEABLE, sizeof(MIDIOPENDESC));
1126 if (lphMidiIn != NULL) *lphMidiIn = hMidiIn;
1127 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1128 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1129 lpDesc->hMidi = hMidiIn;
1130 lpDesc->dwCallback = dwCallback;
1131 lpDesc->dwInstance = dwInstance;
1132 while(uDeviceID < MAXMIDIDRIVERS) {
1133 dwRet = midMessage(uDeviceID, MIDM_OPEN,
1134 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1135 if (dwRet == MMSYSERR_NOERROR) break;
1136 if (!bMapperFlg) break;
1137 uDeviceID++;
1138 printf("midiInOpen // MIDI_MAPPER mode ! try next driver...\n");
1140 return dwRet;
1143 /**************************************************************************
1144 * midiInClose [MMSYSTEM.305]
1146 UINT WINAPI midiInClose(HMIDIIN hMidiIn)
1148 LPMIDIOPENDESC lpDesc;
1149 printf("midiInClose(%04X)\n", hMidiIn);
1150 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1151 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1152 return midMessage(0, MIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1155 /**************************************************************************
1156 * midiInPrepareHeader [MMSYSTEM.306]
1158 UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
1159 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1161 LPMIDIOPENDESC lpDesc;
1162 printf("midiInPrepareHeader(%04X, %08X, %d)\n",
1163 hMidiIn, lpMidiInHdr, uSize);
1164 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1165 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1166 return midMessage(0, MIDM_PREPARE, lpDesc->dwInstance,
1167 (DWORD)lpMidiInHdr, (DWORD)uSize);
1170 /**************************************************************************
1171 * midiInUnprepareHeader [MMSYSTEM.307]
1173 UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
1174 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1176 LPMIDIOPENDESC lpDesc;
1177 printf("midiInUnprepareHeader(%04X, %08X, %d)\n",
1178 hMidiIn, lpMidiInHdr, uSize);
1179 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1180 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1181 return midMessage(0, MIDM_UNPREPARE, lpDesc->dwInstance,
1182 (DWORD)lpMidiInHdr, (DWORD)uSize);
1185 /**************************************************************************
1186 * midiInAddBuffer [MMSYSTEM.308]
1188 UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
1189 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1191 printf("midiInAddBuffer\n");
1192 return 0;
1195 /**************************************************************************
1196 * midiInStart [MMSYSTEM.309]
1198 UINT WINAPI midiInStart(HMIDIIN hMidiIn)
1200 printf("midiInStart\n");
1201 return 0;
1204 /**************************************************************************
1205 * midiInStop [MMSYSTEM.310]
1207 UINT WINAPI midiInStop(HMIDIIN hMidiIn)
1209 printf("midiInStop\n");
1210 return 0;
1213 /**************************************************************************
1214 * midiInReset [MMSYSTEM.311]
1216 UINT WINAPI midiInReset(HMIDIIN hMidiIn)
1218 printf("midiInReset\n");
1219 return 0;
1222 /**************************************************************************
1223 * midiInGetID [MMSYSTEM.312]
1225 UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT FAR* lpuDeviceID)
1227 printf("midiInGetID\n");
1228 return 0;
1231 /**************************************************************************
1232 * midiInMessage [MMSYSTEM.313]
1234 DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
1235 DWORD dwParam1, DWORD dwParam2)
1237 LPMIDIOPENDESC lpDesc;
1238 printf("midiInMessage(%04X, %04X, %08X, %08X)\n",
1239 hMidiIn, uMessage, dwParam1, dwParam2);
1240 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1241 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1242 return midMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1246 /**************************************************************************
1247 * waveOutGetNumDevs [MMSYSTEM.401]
1249 UINT WINAPI waveOutGetNumDevs()
1251 UINT count = 0;
1252 printf("waveOutGetNumDevs\n");
1253 count += wodMessage(0, WODM_GETNUMDEVS, 0L, 0L, 0L);
1254 printf("waveOutGetNumDevs return %u \n", count);
1255 return count;
1258 /**************************************************************************
1259 * waveOutGetDevCaps [MMSYSTEM.402]
1261 UINT WINAPI waveOutGetDevCaps(UINT uDeviceID, WAVEOUTCAPS FAR* lpCaps, UINT uSize)
1263 printf("waveOutGetDevCaps\n");
1264 return wodMessage(uDeviceID, WODM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1267 /**************************************************************************
1268 * waveOutGetErrorText [MMSYSTEM.403]
1270 UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1272 printf("waveOutGetErrorText\n");
1273 return(waveGetErrorText(uError, lpText, uSize));
1277 /**************************************************************************
1278 * waveGetErrorText [internal]
1280 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1282 LPSTR msgptr;
1283 int maxbuf;
1284 printf("waveGetErrorText(%04X, %08X, %d);\n", uError, lpText, uSize);
1285 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
1286 lpText[0] = '\0';
1287 switch(uError) {
1288 case MMSYSERR_NOERROR:
1289 msgptr = "The specified command was carried out.";
1290 break;
1291 case MMSYSERR_ERROR:
1292 msgptr = "Undefined external error.";
1293 break;
1294 case MMSYSERR_BADDEVICEID:
1295 msgptr = "A device ID has been used that is out of range for your system.";
1296 break;
1297 case MMSYSERR_NOTENABLED:
1298 msgptr = "The driver was not enabled.";
1299 break;
1300 case MMSYSERR_ALLOCATED:
1301 msgptr = "The specified device is already in use. Wait until it is free, and then try again.";
1302 break;
1303 case MMSYSERR_INVALHANDLE:
1304 msgptr = "The specified device handle is invalid.";
1305 break;
1306 case MMSYSERR_NODRIVER:
1307 msgptr = "There is no driver installed on your system !\n";
1308 break;
1309 case MMSYSERR_NOMEM:
1310 msgptr = "Not enough memory available for this task. Quit one or more applications to increase available memory, and then try again.";
1311 break;
1312 case MMSYSERR_NOTSUPPORTED:
1313 msgptr = "This function is not supported. Use the Capabilities function to determine which functions and messages the driver supports.";
1314 break;
1315 case MMSYSERR_BADERRNUM:
1316 msgptr = "An error number was specified that is not defined in the system.";
1317 break;
1318 case MMSYSERR_INVALFLAG:
1319 msgptr = "An invalid flag was passed to a system function.";
1320 break;
1321 case MMSYSERR_INVALPARAM:
1322 msgptr = "An invalid parameter was passed to a system function.";
1323 break;
1324 case WAVERR_BADFORMAT:
1325 msgptr = "The specified format is not supported or cannot be translated. Use the Capabilities function to determine the supported formats";
1326 break;
1327 case WAVERR_STILLPLAYING:
1328 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
1329 break;
1330 case WAVERR_UNPREPARED:
1331 msgptr = "The wave header was not prepared. Use the Prepare function to prepare the header, and then try again.";
1332 break;
1333 case WAVERR_SYNC:
1334 msgptr = "Cannot open the device without using the WAVE_ALLOWSYNC flag. Use the flag, and then try again.";
1335 break;
1336 default:
1337 msgptr = "Unkown MMSYSTEM Error !\n";
1338 break;
1340 maxbuf = min(uSize - 1, strlen(msgptr));
1341 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
1342 lpText[maxbuf + 1] = '\0';
1343 return(TRUE);
1346 /**************************************************************************
1347 * waveOutOpen [MMSYSTEM.404]
1349 UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
1350 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1352 HWAVE hWaveOut;
1353 LPWAVEOPENDESC lpDesc;
1354 DWORD dwRet;
1355 BOOL bMapperFlg = FALSE;
1356 printf("waveOutOpen(%08X, %d, %08X, %08X, %08X, %08X);\n",
1357 lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1358 if (dwFlags & WAVE_FORMAT_QUERY) {
1359 printf("waveOutOpen // WAVE_FORMAT_QUERY requested !\n");
1361 if (uDeviceID == (UINT)WAVE_MAPPER) {
1362 printf("waveOutOpen // WAVE_MAPPER mode requested !\n");
1363 bMapperFlg = TRUE;
1364 uDeviceID = 0;
1366 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1367 hWaveOut = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1368 if (lphWaveOut != NULL) *lphWaveOut = hWaveOut;
1369 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1370 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1371 lpDesc->hWave = hWaveOut;
1372 lpDesc->lpFormat = lpFormat;
1373 lpDesc->dwCallBack = dwCallback;
1374 lpDesc->dwInstance = dwInstance;
1375 while(uDeviceID < MAXWAVEDRIVERS) {
1376 dwRet = wodMessage(uDeviceID, WODM_OPEN,
1377 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1378 if (dwRet == MMSYSERR_NOERROR) break;
1379 if (!bMapperFlg) break;
1380 uDeviceID++;
1381 printf("waveOutOpen // WAVE_MAPPER mode ! try next driver...\n");
1383 if (dwFlags & WAVE_FORMAT_QUERY) {
1384 printf("waveOutOpen // End of WAVE_FORMAT_QUERY !\n");
1385 waveOutClose(hWaveOut);
1387 return dwRet;
1390 /**************************************************************************
1391 * waveOutClose [MMSYSTEM.405]
1393 UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
1395 LPWAVEOPENDESC lpDesc;
1396 printf("waveOutClose(%04X)\n", hWaveOut);
1397 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1398 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1399 return wodMessage(0, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1402 /**************************************************************************
1403 * waveOutPrepareHeader [MMSYSTEM.406]
1405 UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
1406 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1408 LPWAVEOPENDESC lpDesc;
1409 printf("waveOutPrepareHeader(%04X, %08X, %u);\n",
1410 hWaveOut, lpWaveOutHdr, uSize);
1411 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1412 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1413 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1414 (DWORD)lpWaveOutHdr, uSize);
1417 /**************************************************************************
1418 * waveOutUnprepareHeader [MMSYSTEM.407]
1420 UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
1421 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1423 LPWAVEOPENDESC lpDesc;
1424 printf("waveOutUnprepareHeader(%04X, %08X, %u);\n",
1425 hWaveOut, lpWaveOutHdr, uSize);
1426 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1427 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1428 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1429 (DWORD)lpWaveOutHdr, uSize);
1432 /**************************************************************************
1433 * waveOutWrite [MMSYSTEM.408]
1435 UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1437 LPWAVEOPENDESC lpDesc;
1438 printf("waveOutWrite(%04X, %08X, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
1439 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1440 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1441 return wodMessage(0, WODM_WRITE, lpDesc->dwInstance,
1442 (DWORD)lpWaveOutHdr, uSize);
1445 /**************************************************************************
1446 * waveOutPause [MMSYSTEM.409]
1448 UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
1450 printf("waveOutPause(%04X)\n", hWaveOut);
1451 return MMSYSERR_INVALHANDLE;
1454 /**************************************************************************
1455 * waveOutRestart [MMSYSTEM.410]
1457 UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
1459 printf("waveOutRestart(%04X)\n", hWaveOut);
1460 return MMSYSERR_INVALHANDLE;
1463 /**************************************************************************
1464 * waveOutReset [MMSYSTEM.411]
1466 UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
1468 printf("waveOutReset(%04X)\n", hWaveOut);
1469 return MMSYSERR_INVALHANDLE;
1472 /**************************************************************************
1473 * waveOutGetPosition [MMSYSTEM.412]
1475 UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, MMTIME FAR* lpTime, UINT uSize)
1477 LPWAVEOPENDESC lpDesc;
1478 printf("waveOutGetPosition(%04X, %08X, %u);\n", hWaveOut, lpTime, uSize);
1479 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1480 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1481 return wodMessage(0, WODM_GETPOS, lpDesc->dwInstance,
1482 (DWORD)lpTime, (DWORD)uSize);
1485 /**************************************************************************
1486 * waveOutGetPitch [MMSYSTEM.413]
1488 UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, DWORD FAR* lpdwPitch)
1490 printf("waveOutGetPitch\n");
1491 return MMSYSERR_INVALHANDLE;
1494 /**************************************************************************
1495 * waveOutSetPitch [MMSYSTEM.414]
1497 UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dwPitch)
1499 printf("waveOutSetPitch\n");
1500 return MMSYSERR_INVALHANDLE;
1503 /**************************************************************************
1504 * waveOutGetVolume [MMSYSTEM.415]
1506 UINT WINAPI waveOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
1508 printf("waveOutGetVolume\n");
1509 return MMSYSERR_INVALHANDLE;
1512 /**************************************************************************
1513 * waveOutSetVolume [MMSYSTEM.416]
1515 UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume)
1517 printf("waveOutSetVolume\n");
1518 return MMSYSERR_INVALHANDLE;
1521 /**************************************************************************
1522 * waveOutGetPlaybackRate [MMSYSTEM.417]
1524 UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, DWORD FAR* lpdwRate)
1526 printf("waveOutGetPlaybackRate\n");
1527 return MMSYSERR_INVALHANDLE;
1530 /**************************************************************************
1531 * waveOutSetPlaybackRate [MMSYSTEM.418]
1533 UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dwRate)
1535 printf("waveOutSetPlaybackRate\n");
1536 return MMSYSERR_INVALHANDLE;
1539 /**************************************************************************
1540 * waveOutBreakLoop [MMSYSTEM.419]
1542 UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
1544 printf("waveOutBreakLoop(%04X)\n", hWaveOut);
1545 return MMSYSERR_INVALHANDLE;
1548 /**************************************************************************
1549 * waveOutGetID [MMSYSTEM.420]
1551 UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT FAR* lpuDeviceID)
1553 printf("waveOutGetID\n");
1554 return MMSYSERR_INVALHANDLE;
1557 /**************************************************************************
1558 * waveOutMessage [MMSYSTEM.421]
1560 DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
1561 DWORD dwParam1, DWORD dwParam2)
1563 LPWAVEOPENDESC lpDesc;
1564 printf("waveOutMessage(%04X, %04X, %08X, %08X)\n",
1565 hWaveOut, uMessage, dwParam1, dwParam2);
1566 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1567 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1568 return wodMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1571 /**************************************************************************
1572 * waveInGetNumDevs [MMSYSTEM.501]
1574 UINT WINAPI waveInGetNumDevs()
1576 UINT count = 0;
1577 printf("waveInGetNumDevs\n");
1578 count += widMessage(0, WIDM_GETNUMDEVS, 0L, 0L, 0L);
1579 printf("waveInGetNumDevs return %u \n", count);
1580 return count;
1584 /**************************************************************************
1585 * waveInGetDevCaps [MMSYSTEM.502]
1587 UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps, UINT uSize)
1589 printf("waveInGetDevCaps\n");
1590 return widMessage(uDeviceID, WIDM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1594 /**************************************************************************
1595 * waveInGetErrorText [MMSYSTEM.503]
1597 UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1599 printf("waveInGetErrorText\n");
1600 return(waveGetErrorText(uError, lpText, uSize));
1604 /**************************************************************************
1605 * waveInOpen [MMSYSTEM.504]
1607 UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
1608 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1610 HWAVE hWaveIn;
1611 LPWAVEOPENDESC lpDesc;
1612 DWORD dwRet;
1613 BOOL bMapperFlg = FALSE;
1614 printf("waveInOpen(%08X, %d, %08X, %08X, %08X, %08X);\n",
1615 lphWaveIn, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1616 if (dwFlags & WAVE_FORMAT_QUERY) {
1617 printf("waveInOpen // WAVE_FORMAT_QUERY requested !\n");
1619 if (uDeviceID == (UINT)WAVE_MAPPER) {
1620 printf("waveInOpen // WAVE_MAPPER mode requested !\n");
1621 bMapperFlg = TRUE;
1622 uDeviceID = 0;
1624 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1625 hWaveIn = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1626 if (lphWaveIn != NULL) *lphWaveIn = hWaveIn;
1627 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1628 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1629 lpDesc->hWave = hWaveIn;
1630 lpDesc->lpFormat = lpFormat;
1631 lpDesc->dwCallBack = dwCallback;
1632 lpDesc->dwInstance = dwInstance;
1633 while(uDeviceID < MAXWAVEDRIVERS) {
1634 dwRet = widMessage(uDeviceID, WIDM_OPEN,
1635 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1636 if (dwRet == MMSYSERR_NOERROR) break;
1637 if (!bMapperFlg) break;
1638 uDeviceID++;
1639 printf("waveInOpen // WAVE_MAPPER mode ! try next driver...\n");
1641 if (dwFlags & WAVE_FORMAT_QUERY) {
1642 printf("waveInOpen // End of WAVE_FORMAT_QUERY !\n");
1643 waveInClose(hWaveIn);
1645 return dwRet;
1649 /**************************************************************************
1650 * waveInClose [MMSYSTEM.505]
1652 UINT WINAPI waveInClose(HWAVEIN hWaveIn)
1654 LPWAVEOPENDESC lpDesc;
1655 printf("waveInClose(%04X)\n", hWaveIn);
1656 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1657 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1658 return widMessage(0, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1662 /**************************************************************************
1663 * waveInPrepareHeader [MMSYSTEM.506]
1665 UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
1666 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1668 LPWAVEOPENDESC lpDesc;
1669 printf("waveInPrepareHeader(%04X, %08X, %u);\n",
1670 hWaveIn, lpWaveInHdr, uSize);
1671 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1672 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1673 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1674 lpWaveInHdr->lpNext = NULL;
1675 lpWaveInHdr->dwBytesRecorded = 0;
1676 printf("waveInPrepareHeader // lpData=%08X size=%u \n",
1677 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1678 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1679 (DWORD)lpWaveInHdr, uSize);
1683 /**************************************************************************
1684 * waveInUnprepareHeader [MMSYSTEM.507]
1686 UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn,
1687 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1689 LPWAVEOPENDESC lpDesc;
1690 printf("waveInUnprepareHeader(%04X, %08X, %u);\n",
1691 hWaveIn, lpWaveInHdr, uSize);
1692 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1693 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1694 USER_HEAP_FREE(HIWORD((DWORD)lpWaveInHdr->lpData));
1695 lpWaveInHdr->lpData = NULL;
1696 lpWaveInHdr->lpNext = NULL;
1697 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1698 (DWORD)lpWaveInHdr, uSize);
1702 /**************************************************************************
1703 * waveInAddBuffer [MMSYSTEM.508]
1705 UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
1706 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1708 LPWAVEOPENDESC lpDesc;
1709 printf("waveInAddBuffer(%04X, %08X, %u);\n", hWaveIn, lpWaveInHdr, uSize);
1710 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1711 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1712 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1713 lpWaveInHdr->lpNext = NULL;
1714 lpWaveInHdr->dwBytesRecorded = 0;
1715 printf("waveInAddBuffer // lpData=%08X size=%u \n",
1716 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1717 return widMessage(0, WIDM_ADDBUFFER, lpDesc->dwInstance,
1718 (DWORD)lpWaveInHdr, uSize);
1722 /**************************************************************************
1723 * waveInStart [MMSYSTEM.509]
1725 UINT WINAPI waveInStart(HWAVEIN hWaveIn)
1727 LPWAVEOPENDESC lpDesc;
1728 printf("waveInStart(%04X)\n", hWaveIn);
1729 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1730 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1731 return widMessage(0, WIDM_START, lpDesc->dwInstance, 0L, 0L);
1735 /**************************************************************************
1736 * waveInStop [MMSYSTEM.510]
1738 UINT WINAPI waveInStop(HWAVEIN hWaveIn)
1740 LPWAVEOPENDESC lpDesc;
1741 printf("waveInStop(%04X)\n", hWaveIn);
1742 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1743 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1744 return widMessage(0, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
1748 /**************************************************************************
1749 * waveInReset [MMSYSTEM.511]
1751 UINT WINAPI waveInReset(HWAVEIN hWaveIn)
1753 LPWAVEOPENDESC lpDesc;
1754 printf("waveInReset(%04X)\n", hWaveIn);
1755 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1756 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1757 return widMessage(0, WIDM_RESET, lpDesc->dwInstance, 0L, 0L);
1761 /**************************************************************************
1762 * waveInGetPosition [MMSYSTEM.512]
1764 UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, MMTIME FAR* lpTime, UINT uSize)
1766 LPWAVEOPENDESC lpDesc;
1767 printf("waveInGetPosition(%04X, %08X, %u);\n", hWaveIn, lpTime, uSize);
1768 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1769 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1770 return widMessage(0, WIDM_GETPOS, lpDesc->dwInstance,
1771 (DWORD)lpTime, (DWORD)uSize);
1775 /**************************************************************************
1776 * waveInGetID [MMSYSTEM.513]
1778 UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT FAR* lpuDeviceID)
1780 printf("waveInGetID\n");
1781 if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1782 return 0;
1786 /**************************************************************************
1787 * waveInMessage [MMSYSTEM.514]
1789 DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
1790 DWORD dwParam1, DWORD dwParam2)
1792 LPWAVEOPENDESC lpDesc;
1793 printf("waveInMessage(%04X, %04X, %08X, %08X)\n",
1794 hWaveIn, uMessage, dwParam1, dwParam2);
1795 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1796 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1797 return widMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1801 /**************************************************************************
1802 * MMSysTimeCallback [internal]
1804 WORD FAR PASCAL MMSysTimeCallback(HWND hWnd, WORD wMsg, int nID, DWORD dwTime)
1806 LPTIMERENTRY lpTimer = lpTimerList;
1807 mmSysTimeMS.u.ms += 33;
1808 mmSysTimeSMPTE.u.smpte.frame++;
1809 while (lpTimer != NULL) {
1810 lpTimer->wCurTime--;
1811 if (lpTimer->wCurTime == 0) {
1812 lpTimer->wCurTime = lpTimer->wDelay;
1813 if (lpTimer->lpFunc != NULL) {
1814 dprintf_mmtime(stddeb,"MMSysTimeCallback // before CallBack16 !\n");
1815 #ifdef WINELIB
1816 (*lpTimer->lpFunc)(lpTimer->wTimerID, (WORD)0,
1817 lpTimer->dwUser, (DWORD)0, (DWORD)0);
1818 #else
1819 CallBack16(lpTimer->lpFunc, 5,
1820 0, (int)lpTimer->wTimerID, 0, (int)0,
1821 2, lpTimer->dwUser, 2, 0, 2, 0);
1822 #endif
1823 dprintf_mmtime(stddeb, "MMSysTimeCallback // after CallBack16 !\n");
1824 fflush(stdout);
1826 if (lpTimer->wFlags & TIME_ONESHOT)
1827 timeKillEvent(lpTimer->wTimerID);
1829 lpTimer = lpTimer->Next;
1831 return 0;
1834 /**************************************************************************
1835 * StartMMTime [internal]
1837 void StartMMTime()
1839 if (!mmTimeStarted) {
1840 mmTimeStarted = TRUE;
1841 mmSysTimeMS.wType = TIME_MS;
1842 mmSysTimeMS.u.ms = 0;
1843 mmSysTimeSMPTE.wType = TIME_SMPTE;
1844 mmSysTimeSMPTE.u.smpte.hour = 0;
1845 mmSysTimeSMPTE.u.smpte.min = 0;
1846 mmSysTimeSMPTE.u.smpte.sec = 0;
1847 mmSysTimeSMPTE.u.smpte.frame = 0;
1848 mmSysTimeSMPTE.u.smpte.fps = 0;
1849 mmSysTimeSMPTE.u.smpte.dummy = 0;
1850 SetTimer(0, 1, 33, (FARPROC)MMSysTimeCallback);
1854 /**************************************************************************
1855 * timeGetSystemTime [MMSYSTEM.601]
1857 WORD timeGetSystemTime(LPMMTIME lpTime, WORD wSize)
1859 printf("timeGetSystemTime(%08X, %u);\n", lpTime, wSize);
1860 if (!mmTimeStarted) StartMMTime();
1861 return 0;
1864 /**************************************************************************
1865 * timeSetEvent [MMSYSTEM.602]
1867 WORD timeSetEvent(WORD wDelay, WORD wResol,
1868 LPTIMECALLBACK lpFunc,
1869 DWORD dwUser, WORD wFlags)
1871 WORD wNewID = 0;
1872 LPTIMERENTRY lpNewTimer;
1873 LPTIMERENTRY lpTimer = lpTimerList;
1874 printf("timeSetEvent(%u, %u, %08X, %08X, %04X);\n",
1875 wDelay, wResol, lpFunc, dwUser, wFlags);
1876 if (!mmTimeStarted) StartMMTime();
1877 lpNewTimer = (LPTIMERENTRY) malloc(sizeof(TIMERENTRY));
1878 if (lpNewTimer == NULL) return 0;
1879 while (lpTimer != NULL) {
1880 wNewID = max(wNewID, lpTimer->wTimerID);
1881 if (lpTimer->Next == NULL) break;
1882 lpTimer = lpTimer->Next;
1884 if (lpTimerList == NULL) {
1885 lpTimerList = lpNewTimer;
1886 lpNewTimer->Prev == NULL;
1888 else {
1889 lpTimer->Next == lpNewTimer;
1890 lpNewTimer->Prev == lpTimer;
1892 lpNewTimer->Next = NULL;
1893 lpNewTimer->wTimerID = wNewID + 1;
1894 lpNewTimer->wCurTime = wDelay;
1895 lpNewTimer->wDelay = wDelay;
1896 lpNewTimer->wResol = wResol;
1897 lpNewTimer->lpFunc = (FARPROC)lpFunc;
1898 lpNewTimer->dwUser = dwUser;
1899 lpNewTimer->wFlags = wFlags;
1900 return lpNewTimer->wTimerID;
1903 /**************************************************************************
1904 * timeKillEvent [MMSYSTEM.603]
1906 WORD timeKillEvent(WORD wID)
1908 LPTIMERENTRY lpTimer = lpTimerList;
1909 while (lpTimer != NULL) {
1910 if (wID == lpTimer->wTimerID) {
1911 if (lpTimer->Prev != NULL) lpTimer->Prev->Next = lpTimer->Next;
1912 if (lpTimer->Next != NULL) lpTimer->Next->Prev = lpTimer->Prev;
1913 free(lpTimer);
1914 return TRUE;
1916 lpTimer = lpTimer->Next;
1918 return 0;
1921 /**************************************************************************
1922 * timeGetDevCaps [MMSYSTEM.604]
1924 WORD timeGetDevCaps(LPTIMECAPS lpCaps, WORD wSize)
1926 printf("timeGetDevCaps(%08X, %u) !\n", lpCaps, wSize);
1927 return 0;
1930 /**************************************************************************
1931 * timeBeginPeriod [MMSYSTEM.605]
1933 WORD timeBeginPeriod(WORD wPeriod)
1935 printf("timeBeginPeriod(%u) !\n", wPeriod);
1936 if (!mmTimeStarted) StartMMTime();
1937 return 0;
1940 /**************************************************************************
1941 * timeEndPeriod [MMSYSTEM.606]
1943 WORD timeEndPeriod(WORD wPeriod)
1945 printf("timeEndPeriod(%u) !\n", wPeriod);
1946 return 0;
1949 /**************************************************************************
1950 * timeGetTime [MMSYSTEM.607]
1952 DWORD timeGetTime()
1954 printf("timeGetTime(); !\n");
1955 if (!mmTimeStarted) StartMMTime();
1956 return 0;
1960 /**************************************************************************
1961 * mmioOpen [MMSYSTEM.1210]
1963 HMMIO WINAPI mmioOpen(LPSTR szFileName, MMIOINFO FAR* lpmmioinfo, DWORD dwOpenFlags)
1965 int hFile;
1966 HANDLE hmmio;
1967 OFSTRUCT ofs;
1968 LPMMIOINFO lpmminfo;
1969 printf("mmioOpen('%s', %08X, %08X);\n", szFileName, lpmmioinfo, dwOpenFlags);
1970 hFile = OpenFile(szFileName, &ofs, dwOpenFlags);
1971 if (hFile == -1) return 0;
1972 hmmio = GlobalAlloc(GMEM_MOVEABLE, sizeof(MMIOINFO));
1973 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
1974 if (lpmminfo == NULL) return 0;
1975 memset(lpmminfo, 0, sizeof(MMIOINFO));
1976 lpmminfo->hmmio = hmmio;
1977 lpmminfo->dwReserved2 = MAKELONG(hFile, 0);
1978 GlobalUnlock(hmmio);
1979 return (HMMIO)hmmio;
1984 /**************************************************************************
1985 * mmioClose [MMSYSTEM.1211]
1987 UINT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
1989 LPMMIOINFO lpmminfo;
1990 printf("mmioClose(%04X, %04X);\n", hmmio, uFlags);
1991 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
1992 if (lpmminfo == NULL) return 0;
1993 _lclose(LOWORD(lpmminfo->dwReserved2));
1994 GlobalUnlock(hmmio);
1995 GlobalFree(hmmio);
1996 return 0;
2001 /**************************************************************************
2002 * mmioRead [MMSYSTEM.1212]
2004 LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
2006 int count;
2007 LPMMIOINFO lpmminfo;
2008 dprintf_mmio(stddeb, "mmioRead(%04X, %08X, %ld);\n", hmmio, pch, cch);
2009 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2010 if (lpmminfo == NULL) return 0;
2011 count = _lread(LOWORD(lpmminfo->dwReserved2), pch, cch);
2012 GlobalUnlock(hmmio);
2013 return count;
2018 /**************************************************************************
2019 * mmioWrite [MMSYSTEM.1213]
2021 LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
2023 int count;
2024 LPMMIOINFO lpmminfo;
2025 printf("mmioWrite(%04X, %08X, %ld);\n", hmmio, pch, cch);
2026 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2027 if (lpmminfo == NULL) return 0;
2028 count = _lwrite(LOWORD(lpmminfo->dwReserved2), (LPSTR)pch, cch);
2029 GlobalUnlock(hmmio);
2030 return count;
2033 /**************************************************************************
2034 * mmioSeek [MMSYSTEM.1214]
2036 LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin)
2038 int count;
2039 LPMMIOINFO lpmminfo;
2040 printf("mmioSeek(%04X, %08X, %d);\n", hmmio, lOffset, iOrigin);
2041 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2042 if (lpmminfo == NULL) return 0;
2043 count = _llseek(LOWORD(lpmminfo->dwReserved2), lOffset, iOrigin);
2044 GlobalUnlock(hmmio);
2045 return count;
2048 /**************************************************************************
2049 * mmioGetInfo [MMSYSTEM.1215]
2051 UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2053 LPMMIOINFO lpmminfo;
2054 printf("mmioGetInfo\n");
2055 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2056 if (lpmminfo == NULL) return 0;
2057 memcpy(lpmmioinfo, lpmminfo, sizeof(MMIOINFO));
2058 GlobalUnlock(hmmio);
2059 return 0;
2062 /**************************************************************************
2063 * mmioSetInfo [MMSYSTEM.1216]
2065 UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2067 LPMMIOINFO lpmminfo;
2068 printf("mmioSetInfo\n");
2069 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2070 if (lpmminfo == NULL) return 0;
2071 GlobalUnlock(hmmio);
2072 return 0;
2075 /**************************************************************************
2076 * mmioSetBuffer [MMSYSTEM.1217]
2078 UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer,
2079 LONG cchBuffer, UINT uFlags)
2081 printf("mmioSetBuffer\n");
2082 return 0;
2085 /**************************************************************************
2086 * mmioFlush [MMSYSTEM.1218]
2088 UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags)
2090 LPMMIOINFO lpmminfo;
2091 printf("mmioFlush(%04X, %04X)\n", hmmio, uFlags);
2092 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2093 if (lpmminfo == NULL) return 0;
2094 GlobalUnlock(hmmio);
2095 return 0;
2098 /**************************************************************************
2099 * mmioAdvance [MMSYSTEM.1219]
2101 UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2103 int count = 0;
2104 LPMMIOINFO lpmminfo;
2105 printf("mmioAdvance\n");
2106 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2107 if (lpmminfo == NULL) return 0;
2108 if (uFlags == MMIO_READ) {
2109 count = _lread(LOWORD(lpmminfo->dwReserved2),
2110 lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer);
2112 if (uFlags == MMIO_WRITE) {
2113 count = _lwrite(LOWORD(lpmminfo->dwReserved2),
2114 lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer);
2116 lpmmioinfo->pchNext += count;
2117 GlobalUnlock(hmmio);
2118 lpmminfo->lDiskOffset = _llseek(LOWORD(lpmminfo->dwReserved2), 0, SEEK_CUR);
2119 return 0;
2122 /**************************************************************************
2123 * mmioStringToFOURCC [MMSYSTEM.1220]
2125 FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags)
2127 printf("mmioStringToFOURCC\n");
2128 return 0;
2131 /**************************************************************************
2132 * mmioInstallIOProc [MMSYSTEM.1221]
2134 LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc,
2135 LPMMIOPROC pIOProc, DWORD dwFlags)
2137 printf("mmioInstallIOProc\n");
2138 return 0;
2141 /**************************************************************************
2142 * mmioSendMessage [MMSYSTEM.1222]
2144 LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
2145 LPARAM lParam1, LPARAM lParam2)
2147 printf("mmioSendMessage\n");
2148 return 0;
2151 /**************************************************************************
2152 * mmioDescend [MMSYSTEM.1223]
2154 UINT WINAPI mmioDescend(HMMIO hmmio, MMCKINFO FAR* lpck,
2155 const MMCKINFO FAR* lpckParent, UINT uFlags)
2157 DWORD dwfcc, dwOldPos;
2158 LPMMIOINFO lpmminfo;
2159 dprintf_mmio(stddeb, "mmioDescend(%04X, %08X, %08X, %04X);\n",
2160 hmmio, lpck, lpckParent, uFlags);
2161 if (lpck == NULL) return 0;
2162 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2163 if (lpmminfo == NULL) return 0;
2164 dwfcc = lpck->ckid;
2165 dwOldPos = _llseek(LOWORD(lpmminfo->dwReserved2), 0, SEEK_CUR);
2166 if (lpckParent != NULL) {
2167 dprintf_mmio(stddeb, "mmioDescend // seek inside parent at %ld !\n", lpckParent->dwDataOffset);
2168 dwOldPos = _llseek(LOWORD(lpmminfo->dwReserved2),
2169 lpckParent->dwDataOffset, SEEK_SET);
2171 if ((uFlags & MMIO_FINDCHUNK) || (uFlags & MMIO_FINDRIFF) ||
2172 (uFlags & MMIO_FINDLIST)) {
2173 dprintf_mmio(stddeb, "mmioDescend // MMIO_FINDxxxx dwfcc=%08X !\n", dwfcc);
2174 while (TRUE) {
2175 if (_lread(LOWORD(lpmminfo->dwReserved2), (LPSTR)lpck,
2176 sizeof(MMCKINFO)) < sizeof(MMCKINFO)) {
2177 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2178 GlobalUnlock(hmmio);
2179 return MMIOERR_CHUNKNOTFOUND;
2181 dprintf_mmio(stddeb, "mmioDescend // dwfcc=%08X ckid=%08X cksize=%08X !\n",
2182 dwfcc, lpck->ckid, lpck->cksize);
2183 if (dwfcc == lpck->ckid) break;
2184 dwOldPos += lpck->cksize + 2 * sizeof(DWORD);
2185 if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST)
2186 dwOldPos += sizeof(DWORD);
2187 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2190 else {
2191 if (_lread(LOWORD(lpmminfo->dwReserved2), (LPSTR)lpck,
2192 sizeof(MMCKINFO)) < sizeof(MMCKINFO)) {
2193 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2194 GlobalUnlock(hmmio);
2195 return MMIOERR_CHUNKNOTFOUND;
2198 GlobalUnlock(hmmio);
2199 lpck->dwDataOffset = dwOldPos + 2 * sizeof(DWORD);
2200 if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST)
2201 lpck->dwDataOffset += sizeof(DWORD);
2202 lpmminfo->lDiskOffset = _llseek(LOWORD(lpmminfo->dwReserved2),
2203 lpck->dwDataOffset, SEEK_SET);
2204 dprintf_mmio(stddeb, "mmioDescend // lpck->ckid=%08X lpck->cksize=%ld !\n",
2205 lpck->ckid, lpck->cksize);
2206 printf("mmioDescend // lpck->fccType=%08X !\n", lpck->fccType);
2207 return 0;
2210 /**************************************************************************
2211 * mmioAscend [MMSYSTEM.1224]
2213 UINT WINAPI mmioAscend(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
2215 printf("mmioAscend\n");
2216 return 0;
2219 /**************************************************************************
2220 * mmioCreateChunk [MMSYSTEM.1225]
2222 UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
2224 printf("mmioCreateChunk\n");
2225 return 0;
2229 /**************************************************************************
2230 * mmioRename [MMSYSTEM.1226]
2232 UINT WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
2233 MMIOINFO FAR* lpmmioinfo, DWORD dwRenameFlags)
2235 printf("mmioRename('%s', '%s', %08X, %08X);\n",
2236 szFileName, szNewFileName, lpmmioinfo, dwRenameFlags);
2237 return 0;
2240 /**************************************************************************
2241 * DrvOpen [MMSYSTEM.1100]
2243 HDRVR DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
2245 printf("DrvOpen('%s', '%s', %08X);\n",
2246 lpDriverName, lpSectionName, lParam);
2247 return OpenDriver(lpDriverName, lpSectionName, lParam);
2251 /**************************************************************************
2252 * DrvClose [MMSYSTEM.1101]
2254 LRESULT DrvClose(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2)
2256 printf("DrvClose(%04X, %08X, %08X);\n", hDrvr, lParam1, lParam2);
2257 return CloseDriver(hDrvr, lParam1, lParam2);
2261 /**************************************************************************
2262 * DrvSendMessage [MMSYSTEM.1102]
2264 LRESULT WINAPI DrvSendMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2)
2266 DWORD dwDevID = 0;
2267 printf("DrvSendMessage(%04X, %04X, %08X, %08X);\n",
2268 hDriver, msg, lParam1, lParam2);
2269 #ifndef WINELIB
2270 return CDAUDIO_DriverProc(dwDevID, hDriver, msg, lParam1, lParam2);
2271 #endif
2274 /**************************************************************************
2275 * DrvGetModuleHandle [MMSYSTEM.1103]
2277 HANDLE DrvGetModuleHandle(HDRVR hDrvr)
2279 printf("DrvGetModuleHandle(%04X);\n", hDrvr);
2283 /**************************************************************************
2284 * DrvDefDriverProc [MMSYSTEM.1104]
2286 LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
2287 DWORD dwParam1, DWORD dwParam2)
2289 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
2293 #endif /* #ifdef WINELIB */