winecfg: Don't reload winmm for each audio test.

This commit is contained in:
Andrew Eikum 2011-10-28 09:24:28 -05:00 committed by Alexandre Julliard
parent cb1dd010ef
commit 00629cb0b3
2 changed files with 2 additions and 22 deletions

View File

@ -1,6 +1,6 @@
MODULE = winecfg.exe
APPMODE = -mwindows
IMPORTS = uuid comdlg32 comctl32 shell32 ole32 shlwapi uxtheme user32 gdi32 advapi32
IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32
C_SRCS = \
about.c \

View File

@ -305,25 +305,7 @@ static void set_reg_device(HWND hDlg, int dlgitem, const WCHAR *key_name)
static void test_sound(void)
{
BOOL (WINAPI *pPlaySoundW)(const WCHAR *, HMODULE, DWORD);
HMODULE winmm;
static const WCHAR winmmW[] = {'w','i','n','m','m','.','d','l','l',0};
winmm = LoadLibraryW(winmmW);
if(!winmm){
WINE_ERR("LoadLibrary failed: %u\n", GetLastError());
return;
}
pPlaySoundW = (void*)GetProcAddress(winmm, "PlaySoundW");
if(!pPlaySoundW){
WINE_ERR("GetProcAddress failed: %u\n", GetLastError());
FreeLibrary(winmm);
return;
}
if(!pPlaySoundW(MAKEINTRESOURCEW(IDW_TESTSOUND), NULL, SND_RESOURCE | SND_SYNC)){
if(!PlaySoundW(MAKEINTRESOURCEW(IDW_TESTSOUND), NULL, SND_RESOURCE | SND_SYNC)){
WCHAR error_str[256], title_str[256];
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_TEST_FAILED,
@ -333,8 +315,6 @@ static void test_sound(void)
MessageBoxW(NULL, error_str, title_str, MB_OK | MB_ICONERROR);
}
FreeLibrary(winmm);
}
INT_PTR CALLBACK