diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c index 0d32274e9a9..64db333758e 100644 --- a/dlls/winmm/playsound.c +++ b/dlls/winmm/playsound.c @@ -560,7 +560,7 @@ BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound) */ BOOL WINAPI sndPlaySoundA(LPCSTR pszSoundA, UINT uFlags) { - uFlags &= SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC; + uFlags &= SND_ALIAS_ID|SND_FILENAME|SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC; return MULTIMEDIA_PlaySound(pszSoundA, 0, uFlags, FALSE); } @@ -569,7 +569,7 @@ BOOL WINAPI sndPlaySoundA(LPCSTR pszSoundA, UINT uFlags) */ BOOL WINAPI sndPlaySoundW(LPCWSTR pszSound, UINT uFlags) { - uFlags &= SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC; + uFlags &= SND_ALIAS_ID|SND_FILENAME|SND_ASYNC|SND_LOOP|SND_MEMORY|SND_NODEFAULT|SND_NOSTOP|SND_SYNC; return MULTIMEDIA_PlaySound(pszSound, 0, uFlags, TRUE); } diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c index 28b4145c800..97849f5c53d 100644 --- a/dlls/winmm/tests/wave.c +++ b/dlls/winmm/tests/wave.c @@ -1443,8 +1443,41 @@ static void wave_out_tests(void) wave_out_test_device(WAVE_MAPPER); } +static void test_sndPlaySound(void) +{ + BOOL br; + + static const WCHAR not_existW[] = {'C',':','\\','n','o','t','_','e','x','i','s','t','.','w','a','v',0}; + static const WCHAR SystemAsteriskW[] = {'S','y','s','t','e','m','A','s','t','e','r','i','s','k',0}; + + br = sndPlaySoundA((LPCSTR)SND_ALIAS_SYSTEMASTERISK, SND_ALIAS_ID|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundW((LPCWSTR)SND_ALIAS_SYSTEMASTERISK, SND_ALIAS_ID|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundA((LPCSTR)sndAlias('X','Y'), SND_ALIAS_ID|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundW((LPCWSTR)sndAlias('X','Y'), SND_ALIAS_ID|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundA("SystemAsterisk", SND_ALIAS|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundW(SystemAsteriskW, SND_ALIAS|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundA("C:\not_exist.wav", SND_FILENAME|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); + + br = sndPlaySoundW(not_existW, SND_FILENAME|SND_SYNC); + ok(br == TRUE || br == FALSE, "sndPlaySound gave strange return: %u\n", br); +} + START_TEST(wave) { test_multiple_waveopens(); wave_out_tests(); + test_sndPlaySound(); }