]> Repos - portaudio/commitdiff
fixes to DirectSound implementation to work in unicode builds
authorrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 24 Jan 2010 09:21:50 +0000 (09:21 +0000)
committerrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 24 Jan 2010 09:21:50 +0000 (09:21 +0000)
src/hostapi/dsound/pa_win_ds.c
src/hostapi/dsound/pa_win_ds_dynlink.c

index cfd5688a9eba0acf2c65c122f86b2a9f0e9b4ae6..322a614e9f2460e1ef03207d84ffe17ac43fc26a 100644 (file)
@@ -1088,9 +1088,9 @@ PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInde
     if( result != paNoError )
         goto error;
 
-    paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&deviceNamesAndGUIDs.inputNamesAndGUIDs );
+    paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&deviceNamesAndGUIDs.inputNamesAndGUIDs );
 
-    paWinDsDSoundEntryPoints.DirectSoundEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&deviceNamesAndGUIDs.outputNamesAndGUIDs );
+    paWinDsDSoundEntryPoints.DirectSoundEnumerateA( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&deviceNamesAndGUIDs.outputNamesAndGUIDs );
 
     if( deviceNamesAndGUIDs.inputNamesAndGUIDs.enumerationError != paNoError )
     {
index ceba18896f9a234106c17a6b3a58b8d84c9ccb02..a7d8298a645f219e4f7dcc5136e2ea4073bdf73d 100644 (file)
@@ -45,6 +45,7 @@
 */
 
 #include "pa_win_ds_dynlink.h"
+#include "pa_debugprint.h"
 
 PaWinDsDSoundEntryPoints paWinDsDSoundEntryPoints = { 0, 0, 0, 0, 0, 0, 0 };
 
@@ -104,7 +105,7 @@ static HRESULT WINAPI DummyDirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA lpDSCE
 
 void PaWinDs_InitializeDSoundEntryPoints(void)
 {
-    paWinDsDSoundEntryPoints.hInstance_ = LoadLibrary("dsound.dll");
+    paWinDsDSoundEntryPoints.hInstance_ = LoadLibraryA("dsound.dll");
     if( paWinDsDSoundEntryPoints.hInstance_ != NULL )
     {
         paWinDsDSoundEntryPoints.DllGetClassObject =
@@ -151,6 +152,9 @@ void PaWinDs_InitializeDSoundEntryPoints(void)
     }
     else
     {
+        DWORD errorCode = GetLastError(); // 126 (0x7E) == ERROR_MOD_NOT_FOUND
+        PA_DEBUG(("Couldn't load dsound.dll error code: %d \n",errorCode));
+
         /* initialize with dummy entry points to make live easy when ds isn't present */
         paWinDsDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate;
         paWinDsDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW;