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

Alexandre Julliard julliard at winehq.org
Fri Oct 28 12:48:38 CDT 2011


Module: wine
Branch: master
Commit: 00629cb0b3c7c3b25d8ccbfc56755344dc9a1e89
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=00629cb0b3c7c3b25d8ccbfc56755344dc9a1e89

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Fri Oct 28 09:24:28 2011 -0500

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

---

 programs/winecfg/Makefile.in |    2 +-
 programs/winecfg/audio.c     |   22 +---------------------
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in
index 382eb94..4b1a001 100644
--- a/programs/winecfg/Makefile.in
+++ b/programs/winecfg/Makefile.in
@@ -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 \
diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c
index dc3e2bc..f2d4fe3 100644
--- a/programs/winecfg/audio.c
+++ b/programs/winecfg/audio.c
@@ -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




More information about the wine-cvs mailing list