Release 940714
[wine/multimedia.git] / misc / mmsystem.c
blob0e1eb91b9d63307dd855fa23bd70d3e5ae564857
1 /*
2 * MMSYTEM functions
4 * Copyright 1993 Martin Ayotte
5 */
6 #ifndef WINELIB
7 static char Copyright[] = "Copyright Martin Ayotte, 1993";
9 #include "stdio.h"
10 #include <fcntl.h>
11 #include <sys/ioctl.h>
12 #include "win.h"
13 #include "user.h"
14 #include "driver.h"
15 #include "mmsystem.h"
17 static WORD mciActiveDev = 0;
18 static BOOL mmTimeStarted = FALSE;
19 static MMTIME mmSysTimeMS;
20 static MMTIME mmSysTimeSMPTE;
22 typedef struct tagTIMERENTRY {
23 WORD wDelay;
24 WORD wResol;
25 FARPROC lpFunc;
26 DWORD dwUser;
27 WORD wFlags;
28 WORD wTimerID;
29 WORD wCurTime;
30 struct tagTIMERENTRY *Next;
31 struct tagTIMERENTRY *Prev;
32 } TIMERENTRY;
33 typedef TIMERENTRY *LPTIMERENTRY;
35 static LPTIMERENTRY lpTimerList = NULL;
37 static MCI_OPEN_DRIVER_PARMS mciDrv[MAXMCIDRIVERS];
39 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
40 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
43 /**************************************************************************
44 * MMSYSTEM_WEP [MMSYSTEM.1]
46 int MMSYSTEM_WEP(HANDLE hInstance, WORD wDataSeg,
47 WORD cbHeapSize, LPSTR lpCmdLine)
49 printf("MMSYSTEM DLL INIT ... hInst=%04X \n", hInstance);
50 return(TRUE);
53 /**************************************************************************
54 * sndPlaySound [MMSYSTEM.2]
56 BOOL WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT uFlags)
58 int hFile;
59 int count;
60 WAVEHDR WaveHdr;
61 PCMWAVEFORMAT WaveFormat;
62 WAVEOPENDESC WaveDesc;
63 DWORD dwRet;
64 char str[128];
65 LPSTR ptr;
66 printf("sndPlaySound // SoundName='%s' uFlags=%04X !\n",
67 lpszSoundName, uFlags);
68 if (lpszSoundName == NULL) {
69 printf("sndPlaySound // Stop !\n");
70 return FALSE;
72 hFile = open(lpszSoundName, O_RDONLY);
73 if (hFile == 0) {
74 printf("sndPlaySound // searching in SystemSound List !\n");
75 GetProfileString("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
76 if (strlen(str) == 0) return FALSE;
77 if ((ptr = strchr(str, ',')) != NULL) *ptr = '\0';
78 hFile = open(str, O_RDONLY);
79 if (hFile == 0) {
80 printf("sndPlaySound // can't find SystemSound='%s' !\n", str);
81 return FALSE;
84 WaveDesc.hWave = 0;
85 WaveDesc.lpFormat = (LPWAVEFORMAT)&WaveFormat;
86 WaveFormat.wf.wFormatTag = WAVE_FORMAT_PCM;
87 WaveFormat.wBitsPerSample = 8;
88 WaveFormat.wf.nChannels = 1;
89 WaveFormat.wf.nSamplesPerSec = 11025;
90 WaveFormat.wf.nAvgBytesPerSec = 11025;
91 WaveFormat.wf.nBlockAlign = 1;
92 dwRet = wodMessage(0, WODM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL);
93 if (dwRet != MMSYSERR_NOERROR) {
94 printf("sndPlaySound // can't open WaveOut device !\n");
95 return FALSE;
97 WaveHdr.lpData = (LPSTR) malloc(64000);
98 WaveHdr.dwBufferLength = 64000;
99 WaveHdr.dwUser = 0L;
100 WaveHdr.dwFlags = 0L;
101 WaveHdr.dwLoops = 0L;
102 dwRet = wodMessage(0, WODM_PREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
103 if (dwRet != MMSYSERR_NOERROR) {
104 printf("sndPlaySound // can't prepare WaveOut device !\n");
105 return FALSE;
107 while(TRUE) {
108 count = read(hFile, WaveHdr.lpData, WaveHdr.dwBufferLength);
109 if (count == 0) break;
110 WaveHdr.dwBytesRecorded = count;
111 wodMessage(0, WODM_WRITE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
113 wodMessage(0, WODM_UNPREPARE, 0, (DWORD)&WaveHdr, sizeof(WAVEHDR));
114 wodMessage(0, WODM_CLOSE, 0, 0L, 0L);
115 free(WaveHdr.lpData);
116 close(hFile);
118 return TRUE;
121 /**************************************************************************
122 * mmsystemGetVersion [MMSYSTEM.5]
124 WORD WINAPI mmsystemGetVersion()
126 printf("mmsystemGetVersion // 0.4.0 ...?... :-) !\n");
127 return(0x0040);
130 /**************************************************************************
131 * DriverProc [MMSYSTEM.6]
133 LRESULT DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
134 DWORD dwParam1, DWORD dwParam2)
136 return DrvDefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
139 /**************************************************************************
140 * OutputDebugStr [MMSYSTEM.30]
142 void WINAPI OutputDebugStr(LPCSTR str)
144 printf("EMPTY STUB !!! OutputDebugStr('%s');\n", str);
147 /**************************************************************************
148 * DriverCallback [MMSYSTEM.31]
150 BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
151 WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
153 printf("DriverCallback(%08X, %04X, %04X, %04X, %08X, %08X, %08X); !\n",
154 dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
155 switch(uFlags & DCB_TYPEMASK) {
156 case DCB_NULL:
157 printf("DriverCallback() // CALLBACK_NULL !\n");
158 break;
159 case DCB_WINDOW:
160 printf("DriverCallback() // CALLBACK_WINDOW !\n");
161 break;
162 case DCB_TASK:
163 printf("DriverCallback() // CALLBACK_TASK !\n");
164 break;
165 case DCB_FUNCTION:
166 printf("DriverCallback() // CALLBACK_FUNCTION !\n");
167 break;
169 return TRUE;
172 /**************************************************************************
173 * JoyGetNumDevs [MMSYSTEM.101]
175 WORD JoyGetNumDevs()
177 printf("EMPTY STUB !!! JoyGetNumDevs();\n");
178 return 0;
181 /**************************************************************************
182 * JoyGetDevCaps [MMSYSTEM.102]
184 WORD JoyGetDevCaps(WORD wID, LPJOYCAPS lpCaps, WORD wSize)
186 printf("EMPTY STUB !!! JoyGetDevCaps(%04X, %08X, %d);\n",
187 wID, lpCaps, wSize);
188 return MMSYSERR_NODRIVER;
191 /**************************************************************************
192 * JoyGetPos [MMSYSTEM.103]
194 WORD JoyGetPos(WORD wID, LPJOYINFO lpInfo)
196 printf("EMPTY STUB !!! JoyGetPos(%04X, %08X);\n", wID, lpInfo);
197 return MMSYSERR_NODRIVER;
200 /**************************************************************************
201 * JoyGetThreshold [MMSYSTEM.104]
203 WORD JoyGetThreshold(WORD wID, LPWORD lpThreshold)
205 printf("EMPTY STUB !!! JoyGetThreshold(%04X, %08X);\n", wID, lpThreshold);
206 return MMSYSERR_NODRIVER;
209 /**************************************************************************
210 * JoyReleaseCapture [MMSYSTEM.105]
212 WORD JoyReleaseCapture(WORD wID)
214 printf("EMPTY STUB !!! JoyReleaseCapture(%04X);\n", wID);
215 return MMSYSERR_NODRIVER;
218 /**************************************************************************
219 * JoySetCapture [MMSYSTEM.106]
221 WORD JoySetCapture(HWND hWnd, WORD wID, WORD wPeriod, BOOL bChanged)
223 printf("EMPTY STUB !!! JoySetCapture(%04X, %04X, %d, %d);\n",
224 hWnd, wID, wPeriod, bChanged);
225 return MMSYSERR_NODRIVER;
228 /**************************************************************************
229 * JoySetThreshold [MMSYSTEM.107]
231 WORD JoySetThreshold(WORD wID, WORD wThreshold)
233 printf("EMPTY STUB !!! JoySetThreshold(%04X, %d);\n", wID, wThreshold);
234 return MMSYSERR_NODRIVER;
237 /**************************************************************************
238 * JoySetCalibration [MMSYSTEM.109]
240 WORD JoySetCalibration(WORD wID)
242 printf("EMPTY STUB !!! JoySetCalibration(%04X);\n", wID);
243 return MMSYSERR_NODRIVER;
247 /**************************************************************************
248 * auxGetNumDevs [MMSYSTEM.350]
250 UINT WINAPI auxGetNumDevs()
252 UINT count = 0;
253 printf("auxGetNumDevs !\n");
254 count += auxMessage(0, AUXDM_GETNUMDEVS, 0L, 0L, 0L);
255 printf("auxGetNumDevs return %u \n", count);
256 return count;
259 /**************************************************************************
260 * auxGetDevCaps [MMSYSTEM.351]
262 UINT WINAPI auxGetDevCaps(UINT uDeviceID, AUXCAPS FAR* lpCaps, UINT uSize)
264 printf("auxGetDevCaps !\n");
265 return 0;
268 /**************************************************************************
269 * auxGetVolume [MMSYSTEM.352]
271 UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
273 printf("auxGetVolume !\n");
274 return 0;
277 /**************************************************************************
278 * auxSetVolume [MMSYSTEM.353]
280 UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume)
282 printf("auxSetVolume !\n");
283 return 0;
286 /**************************************************************************
287 * auxOutMessage [MMSYSTEM.354]
289 DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2)
291 printf("auxOutMessage !\n");
292 return 0L;
295 /**************************************************************************
296 * mciGetErrorString [MMSYSTEM.706]
298 BOOL mciGetErrorString (DWORD wError, LPSTR lpstrBuffer, UINT uLength)
300 LPSTR msgptr;
301 int maxbuf;
302 printf("mciGetErrorString(%04X, %08X, %d);\n", wError, lpstrBuffer, uLength);
303 if ((lpstrBuffer == NULL) || (uLength < 1)) return(FALSE);
304 lpstrBuffer[0] = '\0';
305 switch(wError) {
306 case MCIERR_INVALID_DEVICE_ID:
307 msgptr = "Invalid MCI device ID. Use the ID returned when opening the MCI device.";
308 break;
309 case MCIERR_UNRECOGNIZED_KEYWORD:
310 msgptr = "The driver cannot recognize the specified command parameter.";
311 break;
312 case MCIERR_UNRECOGNIZED_COMMAND:
313 msgptr = "The driver cannot recognize the specified command.";
314 break;
315 case MCIERR_HARDWARE:
316 msgptr = "There is a problem with your media device. Make sure it is working correctly or contact the device manufacturer.";
317 break;
318 case MCIERR_INVALID_DEVICE_NAME:
319 msgptr = "The specified device is not open or is not recognized by MCI.";
320 break;
321 case MCIERR_OUT_OF_MEMORY:
322 msgptr = "Not enough memory available for this task. \nQuit one or more applications to increase available memory, and then try again.";
323 break;
324 case MCIERR_DEVICE_OPEN:
325 msgptr = "The device name is already being used as an alias by this application. Use a unique alias.";
326 break;
327 case MCIERR_CANNOT_LOAD_DRIVER:
328 msgptr = "There is an undetectable problem in loading the specified device driver.";
329 break;
330 case MCIERR_MISSING_COMMAND_STRING:
331 msgptr = "No command was specified.";
332 break;
333 case MCIERR_PARAM_OVERFLOW:
334 msgptr = "The output string was to large to fit in the return buffer. Increase the size of the buffer.";
335 break;
336 case MCIERR_MISSING_STRING_ARGUMENT:
337 msgptr = "The specified command requires a character-string parameter. Please provide one.";
338 break;
339 case MCIERR_BAD_INTEGER:
340 msgptr = "The specified integer is invalid for this command.";
341 break;
342 case MCIERR_PARSER_INTERNAL:
343 msgptr = "The device driver returned an invalid return type. Check with the device manufacturer about obtaining a new driver.";
344 break;
345 case MCIERR_DRIVER_INTERNAL:
346 msgptr = "There is a problem with the device driver. Check with the device manufacturer about obtaining a new driver.";
347 break;
348 case MCIERR_MISSING_PARAMETER:
349 msgptr = "The specified command requires a parameter. Please supply one.";
350 break;
351 case MCIERR_UNSUPPORTED_FUNCTION:
352 msgptr = "The MCI device you are using does not support the specified command.";
353 break;
354 case MCIERR_FILE_NOT_FOUND:
355 msgptr = "Cannot find the specified file. Make sure the path and filename are correct.";
356 break;
357 case MCIERR_DEVICE_NOT_READY:
358 msgptr = "The device driver is not ready.";
359 break;
360 case MCIERR_INTERNAL:
361 msgptr = "A problem occurred in initializing MCI. Try restarting Windows.";
362 break;
363 case MCIERR_DRIVER:
364 msgptr = "There is a problem with the device driver. The driver has closed. Cannot access error.";
365 break;
366 case MCIERR_CANNOT_USE_ALL:
367 msgptr = "Cannot use 'all' as the device name with the specified command.";
368 break;
369 case MCIERR_MULTIPLE:
370 msgptr = "Errors occurred in more than one device. Specify each command and device separately to determine which devices caused the error";
371 break;
372 case MCIERR_EXTENSION_NOT_FOUND:
373 msgptr = "Cannot determine the device type from the given filename extension.";
374 break;
375 case MCIERR_OUTOFRANGE:
376 msgptr = "The specified parameter is out of range for the specified command.";
377 break;
378 case MCIERR_FLAGS_NOT_COMPATIBLE:
379 msgptr = "The specified parameters cannot be used together.";
380 break;
381 case MCIERR_FILE_NOT_SAVED:
382 msgptr = "Cannot save the specified file. Make sure you have enough disk space or are still connected to the network.";
383 break;
384 case MCIERR_DEVICE_TYPE_REQUIRED:
385 msgptr = "Cannot find the specified device. Make sure it is installed or that the device name is spelled correctly.";
386 break;
387 case MCIERR_DEVICE_LOCKED:
388 msgptr = "The specified device is now being closed. Wait a few seconds, and then try again.";
389 break;
390 case MCIERR_DUPLICATE_ALIAS:
391 msgptr = "The specified alias is already being used in this application. Use a unique alias.";
392 break;
393 case MCIERR_BAD_CONSTANT:
394 msgptr = "The specified parameter is invalid for this command.";
395 break;
396 case MCIERR_MUST_USE_SHAREABLE:
397 msgptr = "The device driver is already in use. To share it, use the 'shareable' parameter with each 'open' command.";
398 break;
399 case MCIERR_MISSING_DEVICE_NAME:
400 msgptr = "The specified command requires an alias, file, driver, or device name. Please supply one.";
401 break;
402 case MCIERR_BAD_TIME_FORMAT:
403 msgptr = "The specified value for the time format is invalid. Refer to the MCI documentation for valid formats.";
404 break;
405 case MCIERR_NO_CLOSING_QUOTE:
406 msgptr = "A closing double-quotation mark is missing from the parameter value. Please supply one.";
407 break;
408 case MCIERR_DUPLICATE_FLAGS:
409 msgptr = "A parameter or value was specified twice. Only specify it once.";
410 break;
411 case MCIERR_INVALID_FILE:
412 msgptr = "The specified file cannot be played on the specified MCI device. The file may be corrupt, or not in the correct format.";
413 break;
414 case MCIERR_NULL_PARAMETER_BLOCK:
415 msgptr = "A null parameter block was passed to MCI.";
416 break;
417 case MCIERR_UNNAMED_RESOURCE:
418 msgptr = "Cannot save an unnamed file. Supply a filename.";
419 break;
420 case MCIERR_NEW_REQUIRES_ALIAS:
421 msgptr = "You must specify an alias when using the 'new' parameter.";
422 break;
423 case MCIERR_NOTIFY_ON_AUTO_OPEN:
424 msgptr = "Cannot use the 'notify' flag with auto-opened devices.";
425 break;
426 case MCIERR_NO_ELEMENT_ALLOWED:
427 msgptr = "Cannot use a filename with the specified device.";
428 break;
429 case MCIERR_NONAPPLICABLE_FUNCTION:
430 msgptr = "Cannot carry out the commands in the order specified. Correct the command sequence, and then try again.";
431 break;
432 case MCIERR_ILLEGAL_FOR_AUTO_OPEN:
433 msgptr = "Cannot carry out the specified command on an auto-opened device. Wait until the device is closed, and then try again.";
434 break;
435 case MCIERR_FILENAME_REQUIRED:
436 msgptr = "The filename is invalid. Make sure the filename is not longer than 8 characters, followed by a period and an extension.";
437 break;
438 case MCIERR_EXTRA_CHARACTERS:
439 msgptr = "Cannot specify extra characters after a string enclosed in quotation marks.";
440 break;
441 case MCIERR_DEVICE_NOT_INSTALLED:
442 msgptr = "The specified device is not installed on the system. Use the Drivers option in Control Panel to install the device.";
443 break;
444 case MCIERR_GET_CD:
445 msgptr = "Cannot access the specified file or MCI device. Try changing directories or restarting your computer.";
446 break;
447 case MCIERR_SET_CD:
448 msgptr = "Cannot access the specified file or MCI device because the application cannot change directories.";
449 break;
450 case MCIERR_SET_DRIVE:
451 msgptr = "Cannot access specified file or MCI device because the application cannot change drives.";
452 break;
453 case MCIERR_DEVICE_LENGTH:
454 msgptr = "Specify a device or driver name that is less than 79 characters.";
455 break;
456 case MCIERR_DEVICE_ORD_LENGTH:
457 msgptr = "Specify a device or driver name that is less than 69 characters.";
458 break;
459 case MCIERR_NO_INTEGER:
460 msgptr = "The specified command requires an integer parameter. Please provide one.";
461 break;
462 case MCIERR_WAVE_OUTPUTSINUSE:
463 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.";
464 break;
465 case MCIERR_WAVE_SETOUTPUTINUSE:
466 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.";
467 break;
468 case MCIERR_WAVE_INPUTSINUSE:
469 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.";
470 break;
471 case MCIERR_WAVE_SETINPUTINUSE:
472 msgptr = "Cannot set the current wave device for recording because it is in use. Wait until the device is free, and then try again.";
473 break;
474 case MCIERR_WAVE_OUTPUTUNSPECIFIED:
475 msgptr = "Any compatible waveform playback device may be used.";
476 break;
477 case MCIERR_WAVE_INPUTUNSPECIFIED:
478 msgptr = "Any compatible waveform recording device may be used.";
479 break;
480 case MCIERR_WAVE_OUTPUTSUNSUITABLE:
481 msgptr = "No wave device that can play files in the current format is installed. Use the Drivers option to install the wave device.";
482 break;
483 case MCIERR_WAVE_SETOUTPUTUNSUITABLE:
484 msgptr = "The device you are trying to play to cannot recognize the current file format.";
485 break;
486 case MCIERR_WAVE_INPUTSUNSUITABLE:
487 msgptr = "No wave device that can record files in the current format is installed. Use the Drivers option to install the wave device.";
488 break;
489 case MCIERR_WAVE_SETINPUTUNSUITABLE:
490 msgptr = "The device you are trying to record from cannot recognize the current file format.";
491 break;
492 case MCIERR_NO_WINDOW:
493 msgptr = "There is no display window.";
494 break;
495 case MCIERR_CREATEWINDOW:
496 msgptr = "Could not create or use window.";
497 break;
498 case MCIERR_FILE_READ:
499 msgptr = "Cannot read the specified file. Make sure the file is still present, or check your disk or network connection.";
500 break;
501 case MCIERR_FILE_WRITE:
502 msgptr = "Cannot write to the specified file. Make sure you have enough disk space or are still connected to the network.";
503 break;
506 #define MCIERR_SEQ_DIV_INCOMPATIBLE (MCIERR_BASE + 80)
507 #define MCIERR_SEQ_PORT_INUSE (MCIERR_BASE + 81)
508 #define MCIERR_SEQ_PORT_NONEXISTENT (MCIERR_BASE + 82)
509 #define MCIERR_SEQ_PORT_MAPNODEVICE (MCIERR_BASE + 83)
510 #define MCIERR_SEQ_PORT_MISCERROR (MCIERR_BASE + 84)
511 #define MCIERR_SEQ_TIMER (MCIERR_BASE + 85)
512 #define MCIERR_SEQ_PORTUNSPECIFIED (MCIERR_BASE + 86)
513 #define MCIERR_SEQ_NOMIDIPRESENT (MCIERR_BASE + 87)
515 msg# 513 : vcr
516 msg# 514 : videodisc
517 msg# 515 : overlay
518 msg# 516 : cdaudio
519 msg# 517 : dat
520 msg# 518 : scanner
521 msg# 519 : animation
522 msg# 520 : digitalvideo
523 msg# 521 : other
524 msg# 522 : waveaudio
525 msg# 523 : sequencer
526 msg# 524 : not ready
527 msg# 525 : stopped
528 msg# 526 : playing
529 msg# 527 : recording
530 msg# 528 : seeking
531 msg# 529 : paused
532 msg# 530 : open
533 msg# 531 : false
534 msg# 532 : true
535 msg# 533 : milliseconds
536 msg# 534 : hms
537 msg# 535 : msf
538 msg# 536 : frames
539 msg# 537 : smpte 24
540 msg# 538 : smpte 25
541 msg# 539 : smpte 30
542 msg# 540 : smpte 30 drop
543 msg# 541 : bytes
544 msg# 542 : samples
545 msg# 543 : tmsf
547 default:
548 msgptr = "Unkown MCI Error !\n";
549 break;
551 maxbuf = min(uLength - 1, strlen(msgptr));
552 if (maxbuf > 0) strncpy(lpstrBuffer, msgptr, maxbuf);
553 lpstrBuffer[maxbuf + 1] = '\0';
554 return(TRUE);
558 /**************************************************************************
559 * mciDriverNotify [MMSYSTEM.711]
561 BOOL WINAPI mciDriverNotify(HWND hWndCallBack, UINT wDevID, UINT wStatus)
563 printf("mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
564 PostMessage(hWndCallBack, MM_MCINOTIFY, wStatus,
565 MAKELONG(mciDrv[wDevID].wDeviceID, 0));
566 return TRUE;
569 /**************************************************************************
570 * mciOpen [internal]
572 DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lpParms)
574 char str[128];
575 DWORD dwDevTyp = 0;
576 UINT wDevID = 1;
577 printf("mciOpen(%08X, %08X)\n", dwParam, lpParms);
578 if (lpParms == NULL) return MCIERR_INTERNAL;
579 while(mciDrv[wDevID].wType != 0) {
580 if (++wDevID >= MAXMCIDRIVERS) {
581 printf("MCI_OPEN // MAXMCIDRIVERS reached !\n");
582 return MCIERR_INTERNAL;
585 if (dwParam & MCI_OPEN_TYPE) {
586 if (lpParms->lpstrDeviceType == NULL) return MCIERR_INTERNAL;
587 if (dwParam & MCI_OPEN_TYPE_ID) {
588 printf("MCI_OPEN // Dev=%08X !\n", lpParms->lpstrDeviceType);
589 dwDevTyp = (DWORD)lpParms->lpstrDeviceType;
591 else {
592 printf("MCI_OPEN // Dev='%s' !\n", lpParms->lpstrDeviceType);
593 strcpy(str, lpParms->lpstrDeviceType);
594 AnsiUpper(str);
595 if (strcmp(str, "CDAUDIO") == 0) {
596 dwDevTyp = MCI_DEVTYPE_CD_AUDIO;
598 else
599 if (strcmp(str, "WAVEAUDIO") == 0) {
600 dwDevTyp = MCI_DEVTYPE_WAVEFORM_AUDIO;
602 else
603 if (strcmp(str, "SEQUENCER") == 0) {
604 dwDevTyp = MCI_DEVTYPE_SEQUENCER;
606 else
607 if (strcmp(str, "ANIMATION1") == 0) {
608 dwDevTyp = MCI_DEVTYPE_ANIMATION;
611 mciDrv[wDevID].wType = dwDevTyp;
612 mciDrv[wDevID].wDeviceID = 1;
613 lpParms->wDeviceID = wDevID;
614 printf("MCI_OPEN // wDeviceID=%04X !\n", lpParms->wDeviceID);
615 switch(dwDevTyp) {
616 case MCI_DEVTYPE_CD_AUDIO:
617 #ifdef WINELIB
618 WINELIB_UNIMP ("CDAUDIO_DriverProc");
619 #else
620 return CDAUDIO_DriverProc(0, 0, MCI_OPEN_DRIVER,
622 dwParam, (DWORD)lpParms);
623 #endif
624 case MCI_DEVTYPE_WAVEFORM_AUDIO:
625 return WAVE_DriverProc(0, 0, MCI_OPEN_DRIVER,
626 dwParam, (DWORD)lpParms);
627 case MCI_DEVTYPE_SEQUENCER:
628 printf("MCI_OPEN // No SEQUENCER yet !\n");
629 return MCIERR_DEVICE_NOT_INSTALLED;
630 case MCI_DEVTYPE_ANIMATION:
631 printf("MCI_OPEN // No ANIMATION yet !\n");
632 return MCIERR_DEVICE_NOT_INSTALLED;
633 case MCI_DEVTYPE_DIGITAL_VIDEO:
634 printf("MCI_OPEN // No DIGITAL_VIDEO yet !\n");
635 return MCIERR_DEVICE_NOT_INSTALLED;
636 default:
637 printf("MCI_OPEN // Invalid Device Name '%08X' !\n", lpParms->lpstrDeviceType);
638 return MCIERR_INVALID_DEVICE_NAME;
641 return MCIERR_INTERNAL;
645 /**************************************************************************
646 * mciClose [internal]
648 DWORD mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
650 DWORD dwRet = MCIERR_INTERNAL;
651 printf("mciClose(%u, %08X, %08X)\n", wDevID, dwParam, lpParms);
652 switch(mciDrv[wDevID].wType) {
653 case MCI_DEVTYPE_CD_AUDIO:
654 #ifndef WINELIB
655 dwRet = CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, 0,
656 MCI_CLOSE, dwParam, (DWORD)lpParms);
657 #endif
658 break;
659 case MCI_DEVTYPE_WAVEFORM_AUDIO:
660 dwRet = WAVE_DriverProc(mciDrv[wDevID].wDeviceID, 0,
661 MCI_CLOSE, dwParam, (DWORD)lpParms);
662 break;
663 default:
664 printf("mciClose() // unknown type=%04X !\n", mciDrv[wDevID].wType);
666 mciDrv[wDevID].wType = 0;
667 return dwRet;
671 /**************************************************************************
672 * mciSound [internal]
674 DWORD mciSound(UINT wDevID, DWORD dwParam, LPMCI_SOUND_PARMS lpParms)
676 if (lpParms == NULL) return MCIERR_INTERNAL;
677 if (dwParam & MCI_SOUND_NAME)
678 printf("MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName);
679 return MCIERR_INVALID_DEVICE_ID;
684 /**************************************************************************
685 * mciSendCommand [MMSYSTEM.701]
687 DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2)
689 HDRVR hDrv = 0;
690 #ifdef DEBUG_MCI
691 printf("mciSendCommand(%04X, %04X, %08X, %08X)\n",
692 wDevID, wMsg, dwParam1, dwParam2);
693 #endif
694 switch(wMsg) {
695 case MCI_OPEN:
696 return mciOpen(dwParam1, (LPMCI_OPEN_PARMS)dwParam2);
697 case MCI_CLOSE:
698 return mciClose(wDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
699 default:
700 switch(mciDrv[wDevID].wType) {
701 case MCI_DEVTYPE_CD_AUDIO:
702 #ifndef WINELIB
703 return CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
704 wMsg, dwParam1, dwParam2);
705 #endif
707 case MCI_DEVTYPE_WAVEFORM_AUDIO:
708 return WAVE_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
709 wMsg, dwParam1, dwParam2);
710 default:
711 printf("mciSendCommand() // unknown type=%04X !\n",
712 mciDrv[wDevID].wType);
715 return MMSYSERR_INVALPARAM;
718 /**************************************************************************
719 * mciGetDeviceID [MMSYSTEM.703]
721 UINT mciGetDeviceID (LPCSTR lpstrName)
723 char str[128];
724 printf("mciGetDeviceID(%s)\n", lpstrName);
725 if (lpstrName != NULL) {
726 strcpy(str, lpstrName);
727 AnsiUpper(str);
728 if (strcmp(str, "ALL") == 0) return MCI_ALL_DEVICE_ID;
730 return 0;
733 /**************************************************************************
734 * mciSendString [MMSYSTEM.702]
736 DWORD WINAPI mciSendString (LPCSTR lpstrCommand,
737 LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback)
739 printf("mciSendString('%s', %lX, %u, %X)\n",
740 lpstrCommand, lpstrReturnString,
741 uReturnLength, hwndCallback);
742 return MCIERR_MISSING_COMMAND_STRING;
745 /**************************************************************************
746 * mciSetYieldProc [MMSYSTEM.714]
748 BOOL WINAPI mciSetYieldProc (UINT uDeviceID,
749 YIELDPROC fpYieldProc, DWORD dwYieldData)
753 /**************************************************************************
754 * mciGetDeviceIDFromElementID [MMSYSTEM.715]
756 UINT WINAPI mciGetDeviceIDFromElementID(DWORD dwElementID, LPCSTR lpstrType)
760 /**************************************************************************
761 * mciGetYieldProc [MMSYSTEM.716]
763 YIELDPROC WINAPI mciGetYieldProc(UINT uDeviceID, DWORD FAR* lpdwYieldData)
767 /**************************************************************************
768 * mciGetCreatorTask [MMSYSTEM.717]
770 HTASK WINAPI mciGetCreatorTask(UINT uDeviceID)
774 /**************************************************************************
775 * midiOutGetNumDevs [MMSYSTEM.201]
777 UINT WINAPI midiOutGetNumDevs(void)
779 printf("midiOutGetNumDevs\n");
780 return 0;
783 /**************************************************************************
784 * midiOutGetDevCaps [MMSYSTEM.202]
786 UINT WINAPI midiOutGetDevCaps(UINT uDeviceID,
787 MIDIOUTCAPS FAR* lpCaps, UINT uSize)
789 printf("midiOutGetDevCaps\n");
790 return 0;
793 /**************************************************************************
794 * midiOutGetErrorText [MMSYSTEM.203]
796 UINT WINAPI midiOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
798 printf("midiOutGetErrorText\n");
799 return(midiGetErrorText(uError, lpText, uSize));
803 /**************************************************************************
804 * midiGetErrorText [internal]
806 UINT WINAPI midiGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
808 LPSTR msgptr;
809 int maxbuf;
810 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
811 lpText[0] = '\0';
812 switch(uError) {
813 case MIDIERR_UNPREPARED:
814 msgptr = "The MIDI header was not prepared. Use the Prepare function to prepare the header, and then try again.";
815 break;
816 case MIDIERR_STILLPLAYING:
817 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
818 break;
819 case MIDIERR_NOMAP:
820 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.";
821 break;
822 case MIDIERR_NOTREADY:
823 msgptr = "The port is transmitting data to the device. Wait until the data has been transmitted, and then try again.";
824 break;
825 case MIDIERR_NODEVICE:
826 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.";
827 break;
828 case MIDIERR_INVALIDSETUP:
829 msgptr = "The current MIDI setup is damaged. Copy the original MIDIMAP.CFG file to the Windows SYSTEM directory, and then try again.";
830 break;
832 msg# 336 : Cannot use the song-pointer time format and the SMPTE time-format together.
833 msg# 337 : The specified MIDI device is already in use. Wait until it is free, and then try again.
834 msg# 338 : The specified MIDI device is not installed on the system. Use the Drivers option in Control Panel to install the driver.
835 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.
836 msg# 340 : An error occurred using the specified port.
837 msg# 341 : All multimedia timers are being used by other applications. Quit one of these applications, and then try again.
838 msg# 342 : There is no current MIDI port.
839 msg# 343 : There are no MIDI devices installed on the system. Use the Drivers option in Control Panel to install the driver.
841 default:
842 msgptr = "Unkown MIDI Error !\n";
843 break;
845 maxbuf = min(uSize - 1, strlen(msgptr));
846 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
847 lpText[maxbuf + 1] = '\0';
848 return(TRUE);
851 /**************************************************************************
852 * midiOutOpen [MMSYSTEM.204]
854 UINT WINAPI midiOutOpen(HMIDIOUT FAR* lphMidiOut, UINT uDeviceID,
855 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
857 printf("midiOutOpen\n");
858 if (lphMidiOut != NULL) *lphMidiOut = 0;
859 return 0;
862 /**************************************************************************
863 * midiOutClose [MMSYSTEM.205]
865 UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
867 printf("midiOutClose\n");
868 return 0;
871 /**************************************************************************
872 * midiOutPrepareHeader [MMSYSTEM.206]
874 UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
875 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
877 printf("midiOutPrepareHeader\n");
878 return 0;
881 /**************************************************************************
882 * midiOutUnprepareHeader [MMSYSTEM.207]
884 UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
885 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
887 printf("midiOutUnprepareHeader\n");
888 return 0;
891 /**************************************************************************
892 * midiOutShortMsg [MMSYSTEM.208]
894 UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
896 printf("midiOutShortMsg\n");
897 return 0;
900 /**************************************************************************
901 * midiOutLongMsg [MMSYSTEM.209]
903 UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
904 MIDIHDR FAR* lpMidiOutHdr, UINT uSize)
906 printf("midiOutLongMsg\n");
907 return 0;
910 /**************************************************************************
911 * midiOutReset [MMSYSTEM.210]
913 UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
915 printf("midiOutReset\n");
916 return 0;
919 /**************************************************************************
920 * midiOutGetVolume [MMSYSTEM.211]
922 UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
924 printf("midiOutGetVolume\n");
925 return 0;
928 /**************************************************************************
929 * midiOutSetVolume [MMSYSTEM.212]
931 UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume)
933 printf("midiOutSetVolume\n");
934 return 0;
937 /**************************************************************************
938 * midiOutCachePatches [MMSYSTEM.213]
940 UINT WINAPI midiOutCachePatches(HMIDIOUT hMidiOut,
941 UINT uBank, WORD FAR* lpwPatchArray, UINT uFlags)
943 printf("midiOutCachePatches\n");
944 return 0;
947 /**************************************************************************
948 * midiOutCacheDrumPatches [MMSYSTEM.214]
950 UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT hMidiOut,
951 UINT uPatch, WORD FAR* lpwKeyArray, UINT uFlags)
953 printf("midiOutCacheDrumPatches\n");
954 return 0;
957 /**************************************************************************
958 * midiOutGetID [MMSYSTEM.215]
960 UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT FAR* lpuDeviceID)
962 printf("midiOutGetID\n");
963 return 0;
966 /**************************************************************************
967 * midiOutMessage [MMSYSTEM.216]
969 DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, DWORD dw1, DWORD dw2)
971 printf("midiOutMessage\n");
972 return 0;
975 /**************************************************************************
976 * midiInGetNumDevs [MMSYSTEM.301]
978 UINT WINAPI midiInGetNumDevs(void)
980 printf("midiInGetNumDevs\n");
981 return 0;
984 /**************************************************************************
985 * midiInGetDevCaps [MMSYSTEM.302]
987 UINT WINAPI midiInGetDevCaps(UINT uDeviceID,
988 LPMIDIINCAPS lpCaps, UINT uSize)
990 printf("midiInGetDevCaps\n");
991 return 0;
994 /**************************************************************************
995 * midiInGetErrorText [MMSYSTEM.303]
997 UINT WINAPI midiInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
999 printf("midiInGetErrorText\n");
1000 return (midiGetErrorText(uError, lpText, uSize));
1003 /**************************************************************************
1004 * midiInOpen [MMSYSTEM.304]
1006 UINT WINAPI midiInOpen(HMIDIIN FAR* lphMidiIn, UINT uDeviceID,
1007 DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1009 printf("midiInOpen\n");
1010 if (lphMidiIn != NULL) *lphMidiIn = 0;
1011 return 0;
1014 /**************************************************************************
1015 * midiInClose [MMSYSTEM.305]
1017 UINT WINAPI midiInClose(HMIDIIN hMidiIn)
1019 printf("midiInClose\n");
1020 return 0;
1023 /**************************************************************************
1024 * midiInPrepareHeader [MMSYSTEM.306]
1026 UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
1027 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1029 printf("midiInPrepareHeader\n");
1030 return 0;
1033 /**************************************************************************
1034 * midiInUnprepareHeader [MMSYSTEM.307]
1036 UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
1037 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1039 printf("midiInUnprepareHeader\n");
1040 return 0;
1043 /**************************************************************************
1044 * midiInAddBuffer [MMSYSTEM.308]
1046 UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
1047 MIDIHDR FAR* lpMidiInHdr, UINT uSize)
1049 printf("midiInAddBuffer\n");
1050 return 0;
1053 /**************************************************************************
1054 * midiInStart [MMSYSTEM.309]
1056 UINT WINAPI midiInStart(HMIDIIN hMidiIn)
1058 printf("midiInStart\n");
1059 return 0;
1062 /**************************************************************************
1063 * midiInStop [MMSYSTEM.310]
1065 UINT WINAPI midiInStop(HMIDIIN hMidiIn)
1067 printf("midiInStop\n");
1068 return 0;
1071 /**************************************************************************
1072 * midiInReset [MMSYSTEM.311]
1074 UINT WINAPI midiInReset(HMIDIIN hMidiIn)
1076 printf("midiInReset\n");
1077 return 0;
1080 /**************************************************************************
1081 * midiInGetID [MMSYSTEM.312]
1083 UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT FAR* lpuDeviceID)
1085 printf("midiInGetID\n");
1086 return 0;
1089 /**************************************************************************
1090 * midiInMessage [MMSYSTEM.313]
1092 DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
1093 DWORD dwParam1, DWORD dwParam2)
1095 printf("midiInMessage\n");
1096 return 0;
1100 /**************************************************************************
1101 * waveOutGetNumDevs [MMSYSTEM.401]
1103 UINT WINAPI waveOutGetNumDevs()
1105 UINT count = 0;
1106 printf("waveOutGetNumDevs\n");
1107 count += wodMessage(0, WODM_GETNUMDEVS, 0L, 0L, 0L);
1108 printf("waveOutGetNumDevs return %u \n", count);
1109 return count;
1112 /**************************************************************************
1113 * waveOutGetDevCaps [MMSYSTEM.402]
1115 UINT WINAPI waveOutGetDevCaps(UINT uDeviceID, WAVEOUTCAPS FAR* lpCaps, UINT uSize)
1117 printf("waveOutGetDevCaps\n");
1118 return wodMessage(uDeviceID, WODM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1121 /**************************************************************************
1122 * waveOutGetErrorText [MMSYSTEM.403]
1124 UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1126 printf("waveOutGetErrorText\n");
1127 return(waveGetErrorText(uError, lpText, uSize));
1131 /**************************************************************************
1132 * waveGetErrorText [internal]
1134 UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1136 LPSTR msgptr;
1137 int maxbuf;
1138 printf("waveGetErrorText(%04X, %08X, %d);\n", uError, lpText, uSize);
1139 if ((lpText == NULL) || (uSize < 1)) return(FALSE);
1140 lpText[0] = '\0';
1141 switch(uError) {
1142 case MMSYSERR_NOERROR:
1143 msgptr = "The specified command was carried out.";
1144 break;
1145 case MMSYSERR_ERROR:
1146 msgptr = "Undefined external error.";
1147 break;
1148 case MMSYSERR_BADDEVICEID:
1149 msgptr = "A device ID has been used that is out of range for your system.";
1150 break;
1151 case MMSYSERR_NOTENABLED:
1152 msgptr = "The driver was not enabled.";
1153 break;
1154 case MMSYSERR_ALLOCATED:
1155 msgptr = "The specified device is already in use. Wait until it is free, and then try again.";
1156 break;
1157 case MMSYSERR_INVALHANDLE:
1158 msgptr = "The specified device handle is invalid.";
1159 break;
1160 case MMSYSERR_NODRIVER:
1161 msgptr = "There is no driver installed on your system !\n";
1162 break;
1163 case MMSYSERR_NOMEM:
1164 msgptr = "Not enough memory available for this task. Quit one or more applications to increase available memory, and then try again.";
1165 break;
1166 case MMSYSERR_NOTSUPPORTED:
1167 msgptr = "This function is not supported. Use the Capabilities function to determine which functions and messages the driver supports.";
1168 break;
1169 case MMSYSERR_BADERRNUM:
1170 msgptr = "An error number was specified that is not defined in the system.";
1171 break;
1172 case MMSYSERR_INVALFLAG:
1173 msgptr = "An invalid flag was passed to a system function.";
1174 break;
1175 case MMSYSERR_INVALPARAM:
1176 msgptr = "An invalid parameter was passed to a system function.";
1177 break;
1178 case WAVERR_BADFORMAT:
1179 msgptr = "The specified format is not supported or cannot be translated. Use the Capabilities function to determine the supported formats";
1180 break;
1181 case WAVERR_STILLPLAYING:
1182 msgptr = "Cannot perform this operation while media data is still playing. Reset the device, or wait until the data is finished playing.";
1183 break;
1184 case WAVERR_UNPREPARED:
1185 msgptr = "The wave header was not prepared. Use the Prepare function to prepare the header, and then try again.";
1186 break;
1187 case WAVERR_SYNC:
1188 msgptr = "Cannot open the device without using the WAVE_ALLOWSYNC flag. Use the flag, and then try again.";
1189 break;
1190 default:
1191 msgptr = "Unkown MMSYSTEM Error !\n";
1192 break;
1194 maxbuf = min(uSize - 1, strlen(msgptr));
1195 if (maxbuf > 0) strncpy(lpText, msgptr, maxbuf);
1196 lpText[maxbuf + 1] = '\0';
1197 return(TRUE);
1200 /**************************************************************************
1201 * waveOutOpen [MMSYSTEM.404]
1203 UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
1204 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1206 HWAVE hWaveOut;
1207 LPWAVEOPENDESC lpDesc;
1208 DWORD dwRet;
1209 BOOL bMapperFlg = FALSE;
1210 printf("waveOutOpen(%08X, %d, %08X, %08X, %08X, %08X);\n",
1211 lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1212 if (dwFlags & WAVE_FORMAT_QUERY) {
1213 printf("waveOutOpen // WAVE_FORMAT_QUERY requested !\n");
1215 if (uDeviceID == (UINT)WAVE_MAPPER) {
1216 printf("waveOutOpen // WAVE_MAPPER mode requested !\n");
1217 bMapperFlg = TRUE;
1218 uDeviceID = 0;
1220 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1221 hWaveOut = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1222 if (lphWaveOut != NULL) *lphWaveOut = hWaveOut;
1223 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1224 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1225 lpDesc->hWave = hWaveOut;
1226 lpDesc->lpFormat = lpFormat;
1227 lpDesc->dwCallBack = dwCallback;
1228 lpDesc->dwInstance = dwInstance;
1229 while(uDeviceID < MAXWAVEDRIVERS) {
1230 dwRet = wodMessage(uDeviceID, WODM_OPEN,
1231 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1232 if (dwRet == MMSYSERR_NOERROR) break;
1233 if (!bMapperFlg) break;
1234 uDeviceID++;
1235 printf("waveOutOpen // WAVE_MAPPER mode ! try next driver...\n");
1237 if (dwFlags & WAVE_FORMAT_QUERY) {
1238 printf("waveOutOpen // End of WAVE_FORMAT_QUERY !\n");
1239 waveOutClose(hWaveOut);
1241 return dwRet;
1244 /**************************************************************************
1245 * waveOutClose [MMSYSTEM.405]
1247 UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
1249 LPWAVEOPENDESC lpDesc;
1250 printf("waveOutClose(%04X)\n", hWaveOut);
1251 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1252 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1253 return wodMessage(0, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1256 /**************************************************************************
1257 * waveOutPrepareHeader [MMSYSTEM.406]
1259 UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
1260 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1262 LPWAVEOPENDESC lpDesc;
1263 printf("waveOutPrepareHeader(%04X, %08X, %u);\n",
1264 hWaveOut, lpWaveOutHdr, uSize);
1265 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1266 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1267 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1268 (DWORD)lpWaveOutHdr, uSize);
1271 /**************************************************************************
1272 * waveOutUnprepareHeader [MMSYSTEM.407]
1274 UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
1275 WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1277 LPWAVEOPENDESC lpDesc;
1278 printf("waveOutUnprepareHeader(%04X, %08X, %u);\n",
1279 hWaveOut, lpWaveOutHdr, uSize);
1280 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1281 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1282 return wodMessage(0, WODM_PREPARE, lpDesc->dwInstance,
1283 (DWORD)lpWaveOutHdr, uSize);
1286 /**************************************************************************
1287 * waveOutWrite [MMSYSTEM.408]
1289 UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR FAR* lpWaveOutHdr, UINT uSize)
1291 LPWAVEOPENDESC lpDesc;
1292 printf("waveOutWrite(%04X, %08X, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
1293 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1294 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1295 return wodMessage(0, WODM_WRITE, lpDesc->dwInstance,
1296 (DWORD)lpWaveOutHdr, uSize);
1299 /**************************************************************************
1300 * waveOutPause [MMSYSTEM.409]
1302 UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
1304 printf("waveOutPause(%04X)\n", hWaveOut);
1305 return MMSYSERR_INVALHANDLE;
1308 /**************************************************************************
1309 * waveOutRestart [MMSYSTEM.410]
1311 UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
1313 printf("waveOutRestart(%04X)\n", hWaveOut);
1314 return MMSYSERR_INVALHANDLE;
1317 /**************************************************************************
1318 * waveOutReset [MMSYSTEM.411]
1320 UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
1322 printf("waveOutReset(%04X)\n", hWaveOut);
1323 return MMSYSERR_INVALHANDLE;
1326 /**************************************************************************
1327 * waveOutGetPosition [MMSYSTEM.412]
1329 UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, MMTIME FAR* lpTime, UINT uSize)
1331 LPWAVEOPENDESC lpDesc;
1332 printf("waveOutGetPosition(%04X, %08X, %u);\n", hWaveOut, lpTime, uSize);
1333 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveOut);
1334 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1335 return wodMessage(0, WODM_GETPOS, lpDesc->dwInstance,
1336 (DWORD)lpTime, (DWORD)uSize);
1339 /**************************************************************************
1340 * waveOutGetPitch [MMSYSTEM.413]
1342 UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, DWORD FAR* lpdwPitch)
1344 printf("waveOutGetPitch\n");
1345 return MMSYSERR_INVALHANDLE;
1348 /**************************************************************************
1349 * waveOutSetPitch [MMSYSTEM.414]
1351 UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dwPitch)
1353 printf("waveOutSetPitch\n");
1354 return MMSYSERR_INVALHANDLE;
1357 /**************************************************************************
1358 * waveOutGetVolume [MMSYSTEM.415]
1360 UINT WINAPI waveOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume)
1362 printf("waveOutGetVolume\n");
1363 return MMSYSERR_INVALHANDLE;
1366 /**************************************************************************
1367 * waveOutSetVolume [MMSYSTEM.416]
1369 UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume)
1371 printf("waveOutSetVolume\n");
1372 return MMSYSERR_INVALHANDLE;
1375 /**************************************************************************
1376 * waveOutGetPlaybackRate [MMSYSTEM.417]
1378 UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, DWORD FAR* lpdwRate)
1380 printf("waveOutGetPlaybackRate\n");
1381 return MMSYSERR_INVALHANDLE;
1384 /**************************************************************************
1385 * waveOutSetPlaybackRate [MMSYSTEM.418]
1387 UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dwRate)
1389 printf("waveOutSetPlaybackRate\n");
1390 return MMSYSERR_INVALHANDLE;
1393 /**************************************************************************
1394 * waveOutBreakLoop [MMSYSTEM.419]
1396 UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
1398 printf("waveOutBreakLoop(%04X)\n", hWaveOut);
1399 return MMSYSERR_INVALHANDLE;
1402 /**************************************************************************
1403 * waveOutGetID [MMSYSTEM.420]
1405 UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT FAR* lpuDeviceID)
1407 printf("waveOutGetID\n");
1408 return MMSYSERR_INVALHANDLE;
1411 /**************************************************************************
1412 * waveOutMessage [MMSYSTEM.421]
1414 DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
1415 DWORD dwParam1, DWORD dwParam2)
1419 /**************************************************************************
1420 * waveInGetNumDevs [MMSYSTEM.501]
1422 UINT WINAPI waveInGetNumDevs()
1424 UINT count = 0;
1425 printf("waveInGetNumDevs\n");
1426 count += widMessage(0, WIDM_GETNUMDEVS, 0L, 0L, 0L);
1427 printf("waveInGetNumDevs return %u \n", count);
1428 return count;
1432 /**************************************************************************
1433 * waveInGetDevCaps [MMSYSTEM.502]
1435 UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps, UINT uSize)
1437 printf("waveInGetDevCaps\n");
1438 return widMessage(uDeviceID, WIDM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
1442 /**************************************************************************
1443 * waveInGetErrorText [MMSYSTEM.503]
1445 UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
1447 printf("waveInGetErrorText\n");
1448 return(waveGetErrorText(uError, lpText, uSize));
1452 /**************************************************************************
1453 * waveInOpen [MMSYSTEM.504]
1455 UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
1456 const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags)
1458 HWAVE hWaveIn;
1459 LPWAVEOPENDESC lpDesc;
1460 DWORD dwRet;
1461 BOOL bMapperFlg = FALSE;
1462 printf("waveInOpen(%08X, %d, %08X, %08X, %08X, %08X);\n",
1463 lphWaveIn, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
1464 if (dwFlags & WAVE_FORMAT_QUERY) {
1465 printf("waveInOpen // WAVE_FORMAT_QUERY requested !\n");
1467 if (uDeviceID == (UINT)WAVE_MAPPER) {
1468 printf("waveInOpen // WAVE_MAPPER mode requested !\n");
1469 bMapperFlg = TRUE;
1470 uDeviceID = 0;
1472 if (lpFormat == NULL) return WAVERR_BADFORMAT;
1473 hWaveIn = GlobalAlloc(GMEM_MOVEABLE, sizeof(WAVEOPENDESC));
1474 if (lphWaveIn != NULL) *lphWaveIn = hWaveIn;
1475 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1476 if (lpDesc == NULL) return MMSYSERR_NOMEM;
1477 lpDesc->hWave = hWaveIn;
1478 lpDesc->lpFormat = lpFormat;
1479 lpDesc->dwCallBack = dwCallback;
1480 lpDesc->dwInstance = dwInstance;
1481 while(uDeviceID < MAXWAVEDRIVERS) {
1482 dwRet = widMessage(uDeviceID, WIDM_OPEN,
1483 lpDesc->dwInstance, (DWORD)lpDesc, 0L);
1484 if (dwRet == MMSYSERR_NOERROR) break;
1485 if (!bMapperFlg) break;
1486 uDeviceID++;
1487 printf("waveInOpen // WAVE_MAPPER mode ! try next driver...\n");
1489 if (dwFlags & WAVE_FORMAT_QUERY) {
1490 printf("waveInOpen // End of WAVE_FORMAT_QUERY !\n");
1491 waveInClose(hWaveIn);
1493 return dwRet;
1497 /**************************************************************************
1498 * waveInClose [MMSYSTEM.505]
1500 UINT WINAPI waveInClose(HWAVEIN hWaveIn)
1502 LPWAVEOPENDESC lpDesc;
1503 printf("waveInClose(%04X)\n", hWaveIn);
1504 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1505 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1506 return widMessage(0, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
1510 /**************************************************************************
1511 * waveInPrepareHeader [MMSYSTEM.506]
1513 UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
1514 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1516 LPWAVEOPENDESC lpDesc;
1517 printf("waveInPrepareHeader(%04X, %08X, %u);\n",
1518 hWaveIn, lpWaveInHdr, uSize);
1519 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1520 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1521 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1522 lpWaveInHdr->lpNext = NULL;
1523 lpWaveInHdr->dwBytesRecorded = 0;
1524 printf("waveInPrepareHeader // lpData=%08X size=%u \n",
1525 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1526 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1527 (DWORD)lpWaveInHdr, uSize);
1531 /**************************************************************************
1532 * waveInUnprepareHeader [MMSYSTEM.507]
1534 UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn,
1535 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1537 LPWAVEOPENDESC lpDesc;
1538 printf("waveInUnprepareHeader(%04X, %08X, %u);\n",
1539 hWaveIn, lpWaveInHdr, uSize);
1540 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1541 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1542 USER_HEAP_FREE(HIWORD((DWORD)lpWaveInHdr->lpData));
1543 lpWaveInHdr->lpData = NULL;
1544 lpWaveInHdr->lpNext = NULL;
1545 return widMessage(0, WIDM_PREPARE, lpDesc->dwInstance,
1546 (DWORD)lpWaveInHdr, uSize);
1550 /**************************************************************************
1551 * waveInAddBuffer [MMSYSTEM.508]
1553 UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
1554 WAVEHDR FAR* lpWaveInHdr, UINT uSize)
1556 LPWAVEOPENDESC lpDesc;
1557 printf("waveInAddBuffer(%04X, %08X, %u);\n", hWaveIn, lpWaveInHdr, uSize);
1558 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1559 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1560 if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
1561 lpWaveInHdr->lpNext = NULL;
1562 lpWaveInHdr->dwBytesRecorded = 0;
1563 printf("waveInAddBuffer // lpData=%08X size=%u \n",
1564 lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
1565 return widMessage(0, WIDM_ADDBUFFER, lpDesc->dwInstance,
1566 (DWORD)lpWaveInHdr, uSize);
1570 /**************************************************************************
1571 * waveInStart [MMSYSTEM.509]
1573 UINT WINAPI waveInStart(HWAVEIN hWaveIn)
1575 LPWAVEOPENDESC lpDesc;
1576 printf("waveInStart(%04X)\n", hWaveIn);
1577 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1578 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1579 return widMessage(0, WIDM_START, lpDesc->dwInstance, 0L, 0L);
1583 /**************************************************************************
1584 * waveInStop [MMSYSTEM.510]
1586 UINT WINAPI waveInStop(HWAVEIN hWaveIn)
1588 LPWAVEOPENDESC lpDesc;
1589 printf("waveInStop(%04X)\n", hWaveIn);
1590 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1591 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1592 return widMessage(0, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
1596 /**************************************************************************
1597 * waveInReset [MMSYSTEM.511]
1599 UINT WINAPI waveInReset(HWAVEIN hWaveIn)
1601 LPWAVEOPENDESC lpDesc;
1602 printf("waveInReset(%04X)\n", hWaveIn);
1603 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1604 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1605 return widMessage(0, WIDM_RESET, lpDesc->dwInstance, 0L, 0L);
1609 /**************************************************************************
1610 * waveInGetPosition [MMSYSTEM.512]
1612 UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, MMTIME FAR* lpTime, UINT uSize)
1614 LPWAVEOPENDESC lpDesc;
1615 printf("waveInGetPosition(%04X, %08X, %u);\n", hWaveIn, lpTime, uSize);
1616 lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn);
1617 if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
1618 return widMessage(0, WIDM_GETPOS, lpDesc->dwInstance,
1619 (DWORD)lpTime, (DWORD)uSize);
1623 /**************************************************************************
1624 * waveInGetID [MMSYSTEM.513]
1626 UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT FAR* lpuDeviceID)
1628 printf("waveInGetID\n");
1629 if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1630 return 0;
1634 /**************************************************************************
1635 * waveInMessage [MMSYSTEM.514]
1637 DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
1638 DWORD dwParam1, DWORD dwParam2)
1643 /**************************************************************************
1644 * MMSysTimeCallback [internal]
1646 WORD FAR PASCAL MMSysTimeCallback(HWND hWnd, WORD wMsg, int nID, DWORD dwTime)
1648 LPTIMERENTRY lpTimer = lpTimerList;
1649 mmSysTimeMS.u.ms += 33;
1650 mmSysTimeSMPTE.u.smpte.frame++;
1651 while (lpTimer != NULL) {
1652 lpTimer->wCurTime--;
1653 if (lpTimer->wCurTime == 0) {
1654 lpTimer->wCurTime = lpTimer->wDelay;
1655 if (lpTimer->lpFunc != NULL) {
1656 #ifdef WINELIB
1657 (*lpTimer->lpFunc)(lpTimer->wTimerID, (WORD)0,
1658 lpTimer->dwUser, (DWORD)0, (DWORD)0);
1659 #else
1660 CallBack16(lpTimer->lpFunc, 5,
1661 0, (int)lpTimer->wTimerID, 0, (int)0,
1662 2, lpTimer->dwUser, 2, 0, 2, 0);
1663 #endif
1665 if (lpTimer->wFlags & TIME_ONESHOT)
1666 timeKillEvent(lpTimer->wTimerID);
1668 lpTimer = lpTimer->Next;
1672 /**************************************************************************
1673 * StartMMTime [internal]
1675 void StartMMTime()
1677 if (!mmTimeStarted) {
1678 mmTimeStarted = TRUE;
1679 mmSysTimeMS.wType = TIME_MS;
1680 mmSysTimeMS.u.ms = 0;
1681 mmSysTimeSMPTE.wType = TIME_SMPTE;
1682 mmSysTimeSMPTE.u.smpte.hour = 0;
1683 mmSysTimeSMPTE.u.smpte.min = 0;
1684 mmSysTimeSMPTE.u.smpte.sec = 0;
1685 mmSysTimeSMPTE.u.smpte.frame = 0;
1686 mmSysTimeSMPTE.u.smpte.fps = 0;
1687 mmSysTimeSMPTE.u.smpte.dummy = 0;
1688 SetTimer(0, 1, 33, (FARPROC)MMSysTimeCallback);
1692 /**************************************************************************
1693 * timeGetSystemTime [MMSYSTEM.601]
1695 WORD timeGetSystemTime(LPMMTIME lpTime, WORD wSize)
1697 printf("timeGetSystemTime(%08X, %u);\n", lpTime, wSize);
1698 if (!mmTimeStarted) StartMMTime();
1699 return 0;
1702 /**************************************************************************
1703 * timeSetEvent [MMSYSTEM.602]
1705 WORD timeSetEvent(WORD wDelay, WORD wResol,
1706 LPTIMECALLBACK lpFunc,
1707 DWORD dwUser, WORD wFlags)
1709 WORD wNewID = 0;
1710 LPTIMERENTRY lpNewTimer;
1711 LPTIMERENTRY lpTimer = lpTimerList;
1712 printf("timeSetEvent(%u, %u, %08X, %08X, %04X);\n",
1713 wDelay, wResol, lpFunc, dwUser, wFlags);
1714 if (!mmTimeStarted) StartMMTime();
1715 lpNewTimer = (LPTIMERENTRY) malloc(sizeof(TIMERENTRY));
1716 if (lpNewTimer == NULL) return 0;
1717 while (lpTimer != NULL) {
1718 wNewID = max(wNewID, lpTimer->wTimerID);
1719 if (lpTimer->Next == NULL) break;
1720 lpTimer = lpTimer->Next;
1722 if (lpTimerList == NULL) {
1723 lpTimerList = lpNewTimer;
1724 lpNewTimer->Prev == NULL;
1726 else {
1727 lpTimer->Next == lpNewTimer;
1728 lpNewTimer->Prev == lpTimer;
1730 lpNewTimer->Next == NULL;
1731 lpNewTimer->wTimerID = wNewID + 1;
1732 lpNewTimer->wCurTime = wDelay;
1733 lpNewTimer->wDelay = wDelay;
1734 lpNewTimer->wResol = wResol;
1735 lpNewTimer->lpFunc = lpFunc;
1736 lpNewTimer->dwUser = dwUser;
1737 lpNewTimer->wFlags = wFlags;
1738 return lpNewTimer->wTimerID;
1741 /**************************************************************************
1742 * timeKillEvent [MMSYSTEM.603]
1744 WORD timeKillEvent(WORD wID)
1746 LPTIMERENTRY lpTimer = lpTimerList;
1747 while (lpTimer != NULL) {
1748 if (wID == lpTimer->wTimerID) {
1749 if (lpTimer->Prev != NULL) lpTimer->Prev->Next = lpTimer->Next;
1750 if (lpTimer->Next != NULL) lpTimer->Next->Prev = lpTimer->Prev;
1751 free(lpTimer);
1752 return TRUE;
1754 lpTimer = lpTimer->Next;
1756 return 0;
1759 /**************************************************************************
1760 * timeGetDevCaps [MMSYSTEM.604]
1762 WORD timeGetDevCaps(LPTIMECAPS lpCaps, WORD wSize)
1764 printf("timeGetDevCaps(%08X, %u) !\n", lpCaps, wSize);
1765 return 0;
1768 /**************************************************************************
1769 * timeBeginPeriod [MMSYSTEM.605]
1771 WORD timeBeginPeriod(WORD wPeriod)
1773 printf("timeBeginPeriod(%u) !\n", wPeriod);
1774 if (!mmTimeStarted) StartMMTime();
1775 return 0;
1778 /**************************************************************************
1779 * timeEndPeriod [MMSYSTEM.606]
1781 WORD timeEndPeriod(WORD wPeriod)
1783 printf("timeEndPeriod(%u) !\n", wPeriod);
1784 return 0;
1787 /**************************************************************************
1788 * timeGetTime [MMSYSTEM.607]
1790 DWORD timeGetTime()
1792 printf("timeGetTime(); !\n");
1793 if (!mmTimeStarted) StartMMTime();
1794 return 0;
1798 /**************************************************************************
1799 * mmioOpen [MMSYSTEM.1210]
1801 HMMIO WINAPI mmioOpen(LPSTR szFileName, MMIOINFO FAR* lpmmioinfo, DWORD dwOpenFlags)
1803 int hFile;
1804 printf("mmioOpen('%s', %08X, %08X);\n", szFileName, lpmmioinfo, dwOpenFlags);
1805 hFile = _lopen(szFileName, dwOpenFlags);
1806 return (HMMIO)hFile;
1811 /**************************************************************************
1812 * mmioClose [MMSYSTEM.1211]
1814 UINT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
1816 printf("mmioClose(%04X, %04X);\n", hmmio, uFlags);
1817 _lclose(hmmio);
1818 return 0;
1823 /**************************************************************************
1824 * mmioRead [MMSYSTEM.1212]
1826 LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
1828 printf("mmioRead\n");
1829 _lread(hmmio, pch, cch);
1830 return 0;
1835 /**************************************************************************
1836 * mmioWrite [MMSYSTEM.1213]
1838 LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
1840 printf("mmioWrite\n");
1841 return 0;
1844 /**************************************************************************
1845 * mmioSeek [MMSYSTEM.1214]
1847 LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin)
1849 printf("mmioSeek\n");
1850 return 0;
1853 /**************************************************************************
1854 * mmioGetInfo [MMSYSTEM.1215]
1856 UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
1858 printf("mmioGetInfo\n");
1859 return 0;
1862 /**************************************************************************
1863 * mmioGetInfo [MMSYSTEM.1216]
1865 UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO FAR* lpmmioinfo, UINT uFlags)
1867 printf("mmioSetInfo\n");
1868 return 0;
1871 /**************************************************************************
1872 * mmioSetBuffer [MMSYSTEM.1217]
1874 UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer,
1875 LONG cchBuffer, UINT uFlags)
1877 printf("mmioSetBuffer\n");
1878 return 0;
1881 /**************************************************************************
1882 * mmioFlush [MMSYSTEM.1218]
1884 UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags)
1886 printf("mmioFlush\n");
1887 return 0;
1890 /**************************************************************************
1891 * mmioAdvance [MMSYSTEM.1219]
1893 UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags)
1895 printf("mmioAdvance\n");
1896 return 0;
1899 /**************************************************************************
1900 * mmioStringToFOURCC [MMSYSTEM.1220]
1902 FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags)
1904 printf("mmioStringToFOURCC\n");
1905 return 0;
1908 /**************************************************************************
1909 * mmioInstallIOProc [MMSYSTEM.1221]
1911 LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc,
1912 LPMMIOPROC pIOProc, DWORD dwFlags)
1914 printf("mmioInstallIOProc\n");
1915 return 0;
1918 /**************************************************************************
1919 * mmioSendMessage [MMSYSTEM.1222]
1921 LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
1922 LPARAM lParam1, LPARAM lParam2)
1924 printf("mmioSendMessage\n");
1925 return 0;
1928 /**************************************************************************
1929 * mmioDescend [MMSYSTEM.1223]
1931 UINT WINAPI mmioDescend(HMMIO hmmio, MMCKINFO FAR* lpck,
1932 const MMCKINFO FAR* lpckParent, UINT uFlags)
1934 printf("mmioDescend\n");
1935 return 0;
1938 /**************************************************************************
1939 * mmioAscend [MMSYSTEM.1224]
1941 UINT WINAPI mmioAscend(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
1943 printf("mmioAscend\n");
1944 return 0;
1947 /**************************************************************************
1948 * mmioCreateChunk [MMSYSTEM.1225]
1950 UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags)
1952 printf("mmioCreateChunk\n");
1953 return 0;
1957 /**************************************************************************
1958 * mmioRename [MMSYSTEM.1226]
1960 UINT WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
1961 MMIOINFO FAR* lpmmioinfo, DWORD dwRenameFlags)
1963 printf("mmioRename('%s', '%s', %08X, %08X);\n",
1964 szFileName, szNewFileName, lpmmioinfo, dwRenameFlags);
1965 return 0;
1968 /**************************************************************************
1969 * DrvOpen [MMSYSTEM.1100]
1971 HDRVR DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
1973 printf("DrvOpen('%s', '%s', %08X);\n",
1974 lpDriverName, lpSectionName, lParam);
1975 return OpenDriver(lpDriverName, lpSectionName, lParam);
1979 /**************************************************************************
1980 * DrvClose [MMSYSTEM.1101]
1982 LRESULT DrvClose(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2)
1984 printf("DrvClose(%04X, %08X, %08X);\n", hDrvr, lParam1, lParam2);
1985 return CloseDriver(hDrvr, lParam1, lParam2);
1989 /**************************************************************************
1990 * DrvSendMessage [MMSYSTEM.1102]
1992 LRESULT WINAPI DrvSendMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2)
1994 DWORD dwDevID = 0;
1995 printf("DrvSendMessage(%04X, %04X, %08X, %08X);\n",
1996 hDriver, msg, lParam1, lParam2);
1997 #ifndef WINELIB
1998 return CDAUDIO_DriverProc(dwDevID, hDriver, msg, lParam1, lParam2);
1999 #endif
2002 /**************************************************************************
2003 * DrvGetModuleHandle [MMSYSTEM.1103]
2005 HANDLE DrvGetModuleHandle(HDRVR hDrvr)
2007 printf("DrvGetModuleHandle(%04X);\n", hDrvr);
2011 /**************************************************************************
2012 * DrvDefDriverProc [MMSYSTEM.1104]
2014 LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
2015 DWORD dwParam1, DWORD dwParam2)
2017 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
2022 #endif