Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Tue, Mar 01, 2022 at 08:32:42AM +0100, Eric Pouech wrote:
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/dsound/tests/Makefile.in | 1 dlls/dsound/tests/capture.c | 150 +++++++------- dlls/dsound/tests/ds3d.c | 250 ++++++++++++------------ dlls/dsound/tests/ds3d8.c | 238 +++++++++++------------ dlls/dsound/tests/dsound.c | 386 +++++++++++++++++++------------------ dlls/dsound/tests/dsound8.c | 426 +++++++++++++++++++++-------------------- dlls/dsound/tests/duplex.c | 76 ++++--- dlls/dsound/tests/propset.c | 124 ++++++------ 8 files changed, 825 insertions(+), 826 deletions(-)
diff --git a/dlls/dsound/tests/Makefile.in b/dlls/dsound/tests/Makefile.in index cc39c4bda22..234b49b1bba 100644 --- a/dlls/dsound/tests/Makefile.in +++ b/dlls/dsound/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = dsound.dll IMPORTS = dmoguids dsound msdmo ole32 version user32
diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 2d8138aa19e..63998276a77 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -90,7 +90,7 @@ const char * format_string(const WAVEFORMATEX* wfx) { static char str[64];
- sprintf(str, "%5dx%2dx%d %s",
- sprintf(str, "%5ldx%2dx%d %s", wfx->nSamplesPerSec, wfx->wBitsPerSample, wfx->nChannels, get_format_str(wfx->wFormatTag));
@@ -110,14 +110,14 @@ static void IDirectSoundCapture_test(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundCapture_QueryInterface(dsco, &IID_IUnknown, (LPVOID*)&unknown); ok(rc==DS_OK, "IDirectSoundCapture_QueryInterface(IID_IUnknown) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
if (rc==DS_OK) IUnknown_Release(unknown);
rc=IDirectSoundCapture_QueryInterface(dsco, &IID_IDirectSoundCapture, (LPVOID*)&dsc); ok(rc==DS_OK, "IDirectSoundCapture_QueryInterface(IID_IDirectSoundCapture) "
"failed: %08x\n", rc);
if (rc==DS_OK) IDirectSoundCapture_Release(dsc);"failed: %08lx\n", rc);
@@ -126,16 +126,16 @@ static void IDirectSoundCapture_test(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundCapture_GetCaps(dsco,0); ok(rc==DSERR_UNINITIALIZED||rc==E_INVALIDARG, "IDirectSoundCapture_GetCaps(NULL) should have returned "
"DSERR_UNINITIALIZED or E_INVALIDARG, returned: %08x\n", rc);
"DSERR_UNINITIALIZED or E_INVALIDARG, returned: %08lx\n", rc); rc=IDirectSoundCapture_GetCaps(dsco, &dsccaps); ok(rc==DSERR_UNINITIALIZED,"IDirectSoundCapture_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSoundCapture_Initialize(dsco, lpGuid); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED|| rc==E_FAIL||rc==E_INVALIDARG,
"IDirectSoundCapture_Initialize() failed: %08x\n", rc);
"IDirectSoundCapture_Initialize() failed: %08lx\n", rc); if (rc==DSERR_NODRIVER||rc==E_INVALIDARG) { trace(" No Driver\n"); goto EXIT;
@@ -150,25 +150,25 @@ static void IDirectSoundCapture_test(LPDIRECTSOUNDCAPTURE dsco,
rc=IDirectSoundCapture_Initialize(dsco, lpGuid); ok(rc==DSERR_ALREADYINITIALIZED, "IDirectSoundCapture_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %08x\n", rc);
"should have returned DSERR_ALREADYINITIALIZED: %08lx\n", rc);
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSoundCapture_GetCaps(dsco, 0); ok(rc==DSERR_INVALIDPARAM, "IDirectSoundCapture_GetCaps(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
ZeroMemory(&dsccaps, sizeof(dsccaps));
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSoundCapture_GetCaps(dsco, &dsccaps); ok(rc==DSERR_INVALIDPARAM, "IDirectSound_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
dsccaps.dwSize=sizeof(dsccaps);
/* DSOUND: Running on a certified driver */ rc=IDirectSoundCapture_GetCaps(dsco, &dsccaps);
- ok(rc==DS_OK, "IDirectSoundCapture_GetCaps() failed: %08x\n", rc);
- ok(rc==DS_OK, "IDirectSoundCapture_GetCaps() failed: %08lx\n", rc);
EXIT: ref=IDirectSoundCapture_Release(dsco); @@ -187,17 +187,17 @@ static void test_capture(void) rc=CoGetClassObject(&CLSID_DirectSoundCapture, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
rc=CoGetClassObject(&CLSID_DirectSoundCapture, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSoundCapture, IID_IUnknown) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
/* try the COM class factory method of creation with no device specified */ rc=CoCreateInstance(&CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundCapture, (void**)&dsco);
- ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x\n", rc);
- ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08lx\n", rc); if (rc==REGDB_E_CLASSNOTREG) { trace(" Class Not Registered\n"); return;
@@ -209,7 +209,7 @@ static void test_capture(void) * device specified */ rc=CoCreateInstance(&CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundCapture, (void**)&dsco);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08lx\n", rc); if (dsco) IDirectSoundCapture_test(dsco, FALSE, &DSDEVID_DefaultCapture);
@@ -217,7 +217,7 @@ static void test_capture(void) * capture device specified */ rc=CoCreateInstance(&CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundCapture, (void**)&dsco);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08lx\n", rc); if (dsco) IDirectSoundCapture_test(dsco, FALSE, &DSDEVID_DefaultVoiceCapture);
@@ -227,26 +227,26 @@ static void test_capture(void) &CLSID_DirectSoundPrivate, (void**)&dsco); ok(rc==E_NOINTERFACE, "CoCreateInstance(CLSID_DirectSoundCapture,CLSID_DirectSoundPrivate) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
/* try with no device specified */ rc = DirectSoundCaptureCreate(NULL, &dsco, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(NULL) failed: %08x\n",rc);
"DirectSoundCaptureCreate(NULL) failed: %08lx\n",rc);
if (rc==S_OK && dsco) IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default capture device specified */ rc = DirectSoundCaptureCreate(&DSDEVID_DefaultCapture, &dsco, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08x\n", rc);
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08lx\n", rc);
if (rc==DS_OK && dsco) IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default voice capture device specified */ rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoiceCapture, &dsco, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08x\n", rc);
if (rc==DS_OK && dsco) IDirectSoundCapture_test(dsco, TRUE, NULL);"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08lx\n", rc);
@@ -254,7 +254,7 @@ static void test_capture(void) rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoicePlayback, &dsco, NULL); ok(rc==DSERR_NODRIVER, "DirectSoundCaptureCreate(DSDEVID_DefaultVoicePlatback) "
"should have failed: %08x\n",rc);
if (rc==DS_OK && dsco) IDirectSoundCapture_Release(dsco);"should have failed: %08lx\n",rc);
} @@ -286,18 +286,18 @@ static BOOL capture_buffer_service(capture_state_t* state)
rc=IDirectSoundCaptureBuffer_GetCurrentPosition(state->dscbo,&capture_pos, &read_pos);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetCurrentPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetCurrentPosition() failed: %08lx\n", rc); if (rc!=DS_OK) return FALSE;
rc=IDirectSoundCaptureBuffer_Lock(state->dscbo,state->offset,state->size, &ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Lock() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Lock() failed: %08lx\n", rc); if (rc!=DS_OK) return FALSE;
rc=IDirectSoundCaptureBuffer_Unlock(state->dscbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Unlock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Unlock() failed: %08lx\n", rc); if (rc!=DS_OK) return FALSE;
@@ -319,19 +319,19 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, /* Private dsound.dll: Error: Invalid caps pointer */ rc=IDirectSoundCaptureBuffer_GetCaps(dscbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCaptureBuffer_GetCaps() should "
"have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
/* Private dsound.dll: Error: Invalid caps pointer */ dscbcaps.dwSize=0; rc=IDirectSoundCaptureBuffer_GetCaps(dscbo,&dscbcaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCaptureBuffer_GetCaps() should "
"have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
dscbcaps.dwSize=sizeof(dscbcaps); rc=IDirectSoundCaptureBuffer_GetCaps(dscbo,&dscbcaps);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetCaps() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
- trace(" Caps: size = %d flags=0x%08x buffer size=%d\n",
- trace(" Caps: size = %ld flags=0x%08lx buffer size=%ld\n", dscbcaps.dwSize,dscbcaps.dwFlags,dscbcaps.dwBufferBytes); }
@@ -340,17 +340,17 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, * be non-NULL */ rc=IDirectSoundCaptureBuffer_GetFormat(dscbo,NULL,0,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCaptureBuffer_GetFormat() should "
"have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
size=0; rc=IDirectSoundCaptureBuffer_GetFormat(dscbo,NULL,0,&size); ok(rc==DS_OK && size!=0,"IDirectSoundCaptureBuffer_GetFormat() should "
"have returned the needed size: rc=%08x, size=%d\n", rc,size);
"have returned the needed size: rc=%08lx, size=%ld\n", rc,size);
rc=IDirectSoundCaptureBuffer_GetFormat(dscbo,&wfx,sizeof(wfx),NULL);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetFormat() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
- trace(" Format: tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
- trace(" Format: tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign); }
@@ -358,12 +358,12 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, /* Private dsound.dll: Error: Invalid status pointer */ rc=IDirectSoundCaptureBuffer_GetStatus(dscbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCaptureBuffer_GetStatus() should "
"have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
rc=IDirectSoundCaptureBuffer_GetStatus(dscbo,&status);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetStatus() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetStatus() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
- trace(" Status=0x%04x\n",status);
trace(" Status=0x%04lx\n",status); }
ZeroMemory(&state, sizeof(state));
@@ -377,7 +377,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundCaptureBuffer_QueryInterface(dscbo,&IID_IDirectSoundNotify, (void **)&(state.notify)); ok((rc==DS_OK)&&(state.notify!=NULL),
"IDirectSoundCaptureBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundCaptureBuffer_QueryInterface() failed: %08lx\n", rc);
for (i = 0; i < TIMESTAMP_NOTIFICATIONS; i++) { state.posnotify[i].dwOffset = (i * state.size) + state.size - 1;
@@ -389,32 +389,32 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
rc = IDirectSoundNotify_SetNotificationPositions(state.notify, TOTAL_NOTIFICATIONS, state.posnotify);
- ok(rc==DS_OK,"IDirectSoundNotify_SetNotificationPositions() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundNotify_SetNotificationPositions() failed: %08lx\n", rc);
ref=IDirectSoundNotify_Release(state.notify); ok(ref==0,"IDirectSoundNotify_Release(): has %d references, should have " "0\n",ref);
rc=IDirectSoundCaptureBuffer_Start(dscbo,DSCBSTART_LOOPING);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Start() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Start() failed: %08lx\n", rc);
rc=IDirectSoundCaptureBuffer_Start(dscbo,0);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Start() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Start() failed: %08lx\n", rc);
rc=IDirectSoundCaptureBuffer_GetStatus(dscbo,&status);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetStatus() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetStatus() failed: %08lx\n", rc); ok(status==(DSCBSTATUS_CAPTURING|DSCBSTATUS_LOOPING) || broken(status==DSCBSTATUS_CAPTURING),
"GetStatus: bad status: %x\n",status);
"GetStatus: bad status: %lx\n",status);
if (record) { /* wait for timestamp notifications */ for (i = 0; i < (TIMESTAMP_NOTIFICATIONS * 2); i++) { rc = WaitForMultipleObjects(TOTAL_NOTIFICATIONS, state.event, FALSE, 3000); ok(rc == (WAIT_OBJECT_0 + (i % TIMESTAMP_NOTIFICATIONS)),
"WaitForMultipleObjects failed: 0x%x\n",rc);
ok((rc==WAIT_TIMEOUT)||(rc==WAIT_FAILED),"WaitForMultipleObjects failed: 0x%lx\n",rc); if (rc != (WAIT_OBJECT_0 + (i % TIMESTAMP_NOTIFICATIONS))) {
"Wrong notification: should be %d, got %d\n",
"Wrong notification: should be %d, got %ld\n", i % TIMESTAMP_NOTIFICATIONS, rc - WAIT_OBJECT_0); } if (!capture_buffer_service(&state))
@@ -423,14 +423,14 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
} rc=IDirectSoundCaptureBuffer_Stop(dscbo);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08lx\n", rc);
/* wait for stop notification */ rc = WaitForSingleObject(state.event[TIMESTAMP_NOTIFICATIONS], 3000);
- ok(rc == WAIT_OBJECT_0, "WaitForSingleObject failed: 0x%x\n", rc);
ok(rc == WAIT_OBJECT_0, "WaitForSingleObject failed: 0x%lx\n", rc);
rc=IDirectSoundCaptureBuffer_Stop(dscbo);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08lx\n", rc);
}
static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, @@ -449,11 +449,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); rc = DirectSoundCaptureCreate(lpGuid, NULL, NULL); ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
rc = DirectSoundCaptureCreate(lpGuid, &dsco, NULL); ok((rc==DS_OK)||(rc==DSERR_NODRIVER)||(rc==E_FAIL)||(rc==DSERR_ALLOCATED),
"DirectSoundCaptureCreate() failed: %08x\n",rc);
if (rc!=DS_OK) { if (rc==DSERR_NODRIVER) trace(" No Driver\n");"DirectSoundCaptureCreate() failed: %08lx\n",rc);
@@ -467,19 +467,19 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, /* Private dsound.dll: Error: Invalid caps buffer */ rc=IDirectSoundCapture_GetCaps(dsco,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* Private dsound.dll: Error: Invalid caps buffer */ dsccaps.dwSize=0; rc=IDirectSoundCapture_GetCaps(dsco,&dsccaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
dsccaps.dwSize=sizeof(dsccaps); rc=IDirectSoundCapture_GetCaps(dsco,&dsccaps);
- ok(rc==DS_OK,"IDirectSoundCapture_GetCaps() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundCapture_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
- trace(" Caps: size=%d flags=0x%08x formats=%05x channels=%d\n",
- trace(" Caps: size=%ld flags=0x%08lx formats=%05lx channels=%ld\n", dsccaps.dwSize,dsccaps.dwFlags,dsccaps.dwFormats, dsccaps.dwChannels); }
@@ -494,7 +494,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.lpwfxFormat=NULL; rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_CreateCaptureBuffer() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK) { ref=IDirectSoundCaptureBuffer_Release(dscbo); ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, ""should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -511,7 +511,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.lpwfxFormat=NULL; rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_CreateCaptureBuffer() "
"should have returned DSERR_INVALIDPARAM, returned %08x\n", rc);
if (rc==DS_OK) { ref=IDirectSoundCaptureBuffer_Release(dscbo); ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, ""should have returned DSERR_INVALIDPARAM, returned %08lx\n", rc);
@@ -529,7 +529,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.lpwfxFormat=&wfx; rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_CreateCaptureBuffer() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK) { ref=IDirectSoundCaptureBuffer_Release(dscbo); ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, ""should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -547,7 +547,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.lpwfxFormat=&wfx; rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundCapture_CreateCaptureBuffer() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK) { ref=IDirectSoundCaptureBuffer_Release(dscbo); ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, ""should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -571,7 +571,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, || rc==DSERR_BADFORMAT || rc==DSERR_INVALIDCALL || rc==DSERR_NODRIVER || rc==DSERR_ALLOCATED || rc==E_INVALIDARG || rc==E_FAIL, "IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"%s capture buffer: %08x\n",format_string(&wfx),rc);
if (rc==DS_OK) { test_capture_buffer(dsco, dscbo, winetest_interactive); ref=IDirectSoundCaptureBuffer_Release(dscbo);"%s capture buffer: %08lx\n",format_string(&wfx),rc);
@@ -599,7 +599,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, (DSCBUFFERDESC*)&bufdesc1,&dscbo,NULL); ok(rc==DS_OK || broken(rc==DSERR_INVALIDPARAM), "IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"%s capture buffer: %08x\n",format_string(&wfx), rc);
"%s capture buffer: %08lx\n",format_string(&wfx), rc); if (rc==DSERR_INVALIDPARAM) { skip("broken driver\n"); goto EXIT;
@@ -634,7 +634,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, trace(" Testing the capture buffer at %s\n", format_string(&wfx)); rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok((rc==DS_OK)&&(dscbo!=NULL),"IDirectSoundCapture_CreateCaptureBuffer() "
"failed to create a capture buffer: %08x\n",rc);
if ((rc==DS_OK)&&(dscbo!=NULL)) { test_capture_buffer(dsco, dscbo, winetest_interactive); ref=IDirectSoundCaptureBuffer_Release(dscbo);"failed to create a capture buffer: %08lx\n",rc);
@@ -658,7 +658,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, trace(" Testing the capture buffer at %s\n", format_string(&wfx)); rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); ok(rc!=DS_OK,"IDirectSoundCapture_CreateCaptureBuffer() should have failed "
"at 2 MHz %08x\n",rc);
}"at 2 MHz %08lx\n",rc);
EXIT: @@ -675,7 +675,7 @@ static void test_enumerate(void) { HRESULT rc; rc = DirectSoundCaptureEnumerateA(dscenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %08x\n", rc);
- ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %08lx\n", rc);
}
static void test_COM(void) @@ -691,7 +691,7 @@ static void test_COM(void)
hr = DirectSoundCaptureCreate(NULL, &dsc, (IUnknown *)0xdeadbeef); ok(hr == DSERR_NOAGGREGATION,
"DirectSoundCaptureCreate failed: %08x, expected DSERR_NOAGGREGATION\n", hr);
"DirectSoundCaptureCreate failed: %08lx, expected DSERR_NOAGGREGATION\n", hr);
ok(dsc == (IDirectSoundCapture*)0xdeadbeef, "dsc = %p\n", dsc);
hr = DirectSoundCaptureCreate(NULL, &dsc, NULL);
@@ -699,15 +699,15 @@ static void test_COM(void) skip("No driver\n"); return; }
- ok(hr == DS_OK, "DirectSoundCaptureCreate failed: %08x, expected DS_OK\n", hr);
ok(hr == DS_OK, "DirectSoundCaptureCreate failed: %08lx, expected DS_OK\n", hr);
/* Different refcount for IDirectSoundCapture and for IUnknown */ refcount = IDirectSoundCapture_AddRef(dsc);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); hr = IDirectSoundCapture_QueryInterface(dsc, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); refcount = IUnknown_AddRef(unk);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); IUnknown_Release(unk); IUnknown_Release(unk); IDirectSoundCapture_Release(dsc);
@@ -725,37 +725,37 @@ static void test_COM(void) hr = IDirectSoundCapture_CreateCaptureBuffer(dsc, &bufdesc, &buffer, (IUnknown*)0xdeadbeef); } ok(hr == DSERR_NOAGGREGATION,
"IDirectSoundCapture_CreateCaptureBuffer failed: %08x, expected DSERR_NOAGGREGATION\n", hr);
"IDirectSoundCapture_CreateCaptureBuffer failed: %08lx, expected DSERR_NOAGGREGATION\n", hr);
ok(buffer == (IDirectSoundCaptureBuffer*)0xdeadbeef || !buffer /* Win2k without DirectX9 */, "buffer = %p\n", buffer);
hr = IDirectSoundCapture_CreateCaptureBuffer(dsc, &bufdesc, &buffer, NULL);
- ok(hr == DS_OK, "IDirectSoundCapture_CreateCaptureBuffer failed: %08x, expected DS_OK\n", hr);
ok(hr == DS_OK, "IDirectSoundCapture_CreateCaptureBuffer failed: %08lx, expected DS_OK\n", hr);
/* IDirectSoundCaptureBuffer and IDirectSoundNotify have separate refcounts */ IDirectSoundCaptureBuffer_AddRef(buffer); refcount = IDirectSoundCaptureBuffer_AddRef(buffer);
- ok(refcount == 3, "IDirectSoundCaptureBuffer refcount is %u, expected 3\n", refcount);
- ok(refcount == 3, "IDirectSoundCaptureBuffer refcount is %lu, expected 3\n", refcount); hr = IDirectSoundCaptureBuffer_QueryInterface(buffer, &IID_IDirectSoundNotify, (void**)¬ify);
- ok(hr == DS_OK, "IDirectSoundCapture_QueryInterface failed: %08x, expected DS_OK\n", hr);
- ok(hr == DS_OK, "IDirectSoundCapture_QueryInterface failed: %08lx, expected DS_OK\n", hr); refcount = IDirectSoundNotify_AddRef(notify);
- ok(refcount == 2, "IDirectSoundNotify refcount is %u, expected 2\n", refcount);
- ok(refcount == 2, "IDirectSoundNotify refcount is %lu, expected 2\n", refcount); IDirectSoundCaptureBuffer_AddRef(buffer); refcount = IDirectSoundCaptureBuffer_Release(buffer);
- ok(refcount == 3, "IDirectSoundCaptureBuffer refcount is %u, expected 3\n", refcount);
ok(refcount == 3, "IDirectSoundCaptureBuffer refcount is %lu, expected 3\n", refcount);
/* Release IDirectSoundCaptureBuffer while keeping IDirectSoundNotify alive */ while (IDirectSoundCaptureBuffer_Release(buffer) > 0); refcount = IDirectSoundNotify_AddRef(notify);
- ok(refcount == 3, "IDirectSoundNotify refcount is %u, expected 3\n", refcount);
- ok(refcount == 3, "IDirectSoundNotify refcount is %lu, expected 3\n", refcount); refcount = IDirectSoundCaptureBuffer_AddRef(buffer);
- ok(refcount == 1, "IDirectSoundCaptureBuffer refcount is %u, expected 1\n", refcount);
ok(refcount == 1, "IDirectSoundCaptureBuffer refcount is %lu, expected 1\n", refcount);
while (IDirectSoundNotify_Release(notify) > 0); refcount = IDirectSoundCaptureBuffer_Release(buffer);
- ok(refcount == 0, "IDirectSoundCaptureBuffer refcount is %u, expected 0\n", refcount);
- ok(refcount == 0, "IDirectSoundCaptureBuffer refcount is %lu, expected 0\n", refcount); refcount = IDirectSoundCapture_Release(dsc);
- ok(refcount == 0, "IDirectSoundCapture refcount is %u, expected 0\n", refcount);
- ok(refcount == 0, "IDirectSoundCapture refcount is %lu, expected 0\n", refcount);
}
START_TEST(capture) diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index a6b31641d4a..577c4155e9f 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -197,10 +197,10 @@ static int buffer_refill(play_state_t* state, DWORD size) /* some broken apps like Navyfield mistakenly pass NULL for a ppValue */ rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size, &ptr1,NULL,&ptr2,&len2,0);
- ok(rc==DSERR_INVALIDPARAM,"expected %08x got %08x\n",DSERR_INVALIDPARAM, rc);
- ok(rc==DSERR_INVALIDPARAM,"expected %08lx got %08lx\n",DSERR_INVALIDPARAM, rc); rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size, &ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1;
@@ -213,9 +213,9 @@ static int buffer_refill(play_state_t* state, DWORD size) state->offset=state->written % state->buffer_size; /* some apps blindly pass &ptr1 instead of ptr1 */ rc=IDirectSoundBuffer_Unlock(state->dsbo,&ptr1,len1,ptr2,len2);
- ok(rc==DSERR_INVALIDPARAM, "IDDirectSoundBuffer_Unlock(): expected %08x got %08x, %p %p\n",DSERR_INVALIDPARAM, rc, &ptr1, ptr1);
- ok(rc==DSERR_INVALIDPARAM, "IDDirectSoundBuffer_Unlock(): expected %08lx got %08lx, %p %p\n",DSERR_INVALIDPARAM, rc, &ptr1, ptr1); rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1; return size;
@@ -230,7 +230,7 @@ static int buffer_silence(play_state_t* state, DWORD size)
rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size, &ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1;
@@ -241,7 +241,7 @@ static int buffer_silence(play_state_t* state, DWORD size) } state->offset=(state->offset+size) % state->buffer_size; rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1; return size;
@@ -253,7 +253,7 @@ static BOOL buffer_service(play_state_t* state) HRESULT rc;
rc=IDirectSoundBuffer_GetCurrentPosition(state->dsbo,&play_pos,NULL);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %08lx\n", rc); if (rc!=DS_OK) { goto STOP; }
@@ -266,7 +266,7 @@ static BOOL buffer_service(play_state_t* state) state->played+=play_pos-last_play_pos;
if (winetest_debug > 1)
trace("buf size=%d last_play_pos=%d play_pos=%d played=%d / %d\n",
trace("buf size=%ld last_play_pos=%ld play_pos=%ld played=%ld / %ld\n", state->buffer_size,last_play_pos,play_pos,state->played, state->wave_len);
@@ -283,7 +283,7 @@ static BOOL buffer_service(play_state_t* state) buf_free=state->buffer_size-state->offset+play_pos;
if (winetest_debug > 1)
trace("offset=%d free=%d written=%d / %d\n",
if (buf_free==0) return TRUE;trace("offset=%ld free=%ld written=%ld / %ld\n", state->offset,buf_free,state->written,state->wave_len);
@@ -295,14 +295,14 @@ static BOOL buffer_service(play_state_t* state) goto STOP; buf_free-=w; if (state->written==state->wave_len && winetest_debug > 1)
trace("last sound byte at %d\n",
trace("last sound byte at %ld\n", (state->written % state->buffer_size));
}
if (buf_free>0) { /* Fill with silence */ if (winetest_debug > 1)
trace("writing %d bytes of silence\n",buf_free);
}trace("writing %ld bytes of silence\n",buf_free); if (buffer_silence(state,buf_free)==-1) goto STOP;
@@ -312,7 +312,7 @@ STOP: if (winetest_debug > 1) trace("stopping playback\n"); rc=IDirectSoundBuffer_Stop(state->dsbo);
- ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %08lx\n", rc); return FALSE;
}
@@ -333,7 +333,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, if (set_frequency) { rc=IDirectSoundBuffer_SetFrequency(*dsbo,frequency); ok(rc==DS_OK||rc==DSERR_CONTROLUNAVAIL,
"IDirectSoundBuffer_SetFrequency() failed to set frequency %08x\n",rc);
}"IDirectSoundBuffer_SetFrequency() failed to set frequency %08lx\n",rc); if (rc!=DS_OK) return;
@@ -341,20 +341,20 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, /* DSOUND: Error: Invalid caps pointer */ rc=IDirectSoundBuffer_GetCaps(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
ZeroMemory(&dsbcaps, sizeof(dsbcaps));
/* DSOUND: Error: Invalid caps pointer */ rc=IDirectSoundBuffer_GetCaps(*dsbo,&dsbcaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
dsbcaps.dwSize=sizeof(dsbcaps); rc=IDirectSoundBuffer_GetCaps(*dsbo,&dsbcaps);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
trace(" Caps: flags=0x%08x size=%d\n",dsbcaps.dwFlags,
}trace(" Caps: flags=0x%08lx size=%ld\n",dsbcaps.dwFlags, dsbcaps.dwBufferBytes);
@@ -362,10 +362,10 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, size=0; rc=IDirectSoundBuffer_GetFormat(*dsbo,NULL,0,&size); ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have "
"returned the needed size: rc=%08x size=%d\n",rc,size);
"returned the needed size: rc=%08lx size=%ld\n",rc,size);
ok(size == sizeof(WAVEFORMATEX) || size == sizeof(WAVEFORMATEXTENSIBLE),
"Expected a correct structure size, got %d\n", size);
"Expected a correct structure size, got %ld\n", size);
if (size == sizeof(WAVEFORMATEX)) { rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,size,NULL);
@@ -380,9 +380,9 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, return;
ok(rc==DS_OK,
"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
if (rc==DS_OK && winetest_debug > 1) {"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc);
trace(" Format: %s tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace(" Format: %s tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", is_primary ? "Primary" : "Secondary", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign);
@@ -391,45 +391,45 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, /* DSOUND: Error: Invalid frequency buffer */ rc=IDirectSoundBuffer_GetFrequency(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetFrequency() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* DSOUND: Error: Primary buffers don't support CTRLFREQUENCY */ rc=IDirectSoundBuffer_GetFrequency(*dsbo,&freq); ok((rc==DS_OK && !is_primary) || (rc==DSERR_CONTROLUNAVAIL&&is_primary) || (rc==DSERR_CONTROLUNAVAIL&&!(dsbcaps.dwFlags&DSBCAPS_CTRLFREQUENCY)),
"IDirectSoundBuffer_GetFrequency() failed: %08x\n",rc);
if (rc==DS_OK) { DWORD f = set_frequency?frequency:wfx.nSamplesPerSec; ok(freq==f,"The frequency returned by GetFrequency ""IDirectSoundBuffer_GetFrequency() failed: %08lx\n",rc);
"%d does not match the format %d\n",freq,f);
"%ld does not match the format %ld\n",freq,f);
}
/* DSOUND: Error: Invalid status pointer */ rc=IDirectSoundBuffer_GetStatus(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetStatus() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
rc=IDirectSoundBuffer_GetStatus(*dsbo,&status);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08x\n", rc);
- ok(status==0,"status=0x%x instead of 0\n",status);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08lx\n", rc);
ok(status==0,"status=0x%lx instead of 0\n",status);
if (is_primary) { DSBCAPS new_dsbcaps; /* We must call SetCooperativeLevel to be allowed to call SetFormat */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) return; /* DSOUND: Error: Invalid format pointer */ rc=IDirectSoundBuffer_SetFormat(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_SetFormat() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc); init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2); rc=IDirectSoundBuffer_SetFormat(*dsbo,&wfx2);
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08x\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08lx\n", format_string(&wfx2), rc); /* There is no guarantee that SetFormat will actually change the
@@ -437,16 +437,16 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, * supports. So we must re-query the format. */ rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,sizeof(wfx),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && (wfx.wFormatTag!=wfx2.wFormatTag || wfx.nSamplesPerSec!=wfx2.nSamplesPerSec || wfx.wBitsPerSample!=wfx2.wBitsPerSample || wfx.nChannels!=wfx2.nChannels)) {
trace("Requested format tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Requested format tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx2.wFormatTag,wfx2.nSamplesPerSec,wfx2.wBitsPerSample, wfx2.nChannels,wfx2.nAvgBytesPerSec,wfx2.nBlockAlign);
trace("Got tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Got tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign); }
@@ -454,29 +454,29 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, ZeroMemory(&new_dsbcaps, sizeof(new_dsbcaps)); new_dsbcaps.dwSize = sizeof(new_dsbcaps); rc=IDirectSoundBuffer_GetCaps(*dsbo,&new_dsbcaps);
ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
trace(" new Caps: flags=0x%08x size=%d\n",new_dsbcaps.dwFlags,
trace(" new Caps: flags=0x%08lx size=%ld\n",new_dsbcaps.dwFlags, new_dsbcaps.dwBufferBytes); } /* Check for primary buffer size change */ ok(new_dsbcaps.dwBufferBytes == dsbcaps.dwBufferBytes, " buffer size changed after SetFormat() - "
"previous size was %u, current size is %u\n",
"previous size was %lu, current size is %lu\n", dsbcaps.dwBufferBytes, new_dsbcaps.dwBufferBytes); dsbcaps.dwBufferBytes = new_dsbcaps.dwBufferBytes; /* Check for primary buffer flags change */ ok(new_dsbcaps.dwFlags == dsbcaps.dwFlags, " flags changed after SetFormat() - "
"previous flags were %08x, current flags are %08x\n",
"previous flags were %08lx, current flags are %08lx\n", dsbcaps.dwFlags, new_dsbcaps.dwFlags); /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n",rc);
}
if (play) {
@@ -490,12 +490,12 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
if (winetest_interactive) { if (set_frequency)
trace(" Playing %g second 440Hz tone at %dx%dx%d with a "
"frequency of %d (%dHz)\n", duration,
trace(" Playing %g second 440Hz tone at %ldx%dx%d with a "
"frequency of %ld (%ldHz)\n", duration, wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels, frequency, (440 * frequency) / wfx.nSamplesPerSec); else
trace(" Playing %g second 440Hz tone at %dx%dx%d\n", duration,
trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration, wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels); }
@@ -506,7 +506,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(), DSSCL_WRITEPRIMARY); ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_WRITEPRIMARY) "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (rc!=DS_OK) return; }
@@ -515,7 +515,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
rc=IDirectSoundBuffer_QueryInterface(*dsbo,&IID_IDirectSound3DBuffer, (LPVOID *)&buffer);
ok(rc==DS_OK,"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); if (rc!=DS_OK) return;
@@ -523,7 +523,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSoundBuffer_QueryInterface(*dsbo, &IID_IDirectSoundBuffer, (LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==*dsbo,"COM interface broken: %p != %p\n", temp_buffer,*dsbo); ref=IDirectSoundBuffer_Release(temp_buffer);
@@ -538,37 +538,37 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, &IID_IDirectSoundBuffer, (LPVOID *)dsbo); ok(rc==DS_OK && *dsbo!=NULL,"IDirectSound3DBuffer_QueryInterface() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DBuffer_GetAllParameters(buffer,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); ZeroMemory(&buffer_param, sizeof(buffer_param)); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param); ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); buffer_param.dwSize=sizeof(buffer_param); rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param);
ok(rc==DS_OK,"IDirectSound3DBuffer_GetAllParameters() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3DBuffer_GetAllParameters() failed: %08lx\n", rc); } if (set_volume) { if (dsbcaps.dwFlags & DSBCAPS_CTRLVOLUME) { LONG val; rc=IDirectSoundBuffer_GetVolume(*dsbo,&val);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08lx\n", rc); rc=IDirectSoundBuffer_SetVolume(*dsbo,volume);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume() failed: %08lx\n", rc); } else { /* DSOUND: Error: Buffer does not have CTRLVOLUME */ rc=IDirectSoundBuffer_GetVolume(*dsbo,&volume); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetVolume() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); } }
@@ -576,15 +576,15 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, if (dsbcaps.dwFlags & DSBCAPS_CTRLPAN) { LONG val; rc=IDirectSoundBuffer_GetPan(*dsbo,&val);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed: %08lx\n", rc); rc=IDirectSoundBuffer_SetPan(*dsbo,pan);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed: %08lx\n", rc); } else { /* DSOUND: Error: Buffer does not have CTRLPAN */ rc=IDirectSoundBuffer_GetPan(*dsbo,&pan); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetPan() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); } }
@@ -593,14 +593,14 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, &length1, NULL, NULL, DSBLOCK_ENTIREBUFFER); ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); /* try a size larger than the buffer */ rc = IDirectSoundBuffer_Lock(*dsbo, 0, dsbcaps.dwBufferBytes + 1, &buffer1, &length1, NULL, NULL, DSBLOCK_FROMWRITECURSOR); ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); if (set_frequency) state.wave=wave_generate_la(&wfx,(duration*frequency)/wfx.nSamplesPerSec,&state.wave_len,ieee);
@@ -614,12 +614,12 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, buffer_refill(&state,state.buffer_size);
rc=IDirectSoundBuffer_Play(*dsbo,0,0,DSBPLAY_LOOPING);
ok(rc==DS_OK,"IDirectSoundBuffer_Play() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_Play() failed: %08lx\n", rc); rc=IDirectSoundBuffer_GetStatus(*dsbo,&status);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08lx\n", rc); ok(status==(DSBSTATUS_PLAYING|DSBSTATUS_LOOPING),
"GetStatus: bad status: %x\n",status);
"GetStatus: bad status: %lx\n",status); if (listener) { ZeroMemory(&listener_param,sizeof(listener_param));
@@ -627,7 +627,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSound3DListener_GetAllParameters(listener, &listener_param); ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (move_listener) { listener_param.vPosition.x = -5.0f; listener_param.vVelocity.x = (float)(10.0/duration);
@@ -635,7 +635,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSound3DListener_SetAllParameters(listener, &listener_param, DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08lx\n", rc); } if (buffer3d) { if (move_sound) {
@@ -645,7 +645,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, buffer_param.flMinDistance = 10; rc=IDirectSound3DBuffer_SetAllParameters(buffer,&buffer_param, DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08lx\n", rc); } start_time=GetTickCount();
@@ -659,7 +659,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSound3DListener_SetPosition(listener, listener_param.vPosition.x,listener_param.vPosition.y, listener_param.vPosition.z,DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08lx\n",rc); } if (buffer3d && move_sound) { buffer_param.vPosition.x = (float)(100-200.0*(now-start_time)/1000/duration);
@@ -668,13 +668,13 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, rc=IDirectSound3DBuffer_SetPosition(buffer, buffer_param.vPosition.x,buffer_param.vPosition.y, buffer_param.vPosition.z,DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08lx\n", rc); } } /* Check the sound duration was within 10% of the expected value */ now=GetTickCount(); ok(fabs(1000*duration-now+start_time)<=100*duration,
"The sound played for %d ms instead of %g ms\n",
"The sound played for %ld ms instead of %g ms\n", now-start_time,1000*duration); HeapFree(GetProcessHeap(), 0, state.wave);
@@ -683,7 +683,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL); ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); } if (buffer3d) { ref=IDirectSound3DBuffer_Release(buffer);
@@ -708,14 +708,14 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -728,12 +728,12 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a %sprimary buffer: %08x\n",has_3d?"3D ":"", rc);
if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) { rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);"IDirectSound_CreateSoundBuffer() failed to create a %sprimary buffer: %08lx\n",has_3d?"3D ":"", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT1;
@@ -742,7 +742,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, &IID_IDirectSound3DListener, (void **)&listener); ok(rc==DS_OK && listener!=NULL,
"IDirectSoundBuffer_QueryInterface() failed to get a 3D listener: %08x\n",rc);
"IDirectSoundBuffer_QueryInterface() failed to get a 3D listener: %08lx\n",rc); ref=IDirectSoundBuffer_Release(primary); ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, " "should have 0\n",ref);
@@ -753,20 +753,20 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, rc=IDirectSound3DListener_GetAllParameters(listener,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DListener_GetAllParameters(listener, &listener_param); ok(rc==DSERR_INVALIDPARAM, "IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); listener_param.dwSize=sizeof(listener_param); rc=IDirectSound3DListener_GetAllParameters(listener, &listener_param); ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); } else { ok(listener==NULL, "IDirectSoundBuffer_QueryInterface() " "failed but returned a listener anyway\n");
@@ -793,8 +793,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, wfx.nBlockAlign); bufdesc.lpwfxFormat=&wfx; if (winetest_interactive) {
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %dx%dx%d "
"with a primary buffer at %dx%dx%d\n",
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"",
@@ -807,7 +807,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, } rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok((rc==DS_OK && secondary!=NULL) || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */
"IDirectSound_CreateSoundBuffer() failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %08x\n",
"IDirectSound_CreateSoundBuffer() failed to create a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d (%s): %08lx\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"", move_listener?"moving ":"", listener!=NULL?"listener ":"",
@@ -820,7 +820,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
rc=IDirectSoundBuffer_QueryInterface(secondary, &IID_IDirectSound3DBuffer, (void**)&ds3d); ok((has_3dbuffer && rc==DS_OK) || (!has_3dbuffer && rc==E_NOINTERFACE),
"Wrong return trying to get 3D buffer on %s3D secondary interface: %08x\n", has_3dbuffer ? "" : "non-", rc);
"Wrong return trying to get 3D buffer on %s3D secondary interface: %08lx\n", has_3dbuffer ? "" : "non-", rc); if(rc==DS_OK) IDirectSound3DBuffer_Release(ds3d);
@@ -829,53 +829,53 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
/* Check the initial secondary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(secondary) failed: %08x\n",rc);
ok(vol==0,"wrong volume for a new secondary buffer: %d\n",vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(secondary) failed: %08lx\n",rc);
ok(vol==0,"wrong volume for a new secondary buffer: %ld\n",vol); rc=IDirectSoundBuffer_GetPan(secondary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08x\n",rc);
ok(pan==0,"wrong pan for a new secondary buffer: %d\n",pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08lx\n",rc);
ok(pan==0,"wrong pan for a new secondary buffer: %ld\n",pan); /* Check that changing the secondary buffer's volume and pan * does not impact the primary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(primary,&refvol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetPan(primary,&refpan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08lx\n", rc); rc=IDirectSoundBuffer_SetVolume(secondary,-1000);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(vol==-1000,"secondary: wrong volume %d instead of -1000\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc);
ok(vol==-1000,"secondary: wrong volume %ld instead of -1000\n", vol); rc=IDirectSoundBuffer_SetPan(secondary,-1000);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetPan(secondary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08x\n",rc);
ok(pan==-1000,"secondary: wrong pan %d instead of -1000\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08lx\n",rc);
ok(pan==-1000,"secondary: wrong pan %ld instead of -1000\n", pan); rc=IDirectSoundBuffer_GetVolume(primary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08x\n",rc);
ok(vol==refvol,"The primary volume changed from %d to %d\n",
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08lx\n",rc);
ok(vol==refvol,"The primary volume changed from %ld to %ld\n", refvol,vol); rc=IDirectSoundBuffer_GetPan(primary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08x\n", rc);
ok(pan==refpan,"The primary pan changed from %d to %d\n",
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08lx\n", rc);
ok(pan==refpan,"The primary pan changed from %ld to %ld\n", refpan,pan); rc=IDirectSoundBuffer_SetVolume(secondary,0);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_SetPan(secondary,0);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08lx\n",rc); } else if (has_3dbuffer) { LONG pan; rc=IDirectSoundBuffer_GetPan(secondary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed, returned: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed, returned: %08lx\n", rc); rc=IDirectSoundBuffer_SetPan(secondary,0);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed, returned: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed, returned: %08lx\n", rc); } if (has_duplicate) {
@@ -885,26 +885,26 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, rc=IDirectSound_DuplicateSoundBuffer(dso,0,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); /* DSOUND: Error: Invalid dest buffer */ rc=IDirectSound_DuplicateSoundBuffer(dso,secondary,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); /* DSOUND: Error: Invalid source buffer */ rc=IDirectSound_DuplicateSoundBuffer(dso,0,&duplicated); ok(rc==DSERR_INVALIDPARAM, "IDirectSound_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); duplicated=NULL; rc=IDirectSound_DuplicateSoundBuffer(dso,secondary, &duplicated); ok(rc==DS_OK && duplicated!=NULL, "IDirectSound_DuplicateSoundBuffer() failed to duplicate "
"a secondary buffer: %08x\n",rc);
"a secondary buffer: %08lx\n",rc); if (rc==DS_OK && duplicated!=NULL) { ref=IDirectSoundBuffer_Release(secondary);
@@ -951,7 +951,7 @@ EXIT2: /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -971,7 +971,7 @@ static HRESULT test_for_driver(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -994,7 +994,7 @@ static HRESULT test_primary(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -1002,14 +1002,14 @@ static HRESULT test_primary(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -1020,7 +1020,7 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08x\n",rc);
if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) {"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08lx\n",rc);
@@ -1055,7 +1055,7 @@ static HRESULT test_primary(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -1077,7 +1077,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -1085,14 +1085,14 @@ static HRESULT test_primary_3d(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -1102,7 +1102,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed "
"to create a primary buffer: %08x\n",rc);
if (rc==DS_OK && primary!=NULL) { ref=IDirectSoundBuffer_Release(primary); ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, ""to create a primary buffer: %08lx\n",rc);
@@ -1113,7 +1113,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() "
"failed to create a 3D primary buffer: %08x\n",rc);
"failed to create a 3D primary buffer: %08lx\n",rc); if (rc==DS_OK && primary!=NULL) { test_buffer(dso,&primary,1,FALSE,0,FALSE,0,winetest_interactive && !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,0,0,0,
@@ -1126,7 +1126,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -1148,7 +1148,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -1156,14 +1156,14 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT; primary=NULL;
@@ -1172,7 +1172,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed "
"to create a 3D primary buffer: %08x\n",rc);
if (rc==DS_OK && primary!=NULL) { LPDIRECTSOUND3DLISTENER listener=NULL; LPDIRECTSOUNDBUFFER temp_buffer=NULL;"to create a 3D primary buffer: %08lx\n",rc);
@@ -1181,13 +1181,13 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSound3DListener,(void **)&listener); ok(rc==DS_OK && listener!=NULL,"IDirectSoundBuffer_QueryInterface() "
"failed to get a 3D listener: %08x\n",rc);
"failed to get a 3D listener: %08lx\n",rc); if (rc==DS_OK && listener!=NULL) { /* Checking the COM interface */ rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundBuffer,(LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==primary, "COM interface broken: %p != %p\n", temp_buffer,primary);
@@ -1200,7 +1200,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) rc=IDirectSound3DListener_QueryInterface(listener, &IID_IDirectSoundBuffer,(LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==primary, "COM interface broken: %p != %p\n", temp_buffer,primary);
@@ -1218,7 +1218,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) rc = IDirectSound3DListener_QueryInterface(listener, &IID_IKsPropertySet, (void **)&propset); ok(rc == DS_OK && propset != NULL,
"IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08x\n", rc);
"IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08lx\n", rc); IKsPropertySet_Release(propset); }
@@ -1231,7 +1231,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) propset = NULL; rc = IDirectSoundBuffer_QueryInterface(primary, &IID_IKsPropertySet, (void **)&propset); ok(rc == DS_OK && propset != NULL,
"IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08x\n", rc);
"IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08lx\n", rc); IKsPropertySet_Release(propset); /* Testing the reference counting */
@@ -1302,7 +1302,7 @@ static void ds3d_tests(void) { HRESULT rc; rc = DirectSoundEnumerateA(dsenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08lx\n",rc); trace("tested %u DirectSound drivers\n", driver_count);
}
diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c index 465ba040a33..9c4a132b545 100644 --- a/dlls/dsound/tests/ds3d8.c +++ b/dlls/dsound/tests/ds3d8.c @@ -57,7 +57,7 @@ static int buffer_refill8(play_state_t* state, DWORD size)
rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size, &ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1;
@@ -69,7 +69,7 @@ static int buffer_refill8(play_state_t* state, DWORD size) } state->offset=state->written % state->buffer_size; rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1; return size;
@@ -84,7 +84,7 @@ static int buffer_silence8(play_state_t* state, DWORD size)
rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size, &ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1;
@@ -95,7 +95,7 @@ static int buffer_silence8(play_state_t* state, DWORD size) } state->offset=(state->offset+size) % state->buffer_size; rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %08lx\n", rc); if (rc!=DS_OK) return -1; return size;
@@ -107,7 +107,7 @@ static BOOL buffer_service8(play_state_t* state) HRESULT rc;
rc=IDirectSoundBuffer_GetCurrentPosition(state->dsbo,&play_pos,NULL);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %08lx\n", rc); if (rc!=DS_OK) { goto STOP; }
@@ -120,7 +120,7 @@ static BOOL buffer_service8(play_state_t* state) state->played+=play_pos-last_play_pos;
if (winetest_debug > 1)
trace("buf size=%d last_play_pos=%d play_pos=%d played=%d / %d\n",
trace("buf size=%ld last_play_pos=%ld play_pos=%ld played=%ld / %ld\n", state->buffer_size,last_play_pos,play_pos,state->played, state->wave_len);
@@ -137,7 +137,7 @@ static BOOL buffer_service8(play_state_t* state) buf_free=state->buffer_size-state->offset+play_pos;
if (winetest_debug > 1)
trace("offset=%d free=%d written=%d / %d\n",
if (buf_free==0) return TRUE;trace("offset=%ld free=%ld written=%ld / %ld\n", state->offset,buf_free,state->written,state->wave_len);
@@ -149,14 +149,14 @@ static BOOL buffer_service8(play_state_t* state) goto STOP; buf_free-=w; if (state->written==state->wave_len && winetest_debug > 1)
trace("last sound byte at %d\n",
trace("last sound byte at %ld\n", (state->written % state->buffer_size));
}
if (buf_free>0) { /* Fill with silence */ if (winetest_debug > 1)
trace("writing %d bytes of silence\n",buf_free);
}trace("writing %ld bytes of silence\n",buf_free); if (buffer_silence8(state,buf_free)==-1) goto STOP;
@@ -166,7 +166,7 @@ STOP: if (winetest_debug > 1) trace("stopping playback\n"); rc=IDirectSoundBuffer_Stop(state->dsbo);
- ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %08lx\n", rc); return FALSE;
}
@@ -186,20 +186,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, /* DSOUND: Error: Invalid caps pointer */ rc=IDirectSoundBuffer_GetCaps(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
ZeroMemory(&dsbcaps, sizeof(dsbcaps));
/* DSOUND: Error: Invalid caps pointer */ rc=IDirectSoundBuffer_GetCaps(*dsbo,&dsbcaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
dsbcaps.dwSize=sizeof(dsbcaps); rc=IDirectSoundBuffer_GetCaps(*dsbo,&dsbcaps);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
trace(" Caps: flags=0x%08x size=%d\n",dsbcaps.dwFlags,
}trace(" Caps: flags=0x%08lx size=%ld\n",dsbcaps.dwFlags, dsbcaps.dwBufferBytes);
@@ -207,10 +207,10 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, size=0; rc=IDirectSoundBuffer_GetFormat(*dsbo,NULL,0,&size); ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have "
"returned the needed size: rc=%08x size=%d\n",rc,size);
"returned the needed size: rc=%08lx size=%ld\n",rc,size);
ok(size == sizeof(WAVEFORMATEX) || size == sizeof(WAVEFORMATEXTENSIBLE),
"Expected a correct structure size, got %d\n", size);
"Expected a correct structure size, got %ld\n", size);
if (size == sizeof(WAVEFORMATEX)) { rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,size,NULL);
@@ -223,9 +223,9 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, } else return;
- ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
trace(" Format: %s tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace(" Format: %s tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", is_primary ? "Primary" : "Secondary", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign);
@@ -234,26 +234,26 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, /* DSOUND: Error: Invalid frequency buffer */ rc=IDirectSoundBuffer_GetFrequency(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetFrequency() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* DSOUND: Error: Primary buffers don't support CTRLFREQUENCY */ rc=IDirectSoundBuffer_GetFrequency(*dsbo,&freq); ok((rc==DS_OK && !is_primary) || (rc==DSERR_CONTROLUNAVAIL&&is_primary) || (rc==DSERR_CONTROLUNAVAIL&&!(dsbcaps.dwFlags&DSBCAPS_CTRLFREQUENCY)),
"IDirectSoundBuffer_GetFrequency() failed: %08x\n",rc);
if (rc==DS_OK) { ok(freq==wfx.nSamplesPerSec,"The frequency returned by GetFrequency ""IDirectSoundBuffer_GetFrequency() failed: %08lx\n",rc);
"%d does not match the format %d\n",freq,wfx.nSamplesPerSec);
"%ld does not match the format %ld\n",freq,wfx.nSamplesPerSec);
}
/* DSOUND: Error: Invalid status pointer */ rc=IDirectSoundBuffer_GetStatus(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetStatus() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
rc=IDirectSoundBuffer_GetStatus(*dsbo,&status);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08x\n", rc);
- ok(status==0,"status=0x%x instead of 0\n",status);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08lx\n", rc);
ok(status==0,"status=0x%lx instead of 0\n",status);
if (is_primary) { DSBCAPS new_dsbcaps;
@@ -261,18 +261,18 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY); ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (rc!=DS_OK) return; /* DSOUND: Error: Invalid format pointer */ rc=IDirectSoundBuffer_SetFormat(*dsbo,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_SetFormat() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc); init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2); rc=IDirectSoundBuffer_SetFormat(*dsbo,&wfx2);
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08x\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08lx\n", format_string(&wfx2), rc); /* There is no guarantee that SetFormat will actually change the
@@ -280,16 +280,16 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, * supports. So we must re-query the format. */ rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,sizeof(wfx),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && (wfx.wFormatTag!=wfx2.wFormatTag || wfx.nSamplesPerSec!=wfx2.nSamplesPerSec || wfx.wBitsPerSample!=wfx2.wBitsPerSample || wfx.nChannels!=wfx2.nChannels)) {
trace("Requested format tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Requested format tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx2.wFormatTag,wfx2.nSamplesPerSec,wfx2.wBitsPerSample, wfx2.nChannels,wfx2.nAvgBytesPerSec,wfx2.nBlockAlign);
trace("Got tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Got tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign); }
@@ -297,30 +297,30 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, ZeroMemory(&new_dsbcaps, sizeof(new_dsbcaps)); new_dsbcaps.dwSize = sizeof(new_dsbcaps); rc=IDirectSoundBuffer_GetCaps(*dsbo,&new_dsbcaps);
ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %08lx\n", rc); if (rc==DS_OK && winetest_debug > 1) {
trace(" new Caps: flags=0x%08x size=%d\n",new_dsbcaps.dwFlags,
trace(" new Caps: flags=0x%08lx size=%ld\n",new_dsbcaps.dwFlags, new_dsbcaps.dwBufferBytes); } /* Check for primary buffer size change */ ok(new_dsbcaps.dwBufferBytes == dsbcaps.dwBufferBytes, " buffer size changed after SetFormat() - "
"previous size was %u, current size is %u\n",
"previous size was %lu, current size is %lu\n", dsbcaps.dwBufferBytes, new_dsbcaps.dwBufferBytes); dsbcaps.dwBufferBytes = new_dsbcaps.dwBufferBytes; /* Check for primary buffer flags change */ ok(new_dsbcaps.dwFlags == dsbcaps.dwFlags, " flags changed after SetFormat() - "
"previous flags were %08x, current flags are %08x\n",
"previous flags were %08lx, current flags are %08lx\n", dsbcaps.dwFlags, new_dsbcaps.dwFlags); /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL); ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) "
"failed: %08x\n",rc);
"failed: %08lx\n",rc);
}
if (play) {
@@ -333,7 +333,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, DWORD length1;
if (winetest_interactive) {
trace(" Playing %g second 440Hz tone at %dx%dx%d\n", duration,
trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration, wfx.nSamplesPerSec, wfx.wBitsPerSample,wfx.nChannels); }
@@ -344,7 +344,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(), DSSCL_WRITEPRIMARY); ok(rc==DS_OK,
"IDirectSound8_SetCooperativeLevel(DSSCL_WRITEPRIMARY) failed: %08x\n",rc);
"IDirectSound8_SetCooperativeLevel(DSSCL_WRITEPRIMARY) failed: %08lx\n",rc); if (rc!=DS_OK) return; }
@@ -353,7 +353,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc=IDirectSoundBuffer_QueryInterface(*dsbo,&IID_IDirectSound3DBuffer, (LPVOID *)&buffer);
ok(rc==DS_OK,"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); if (rc!=DS_OK) return;
@@ -361,7 +361,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, rc=IDirectSoundBuffer_QueryInterface(*dsbo, &IID_IDirectSoundBuffer, (LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==*dsbo,"COM interface broken: %p != %p\n", temp_buffer,*dsbo); ref=IDirectSoundBuffer_Release(temp_buffer);
@@ -376,37 +376,37 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, &IID_IDirectSoundBuffer, (LPVOID *)dsbo); ok(rc==DS_OK && *dsbo!=NULL,"IDirectSound3DBuffer_QueryInterface() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DBuffer_GetAllParameters(buffer,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); ZeroMemory(&buffer_param, sizeof(buffer_param)); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param); ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); buffer_param.dwSize=sizeof(buffer_param); rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param);
ok(rc==DS_OK,"IDirectSound3DBuffer_GetAllParameters() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3DBuffer_GetAllParameters() failed: %08lx\n", rc); } if (set_volume) { if (dsbcaps.dwFlags & DSBCAPS_CTRLVOLUME) { LONG val; rc=IDirectSoundBuffer_GetVolume(*dsbo,&val);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08lx\n", rc); rc=IDirectSoundBuffer_SetVolume(*dsbo,volume);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume() failed: %08lx\n", rc); } else { /* DSOUND: Error: Buffer does not have CTRLVOLUME */ rc=IDirectSoundBuffer_GetVolume(*dsbo,&volume); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetVolume() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); } }
@@ -414,15 +414,15 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, if (dsbcaps.dwFlags & DSBCAPS_CTRLPAN) { LONG val; rc=IDirectSoundBuffer_GetPan(*dsbo,&val);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed: %08lx\n", rc); rc=IDirectSoundBuffer_SetPan(*dsbo,pan);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed: %08lx\n", rc); } else { /* DSOUND: Error: Buffer does not have CTRLPAN */ rc=IDirectSoundBuffer_GetPan(*dsbo,&pan); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetPan() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); } }
@@ -431,14 +431,14 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, &length1, NULL, NULL, DSBLOCK_ENTIREBUFFER); ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); /* try a size larger than the buffer */ rc = IDirectSoundBuffer_Lock(*dsbo, 0, dsbcaps.dwBufferBytes + 1, &buffer1, &length1, NULL, NULL, DSBLOCK_FROMWRITECURSOR); ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); state.wave=wave_generate_la(&wfx,duration,&state.wave_len,ieee);
@@ -449,19 +449,19 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, buffer_refill8(&state,state.buffer_size);
rc=IDirectSoundBuffer_Play(*dsbo,0,0,DSBPLAY_LOOPING);
ok(rc==DS_OK,"IDirectSoundBuffer_Play() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_Play() failed: %08lx\n", rc); rc=IDirectSoundBuffer_GetStatus(*dsbo,&status);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %08lx\n", rc); ok(status==(DSBSTATUS_PLAYING|DSBSTATUS_LOOPING),
"GetStatus: bad status: %x\n",status);
"GetStatus: bad status: %lx\n",status); if (listener) { ZeroMemory(&listener_param,sizeof(listener_param)); listener_param.dwSize=sizeof(listener_param); rc=IDirectSound3DListener_GetAllParameters(listener,&listener_param); ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (move_listener) { listener_param.vPosition.x = -5.0f; listener_param.vVelocity.x = (float)(10.0/duration);
@@ -469,7 +469,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, rc=IDirectSound3DListener_SetAllParameters(listener, &listener_param, DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08lx\n", rc); } if (buffer3d) { if (move_sound) {
@@ -479,7 +479,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, buffer_param.flMinDistance = 10; rc=IDirectSound3DBuffer_SetAllParameters(buffer,&buffer_param, DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08lx\n", rc); } start_time=GetTickCount();
@@ -493,7 +493,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, rc=IDirectSound3DListener_SetPosition(listener, listener_param.vPosition.x,listener_param.vPosition.y, listener_param.vPosition.z,DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %08lx\n",rc); } if (buffer3d && move_sound) { buffer_param.vPosition.x = (float)(100-200.0*(now-start_time)/1000/duration);
@@ -502,13 +502,13 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, rc=IDirectSound3DBuffer_SetPosition(buffer, buffer_param.vPosition.x,buffer_param.vPosition.y, buffer_param.vPosition.z,DS3D_IMMEDIATE);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %08lx\n", rc); } } /* Check the sound duration was within 10% of the expected value */ now=GetTickCount(); ok(fabs(1000*duration-now+start_time)<=100*duration,
"The sound played for %d ms instead of %g ms\n",
"The sound played for %ld ms instead of %g ms\n", now-start_time,1000*duration); HeapFree(GetProcessHeap(), 0, state.wave);
@@ -517,7 +517,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL); ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); } if (buffer3d) { ref=IDirectSound3DBuffer_Release(buffer);
@@ -542,14 +542,14 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play,
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -562,12 +562,12 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN); rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
"IDirectSound8_CreateSoundBuffer() failed to create a %sprimary buffer: %08x\n",has_3d?"3D ":"", rc);
if (rc == DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) { rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);"IDirectSound8_CreateSoundBuffer() failed to create a %sprimary buffer: %08lx\n",has_3d?"3D ":"", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT1;
@@ -577,7 +577,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, (void **)&listener); ok(rc==DS_OK && listener!=NULL, "IDirectSoundBuffer_QueryInterface() failed to get a 3D "
"listener %08x\n",rc);
"listener %08lx\n",rc); ref=IDirectSoundBuffer_Release(primary); ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, " "should have 0\n",ref);
@@ -588,20 +588,20 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, rc=IDirectSound3DListener_GetAllParameters(listener,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); /* DSOUND: Error: Invalid buffer */ rc=IDirectSound3DListener_GetAllParameters(listener, &listener_param); ok(rc==DSERR_INVALIDPARAM, "IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); listener_param.dwSize=sizeof(listener_param); rc=IDirectSound3DListener_GetAllParameters(listener, &listener_param); ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); } else { ok(listener==NULL, "IDirectSoundBuffer_QueryInterface() " "failed but returned a listener anyway\n");
@@ -634,7 +634,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_CreateSoundBuffer(secondary) should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); init_format(&wfx,WAVE_FORMAT_PCM,22050,16,1); /* Invalid flag combination */
@@ -642,13 +642,13 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_CreateSoundBuffer(secondary) should have "
"returned DSERR_INVALIDPARAM, returned %08x\n", rc);
"returned DSERR_INVALIDPARAM, returned %08lx\n", rc); bufdesc.dwFlags&=~DSBCAPS_CTRLPAN; } if (winetest_interactive) {
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %dx%dx%d "
"with a primary buffer at %dx%dx%d\n",
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"",
@@ -661,7 +661,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, } rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL,"IDirectSound8_CreateSoundBuffer() "
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %08x\n",
"failed to create a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d (%s): %08lx\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"", move_listener?"moving ":"", listener!=NULL?"listener ":"",
@@ -675,55 +675,55 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play,
/* Check the initial secondary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(secondary) failed: %08x\n",rc);
ok(vol==0,"wrong volume for a new secondary buffer: %d\n",vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(secondary) failed: %08lx\n",rc);
ok(vol==0,"wrong volume for a new secondary buffer: %ld\n",vol); rc=IDirectSoundBuffer_GetPan(secondary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08x\n",rc);
ok(pan==0,"wrong pan for a new secondary buffer: %d\n",pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08lx\n",rc);
ok(pan==0,"wrong pan for a new secondary buffer: %ld\n",pan); /* Check that changing the secondary buffer's volume and pan * does not impact the primary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(primary,&refvol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetPan(primary,&refpan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_SetVolume(secondary,-1000);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(vol==-1000,"secondary: wrong volume %d instead of -1000\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc);
ok(vol==-1000,"secondary: wrong volume %ld instead of -1000\n", vol); rc=IDirectSoundBuffer_SetPan(secondary,-1000);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_GetPan(secondary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08x\n",rc);
ok(pan==-1000,"secondary: wrong pan %d instead of -1000\n",
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: %08lx\n",rc);
ok(pan==-1000,"secondary: wrong pan %ld instead of -1000\n", pan); rc=IDirectSoundBuffer_GetVolume(primary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_`GetVolume(primary) failed: i%08x\n",rc);
ok(vol==refvol,"The primary volume changed from %d to %d\n",
ok(rc==DS_OK,"IDirectSoundBuffer_`GetVolume(primary) failed: i%08lx\n",rc);
ok(vol==refvol,"The primary volume changed from %ld to %ld\n", refvol,vol); rc=IDirectSoundBuffer_GetPan(primary,&pan);
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08x\n",rc);
ok(pan==refpan,"The primary pan changed from %d to %d\n",
ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: %08lx\n",rc);
ok(pan==refpan,"The primary pan changed from %ld to %ld\n", refpan,pan); rc=IDirectSoundBuffer_SetVolume(secondary,0);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: %08lx\n",rc); rc=IDirectSoundBuffer_SetPan(secondary,0);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: %08lx\n",rc); } else { LONG pan; rc=IDirectSoundBuffer_GetPan(secondary,&pan); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetPan() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); rc=IDirectSoundBuffer_SetPan(secondary,0); ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_SetPan() "
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x\n", rc);
"should have returned DSERR_CONTROLUNAVAIL, returned: %08lx\n", rc); } if (has_duplicate) {
@@ -733,26 +733,26 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play, rc=IDirectSound8_DuplicateSoundBuffer(dso,0,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); /* DSOUND: Error: Invalid dest buffer */ rc=IDirectSound8_DuplicateSoundBuffer(dso,secondary,0); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); /* DSOUND: Error: Invalid source buffer */ rc=IDirectSound8_DuplicateSoundBuffer(dso,0,&duplicated); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc); duplicated=NULL; rc=IDirectSound8_DuplicateSoundBuffer(dso,secondary, &duplicated); ok(rc==DS_OK && duplicated!=NULL, "IDirectSound8_DuplicateSoundBuffer() failed to duplicate "
"a secondary buffer: %08x\n",rc);
"a secondary buffer: %08lx\n",rc); if (rc==DS_OK && duplicated!=NULL) { ref=IDirectSoundBuffer_Release(secondary);
@@ -801,7 +801,7 @@ EXIT2: /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n",rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -821,7 +821,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate8() failed: %08lx\n",rc);
@@ -844,7 +844,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -852,14 +852,14 @@ static HRESULT test_primary8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -870,7 +870,7 @@ static HRESULT test_primary8(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
"IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: %08x\n",rc);
if (rc == DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) {"IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: %08lx\n",rc);
@@ -904,7 +904,7 @@ static HRESULT test_primary8(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n",rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -926,7 +926,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -934,14 +934,14 @@ static HRESULT test_primary_3d8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -951,7 +951,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() failed "
"to create a primary buffer: %08x\n",rc);
if (rc==DS_OK && primary!=NULL) { ref=IDirectSoundBuffer_Release(primary); ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, ""to create a primary buffer: %08lx\n",rc);
@@ -962,7 +962,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() "
"failed to create a 3D primary buffer: %08x\n",rc);
"failed to create a 3D primary buffer: %08lx\n",rc); if (rc==DS_OK && primary!=NULL) { test_buffer8(dso,&primary,TRUE,FALSE,0,FALSE,0, winetest_interactive && !(dscaps.dwFlags & DSCAPS_EMULDRIVER),
@@ -975,7 +975,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08lx\n",rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -997,7 +997,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
/* Create the DirectSound object */ 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: %08lx\n", rc); if (rc!=DS_OK) return rc;
@@ -1005,14 +1005,14 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT; primary=NULL;
@@ -1021,14 +1021,14 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() failed "
"to create a 3D primary buffer %08x\n",rc);
if (rc==DS_OK && primary!=NULL) { LPDIRECTSOUND3DLISTENER listener=NULL; rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSound3DListener, (void **)&listener); ok(rc==DS_OK && listener!=NULL,"IDirectSoundBuffer_QueryInterface() ""to create a 3D primary buffer %08lx\n",rc);
"failed to get a 3D listener: %08x\n",rc);
"failed to get a 3D listener: %08lx\n",rc); if (rc==DS_OK && listener!=NULL) { LPDIRECTSOUNDBUFFER temp_buffer=NULL;
@@ -1037,7 +1037,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid) &IID_IDirectSoundBuffer, (LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==primary,"COM interface broken: %p != %p\n",temp_buffer,primary); if (rc==DS_OK && temp_buffer!=NULL) { ref=IDirectSoundBuffer_Release(temp_buffer);
@@ -1048,7 +1048,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid) rc=IDirectSound3DListener_QueryInterface(listener, &IID_IDirectSoundBuffer,(LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface() failed: %08x\n", rc);
"IDirectSoundBuffer_QueryInterface() failed: %08lx\n", rc); ok(temp_buffer==primary,"COM interface broken: %p != %p\n",temp_buffer,primary); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, "
@@ -1134,7 +1134,7 @@ static void ds3d8_tests(void) { HRESULT rc; rc = DirectSoundEnumerateA(dsenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08lx\n",rc); trace("tested %u DirectSound drivers\n", driver_count);
}
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index a4f59efaad9..d5a3ccad8fd 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -54,18 +54,18 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
/* Try to Query for objects */ rc=IDirectSound_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
- ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IUnknown) failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IUnknown) failed: %08lx\n", rc); if (rc==DS_OK) IUnknown_Release(unknown);
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
- ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IDirectSound) failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_QueryInterface(IID_IDirectSound) failed: %08lx\n", rc); if (rc==DS_OK) IDirectSound_Release(ds);
rc=IDirectSound_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8); ok(rc==E_NOINTERFACE,"IDirectSound_QueryInterface(IID_IDirectSound8) "
"should have failed: %08x\n",rc);
if (rc==DS_OK) IDirectSound8_Release(ds8);"should have failed: %08lx\n",rc);
@@ -73,23 +73,23 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized, /* try uninitialized object */ rc=IDirectSound_GetCaps(dso,0); ok(rc==DSERR_UNINITIALIZED,"IDirectSound_GetCaps(NULL) "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound_GetCaps(dso,&dscaps); ok(rc==DSERR_UNINITIALIZED,"IDirectSound_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound_Compact(dso); ok(rc==DSERR_UNINITIALIZED,"IDirectSound_Compact() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound_GetSpeakerConfig(dso,&speaker_config); ok(rc==DSERR_UNINITIALIZED,"IDirectSound_GetSpeakerConfig() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound_Initialize(dso,lpGuid); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"IDirectSound_Initialize() failed: %08x\n",rc);
"IDirectSound_Initialize() failed: %08lx\n",rc); if (rc==DSERR_NODRIVER) { trace(" No Driver\n"); goto EXIT;
@@ -104,41 +104,41 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
rc=IDirectSound_Initialize(dso,lpGuid); ok(rc==DSERR_ALREADYINITIALIZED, "IDirectSound_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %08x\n", rc);
"should have returned DSERR_ALREADYINITIALIZED: %08lx\n", rc);
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSound_GetCaps(dso,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetCaps(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
ZeroMemory(&dscaps, sizeof(dscaps));
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSound_GetCaps(dso,&dscaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
dscaps.dwSize=sizeof(dscaps);
/* DSOUND: Running on a certified driver */ rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc);
rc=IDirectSound_Compact(dso);
- ok(rc==DSERR_PRIOLEVELNEEDED,"IDirectSound_Compact() failed: %08x\n", rc);
ok(rc==DSERR_PRIOLEVELNEEDED,"IDirectSound_Compact() failed: %08lx\n", rc);
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
rc=IDirectSound_Compact(dso);
- ok(rc==DS_OK,"IDirectSound_Compact() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_Compact() failed: %08lx\n",rc);
rc=IDirectSound_GetSpeakerConfig(dso,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetSpeakerConfig(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
rc=IDirectSound_GetSpeakerConfig(dso,&speaker_config);
- ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08lx\n", rc); ref_speaker_config = speaker_config;
speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO,
@@ -148,14 +148,14 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized, DSSPEAKER_GEOMETRY_NARROW); if(rc==DS_OK) { rc=IDirectSound_SetSpeakerConfig(dso,speaker_config);
ok(rc==DS_OK,"IDirectSound_SetSpeakerConfig() failed: %08x\n", rc);
} if (rc==DS_OK) { rc=IDirectSound_GetSpeakerConfig(dso,&new_speaker_config);ok(rc==DS_OK,"IDirectSound_SetSpeakerConfig() failed: %08lx\n", rc);
ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08lx\n", rc); if (rc==DS_OK && speaker_config!=new_speaker_config && ref_speaker_config!=new_speaker_config) trace("IDirectSound_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08x or 0x%08x, got 0x%08x\n",
}"config: expected 0x%08lx or 0x%08lx, got 0x%08lx\n", speaker_config,ref_speaker_config,new_speaker_config); IDirectSound_SetSpeakerConfig(dso,ref_speaker_config);
@@ -176,23 +176,23 @@ static void IDirectSound_tests(void) rc=CoGetClassObject(&CLSID_DirectSound, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
rc=CoGetClassObject(&CLSID_DirectSound, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound, IID_IUnknown) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
/* COM aggregation */ rc=CoCreateInstance(&CLSID_DirectSound, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso); ok(rc==CLASS_E_NOAGGREGATION || broken(rc==DSERR_INVALIDPARAM),
"DirectMusicPerformance create failed: %08x, expected CLASS_E_NOAGGREGATION\n", rc);
"DirectMusicPerformance create failed: %08lx, expected CLASS_E_NOAGGREGATION\n", rc);
/* try the COM class factory method of creation with no device specified */ rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", rc); if (dso) IDirectSound_test(dso, FALSE, NULL);
@@ -200,7 +200,7 @@ static void IDirectSound_tests(void) * device specified */ rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", rc); if (dso) IDirectSound_test(dso, FALSE, &DSDEVID_DefaultPlayback);
@@ -208,7 +208,7 @@ static void IDirectSound_tests(void) * playback device specified */ rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", rc); if (dso) IDirectSound_test(dso, FALSE, &DSDEVID_DefaultVoicePlayback);
@@ -218,7 +218,7 @@ static void IDirectSound_tests(void) &CLSID_DirectSoundPrivate, (void**)&dso); ok(rc==E_NOINTERFACE, "CoCreateInstance(CLSID_DirectSound,CLSID_DirectSoundPrivate) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
/* try the COM class factory method of creation with a bad * GUID and IID specified */
@@ -226,33 +226,33 @@ static void IDirectSound_tests(void) &IID_IDirectSound, (void**)&dso); ok(rc==REGDB_E_CLASSNOTREG, "CoCreateInstance(CLSID_DirectSoundPrivate,IID_IDirectSound) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
/* try with no device specified */ rc = DirectSoundCreate(NULL, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(NULL) failed: %08x\n",rc);
"DirectSoundCreate(NULL) failed: %08lx\n",rc);
if (rc==S_OK && dso) IDirectSound_test(dso, TRUE, NULL);
/* try with default playback device specified */ rc = DirectSoundCreate(&DSDEVID_DefaultPlayback, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08x\n", rc);
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08lx\n", rc);
if (rc==DS_OK && dso) IDirectSound_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ rc = DirectSoundCreate(&DSDEVID_DefaultVoicePlayback, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08lx\n", rc);
if (rc==DS_OK && dso) IDirectSound_test(dso, TRUE, NULL);
/* try with a bad device specified */ rc = DirectSoundCreate(&DSDEVID_DefaultVoiceCapture, &dso, NULL); ok(rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc);
if (rc==DS_OK && dso) IDirectSound_Release(dso);"should have failed: %08lx\n",rc);
} @@ -266,12 +266,12 @@ static HRESULT test_dsound(LPGUID lpGuid) /* DSOUND: Error: Invalid interface buffer */ rc = DirectSoundCreate(lpGuid, 0, NULL); ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -281,19 +281,19 @@ static HRESULT test_dsound(LPGUID lpGuid) /* Try the COM class factory method of creation with enumerated device */ rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08x\n", rc);
ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", rc); if (dso) IDirectSound_test(dso, FALSE, lpGuid);
/* Create a DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL);
- ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08lx\n",rc); if (rc==DS_OK) { LPDIRECTSOUND dso1=NULL;
/* Create a second DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08lx\n",rc); if (rc==DS_OK) { /* Release the second DirectSound object */ ref=IDirectSound_Release(dso1);
@@ -313,7 +313,7 @@ static HRESULT test_dsound(LPGUID lpGuid)
/* Create a DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL);
- ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundCreate() failed: %08lx\n",rc); if (rc==DS_OK) { LPDIRECTSOUNDBUFFER secondary; DSBUFFERDESC bufdesc;
@@ -329,13 +329,13 @@ static HRESULT test_dsound(LPGUID lpGuid) rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); 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);
"buffer %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { LPDIRECTSOUND3DBUFFER buffer3d; rc = IDirectSoundBuffer_QueryInterface(secondary, &IID_IDirectSound3DBuffer, (void **)&buffer3d); ok(rc==DS_OK && buffer3d!=NULL,"IDirectSound_QueryInterface() "
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (rc==DS_OK && buffer3d!=NULL) { ref=IDirectSound3DBuffer_AddRef(buffer3d); ok(ref==2,"IDirectSound3DBuffer_AddRef() has %d references, "
@@ -370,7 +370,7 @@ static HRESULT test_primary(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -378,20 +378,20 @@ static HRESULT test_primary(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* DSOUND: Error: Invalid buffer description pointer */ rc=IDirectSound_CreateSoundBuffer(dso,0,0,NULL); ok(rc==DSERR_INVALIDPARAM,
"IDirectSound_CreateSoundBuffer() should have failed: %08x\n", rc);
"IDirectSound_CreateSoundBuffer() should have failed: %08lx\n", rc);
/* DSOUND: Error: NULL pointer is invalid */ /* DSOUND: Error: Invalid buffer description pointer */ rc=IDirectSound_CreateSoundBuffer(dso,0,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08lx," "dsbo=%p\n",rc,primary);
/* DSOUND: Error: Invalid size */
@@ -401,7 +401,7 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc)-1; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08lx," "primary=%p\n",rc,primary);
/* DSOUND: Error: DSBCAPS_PRIMARYBUFFER flag with non-NULL lpwfxFormat */
@@ -413,7 +413,7 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.lpwfxFormat=&wfx; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08lx," "primary=%p\n",rc,primary);
/* DSOUND: Error: No DSBCAPS_PRIMARYBUFFER flag with NULL lpwfxFormat */
@@ -425,13 +425,13 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.lpwfxFormat=NULL; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound_CreateSoundBuffer() should have failed: rc=%08lx," "primary=%p\n",rc,primary);
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -444,7 +444,7 @@ static HRESULT test_primary(LPGUID lpGuid) init_format(&wfx,WAVE_FORMAT_PCM,11025,8,2); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSound_CreateSoundBuffer() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK && primary!=NULL) IDirectSoundBuffer_Release(primary);"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -454,7 +454,7 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08x\n",rc);
if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) {"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08lx\n",rc);
@@ -467,7 +467,7 @@ static HRESULT test_primary(LPGUID lpGuid) rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&second,NULL); ok(rc==DS_OK && second==primary, "IDirectSound_CreateSoundBuffer() should have returned original "
"primary buffer: %08x\n",rc);
"primary buffer: %08lx\n",rc); ref=IDirectSoundBuffer_Release(second); ok(ref==1,"IDirectSoundBuffer_Release() primary has %d references, " "should have 1\n",ref);
@@ -477,16 +477,16 @@ static HRESULT test_primary(LPGUID lpGuid) rc=IDirectSound_DuplicateSoundBuffer(dso,primary,&third); /* rc=0x88780032 */ ok(rc!=DS_OK,"IDirectSound_DuplicateSoundBuffer() primary buffer "
"should have failed %08x\n",rc);
"should have failed %08lx\n",rc); rc=IDirectSoundBuffer_GetVolume(primary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08lx\n", rc); if (winetest_interactive) { trace("Playing a 5 seconds reference tone at the current " "volume.\n"); if (rc==DS_OK)
trace("(the current volume is %d according to DirectSound)\n",
trace("(the current volume is %ld according to DirectSound)\n", vol); trace("All subsequent tones should be identical to this one.\n"); trace("Listen for stutter, changes in pitch, volume, etc.\n");
@@ -507,13 +507,13 @@ static HRESULT test_primary(LPGUID lpGuid) ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references\n",ref);
rc=IDirectSoundBuffer_QueryInterface(primary,&IID_IDirectSoundNotify,(void **)¬ify);
ok(rc==E_NOINTERFACE,"IDirectSoundBuffer_QueryInterface() failed %08x\n",rc);
ok(rc==E_NOINTERFACE,"IDirectSoundBuffer_QueryInterface() failed %08lx\n",rc);
}
/* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -541,7 +541,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -549,14 +549,14 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -565,7 +565,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc);
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { for (f = 0; f < ARRAY_SIZE(formats); f++) {
@@ -579,7 +579,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) /* DSOUND: Setting DirectSound cooperative level to * DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -589,10 +589,10 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) rc=IDirectSoundBuffer_SetFormat(primary,&wfx);
if (wfx.wBitsPerSample <= 16)
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08x\n",
ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08lx\n", format_string(&wfx), rc); else
ok(rc==DS_OK || rc == E_INVALIDARG, "SetFormat (%s) failed: %08x\n",
ok(rc==DS_OK || rc == E_INVALIDARG, "SetFormat (%s) failed: %08lx\n", format_string(&wfx), rc); /* There is no guarantee that SetFormat will actually change the
@@ -600,17 +600,17 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) * supports. So we must re-query the format. */ rc=IDirectSoundBuffer_GetFormat(primary,&wfx,sizeof(wfx),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && (wfx.wFormatTag!=wfx2.wFormatTag || wfx.nSamplesPerSec!=wfx2.nSamplesPerSec || wfx.wBitsPerSample!=wfx2.wBitsPerSample || wfx.nChannels!=wfx2.nChannels)) {
trace("Requested primary format tag=0x%04x %dx%dx%d "
"avg.B/s=%d align=%d\n",
trace("Requested primary format tag=0x%04x %ldx%dx%d "
"avg.B/s=%ld align=%d\n", wfx2.wFormatTag,wfx2.nSamplesPerSec,wfx2.wBitsPerSample, wfx2.nChannels,wfx2.nAvgBytesPerSec,wfx2.nBlockAlign);
trace("Got tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Got tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign); }
@@ -618,7 +618,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2);
@@ -630,14 +630,14 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) wfx.nBlockAlign); bufdesc.lpwfxFormat=&wfx2; if (winetest_interactive) {
trace(" Testing a primary buffer at %dx%dx%d (fmt=%d) with a "
"secondary buffer at %dx%dx%d\n",
trace(" Testing a primary buffer at %ldx%dx%d (fmt=%d) with a "
"secondary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,format_tags[tag], wfx2.nSamplesPerSec,wfx2.wBitsPerSample,wfx2.nChannels); } rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); 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 %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { test_buffer(dso,&secondary,0,FALSE,0,FALSE,0,
@@ -658,7 +658,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -683,7 +683,7 @@ static HRESULT test_secondary(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -691,14 +691,14 @@ static HRESULT test_secondary(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -707,11 +707,11 @@ static HRESULT test_secondary(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc);
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT1;
@@ -733,7 +733,7 @@ static HRESULT test_secondary(LPGUID lpGuid) wfx.nBlockAlign); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSound_CreateSoundBuffer() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); if (rc==DS_OK && secondary!=NULL) IDirectSoundBuffer_Release(secondary);
@@ -751,10 +751,10 @@ static HRESULT test_secondary(LPGUID lpGuid) || rc == DS_OK, /* driver dependent? */ "IDirectSound_CreateSoundBuffer() " "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) "
"and NULL, returned: %08x %p\n", rc, secondary);
"and NULL, returned: %08lx %p\n", rc, secondary); else 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 %08lx\n",rc); if (secondary) IDirectSoundBuffer_Release(secondary);
@@ -770,7 +770,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok((rc==DSERR_INVALIDPARAM || rc==DSERR_INVALIDCALL /* 2003 */) && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -784,7 +784,7 @@ static HRESULT test_secondary(LPGUID lpGuid) ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL || rc==DSERR_INVALIDPARAM) && !secondary) || rc==DS_OK, /* 2003 / 2008 */
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -796,7 +796,7 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.SubFormat = GUID_NULL; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok((rc==DSERR_INVALIDPARAM || rc==DSERR_INVALIDCALL) && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -808,7 +808,7 @@ static HRESULT test_secondary(LPGUID lpGuid) ++wfxe.Samples.wValidBitsPerSample; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -820,7 +820,7 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = 0; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -831,12 +831,12 @@ static HRESULT test_secondary(LPGUID lpGuid)
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&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 %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { if (winetest_interactive) {
trace(" Testing a secondary buffer at %dx%dx%d (fmt=%d) "
"with a primary buffer at %dx%dx%d\n",
trace(" Testing a secondary buffer at %ldx%dx%d (fmt=%d) "
"with a primary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,format_tags[tag], wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels); }
@@ -858,7 +858,7 @@ EXIT1: /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -883,7 +883,7 @@ static HRESULT test_block_align(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -895,30 +895,30 @@ static HRESULT test_block_align(LPGUID lpGuid) bufdesc.lpwfxFormat=&wfx; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc == DS_OK || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */
"IDirectSound_CreateSoundBuffer() should have returned DS_OK, returned: %08x\n", rc);
"IDirectSound_CreateSoundBuffer() should have returned DS_OK, returned: %08lx\n", rc);
if (rc==DS_OK && secondary!=NULL) { ZeroMemory(&dsbcaps, sizeof(dsbcaps)); dsbcaps.dwSize = sizeof(dsbcaps); rc=IDirectSoundBuffer_GetCaps(secondary,&dsbcaps); ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() should have returned DS_OK, "
"returned: %08x\n", rc);
"returned: %08lx\n", rc); if (rc==DS_OK && wfx.nBlockAlign > 1) { ok(dsbcaps.dwBufferBytes==(wfx.nAvgBytesPerSec + wfx.nBlockAlign),
"Buffer size not a multiple of nBlockAlign: requested %d, "
"got %d, should be %d\n", bufdesc.dwBufferBytes,
"Buffer size not a multiple of nBlockAlign: requested %ld, "
"got %ld, should be %ld\n", bufdesc.dwBufferBytes, dsbcaps.dwBufferBytes, wfx.nAvgBytesPerSec + wfx.nBlockAlign); rc = IDirectSoundBuffer_SetCurrentPosition(secondary, 0);
ok(rc == DS_OK, "Could not set position to 0: %08x\n", rc);
ok(rc == DS_OK, "Could not set position to 0: %08lx\n", rc); rc = IDirectSoundBuffer_GetCurrentPosition(secondary, &pos, NULL);
ok(rc == DS_OK, "Could not get position: %08x\n", rc);
ok(rc == DS_OK, "Could not get position: %08lx\n", rc); rc = IDirectSoundBuffer_SetCurrentPosition(secondary, 1);
ok(rc == DS_OK, "Could not set position to 1: %08x\n", rc);
ok(rc == DS_OK, "Could not set position to 1: %08lx\n", rc); rc = IDirectSoundBuffer_GetCurrentPosition(secondary, &pos2, NULL);
ok(rc == DS_OK, "Could not get new position: %08x\n", rc);
ok(pos == pos2, "Positions not the same! Old position: %d, new position: %d\n", pos, pos2);
ok(rc == DS_OK, "Could not get new position: %08lx\n", rc);
ok(pos == pos2, "Positions not the same! Old position: %ld, new position: %ld\n", pos, pos2); } ref=IDirectSoundBuffer_Release(secondary); ok(ref==0,"IDirectSoundBuffer_Release() secondary has %d references, "
@@ -954,7 +954,7 @@ static HRESULT test_frequency(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate() failed: %08lx\n",rc);
@@ -962,14 +962,14 @@ static HRESULT test_frequency(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -978,11 +978,11 @@ static HRESULT test_frequency(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc);
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT1;
@@ -998,14 +998,14 @@ static HRESULT test_frequency(LPGUID lpGuid) BUFFER_LEN/1000,wfx.nBlockAlign); bufdesc.lpwfxFormat=&wfx; if (winetest_interactive) {
trace(" Testing a secondary buffer at %dx%dx%d "
"with a primary buffer at %dx%dx%d\n",
trace(" Testing a secondary buffer at %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels, wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels); } rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); 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 %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { test_buffer(dso,&secondary,0,FALSE,0,FALSE,0,
@@ -1026,7 +1026,7 @@ EXIT1: /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -1046,30 +1046,30 @@ static HRESULT test_notify(LPDIRECTSOUNDBUFFER dsb,
rc=IDirectSoundBuffer_SetCurrentPosition(dsb,0); ok(rc==DS_OK,
"IDirectSoundBuffer_SetCurrentPosition failed %08x\n",rc);
"IDirectSoundBuffer_SetCurrentPosition failed %08lx\n",rc);
if(rc!=DS_OK) return rc;
rc=IDirectSoundBuffer_Play(dsb,0,0,0);
- ok(rc==DS_OK,"IDirectSoundBuffer_Play failed %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_Play failed %08lx\n",rc); if(rc!=DS_OK) return rc;
rc = IDirectSoundBuffer_GetStatus(dsb, &status);
- ok(rc == DS_OK,"Failed %08x\n",rc);
- ok(status == DSBSTATUS_PLAYING,"got %08x\n", status);
ok(rc == DS_OK,"Failed %08lx\n",rc);
ok(status == DSBSTATUS_PLAYING,"got %08lx\n", status);
rc=IDirectSoundBuffer_Stop(dsb);
- ok(rc==DS_OK,"IDirectSoundBuffer_Stop failed %08x\n",rc);
ok(rc==DS_OK,"IDirectSoundBuffer_Stop failed %08lx\n",rc); if(rc!=DS_OK) return rc;
rc = IDirectSoundBuffer_GetStatus(dsb, &status);
- ok(rc == DS_OK,"Failed %08x\n",rc);
- ok(status == 0 /* Stopped */,"got %08x\n", status);
ok(rc == DS_OK,"Failed %08lx\n",rc);
ok(status == 0 /* Stopped */,"got %08lx\n", status);
ret = WaitForMultipleObjects(count, event, FALSE, 3000);
- ok(ret==expected,"expected %d. got %d\n",expected,ret);
ok(ret==expected,"expected %ld. got %ld\n",expected,ret);
return rc;
} @@ -1085,14 +1085,14 @@ static HRESULT test_duplicate(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
"DirectSoundCreate() failed: %08lx\n",rc);
if (rc!=DS_OK) return rc;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -1101,7 +1101,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed "
"to create a primary buffer %08x\n",rc);
"to create a primary buffer %08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { LPDIRECTSOUNDBUFFER original=NULL;
@@ -1116,7 +1116,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&original,NULL); ok(rc==DS_OK && original!=NULL, "IDirectSound_CreateSoundBuffer() failed to create an original "
"buffer %08x\n",rc);
"buffer %08lx\n",rc); if (rc==DS_OK && original!=NULL) { LPDIRECTSOUNDBUFFER duplicated=NULL; LPDIRECTSOUNDNOTIFY notify=NULL;
@@ -1134,7 +1134,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) rc=IDirectSoundBuffer_Lock(original,0,0,&buf,&bufsize, NULL,NULL,DSBLOCK_ENTIREBUFFER); ok(rc==DS_OK && buf!=NULL,
"IDirectSoundBuffer_Lock failed to lock the buffer %08x\n",rc);
"IDirectSoundBuffer_Lock failed to lock the buffer %08lx\n",rc); if (rc==DS_OK && buf!=NULL) { if (sizeof(void*)==4) { /* crashes on 64-bit */ /* broken apps like Asuka 120% Return BURNING Fest,
@@ -1147,7 +1147,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) rc=IDirectSoundBuffer_Unlock(original,buf,bufsize, NULL,0); ok(rc==DS_OK,"IDirectSoundBuffer_Unlock failed to unlock "
"%08x\n",rc);
"%08lx\n",rc); } rc=IDirectSoundBuffer_QueryInterface(original,
@@ -1155,7 +1155,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) (void**)¬ify); ok(rc==DS_OK && notify!=NULL, "IDirectSoundBuffer_QueryInterface() failed to create a "
"notification %08x\n",rc);
"notification %08lx\n",rc); if (rc==DS_OK && notify!=NULL) { DSBPOSITIONNOTIFY dsbpn; LPDIRECTSOUNDNOTIFY dup_notify=NULL;
@@ -1165,11 +1165,11 @@ static HRESULT test_duplicate(LPGUID lpGuid) rc=IDirectSoundNotify_SetNotificationPositions(notify, 1,&dsbpn); ok(rc==DS_OK,"IDirectSoundNotify_SetNotificationPositions "
"failed %08x\n",rc);
"failed %08lx\n",rc); rc=IDirectSound_DuplicateSoundBuffer(dso,original,&duplicated); ok(rc==DS_OK && duplicated!=NULL,
"IDirectSound_DuplicateSoundBuffer failed %08x\n",rc);
"IDirectSound_DuplicateSoundBuffer failed %08lx\n",rc); trace("testing duplicated buffer without notifications.\n"); test_notify(duplicated, ARRAY_SIZE(event), event, WAIT_TIMEOUT);
@@ -1179,14 +1179,14 @@ static HRESULT test_duplicate(LPGUID lpGuid) (void**)&dup_notify); ok(rc==DS_OK&&dup_notify!=NULL, "IDirectSoundBuffer_QueryInterface() failed to create a "
"notification %08x\n",rc);
"notification %08lx\n",rc); if(rc==DS_OK&&dup_notify!=NULL) { dsbpn.dwOffset=DSBPN_OFFSETSTOP; dsbpn.hEventNotify=event[1]; rc=IDirectSoundNotify_SetNotificationPositions(dup_notify, 1,&dsbpn); ok(rc==DS_OK,"IDirectSoundNotify_SetNotificationPositions "
"failed %08x\n",rc);
"failed %08lx\n",rc); trace("testing duplicated buffer with a notification.\n"); test_notify(duplicated, ARRAY_SIZE(event), event, WAIT_OBJECT_0 + 1);
@@ -1218,7 +1218,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound_Release(dso); @@ -1267,7 +1267,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1275,7 +1275,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1283,7 +1283,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1291,7 +1291,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 0;
@@ -1299,7 +1299,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1307,7 +1307,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = 0; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1315,7 +1315,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = 0; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1323,7 +1323,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8) - 1; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1331,7 +1331,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8) + 1; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
wfx.nChannels = 2; wfx.nSamplesPerSec = 44100;
@@ -1339,16 +1339,16 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign + 1; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc);
rc = IDirectSoundBuffer_GetFormat(got_buf, &wfx, sizeof(wfx), NULL);
- ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
- ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(wfx.wFormatTag == WAVE_FORMAT_PCM, "%s: format: 0x%x\n", testname, wfx.wFormatTag); ok(wfx.nChannels == 2, "%s: channels: %u\n", testname, wfx.nChannels);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, wfx.nSamplesPerSec);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, wfx.nSamplesPerSec); ok(wfx.wBitsPerSample == 16, "%s: bps: %u\n", testname, wfx.wBitsPerSample); ok(wfx.nBlockAlign == 4, "%s: blockalign: %u\n", testname, wfx.nBlockAlign);
- ok(wfx.nAvgBytesPerSec == 44100 * 4 + 1, "%s: avgbytes: %u\n", testname, wfx.nAvgBytesPerSec);
ok(wfx.nAvgBytesPerSec == 44100 * 4 + 1, "%s: avgbytes: %lu\n", testname, wfx.nAvgBytesPerSec); IDirectSoundBuffer_Release(got_buf);
wfx.nChannels = 2;
@@ -1357,16 +1357,16 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign - 1; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc);
rc = IDirectSoundBuffer_GetFormat(got_buf, &wfx, sizeof(wfx), NULL);
- ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
- ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(wfx.wFormatTag == WAVE_FORMAT_PCM, "%s: format: 0x%x\n", testname, wfx.wFormatTag); ok(wfx.nChannels == 2, "%s: channels: %u\n", testname, wfx.nChannels);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, wfx.nSamplesPerSec);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, wfx.nSamplesPerSec); ok(wfx.wBitsPerSample == 16, "%s: bps: %u\n", testname, wfx.wBitsPerSample); ok(wfx.nBlockAlign == 4, "%s: blockalign: %u\n", testname, wfx.nBlockAlign);
- ok(wfx.nAvgBytesPerSec == 44100 * 4 - 1, "%s: avgbytes: %u\n", testname, wfx.nAvgBytesPerSec);
ok(wfx.nAvgBytesPerSec == 44100 * 4 - 1, "%s: avgbytes: %lu\n", testname, wfx.nAvgBytesPerSec); IDirectSoundBuffer_Release(got_buf);
wfx.nChannels = 2;
@@ -1375,16 +1375,16 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign + 1; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
- ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc);
rc = IDirectSoundBuffer_GetFormat(got_buf, &wfx, sizeof(wfx), NULL);
- ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
- ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(wfx.wFormatTag == WAVE_FORMAT_PCM, "%s: format: 0x%x\n", testname, wfx.wFormatTag); ok(wfx.nChannels == 2, "%s: channels: %u\n", testname, wfx.nChannels);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, wfx.nSamplesPerSec);
- ok(wfx.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, wfx.nSamplesPerSec); ok(wfx.wBitsPerSample == 16, "%s: bps: %u\n", testname, wfx.wBitsPerSample); ok(wfx.nBlockAlign == 4, "%s: blockalign: %u\n", testname, wfx.nBlockAlign);
- ok(wfx.nAvgBytesPerSec == 44100 * 4 + 1, "%s: avgbytes: %u\n", testname, wfx.nAvgBytesPerSec);
ok(wfx.nAvgBytesPerSec == 44100 * 4 + 1, "%s: avgbytes: %lu\n", testname, wfx.nAvgBytesPerSec); IDirectSoundBuffer_Release(got_buf);
if(buf){
@@ -1395,17 +1395,17 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf);
ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc); if(got_buf){ rc = IDirectSoundBuffer_GetFormat(got_buf, &wfx, sizeof(wfx), NULL);
ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(wfx.wFormatTag == WAVE_FORMAT_ALAW, "%s: format: 0x%x\n", testname, wfx.wFormatTag); ok(wfx.nChannels == 2, "%s: channels: %u\n", testname, wfx.nChannels);
ok(wfx.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, wfx.nSamplesPerSec);
ok(wfx.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, wfx.nSamplesPerSec); ok(wfx.wBitsPerSample == 16, "%s: bps: %u\n", testname, wfx.wBitsPerSample); ok(wfx.nBlockAlign == 4, "%s: blockalign: %u\n", testname, wfx.nBlockAlign);
ok(wfx.nAvgBytesPerSec == 44100 * 4, "%s: avgbytes: %u\n", testname, wfx.nAvgBytesPerSec);
}ok(wfx.nAvgBytesPerSec == 44100 * 4, "%s: avgbytes: %lu\n", testname, wfx.nAvgBytesPerSec); IDirectSoundBuffer_Release(got_buf); }
@@ -1421,16 +1421,16 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I fmtex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; fmtex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; rc = do_invalid_fmt_test(dso, buf, (WAVEFORMATEX*)&fmtex, &got_buf);
- ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc);
rc = IDirectSoundBuffer_GetFormat(got_buf, (WAVEFORMATEX*)&fmtex, sizeof(fmtex), NULL);
- ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
- ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(fmtex.Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "%s: format: 0x%x\n", testname, fmtex.Format.wFormatTag); ok(fmtex.Format.nChannels == 2, "%s: channels: %u\n", testname, fmtex.Format.nChannels);
- ok(fmtex.Format.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, fmtex.Format.nSamplesPerSec);
- ok(fmtex.Format.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, fmtex.Format.nSamplesPerSec); ok(fmtex.Format.wBitsPerSample == 16, "%s: bps: %u\n", testname, fmtex.Format.wBitsPerSample); ok(fmtex.Format.nBlockAlign == 4, "%s: blockalign: %u\n", testname, fmtex.Format.nBlockAlign);
- ok(fmtex.Format.nAvgBytesPerSec == 44100 * 4, "%s: avgbytes: %u\n", testname, fmtex.Format.nAvgBytesPerSec);
- ok(fmtex.Format.nAvgBytesPerSec == 44100 * 4, "%s: avgbytes: %lu\n", testname, fmtex.Format.nAvgBytesPerSec); ok(fmtex.Samples.wValidBitsPerSample == 0 || /* <= XP */ fmtex.Samples.wValidBitsPerSample == 16, /* >= Vista */ "%s: validbits: %u\n", testname, fmtex.Samples.wValidBitsPerSample);
@@ -1448,16 +1448,16 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I fmtex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; fmtex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; rc = do_invalid_fmt_test(dso, buf, (WAVEFORMATEX*)&fmtex, &got_buf);
- ok(rc == S_OK, "%s: SetFormat: %08x\n", testname, rc);
ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc);
rc = IDirectSoundBuffer_GetFormat(got_buf, (WAVEFORMATEX*)&fmtex, sizeof(fmtex), NULL);
- ok(rc == S_OK, "%s: GetFormat: %08x\n", testname, rc);
- ok(rc == S_OK, "%s: GetFormat: %08lx\n", testname, rc); ok(fmtex.Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "%s: format: 0x%x\n", testname, fmtex.Format.wFormatTag); ok(fmtex.Format.nChannels == 2, "%s: channels: %u\n", testname, fmtex.Format.nChannels);
- ok(fmtex.Format.nSamplesPerSec == 44100, "%s: rate: %u\n", testname, fmtex.Format.nSamplesPerSec);
- ok(fmtex.Format.nSamplesPerSec == 44100, "%s: rate: %lu\n", testname, fmtex.Format.nSamplesPerSec); ok(fmtex.Format.wBitsPerSample == 24, "%s: bps: %u\n", testname, fmtex.Format.wBitsPerSample); ok(fmtex.Format.nBlockAlign == 6, "%s: blockalign: %u\n", testname, fmtex.Format.nBlockAlign);
- ok(fmtex.Format.nAvgBytesPerSec == 44100 * 6, "%s: avgbytes: %u\n", testname, fmtex.Format.nAvgBytesPerSec);
- ok(fmtex.Format.nAvgBytesPerSec == 44100 * 6, "%s: avgbytes: %lu\n", testname, fmtex.Format.nAvgBytesPerSec); ok(fmtex.Samples.wValidBitsPerSample == 20, "%s: validbits: %u\n", testname, fmtex.Samples.wValidBitsPerSample); ok(IsEqualGUID(&fmtex.SubFormat, &KSDATAFORMAT_SUBTYPE_PCM), "%s: subtype incorrect\n", testname); IDirectSoundBuffer_Release(got_buf);
@@ -1473,7 +1473,7 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I fmtex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; fmtex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; rc = do_invalid_fmt_test(dso, buf, (WAVEFORMATEX*)&fmtex, &got_buf);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08x\n", testname, rc);
- ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc);
}
static HRESULT test_invalid_fmts(LPGUID lpGuid) @@ -1486,14 +1486,14 @@ static HRESULT test_invalid_fmts(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
"DirectSoundCreate() failed: %08lx\n",rc);
if (rc!=DS_OK) return rc;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK){ IDirectSound_Release(dso); return rc;
@@ -1504,7 +1504,7 @@ static HRESULT test_invalid_fmts(LPGUID lpGuid) bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&buffer,NULL); ok(rc==DS_OK && buffer!=NULL,"IDirectSound_CreateSoundBuffer() failed "
"to create a primary buffer %08x\n",rc);
if (rc==DS_OK && buffer!=NULL) { perform_invalid_fmt_tests("primary", dso, buffer); IDirectSoundBuffer_Release(buffer);"to create a primary buffer %08lx\n",rc);
@@ -1532,12 +1532,12 @@ static void test_notifications(LPGUID lpGuid)
rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc == DS_OK || rc == DSERR_NODRIVER || rc == DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n", rc);
"DirectSoundCreate() failed: %08lx\n", rc);
if(rc != DS_OK) return;
rc = IDirectSound_SetCooperativeLevel(dso, get_hwnd(), DSSCL_PRIORITY);
- ok(rc == DS_OK, "IDirectSound_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc == DS_OK, "IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if(rc != DS_OK){ IDirectSound_Release(dso); return;
@@ -1558,10 +1558,10 @@ static void test_notifications(LPGUID lpGuid) bufdesc.lpwfxFormat = &wfx; rc = IDirectSound_CreateSoundBuffer(dso, &bufdesc, &buf, NULL); ok(rc == DS_OK && buf != NULL, "IDirectSound_CreateSoundBuffer() failed "
"to create a buffer %08x\n", rc);
"to create a buffer %08lx\n", rc);
rc = IDirectSoundBuffer_QueryInterface(buf, &IID_IDirectSoundNotify, (void**)&buf_notif);
- ok(rc == E_NOINTERFACE, "QueryInterface(IID_IDirectSoundNotify): %08x\n", rc);
ok(rc == E_NOINTERFACE, "QueryInterface(IID_IDirectSoundNotify): %08lx\n", rc); IDirectSoundBuffer_Release(buf);
ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -1571,10 +1571,10 @@ static void test_notifications(LPGUID lpGuid) bufdesc.lpwfxFormat = &wfx; rc = IDirectSound_CreateSoundBuffer(dso, &bufdesc, &buf, NULL); ok(rc == DS_OK && buf != NULL, "IDirectSound_CreateSoundBuffer() failed "
"to create a buffer %08x\n", rc);
"to create a buffer %08lx\n", rc);
rc = IDirectSoundBuffer_QueryInterface(buf, &IID_IDirectSoundNotify, (void**)&buf_notif);
- ok(rc == DS_OK, "QueryInterface(IID_IDirectSoundNotify): %08x\n", rc);
ok(rc == DS_OK, "QueryInterface(IID_IDirectSoundNotify): %08lx\n", rc);
notifies[0].dwOffset = 0; handles[0] = notifies[0].hEventNotify = CreateEventW(NULL, FALSE, FALSE, NULL);
@@ -1582,12 +1582,12 @@ static void test_notifications(LPGUID lpGuid) handles[1] = notifies[1].hEventNotify = CreateEventW(NULL, FALSE, FALSE, NULL);
rc = IDirectSoundNotify_SetNotificationPositions(buf_notif, 2, notifies);
- ok(rc == DS_OK, "SetNotificationPositions: %08x\n", rc);
ok(rc == DS_OK, "SetNotificationPositions: %08lx\n", rc);
IDirectSoundNotify_Release(buf_notif);
rc = IDirectSoundBuffer_Play(buf, 0, 0, DSBPLAY_LOOPING);
- ok(rc == DS_OK, "Play: %08x\n", rc);
ok(rc == DS_OK, "Play: %08lx\n", rc);
expect = 0; for(cycles = 0; cycles < 6 /* 1.5s */; ++cycles){
@@ -1595,21 +1595,21 @@ static void test_notifications(LPGUID lpGuid)
wait = WaitForMultipleObjects(2, handles, FALSE, 1000); ok(wait <= WAIT_OBJECT_0 + 1 && wait - WAIT_OBJECT_0 == expect,
"Got unexpected notification order or timeout: %u\n", wait);
"Got unexpected notification order or timeout: %lu\n", wait); rc = IDirectSoundBuffer_GetStatus(buf, &status);
ok(rc == DS_OK,"Failed %08x\n",rc);
ok(status == (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING),"got %08x\n", status);
ok(rc == DS_OK,"Failed %08lx\n",rc);
ok(status == (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING),"got %08lx\n", status); expect = !expect;
}
rc = IDirectSoundBuffer_Stop(buf);
- ok(rc == DS_OK, "Stop: %08x\n", rc);
ok(rc == DS_OK, "Stop: %08lx\n", rc);
rc = IDirectSoundBuffer_GetStatus(buf, &status);
- ok(rc == DS_OK,"Failed %08x\n",rc);
- ok(status == 0,"got %08x\n", status);
ok(rc == DS_OK,"Failed %08lx\n",rc);
ok(status == 0,"got %08lx\n", status);
CloseHandle(notifies[0].hEventNotify); CloseHandle(notifies[1].hEventNotify);
@@ -1658,7 +1658,7 @@ static void dsound_tests(void) { HRESULT rc; rc = DirectSoundEnumerateA(&dsenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08lx\n",rc);
}
static void test_hw_buffers(void) @@ -1675,16 +1675,16 @@ static void test_hw_buffers(void)
hr = DirectSoundCreate(NULL, &ds, NULL); ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate failed: %08x\n", hr);
"DirectSoundCreate failed: %08lx\n", hr);
if(hr != S_OK) return;
caps.dwSize = sizeof(caps);
hr = IDirectSound_GetCaps(ds, &caps);
- ok(hr == S_OK, "GetCaps failed: %08x\n", hr);
- ok(hr == S_OK, "GetCaps failed: %08lx\n", hr);
- ok(caps.dwPrimaryBuffers == 1, "Got wrong number of primary buffers: %u\n",
ok(caps.dwPrimaryBuffers == 1, "Got wrong number of primary buffers: %lu\n", caps.dwPrimaryBuffers);
/* DSBCAPS_LOC* is ignored for primary buffers */
@@ -1697,7 +1697,7 @@ static void test_hw_buffers(void) bufdesc.guid3DAlgorithm = GUID_NULL;
hr = IDirectSound_CreateSoundBuffer(ds, &bufdesc, &primary, NULL);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08lx\n", hr); if(hr != S_OK){ IDirectSound_Release(ds); return;
@@ -1707,7 +1707,7 @@ static void test_hw_buffers(void) DSBCAPS_PRIMARYBUFFER;
hr = IDirectSound_CreateSoundBuffer(ds, &bufdesc, &primary2, NULL);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08lx\n", hr); ok(primary == primary2, "Got different primary buffers: %p, %p\n", primary, primary2); if(hr == S_OK) IDirectSoundBuffer_Release(primary2);
@@ -1715,7 +1715,7 @@ static void test_hw_buffers(void) buf8 = (IDirectSoundBuffer8 *)0xDEADBEEF; hr = IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundBuffer8, (void**)&buf8);
- ok(hr == E_NOINTERFACE, "QueryInterface gave wrong failure: %08x\n", hr);
ok(hr == E_NOINTERFACE, "QueryInterface gave wrong failure: %08lx\n", hr); ok(buf8 == NULL, "Pointer didn't get set to NULL\n");
fmt.wFormatTag = WAVE_FORMAT_PCM;
@@ -1735,21 +1735,21 @@ static void test_hw_buffers(void) sizeof(IDirectSoundBuffer *) * caps.dwMaxHwMixingAllBuffers);
/* try to fill all of the hw buffers */
- trace("dwMaxHwMixingAllBuffers: %u\n", caps.dwMaxHwMixingAllBuffers);
- trace("dwMaxHwMixingStaticBuffers: %u\n", caps.dwMaxHwMixingStaticBuffers);
- trace("dwMaxHwMixingStreamingBuffers: %u\n", caps.dwMaxHwMixingStreamingBuffers);
- trace("dwMaxHwMixingAllBuffers: %lu\n", caps.dwMaxHwMixingAllBuffers);
- trace("dwMaxHwMixingStaticBuffers: %lu\n", caps.dwMaxHwMixingStaticBuffers);
- trace("dwMaxHwMixingStreamingBuffers: %lu\n", caps.dwMaxHwMixingStreamingBuffers); for(i = 0; i < caps.dwMaxHwMixingAllBuffers; ++i){ hr = IDirectSound_CreateSoundBuffer(ds, &bufdesc, &secondaries[i], NULL); ok(hr == S_OK || hr == E_NOTIMPL || broken(hr == DSERR_CONTROLUNAVAIL) || broken(hr == E_FAIL),
"CreateSoundBuffer(%u) failed: %08x\n", i, hr);
"CreateSoundBuffer(%u) failed: %08lx\n", i, hr); if(hr != S_OK) break; bufcaps.dwSize = sizeof(bufcaps); hr = IDirectSoundBuffer_GetCaps(secondaries[i], &bufcaps);
ok(hr == S_OK, "GetCaps failed: %08x\n", hr);
ok(hr == S_OK, "GetCaps failed: %08lx\n", hr); ok((bufcaps.dwFlags & DSBCAPS_LOCHARDWARE) != 0,
"Buffer wasn't allocated in hardware, dwFlags: %x\n", bufcaps.dwFlags);
"Buffer wasn't allocated in hardware, dwFlags: %lx\n", bufcaps.dwFlags);
}
/* see if we can create one more */
@@ -1760,7 +1760,7 @@ static void test_hw_buffers(void) broken(hr == DSERR_CONTROLUNAVAIL) || /* vmware winxp, others? */ broken(hr == E_FAIL) || /* broken AC97 driver */ broken(hr == S_OK) /* broken driver allows more hw bufs than dscaps claims */,
"CreateSoundBuffer(%u) gave wrong error: %08x\n", i, hr);
if(hr == S_OK) IDirectSoundBuffer_Release(secondary);"CreateSoundBuffer(%u) gave wrong error: %08lx\n", i, hr);
diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index e3adbfbe70e..70db008a0df 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -70,18 +70,18 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
/* Try to Query for objects */ rc=IDirectSound8_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown);
- ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IUnknown) failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IUnknown) failed: %08lx\n", rc); if (rc==DS_OK) IUnknown_Release(unknown);
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound,(LPVOID*)&ds);
- ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %08lx\n", rc); if (rc==DS_OK) IDirectSound_Release(ds);
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8); ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound8) "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK) IDirectSound8_Release(ds8);"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -89,27 +89,27 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized, /* try uninitialized object */ rc=IDirectSound8_GetCaps(dso,0); ok(rc==DSERR_UNINITIALIZED,"IDirectSound8_GetCaps(NULL) "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound8_GetCaps(dso,&dscaps); ok(rc==DSERR_UNINITIALIZED,"IDirectSound8_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound8_Compact(dso); ok(rc==DSERR_UNINITIALIZED,"IDirectSound8_Compact() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound8_GetSpeakerConfig(dso,&speaker_config); ok(rc==DSERR_UNINITIALIZED,"IDirectSound8_GetSpeakerConfig() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound8_VerifyCertification(dso, &certified); ok(rc==DSERR_UNINITIALIZED,"IDirectSound8_VerifyCertification() "
"should have returned DSERR_UNINITIALIZED, returned: %08x\n", rc);
"should have returned DSERR_UNINITIALIZED, returned: %08lx\n", rc); rc=IDirectSound8_Initialize(dso,lpGuid); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"IDirectSound8_Initialize() failed: %08x\n",rc);
"IDirectSound8_Initialize() failed: %08lx\n",rc); if (rc==DSERR_NODRIVER) { trace(" No Driver\n"); goto EXIT;
@@ -124,41 +124,41 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
rc=IDirectSound8_Initialize(dso,lpGuid); ok(rc==DSERR_ALREADYINITIALIZED, "IDirectSound8_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %08x\n", rc);
"should have returned DSERR_ALREADYINITIALIZED: %08lx\n", rc);
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSound8_GetCaps(dso,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
ZeroMemory(&dscaps, sizeof(dscaps));
/* DSOUND: Error: Invalid caps buffer */ rc=IDirectSound8_GetCaps(dso,&dscaps); ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
dscaps.dwSize=sizeof(dscaps);
/* DSOUND: Running on a certified driver */ rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc);
rc=IDirectSound8_Compact(dso);
- ok(rc==DSERR_PRIOLEVELNEEDED,"IDirectSound8_Compact() failed: %08x\n", rc);
ok(rc==DSERR_PRIOLEVELNEEDED,"IDirectSound8_Compact() failed: %08lx\n", rc);
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc);
rc=IDirectSound8_Compact(dso);
- ok(rc==DS_OK,"IDirectSound8_Compact() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_Compact() failed: %08lx\n",rc);
rc=IDirectSound8_GetSpeakerConfig(dso,0); ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetSpeakerConfig(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
rc=IDirectSound8_GetSpeakerConfig(dso,&speaker_config);
- ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08lx\n", rc); ref_speaker_config = speaker_config;
speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO,
@@ -168,20 +168,20 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized, DSSPEAKER_GEOMETRY_NARROW); if(rc==DS_OK) { rc=IDirectSound8_SetSpeakerConfig(dso,speaker_config);
ok(rc==DS_OK,"IDirectSound8_SetSpeakerConfig() failed: %08x\n", rc);
} if (rc==DS_OK) { rc=IDirectSound8_GetSpeakerConfig(dso,&new_speaker_config);ok(rc==DS_OK,"IDirectSound8_SetSpeakerConfig() failed: %08lx\n", rc);
ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08lx\n", rc); if (rc==DS_OK && speaker_config!=new_speaker_config && ref_speaker_config!=new_speaker_config) trace("IDirectSound8_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08x or 0x%08x, got 0x%08x\n",
"config: expected 0x%08lx or 0x%08lx, got 0x%08lx\n", speaker_config,ref_speaker_config,new_speaker_config); IDirectSound8_SetSpeakerConfig(dso,ref_speaker_config);
}
rc=IDirectSound8_VerifyCertification(dso, &certified);
- ok(rc==DS_OK||rc==E_NOTIMPL,"IDirectSound8_VerifyCertification() failed: %08x\n", rc);
- ok(rc==DS_OK||rc==E_NOTIMPL,"IDirectSound8_VerifyCertification() failed: %08lx\n", rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -199,17 +199,17 @@ static void IDirectSound8_tests(void) rc=CoGetClassObject(&CLSID_DirectSound8, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
rc=CoGetClassObject(&CLSID_DirectSound8, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&cf); ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound8, IID_IUnknown) "
"failed: %08x\n", rc);
"failed: %08lx\n", rc);
/* try the COM class factory method of creation with no device specified */ rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&dso);
- ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG,"CoCreateInstance() failed: %08x\n", rc);
- ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG,"CoCreateInstance() failed: %08lx\n", rc); if (rc==REGDB_E_CLASSNOTREG) { trace(" Class Not Registered\n"); return;
@@ -221,7 +221,7 @@ static void IDirectSound8_tests(void) * device specified */ rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound8) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound8) failed: %08lx\n", rc); if (dso) IDirectSound8_test(dso, FALSE, &DSDEVID_DefaultPlayback);
@@ -229,7 +229,7 @@ static void IDirectSound8_tests(void) * playback device specified */ rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound8) failed: %08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound8) failed: %08lx\n", rc); if (dso) IDirectSound8_test(dso, FALSE, &DSDEVID_DefaultVoicePlayback);
@@ -239,7 +239,7 @@ static void IDirectSound8_tests(void) &CLSID_DirectSoundPrivate, (void**)&dso); ok(rc==E_NOINTERFACE, "CoCreateInstance(CLSID_DirectSound8,CLSID_DirectSoundPrivate) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
/* try the COM class factory method of creation with a bad * GUID and IID specified */
@@ -247,33 +247,33 @@ static void IDirectSound8_tests(void) &IID_IDirectSound8, (void**)&dso); ok(rc==REGDB_E_CLASSNOTREG, "CoCreateInstance(CLSID_DirectSoundPrivate,IID_IDirectSound8) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
/* try with no device specified */ rc = DirectSoundCreate8(NULL, &dso, NULL); ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
"DirectSoundCreate8() failed: %08lx\n",rc);
if (rc==DS_OK && dso) IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */ rc = DirectSoundCreate8(&DSDEVID_DefaultPlayback, &dso, NULL); ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
"DirectSoundCreate8() failed: %08lx\n",rc);
if (rc==DS_OK && dso) IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ rc = DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback, &dso, NULL); ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
"DirectSoundCreate8() failed: %08lx\n",rc);
if (rc==DS_OK && dso) IDirectSound8_test(dso, TRUE, NULL);
/* try with a bad device specified */ rc = DirectSoundCreate8(&DSDEVID_DefaultVoiceCapture, &dso, NULL); ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc);
"should have failed: %08lx\n",rc);
}
static HRESULT test_dsound8(LPGUID lpGuid) @@ -285,12 +285,12 @@ static HRESULT test_dsound8(LPGUID lpGuid) /* DSOUND: Error: Invalid interface buffer */ rc = DirectSoundCreate8(lpGuid, 0, NULL); ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* Create the DirectSound8 object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate8() failed: %08lx\n",rc);
@@ -300,19 +300,19 @@ static HRESULT test_dsound8(LPGUID lpGuid) /* Try the COM class factory method of creation with enumerated device */ rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08x\n", rc);
ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", rc); if (dso) IDirectSound8_test(dso, FALSE, lpGuid);
/* Create a DirectSound8 object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
- ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08lx\n",rc); if (rc==DS_OK) { LPDIRECTSOUND8 dso1=NULL;
/* Create a second DirectSound8 object */ rc = DirectSoundCreate8(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08lx\n",rc); if (rc==DS_OK) { /* Release the second DirectSound8 object */ ref=IDirectSound8_Release(dso1);
@@ -333,7 +333,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
/* Create a DirectSound8 object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
- ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundCreate8() failed: %08lx\n",rc); if (rc==DS_OK) { LPDIRECTSOUNDBUFFER secondary; DSBUFFERDESC bufdesc;
@@ -349,7 +349,7 @@ static HRESULT test_dsound8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL, "IDirectSound8_CreateSoundBuffer() failed to create a secondary "
"buffer: %08x\n",rc);
"buffer: %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { LPDIRECTSOUND3DBUFFER buffer3d; LPDIRECTSOUNDBUFFER8 buffer8;
@@ -357,7 +357,7 @@ static HRESULT test_dsound8(LPGUID lpGuid) &IID_IDirectSound3DBuffer, (void **)&buffer3d); ok(rc==DS_OK && buffer3d!=NULL,
"IDirectSound8_QueryInterface() failed: %08x\n", rc);
"IDirectSound8_QueryInterface() failed: %08lx\n", rc); if (rc==DS_OK && buffer3d!=NULL) { ref=IDirectSound3DBuffer_AddRef(buffer3d); ok(ref==2,"IDirectSound3DBuffer_AddRef() has %d references, "
@@ -403,7 +403,7 @@ static HRESULT test_primary8(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate8() failed: %08lx\n",rc);
@@ -411,7 +411,7 @@ static HRESULT test_primary8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
@@ -419,13 +419,13 @@ static HRESULT test_primary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,0,0,NULL); ok(rc==DSERR_INVALIDPARAM, "IDirectSound8_CreateSoundBuffer should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
"DSERR_INVALIDPARAM, returned: %08lx\n",rc);
/* DSOUND: Error: Invalid buffer description pointer */ rc=IDirectSound8_CreateSoundBuffer(dso,0,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound8_CreateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: rc=%08x,dsbo=%p\n",
"DSERR_INVALIDPARAM, returned: rc=%08lx,dsbo=%p\n", rc,primary);
ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -434,7 +434,7 @@ static HRESULT test_primary8(LPGUID lpGuid) /* DSOUND: Error: Invalid dsound buffer interface pointer */ rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,0,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%08lx," "dsbo=%p\n",rc,primary);
ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -443,13 +443,13 @@ static HRESULT test_primary8(LPGUID lpGuid) /* DSOUND: Error: Invalid buffer description */ rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%08x,"
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%08lx," "primary=%p\n",rc,primary);
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -462,7 +462,7 @@ static HRESULT test_primary8(LPGUID lpGuid) init_format(&wfx,WAVE_FORMAT_PCM,11025,8,2); rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_CreateSoundBuffer() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
if (rc==DS_OK && primary!=NULL) IDirectSoundBuffer_Release(primary);"returned DSERR_INVALIDPARAM, returned: %08lx\n", rc);
@@ -473,7 +473,7 @@ static HRESULT test_primary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL), "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: "
"%08x\n",rc);
if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); else if (rc==DS_OK && primary!=NULL) {"%08lx\n",rc);
@@ -485,7 +485,7 @@ static HRESULT test_primary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&second,NULL); ok(rc==DS_OK && second==primary, "IDirectSound8_CreateSoundBuffer() should have returned original "
"primary buffer: %08x\n",rc);
"primary buffer: %08lx\n",rc); ref=IDirectSoundBuffer_Release(second); ok(ref==1,"IDirectSoundBuffer_Release() primary has %d references, " "should have 1\n",ref);
@@ -495,19 +495,19 @@ static HRESULT test_primary8(LPGUID lpGuid) rc=IDirectSound8_DuplicateSoundBuffer(dso,primary,&third); /* rc=0x88780032 */ ok(rc!=DS_OK,"IDirectSound8_DuplicateSoundBuffer() primary buffer "
"should have failed %08x\n",rc);
"should have failed %08lx\n",rc); /* Primary buffers don't have an IDirectSoundBuffer8 */ rc = IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundBuffer8, (LPVOID*)&pb8);
ok(FAILED(rc), "Primary buffer does have an IDirectSoundBuffer8: %08x\n", rc);
ok(FAILED(rc), "Primary buffer does have an IDirectSoundBuffer8: %08lx\n", rc); rc=IDirectSoundBuffer_GetVolume(primary,&vol);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %08lx\n", rc); if (winetest_interactive) { trace("Playing a 5 seconds reference tone at the current volume.\n"); if (rc==DS_OK)
trace("(the current volume is %d according to DirectSound)\n",
trace("(the current volume is %ld according to DirectSound)\n", vol); trace("All subsequent tones should be identical to this one.\n"); trace("Listen for stutter, changes in pitch, volume, etc.\n");
@@ -524,7 +524,7 @@ static HRESULT test_primary8(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -553,7 +553,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate8() failed: %08lx\n",rc);
@@ -561,14 +561,14 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -578,7 +578,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL, "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer "
"%08x\n",rc);
"%08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { for (f = 0; f < ARRAY_SIZE(formats); f++) {
@@ -592,7 +592,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) /* DSOUND: Setting DirectSound cooperative level to * DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -602,7 +602,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) rc=IDirectSoundBuffer_SetFormat(primary,&wfx); ok(rc==DS_OK || rc==DSERR_INVALIDPARAM, /* 2003 */
"IDirectSoundBuffer_SetFormat(%s) failed: %08x\n",
"IDirectSoundBuffer_SetFormat(%s) failed: %08lx\n", format_string(&wfx), rc); /* There is no guarantee that SetFormat will actually change the
@@ -610,17 +610,17 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) * supports. So we must re-query the format. */ rc=IDirectSoundBuffer_GetFormat(primary,&wfx,sizeof(wfx),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %08lx\n", rc); if (rc==DS_OK && (wfx.wFormatTag!=wfx2.wFormatTag || wfx.nSamplesPerSec!=wfx2.nSamplesPerSec || wfx.wBitsPerSample!=wfx2.wBitsPerSample || wfx.nChannels!=wfx2.nChannels)) {
trace("Requested primary format tag=0x%04x %dx%dx%d "
"avg.B/s=%d align=%d\n",
trace("Requested primary format tag=0x%04x %ldx%dx%d "
"avg.B/s=%ld align=%d\n", wfx2.wFormatTag,wfx2.nSamplesPerSec,wfx2.wBitsPerSample, wfx2.nChannels,wfx2.nAvgBytesPerSec,wfx2.nBlockAlign);
trace("Got tag=0x%04x %dx%dx%d avg.B/s=%d align=%d\n",
trace("Got tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n", wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample, wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign); }
@@ -628,7 +628,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc); init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2);
@@ -640,15 +640,15 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) wfx.nBlockAlign); bufdesc.lpwfxFormat=&wfx2; if (winetest_interactive) {
trace(" Testing a primary buffer at %dx%dx%d (fmt=%d) with a "
"secondary buffer at %dx%dx%d\n",
trace(" Testing a primary buffer at %ldx%dx%d (fmt=%d) with a "
"secondary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,format_tags[tag], wfx2.nSamplesPerSec,wfx2.wBitsPerSample,wfx2.nChannels); } rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL, "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %08x\n",rc);
"buffer %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { test_buffer8(dso,&secondary,FALSE,FALSE,0,FALSE,0,
@@ -669,7 +669,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -694,7 +694,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) /* Create the DirectSound object */ rc = DirectSoundCreate8(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK) return rc;"DirectSoundCreate8() failed: %08lx\n",rc);
@@ -702,14 +702,14 @@ static HRESULT test_secondary8(LPGUID lpGuid) ZeroMemory(&dscaps, sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08x\n",rc);
ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %08lx\n",rc); if (rc!=DS_OK) goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -719,11 +719,11 @@ static HRESULT test_secondary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DS_OK && primary!=NULL, "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer "
"%08x\n",rc);
"%08lx\n",rc);
if (rc==DS_OK && primary!=NULL) { rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08x\n", rc);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT1;
@@ -745,7 +745,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfx.nBlockAlign); rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_CreateSoundBuffer() "
"should have returned DSERR_INVALIDPARAM, returned: %08x\n", rc);
"should have returned DSERR_INVALIDPARAM, returned: %08lx\n", rc); if (rc==DS_OK && secondary!=NULL) IDirectSoundBuffer_Release(secondary);
@@ -762,11 +762,11 @@ static HRESULT test_secondary8(LPGUID lpGuid) || rc == DS_OK, /* driver dependent? */ "IDirectSound_CreateSoundBuffer() " "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) "
"and NULL, returned: %08x %p\n", rc, secondary);
"and NULL, returned: %08lx %p\n", rc, secondary); else ok(rc==DS_OK && secondary!=NULL, "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %08x\n",rc);
"buffer %08lx\n",rc); if (secondary) IDirectSoundBuffer_Release(secondary); secondary = NULL;
@@ -781,7 +781,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -794,7 +794,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL /* 2003 */ || rc==DSERR_INVALIDPARAM) && !secondary) || rc==DS_OK /* driver dependent? */,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -806,7 +806,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.SubFormat = GUID_NULL; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok((rc==DSERR_INVALIDPARAM || rc==DSERR_INVALIDCALL) && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -817,7 +817,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.Format.cbSize = sizeof(wfxe); rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL || rc==DSERR_INVALIDPARAM) && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -828,7 +828,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.SubFormat = (format_tags[tag] == WAVE_FORMAT_PCM ? KSDATAFORMAT_SUBTYPE_PCM : KSDATAFORMAT_SUBTYPE_IEEE_FLOAT); rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -840,7 +840,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL /* 2003 */ || rc==DSERR_INVALIDPARAM) && !secondary) || rc==DS_OK /* driver dependent? */,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -852,7 +852,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) ++wfxe.Samples.wValidBitsPerSample; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DSERR_INVALIDPARAM && !secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -864,7 +864,7 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = 0; rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary,
"IDirectSound_CreateSoundBuffer() returned: %08x %p\n",
"IDirectSound_CreateSoundBuffer() returned: %08lx %p\n", rc, secondary); if (secondary) {
@@ -876,12 +876,12 @@ static HRESULT test_secondary8(LPGUID lpGuid) rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL, "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %08x\n",rc);
"buffer %08lx\n",rc); if (rc==DS_OK && secondary!=NULL) { if (winetest_interactive) {
trace(" Testing a secondary buffer at %dx%dx%d (fmt=%d) "
"with a primary buffer at %dx%dx%d\n",
trace(" Testing a secondary buffer at %ldx%dx%d (fmt=%d) "
"with a primary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,format_tags[tag], wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels); }
@@ -903,7 +903,7 @@ EXIT1: /* Set the CooperativeLevel back to normal */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */ rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %08lx\n", rc);
EXIT: ref=IDirectSound8_Release(dso); @@ -939,7 +939,7 @@ static void dsound8_tests(void) { HRESULT rc; rc = DirectSoundEnumerateA(dsenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08lx\n",rc);
}
static void test_hw_buffers(void) @@ -956,16 +956,16 @@ static void test_hw_buffers(void)
hr = DirectSoundCreate8(NULL, &ds, NULL); ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate8 failed: %08x\n", hr);
"DirectSoundCreate8 failed: %08lx\n", hr);
if(hr != S_OK) return;
caps.dwSize = sizeof(caps);
hr = IDirectSound8_GetCaps(ds, &caps);
- ok(hr == S_OK, "GetCaps failed: %08x\n", hr);
- ok(hr == S_OK, "GetCaps failed: %08lx\n", hr);
- ok(caps.dwPrimaryBuffers == 1, "Got wrong number of primary buffers: %u\n",
ok(caps.dwPrimaryBuffers == 1, "Got wrong number of primary buffers: %lu\n", caps.dwPrimaryBuffers);
/* DSBCAPS_LOC* is ignored for primary buffers */
@@ -978,7 +978,7 @@ static void test_hw_buffers(void) bufdesc.guid3DAlgorithm = GUID_NULL;
hr = IDirectSound8_CreateSoundBuffer(ds, &bufdesc, &primary, NULL);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08lx\n", hr); if(hr != S_OK){ IDirectSound8_Release(ds); return;
@@ -988,7 +988,7 @@ static void test_hw_buffers(void) DSBCAPS_PRIMARYBUFFER;
hr = IDirectSound8_CreateSoundBuffer(ds, &bufdesc, &primary2, NULL);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08lx\n", hr); ok(primary == primary2, "Got different primary buffers: %p, %p\n", primary, primary2); if(hr == S_OK) IDirectSoundBuffer_Release(primary2);
@@ -996,7 +996,7 @@ static void test_hw_buffers(void) buf8 = (IDirectSoundBuffer8 *)0xDEADBEEF; hr = IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundBuffer8, (void**)&buf8);
- ok(hr == E_NOINTERFACE, "QueryInterface gave wrong failure: %08x\n", hr);
ok(hr == E_NOINTERFACE, "QueryInterface gave wrong failure: %08lx\n", hr); ok(buf8 == NULL, "Pointer didn't get set to NULL\n");
fmt.wFormatTag = WAVE_FORMAT_PCM;
@@ -1016,21 +1016,21 @@ static void test_hw_buffers(void) sizeof(IDirectSoundBuffer *) * caps.dwMaxHwMixingAllBuffers);
/* try to fill all of the hw buffers */
- trace("dwMaxHwMixingAllBuffers: %u\n", caps.dwMaxHwMixingAllBuffers);
- trace("dwMaxHwMixingStaticBuffers: %u\n", caps.dwMaxHwMixingStaticBuffers);
- trace("dwMaxHwMixingStreamingBuffers: %u\n", caps.dwMaxHwMixingStreamingBuffers);
- trace("dwMaxHwMixingAllBuffers: %lu\n", caps.dwMaxHwMixingAllBuffers);
- trace("dwMaxHwMixingStaticBuffers: %lu\n", caps.dwMaxHwMixingStaticBuffers);
- trace("dwMaxHwMixingStreamingBuffers: %lu\n", caps.dwMaxHwMixingStreamingBuffers); for(i = 0; i < caps.dwMaxHwMixingAllBuffers; ++i){ hr = IDirectSound8_CreateSoundBuffer(ds, &bufdesc, &secondaries[i], NULL); ok(hr == S_OK || hr == E_NOTIMPL || broken(hr == DSERR_CONTROLUNAVAIL) || broken(hr == E_FAIL),
"CreateSoundBuffer(%u) failed: %08x\n", i, hr);
"CreateSoundBuffer(%u) failed: %08lx\n", i, hr); if(hr != S_OK) break; bufcaps.dwSize = sizeof(bufcaps); hr = IDirectSoundBuffer_GetCaps(secondaries[i], &bufcaps);
ok(hr == S_OK, "GetCaps failed: %08x\n", hr);
ok(hr == S_OK, "GetCaps failed: %08lx\n", hr); ok((bufcaps.dwFlags & DSBCAPS_LOCHARDWARE) != 0,
"Buffer wasn't allocated in hardware, dwFlags: %x\n", bufcaps.dwFlags);
"Buffer wasn't allocated in hardware, dwFlags: %lx\n", bufcaps.dwFlags);
}
/* see if we can create one more */
@@ -1041,7 +1041,7 @@ static void test_hw_buffers(void) broken(hr == DSERR_CONTROLUNAVAIL) || /* vmware winxp, others? */ broken(hr == E_FAIL) || /* broken AC97 driver */ broken(hr == S_OK) /* broken driver allows more hw bufs than dscaps claims */,
"CreateSoundBuffer(%u) gave wrong error: %08x\n", i, hr);
if(hr == S_OK) IDirectSoundBuffer_Release(secondary);"CreateSoundBuffer(%u) gave wrong error: %08lx\n", i, hr);
@@ -1102,15 +1102,15 @@ static void test_first_device(void) win_skip("No default device found\n"); return; }
- ok(hr == S_OK, "GetDefaultAudioEndpoint failed: %08x\n", hr);
ok(hr == S_OK, "GetDefaultAudioEndpoint failed: %08lx\n", hr);
hr = IMMDevice_OpenPropertyStore(defdev, STGM_READ, &ps);
- ok(hr == S_OK, "OpenPropertyStore failed: %08x\n", hr);
ok(hr == S_OK, "OpenPropertyStore failed: %08lx\n", hr);
PropVariantInit(&pv);
hr = IPropertyStore_GetValue(ps, &PKEY_AudioEndpoint_GUID, &pv);
- ok(hr == S_OK, "GetValue failed: %08x\n", hr);
ok(hr == S_OK, "GetValue failed: %08lx\n", hr);
CLSIDFromString(pv.pwszVal, &default_info.guid);
@@ -1120,7 +1120,7 @@ static void test_first_device(void) IMMDeviceEnumerator_Release(devenum);
hr = DirectSoundEnumerateA(default_device_cb, NULL);
- ok(hr == S_OK, "DirectSoundEnumerateA failed: %08x\n", hr);
- ok(hr == S_OK, "DirectSoundEnumerateA failed: %08lx\n", hr);
}
static void test_COM(void) @@ -1135,39 +1135,39 @@ static void test_COM(void) hr = CoCreateInstance(&CLSID_DirectSound8, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&ds8); ok(hr == CLASS_E_NOAGGREGATION,
"DirectSound create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
"DirectSound create failed: %08lx, expected CLASS_E_NOAGGREGATION\n", hr);
ok(!ds8, "ds8 = %p\n", ds8);
/* Invalid RIID */ hr = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound3DBuffer, (void**)&ds8); ok(hr == E_NOINTERFACE,
"DirectSound create failed: %08x, expected E_NOINTERFACE\n", hr);
"DirectSound create failed: %08lx, expected E_NOINTERFACE\n", hr);
/* Same refcount for IDirectSound and IDirectSound8 */ hr = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void**)&ds8);
- ok(hr == S_OK, "DirectSound create failed: %08x, expected S_OK\n", hr);
- ok(hr == S_OK, "DirectSound create failed: %08lx, expected S_OK\n", hr); refcount = IDirectSound8_AddRef(ds8);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); hr = IDirectSound8_QueryInterface(ds8, &IID_IDirectSound, (void**)&ds);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound failed: %08lx\n", hr); refcount = IDirectSound8_AddRef(ds8);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
- ok(refcount == 4, "refcount == %lu, expected 4\n", refcount); refcount = IDirectSound_AddRef(ds);
- ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
/* Separate refcount for IUnknown */ hr = IDirectSound_QueryInterface(ds, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); refcount = IUnknown_AddRef(unk);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); hr = IDirectSound8_QueryInterface(ds8, &IID_IUnknown, (void**)&unk8);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); refcount = IUnknown_AddRef(unk8);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
- ok(refcount == 4, "refcount == %lu, expected 4\n", refcount); refcount = IDirectSound_AddRef(ds);
- ok(refcount == 6, "refcount == %u, expected 6\n", refcount);
ok(refcount == 6, "refcount == %lu, expected 6\n", refcount);
while (IDirectSound_Release(ds)); while (IUnknown_Release(unk));
@@ -1184,13 +1184,13 @@ static void test_primary_flags(void)
/* Create a DirectSound8 object */ rc = DirectSoundCreate8(NULL, &dso, NULL);
- ok(rc == DS_OK || rc==DSERR_NODRIVER, "Failed: %08x\n",rc);
ok(rc == DS_OK || rc==DSERR_NODRIVER, "Failed: %08lx\n",rc);
if (rc!=DS_OK) return;
rc = IDirectSound8_SetCooperativeLevel(dso, get_hwnd(), DSSCL_PRIORITY);
- ok(rc == DS_OK,"Failed: %08x\n", rc);
- ok(rc == DS_OK,"Failed: %08lx\n", rc); if (rc != DS_OK) { IDirectSound8_Release(dso); return;
@@ -1198,23 +1198,23 @@ static void test_primary_flags(void)
dscaps.dwSize = sizeof(dscaps); rc = IDirectSound8_GetCaps(dso, &dscaps);
- ok(rc == DS_OK,"Failed: %08x\n", rc);
- trace("0x%x\n", dscaps.dwFlags);
ok(rc == DS_OK,"Failed: %08lx\n", rc);
trace("0x%lx\n", dscaps.dwFlags);
ZeroMemory(&bufdesc, sizeof(bufdesc)); bufdesc.dwSize = sizeof(bufdesc); bufdesc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRLFX; rc = IDirectSound8_CreateSoundBuffer(dso, &bufdesc, &primary, NULL);
- ok(rc == E_INVALIDARG, "got %08x\n", rc);
ok(rc == E_INVALIDARG, "got %08lx\n", rc);
ZeroMemory(&bufdesc, sizeof(bufdesc)); bufdesc.dwSize = sizeof(bufdesc); bufdesc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRL3D; rc = IDirectSound8_CreateSoundBuffer(dso, &bufdesc, &primary, NULL);
- ok((rc == DS_OK && primary != NULL), "Failed to create a primary buffer: %08x\n", rc);
- ok((rc == DS_OK && primary != NULL), "Failed to create a primary buffer: %08lx\n", rc); if (rc == DS_OK) { rc = IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundFXI3DL2Reverb, (LPVOID*)&reverb);
ok(rc==E_NOINTERFACE,"Failed: %08x\n", rc);
ok(rc==E_NOINTERFACE,"Failed: %08lx\n", rc); IDirectSoundBuffer_Release(primary);
}
@@ -1292,8 +1292,8 @@ static HRESULT WINAPI dmo_SetInputType(IMediaObject *iface, DWORD index, const D
if (winetest_debug > 1) trace("SetInputType()\n");
- ok(!index, "Got unexpected index %u.\n", index);
- ok(!flags, "Got unexpected flags %#x.\n", flags);
ok(!index, "Got unexpected index %lu.\n", index);
ok(!flags, "Got unexpected flags %#lx.\n", flags);
ok(IsEqualGUID(&type->majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&type->majortype)); todo_wine ok(IsEqualGUID(&type->subtype, &MEDIASUBTYPE_PCM), "Got subtype %s.\n", debugstr_guid(&type->subtype));
@@ -1301,10 +1301,10 @@ static HRESULT WINAPI dmo_SetInputType(IMediaObject *iface, DWORD index, const D ok(!type->bTemporalCompression, "Got temporal compression %d.\n", type->bTemporalCompression); ok(IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx), "Got format type %s.\n", debugstr_guid(&type->formattype)); ok(!type->pUnk, "Got pUnk %p.\n", type->pUnk);
- ok(type->cbFormat == sizeof(WAVEFORMATEX), "Got format size %u.\n", type->cbFormat);
ok(type->cbFormat == sizeof(WAVEFORMATEX), "Got format size %lu.\n", type->cbFormat);
wfx = (WAVEFORMATEX *)type->pbFormat;
- todo_wine ok(type->lSampleSize == wfx->nBlockAlign, "Got sample size %u.\n", type->lSampleSize);
todo_wine ok(type->lSampleSize == wfx->nBlockAlign, "Got sample size %lu.\n", type->lSampleSize);
if (wfx->wBitsPerSample != 8) return DMO_E_TYPE_NOT_ACCEPTED;
@@ -1318,8 +1318,8 @@ static HRESULT WINAPI dmo_SetOutputType(IMediaObject *iface, DWORD index, const { if (winetest_debug > 1) trace("SetOutputType()\n");
- ok(!index, "Got unexpected index %u.\n", index);
- ok(!flags, "Got unexpected flags %#x.\n", flags);
ok(!index, "Got unexpected index %lu.\n", index);
ok(!flags, "Got unexpected flags %#lx.\n", flags);
ok(testdmo_input_type_set, "Expected the input type to be set.\n");
@@ -1327,10 +1327,10 @@ static HRESULT WINAPI dmo_SetOutputType(IMediaObject *iface, DWORD index, const ok(IsEqualGUID(&type->subtype, &MEDIASUBTYPE_PCM), "Got subtype %s.\n", debugstr_guid(&type->subtype)); ok(type->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", type->bFixedSizeSamples); ok(!type->bTemporalCompression, "Got temporal compression %d.\n", type->bTemporalCompression);
- ok(type->lSampleSize == 1, "Got sample size %u.\n", type->lSampleSize);
- ok(type->lSampleSize == 1, "Got sample size %lu.\n", type->lSampleSize); ok(IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx), "Got format type %s.\n", debugstr_guid(&type->formattype)); ok(!type->pUnk, "Got pUnk %p.\n", type->pUnk);
- ok(type->cbFormat == sizeof(WAVEFORMATEX), "Got format size %u.\n", type->cbFormat);
ok(type->cbFormat == sizeof(WAVEFORMATEX), "Got format size %lu.\n", type->cbFormat);
ok(!memcmp(type->pbFormat, &testdmo_input_type, sizeof(WAVEFORMATEX)), "Format blocks didn't match.\n");
@@ -1472,10 +1472,10 @@ static ULONG WINAPI dmo_inplace_Release(IMediaObjectInPlace *iface) static HRESULT WINAPI dmo_inplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags) {
- if (winetest_debug > 1) trace("Process(size %u)\n", size);
if (winetest_debug > 1) trace("Process(size %lu)\n", size);
ok(!start, "Got start time %s.\n", wine_dbgstr_longlong(start));
- ok(!flags, "Got flags %#x.\n", flags);
ok(!flags, "Got flags %#lx.\n", flags);
SetEvent(got_Process);
@@ -1574,12 +1574,12 @@ static void test_effects(void) ULONG ref;
hr = DirectSoundCreate8(NULL, &dsound, NULL);
- ok(hr == DS_OK || hr == DSERR_NODRIVER, "Got hr %#x.\n", hr);
ok(hr == DS_OK || hr == DSERR_NODRIVER, "Got hr %#lx.\n", hr); if (FAILED(hr)) return;
hr = IDirectSound8_SetCooperativeLevel(dsound, get_hwnd(), DSSCL_PRIORITY);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
effects[0].dwSize = effects[1].dwSize = sizeof(effects[0]); effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ;
@@ -1588,161 +1588,161 @@ static void test_effects(void) buffer_desc.dwBufferBytes = align(wfx.nAvgBytesPerSec * BUFFER_LEN / 1000, wfx.nBlockAlign); buffer_desc.lpwfxFormat = &wfx; hr = IDirectSound8_CreateSoundBuffer(dsound, &buffer_desc, &buffer, NULL);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer_QueryInterface(buffer, &IID_IDirectSoundBuffer8, (void **)&buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DSERR_CONTROLUNAVAIL, "Got hr %#x.\n", hr);
ok(hr == DSERR_CONTROLUNAVAIL, "Got hr %#lx.\n", hr);
IDirectSoundBuffer8_Release(buffer8); IDirectSoundBuffer_Release(buffer);
buffer_desc.dwFlags = DSBCAPS_CTRLFX | DSBCAPS_CTRLPOSITIONNOTIFY; hr = IDirectSound8_CreateSoundBuffer(dsound, &buffer_desc, &buffer, NULL);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer_QueryInterface(buffer, &IID_IDirectSoundBuffer8, (void **)&buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer8_QueryInterface(buffer, &IID_IDirectSoundNotify, (void **)¬ify);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
hr = IDirectSoundNotify_SetNotificationPositions(notify, 1, ¬ify_params);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
hr = IDirectSoundBuffer8_SetFX(buffer8, 1, NULL, NULL);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer8_SetFX(buffer8, 0, effects, NULL);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer8_SetFX(buffer8, 0, NULL, results);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
ok(hr == DSERR_INVALIDPARAM, "Got hr %#lx.\n", hr);
results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#lx.\n", results[0]);
hr = IDirectSoundBuffer8_Lock(buffer8, 0, 0, &ptr1, &size1, &ptr2, &size2, DSBLOCK_ENTIREBUFFER);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DSERR_INVALIDCALL, "Got hr %#x.\n", hr);
- todo_wine ok(results[0] == 0xdeadbeef, "Got result %#x.\n", results[0]);
- ok(hr == DSERR_INVALIDCALL, "Got hr %#lx.\n", hr);
- todo_wine ok(results[0] == 0xdeadbeef, "Got result %#lx.\n", results[0]); hr = IDirectSoundBuffer8_Unlock(buffer8, ptr1, size1, ptr2, size2);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
hr = IDirectSoundBuffer8_Play(buffer8, 0, 0, DSBPLAY_LOOPING);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DSERR_INVALIDCALL, "Got hr %#x.\n", hr);
- todo_wine ok(results[0] == 0xdeadbeef, "Got result %#x.\n", results[0]);
- ok(hr == DSERR_INVALIDCALL, "Got hr %#lx.\n", hr);
- todo_wine ok(results[0] == 0xdeadbeef, "Got result %#lx.\n", results[0]); hr = IDirectSoundBuffer8_Stop(buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(!WaitForSingleObject(notify_params.hEventNotify, 1000), "Wait timed out.\n");
effects[0].guidDSFXClass = GUID_NULL; results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr);
- ok(results[0] == DSFXR_UNKNOWN, "Got result %#x.\n", results[0]);
ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#lx.\n", hr);
ok(results[0] == DSFXR_UNKNOWN, "Got result %#lx.\n", results[0]);
effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ; results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#lx.\n", results[0]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, NULL);
- ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
ok(hr == DSERR_INVALIDPARAM, "Got hr %#lx.\n", hr);
dmo = (IMediaObject *)0xdeadbeef; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &GUID_NULL, (void **)&dmo);
- ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); ok(!dmo, "Got object %p.\n", dmo);
dmo = (IMediaObject *)0xdeadbeef; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_NULL, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#lx.\n", hr); ok(dmo == (IMediaObject *)0xdeadbeef, "Got object %p.\n", dmo);
dmo = NULL; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(!!dmo, "Expected a non-NULL object.\n"); IMediaObject_Release(dmo);
dmo = NULL; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(!!dmo, "Expected a non-NULL object.\n"); IMediaObject_Release(dmo);
dmo = (IMediaObject *)0xdeadbeef; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#lx.\n", hr); ok(dmo == (IMediaObject *)0xdeadbeef, "Got object %p.\n", dmo);
effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ; effects[1].guidDSFXClass = GUID_NULL; results[0] = results[1] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
- ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr);
- ok(results[0] == DSFXR_PRESENT, "Got result %#x.\n", results[0]);
- ok(results[1] == DSFXR_UNKNOWN, "Got result %#x.\n", results[1]);
ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#lx.\n", hr);
ok(results[0] == DSFXR_PRESENT, "Got result %#lx.\n", results[0]);
ok(results[1] == DSFXR_UNKNOWN, "Got result %#lx.\n", results[1]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
- todo_wine ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
todo_wine ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#lx.\n", hr);
effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ; effects[1].guidDSFXClass = GUID_DSFX_STANDARD_I3DL2REVERB; results[0] = results[1] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
- ok(results[1] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[1]);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#lx.\n", results[0]);
ok(results[1] == DSFXR_LOCSOFTWARE, "Got result %#lx.\n", results[1]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); echo = dmo; hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); reverb = dmo;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(dmo == echo, "Expected %p, got %p.\n", echo, dmo); IMediaObject_Release(dmo);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(dmo == reverb, "Expected %p, got %p.\n", reverb, dmo); IMediaObject_Release(dmo);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_I3DL2REVERB, 1, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#lx.\n", hr);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IDirectSoundFXParamEq, (void **)&unk);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); IUnknown_Release(unk);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IDirectSoundFXParamEq, (void **)&unk);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); IUnknown_Release(unk);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
- ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); IUnknown_Release(unk);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); IUnknown_Release(unk);
IMediaObject_Release(echo);
@@ -1753,60 +1753,60 @@ static void test_effects(void) effects[0].guidDSFXClass = testdmo_clsid; results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
- todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
todo_wine ok(hr == DS_OK, "Got hr %#lx.\n", hr);
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#lx.\n", results[0]); todo_wine ok(!memcmp(&testdmo_input_type, &wfx, sizeof(WAVEFORMATEX)), "Format blocks didn't match.\n");
ResetEvent(notify_params.hEventNotify); hr = IDirectSoundBuffer8_Play(buffer8, 0, 0, 0);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); todo_wine ok(got_Discontinuity == 1, "Got %u calls to IMediaObject::Discontinuity().\n", got_Discontinuity);
todo_wine ok(!WaitForSingleObject(got_Process, 100), "Wait timed out.\n");
hr = IDirectSoundBuffer8_Stop(buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); todo_wine ok(got_Discontinuity == 1, "Got %u calls to IMediaObject::Discontinuity().\n", got_Discontinuity); ok(!WaitForSingleObject(notify_params.hEventNotify, 1000), "Wait timed out.\n");
ResetEvent(notify_params.hEventNotify); hr = IDirectSoundBuffer8_Play(buffer8, 0, 0, 0);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); todo_wine ok(got_Discontinuity == 2, "Got %u calls to IMediaObject::Discontinuity().\n", got_Discontinuity);
hr = IDirectSoundBuffer8_Stop(buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr); ok(!WaitForSingleObject(notify_params.hEventNotify, 1000), "Wait timed out.\n");
hr = IDirectSoundBuffer8_SetFX(buffer8, 0, NULL, NULL);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
- ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#lx.\n", hr);
CloseHandle(got_Process); IDirectSoundBuffer8_Release(buffer8); ref = IDirectSoundBuffer_Release(buffer);
- ok(!ref, "Got outstanding refcount %u.\n", ref);
ok(!ref, "Got outstanding refcount %lu.\n", ref);
init_format(&wfx, WAVE_FORMAT_PCM, 11025, 16, 1); hr = IDirectSound8_CreateSoundBuffer(dsound, &buffer_desc, &buffer, NULL);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
- ok(hr == DS_OK, "Got hr %#lx.\n", hr); hr = IDirectSoundBuffer_QueryInterface(buffer, &IID_IDirectSoundBuffer8, (void **)&buffer8);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
results[0] = 0xdeadbeef; hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
- ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
- todo_wine ok(results[0] == DSFXR_UNKNOWN, "Got result %#x.\n", results[0]);
ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr);
todo_wine ok(results[0] == DSFXR_UNKNOWN, "Got result %#lx.\n", results[0]);
IDirectSoundNotify_Release(notify); IDirectSoundBuffer8_Release(buffer8); ref = IDirectSoundBuffer_Release(buffer);
- ok(!ref, "Got outstanding refcount %u.\n", ref);
ok(!ref, "Got outstanding refcount %lu.\n", ref);
ref = IDirectSound8_Release(dsound);
- ok(!ref, "Got outstanding refcount %u.\n", ref);
- ok(!ref, "Got outstanding refcount %lu.\n", ref);
}
static void test_AcquireResources(void) @@ -1818,12 +1818,12 @@ static void test_AcquireResources(void) HRESULT hr;
hr = DirectSoundCreate8(NULL, &dsound, NULL);
- ok(hr == DS_OK || hr == DSERR_NODRIVER, "Got hr %#x.\n", hr);
ok(hr == DS_OK || hr == DSERR_NODRIVER, "Got hr %#lx.\n", hr); if (FAILED(hr)) return;
hr = IDirectSound8_SetCooperativeLevel(dsound, get_hwnd(), DSSCL_PRIORITY);
- ok(hr == DS_OK, "Got hr %#x.\n", hr);
ok(hr == DS_OK, "Got hr %#lx.\n", hr);
bufdesc.dwSize = sizeof(bufdesc); bufdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_PRIMARYBUFFER;
@@ -1833,7 +1833,7 @@ static void test_AcquireResources(void) bufdesc.guid3DAlgorithm = GUID_NULL;
hr = IDirectSound8_CreateSoundBuffer(dsound, &bufdesc, &primary, NULL);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "CreateSoundBuffer failed: %08lx\n", hr); if(hr != S_OK) { IDirectSound_Release(dsound); return;
@@ -1853,26 +1853,26 @@ static void test_AcquireResources(void)
/* see if we can create one more */ hr = IDirectSound8_CreateSoundBuffer(dsound, &bufdesc, &secondary, NULL);
- ok(hr == S_OK, "CreateSoundBuffer gave wrong error: %08x\n", hr);
ok(hr == S_OK, "CreateSoundBuffer gave wrong error: %08lx\n", hr); if(hr == S_OK) { DWORD status; IDirectSoundBuffer8 *buffer8;
hr = IDirectSoundBuffer_QueryInterface(secondary, &IID_IDirectSoundBuffer8, (void **)&buffer8);
ok(hr == S_OK, "got: %08x\n", hr);
ok(hr == S_OK, "got: %08lx\n", hr); status = 0xFFFF; hr = IDirectSoundBuffer8_GetStatus(buffer8, &status);
ok(hr == S_OK, "got: %08x\n", hr);
todo_wine ok(status == 0, "got: %08x\n", status);
ok(hr == S_OK, "got: %08lx\n", hr);
todo_wine ok(status == 0, "got: %08lx\n", status); hr = IDirectSoundBuffer8_AcquireResources(buffer8, 0, 0, NULL);
ok(hr == S_OK, "got: %08x\n", hr);
ok(hr == S_OK, "got: %08lx\n", hr); status = 0xFFFF; hr = IDirectSoundBuffer8_GetStatus(buffer8, &status);
ok(hr == S_OK, "got: %08x\n", hr);
ok(status == DSBSTATUS_LOCSOFTWARE, "got: %08x\n", status);
ok(hr == S_OK, "got: %08lx\n", hr);
ok(status == DSBSTATUS_LOCSOFTWARE, "got: %08lx\n", status); IDirectSoundBuffer8_Release(buffer8); IDirectSoundBuffer_Release(secondary);
@@ -1899,7 +1899,7 @@ START_TEST(dsound8)
hr = CoRegisterClassObject(&testdmo_clsid, (IUnknown *)&testdmo_cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie);
- ok(hr == S_OK, "Failed to register class, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to register class, hr %#lx.\n", hr);
test_effects();
diff --git a/dlls/dsound/tests/duplex.c b/dlls/dsound/tests/duplex.c index 59507c566c1..3ea1aabe20a 100644 --- a/dlls/dsound/tests/duplex.c +++ b/dlls/dsound/tests/duplex.c @@ -43,7 +43,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
/* Try to Query for objects */ rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IUnknown,(LPVOID*)&unknown);
- ok(rc==DS_OK,"IDirectSoundFullDuplex_QueryInterface(IID_IUnknown) failed: %08x\n", rc);
- ok(rc==DS_OK,"IDirectSoundFullDuplex_QueryInterface(IID_IUnknown) failed: %08lx\n", rc); if (rc==DS_OK) { ref = IUnknown_Release(unknown); ok(ref==0, "IDirectSoundFullDuplex_Release() has %d references, "
@@ -51,7 +51,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo, }
rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IDirectSound,(LPVOID*)&ds);
- ok(rc==(initialized?DS_OK:E_NOINTERFACE),"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSound) failed: %08x\n", rc);
- ok(rc==(initialized?DS_OK:E_NOINTERFACE),"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSound) failed: %08lx\n", rc); if (rc==DS_OK) { ref=IDirectSound_Release(ds); ok(ref==0, "IDirectSound_Release() has %d references, "
@@ -60,12 +60,12 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IDirectSound8,(LPVOID*)&ds8); ok(rc==(initialized?DS_OK:E_NOINTERFACE),"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSound8) "
"failed: %08x\n",rc);
if (rc==DS_OK) { IDirectSoundFullDuplex * dsfd1; rc=IDirectSound8_QueryInterface(ds8,&IID_IDirectSoundFullDuplex,(LPVOID*)&dsfd1); ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSoundFullDuplex) ""failed: %08lx\n",rc);
"failed: %08x\n",rc);
"failed: %08lx\n",rc); if (rc==DS_OK) { ref=IDirectSoundFullDuplex_Release(dsfd1); ok(ref==1, "IDirectSoundFullDuplex_Release() has %d references, "
@@ -78,7 +78,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IDirectSoundCapture,(LPVOID*)&dsc); ok(rc==(initialized?DS_OK:E_NOINTERFACE),"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSoundCapture) "
"failed: %08x\n",rc);
if (rc==DS_OK) { ref=IDirectSoundCapture_Release(dsc); ok(ref==0, "IDirectSoundCapture_Release() has %d references, ""failed: %08lx\n",rc);
@@ -87,7 +87,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IDirectSoundFullDuplex,(LPVOID*)&dsfd); ok(rc==DS_OK,"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSoundFullDuplex) "
"failed: %08x\n",rc);
if (rc==DS_OK) { ok(dsfdo==dsfd, "different interfaces\n"); ref=IDirectSoundFullDuplex_Release(dsfd);"failed: %08lx\n",rc);
@@ -116,7 +116,7 @@ static void IDirectSoundFullDuplex_tests(void) CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex, (void**)&dsfdo); ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG||rc==CLASS_E_CLASSNOTAVAILABLE,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
if (rc==REGDB_E_CLASSNOTREG) { trace(" Class Not Registered\n"); return;"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08lx\n", rc);
@@ -132,7 +132,7 @@ static void IDirectSoundFullDuplex_tests(void) rc=CoCreateInstance(&CLSID_DirectSoundFullDuplex, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex, (void**)&dsfdo);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08lx\n", rc); if (dsfdo) IDirectSoundFullDuplex_test(dsfdo, FALSE, &DSDEVID_DefaultCapture, &DSDEVID_DefaultPlayback);
@@ -142,7 +142,7 @@ static void IDirectSoundFullDuplex_tests(void) rc=CoCreateInstance(&CLSID_DirectSoundFullDuplex, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex, (void**)&dsfdo);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
- ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08lx\n", rc); if (dsfdo) IDirectSoundFullDuplex_test(dsfdo, FALSE, &DSDEVID_DefaultVoiceCapture, &DSDEVID_DefaultVoicePlayback);
@@ -154,7 +154,7 @@ static void IDirectSoundFullDuplex_tests(void) (void**)&dsfdo); ok(rc==E_NOINTERFACE, "CoCreateInstance(CLSID_DirectSoundFullDuplex,CLSID_DirectSoundPrivate) "
"should have failed: 0x%08x\n", rc);
"should have failed: 0x%08lx\n", rc);
ZeroMemory(&wfex, sizeof(wfex)); wfex.wFormatTag = WAVE_FORMAT_PCM;
@@ -180,7 +180,7 @@ static void IDirectSoundFullDuplex_tests(void) rc = DirectSoundFullDuplexCreate(NULL, NULL, &DSCBufferDesc, &DSBufferDesc, get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(NULL,NULL) failed: %08x\n",rc);
if (rc==S_OK && dsfdo) IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);"DirectSoundFullDuplexCreate(NULL,NULL) failed: %08lx\n",rc);
@@ -190,7 +190,7 @@ static void IDirectSoundFullDuplex_tests(void) DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8,&pDSBuffer8, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL, "DirectSoundFullDuplexCreate(DSDEVID_DefaultCapture,"
"DSDEVID_DefaultPlayback) failed: %08x\n", rc);
if (rc==DS_OK && dsfdo) IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);"DSDEVID_DefaultPlayback) failed: %08lx\n", rc);
@@ -200,7 +200,7 @@ static void IDirectSoundFullDuplex_tests(void) get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL, "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoiceCapture,"
"DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
if (rc==DS_OK && dsfdo) IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);"DSDEVID_DefaultVoicePlayback) failed: %08lx\n", rc);
@@ -210,7 +210,7 @@ static void IDirectSoundFullDuplex_tests(void) get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL); ok(rc==DSERR_NODRIVER||rc==DSERR_INVALIDCALL, "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback,"
"DSDEVID_DefaultVoiceCapture) should have failed: %08x\n", rc);
if (rc==DS_OK && dsfdo) IDirectSoundFullDuplex_Release(dsfdo);"DSDEVID_DefaultVoiceCapture) should have failed: %08lx\n", rc);
} @@ -234,33 +234,33 @@ static void test_COM(void) hr = CoCreateInstance(&CLSID_DirectSoundFullDuplex, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&dsfd); ok(hr == CLASS_E_NOAGGREGATION,
"DirectSoundFullDuplex create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
"DirectSoundFullDuplex create failed: %08lx, expected CLASS_E_NOAGGREGATION\n", hr);
ok(!dsfd, "dsfd = %p\n", dsfd);
/* Invalid RIID */ hr = CoCreateInstance(&CLSID_DirectSoundFullDuplex, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound3DBuffer, (void**)&dsfd); ok(hr == E_NOINTERFACE,
"DirectSoundFullDuplex create failed: %08x, expected E_NOINTERFACE\n", hr);
"DirectSoundFullDuplex create failed: %08lx, expected E_NOINTERFACE\n", hr);
/* Different refcount for IDirectSoundFullDuplex and for IUnknown */ hr = CoCreateInstance(&CLSID_DirectSoundFullDuplex, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex, (void**)&dsfd);
- ok(hr == S_OK, "DirectSoundFullDuplex create failed: %08x, expected S_OK\n", hr);
- ok(hr == S_OK, "DirectSoundFullDuplex create failed: %08lx, expected S_OK\n", hr); refcount = IDirectSoundFullDuplex_AddRef(dsfd);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); refcount = IUnknown_AddRef(unk);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
/* Not initialized */ hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IDirectSound8, (void**)&ds8); ok(hr == E_NOINTERFACE,
"QueryInterface for IID_IDirectSound8 failed: %08x, expected E_NOINTERFACE\n", hr);
hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IDirectSoundCapture, (void**)&dsc); ok(hr == E_NOINTERFACE,"QueryInterface for IID_IDirectSound8 failed: %08lx, expected E_NOINTERFACE\n", hr);
"QueryInterface for IID_IDirectSoundCapture failed: %08x, expected E_NOINTERFACE\n", hr);
"QueryInterface for IID_IDirectSoundCapture failed: %08lx, expected E_NOINTERFACE\n", hr);
init_format(&wfx, WAVE_FORMAT_PCM, 44100, 16, 1); ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -274,49 +274,49 @@ static void test_COM(void) hr = IDirectSoundFullDuplex_Initialize(dsfd, NULL, NULL, &cbufdesc, &bufdesc, get_hwnd(), DSSCL_EXCLUSIVE, NULL, NULL); ok(hr == E_INVALIDARG,
"IDirectSoundFullDuplex_Initialize failed: %08x, expected E_INVALIDARG\n", hr);
hr = IDirectSoundFullDuplex_Initialize(dsfd, NULL, NULL, &cbufdesc, &bufdesc, get_hwnd(), DSSCL_EXCLUSIVE, &dscb8, &dsb8); if (hr == DSERR_NODRIVER || hr == DSERR_INVALIDCALL) { skip("No driver\n"); return; }"IDirectSoundFullDuplex_Initialize failed: %08lx, expected E_INVALIDARG\n", hr);
- ok(hr == S_OK, "IDirectSoundFullDuplex_Initialize failed: %08x\n", hr);
ok(hr == S_OK, "IDirectSoundFullDuplex_Initialize failed: %08lx\n", hr);
/* IDirectSound and IDirectSound8 */ hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IDirectSound8, (void**)&ds8);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound8 failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound8 failed: %08lx\n", hr); refcount = IDirectSound8_AddRef(ds8);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IDirectSound, (void**)&ds);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSound failed: %08lx\n", hr); refcount = IDirectSound8_AddRef(ds8);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
- ok(refcount == 4, "refcount == %lu, expected 4\n", refcount); refcount = IDirectSound_AddRef(ds);
- ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
- ok(refcount == 5, "refcount == %lu, expected 5\n", refcount); hr = IDirectSound8_QueryInterface(ds8, &IID_IUnknown, (void**)&unk8);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); ok(unk == unk8, "Got different IUnknown when QI'ing IDirectSoundFullDuplex and IDirectSound\n"); refcount = IUnknown_AddRef(unk8);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
- ok(refcount == 4, "refcount == %lu, expected 4\n", refcount); refcount = IDirectSound_AddRef(ds);
- ok(refcount == 6, "refcount == %u, expected 6\n", refcount);
- ok(refcount == 6, "refcount == %lu, expected 6\n", refcount); refcount = IDirectSoundFullDuplex_AddRef(dsfd);
- ok(refcount == 3, "refcount == %u, expected 3\n", refcount);
ok(refcount == 3, "refcount == %lu, expected 3\n", refcount);
/* IDirectSoundCapture */ hr = IDirectSoundFullDuplex_QueryInterface(dsfd, &IID_IDirectSoundCapture, (void**)&dsc);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSoundCapture failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IDirectSoundCapture failed: %08lx\n", hr); refcount = IDirectSoundCapture_AddRef(dsc);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
- ok(refcount == 2, "refcount == %lu, expected 2\n", refcount); refcount = IDirectSoundFullDuplex_AddRef(dsfd);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
- ok(refcount == 4, "refcount == %lu, expected 4\n", refcount); hr = IDirectSound8_QueryInterface(ds8, &IID_IUnknown, (void**)&unk8);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08lx\n", hr); ok(unk == unk8, "Got different IUnknown when QI'ing IDirectSoundFullDuplex and IDirectSoundCapture\n"); refcount = IUnknown_AddRef(unk8);
- ok(refcount == 6, "refcount == %u, expected 6\n", refcount);
ok(refcount == 6, "refcount == %lu, expected 6\n", refcount);
IDirectSoundBuffer8_Release(dsb8); IDirectSoundCaptureBuffer8_Release(dscb8);
diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c index 94f0d36345f..71040a70c77 100644 --- a/dlls/dsound/tests/propset.c +++ b/dlls/dsound/tests/propset.c @@ -67,7 +67,7 @@ static BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA dat trace(" Description: %s\n", data->Description); trace(" Module: %s\n", data->Module); trace(" Interface: %s\n", data->Interface);
- trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
trace(" WaveDeviceId: %ld\n", data->WaveDeviceId);
return TRUE;
} @@ -94,7 +94,7 @@ static BOOL CALLBACK callback1(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA trace(" ModuleA: %s\n", data->ModuleA); WideCharToMultiByte(CP_ACP, 0, data->ModuleW, -1, moduleA, sizeof(moduleA), NULL, NULL); trace(" ModuleW: %s\n", moduleA);
- trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
trace(" WaveDeviceId: %ld\n", data->WaveDeviceId);
return TRUE;
} @@ -115,7 +115,7 @@ static BOOL CALLBACK callbackA(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA trace(" Description: %s\n", data->Description); trace(" Module: %s\n", data->Module); trace(" Interface: %s\n", data->Interface);
- trace(" WaveDeviceId: %d\n", data->WaveDeviceId);
trace(" WaveDeviceId: %ld\n", data->WaveDeviceId);
return TRUE;
} @@ -143,7 +143,7 @@ static BOOL CALLBACK callbackW(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA trace("\tDescription: %s\n", descriptionA); trace("\tModule: %s\n", moduleA); trace("\tInterface: %s\n", interfaceA);
- trace("\tWaveDeviceId: %d\n", data->WaveDeviceId);
trace("\tWaveDeviceId: %ld\n", data->WaveDeviceId);
return TRUE;
} @@ -160,20 +160,20 @@ static void propset_private_tests(void) rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IClassFactory, NULL); ok(rc==DSERR_INVALIDPARAM,"DllGetClassObject(CLSID_DirectSound, " "IID_IClassFactory) should have returned DSERR_INVALIDPARAM, "
"returned: %08x\n",rc);
"returned: %08lx\n",rc);
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IDirectSound, (void **)(&pcf)); ok(rc==E_NOINTERFACE,"DllGetClassObject(CLSID_DirectSound, " "IID_IDirectSound) should have returned E_NOINTERFACE, "
"returned: %08x\n",rc);
"returned: %08lx\n",rc);
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IUnknown, (void **)(&pcf)); ok(rc==DS_OK,"DllGetClassObject(CLSID_DirectSound, "
"IID_IUnknown) failed: %08x\n",rc);
"IID_IUnknown) failed: %08lx\n",rc);
rc = (pDllGetClassObject)(&CLSID_DirectSound, &IID_IClassFactory, (void **)(&pcf)); ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
"failed: %08x\n",rc);
if (pcf==0) return;"failed: %08lx\n",rc);
@@ -182,17 +182,17 @@ static void propset_private_tests(void) rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, NULL); ok(rc==DSERR_INVALIDPARAM, "CreateInstance(IID_IKsPropertySet) should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
"returned DSERR_INVALIDPARAM, returned: %08lx\n",rc);
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %08x\n",rc);
"returned E_NOINTERFACE, returned: %08lx\n",rc);
/* and the direct sound 8 version */ rc = pDllGetClassObject(&CLSID_DirectSound8, &IID_IClassFactory, (void **)&pcf); ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
"failed: %08x\n",rc);
if (pcf==0) return;"failed: %08lx\n",rc);
@@ -200,12 +200,12 @@ static void propset_private_tests(void) rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %08x\n",rc);
"returned E_NOINTERFACE, returned: %08lx\n",rc);
/* try direct sound capture next */ rc = pDllGetClassObject(&CLSID_DirectSoundCapture, &IID_IClassFactory, (void **)&pcf); ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %08x\n",rc);
if (pcf==0) return;"failed: %08lx\n",rc);
@@ -213,12 +213,12 @@ static void propset_private_tests(void) rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE,returned: %08x\n",rc);
"returned E_NOINTERFACE,returned: %08lx\n",rc);
/* and the direct sound capture 8 version */ rc = pDllGetClassObject(&CLSID_DirectSoundCapture8, &IID_IClassFactory, (void **)&pcf); ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
"IID_IClassFactory) failed: %08x\n",rc);
if (pcf==0) return;"IID_IClassFactory) failed: %08lx\n",rc);
@@ -226,13 +226,13 @@ static void propset_private_tests(void) rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %08x\n",rc);
"returned E_NOINTERFACE, returned: %08lx\n",rc);
/* try direct sound full duplex next */ rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory, (void **)(&pcf)); ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
"IID_IClassFactory) failed: %08x\n",rc);
if (pcf==0) return;"IID_IClassFactory) failed: %08lx\n",rc);
@@ -240,7 +240,7 @@ static void propset_private_tests(void) rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned NOINTERFACE, returned: %08x\n",rc);
"returned NOINTERFACE, returned: %08lx\n",rc);
/* try direct sound private last */ rc = (pDllGetClassObject)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
@@ -253,7 +253,7 @@ static void propset_private_tests(void) /* direct sound private does have an IKsPropertySet */ rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps));
- ok(rc==DS_OK, "CreateInstance(IID_IKsPropertySet) failed: %08x\n",
- ok(rc==DS_OK, "CreateInstance(IID_IKsPropertySet) failed: %08lx\n", rc); if (rc!=DS_OK) return;
@@ -264,7 +264,7 @@ static void propset_private_tests(void) &support); ok(rc==DS_OK||rc==E_INVALIDARG, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %08x\n",
if (rc!=DS_OK) { if (rc==E_INVALIDARG)"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %08lx\n", rc);
@@ -274,10 +274,10 @@ static void propset_private_tests(void)
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: ""support = 0x%lx\n",support);
"support = 0x%x\n",support);
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
@@ -285,7 +285,7 @@ static void propset_private_tests(void) &support); ok(rc==DS_OK||rc==E_INVALIDARG, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1) failed: %08x\n",
if (rc!=DS_OK) { if (rc==E_INVALIDARG)"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1) failed: %08lx\n", rc);
@@ -295,10 +295,10 @@ static void propset_private_tests(void)
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: ""support = 0x%lx\n",support);
"support = 0x%x\n",support);
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
@@ -306,7 +306,7 @@ static void propset_private_tests(void) &support); ok(rc==DS_OK||rc==E_INVALIDARG, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A) failed: %08x\n",
if (rc!=DS_OK) { if (rc==E_INVALIDARG)"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A) failed: %08lx\n", rc);
@@ -316,10 +316,10 @@ static void propset_private_tests(void)
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: ""support = 0x%lx\n",support);
"support = 0x%x\n",support);
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
@@ -327,7 +327,7 @@ static void propset_private_tests(void) &support); ok(rc==DS_OK||rc==E_INVALIDARG, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W) failed: %08x\n",
if (rc!=DS_OK) { if (rc==E_INVALIDARG)"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W) failed: %08lx\n", rc);
@@ -337,58 +337,58 @@ static void propset_private_tests(void)
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: ""support = 0x%lx\n",support);
"support = 0x%x\n",support);
"support = 0x%lx\n",support);
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: support = ""support = 0x%lx\n",support);
"0x%x\n",support);
"0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: support = ""support = 0x%lx\n",support);
"0x%x\n",support);
"0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W */ rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET), "Shouldn't be able to set " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: support = ""support = 0x%lx\n",support);
"0x%x\n",support);
"0x%lx\n",support);
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE */ trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE ***\n");
@@ -396,16 +396,16 @@ static void propset_private_tests(void) DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set ""support = 0x%lx\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%x\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%lx\n",support);
if (support & KSPROPERTY_SUPPORT_GET) { DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA data;
@@ -417,7 +417,7 @@ static void propset_private_tests(void) rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE, NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 */
@@ -426,16 +426,16 @@ static void propset_private_tests(void) DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set ""support = 0x%lx\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: support = 0x%x\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: support = 0x%lx\n",support);
if (support & KSPROPERTY_SUPPORT_GET) { DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA data;
@@ -447,7 +447,7 @@ static void propset_private_tests(void) rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1, NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A */
@@ -456,16 +456,16 @@ static void propset_private_tests(void) DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set ""support = 0x%lx\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: support = 0x%x\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: support = 0x%lx\n",support);
if (support & KSPROPERTY_SUPPORT_GET) { DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA data;
@@ -477,7 +477,7 @@ static void propset_private_tests(void) rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A, NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W */
@@ -486,16 +486,16 @@ static void propset_private_tests(void) DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W) failed: %08x\n",
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W) failed: %08lx\n", rc);
if (rc!=DS_OK) return;
ok(support & KSPROPERTY_SUPPORT_GET, "Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: "
"support = 0x%x\n",support);
ok(!(support & KSPROPERTY_SUPPORT_SET),"Shouldn't be able to set ""support = 0x%lx\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: support = 0x%x\n",support);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: support = 0x%lx\n",support);
if (support & KSPROPERTY_SUPPORT_GET) { DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
@@ -507,7 +507,7 @@ static void propset_private_tests(void) rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W, NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc);
} IKsPropertySet_Release(pps);ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
} @@ -529,7 +529,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
rc = DirectSoundCreate(lpGuid, &dso, NULL); ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) { if (rc==DSERR_NODRIVER) trace(" No Driver\n");"DirectSoundCreate() failed: %08lx\n",rc);
@@ -543,7 +543,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, /* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n",
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08lx\n", rc); if (rc!=DS_OK) goto EXIT;
@@ -557,7 +557,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ok((rc==DS_OK&&primary!=NULL) || broken(rc==DSERR_INVALIDPARAM), "IDirectSound_CreateSoundBuffer() failed to "
"create a hardware 3D primary buffer: %08x\n",rc);
if(rc==DSERR_INVALIDPARAM) { skip("broken driver\n"); goto EXIT;"create a hardware 3D primary buffer: %08lx\n",rc);
@@ -575,11 +575,11 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.dwFlags=DSBCAPS_CTRLDEFAULT|DSBCAPS_GETCURRENTPOSITION2; bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec; bufdesc.lpwfxFormat=&wfx;
trace(" Testing a secondary buffer at %dx%dx%d\n",
trace(" Testing a secondary buffer at %ldx%dx%d\n", wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); 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: %08lx\n",rc); if (rc==DS_OK&&secondary!=NULL) { IKsPropertySet * pPropertySet=NULL; rc=IDirectSoundBuffer_QueryInterface(secondary,
@@ -671,7 +671,7 @@ static void propset_buffer_tests(void) { HRESULT rc; rc = DirectSoundEnumerateA(dsenum_callback, NULL);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
- ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08lx\n",rc); trace("tested %u DirectSound drivers\n", driver_count);
}