winex11: Leave fullscreen state alone when minimizing.
[wine/multimedia.git] / dlls / winmm / playsound.c
blobf8bd91f9678c279c880dff5af14d2fd9eb36f403
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*
4 * MMSYSTEM functions
6 * Copyright 1993 Martin Ayotte
7 * 1998-2002 Eric Pouech
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include <stdarg.h>
25 #include <string.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "mmsystem.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "winreg.h"
33 #include "winemm.h"
34 #include "winternl.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(winmm);
40 typedef struct tagWINE_PLAYSOUND
42 unsigned bLoop : 1,
43 bAlloc : 1;
44 LPCWSTR pszSound;
45 HMODULE hMod;
46 DWORD fdwSound;
47 HWAVEOUT hWave;
48 } WINE_PLAYSOUND;
50 static WINE_PLAYSOUND *PlaySoundCurrent;
51 static BOOL bPlaySoundStop;
53 static HMMIO get_mmioFromFile(LPCWSTR lpszName)
55 HMMIO ret;
56 WCHAR buf[256];
57 LPWSTR dummy;
59 ret = mmioOpenW((LPWSTR)lpszName, NULL,
60 MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
61 if (ret != 0) return ret;
62 if (SearchPathW(NULL, lpszName, NULL, sizeof(buf)/sizeof(buf[0]), buf, &dummy))
64 return mmioOpenW(buf, NULL,
65 MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
67 return 0;
70 static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
72 WCHAR str[128];
73 LPWSTR ptr;
74 HMMIO hmmio;
75 HKEY hRegSnd, hRegApp, hScheme, hSnd;
76 DWORD err, type, count;
78 static const WCHAR wszSounds[] = {'S','o','u','n','d','s',0};
79 static const WCHAR wszDefault[] = {'D','e','f','a','u','l','t',0};
80 static const WCHAR wszKey[] = {'A','p','p','E','v','e','n','t','s','\\',
81 'S','c','h','e','m','e','s','\\',
82 'A','p','p','s',0};
83 static const WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0};
84 static const WCHAR wszDotCurrent[] = {'.','C','u','r','r','e','n','t',0};
85 static const WCHAR wszNull[] = {0};
87 TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName));
88 GetProfileStringW(wszSounds, lpszName, wszNull, str, sizeof(str)/sizeof(str[0]));
89 if (lstrlenW(str) == 0)
91 if (uFlags & SND_NODEFAULT) goto next;
92 GetProfileStringW(wszSounds, wszDefault, wszNull, str, sizeof(str)/sizeof(str[0]));
93 if (lstrlenW(str) == 0) goto next;
95 for (ptr = str; *ptr && *ptr != ','; ptr++);
96 if (*ptr) *ptr = 0;
97 hmmio = mmioOpenW(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
98 if (hmmio != 0) return hmmio;
99 next:
100 /* we look up the registry under
101 * HKCU\AppEvents\Schemes\Apps\.Default
102 * HKCU\AppEvents\Schemes\Apps\<AppName>
104 if (RegOpenKeyW(HKEY_CURRENT_USER, wszKey, &hRegSnd) != 0) goto none;
105 if (uFlags & SND_APPLICATION)
107 DWORD len;
109 err = 1; /* error */
110 len = GetModuleFileNameW(0, str, sizeof(str)/sizeof(str[0]));
111 if (len > 0 && len < sizeof(str)/sizeof(str[0]))
113 for (ptr = str + lstrlenW(str) - 1; ptr >= str; ptr--)
115 if (*ptr == '.') *ptr = 0;
116 if (*ptr == '\\')
118 err = RegOpenKeyW(hRegSnd, ptr+1, &hRegApp);
119 break;
124 else
126 err = RegOpenKeyW(hRegSnd, wszDotDefault, &hRegApp);
128 RegCloseKey(hRegSnd);
129 if (err != 0) goto none;
130 err = RegOpenKeyW(hRegApp, lpszName, &hScheme);
131 RegCloseKey(hRegApp);
132 if (err != 0) goto none;
133 /* what's the difference between .Current and .Default ? */
134 err = RegOpenKeyW(hScheme, wszDotDefault, &hSnd);
135 if (err != 0)
137 err = RegOpenKeyW(hScheme, wszDotCurrent, &hSnd);
138 RegCloseKey(hScheme);
139 if (err != 0)
140 goto none;
142 count = sizeof(str)/sizeof(str[0]);
143 err = RegQueryValueExW(hSnd, NULL, 0, &type, (LPBYTE)str, &count);
144 RegCloseKey(hSnd);
145 if (err != 0 || !*str) goto none;
146 hmmio = mmioOpenW(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
147 if (hmmio) return hmmio;
148 none:
149 WARN("can't find SystemSound=%s !\n", debugstr_w(lpszName));
150 return 0;
153 struct playsound_data
155 HANDLE hEvent;
156 LONG dwEventCount;
159 static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg,
160 DWORD_PTR dwInstance,
161 DWORD_PTR dwParam1, DWORD_PTR dwParam2)
163 struct playsound_data* s = (struct playsound_data*)dwInstance;
165 switch (uMsg) {
166 case WOM_OPEN:
167 case WOM_CLOSE:
168 break;
169 case WOM_DONE:
170 InterlockedIncrement(&s->dwEventCount);
171 TRACE("Returning waveHdr=%lx\n", dwParam1);
172 SetEvent(s->hEvent);
173 break;
174 default:
175 ERR("Unknown uMsg=%d\n", uMsg);
179 static void PlaySound_WaitDone(struct playsound_data* s)
181 for (;;) {
182 if (InterlockedDecrement(&s->dwEventCount) >= 0) break;
183 InterlockedIncrement(&s->dwEventCount);
185 WaitForSingleObject(s->hEvent, INFINITE);
189 static BOOL PlaySound_IsString(DWORD fdwSound, const void* psz)
191 /* SND_RESOURCE is 0x40004 while
192 * SND_MEMORY is 0x00004
194 switch (fdwSound & (SND_RESOURCE|SND_ALIAS_ID|SND_FILENAME))
196 case SND_RESOURCE: return HIWORD(psz) != 0; /* by name or by ID ? */
197 case SND_ALIAS_ID:
198 case SND_MEMORY: return FALSE;
199 case SND_ALIAS:
200 case SND_FILENAME:
201 case SND_ALIAS|SND_FILENAME:
202 case 0: return TRUE;
203 default: FIXME("WTF\n"); return FALSE;
207 static void PlaySound_Free(WINE_PLAYSOUND* wps)
209 EnterCriticalSection(&WINMM_cs);
210 PlaySoundCurrent = NULL;
211 SetEvent(psLastEvent);
212 LeaveCriticalSection(&WINMM_cs);
213 if (wps->bAlloc) HeapFree(GetProcessHeap(), 0, (void*)wps->pszSound);
214 HeapFree(GetProcessHeap(), 0, wps);
217 static WINE_PLAYSOUND* PlaySound_Alloc(const void* pszSound, HMODULE hmod,
218 DWORD fdwSound, BOOL bUnicode)
220 WINE_PLAYSOUND* wps;
222 wps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wps));
223 if (!wps) return NULL;
225 wps->hMod = hmod;
226 wps->fdwSound = fdwSound;
227 if (PlaySound_IsString(fdwSound, pszSound))
229 if (bUnicode)
231 if (fdwSound & SND_ASYNC)
233 LPWSTR sound = HeapAlloc(GetProcessHeap(), 0,
234 (lstrlenW(pszSound)+1) * sizeof(WCHAR));
235 if (!sound) goto oom_error;
236 wps->pszSound = lstrcpyW(sound, pszSound);
237 wps->bAlloc = TRUE;
239 else
240 wps->pszSound = pszSound;
242 else
244 UNICODE_STRING usBuffer;
245 RtlCreateUnicodeStringFromAsciiz(&usBuffer, pszSound);
246 wps->pszSound = usBuffer.Buffer;
247 if (!wps->pszSound) goto oom_error;
248 wps->bAlloc = TRUE;
251 else
252 wps->pszSound = pszSound;
254 return wps;
255 oom_error:
256 if (wps->bAlloc) HeapFree(GetProcessHeap(), 0, (void*)wps->pszSound);
257 HeapFree(GetProcessHeap(), 0, wps);
258 return NULL;
261 static DWORD WINAPI proc_PlaySound(LPVOID arg)
263 WINE_PLAYSOUND* wps = arg;
264 BOOL bRet = FALSE;
265 HMMIO hmmio = 0;
266 MMCKINFO ckMainRIFF;
267 MMCKINFO mmckInfo;
268 LPWAVEFORMATEX lpWaveFormat = NULL;
269 HWAVEOUT hWave = 0;
270 LPWAVEHDR waveHdr = NULL;
271 INT count, bufsize, left, index;
272 struct playsound_data s;
273 void* data;
275 s.hEvent = 0;
277 TRACE("SoundName=%s !\n", debugstr_w(wps->pszSound));
279 /* if resource, grab it */
280 if ((wps->fdwSound & SND_RESOURCE) == SND_RESOURCE) {
281 static const WCHAR wszWave[] = {'W','A','V','E',0};
282 HRSRC hRes;
283 HGLOBAL hGlob;
285 if ((hRes = FindResourceW(wps->hMod, wps->pszSound, wszWave)) == 0 ||
286 (hGlob = LoadResource(wps->hMod, hRes)) == 0)
287 goto errCleanUp;
288 if ((data = LockResource(hGlob)) == NULL) {
289 FreeResource(hGlob);
290 goto errCleanUp;
292 FreeResource(hGlob);
293 } else
294 data = (void*)wps->pszSound;
296 /* construct an MMIO stream (either in memory, or from a file */
297 if (wps->fdwSound & SND_MEMORY)
298 { /* NOTE: SND_RESOURCE has the SND_MEMORY bit set */
299 MMIOINFO mminfo;
301 memset(&mminfo, 0, sizeof(mminfo));
302 mminfo.fccIOProc = FOURCC_MEM;
303 mminfo.pchBuffer = data;
304 mminfo.cchBuffer = -1; /* FIXME: when a resource, could grab real size */
305 TRACE("Memory sound %p\n", data);
306 hmmio = mmioOpenW(NULL, &mminfo, MMIO_READ);
308 if (!hmmio && wps->fdwSound & SND_ALIAS)
310 if ((wps->fdwSound & SND_ALIAS_ID) == SND_ALIAS_ID)
312 static const WCHAR wszSystemAsterisk[] = {'S','y','s','t','e','m','A','s','t','e','r','i','s','k',0};
313 static const WCHAR wszSystemDefault[] = {'S','y','s','t','e','m','D','e','f','a','u','l','t',0};
314 static const WCHAR wszSystemExclamation[] = {'S','y','s','t','e','m','E','x','c','l','a','m','a','t','i','o','n',0};
315 static const WCHAR wszSystemExit[] = {'S','y','s','t','e','m','E','x','i','t',0};
316 static const WCHAR wszSystemHand[] = {'S','y','s','t','e','m','H','a','n','d',0};
317 static const WCHAR wszSystemQuestion[] = {'S','y','s','t','e','m','Q','u','e','s','t','i','o','n',0};
318 static const WCHAR wszSystemStart[] = {'S','y','s','t','e','m','S','t','a','r','t',0};
319 static const WCHAR wszSystemWelcome[] = {'S','y','s','t','e','m','W','e','l','c','o','m','e',0};
321 wps->fdwSound &= ~(SND_ALIAS_ID ^ SND_ALIAS);
322 if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMASTERISK)
323 wps->pszSound = wszSystemAsterisk;
324 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMDEFAULT)
325 wps->pszSound = wszSystemDefault;
326 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMEXCLAMATION)
327 wps->pszSound = wszSystemExclamation;
328 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMEXIT)
329 wps->pszSound = wszSystemExit;
330 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMHAND)
331 wps->pszSound = wszSystemHand;
332 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMQUESTION)
333 wps->pszSound = wszSystemQuestion;
334 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMSTART)
335 wps->pszSound = wszSystemStart;
336 else if (wps->pszSound == (LPCWSTR)SND_ALIAS_SYSTEMWELCOME)
337 wps->pszSound = wszSystemWelcome;
338 else goto errCleanUp;
340 hmmio = get_mmioFromProfile(wps->fdwSound, wps->pszSound);
341 if (!hmmio)
343 wps->fdwSound &= ~SND_ALIAS;
344 wps->fdwSound |= SND_FILENAME;
347 if (!hmmio && wps->fdwSound & SND_FILENAME)
349 hmmio = get_mmioFromFile(wps->pszSound);
351 if (!(wps->fdwSound & (SND_FILENAME|SND_ALIAS|SND_MEMORY)))
353 if ((hmmio = get_mmioFromProfile(wps->fdwSound | SND_NODEFAULT, wps->pszSound)) == 0)
355 if ((hmmio = get_mmioFromFile(wps->pszSound)) == 0)
357 hmmio = get_mmioFromProfile(wps->fdwSound, wps->pszSound);
361 if (hmmio == 0) goto errCleanUp;
363 if (mmioDescend(hmmio, &ckMainRIFF, NULL, 0))
364 goto errCleanUp;
366 TRACE("ParentChunk ckid=%.4s fccType=%.4s cksize=%08X\n",
367 (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize);
369 if ((ckMainRIFF.ckid != FOURCC_RIFF) ||
370 (ckMainRIFF.fccType != mmioFOURCC('W', 'A', 'V', 'E')))
371 goto errCleanUp;
373 mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
374 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK))
375 goto errCleanUp;
377 TRACE("Chunk Found ckid=%.4s fccType=%08x cksize=%08X\n",
378 (LPSTR)&mmckInfo.ckid, mmckInfo.fccType, mmckInfo.cksize);
380 lpWaveFormat = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize);
381 if (!lpWaveFormat)
382 goto errCleanUp;
383 if (mmioRead(hmmio, (HPSTR)lpWaveFormat, mmckInfo.cksize) < sizeof(PCMWAVEFORMAT))
384 goto errCleanUp;
386 TRACE("wFormatTag=%04X !\n", lpWaveFormat->wFormatTag);
387 TRACE("nChannels=%d\n", lpWaveFormat->nChannels);
388 TRACE("nSamplesPerSec=%d\n", lpWaveFormat->nSamplesPerSec);
389 TRACE("nAvgBytesPerSec=%d\n", lpWaveFormat->nAvgBytesPerSec);
390 TRACE("nBlockAlign=%d\n", lpWaveFormat->nBlockAlign);
391 TRACE("wBitsPerSample=%u !\n", lpWaveFormat->wBitsPerSample);
393 /* move to end of 'fmt ' chunk */
394 mmioAscend(hmmio, &mmckInfo, 0);
396 mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
397 if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK))
398 goto errCleanUp;
400 TRACE("Chunk Found ckid=%.4s fccType=%08x cksize=%08X\n",
401 (LPSTR)&mmckInfo.ckid, mmckInfo.fccType, mmckInfo.cksize);
403 s.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
404 if (!s.hEvent || bPlaySoundStop)
405 goto errCleanUp;
407 if (waveOutOpen(&hWave, WAVE_MAPPER, lpWaveFormat, (DWORD_PTR)PlaySound_Callback,
408 (DWORD_PTR)&s, CALLBACK_FUNCTION) != MMSYSERR_NOERROR)
409 goto errCleanUp;
411 /* make it so that 3 buffers per second are needed */
412 bufsize = (((lpWaveFormat->nAvgBytesPerSec / 3) - 1) / lpWaveFormat->nBlockAlign + 1) *
413 lpWaveFormat->nBlockAlign;
414 waveHdr = HeapAlloc(GetProcessHeap(), 0, 2 * sizeof(WAVEHDR) + 2 * bufsize);
415 if (!waveHdr)
416 goto errCleanUp;
417 waveHdr[0].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR);
418 waveHdr[1].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR) + bufsize;
419 waveHdr[0].dwUser = waveHdr[1].dwUser = 0L;
420 waveHdr[0].dwLoops = waveHdr[1].dwLoops = 0L;
421 waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L;
422 waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize;
423 if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) ||
424 waveOutPrepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR))) {
425 goto errCleanUp;
428 wps->hWave = hWave;
429 s.dwEventCount = 1L; /* for first buffer */
430 index = 0;
432 do {
433 left = mmckInfo.cksize;
435 mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET);
436 while (left)
438 if (bPlaySoundStop)
440 wps->bLoop = FALSE;
441 break;
443 count = mmioRead(hmmio, waveHdr[index].lpData, min(bufsize, left));
444 if (count < 1) break;
445 left -= count;
446 waveHdr[index].dwBufferLength = count;
447 if (waveOutWrite(hWave, &waveHdr[index], sizeof(WAVEHDR)) == MMSYSERR_NOERROR) {
448 index ^= 1;
449 PlaySound_WaitDone(&s);
451 else {
452 ERR("Aborting play loop, waveOutWrite error\n");
453 wps->bLoop = FALSE;
454 break;
457 bRet = TRUE;
458 } while (wps->bLoop);
460 PlaySound_WaitDone(&s); /* to balance first buffer */
461 waveOutReset(hWave);
463 waveOutUnprepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR));
464 waveOutUnprepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR));
466 errCleanUp:
467 TRACE("Done playing=%s => %s!\n", debugstr_w(wps->pszSound), bRet ? "ok" : "ko");
468 HeapFree(GetProcessHeap(), 0, lpWaveFormat);
469 if (hWave)
471 EnterCriticalSection(&WINMM_cs);
472 /* the CS prevents a concurrent waveOutReset */
473 wps->hWave = 0;
474 LeaveCriticalSection(&WINMM_cs);
475 while (waveOutClose(hWave) == WAVERR_STILLPLAYING)
476 Sleep(100);
478 CloseHandle(s.hEvent);
479 HeapFree(GetProcessHeap(), 0, waveHdr);
480 if (hmmio) mmioClose(hmmio, 0);
482 PlaySound_Free(wps);
484 return bRet;
487 static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode)
489 WINE_PLAYSOUND* wps = NULL;
491 TRACE("pszSound='%p' hmod=%p fdwSound=%08X\n",
492 pszSound, hmod, fdwSound);
494 /* SND_NOWAIT is ignored in w95/2k/xp. */
495 if ((fdwSound & SND_NOSTOP) && PlaySoundCurrent != NULL)
496 return FALSE;
498 /* alloc internal structure, if we need to play something */
499 if (pszSound && !(fdwSound & SND_PURGE))
501 if (!(wps = PlaySound_Alloc(pszSound, hmod, fdwSound, bUnicode)))
502 return FALSE;
505 EnterCriticalSection(&WINMM_cs);
506 /* since several threads can enter PlaySound in parallel, we're not
507 * sure, at this point, that another thread didn't start a new playsound
509 while (PlaySoundCurrent != NULL)
511 ResetEvent(psLastEvent);
512 /* FIXME: doc says we have to stop all instances of pszSound if it's non
513 * NULL... as of today, we stop all playing instances */
514 bPlaySoundStop = TRUE;
515 if(PlaySoundCurrent->hWave)
516 waveOutReset(PlaySoundCurrent->hWave);
518 LeaveCriticalSection(&WINMM_cs);
519 WaitForSingleObject(psLastEvent, INFINITE);
520 EnterCriticalSection(&WINMM_cs);
522 bPlaySoundStop = FALSE;
525 PlaySoundCurrent = wps;
526 LeaveCriticalSection(&WINMM_cs);
528 if (!wps) return TRUE;
530 if (fdwSound & SND_ASYNC)
532 HANDLE handle;
533 wps->bLoop = (fdwSound & SND_LOOP) != 0;
534 if ((handle = CreateThread(NULL, 0, proc_PlaySound, wps, 0, NULL)) != 0) {
535 SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL);
536 CloseHandle(handle);
537 return TRUE;
540 else return proc_PlaySound(wps);
542 /* error cases */
543 PlaySound_Free(wps);
544 return FALSE;
547 /**************************************************************************
548 * PlaySoundA [WINMM.@]
550 BOOL WINAPI PlaySoundA(LPCSTR pszSoundA, HMODULE hmod, DWORD fdwSound)
552 return MULTIMEDIA_PlaySound(pszSoundA, hmod, fdwSound, FALSE);
555 /**************************************************************************
556 * PlaySoundW [WINMM.@]
558 BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
560 return MULTIMEDIA_PlaySound(pszSoundW, hmod, fdwSound, TRUE);
563 /**************************************************************************
564 * sndPlaySoundA [WINMM.@]
566 BOOL WINAPI sndPlaySoundA(LPCSTR pszSoundA, UINT uFlags)
568 uFlags &= SND_ALIAS_ID|SND_FILENAME|SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC;
569 return MULTIMEDIA_PlaySound(pszSoundA, 0, uFlags, FALSE);
572 /**************************************************************************
573 * sndPlaySoundW [WINMM.@]
575 BOOL WINAPI sndPlaySoundW(LPCWSTR pszSound, UINT uFlags)
577 uFlags &= SND_ALIAS_ID|SND_FILENAME|SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC;
578 return MULTIMEDIA_PlaySound(pszSound, 0, uFlags, TRUE);
581 /**************************************************************************
582 * mmsystemGetVersion [WINMM.@]
584 UINT WINAPI mmsystemGetVersion(void)
586 TRACE("3.10 (Win95?)\n");
587 return 0x030a;