Alexandre Julliard : winedos: Link to DirectSoundCreate through delayed imports instead of doing it by hand .

Alexandre Julliard julliard at winehq.org
Tue Jan 5 11:37:50 CST 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan  4 17:58:25 2010 +0100

winedos: Link to DirectSoundCreate through delayed imports instead of doing it by hand.

---

 dlls/winedos/Makefile.in    |    2 +-
 dlls/winedos/soundblaster.c |   16 +---------------
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/dlls/winedos/Makefile.in b/dlls/winedos/Makefile.in
index 632815c..3c16053 100644
--- a/dlls/winedos/Makefile.in
+++ b/dlls/winedos/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winedos.dll
 IMPORTS   = user32 kernel32 kernel ntdll
-DELAYIMPORTS = ddraw
+DELAYIMPORTS = ddraw dsound
 
 C_SRCS = \
 	devices.c \
diff --git a/dlls/winedos/soundblaster.c b/dlls/winedos/soundblaster.c
index e48095f..52eb7ba 100644
--- a/dlls/winedos/soundblaster.c
+++ b/dlls/winedos/soundblaster.c
@@ -61,9 +61,6 @@ static BYTE dma_buffer[DMATRFSIZE*2];
 #define DSBUFLEN 4096 /* FIXME: Only this value seems to work */
 
 /* Direct Sound playback stuff */
-static HMODULE hmodule;
-typedef HRESULT (WINAPI* fnDirectSoundCreate) (LPGUID,LPDIRECTSOUND*,LPUNKNOWN);
-static fnDirectSoundCreate lpDirectSoundCreate;
 static LPDIRECTSOUND lpdsound;
 static LPDIRECTSOUNDBUFFER lpdsbuf;
 static DSBUFFERDESC buf_desc;
@@ -126,18 +123,7 @@ static BOOL SB_Init(void)
     HRESULT result;
 
     if (!lpdsound) {
-        hmodule = LoadLibraryA("dsound.dll");
-        if (!hmodule) {
-            ERR("Can't load dsound.dll !\n");
-            return 0;
-        }
-        lpDirectSoundCreate = (fnDirectSoundCreate)GetProcAddress(hmodule,"DirectSoundCreate");
-        if (!lpDirectSoundCreate) {
-            /* CloseHandle(hmodule); */
-            ERR("Can't find DirectSoundCreate function !\n");
-            return 0;
-        }
-        result = (*lpDirectSoundCreate)(NULL,&lpdsound,NULL);
+        result = DirectSoundCreate(NULL,&lpdsound,NULL);
         if (result != DS_OK) {
             ERR("Unable to initialize Sound Subsystem err = %x !\n",result);
             return 0;




More information about the wine-cvs mailing list