Commit 3f27d916 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

dsound/tests: Link directly to dsound.

parent 866f6725
TESTDLL = dsound.dll TESTDLL = dsound.dll
IMPORTS = ole32 version user32 IMPORTS = dsound ole32 version user32
C_SRCS = \ C_SRCS = \
capture.c \ capture.c \
......
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
#define NOTIFICATIONS 5 #define NOTIFICATIONS 5
static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
static HRESULT (WINAPI *pDirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static const char * get_format_str(WORD format) static const char * get_format_str(WORD format)
{ {
static char msg[32]; static char msg[32];
...@@ -232,28 +229,28 @@ static void test_capture(void) ...@@ -232,28 +229,28 @@ static void test_capture(void)
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
/* try with no device specified */ /* try with no device specified */
rc=pDirectSoundCaptureCreate(NULL,&dsco,NULL); rc = DirectSoundCaptureCreate(NULL, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(NULL) failed: %08x\n",rc); "DirectSoundCaptureCreate(NULL) failed: %08x\n",rc);
if (rc==S_OK && dsco) if (rc==S_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL); IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default capture device specified */ /* try with default capture device specified */
rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultCapture,&dsco,NULL); rc = DirectSoundCaptureCreate(&DSDEVID_DefaultCapture, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08x\n", rc); "DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08x\n", rc);
if (rc==DS_OK && dsco) if (rc==DS_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL); IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default voice capture device specified */ /* try with default voice capture device specified */
rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultVoiceCapture,&dsco,NULL); rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoiceCapture, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08x\n", rc); "DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08x\n", rc);
if (rc==DS_OK && dsco) if (rc==DS_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL); IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with a bad device specified */ /* try with a bad device specified */
rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultVoicePlayback,&dsco,NULL); rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoicePlayback, &dsco, NULL);
ok(rc==DSERR_NODRIVER, ok(rc==DSERR_NODRIVER,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoicePlatback) " "DirectSoundCaptureCreate(DSDEVID_DefaultVoicePlatback) "
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
...@@ -442,11 +439,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -442,11 +439,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
/* Private dsound.dll: Error: Invalid interface buffer */ /* Private dsound.dll: Error: Invalid interface buffer */
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
rc=pDirectSoundCaptureCreate(lpGuid,NULL,NULL); rc = DirectSoundCaptureCreate(lpGuid, NULL, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have " ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc); "returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
rc=pDirectSoundCaptureCreate(lpGuid,&dsco,NULL); rc = DirectSoundCaptureCreate(lpGuid, &dsco, NULL);
ok((rc==DS_OK)||(rc==DSERR_NODRIVER)||(rc==E_FAIL)||(rc==DSERR_ALLOCATED), ok((rc==DS_OK)||(rc==DSERR_NODRIVER)||(rc==E_FAIL)||(rc==DSERR_ALLOCATED),
"DirectSoundCaptureCreate() failed: %08x\n",rc); "DirectSoundCaptureCreate() failed: %08x\n",rc);
if (rc!=DS_OK) { if (rc!=DS_OK) {
...@@ -669,7 +666,7 @@ EXIT: ...@@ -669,7 +666,7 @@ EXIT:
static void test_enumerate(void) static void test_enumerate(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL); rc = DirectSoundCaptureEnumerateA(dscenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %08x\n", rc); ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %08x\n", rc);
} }
...@@ -684,12 +681,12 @@ static void test_COM(void) ...@@ -684,12 +681,12 @@ static void test_COM(void)
HRESULT hr; HRESULT hr;
ULONG refcount; ULONG refcount;
hr = pDirectSoundCaptureCreate(NULL, &dsc, (IUnknown*)0xdeadbeef); hr = DirectSoundCaptureCreate(NULL, &dsc, (IUnknown *)0xdeadbeef);
ok(hr == DSERR_NOAGGREGATION, ok(hr == DSERR_NOAGGREGATION,
"DirectSoundCaptureCreate failed: %08x, expected DSERR_NOAGGREGATION\n", hr); "DirectSoundCaptureCreate failed: %08x, expected DSERR_NOAGGREGATION\n", hr);
ok(dsc == (IDirectSoundCapture*)0xdeadbeef, "dsc = %p\n", dsc); ok(dsc == (IDirectSoundCapture*)0xdeadbeef, "dsc = %p\n", dsc);
hr = pDirectSoundCaptureCreate(NULL, &dsc, NULL); hr = DirectSoundCaptureCreate(NULL, &dsc, NULL);
if (hr == DSERR_NODRIVER) { if (hr == DSERR_NODRIVER) {
skip("No driver\n"); skip("No driver\n");
return; return;
...@@ -755,27 +752,11 @@ static void test_COM(void) ...@@ -755,27 +752,11 @@ static void test_COM(void)
START_TEST(capture) START_TEST(capture)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (!hDsound) {
skip("dsound.dll not found - skipping all tests\n");
return;
}
pDirectSoundCaptureCreate = (void*)GetProcAddress(hDsound, "DirectSoundCaptureCreate");
pDirectSoundCaptureEnumerateA = (void*)GetProcAddress(hDsound, "DirectSoundCaptureEnumerateA");
if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA) {
skip("DirectSoundCapture{Create,Enumerate} missing - skipping all tests\n");
return;
}
test_COM(); test_COM();
test_capture(); test_capture();
test_enumerate(); test_enumerate();
FreeLibrary(hDsound);
CoUninitialize(); CoUninitialize();
} }
...@@ -36,11 +36,6 @@ ...@@ -36,11 +36,6 @@
#define PI 3.14159265358979323846 #define PI 3.14159265358979323846
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
LPUNKNOWN)=NULL;
char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL ieee) char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL ieee)
{ {
int i; int i;
...@@ -712,7 +707,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, ...@@ -712,7 +707,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -974,7 +969,7 @@ static HRESULT test_for_driver(LPGUID lpGuid) ...@@ -974,7 +969,7 @@ static HRESULT test_for_driver(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -998,7 +993,7 @@ static HRESULT test_primary(LPGUID lpGuid) ...@@ -998,7 +993,7 @@ static HRESULT test_primary(LPGUID lpGuid)
int ref, i; int ref, i;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -1081,7 +1076,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid) ...@@ -1081,7 +1076,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -1152,7 +1147,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) ...@@ -1152,7 +1147,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -1306,32 +1301,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -1306,32 +1301,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void ds3d_tests(void) static void ds3d_tests(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL); rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count); trace("tested %u DirectSound drivers\n", driver_count);
} }
START_TEST(ds3d) START_TEST(ds3d)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
"DirectSoundEnumerateA");
pDirectSoundCreate = (void*)GetProcAddress(hDsound,
"DirectSoundCreate");
ds3d_tests(); ds3d_tests();
FreeLibrary(hDsound);
}
else
skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
...@@ -34,9 +34,6 @@ ...@@ -34,9 +34,6 @@
#include "ksmedia.h" #include "ksmedia.h"
#include "dsound_test.h" #include "dsound_test.h"
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
typedef struct { typedef struct {
char* wave; char* wave;
DWORD wave_len; DWORD wave_len;
...@@ -544,7 +541,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, ...@@ -544,7 +541,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play,
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -822,7 +819,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid) ...@@ -822,7 +819,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -846,7 +843,7 @@ static HRESULT test_primary8(LPGUID lpGuid) ...@@ -846,7 +843,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int ref, i; int ref, i;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -928,7 +925,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid) ...@@ -928,7 +925,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -999,7 +996,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid) ...@@ -999,7 +996,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return rc; return rc;
...@@ -1136,34 +1133,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -1136,34 +1133,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void ds3d8_tests(void) static void ds3d8_tests(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL); rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count); trace("tested %u DirectSound drivers\n", driver_count);
} }
START_TEST(ds3d8) START_TEST(ds3d8)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
"DirectSoundEnumerateA");
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
"DirectSoundCreate8");
if (pDirectSoundCreate8)
ds3d8_tests(); ds3d8_tests();
else
skip("DirectSoundCreate8 missing - skipping all tests\n");
FreeLibrary(hDsound);
}
else
skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
...@@ -41,12 +41,6 @@ ...@@ -41,12 +41,6 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
LPUNKNOWN)=NULL;
static BOOL gotdx8;
static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized, static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
LPCGUID lpGuid) LPCGUID lpGuid)
{ {
...@@ -235,28 +229,28 @@ static void IDirectSound_tests(void) ...@@ -235,28 +229,28 @@ static void IDirectSound_tests(void)
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
/* try with no device specified */ /* try with no device specified */
rc=pDirectSoundCreate(NULL,&dso,NULL); rc = DirectSoundCreate(NULL, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(NULL) failed: %08x\n",rc); "DirectSoundCreate(NULL) failed: %08x\n",rc);
if (rc==S_OK && dso) if (rc==S_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with default playback device specified */ /* try with default playback device specified */
rc=pDirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL); rc = DirectSoundCreate(&DSDEVID_DefaultPlayback, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08x\n", rc); "DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08x\n", rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ /* try with default voice playback device specified */
rc=pDirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL); rc = DirectSoundCreate(&DSDEVID_DefaultVoicePlayback, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc); "DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with a bad device specified */ /* try with a bad device specified */
rc=pDirectSoundCreate(&DSDEVID_DefaultVoiceCapture,&dso,NULL); rc = DirectSoundCreate(&DSDEVID_DefaultVoiceCapture, &dso, NULL);
ok(rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultVoiceCapture) " ok(rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
...@@ -270,12 +264,12 @@ static HRESULT test_dsound(LPGUID lpGuid) ...@@ -270,12 +264,12 @@ static HRESULT test_dsound(LPGUID lpGuid)
int ref; int ref;
/* DSOUND: Error: Invalid interface buffer */ /* DSOUND: Error: Invalid interface buffer */
rc=pDirectSoundCreate(lpGuid,0,NULL); rc = DirectSoundCreate(lpGuid, 0, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate() should have returned " ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc); "DSERR_INVALIDPARAM, returned: %08x\n",rc);
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -292,13 +286,13 @@ static HRESULT test_dsound(LPGUID lpGuid) ...@@ -292,13 +286,13 @@ static HRESULT test_dsound(LPGUID lpGuid)
IDirectSound_test(dso, FALSE, lpGuid); IDirectSound_test(dso, FALSE, lpGuid);
/* Create a DirectSound object */ /* Create a DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
LPDIRECTSOUND dso1=NULL; LPDIRECTSOUND dso1=NULL;
/* Create a second DirectSound object */ /* Create a second DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso1,NULL); rc = DirectSoundCreate(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
/* Release the second DirectSound object */ /* Release the second DirectSound object */
...@@ -318,7 +312,7 @@ static HRESULT test_dsound(LPGUID lpGuid) ...@@ -318,7 +312,7 @@ static HRESULT test_dsound(LPGUID lpGuid)
return rc; return rc;
/* Create a DirectSound object */ /* Create a DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary; LPDIRECTSOUNDBUFFER secondary;
...@@ -374,7 +368,7 @@ static HRESULT test_primary(LPGUID lpGuid) ...@@ -374,7 +368,7 @@ static HRESULT test_primary(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -545,7 +539,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) ...@@ -545,7 +539,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
int f,ref,tag; int f,ref,tag;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -687,7 +681,7 @@ static HRESULT test_secondary(LPGUID lpGuid) ...@@ -687,7 +681,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -751,8 +745,7 @@ static HRESULT test_secondary(LPGUID lpGuid) ...@@ -751,8 +745,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
wfx.nBlockAlign); wfx.nBlockAlign);
bufdesc.lpwfxFormat=&wfx; bufdesc.lpwfxFormat=&wfx;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
if (gotdx8 || wfx.wBitsPerSample <= 16 || wfx.wFormatTag == WAVE_FORMAT_IEEE_FLOAT)
{
if (wfx.wBitsPerSample > 16) if (wfx.wBitsPerSample > 16)
ok(broken((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary) ok(broken((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary)
|| rc == DS_OK, /* driver dependent? */ || rc == DS_OK, /* driver dependent? */
...@@ -762,19 +755,6 @@ static HRESULT test_secondary(LPGUID lpGuid) ...@@ -762,19 +755,6 @@ static HRESULT test_secondary(LPGUID lpGuid)
else else
ok((rc==DS_OK && secondary!=NULL) || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */ ok((rc==DS_OK && secondary!=NULL) || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc); "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc);
}
else
ok(rc==E_INVALIDARG, "Creating %d bpp buffer on dx < 8 returned: %p %08x\n",
wfx.wBitsPerSample, secondary, rc);
if (!gotdx8)
{
win_skip("Not doing the WAVE_FORMAT_EXTENSIBLE tests\n");
/* Apparently they succeed with bogus values,
* which means that older dsound doesn't look at them
*/
goto no_wfe;
}
if (secondary) if (secondary)
IDirectSoundBuffer_Release(secondary); IDirectSoundBuffer_Release(secondary);
...@@ -853,7 +833,6 @@ static HRESULT test_secondary(LPGUID lpGuid) ...@@ -853,7 +833,6 @@ static HRESULT test_secondary(LPGUID lpGuid)
ok(rc==DS_OK && secondary!=NULL, ok(rc==DS_OK && secondary!=NULL,
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc); "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc);
no_wfe:
if (rc==DS_OK && secondary!=NULL) { if (rc==DS_OK && secondary!=NULL) {
if (winetest_interactive) { if (winetest_interactive) {
trace(" Testing a secondary buffer at %dx%dx%d (fmt=%d) " trace(" Testing a secondary buffer at %dx%dx%d (fmt=%d) "
...@@ -902,7 +881,7 @@ static HRESULT test_block_align(LPGUID lpGuid) ...@@ -902,7 +881,7 @@ static HRESULT test_block_align(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -973,7 +952,7 @@ static HRESULT test_frequency(LPGUID lpGuid) ...@@ -973,7 +952,7 @@ static HRESULT test_frequency(LPGUID lpGuid)
48000, 96000 }; 48000, 96000 };
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -1104,7 +1083,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) ...@@ -1104,7 +1083,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -1431,11 +1410,6 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I ...@@ -1431,11 +1410,6 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I
} }
} }
if(!gotdx8){
win_skip("Not doing the WAVE_FORMAT_EXTENSIBLE tests\n");
return;
}
fmtex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); fmtex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
fmtex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; fmtex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
fmtex.Format.nChannels = 2; fmtex.Format.nChannels = 2;
...@@ -1510,7 +1484,7 @@ static HRESULT test_invalid_fmts(LPGUID lpGuid) ...@@ -1510,7 +1484,7 @@ static HRESULT test_invalid_fmts(LPGUID lpGuid)
DSBUFFERDESC bufdesc; DSBUFFERDESC bufdesc;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -1556,7 +1530,7 @@ static void test_notifications(LPGUID lpGuid) ...@@ -1556,7 +1530,7 @@ static void test_notifications(LPGUID lpGuid)
DWORD expect, status; DWORD expect, status;
int cycles; int cycles;
rc = pDirectSoundCreate(lpGuid, &dso, NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc == DS_OK || rc == DSERR_NODRIVER || rc == DSERR_ALLOCATED, ok(rc == DS_OK || rc == DSERR_NODRIVER || rc == DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n", rc); "DirectSoundCreate() failed: %08x\n", rc);
if(rc != DS_OK) if(rc != DS_OK)
...@@ -1683,7 +1657,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -1683,7 +1657,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void dsound_tests(void) static void dsound_tests(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL); rc = DirectSoundEnumerateA(&dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
} }
...@@ -1699,7 +1673,7 @@ static void test_hw_buffers(void) ...@@ -1699,7 +1673,7 @@ static void test_hw_buffers(void)
UINT i; UINT i;
HRESULT hr; HRESULT hr;
hr = pDirectSoundCreate(NULL, &ds, NULL); hr = DirectSoundCreate(NULL, &ds, NULL);
ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate failed: %08x\n", hr); "DirectSoundCreate failed: %08x\n", hr);
if(hr != S_OK) if(hr != S_OK)
...@@ -1801,38 +1775,11 @@ static void test_hw_buffers(void) ...@@ -1801,38 +1775,11 @@ static void test_hw_buffers(void)
START_TEST(dsound) START_TEST(dsound)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
BOOL ret;
ret = FreeLibrary(hDsound);
ok( ret, "FreeLibrary(1) returned %d\n", GetLastError());
}
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
"DirectSoundEnumerateA");
pDirectSoundCreate = (void*)GetProcAddress(hDsound,
"DirectSoundCreate");
gotdx8 = !!GetProcAddress(hDsound, "DirectSoundCreate8");
IDirectSound_tests(); IDirectSound_tests();
dsound_tests(); dsound_tests();
test_hw_buffers(); test_hw_buffers();
FreeLibrary(hDsound);
}
else
win_skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
#include "dsound_test.h" #include "dsound_test.h"
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
int align(int length, int align) int align(int length, int align)
{ {
return (length / align) * align; return (length / align) * align;
...@@ -250,28 +247,28 @@ static void IDirectSound8_tests(void) ...@@ -250,28 +247,28 @@ static void IDirectSound8_tests(void)
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
/* try with no device specified */ /* try with no device specified */
rc=pDirectSoundCreate8(NULL,&dso,NULL); rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */ /* try with default playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL); rc = DirectSoundCreate8(&DSDEVID_DefaultPlayback, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ /* try with default voice playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL); rc = DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso) if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with a bad device specified */ /* try with a bad device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoiceCapture,&dso,NULL); rc = DirectSoundCreate8(&DSDEVID_DefaultVoiceCapture, &dso, NULL);
ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) " ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc); "should have failed: %08x\n",rc);
} }
...@@ -283,12 +280,12 @@ static HRESULT test_dsound8(LPGUID lpGuid) ...@@ -283,12 +280,12 @@ static HRESULT test_dsound8(LPGUID lpGuid)
int ref; int ref;
/* DSOUND: Error: Invalid interface buffer */ /* DSOUND: Error: Invalid interface buffer */
rc=pDirectSoundCreate8(lpGuid,0,NULL); rc = DirectSoundCreate8(lpGuid, 0, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned " ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc); "DSERR_INVALIDPARAM, returned: %08x\n",rc);
/* Create the DirectSound8 object */ /* Create the DirectSound8 object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -305,13 +302,13 @@ static HRESULT test_dsound8(LPGUID lpGuid) ...@@ -305,13 +302,13 @@ static HRESULT test_dsound8(LPGUID lpGuid)
IDirectSound8_test(dso, FALSE, lpGuid); IDirectSound8_test(dso, FALSE, lpGuid);
/* Create a DirectSound8 object */ /* Create a DirectSound8 object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
LPDIRECTSOUND8 dso1=NULL; LPDIRECTSOUND8 dso1=NULL;
/* Create a second DirectSound8 object */ /* Create a second DirectSound8 object */
rc=pDirectSoundCreate8(lpGuid,&dso1,NULL); rc = DirectSoundCreate8(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
/* Release the second DirectSound8 object */ /* Release the second DirectSound8 object */
...@@ -332,7 +329,7 @@ static HRESULT test_dsound8(LPGUID lpGuid) ...@@ -332,7 +329,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
return rc; return rc;
/* Create a DirectSound8 object */ /* Create a DirectSound8 object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) { if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary; LPDIRECTSOUNDBUFFER secondary;
...@@ -401,7 +398,7 @@ static HRESULT test_primary8(LPGUID lpGuid) ...@@ -401,7 +398,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -551,7 +548,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) ...@@ -551,7 +548,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
unsigned int f, tag; unsigned int f, tag;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -692,7 +689,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) ...@@ -692,7 +689,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
int ref; int ref;
/* Create the DirectSound object */ /* Create the DirectSound object */
rc=pDirectSoundCreate8(lpGuid,&dso,NULL); rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc); "DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -938,7 +935,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -938,7 +935,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void dsound8_tests(void) static void dsound8_tests(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL); rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
} }
...@@ -954,7 +951,7 @@ static void test_hw_buffers(void) ...@@ -954,7 +951,7 @@ static void test_hw_buffers(void)
UINT i; UINT i;
HRESULT hr; HRESULT hr;
hr = pDirectSoundCreate8(NULL, &ds, NULL); hr = DirectSoundCreate8(NULL, &ds, NULL);
ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate8 failed: %08x\n", hr); "DirectSoundCreate8 failed: %08x\n", hr);
if(hr != S_OK) if(hr != S_OK)
...@@ -1119,7 +1116,7 @@ static void test_first_device(void) ...@@ -1119,7 +1116,7 @@ static void test_first_device(void)
IMMDevice_Release(defdev); IMMDevice_Release(defdev);
IMMDeviceEnumerator_Release(devenum); IMMDeviceEnumerator_Release(devenum);
hr = pDirectSoundEnumerateA(&default_device_cb, NULL); hr = DirectSoundEnumerateA(default_device_cb, NULL);
ok(hr == S_OK, "DirectSoundEnumerateA failed: %08x\n", hr); ok(hr == S_OK, "DirectSoundEnumerateA failed: %08x\n", hr);
} }
...@@ -1183,7 +1180,7 @@ static void test_primary_flags(void) ...@@ -1183,7 +1180,7 @@ static void test_primary_flags(void)
DSCAPS dscaps; DSCAPS dscaps;
/* Create a DirectSound8 object */ /* Create a DirectSound8 object */
rc = pDirectSoundCreate8(NULL, &dso, NULL); rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc == DS_OK || rc==DSERR_NODRIVER, "Failed: %08x\n",rc); ok(rc == DS_OK || rc==DSERR_NODRIVER, "Failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -1234,7 +1231,7 @@ static void test_effects(void) ...@@ -1234,7 +1231,7 @@ static void test_effects(void)
DWORD resultcodes[2]; DWORD resultcodes[2];
/* Create a DirectSound8 object */ /* Create a DirectSound8 object */
rc=pDirectSoundCreate8(NULL,&dso,NULL); rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n",rc); ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
...@@ -1696,7 +1693,7 @@ static void test_effects_parameters(void) ...@@ -1696,7 +1693,7 @@ static void test_effects_parameters(void)
DWORD resultcodes[8]; DWORD resultcodes[8];
/* Create a DirectSound8 object */ /* Create a DirectSound8 object */
rc = pDirectSoundCreate8(NULL, &dso, NULL); rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc == DS_OK || rc == DSERR_NODRIVER, "DirectSoundCreate8() failed: %08x\n", rc); ok(rc == DS_OK || rc == DSERR_NODRIVER, "DirectSoundCreate8() failed: %08x\n", rc);
if (rc != DS_OK) if (rc != DS_OK)
return; return;
...@@ -1789,20 +1786,8 @@ cleanup: ...@@ -1789,20 +1786,8 @@ cleanup:
START_TEST(dsound8) START_TEST(dsound8)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
"DirectSoundEnumerateA");
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
"DirectSoundCreate8");
if (pDirectSoundCreate8)
{
test_COM(); test_COM();
IDirectSound8_tests(); IDirectSound8_tests();
dsound8_tests(); dsound8_tests();
...@@ -1811,14 +1796,6 @@ START_TEST(dsound8) ...@@ -1811,14 +1796,6 @@ START_TEST(dsound8)
test_primary_flags(); test_primary_flags();
test_effects(); test_effects();
test_effects_parameters(); test_effects_parameters();
}
else
skip("DirectSoundCreate8 missing - skipping all tests\n");
FreeLibrary(hDsound);
}
else
skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
#include "dsound_test.h" #include "dsound_test.h"
static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID, LPCGUID,
LPCDSCBUFFERDESC, LPCDSBUFFERDESC, HWND, DWORD, LPDIRECTSOUNDFULLDUPLEX *,
LPDIRECTSOUNDCAPTUREBUFFER8*, LPDIRECTSOUNDBUFFER8*, LPUNKNOWN)=NULL;
static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo, static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
BOOL initialized, LPCGUID lpGuidCapture, BOOL initialized, LPCGUID lpGuidCapture,
LPCGUID lpGuidRender) LPCGUID lpGuidRender)
...@@ -181,19 +177,17 @@ static void IDirectSoundFullDuplex_tests(void) ...@@ -181,19 +177,17 @@ static void IDirectSoundFullDuplex_tests(void)
DSBufferDesc.lpwfxFormat = &wfex; DSBufferDesc.lpwfxFormat = &wfex;
/* try with no device specified */ /* try with no device specified */
rc=pDirectSoundFullDuplexCreate(NULL,NULL,&DSCBufferDesc,&DSBufferDesc, rc = DirectSoundFullDuplexCreate(NULL, NULL, &DSCBufferDesc, &DSBufferDesc,
get_hwnd(),DSSCL_EXCLUSIVE ,&dsfdo,&pDSCBuffer8, get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
&pDSBuffer8,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(NULL,NULL) failed: %08x\n",rc); "DirectSoundFullDuplexCreate(NULL,NULL) failed: %08x\n",rc);
if (rc==S_OK && dsfdo) if (rc==S_OK && dsfdo)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL); IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with default devices specified */ /* try with default devices specified */
rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultCapture, rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultCapture,
&DSDEVID_DefaultPlayback,&DSCBufferDesc, &DSDEVID_DefaultPlayback, &DSCBufferDesc, &DSBufferDesc, get_hwnd(),
&DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE,&dsfdo, DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8,&pDSBuffer8, NULL);
&pDSCBuffer8,&pDSBuffer8,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultCapture," "DirectSoundFullDuplexCreate(DSDEVID_DefaultCapture,"
"DSDEVID_DefaultPlayback) failed: %08x\n", rc); "DSDEVID_DefaultPlayback) failed: %08x\n", rc);
...@@ -201,10 +195,9 @@ static void IDirectSoundFullDuplex_tests(void) ...@@ -201,10 +195,9 @@ static void IDirectSoundFullDuplex_tests(void)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL); IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with default voice devices specified */ /* try with default voice devices specified */
rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoiceCapture, rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultVoiceCapture,
&DSDEVID_DefaultVoicePlayback, &DSDEVID_DefaultVoicePlayback, &DSCBufferDesc, &DSBufferDesc,
&DSCBufferDesc,&DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE, get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
&dsfdo,&pDSCBuffer8,&pDSBuffer8,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultVoiceCapture," "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoiceCapture,"
"DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc); "DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
...@@ -212,10 +205,9 @@ static void IDirectSoundFullDuplex_tests(void) ...@@ -212,10 +205,9 @@ static void IDirectSoundFullDuplex_tests(void)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL); IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with bad devices specified */ /* try with bad devices specified */
rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoicePlayback, rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultVoicePlayback,
&DSDEVID_DefaultVoiceCapture, &DSDEVID_DefaultVoiceCapture, &DSCBufferDesc, &DSBufferDesc,
&DSCBufferDesc,&DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE, get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
&dsfdo,&pDSCBuffer8,&pDSBuffer8,NULL);
ok(rc==DSERR_NODRIVER||rc==DSERR_INVALIDCALL, ok(rc==DSERR_NODRIVER||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback," "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback,"
"DSDEVID_DefaultVoiceCapture) should have failed: %08x\n", rc); "DSDEVID_DefaultVoiceCapture) should have failed: %08x\n", rc);
...@@ -336,26 +328,10 @@ static void test_COM(void) ...@@ -336,26 +328,10 @@ static void test_COM(void)
START_TEST(duplex) START_TEST(duplex)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll");
if (hDsound)
{
pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,
"DirectSoundFullDuplexCreate");
if (pDirectSoundFullDuplexCreate) {
test_COM(); test_COM();
IDirectSoundFullDuplex_tests(); IDirectSoundFullDuplex_tests();
} else
skip("DirectSoundFullDuplexCreate missing - skipping all tests\n");
FreeLibrary(hDsound);
}
else
skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
...@@ -49,19 +49,7 @@ DEFINE_GUID(DSPROPSETID_I3DL2_BufferProperties, ...@@ -49,19 +49,7 @@ DEFINE_GUID(DSPROPSETID_I3DL2_BufferProperties,
DEFINE_GUID(DSPROPSETID_ZOOMFX_BufferProperties, DEFINE_GUID(DSPROPSETID_ZOOMFX_BufferProperties,
0xCD5368E0,0x3450,0x11D3,0x8B,0x6E,0x00,0x10,0x5A,0x9B,0x7B,0xBC); 0xCD5368E0,0x3450,0x11D3,0x8B,0x6E,0x00,0x10,0x5A,0x9B,0x7B,0xBC);
static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID*)=NULL; static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID*)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
LPUNKNOWN)=NULL;
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,
LPUNKNOWN)=NULL;
static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,
LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
static HRESULT (WINAPI *pDirectSoundCaptureCreate8)(LPCGUID,
LPDIRECTSOUNDCAPTURE8*,LPUNKNOWN)=NULL;
static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID,LPCGUID,
LPCDSCBUFFERDESC,LPCDSBUFFERDESC,HWND,DWORD,LPDIRECTSOUNDFULLDUPLEX*,
LPDIRECTSOUNDCAPTUREBUFFER8*,LPDIRECTSOUNDBUFFER8*,LPUNKNOWN)=NULL;
static BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data, static BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
LPVOID context) LPVOID context)
...@@ -202,8 +190,7 @@ static void propset_private_tests(void) ...@@ -202,8 +190,7 @@ static void propset_private_tests(void)
"returned E_NOINTERFACE, returned: %08x\n",rc); "returned E_NOINTERFACE, returned: %08x\n",rc);
/* and the direct sound 8 version */ /* and the direct sound 8 version */
if (pDirectSoundCreate8) { rc = pDllGetClassObject(&CLSID_DirectSound8, &IID_IClassFactory, (void **)&pcf);
rc = (pDllGetClassObject)(&CLSID_DirectSound8, &IID_IClassFactory, (void **)(&pcf));
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) " ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
"failed: %08x\n",rc); "failed: %08x\n",rc);
if (pcf==0) if (pcf==0)
...@@ -214,12 +201,9 @@ static void propset_private_tests(void) ...@@ -214,12 +201,9 @@ static void propset_private_tests(void)
(void **)(&pps)); (void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %08x\n",rc); "returned E_NOINTERFACE, returned: %08x\n",rc);
}
/* try direct sound capture next */ /* try direct sound capture next */
if (pDirectSoundCaptureCreate) { rc = pDllGetClassObject(&CLSID_DirectSoundCapture, &IID_IClassFactory, (void **)&pcf);
rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture, &IID_IClassFactory,
(void **)(&pcf));
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) " ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %08x\n",rc); "failed: %08x\n",rc);
if (pcf==0) if (pcf==0)
...@@ -230,12 +214,9 @@ static void propset_private_tests(void) ...@@ -230,12 +214,9 @@ static void propset_private_tests(void)
(void **)(&pps)); (void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE,returned: %08x\n",rc); "returned E_NOINTERFACE,returned: %08x\n",rc);
}
/* and the direct sound capture 8 version */ /* and the direct sound capture 8 version */
if (pDirectSoundCaptureCreate8) { rc = pDllGetClassObject(&CLSID_DirectSoundCapture8, &IID_IClassFactory, (void **)&pcf);
rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture8, &IID_IClassFactory,
(void **)(&pcf));
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, " ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
"IID_IClassFactory) failed: %08x\n",rc); "IID_IClassFactory) failed: %08x\n",rc);
if (pcf==0) if (pcf==0)
...@@ -246,10 +227,8 @@ static void propset_private_tests(void) ...@@ -246,10 +227,8 @@ static void propset_private_tests(void)
(void **)(&pps)); (void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %08x\n",rc); "returned E_NOINTERFACE, returned: %08x\n",rc);
}
/* try direct sound full duplex next */ /* try direct sound full duplex next */
if (pDirectSoundFullDuplexCreate) {
rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory, rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
(void **)(&pcf)); (void **)(&pcf));
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, " ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
...@@ -262,7 +241,6 @@ static void propset_private_tests(void) ...@@ -262,7 +241,6 @@ static void propset_private_tests(void)
(void **)(&pps)); (void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned NOINTERFACE, returned: %08x\n",rc); "returned NOINTERFACE, returned: %08x\n",rc);
}
/* try direct sound private last */ /* try direct sound private last */
rc = (pDllGetClassObject)(&CLSID_DirectSoundPrivate, &IID_IClassFactory, rc = (pDllGetClassObject)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
...@@ -549,7 +527,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -549,7 +527,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
driver_count++; driver_count++;
rc=pDirectSoundCreate(lpGuid,&dso,NULL); rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL, ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc); "DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) { if (rc!=DS_OK) {
...@@ -692,43 +670,19 @@ EXIT: ...@@ -692,43 +670,19 @@ EXIT:
static void propset_buffer_tests(void) static void propset_buffer_tests(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundEnumerateA(&dsenum_callback,NULL); rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc); ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count); trace("tested %u DirectSound drivers\n", driver_count);
} }
START_TEST(propset) START_TEST(propset)
{ {
HMODULE hDsound;
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibraryA("dsound.dll"); pDllGetClassObject = (void *)GetProcAddress(GetModuleHandleA("dsound"), "DllGetClassObject");
if (hDsound)
{
pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
"DirectSoundEnumerateA");
pDllGetClassObject = (void *)GetProcAddress(hDsound,
"DllGetClassObject");
pDirectSoundCreate = (void*)GetProcAddress(hDsound,
"DirectSoundCreate");
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
"DirectSoundCreate8");
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,
"DirectSoundCaptureCreate");
pDirectSoundCaptureCreate8=(void*)GetProcAddress(hDsound,
"DirectSoundCaptureCreate8");
pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,
"DirectSoundFullDuplexCreate");
propset_private_tests(); propset_private_tests();
propset_buffer_tests(); propset_buffer_tests();
FreeLibrary(hDsound);
}
else
skip("dsound.dll not found - skipping all tests\n");
CoUninitialize(); CoUninitialize();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment