winmm: Don't mask out SND_ALIAS_ID or SND_FILENAME in sndPlaySound.
This commit is contained in:
parent
2ddb3b7d93
commit
b1d9d43af7
|
@ -560,7 +560,7 @@ BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI sndPlaySoundA(LPCSTR pszSoundA, UINT uFlags)
|
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);
|
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)
|
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);
|
return MULTIMEDIA_PlaySound(pszSound, 0, uFlags, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1443,8 +1443,41 @@ static void wave_out_tests(void)
|
||||||
wave_out_test_device(WAVE_MAPPER);
|
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)
|
START_TEST(wave)
|
||||||
{
|
{
|
||||||
test_multiple_waveopens();
|
test_multiple_waveopens();
|
||||||
wave_out_tests();
|
wave_out_tests();
|
||||||
|
test_sndPlaySound();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue