Release 950319
[wine.git] / multimedia / mmsystem.c
blob27a2b3c004c5ca351eb98383e9d45646d2a30ba0
1 /*
2 * MMSYTEM functions
4 * Copyright 1993 Martin Ayotte
6 static char Copyright[] = "Copyright Martin Ayotte, 1993";
7 */
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 "windows.h"
16 #include "ldt.h"
17 #include "callback.h"
18 #include "user.h"
19 #include "driver.h"
20 #include "mmsystem.h"
21 #include "stddebug.h"
22 /* #define DEBUG_MCI */
23 /* #undef DEBUG_MCI */
24 /* #define DEBUG_MMTIME */
25 /* #undef DEBUG_MMTIME */
26 /* #define DEBUG_MMIO */
27 /* #undef DEBUG_MMIO */
28 #include "debug.h"
31 static BOOL mmTimeStarted = FALSE;
32 static MMTIME mmSysTimeMS;
33 static MMTIME mmSysTimeSMPTE;
35 typedef struct tagTIMERENTRY {
36 WORD wDelay;
37 WORD wResol;
38 FARPROC lpFunc;
39 DWORD dwUser;
40 WORD wFlags;
41 WORD wTimerID;
42 WORD wCurTime;
43 struct tagTIMERENTRY *Next;
44 struct tagTIMERENTRY *Prev;
45 } TIMERENTRY;
46 typedef TIMERENTRY *LPTIMERENTRY;
48 static LPTIMERENTRY lpTimerList = NULL;
50 static MCI_OPEN_DRIVER_PARMS mciDrv[MAXMCIDRIVERS];
52 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
53 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
54 LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
55 DWORD dwParam1, DWORD dwParam2);
57 LRESULT WAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
58 DWORD dwParam1, DWORD dwParam2);
59 LRESULT MIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
60 DWORD dwParam1, DWORD dwParam2);
61 LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
62 DWORD dwParam1, DWORD dwParam2);
63 LRESULT ANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
64 DWORD dwParam1, DWORD dwParam2);
66 /**************************************************************************
67 * MMSYSTEM_WEP [MMSYSTEM.1]
69 int MMSYSTEM_WEP(HANDLE hInstance, WORD wDataSeg,
70 WORD cbHeapSize, LPSTR lpCmdLine)
72 printf("MMSYSTEM DLL INIT ... hInst=%04X \n", hInstance);
73 return(TRUE);
76 /**************************************************************************
77 * sndPlaySound [MMSYSTEM.2]
79 BOOL WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT uFlags)
81 HMMIO hmmio;
82 MMCKINFO mmckInfo;
83 MMCKINFO ckMainRIFF;
84 PCMWAVEFORMAT pcmWaveFormat;
85 int count;
86 WAVEHDR WaveHdr;
87 WAVEOPENDESC WaveDesc;
88 DWORD dwRet;
89 char str[128];
90 LPSTR ptr;
91 printf("sndPlaySound // SoundName='%s' uFlags=%04X !\n",
92 lpszSoundName, uFlags);
93 if (lpszSoundName == NULL) {
94 printf("sndPlaySound // Stop !\n");
95 return FALSE;
97 hmmio = mmioOpen((LPSTR)lpszSoundName, NULL,
98 MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
99 if (hmmio == 0) {
100 printf("sndPlaySound // searching in SystemSound List !\n");
101 GetProfileString("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
102 if (strlen(str) == 0) return FALSE;
103 if ( (ptr = (LPSTR)strchr(str, ',')) != NULL) *ptr = '\0';
104 hmmio = mmioOpen(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
105 if (hmmio == 0) {
106 printf("sndPlaySound // can't find SystemSound='%s' !\n", str);
107 return FALSE;
110 if (mmioDescend(hmmio, &ckMainRIFF, NULL, 0) != 0) {
111 ErrSND: if (hmmio != 0) mmioClose(hmmio, 0);
112 return FALSE;
114 printf("sndPlaySound // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
115 (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
116 ckMainRIFF.cksize);
117 if ((ckMainRIFF.ckid != FOURCC_RIFF) ||
118 (ckMainRIFF.fccType != mmioFOURCC('W', 'A', 'V', 'E'))) goto ErrSND;
119 mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
120 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) goto ErrSND;
121 printf("sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
122 (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
123 mmckInfo.cksize);
124 if (mmioRead(hmmio, (HPSTR) &pcmWaveFormat,
125 (long) sizeof(PCMWAVEFORMAT)) != (long) sizeof(PCMWAVEFORMAT)) goto ErrSND;
126 mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
127 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) goto ErrSND;
128 printf("sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
129 (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
130 mmckInfo.cksize);
131 WaveDesc.hWave = 0;
132 WaveDesc.lpFormat = (LPWAVEFORMAT)&pcmWaveFormat;
133 pcmWaveFormat.wf.wFormatTag = WAVE_FORMAT_PCM;
134 /* pcmWaveFormat.wBitsPerSample = 8;
135 pcmWaveFormat.wf.nChannels = 1;
136 pcmWaveFormat.wf.nSamplesPerSec = 11025;
137 pcmWaveFormat.wf.nBlockAlign = 1; */
138 pcmWaveFormat.wf.nAvgBytesPerSec =
139 pcmWaveFormat.wf.nSamplesPerSec * pcmWaveFormat.wf.nBlockAlign;
140 dwRet = wodMessage(0, WODM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL);
141 if (dwRet != MMSYSERR_NOERROR) {
142 printf("sndPlaySound // can't open WaveOut device !\n");
143 goto ErrSND;
145 WaveHdr.lpData = (LPSTR) malloc(64000);
146 WaveHdr.dwBufferLength = 32000;
147 WaveHdr.dwUser = 0L;
148 WaveHdr.dwFlags = 0L;
149 WaveHdr.dwLoops = 0L;
150 dwRet = wodMessage(0, WODM_PREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
151 if (dwRet != MMSYSERR_NOERROR) {
152 printf("sndPlaySound // can't prepare WaveOut device !\n");
153 free(WaveHdr.lpData);
154 goto ErrSND;
156 while(TRUE) {
157 count = mmioRead(hmmio, WaveHdr.lpData, WaveHdr.dwBufferLength);
158 if (count < 1) break;
159 WaveHdr.dwBytesRecorded = count;
160 wodMessage(0, WODM_WRITE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
162 wodMessage(0, WODM_UNPREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
163 wodMessage(0, WODM_CLOSE, 0, 0L, 0L);
164 free(WaveHdr.lpData);
165 if (hmmio != 0) mmioClose(hmmio, 0);
166 return TRUE;
169 /**************************************************************************
170 * mmsystemGetVersion [MMSYSTEM.5]
172 WORD WINAPI mmsystemGetVersion()
174 printf("mmsystemGetVersion // 0.4.0 ...?... :-) !\n");
175 return(0x0040);
178 /**************************************************************************
179 * DriverProc [MMSYSTEM.6]
181 LRESULT DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
182 DWORD dwParam1, DWORD dwParam2)
184 return DrvDefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
187 /**************************************************************************
188 * OutputDebugStr [MMSYSTEM.30]
190 void WINAPI OutputDebugStr(LPCSTR str)
192 printf("EMPTY STUB !!! OutputDebugStr('%s');\n", str);
195 /**************************************************************************
196 * DriverCallback [MMSYSTEM.31]
198 BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
199 WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
201 printf("DriverCallback(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n",
202 dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
203 switch(uFlags & DCB_TYPEMASK) {
204 case DCB_NULL:
205 printf("DriverCallback() // CALLBACK_NULL !\n");
206 break;
207 case DCB_WINDOW:
208 printf("DriverCallback() // CALLBACK_WINDOW !\n");
209 break;
210 case DCB_TASK:
211 printf("DriverCallback() // CALLBACK_TASK !\n");
212 break;
213 case DCB_FUNCTION:
214 printf("DriverCallback() // CALLBACK_FUNCTION !\n");
215 break;
217 return TRUE;
220 /**************************************************************************
221 * JoyGetNumDevs [MMSYSTEM.101]
223 WORD JoyGetNumDevs()
225 printf("EMPTY STUB !!! JoyGetNumDevs();\n");
226 return 0;
229 /**************************************************************************
230 * JoyGetDevCaps [MMSYSTEM.102]
232 WORD JoyGetDevCaps(WORD wID, LPJOYCAPS lpCaps, WORD wSize)
234 printf("EMPTY STUB !!! JoyGetDevCaps(%04X, %p, %d);\n",
235 wID, lpCaps, wSize);
236 return MMSYSERR_NODRIVER;
239 /**************************************************************************
240 * JoyGetPos [MMSYSTEM.103]
242 WORD JoyGetPos(WORD wID, LPJOYINFO lpInfo)
244 printf("EMPTY STUB !!! JoyGetPos(%04X, %p);\n", wID, lpInfo);
245 return MMSYSERR_NODRIVER;
248 /**************************************************************************
249 * JoyGetThreshold [MMSYSTEM.104]
251 WORD JoyGetThreshold(WORD wID, LPWORD lpThreshold)
253 printf("EMPTY STUB !!! JoyGetThreshold(%04X, %p);\n", wID, lpThreshold);
254 return MMSYSERR_NODRIVER;
257 /**************************************************************************
258 * JoyReleaseCapture [MMSYSTEM.105]
260 WORD JoyReleaseCapture(WORD wID)
262 printf("EMPTY STUB !!! JoyReleaseCapture(%04X);\n", wID);
263 return MMSYSERR_NODRIVER;
266 /**************************************************************************
267 * JoySetCapture [MMSYSTEM.106]
269 WORD JoySetCapture(HWND hWnd, WORD wID, WORD wPeriod, BOOL bChanged)
271 printf("EMPTY STUB !!! JoySetCapture(%04X, %04X, %d, %d);\n",
272 hWnd, wID, wPeriod, bChanged);
273 return MMSYSERR_NODRIVER;
276 /**************************************************************************
277 * JoySetThreshold [MMSYSTEM.107]
279 WORD JoySetThreshold(WORD wID, WORD wThreshold)
281 printf("EMPTY STUB !!! JoySetThreshold(%04X, %d);\n", wID, wThreshold);
282 return MMSYSERR_NODRIVER;
285 /**************************************************************************
286 * JoySetCalibration [MMSYSTEM.109]
288 WORD JoySetCalibration(WORD wID)
290 printf("EMPTY STUB !!! JoySetCalibration(%04X);\n", wID);
291 return MMSYSERR_NODRIVER;
295 /**************************************************************************
296 * auxGetNumDevs [MMSYSTEM.350]
298 UINT WINAPI auxGetNumDevs()
300 UINT count = 0;
301 printf("auxGetNumDevs !\n");
302 count += auxMessage(0, AUXDM_GETNUMDEVS, 0L, 0L, 0L);
303 printf("auxGetNumDevs return %u \n", count);
304 return count;
307 /**************************************************************************
308 * auxGetDevCaps [MMSYSTEM.351]
310 UINT WINAPI auxGetDevCaps(UINT uDeviceID, AUXCAPS FAR* lpCaps, UINT uSize)
312 printf("auxGetDevCaps(%04X, %p, %d) !\n",
313 uDeviceID, lpCaps, uSize);
314 return auxMessage(uDeviceID, AUXDM_GETDEVCAPS,
315 0L, (DWORD)lpCaps, (DWORD)uSize);
318 /**************************************************************************
319 * auxGetVolume [MMSYSTEM.352]
321 UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
323 printf("auxGetVolume(%04X, %p) !\n", uDeviceID, lpdwVolume);
324 return auxMessage(uDeviceID, AUXDM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L);
327 /**************************************************************************
328 * auxSetVolume [MMSYSTEM.353]
330 UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume)
332 printf("auxSetVolume(%04X, %08lX) !\n", uDeviceID, dwVolume);
333 return auxMessage(uDeviceID, AUXDM_SETVOLUME, 0L, dwVolume, 0L);
336 /**************************************************************************
337 * auxOutMessage [MMSYSTEM.354]
339 DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2)
341 printf("auxOutMessage(%04X, %04X, %08lX, %08lX)\n",
342 uDeviceID, uMessage, dw1, dw2);
343 return auxMessage(uDeviceID, uMessage, 0L, dw1, dw2);
346 /**************************************************************************
347 * mciGetErrorString [MMSYSTEM.706]
349 BOOL mciGetErrorString (DWORD wError, LPSTR lpstrBuffer, UINT uLength)
351 LPSTR msgptr;
352 int maxbuf;
353 printf("mciGetErrorString(%08lX, %p, %d);\n", wError, lpstrBuffer, uLength);
354 if ((lpstrBuffer == NULL) || (uLength < 1)) return(FALSE);
355 lpstrBuffer[0] = '\0';
356 switch(wError) {
357 case MCIERR_INVALID_DEVICE_ID:
358 msgptr = "Invalid MCI device ID. Use the ID returned when opening the MCI device.";
359 break;
360 case MCIERR_UNRECOGNIZED_KEYWORD:
361 msgptr = "The driver cannot recognize the specified command parameter.";
362 break;
363 case MCIERR_UNRECOGNIZED_COMMAND:
364 msgptr = "The driver cannot recognize the specified command.";
365 break;
366 case MCIERR_HARDWARE:
367 msgptr = "There is a problem with your media device. Make sure it is working correctly or contact the device manufacturer.";
368 break;
369 case MCIERR_INVALID_DEVICE_NAME:
370 msgptr = "The specified device is not open or is not recognized by MCI.";
371 break;
372 case MCIERR_OUT_OF_MEMORY:
373 msgptr = "Not enough memory available for this task. \nQuit one or more applications to increase available memory, and then try again.";
374 break;
375 case MCIERR_DEVICE_OPEN:
376 msgptr = "The device name is already being used as an alias by this application. Use a unique alias.";
377 break;
378 case MCIERR_CANNOT_LOAD_DRIVER:
379 msgptr = "There is an undetectable problem in loading the specified device driver.";
380 break;
381 case MCIERR_MISSING_COMMAND_STRING:
382 msgptr = "No command was specified.";
383 break;
384 case MCIERR_PARAM_OVERFLOW:
385 msgptr = "The output string was to large to fit in the return buffer. Increase the size of the buffer.";
386 break;
387 case MCIERR_MISSING_STRING_ARGUMENT:
388 msgptr = "The specified command requires a character-string parameter. Please provide one.";
389 break;
390 case MCIERR_BAD_INTEGER:
391 msgptr = "The specified integer is invalid for this command.";
392 break;
393 case MCIERR_PARSER_INTERNAL:
394 msgptr = "The device driver returned an invalid return type. Check with the device manufacturer about obtaining a new driver.";
395 break;
396 case MCIERR_DRIVER_INTERNAL:
397 msgptr = "There is a problem with the device driver. Check with the device manufacturer about obtaining a new driver.";
398 break;
399 case MCIERR_MISSING_PARAMETER:
400 msgptr = "The specified command requires a parameter. Please supply one.";
401 break;
402 case MCIERR_UNSUPPORTED_FUNCTION:
403 msgptr = "The MCI device you are using does not support the specified command.";
404 break;
405 case MCIERR_FILE_NOT_FOUND:
406 msgptr = "Cannot find the specified file. Make sure the path and filename are correct.";
407 break;
408 case MCIERR_DEVICE_NOT_READY:
409 msgptr = "The device driver is not ready.";
410 break;
411 case MCIERR_INTERNAL:
412 msgptr = "A problem occurred in initializing MCI. Try restarting Windows.";
413 break;
414 case MCIERR_DRIVER:
415 msgptr = "There is a problem with the device driver. The driver has closed. Cannot access error.";
416 break;
417 case MCIERR_CANNOT_USE_ALL:
418 msgptr = "Cannot use 'all' as the device name with the specified command.";
419 break;
420 case MCIERR_MULTIPLE:
421 msgptr = "Errors occurred in more than one device. Specify each command and device separately to determine which devices caused the error";
422 break;
423 case MCIERR_EXTENSION_NOT_FOUND:
424 msgptr = "Cannot determine the device type from the given filename extension.";
425 break;
426 case MCIERR_OUTOFRANGE:
427 msgptr = "The specified parameter is out of range for the specified command.";
428 break;
429 case MCIERR_FLAGS_NOT_COMPATIBLE:
430 msgptr = "The specified parameters cannot be used together.";
431 break;
432 case MCIERR_FILE_NOT_SAVED:
433 msgptr = "Cannot save the specified file. Make sure you have enough disk space or are still connected to the network.";
434 break;
435 case MCIERR_DEVICE_TYPE_REQUIRED:
436 msgptr = "Cannot find the specified device. Make sure it is installed or that the device name is spelled correctly.";
437 break;
438 case MCIERR_DEVICE_LOCKED:
439 msgptr = "The specified device is now being closed. Wait a few seconds, and then try again.";
440 break;
441 case MCIERR_DUPLICATE_ALIAS:
442 msgptr = "The specified alias is already being used in this application. Use a unique alias.";
443 break;
444 case MCIERR_BAD_CONSTANT:
445 msgptr = "The specified parameter is invalid for this command.";
446 break;
447 case MCIERR_MUST_USE_SHAREABLE:
448 msgptr = "The device driver is already in use. To share it, use the 'shareable' parameter with each 'open' command.";
449 break;
450 case MCIERR_MISSING_DEVICE_NAME:
451 msgptr = "The specified command requires an alias, file, driver, or device name. Please supply one.";
452 break;
453 case MCIERR_BAD_TIME_FORMAT:
454 msgptr = "The specified value for the time format is invalid. Refer to the MCI documentation for valid formats.";
455 break;
456 case MCIERR_NO_CLOSING_QUOTE:
457 msgptr = "A closing double-quotation mark is missing from the parameter value. Please supply one.";
458 break;
459 case MCIERR_DUPLICATE_FLAGS:
460 msgptr = "A parameter or value was specified twice. Only specify it once.";
461 break;
462 case MCIERR_INVALID_FILE:
463 msgptr = "The specified file cannot be played on the specified MCI device. The file may be corrupt, or not in the correct format.";
464 break;
465 case MCIERR_NULL_PARAMETER_BLOCK:
466 msgptr = "A null parameter block was passed to MCI.";
467 break;
468 case MCIERR_UNNAMED_RESOURCE:
469 msgptr = "Cannot save an unnamed file. Supply a filename.";
470 break;
471 case MCIERR_NEW_REQUIRES_ALIAS:
472 msgptr = "You must specify an alias when using the 'new' parameter.";
473 break;
474 case MCIERR_NOTIFY_ON_AUTO_OPEN:
475 msgptr = "Cannot use the 'notify' flag with auto-opened devices.";
476 break;
477 case MCIERR_NO_ELEMENT_ALLOWED:
478 msgptr = "Cannot use a filename with the specified device.";
479 break;
480 case MCIERR_NONAPPLICABLE_FUNCTION:
481 msgptr = "Cannot carry out the commands in the order specified. Correct the command sequence, and then try again.";
482 break;
483 case MCIERR_ILLEGAL_FOR_AUTO_OPEN:
484 msgptr = "Cannot carry out the specified command on an auto-opened device. Wait until the device is closed, and then try again.";
485 break;
486 case MCIERR_FILENAME_REQUIRED:
487 msgptr = "The filename is invalid. Make sure the filename is not longer than 8 characters, followed by a period and an extension.";
488 break;
489 case MCIERR_EXTRA_CHARACTERS:
490 msgptr = "Cannot specify extra characters after a string enclosed in quotation marks.";
491 break;
492 case MCIERR_DEVICE_NOT_INSTALLED:
493 msgptr = "The specified device is not installed on the system. Use the Drivers option in Control Panel to install the device.";
494 break;
495 case MCIERR_GET_CD:
496 msgptr = "Cannot access the specified file or MCI device. Try changing directories or restarting your computer.";
497 break;
498 case MCIERR_SET_CD:
499 msgptr = "Cannot access the specified file or MCI device because the application cannot change directories.";
500 break;
501 case MCIERR_SET_DRIVE:
502 msgptr = "Cannot access specified file or MCI device because the application cannot change drives.";
503 break;
504 case MCIERR_DEVICE_LENGTH:
505 msgptr = "Specify a device or driver name that is less than 79 characters.";
506 break;
507 case MCIERR_DEVICE_ORD_LENGTH:
508 msgptr = "Specify a device or driver name that is less than 69 characters.";
509 break;
510 case MCIERR_NO_INTEGER:
511 msgptr = "The specified command requires an integer parameter. Please provide one.";
512 break;
513 case MCIERR_WAVE_OUTPUTSINUSE:
514 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.";
515 break;
516 case MCIERR_WAVE_SETOUTPUTINUSE:
517 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.";
518 break;
519 case MCIERR_WAVE_INPUTSINUSE:
520 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.";
521 break;
522 case MCIERR_WAVE_SETINPUTINUSE:
523 msgptr = "Cannot set the current wave device for recording because it is in use. Wait until the device is free, and then try again.";
524 break;
525 case MCIERR_WAVE_OUTPUTUNSPECIFIED:
526 msgptr = "Any compatible waveform playback device may be used.";
527 break;
528 case MCIERR_WAVE_INPUTUNSPECIFIED:
529 msgptr = "Any compatible waveform recording device may be used.";
530 break;
531 case MCIERR_WAVE_OUTPUTSUNSUITABLE:
532 msgptr = "No wave device that can play files in the current format is installed. Use the Drivers option to install the wave device.";
533 break;
534 case MCIERR_WAVE_SETOUTPUTUNSUITABLE:
535 msgptr = "The device you are trying to play to cannot recognize the current file format.";
536 break;
537 case MCIERR_WAVE_INPUTSUNSUITABLE:
538 msgptr = "No wave device that can record files in the current format is installed. Use the Drivers option to install the wave device.";
539 break;
540 case MCIERR_WAVE_SETINPUTUNSUITABLE:
541 msgptr = "The device you are trying to record from cannot recognize the current file format.";
542 break;
543 case MCIERR_NO_WINDOW:
544 msgptr = "There is no display window.";
545 break;
546 case MCIERR_CREATEWINDOW:
547 msgptr = "Could not create or use window.";
548 break;
549 case MCIERR_FILE_READ:
550 msgptr = "Cannot read the specified file. Make sure the file is still present, or check your disk or network connection.";
551 break;
552 case MCIERR_FILE_WRITE:
553 msgptr = "Cannot write to the specified file. Make sure you have enough disk space or are still connected to the network.";
554 break;
557 #define MCIERR_SEQ_DIV_INCOMPATIBLE (MCIERR_BASE + 80)
558 #define MCIERR_SEQ_PORT_INUSE (MCIERR_BASE + 81)
559 #define MCIERR_SEQ_PORT_NONEXISTENT (MCIERR_BASE + 82)
560 #define MCIERR_SEQ_PORT_MAPNODEVICE (MCIERR_BASE + 83)
561 #define MCIERR_SEQ_PORT_MISCERROR (MCIERR_BASE + 84)
562 #define MCIERR_SEQ_TIMER (MCIERR_BASE + 85)
563 #define MCIERR_SEQ_PORTUNSPECIFIED (MCIERR_BASE + 86)
564 #define MCIERR_SEQ_NOMIDIPRESENT (MCIERR_BASE + 87)
566 msg# 513 : vcr
567 msg# 514 : videodisc
568 msg# 515 : overlay
569 msg# 516 : cdaudio
570 msg# 517 : dat
571 msg# 518 : scanner
572 msg# 519 : animation
573 msg# 520 : digitalvideo
574 msg# 521 : other
575 msg# 522 : waveaudio
576 msg# 523 : sequencer
577 msg# 524 : not ready
578 msg# 525 : stopped
579 msg# 526 : playing
580 msg# 527 : recording
581 msg# 528 : seeking
582 msg# 529 : paused
583 msg# 530 : open
584 msg# 531 : false
585 msg# 532 : true
586 msg# 533 : milliseconds
587 msg# 534 : hms
588 msg# 535 : msf
589 msg# 536 : frames
590 msg# 537 : smpte 24
591 msg# 538 : smpte 25
592 msg# 539 : smpte 30
593 msg# 540 : smpte 30 drop
594 msg# 541 : bytes
595 msg# 542 : samples
596 msg# 543 : tmsf
598 default:
599 msgptr = "Unkown MCI Error !\n";
600 break;
602 maxbuf = min(uLength - 1, strlen(msgptr));
603 if (maxbuf > 0) strncpy(lpstrBuffer, msgptr, maxbuf);
604 lpstrBuffer[maxbuf + 1] = '\0';
605 return(TRUE);
609 /**************************************************************************
610 * mciDriverNotify [MMSYSTEM.711]
612 BOOL WINAPI mciDriverNotify(HWND hWndCallBack, UINT wDevID, UINT wStatus)
614 printf("mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
615 if (!IsWindow(hWndCallBack)) return FALSE;
616 PostMessage(hWndCallBack, MM_MCINOTIFY, wStatus,
617 MAKELONG(mciDrv[wDevID].wDeviceID, 0));
618 return TRUE;
621 /**************************************************************************
622 * mciOpen [internal]
624 DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lpParms)
626 char str[128];
627 DWORD dwDevTyp = 0;
628 UINT wDevID = 1;
629 printf("mciOpen(%08lX, %p)\n", dwParam, lpParms);
630 if (lpParms == NULL) return MCIERR_INTERNAL;
631 while(mciDrv[wDevID].wType != 0) {
632 if (++wDevID >= MAXMCIDRIVERS) {
633 printf("MCI_OPEN // MAXMCIDRIVERS reached !\n");
634 return MCIERR_INTERNAL;
637 if (dwParam & MCI_OPEN_TYPE) {
638 if (lpParms->lpstrDeviceType == NULL) return MCIERR_INTERNAL;
639 if (dwParam & MCI_OPEN_TYPE_ID) {
640 printf("MCI_OPEN // Dev=%p !\n", lpParms->lpstrDeviceType);
641 dwDevTyp = (DWORD)lpParms->lpstrDeviceType;
643 else {
644 printf("MCI_OPEN // Dev='%s' !\n",
645 (char*)PTR_SEG_TO_LIN(lpParms->lpstrDeviceType));
646 strcpy(str, PTR_SEG_TO_LIN(lpParms->lpstrDeviceType));
647 AnsiUpper(str);
648 if (strcmp(str, "CDAUDIO") == 0) {
649 dwDevTyp = MCI_DEVTYPE_CD_AUDIO;
651 else
652 if (strcmp(str, "WAVEAUDIO") == 0) {
653 dwDevTyp = MCI_DEVTYPE_WAVEFORM_AUDIO;
655 else
656 if (strcmp(str, "SEQUENCER") == 0) {
657 dwDevTyp = MCI_DEVTYPE_SEQUENCER;
659 else
660 if (strcmp(str, "ANIMATION1") == 0) {
661 dwDevTyp = MCI_DEVTYPE_ANIMATION;
664 mciDrv[wDevID].wType = dwDevTyp;
665 mciDrv[wDevID].wDeviceID = 1;
666 lpParms->wDeviceID = wDevID;
667 printf("MCI_OPEN // wDeviceID=%04X !\n", lpParms->wDeviceID);
668 switch(dwDevTyp) {
669 case MCI_DEVTYPE_CD_AUDIO:
670 #ifdef WINELIB
671 WINELIB_UNIMP ("CDAUDIO_DriverProc");
672 #else
673 return CDAUDIO_DriverProc(0, 0, MCI_OPEN_DRIVER,
675 dwParam, (DWORD)lpParms);
676 #endif
677 case MCI_DEVTYPE_WAVEFORM_AUDIO:
678 return WAVE_DriverProc(0, 0, MCI_OPEN_DRIVER,
679 dwParam, (DWORD)lpParms);
680 case MCI_DEVTYPE_SEQUENCER:
681 return MIDI_DriverProc(0, 0, MCI_OPEN_DRIVER,
682 dwParam, (DWORD)lpParms);
683 case MCI_DEVTYPE_ANIMATION:
684 return ANIM_DriverProc(0, 0, MCI_OPEN_DRIVER,
685 dwParam, (DWORD)lpParms);
686 case MCI_DEVTYPE_DIGITAL_VIDEO:
687 printf("MCI_OPEN // No DIGITAL_VIDEO yet !\n");
688 return MCIERR_DEVICE_NOT_INSTALLED;
689 default:
690 printf("MCI_OPEN // Invalid Device Name '%p' !\n", lpParms->lpstrDeviceType);
691 return MCIERR_INVALID_DEVICE_NAME;
694 return MCIERR_INTERNAL;
698 /**************************************************************************
699 * mciClose [internal]
701 DWORD mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
703 DWORD dwRet = MCIERR_INTERNAL;
704 printf("mciClose(%u, %08lX, %p)\n", wDevID, dwParam, lpParms);
705 switch(mciDrv[wDevID].wType) {
706 case MCI_DEVTYPE_CD_AUDIO:
707 #ifndef WINELIB
708 dwRet = CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, 0,
709 MCI_CLOSE, dwParam, (DWORD)lpParms);
710 #endif
711 break;
712 case MCI_DEVTYPE_WAVEFORM_AUDIO:
713 dwRet = WAVE_DriverProc(mciDrv[wDevID].wDeviceID, 0,
714 MCI_CLOSE, dwParam, (DWORD)lpParms);
715 break;
716 case MCI_DEVTYPE_SEQUENCER:
717 dwRet = MIDI_DriverProc(mciDrv[wDevID].wDeviceID, 0,
718 MCI_CLOSE, dwParam, (DWORD)lpParms);
719 break;
720 case MCI_DEVTYPE_ANIMATION:
721 dwRet = ANIM_DriverProc(mciDrv[wDevID].wDeviceID, 0,
722 MCI_CLOSE, dwParam, (DWORD)lpParms);
723 break;
724 default:
725 printf("mciClose() // unknown type=%04X !\n", mciDrv[wDevID].wType);
727 mciDrv[wDevID].wType = 0;
728 return dwRet;
732 /**************************************************************************
733 * mciSound [internal]
735 DWORD mciSound(UINT wDevID, DWORD dwParam, LPMCI_SOUND_PARMS lpParms)
737 if (lpParms == NULL) return MCIERR_INTERNAL;
738 if (dwParam & MCI_SOUND_NAME)
739 printf("MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName);
740 return MCIERR_INVALID_DEVICE_ID;
745 /**************************************************************************
746 * mciSendCommand [MMSYSTEM.701]
748 DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2)
750 HDRVR hDrv = 0;
751 dprintf_mci(stddeb, "mciSendCommand(%04X, %04X, %08lX, %08lX)\n",
752 wDevID, wMsg, dwParam1, dwParam2);
753 switch(wMsg) {
754 case MCI_OPEN:
755 return mciOpen(dwParam1, (LPMCI_OPEN_PARMS)PTR_SEG_TO_LIN(dwParam2));
756 case MCI_CLOSE:
757 return mciClose(wDevID, dwParam1, (LPMCI_GENERIC_PARMS)PTR_SEG_TO_LIN(dwParam2));
758 default:
759 switch(mciDrv[wDevID].wType) {
760 case MCI_DEVTYPE_CD_AUDIO:
761 #ifndef WINELIB
762 return CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
763 wMsg, dwParam1, dwParam2);
764 #endif
766 case MCI_DEVTYPE_WAVEFORM_AUDIO:
767 return WAVE_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
768 wMsg, dwParam1, dwParam2);
769 case MCI_DEVTYPE_SEQUENCER:
770 return MIDI_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
771 wMsg, dwParam1, dwParam2);
772 case MCI_DEVTYPE_ANIMATION:
773 return ANIM_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
774 wMsg, dwParam1, dwParam2);
775 default:
776 printf("mciSendCommand() // unknown type=%04X !\n",
777 mciDrv[wDevID].wType);
780 return MMSYSERR_INVALPARAM;
783 /**************************************************************************
784 * mciGetDeviceID [MMSYSTEM.703]
786 UINT mciGetDeviceID (LPCSTR lpstrName)
788 char str[128];
789 printf("mciGetDeviceID(%s)\n", lpstrName);
790 if (lpstrName != NULL) {
791 strcpy(str, lpstrName);
792 AnsiUpper(str);
793 if (strcmp(str, "ALL") == 0) return MCI_ALL_DEVICE_ID;
795 return 0;
798 /**************************************************************************
799 * mciSendString [MMSYSTEM.702]
801 DWORD WINAPI mciSendString (LPCSTR lpstrCommand,
802 LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback)
804 printf("mciSendString('%s', %p, %u, %X)\n",
805 lpstrCommand, lpstrReturnString,
806 uReturnLength, hwndCallback);
807 return MCIERR_MISSING_COMMAND_STRING;
810 /**************************************************************************
811 * mciSetYieldProc [MMSYSTEM.714]
813 BOOL WINAPI mciSetYieldProc (UINT uDeviceID,
814 YIELDPROC fpYieldProc, DWORD dwYieldData)
816 return FALSE;
819 /**************************************************************************
820 * mciGetDeviceIDFromElementID [MMSYSTEM.715]
822 UINT WINAPI mciGetDeviceIDFromElementID(DWORD dwElementID, LPCSTR lpstrType)
824 return 0;
827 /**************************************************************************
828 * mciGetYieldProc [MMSYSTEM.716]
830 YIELDPROC WINAPI mciGetYieldProc(UINT uDeviceID, DWORD FAR* lpdwYieldData)
832 return NULL;
835 /**************************************************************************
836 * mciGetCreatorTask [MMSYSTEM.717]
838 HTASK WINAPI mciGetCreatorTask(UINT uDeviceID)
840 return 0;
843 /**************************************************************************
844 * midiOutGetNumDevs [MMSYSTEM.201]
846 UINT WINAPI midiOutGetNumDevs(void)
848 UINT count = 0;
849 printf("midiOutGetNumDevs\n");
850 count += modMessage(0, MODM_GETNUMDEVS, 0L, 0L, 0L);
851 printf("midiOutGetNumDevs return %u \n", count);
852 return count;
855 /**************************************************************************
856 * midiOutGetDevCaps [MMSYSTEM.202]
858 UINT WINAPI midiOutGetDevCaps(UINT uDeviceID,
859 MIDIOUTCAPS FAR* lpCaps, UINT uSize)
861 printf("midiOutGetDevCaps\n");
862 return 0;
865 /**************************************************************************
866 * midiOutGetErrorText [MMSYSTEM.203]
868 UINT WINAPI midiOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
870 printf("midiOutGetErrorText\n");
871 return(midiGetErrorText(uError, lpText, uSize));
875 /**************************************************************************
876 * midiGetErrorText [internal]
878 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
880 LPSTR msgptr;
881 int maxbuf;
882 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
883 lpText[0] = '\0';
884 switch(uError) {
885 case MIDIERR_UNPREPARED:
886 msgptr = "The MIDI header was not prepared. Use the Prepare function to prepare the header, and then try again.";
887 break;
888 case MIDIERR_STILLPLAYING:
889 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
890 break;
891 case MIDIERR_NOMAP:
892 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.";
893 break;
894 case MIDIERR_NOTREADY:
895 msgptr = "The port is transmitting data to the device. Wait until the data has been transmitted, and then try again.";
896 break;
897 case MIDIERR_NODEVICE:
898 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.";
899 break;
900 case MIDIERR_INVALIDSETUP:
901 msgptr = "The current MIDI setup is damaged. Copy the original MIDIMAP.CFG file to the Windows SYSTEM directory, and then try again.";
902 break;
904 msg# 336 : Cannot use the song-pointer time format and the SMPTE time-format together.
905 msg# 337 : The specified MIDI device is already in use. Wait until it is free, and then try again.
906 msg# 338 : The specified MIDI device is not installed on the system. Use the Drivers option in Control Panel to install the driver.
907 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.
908 msg# 340 : An error occurred using the specified port.
909 msg# 341 : All multimedia timers are being used by other applications. Quit one of these applications, and then try again.
910 msg# 342 : There is no current MIDI port.
911 msg# 343 : There are no MIDI devices installed on the system. Use the Drivers option in Control Panel to install the driver.
913 default:
914 msgptr = "Unkown MIDI Error !\n";
915 break;
917 maxbuf = min(uSize - 1, strlen(msgptr));
918 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
919 lpText[maxbuf + 1] = '\0';
920 return(TRUE);
923 /**************************************************************************
924 * midiOutOpen [MMSYSTEM.204]
926 UINT WINAPI midiOutOpen(HMIDIOUT FAR* lphMidiOut, UINT uDeviceID,
927 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
929 HMIDI hMidiOut;
930 LPMIDIOPENDESC lpDesc;
931 DWORD dwRet = 0;
932 BOOL bMapperFlg = FALSE;
933 if (lphMidiOut != NULL) *lphMidiOut = 0;
934 printf("midiOutOpen(%p, %d, %08lX, %08lX, %08lX);\n",
935 lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags);
936 if (uDeviceID == (UINT)MIDI_MAPPER) {
937 printf("midiOutOpen // MIDI_MAPPER mode requested !\n");
938 bMapperFlg = TRUE;
939 uDeviceID = 0;
941 hMidiOut = GlobalAlloc(GMEM_MOVEABLE, sizeof(MIDIOPENDESC));
942 if (lphMidiOut != NULL) *lphMidiOut = hMidiOut;
943 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
944 if (lpDesc == NULL) return MMSYSERR_NOMEM;
945 lpDesc->hMidi = hMidiOut;
946 lpDesc->dwCallback = dwCallback;
947 lpDesc->dwInstance = dwInstance;
948 while(uDeviceID < MAXMIDIDRIVERS) {
949 dwRet = modMessage(uDeviceID, MODM_OPEN,
950 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
951 if (dwRet == MMSYSERR_NOERROR) break;
952 if (!bMapperFlg) break;
953 uDeviceID++;
954 printf("midiOutOpen // MIDI_MAPPER mode ! try next driver...\n");
956 return dwRet;
959 /**************************************************************************
960 * midiOutClose [MMSYSTEM.205]
962 UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
964 LPMIDIOPENDESC lpDesc;
965 printf("midiOutClose(%04X)\n", hMidiOut);
966 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
967 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
968 return modMessage(0, MODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
971 /**************************************************************************
972 * midiOutPrepareHeader [MMSYSTEM.206]
974 UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
975 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
977 LPMIDIOPENDESC lpDesc;
978 printf("midiOutPrepareHeader(%04X, %p, %d)\n",
979 hMidiOut, lpMidiOutHdr, uSize);
980 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
981 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
982 return modMessage(0, MODM_PREPARE, lpDesc->dwInstance,
983 (DWORD)lpMidiOutHdr, (DWORD)uSize);
986 /**************************************************************************
987 * midiOutUnprepareHeader [MMSYSTEM.207]
989 UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
990 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
992 LPMIDIOPENDESC lpDesc;
993 printf("midiOutUnprepareHeader(%04X, %p, %d)\n",
994 hMidiOut, lpMidiOutHdr, uSize);
995 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
996 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
997 return modMessage(0, MODM_UNPREPARE, lpDesc->dwInstance,
998 (DWORD)lpMidiOutHdr, (DWORD)uSize);
1001 /**************************************************************************
1002 * midiOutShortMsg [MMSYSTEM.208]
1004 UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
1006 LPMIDIOPENDESC lpDesc;
1007 printf("midiOutShortMsg(%04X, %08lX)\n", hMidiOut, dwMsg);
1008 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
1009 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1010 return modMessage(0, MODM_DATA, lpDesc->dwInstance, dwMsg, 0L);
1013 /**************************************************************************
1014 * midiOutLongMsg [MMSYSTEM.209]
1016 UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
1017 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
1019 LPMIDIOPENDESC lpDesc;
1020 printf("midiOutLongMsg(%04X, %p, %d)\n",
1021 hMidiOut, lpMidiOutHdr, uSize);
1022 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
1023 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1024 return modMessage(0, MODM_LONGDATA, lpDesc->dwInstance,
1025 (DWORD)lpMidiOutHdr, (DWORD)uSize);
1028 /**************************************************************************
1029 * midiOutReset [MMSYSTEM.210]
1031 UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
1033 printf("midiOutReset\n");
1034 return 0;
1037 /**************************************************************************
1038 * midiOutGetVolume [MMSYSTEM.211]
1040 UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
1042 printf("midiOutGetVolume\n");
1043 return 0;
1046 /**************************************************************************
1047 * midiOutSetVolume [MMSYSTEM.212]
1049 UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume)
1051 printf("midiOutSetVolume\n");
1052 return 0;
1055 /**************************************************************************
1056 * midiOutCachePatches [MMSYSTEM.213]
1058 UINT WINAPI midiOutCachePatches(HMIDIOUT hMidiOut,
1059 UINT uBank, WORD FAR* lpwPatchArray, UINT uFlags)
1061 printf("midiOutCachePatches\n");
1062 return 0;
1065 /**************************************************************************
1066 * midiOutCacheDrumPatches [MMSYSTEM.214]
1068 UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT hMidiOut,
1069 UINT uPatch, WORD FAR* lpwKeyArray, UINT uFlags)
1071 printf("midiOutCacheDrumPatches\n");
1072 return 0;
1075 /**************************************************************************
1076 * midiOutGetID [MMSYSTEM.215]
1078 UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT FAR* lpuDeviceID)
1080 printf("midiOutGetID\n");
1081 return 0;
1084 /**************************************************************************
1085 * midiOutMessage [MMSYSTEM.216]
1087 DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
1088 DWORD dwParam1, DWORD dwParam2)
1090 LPMIDIOPENDESC lpDesc;
1091 printf("midiOutMessage(%04X, %04X, %08lX, %08lX)\n",
1092 hMidiOut, uMessage, dwParam1, dwParam2);
1093 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiOut);
1094 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1095 return modMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1096 return 0;
1099 /**************************************************************************
1100 * midiInGetNumDevs [MMSYSTEM.301]
1102 UINT WINAPI midiInGetNumDevs(void)
1104 printf("midiInGetNumDevs\n");
1105 return 0;
1108 /**************************************************************************
1109 * midiInGetDevCaps [MMSYSTEM.302]
1111 UINT WINAPI midiInGetDevCaps(UINT uDeviceID,
1112 LPMIDIINCAPS lpCaps, UINT uSize)
1114 printf("midiInGetDevCaps\n");
1115 return 0;
1118 /**************************************************************************
1119 * midiInGetErrorText [MMSYSTEM.303]
1121 UINT WINAPI midiInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1123 printf("midiInGetErrorText\n");
1124 return (midiGetErrorText(uError, lpText, uSize));
1127 /**************************************************************************
1128 * midiInOpen [MMSYSTEM.304]
1130 UINT WINAPI midiInOpen(HMIDIIN FAR* lphMidiIn, UINT uDeviceID,
1131 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1133 HMIDI hMidiIn;
1134 LPMIDIOPENDESC lpDesc;
1135 DWORD dwRet = 0;
1136 BOOL bMapperFlg = FALSE;
1137 if (lphMidiIn != NULL) *lphMidiIn = 0;
1138 printf("midiInOpen(%p, %d, %08lX, %08lX, %08lX);\n",
1139 lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags);
1140 if (uDeviceID == (UINT)MIDI_MAPPER) {
1141 printf("midiInOpen // MIDI_MAPPER mode requested !\n");
1142 bMapperFlg = TRUE;
1143 uDeviceID = 0;
1145 hMidiIn = GlobalAlloc(GMEM_MOVEABLE, sizeof(MIDIOPENDESC));
1146 if (lphMidiIn != NULL) *lphMidiIn = hMidiIn;
1147 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1148 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1149 lpDesc->hMidi = hMidiIn;
1150 lpDesc->dwCallback = dwCallback;
1151 lpDesc->dwInstance = dwInstance;
1152 while(uDeviceID < MAXMIDIDRIVERS) {
1153 dwRet = midMessage(uDeviceID, MIDM_OPEN,
1154 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1155 if (dwRet == MMSYSERR_NOERROR) break;
1156 if (!bMapperFlg) break;
1157 uDeviceID++;
1158 printf("midiInOpen // MIDI_MAPPER mode ! try next driver...\n");
1160 return dwRet;
1163 /**************************************************************************
1164 * midiInClose [MMSYSTEM.305]
1166 UINT WINAPI midiInClose(HMIDIIN hMidiIn)
1168 LPMIDIOPENDESC lpDesc;
1169 printf("midiInClose(%04X)\n", hMidiIn);
1170 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1171 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1172 return midMessage(0, MIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1175 /**************************************************************************
1176 * midiInPrepareHeader [MMSYSTEM.306]
1178 UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
1179 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1181 LPMIDIOPENDESC lpDesc;
1182 printf("midiInPrepareHeader(%04X, %p, %d)\n",
1183 hMidiIn, lpMidiInHdr, uSize);
1184 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1185 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1186 return midMessage(0, MIDM_PREPARE, lpDesc->dwInstance,
1187 (DWORD)lpMidiInHdr, (DWORD)uSize);
1190 /**************************************************************************
1191 * midiInUnprepareHeader [MMSYSTEM.307]
1193 UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
1194 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1196 LPMIDIOPENDESC lpDesc;
1197 printf("midiInUnprepareHeader(%04X, %p, %d)\n",
1198 hMidiIn, lpMidiInHdr, uSize);
1199 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1200 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1201 return midMessage(0, MIDM_UNPREPARE, lpDesc->dwInstance,
1202 (DWORD)lpMidiInHdr, (DWORD)uSize);
1205 /**************************************************************************
1206 * midiInAddBuffer [MMSYSTEM.308]
1208 UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
1209 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1211 printf("midiInAddBuffer\n");
1212 return 0;
1215 /**************************************************************************
1216 * midiInStart [MMSYSTEM.309]
1218 UINT WINAPI midiInStart(HMIDIIN hMidiIn)
1220 printf("midiInStart\n");
1221 return 0;
1224 /**************************************************************************
1225 * midiInStop [MMSYSTEM.310]
1227 UINT WINAPI midiInStop(HMIDIIN hMidiIn)
1229 printf("midiInStop\n");
1230 return 0;
1233 /**************************************************************************
1234 * midiInReset [MMSYSTEM.311]
1236 UINT WINAPI midiInReset(HMIDIIN hMidiIn)
1238 printf("midiInReset\n");
1239 return 0;
1242 /**************************************************************************
1243 * midiInGetID [MMSYSTEM.312]
1245 UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT FAR* lpuDeviceID)
1247 printf("midiInGetID\n");
1248 return 0;
1251 /**************************************************************************
1252 * midiInMessage [MMSYSTEM.313]
1254 DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
1255 DWORD dwParam1, DWORD dwParam2)
1257 LPMIDIOPENDESC lpDesc;
1258 printf("midiInMessage(%04X, %04X, %08lX, %08lX)\n",
1259 hMidiIn, uMessage, dwParam1, dwParam2);
1260 lpDesc = (LPMIDIOPENDESC) GlobalLock(hMidiIn);
1261 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1262 return midMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1266 /**************************************************************************
1267 * waveOutGetNumDevs [MMSYSTEM.401]
1269 UINT WINAPI waveOutGetNumDevs()
1271 UINT count = 0;
1272 printf("waveOutGetNumDevs\n");
1273 count += wodMessage(0, WODM_GETNUMDEVS, 0L, 0L, 0L);
1274 printf("waveOutGetNumDevs return %u \n", count);
1275 return count;
1278 /**************************************************************************
1279 * waveOutGetDevCaps [MMSYSTEM.402]
1281 UINT WINAPI waveOutGetDevCaps(UINT uDeviceID, WAVEOUTCAPS FAR* lpCaps, UINT uSize)
1283 printf("waveOutGetDevCaps\n");
1284 return wodMessage(uDeviceID, WODM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1287 /**************************************************************************
1288 * waveOutGetErrorText [MMSYSTEM.403]
1290 UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1292 printf("waveOutGetErrorText\n");
1293 return(waveGetErrorText(uError, lpText, uSize));
1297 /**************************************************************************
1298 * waveGetErrorText [internal]
1300 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1302 LPSTR msgptr;
1303 int maxbuf;
1304 printf("waveGetErrorText(%04X, %p, %d);\n", uError, lpText, uSize);
1305 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
1306 lpText[0] = '\0';
1307 switch(uError) {
1308 case MMSYSERR_NOERROR:
1309 msgptr = "The specified command was carried out.";
1310 break;
1311 case MMSYSERR_ERROR:
1312 msgptr = "Undefined external error.";
1313 break;
1314 case MMSYSERR_BADDEVICEID:
1315 msgptr = "A device ID has been used that is out of range for your system.";
1316 break;
1317 case MMSYSERR_NOTENABLED:
1318 msgptr = "The driver was not enabled.";
1319 break;
1320 case MMSYSERR_ALLOCATED:
1321 msgptr = "The specified device is already in use. Wait until it is free, and then try again.";
1322 break;
1323 case MMSYSERR_INVALHANDLE:
1324 msgptr = "The specified device handle is invalid.";
1325 break;
1326 case MMSYSERR_NODRIVER:
1327 msgptr = "There is no driver installed on your system !\n";
1328 break;
1329 case MMSYSERR_NOMEM:
1330 msgptr = "Not enough memory available for this task. Quit one or more applications to increase available memory, and then try again.";
1331 break;
1332 case MMSYSERR_NOTSUPPORTED:
1333 msgptr = "This function is not supported. Use the Capabilities function to determine which functions and messages the driver supports.";
1334 break;
1335 case MMSYSERR_BADERRNUM:
1336 msgptr = "An error number was specified that is not defined in the system.";
1337 break;
1338 case MMSYSERR_INVALFLAG:
1339 msgptr = "An invalid flag was passed to a system function.";
1340 break;
1341 case MMSYSERR_INVALPARAM:
1342 msgptr = "An invalid parameter was passed to a system function.";
1343 break;
1344 case WAVERR_BADFORMAT:
1345 msgptr = "The specified format is not supported or cannot be translated. Use the Capabilities function to determine the supported formats";
1346 break;
1347 case WAVERR_STILLPLAYING:
1348 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
1349 break;
1350 case WAVERR_UNPREPARED:
1351 msgptr = "The wave header was not prepared. Use the Prepare function to prepare the header, and then try again.";
1352 break;
1353 case WAVERR_SYNC:
1354 msgptr = "Cannot open the device without using the WAVE_ALLOWSYNC flag. Use the flag, and then try again.";
1355 break;
1356 default:
1357 msgptr = "Unkown MMSYSTEM Error !\n";
1358 break;
1360 maxbuf = min(uSize - 1, strlen(msgptr));
1361 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
1362 lpText[maxbuf + 1] = '\0';
1363 return(TRUE);
1366 /**************************************************************************
1367 * waveOutOpen [MMSYSTEM.404]
1369 UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
1370 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1372 HWAVE hWaveOut;
1373 LPWAVEOPENDESC lpDesc;
1374 DWORD dwRet = 0;
1375 BOOL bMapperFlg = FALSE;
1376 printf("waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n",
1377 lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1378 if (dwFlags & WAVE_FORMAT_QUERY) {
1379 printf("waveOutOpen // WAVE_FORMAT_QUERY requested !\n");
1381 if (uDeviceID == (UINT)WAVE_MAPPER) {
1382 printf("waveOutOpen // WAVE_MAPPER mode requested !\n");
1383 bMapperFlg = TRUE;
1384 uDeviceID = 0;
1386 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1387 hWaveOut = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1388 if (lphWaveOut != NULL) *lphWaveOut = hWaveOut;
1389 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1390 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1391 lpDesc->hWave = hWaveOut;
1392 lpDesc->lpFormat = lpFormat;
1393 lpDesc->dwCallBack = dwCallback;
1394 lpDesc->dwInstance = dwInstance;
1395 while(uDeviceID < MAXWAVEDRIVERS) {
1396 dwRet = wodMessage(uDeviceID, WODM_OPEN,
1397 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1398 if (dwRet == MMSYSERR_NOERROR) break;
1399 if (!bMapperFlg) break;
1400 uDeviceID++;
1401 printf("waveOutOpen // WAVE_MAPPER mode ! try next driver...\n");
1403 if (dwFlags & WAVE_FORMAT_QUERY) {
1404 printf("waveOutOpen // End of WAVE_FORMAT_QUERY !\n");
1405 waveOutClose(hWaveOut);
1407 return dwRet;
1410 /**************************************************************************
1411 * waveOutClose [MMSYSTEM.405]
1413 UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
1415 LPWAVEOPENDESC lpDesc;
1416 printf("waveOutClose(%04X)\n", hWaveOut);
1417 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1418 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1419 return wodMessage(0, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1422 /**************************************************************************
1423 * waveOutPrepareHeader [MMSYSTEM.406]
1425 UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
1426 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1428 LPWAVEOPENDESC lpDesc;
1429 printf("waveOutPrepareHeader(%04X, %p, %u);\n",
1430 hWaveOut, lpWaveOutHdr, uSize);
1431 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1432 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1433 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1434 (DWORD)lpWaveOutHdr, uSize);
1437 /**************************************************************************
1438 * waveOutUnprepareHeader [MMSYSTEM.407]
1440 UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
1441 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1443 LPWAVEOPENDESC lpDesc;
1444 printf("waveOutUnprepareHeader(%04X, %p, %u);\n",
1445 hWaveOut, lpWaveOutHdr, uSize);
1446 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1447 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1448 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1449 (DWORD)lpWaveOutHdr, uSize);
1452 /**************************************************************************
1453 * waveOutWrite [MMSYSTEM.408]
1455 UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1457 LPWAVEOPENDESC lpDesc;
1458 printf("waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
1459 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1460 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1461 return wodMessage(0, WODM_WRITE, lpDesc->dwInstance,
1462 (DWORD)lpWaveOutHdr, uSize);
1465 /**************************************************************************
1466 * waveOutPause [MMSYSTEM.409]
1468 UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
1470 printf("waveOutPause(%04X)\n", hWaveOut);
1471 return MMSYSERR_INVALHANDLE;
1474 /**************************************************************************
1475 * waveOutRestart [MMSYSTEM.410]
1477 UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
1479 printf("waveOutRestart(%04X)\n", hWaveOut);
1480 return MMSYSERR_INVALHANDLE;
1483 /**************************************************************************
1484 * waveOutReset [MMSYSTEM.411]
1486 UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
1488 printf("waveOutReset(%04X)\n", hWaveOut);
1489 return MMSYSERR_INVALHANDLE;
1492 /**************************************************************************
1493 * waveOutGetPosition [MMSYSTEM.412]
1495 UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, MMTIME FAR* lpTime, UINT uSize)
1497 LPWAVEOPENDESC lpDesc;
1498 printf("waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize);
1499 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1500 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1501 return wodMessage(0, WODM_GETPOS, lpDesc->dwInstance,
1502 (DWORD)lpTime, (DWORD)uSize);
1505 /**************************************************************************
1506 * waveOutGetPitch [MMSYSTEM.413]
1508 UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, DWORD FAR* lpdwPitch)
1510 printf("waveOutGetPitch\n");
1511 return MMSYSERR_INVALHANDLE;
1514 /**************************************************************************
1515 * waveOutSetPitch [MMSYSTEM.414]
1517 UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dwPitch)
1519 printf("waveOutSetPitch\n");
1520 return MMSYSERR_INVALHANDLE;
1523 /**************************************************************************
1524 * waveOutGetVolume [MMSYSTEM.415]
1526 UINT WINAPI waveOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
1528 printf("waveOutGetVolume\n");
1529 return MMSYSERR_INVALHANDLE;
1532 /**************************************************************************
1533 * waveOutSetVolume [MMSYSTEM.416]
1535 UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume)
1537 printf("waveOutSetVolume\n");
1538 return MMSYSERR_INVALHANDLE;
1541 /**************************************************************************
1542 * waveOutGetPlaybackRate [MMSYSTEM.417]
1544 UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, DWORD FAR* lpdwRate)
1546 printf("waveOutGetPlaybackRate\n");
1547 return MMSYSERR_INVALHANDLE;
1550 /**************************************************************************
1551 * waveOutSetPlaybackRate [MMSYSTEM.418]
1553 UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dwRate)
1555 printf("waveOutSetPlaybackRate\n");
1556 return MMSYSERR_INVALHANDLE;
1559 /**************************************************************************
1560 * waveOutBreakLoop [MMSYSTEM.419]
1562 UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
1564 printf("waveOutBreakLoop(%04X)\n", hWaveOut);
1565 return MMSYSERR_INVALHANDLE;
1568 /**************************************************************************
1569 * waveOutGetID [MMSYSTEM.420]
1571 UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT FAR* lpuDeviceID)
1573 printf("waveOutGetID\n");
1574 return MMSYSERR_INVALHANDLE;
1577 /**************************************************************************
1578 * waveOutMessage [MMSYSTEM.421]
1580 DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
1581 DWORD dwParam1, DWORD dwParam2)
1583 LPWAVEOPENDESC lpDesc;
1584 printf("waveOutMessage(%04X, %04X, %08lX, %08lX)\n",
1585 hWaveOut, uMessage, dwParam1, dwParam2);
1586 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1587 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1588 return wodMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1591 /**************************************************************************
1592 * waveInGetNumDevs [MMSYSTEM.501]
1594 UINT WINAPI waveInGetNumDevs()
1596 UINT count = 0;
1597 printf("waveInGetNumDevs\n");
1598 count += widMessage(0, WIDM_GETNUMDEVS, 0L, 0L, 0L);
1599 printf("waveInGetNumDevs return %u \n", count);
1600 return count;
1604 /**************************************************************************
1605 * waveInGetDevCaps [MMSYSTEM.502]
1607 UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps, UINT uSize)
1609 printf("waveInGetDevCaps\n");
1610 return widMessage(uDeviceID, WIDM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1614 /**************************************************************************
1615 * waveInGetErrorText [MMSYSTEM.503]
1617 UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1619 printf("waveInGetErrorText\n");
1620 return(waveGetErrorText(uError, lpText, uSize));
1624 /**************************************************************************
1625 * waveInOpen [MMSYSTEM.504]
1627 UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
1628 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1630 HWAVE hWaveIn;
1631 LPWAVEOPENDESC lpDesc;
1632 DWORD dwRet = 0;
1633 BOOL bMapperFlg = FALSE;
1634 printf("waveInOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n",
1635 lphWaveIn, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1636 if (dwFlags & WAVE_FORMAT_QUERY) {
1637 printf("waveInOpen // WAVE_FORMAT_QUERY requested !\n");
1639 if (uDeviceID == (UINT)WAVE_MAPPER) {
1640 printf("waveInOpen // WAVE_MAPPER mode requested !\n");
1641 bMapperFlg = TRUE;
1642 uDeviceID = 0;
1644 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1645 hWaveIn = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1646 if (lphWaveIn != NULL) *lphWaveIn = hWaveIn;
1647 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1648 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1649 lpDesc->hWave = hWaveIn;
1650 lpDesc->lpFormat = lpFormat;
1651 lpDesc->dwCallBack = dwCallback;
1652 lpDesc->dwInstance = dwInstance;
1653 while(uDeviceID < MAXWAVEDRIVERS) {
1654 dwRet = widMessage(uDeviceID, WIDM_OPEN,
1655 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1656 if (dwRet == MMSYSERR_NOERROR) break;
1657 if (!bMapperFlg) break;
1658 uDeviceID++;
1659 printf("waveInOpen // WAVE_MAPPER mode ! try next driver...\n");
1661 if (dwFlags & WAVE_FORMAT_QUERY) {
1662 printf("waveInOpen // End of WAVE_FORMAT_QUERY !\n");
1663 waveInClose(hWaveIn);
1665 return dwRet;
1669 /**************************************************************************
1670 * waveInClose [MMSYSTEM.505]
1672 UINT WINAPI waveInClose(HWAVEIN hWaveIn)
1674 LPWAVEOPENDESC lpDesc;
1675 printf("waveInClose(%04X)\n", hWaveIn);
1676 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1677 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1678 return widMessage(0, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1682 /**************************************************************************
1683 * waveInPrepareHeader [MMSYSTEM.506]
1685 UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
1686 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1688 LPWAVEOPENDESC lpDesc;
1689 printf("waveInPrepareHeader(%04X, %p, %u);\n",
1690 hWaveIn, lpWaveInHdr, uSize);
1691 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1692 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1693 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1694 lpWaveInHdr->lpNext = NULL;
1695 lpWaveInHdr->dwBytesRecorded = 0;
1696 printf("waveInPrepareHeader // lpData=%p size=%lu \n",
1697 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1698 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1699 (DWORD)lpWaveInHdr, uSize);
1703 /**************************************************************************
1704 * waveInUnprepareHeader [MMSYSTEM.507]
1706 UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn,
1707 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1709 LPWAVEOPENDESC lpDesc;
1710 printf("waveInUnprepareHeader(%04X, %p, %u);\n",
1711 hWaveIn, lpWaveInHdr, uSize);
1712 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1713 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1714 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1715 USER_HEAP_FREE(HIWORD((DWORD)lpWaveInHdr->lpData));
1716 lpWaveInHdr->lpData = NULL;
1717 lpWaveInHdr->lpNext = NULL;
1718 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1719 (DWORD)lpWaveInHdr, uSize);
1723 /**************************************************************************
1724 * waveInAddBuffer [MMSYSTEM.508]
1726 UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
1727 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1729 LPWAVEOPENDESC lpDesc;
1730 printf("waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
1731 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1732 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1733 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1734 lpWaveInHdr->lpNext = NULL;
1735 lpWaveInHdr->dwBytesRecorded = 0;
1736 printf("waveInAddBuffer // lpData=%p size=%lu \n",
1737 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1738 return widMessage(0, WIDM_ADDBUFFER, lpDesc->dwInstance,
1739 (DWORD)lpWaveInHdr, uSize);
1743 /**************************************************************************
1744 * waveInStart [MMSYSTEM.509]
1746 UINT WINAPI waveInStart(HWAVEIN hWaveIn)
1748 LPWAVEOPENDESC lpDesc;
1749 printf("waveInStart(%04X)\n", hWaveIn);
1750 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1751 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1752 return widMessage(0, WIDM_START, lpDesc->dwInstance, 0L, 0L);
1756 /**************************************************************************
1757 * waveInStop [MMSYSTEM.510]
1759 UINT WINAPI waveInStop(HWAVEIN hWaveIn)
1761 LPWAVEOPENDESC lpDesc;
1762 printf("waveInStop(%04X)\n", hWaveIn);
1763 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1764 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1765 return widMessage(0, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
1769 /**************************************************************************
1770 * waveInReset [MMSYSTEM.511]
1772 UINT WINAPI waveInReset(HWAVEIN hWaveIn)
1774 LPWAVEOPENDESC lpDesc;
1775 printf("waveInReset(%04X)\n", hWaveIn);
1776 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1777 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1778 return widMessage(0, WIDM_RESET, lpDesc->dwInstance, 0L, 0L);
1782 /**************************************************************************
1783 * waveInGetPosition [MMSYSTEM.512]
1785 UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, MMTIME FAR* lpTime, UINT uSize)
1787 LPWAVEOPENDESC lpDesc;
1788 printf("waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize);
1789 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1790 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1791 return widMessage(0, WIDM_GETPOS, lpDesc->dwInstance,
1792 (DWORD)lpTime, (DWORD)uSize);
1796 /**************************************************************************
1797 * waveInGetID [MMSYSTEM.513]
1799 UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT FAR* lpuDeviceID)
1801 printf("waveInGetID\n");
1802 if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1803 return 0;
1807 /**************************************************************************
1808 * waveInMessage [MMSYSTEM.514]
1810 DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
1811 DWORD dwParam1, DWORD dwParam2)
1813 LPWAVEOPENDESC lpDesc;
1814 printf("waveInMessage(%04X, %04X, %08lX, %08lX)\n",
1815 hWaveIn, uMessage, dwParam1, dwParam2);
1816 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1817 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1818 return widMessage(0, uMessage, lpDesc->dwInstance, dwParam1, dwParam2);
1822 /**************************************************************************
1823 * MMSysTimeCallback [internal]
1825 WORD FAR PASCAL MMSysTimeCallback(HWND hWnd, WORD wMsg, int nID, DWORD dwTime)
1827 LPTIMERENTRY lpTimer = lpTimerList;
1828 mmSysTimeMS.u.ms += 33;
1829 mmSysTimeSMPTE.u.smpte.frame++;
1830 while (lpTimer != NULL) {
1831 lpTimer->wCurTime--;
1832 if (lpTimer->wCurTime == 0) {
1833 lpTimer->wCurTime = lpTimer->wDelay;
1834 if (lpTimer->lpFunc != NULL) {
1835 dprintf_mmtime(stddeb,"MMSysTimeCallback // before CallBack16 !\n");
1836 #ifdef WINELIB
1837 (*lpTimer->lpFunc)(lpTimer->wTimerID, (WORD)0,
1838 lpTimer->dwUser, (DWORD)0, (DWORD)0);
1839 #else
1840 CallBack16(lpTimer->lpFunc, 5,
1841 0, (int)lpTimer->wTimerID, 0, (int)0,
1842 2, lpTimer->dwUser, 2, 0, 2, 0);
1843 #endif
1844 dprintf_mmtime(stddeb, "MMSysTimeCallback // after CallBack16 !\n");
1845 fflush(stdout);
1847 if (lpTimer->wFlags & TIME_ONESHOT)
1848 timeKillEvent(lpTimer->wTimerID);
1850 lpTimer = lpTimer->Next;
1852 return 0;
1855 /**************************************************************************
1856 * StartMMTime [internal]
1858 void StartMMTime()
1860 if (!mmTimeStarted) {
1861 mmTimeStarted = TRUE;
1862 mmSysTimeMS.wType = TIME_MS;
1863 mmSysTimeMS.u.ms = 0;
1864 mmSysTimeSMPTE.wType = TIME_SMPTE;
1865 mmSysTimeSMPTE.u.smpte.hour = 0;
1866 mmSysTimeSMPTE.u.smpte.min = 0;
1867 mmSysTimeSMPTE.u.smpte.sec = 0;
1868 mmSysTimeSMPTE.u.smpte.frame = 0;
1869 mmSysTimeSMPTE.u.smpte.fps = 0;
1870 mmSysTimeSMPTE.u.smpte.dummy = 0;
1871 SetTimer(0, 1, 33, (FARPROC)MMSysTimeCallback);
1875 /**************************************************************************
1876 * timeGetSystemTime [MMSYSTEM.601]
1878 WORD timeGetSystemTime(LPMMTIME lpTime, WORD wSize)
1880 printf("timeGetSystemTime(%p, %u);\n", lpTime, wSize);
1881 if (!mmTimeStarted) StartMMTime();
1882 return 0;
1885 /**************************************************************************
1886 * timeSetEvent [MMSYSTEM.602]
1888 WORD timeSetEvent(WORD wDelay, WORD wResol,
1889 LPTIMECALLBACK lpFunc,
1890 DWORD dwUser, WORD wFlags)
1892 WORD wNewID = 0;
1893 LPTIMERENTRY lpNewTimer;
1894 LPTIMERENTRY lpTimer = lpTimerList;
1895 printf("timeSetEvent(%u, %u, %p, %08lX, %04X);\n",
1896 wDelay, wResol, lpFunc, dwUser, wFlags);
1897 if (!mmTimeStarted) StartMMTime();
1898 lpNewTimer = (LPTIMERENTRY) malloc(sizeof(TIMERENTRY));
1899 if (lpNewTimer == NULL) return 0;
1900 while (lpTimer != NULL) {
1901 wNewID = max(wNewID, lpTimer->wTimerID);
1902 if (lpTimer->Next == NULL) break;
1903 lpTimer = lpTimer->Next;
1905 if (lpTimerList == NULL) {
1906 lpTimerList = lpNewTimer;
1907 lpNewTimer->Prev = NULL;
1909 else {
1910 lpTimer->Next = lpNewTimer;
1911 lpNewTimer->Prev = lpTimer;
1913 lpNewTimer->Next = NULL;
1914 lpNewTimer->wTimerID = wNewID + 1;
1915 lpNewTimer->wCurTime = wDelay;
1916 lpNewTimer->wDelay = wDelay;
1917 lpNewTimer->wResol = wResol;
1918 lpNewTimer->lpFunc = (FARPROC)lpFunc;
1919 lpNewTimer->dwUser = dwUser;
1920 lpNewTimer->wFlags = wFlags;
1921 return lpNewTimer->wTimerID;
1924 /**************************************************************************
1925 * timeKillEvent [MMSYSTEM.603]
1927 WORD timeKillEvent(WORD wID)
1929 LPTIMERENTRY lpTimer = lpTimerList;
1930 while (lpTimer != NULL) {
1931 if (wID == lpTimer->wTimerID) {
1932 if (lpTimer->Prev != NULL) lpTimer->Prev->Next = lpTimer->Next;
1933 if (lpTimer->Next != NULL) lpTimer->Next->Prev = lpTimer->Prev;
1934 free(lpTimer);
1935 return TRUE;
1937 lpTimer = lpTimer->Next;
1939 return 0;
1942 /**************************************************************************
1943 * timeGetDevCaps [MMSYSTEM.604]
1945 WORD timeGetDevCaps(LPTIMECAPS lpCaps, WORD wSize)
1947 printf("timeGetDevCaps(%p, %u) !\n", lpCaps, wSize);
1948 return 0;
1951 /**************************************************************************
1952 * timeBeginPeriod [MMSYSTEM.605]
1954 WORD timeBeginPeriod(WORD wPeriod)
1956 printf("timeBeginPeriod(%u) !\n", wPeriod);
1957 if (!mmTimeStarted) StartMMTime();
1958 return 0;
1961 /**************************************************************************
1962 * timeEndPeriod [MMSYSTEM.606]
1964 WORD timeEndPeriod(WORD wPeriod)
1966 printf("timeEndPeriod(%u) !\n", wPeriod);
1967 return 0;
1970 /**************************************************************************
1971 * timeGetTime [MMSYSTEM.607]
1973 DWORD timeGetTime()
1975 printf("timeGetTime(); !\n");
1976 if (!mmTimeStarted) StartMMTime();
1977 return 0;
1981 /**************************************************************************
1982 * mmioOpen [MMSYSTEM.1210]
1984 HMMIO WINAPI mmioOpen(LPSTR szFileName, MMIOINFO FAR* lpmmioinfo, DWORD dwOpenFlags)
1986 int hFile;
1987 HANDLE hmmio;
1988 OFSTRUCT ofs;
1989 LPMMIOINFO lpmminfo;
1990 printf("mmioOpen('%s', %p, %08lX);\n", szFileName, lpmmioinfo, dwOpenFlags);
1991 hFile = OpenFile(szFileName, &ofs, dwOpenFlags);
1992 if (hFile == -1) return 0;
1993 hmmio = GlobalAlloc(GMEM_MOVEABLE, sizeof(MMIOINFO));
1994 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
1995 if (lpmminfo == NULL) return 0;
1996 memset(lpmminfo, 0, sizeof(MMIOINFO));
1997 lpmminfo->hmmio = hmmio;
1998 lpmminfo->dwReserved2 = MAKELONG(hFile, 0);
1999 GlobalUnlock(hmmio);
2000 return (HMMIO)hmmio;
2005 /**************************************************************************
2006 * mmioClose [MMSYSTEM.1211]
2008 UINT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
2010 LPMMIOINFO lpmminfo;
2011 printf("mmioClose(%04X, %04X);\n", hmmio, uFlags);
2012 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2013 if (lpmminfo == NULL) return 0;
2014 _lclose(LOWORD(lpmminfo->dwReserved2));
2015 GlobalUnlock(hmmio);
2016 GlobalFree(hmmio);
2017 return 0;
2022 /**************************************************************************
2023 * mmioRead [MMSYSTEM.1212]
2025 LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
2027 int count;
2028 LPMMIOINFO lpmminfo;
2029 dprintf_mmio(stddeb, "mmioRead(%04X, %p, %ld);\n", hmmio, pch, cch);
2030 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2031 if (lpmminfo == NULL) return 0;
2032 count = _lread(LOWORD(lpmminfo->dwReserved2), pch, cch);
2033 GlobalUnlock(hmmio);
2034 return count;
2039 /**************************************************************************
2040 * mmioWrite [MMSYSTEM.1213]
2042 LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
2044 int count;
2045 LPMMIOINFO lpmminfo;
2046 printf("mmioWrite(%04X, %p, %ld);\n", hmmio, pch, cch);
2047 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2048 if (lpmminfo == NULL) return 0;
2049 count = _lwrite(LOWORD(lpmminfo->dwReserved2), (LPSTR)pch, cch);
2050 GlobalUnlock(hmmio);
2051 return count;
2054 /**************************************************************************
2055 * mmioSeek [MMSYSTEM.1214]
2057 LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin)
2059 int count;
2060 LPMMIOINFO lpmminfo;
2061 printf("mmioSeek(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin);
2062 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2063 if (lpmminfo == NULL) {
2064 printf("mmioSeek // can't lock hmmio=%04X !\n", hmmio);
2065 return 0;
2067 count = _llseek(LOWORD(lpmminfo->dwReserved2), lOffset, iOrigin);
2068 GlobalUnlock(hmmio);
2069 return count;
2072 /**************************************************************************
2073 * mmioGetInfo [MMSYSTEM.1215]
2075 UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2077 LPMMIOINFO lpmminfo;
2078 printf("mmioGetInfo\n");
2079 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2080 if (lpmminfo == NULL) return 0;
2081 memcpy(lpmmioinfo, lpmminfo, sizeof(MMIOINFO));
2082 GlobalUnlock(hmmio);
2083 return 0;
2086 /**************************************************************************
2087 * mmioSetInfo [MMSYSTEM.1216]
2089 UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2091 LPMMIOINFO lpmminfo;
2092 printf("mmioSetInfo\n");
2093 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2094 if (lpmminfo == NULL) return 0;
2095 GlobalUnlock(hmmio);
2096 return 0;
2099 /**************************************************************************
2100 * mmioSetBuffer [MMSYSTEM.1217]
2102 UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer,
2103 LONG cchBuffer, UINT uFlags)
2105 printf("mmioSetBuffer\n");
2106 return 0;
2109 /**************************************************************************
2110 * mmioFlush [MMSYSTEM.1218]
2112 UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags)
2114 LPMMIOINFO lpmminfo;
2115 printf("mmioFlush(%04X, %04X)\n", hmmio, uFlags);
2116 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2117 if (lpmminfo == NULL) return 0;
2118 GlobalUnlock(hmmio);
2119 return 0;
2122 /**************************************************************************
2123 * mmioAdvance [MMSYSTEM.1219]
2125 UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
2127 int count = 0;
2128 LPMMIOINFO lpmminfo;
2129 printf("mmioAdvance\n");
2130 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2131 if (lpmminfo == NULL) return 0;
2132 if (uFlags == MMIO_READ) {
2133 count = _lread(LOWORD(lpmminfo->dwReserved2),
2134 lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer);
2136 if (uFlags == MMIO_WRITE) {
2137 count = _lwrite(LOWORD(lpmminfo->dwReserved2),
2138 lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer);
2140 lpmmioinfo->pchNext += count;
2141 GlobalUnlock(hmmio);
2142 lpmminfo->lDiskOffset = _llseek(LOWORD(lpmminfo->dwReserved2), 0, SEEK_CUR);
2143 return 0;
2146 /**************************************************************************
2147 * mmioStringToFOURCC [MMSYSTEM.1220]
2149 FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags)
2151 printf("mmioStringToFOURCC\n");
2152 return 0;
2155 /**************************************************************************
2156 * mmioInstallIOProc [MMSYSTEM.1221]
2158 LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc,
2159 LPMMIOPROC pIOProc, DWORD dwFlags)
2161 printf("mmioInstallIOProc\n");
2162 return 0;
2165 /**************************************************************************
2166 * mmioSendMessage [MMSYSTEM.1222]
2168 LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
2169 LPARAM lParam1, LPARAM lParam2)
2171 printf("mmioSendMessage\n");
2172 return 0;
2175 /**************************************************************************
2176 * mmioDescend [MMSYSTEM.1223]
2178 UINT WINAPI mmioDescend(HMMIO hmmio, MMCKINFO FAR* lpck,
2179 const MMCKINFO FAR* lpckParent, UINT uFlags)
2181 DWORD dwfcc, dwOldPos;
2182 LPMMIOINFO lpmminfo;
2183 dprintf_mmio(stddeb, "mmioDescend(%04X, %p, %p, %04X);\n",
2184 hmmio, lpck, lpckParent, uFlags);
2185 if (lpck == NULL) return 0;
2186 lpmminfo = (LPMMIOINFO)GlobalLock(hmmio);
2187 if (lpmminfo == NULL) return 0;
2188 dwfcc = lpck->ckid;
2189 dwOldPos = _llseek(LOWORD(lpmminfo->dwReserved2), 0, SEEK_CUR);
2190 if (lpckParent != NULL) {
2191 dprintf_mmio(stddeb, "mmioDescend // seek inside parent at %ld !\n", lpckParent->dwDataOffset);
2192 dwOldPos = _llseek(LOWORD(lpmminfo->dwReserved2),
2193 lpckParent->dwDataOffset, SEEK_SET);
2195 if ((uFlags & MMIO_FINDCHUNK) || (uFlags & MMIO_FINDRIFF) ||
2196 (uFlags & MMIO_FINDLIST)) {
2197 dprintf_mmio(stddeb, "mmioDescend // MMIO_FINDxxxx dwfcc=%08lX !\n", dwfcc);
2198 while (TRUE) {
2199 if (_lread(LOWORD(lpmminfo->dwReserved2), (LPSTR)lpck,
2200 sizeof(MMCKINFO)) < sizeof(MMCKINFO)) {
2201 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2202 GlobalUnlock(hmmio);
2203 return MMIOERR_CHUNKNOTFOUND;
2205 dprintf_mmio(stddeb, "mmioDescend // dwfcc=%08lX ckid=%08lX cksize=%08lX !\n",
2206 dwfcc, lpck->ckid, lpck->cksize);
2207 if (dwfcc == lpck->ckid) break;
2208 dwOldPos += lpck->cksize + 2 * sizeof(DWORD);
2209 if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST)
2210 dwOldPos += sizeof(DWORD);
2211 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2214 else {
2215 if (_lread(LOWORD(lpmminfo->dwReserved2), (LPSTR)lpck,
2216 sizeof(MMCKINFO)) < sizeof(MMCKINFO)) {
2217 _llseek(LOWORD(lpmminfo->dwReserved2), dwOldPos, SEEK_SET);
2218 GlobalUnlock(hmmio);
2219 return MMIOERR_CHUNKNOTFOUND;
2222 GlobalUnlock(hmmio);
2223 lpck->dwDataOffset = dwOldPos + 2 * sizeof(DWORD);
2224 if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST)
2225 lpck->dwDataOffset += sizeof(DWORD);
2226 lpmminfo->lDiskOffset = _llseek(LOWORD(lpmminfo->dwReserved2),
2227 lpck->dwDataOffset, SEEK_SET);
2228 dprintf_mmio(stddeb, "mmioDescend // lpck->ckid=%08lX lpck->cksize=%ld !\n",
2229 lpck->ckid, lpck->cksize);
2230 printf("mmioDescend // lpck->fccType=%08lX !\n", lpck->fccType);
2231 return 0;
2234 /**************************************************************************
2235 * mmioAscend [MMSYSTEM.1224]
2237 UINT WINAPI mmioAscend(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
2239 printf("mmioAscend\n");
2240 return 0;
2243 /**************************************************************************
2244 * mmioCreateChunk [MMSYSTEM.1225]
2246 UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
2248 printf("mmioCreateChunk\n");
2249 return 0;
2253 /**************************************************************************
2254 * mmioRename [MMSYSTEM.1226]
2256 UINT WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
2257 MMIOINFO FAR* lpmmioinfo, DWORD dwRenameFlags)
2259 printf("mmioRename('%s', '%s', %p, %08lX);\n",
2260 szFileName, szNewFileName, lpmmioinfo, dwRenameFlags);
2261 return 0;
2264 /**************************************************************************
2265 * DrvOpen [MMSYSTEM.1100]
2267 HDRVR DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
2269 printf("DrvOpen('%s', '%s', %08lX);\n",
2270 lpDriverName, lpSectionName, lParam);
2271 return OpenDriver(lpDriverName, lpSectionName, lParam);
2275 /**************************************************************************
2276 * DrvClose [MMSYSTEM.1101]
2278 LRESULT DrvClose(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2)
2280 printf("DrvClose(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2);
2281 return CloseDriver(hDrvr, lParam1, lParam2);
2285 /**************************************************************************
2286 * DrvSendMessage [MMSYSTEM.1102]
2288 LRESULT WINAPI DrvSendMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2)
2290 DWORD dwDevID = 0;
2291 printf("DrvSendMessage(%04X, %04X, %08lX, %08lX);\n",
2292 hDriver, msg, lParam1, lParam2);
2293 #ifndef WINELIB
2294 return CDAUDIO_DriverProc(dwDevID, hDriver, msg, lParam1, lParam2);
2295 #endif
2298 /**************************************************************************
2299 * DrvGetModuleHandle [MMSYSTEM.1103]
2301 HANDLE DrvGetModuleHandle(HDRVR hDrvr)
2303 printf("DrvGetModuleHandle(%04X);\n", hDrvr);
2304 return 0;
2308 /**************************************************************************
2309 * DrvDefDriverProc [MMSYSTEM.1104]
2311 LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
2312 DWORD dwParam1, DWORD dwParam2)
2314 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
2318 #endif /* #ifdef WINELIB */