From: rossb Date: Sun, 24 Jan 2010 09:21:50 +0000 (+0000) Subject: fixes to DirectSound implementation to work in unicode builds X-Git-Tag: pa_stable_v19_20110326_r1647~188 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=ecd151713f258acf13e44f1052403bf7448ad55b;p=portaudio fixes to DirectSound implementation to work in unicode builds --- diff --git a/src/hostapi/dsound/pa_win_ds.c b/src/hostapi/dsound/pa_win_ds.c index cfd5688..322a614 100644 --- a/src/hostapi/dsound/pa_win_ds.c +++ b/src/hostapi/dsound/pa_win_ds.c @@ -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 ) { diff --git a/src/hostapi/dsound/pa_win_ds_dynlink.c b/src/hostapi/dsound/pa_win_ds_dynlink.c index ceba188..a7d8298 100644 --- a/src/hostapi/dsound/pa_win_ds_dynlink.c +++ b/src/hostapi/dsound/pa_win_ds_dynlink.c @@ -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;