Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ca681835
Commit
ca681835
authored
Jul 08, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Don't depend on the dxerr8 static library in the tests.
parent
b648dac7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
493 additions
and
743 deletions
+493
-743
Makefile.in
dlls/dsound/tests/Makefile.in
+1
-1
capture.c
dlls/dsound/tests/capture.c
+49
-85
ds3d.c
dlls/dsound/tests/ds3d.c
+94
-155
ds3d8.c
dlls/dsound/tests/ds3d8.c
+94
-154
dsound.c
dlls/dsound/tests/dsound.c
+107
-154
dsound8.c
dlls/dsound/tests/dsound8.c
+90
-126
duplex.c
dlls/dsound/tests/duplex.c
+14
-23
propset.c
dlls/dsound/tests/propset.c
+44
-45
No files found.
dlls/dsound/tests/Makefile.in
View file @
ca681835
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
dsound.dll
IMPORTS
=
dxerr8
ole32 version user32 kernel32
IMPORTS
=
ole32 version user32 kernel32
CTESTS
=
\
capture.c
\
...
...
dlls/dsound/tests/capture.c
View file @
ca681835
...
...
@@ -25,7 +25,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "mmreg.h"
#include "dxerr8.h"
#include "dsconf.h"
#include "dsound_test.h"
...
...
@@ -112,14 +111,14 @@ static void IDirectSoundCapture_test(LPDIRECTSOUNDCAPTURE dsco,
rc
=
IDirectSoundCapture_QueryInterface
(
dsco
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
unknown
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_QueryInterface(IID_IUnknown) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSoundCapture_Release
(
unknown
);
rc
=
IDirectSoundCapture_QueryInterface
(
dsco
,
&
IID_IDirectSoundCapture
,
(
LPVOID
*
)
&
dsc
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_QueryInterface(IID_IDirectSoundCapture) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSoundCapture_Release
(
dsc
);
...
...
@@ -128,19 +127,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DSERR_UNINITIALIZED or E_INVALIDARG, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSoundCapture_GetCaps
(
dsco
,
&
dsccaps
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSoundCapture_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundCapture_Initialize() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DSERR_NODRIVER
||
rc
==
E_INVALIDARG
)
{
trace
(
" No Driver
\n
"
);
goto
EXIT
;
...
...
@@ -155,29 +151,25 @@ static void IDirectSoundCapture_test(LPDIRECTSOUNDCAPTURE dsco,
rc
=
IDirectSoundCapture_Initialize
(
dsco
,
lpGuid
);
ok
(
rc
==
DSERR_ALREADYINITIALIZED
,
"IDirectSoundCapture_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_ALREADYINITIALIZED: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
ZeroMemory
(
&
dsccaps
,
sizeof
(
dsccaps
));
/* DSOUND: Error: Invalid caps buffer */
rc
=
IDirectSound_GetCaps
(
dsco
,
&
dsccaps
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
dsccaps
.
dwSize
=
sizeof
(
dsccaps
);
/* DSOUND: Running on a certified driver */
rc
=
IDirectSoundCapture_GetCaps
(
dsco
,
&
dsccaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_GetCaps() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSoundCapture_Release
(
dsco
);
...
...
@@ -196,18 +188,17 @@ static void IDirectSoundCapture_tests(void)
rc
=
CoGetClassObject
(
&
CLSID_DirectSoundCapture
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IClassFactory
,
(
void
**
)
&
cf
);
ok
(
rc
==
S_OK
,
"CoGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
rc
=
CoGetClassObject
(
&
CLSID_DirectSoundCapture
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
cf
);
ok
(
rc
==
S_OK
,
"CoGetClassObject(CLSID_DirectSoundCapture, IID_IUnknown) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
||
rc
==
REGDB_E_CLASSNOTREG
,
"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x
\n
"
,
rc
);
if
(
rc
==
REGDB_E_CLASSNOTREG
)
{
trace
(
" Class Not Registered
\n
"
);
return
;
...
...
@@ -219,8 +210,7 @@ static void IDirectSoundCapture_tests(void)
* device specified */
rc
=
CoCreateInstance
(
&
CLSID_DirectSoundCapture
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSoundCapture
,
(
void
**
)
&
dsco
);
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundCapture) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x
\n
"
,
rc
);
if
(
dsco
)
IDirectSoundCapture_test
(
dsco
,
FALSE
,
&
DSDEVID_DefaultCapture
);
...
...
@@ -228,8 +218,7 @@ static void IDirectSoundCapture_tests(void)
* capture device specified */
rc
=
CoCreateInstance
(
&
CLSID_DirectSoundCapture
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSoundCapture
,
(
void
**
)
&
dsco
);
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundCapture) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundCapture) failed: %08x
\n
"
,
rc
);
if
(
dsco
)
IDirectSoundCapture_test
(
dsco
,
FALSE
,
&
DSDEVID_DefaultVoiceCapture
);
...
...
@@ -239,28 +228,26 @@ static void IDirectSoundCapture_tests(void)
&
CLSID_DirectSoundPrivate
,
(
void
**
)
&
dsco
);
ok
(
rc
==
E_NOINTERFACE
,
"CoCreateInstance(CLSID_DirectSoundCapture,CLSID_DirectSoundPrivate) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
/* try with no device specified */
rc
=
pDirectSoundCaptureCreate
(
NULL
,
&
dsco
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCaptureCreate(NULL) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCaptureCreate(NULL) failed: %
08x
\n
"
,
rc
);
if
(
rc
==
S_OK
&&
dsco
)
IDirectSoundCapture_test
(
dsco
,
TRUE
,
NULL
);
/* try with default capture device specified */
rc
=
pDirectSoundCaptureCreate
(
&
DSDEVID_DefaultCapture
,
&
dsco
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsco
)
IDirectSoundCapture_test
(
dsco
,
TRUE
,
NULL
);
/* try with default voice capture device specified */
rc
=
pDirectSoundCaptureCreate
(
&
DSDEVID_DefaultVoiceCapture
,
&
dsco
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsco
)
IDirectSoundCapture_test
(
dsco
,
TRUE
,
NULL
);
...
...
@@ -268,7 +255,7 @@ static void IDirectSoundCapture_tests(void)
rc
=
pDirectSoundCaptureCreate
(
&
DSDEVID_DefaultVoicePlayback
,
&
dsco
,
NULL
);
ok
(
rc
==
DSERR_NODRIVER
,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoicePlatback) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsco
)
IDirectSoundCapture_Release
(
dsco
);
}
...
...
@@ -300,21 +287,18 @@ static int capture_buffer_service(capture_state_t* state)
rc
=
IDirectSoundCaptureBuffer_GetCurrentPosition
(
state
->
dscbo
,
&
capture_pos
,
&
read_pos
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetCurrentPosition() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetCurrentPosition() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
0
;
rc
=
IDirectSoundCaptureBuffer_Lock
(
state
->
dscbo
,
state
->
offset
,
state
->
size
,
&
ptr1
,
&
len1
,
&
ptr2
,
&
len2
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Lock() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Lock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
0
;
rc
=
IDirectSoundCaptureBuffer_Unlock
(
state
->
dscbo
,
ptr1
,
len1
,
ptr2
,
len2
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Unlock() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Unlock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
0
;
...
...
@@ -336,20 +320,17 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"have returned DSERR_INVALIDPARAM, returned: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
dscbcaps
.
dwSize
=
sizeof
(
dscbcaps
);
rc
=
IDirectSoundCaptureBuffer_GetCaps
(
dscbo
,
&
dscbcaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: size = %d flags=0x%08x buffer size=%d
\n
"
,
dscbcaps
.
dwSize
,
dscbcaps
.
dwFlags
,
dscbcaps
.
dwBufferBytes
);
...
...
@@ -360,18 +341,15 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"have returned DSERR_INVALIDPARAM, returned: %08x
\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=%s, size=%d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
"have returned the needed size: rc=%08x, size=%d
\n
"
,
rc
,
size
);
rc
=
IDirectSoundCaptureBuffer_GetFormat
(
dscbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetFormat() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Format: tag=0x%04x %dx%dx%d avg.B/s=%d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
...
...
@@ -381,12 +359,10 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSoundCaptureBuffer_GetStatus
(
dscbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Status=0x%04x
\n
"
,
status
);
}
...
...
@@ -402,8 +378,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundCaptureBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -414,8 +389,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
rc
=
IDirectSoundNotify_SetNotificationPositions
(
state
.
notify
,
NOTIFICATIONS
,
state
.
posnotify
);
ok
(
rc
==
DS_OK
,
"IDirectSoundNotify_SetNotificationPositions() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundNotify_SetNotificationPositions() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -427,14 +401,12 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
if
(
record
)
{
rc
=
IDirectSoundCaptureBuffer_Start
(
dscbo
,
DSCBSTART_LOOPING
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Start() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Start() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
rc
=
IDirectSoundCaptureBuffer_GetStatus
(
dscbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
(
DSCBSTATUS_CAPTURING
|
DSCBSTATUS_LOOPING
),
"GetStatus: bad status: %x
\n
"
,
status
);
if
(
rc
!=
DS_OK
)
...
...
@@ -455,8 +427,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
}
rc
=
IDirectSoundCaptureBuffer_Stop
(
dscbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Stop() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Stop() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
}
...
...
@@ -478,11 +449,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
trace
(
"*** Testing %s - %s ***
\n
"
,
lpcstrDescription
,
lpcstrModule
);
rc
=
pDirectSoundCaptureCreate
(
lpGuid
,
NULL
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DirectSoundCaptureCreate() should have "
"returned DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
rc
=
pDirectSoundCaptureCreate
(
lpGuid
,
&
dsco
,
NULL
);
ok
((
rc
==
DS_OK
)
||
(
rc
==
DSERR_NODRIVER
)
||
(
rc
==
E_FAIL
)
||
(
rc
==
DSERR_ALLOCATED
),
"DirectSoundCaptureCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCaptureCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
DSERR_NODRIVER
)
trace
(
" No Driver
\n
"
);
...
...
@@ -496,18 +467,17 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
dsccaps
.
dwSize
=
sizeof
(
dsccaps
);
rc
=
IDirectSoundCapture_GetCaps
(
dsco
,
&
dsccaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: size=%d flags=0x%08x formats=%05x channels=%d
\n
"
,
dsccaps
.
dwSize
,
dsccaps
.
dwFlags
,
dsccaps
.
dwFormats
,
...
...
@@ -524,8 +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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"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, "
...
...
@@ -542,8 +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 %s
\n
"
,
DXGetErrorString8
(
rc
));
"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, "
...
...
@@ -561,8 +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 :%s
\n
"
,
DXGetErrorString8
(
rc
));
"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, "
...
...
@@ -580,8 +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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"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, "
...
...
@@ -604,7 +570,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
ok
(((
rc
==
DS_OK
)
&&
(
dscbo
!=
NULL
))
||
(
rc
==
DSERR_BADFORMAT
)
||
((
rc
==
DSERR_NODRIVER
))
||
(
rc
==
DSERR_ALLOCATED
)
||
(
rc
==
E_INVALIDARG
)
||
(
rc
==
E_FAIL
),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"%s capture buffer: %
s
\n
"
,
format_string
(
&
wfx
),
DXGetErrorString8
(
rc
)
);
"%s capture buffer: %
08x
\n
"
,
format_string
(
&
wfx
),
rc
);
if
(
rc
==
DS_OK
)
{
test_capture_buffer
(
dsco
,
dscbo
,
winetest_interactive
);
ref
=
IDirectSoundCaptureBuffer_Release
(
dscbo
);
...
...
@@ -632,8 +598,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
(
DSCBUFFERDESC
*
)
&
bufdesc1
,
&
dscbo
,
NULL
);
ok
(
rc
==
DS_OK
||
broken
(
rc
==
E_INVALIDARG
),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"%s capture buffer: %s
\n
"
,
format_string
(
&
wfx
),
DXGetErrorString8
(
rc
));
"%s capture buffer: %08x
\n
"
,
format_string
(
&
wfx
),
rc
);
if
(
rc
==
DS_OK
)
{
test_capture_buffer
(
dsco
,
dscbo
,
winetest_interactive
);
ref
=
IDirectSoundCaptureBuffer_Release
(
dscbo
);
...
...
@@ -664,7 +629,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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
);
...
...
@@ -688,7 +653,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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"at 2 MHz %
08x
\n
"
,
rc
);
}
EXIT:
...
...
@@ -705,8 +670,7 @@ static void capture_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundCaptureEnumerateA
(
&
dscenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCaptureEnumerateA() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"DirectSoundCaptureEnumerateA() failed: %08x
\n
"
,
rc
);
}
START_TEST
(
capture
)
...
...
dlls/dsound/tests/ds3d.c
View file @
ca681835
...
...
@@ -29,7 +29,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "dxerr8.h"
#include "mmreg.h"
#include "dsound_test.h"
...
...
@@ -187,8 +186,7 @@ static int buffer_refill(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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
...
...
@@ -200,8 +198,7 @@ static int buffer_refill(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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Unlock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
return
size
;
...
...
@@ -216,8 +213,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
...
...
@@ -228,8 +224,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Unlock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
return
size
;
...
...
@@ -241,8 +236,7 @@ static int buffer_service(play_state_t* state)
HRESULT
rc
;
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
state
->
dsbo
,
&
play_pos
,
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCurrentPosition() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCurrentPosition() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
goto
STOP
;
}
...
...
@@ -301,8 +295,7 @@ STOP:
if
(
winetest_debug
>
1
)
trace
(
"stopping playback
\n
"
);
rc
=
IDirectSoundBuffer_Stop
(
state
->
dsbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Stop() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Stop() failed: %08x
\n
"
,
rc
);
return
0
;
}
...
...
@@ -322,8 +315,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 "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_SetFrequency() failed to set frequency %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
}
...
...
@@ -331,19 +323,18 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
dsbcaps
.
dwSize
=
sizeof
(
dsbcaps
);
rc
=
IDirectSoundBuffer_GetCaps
(
*
dsbo
,
&
dsbcaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: flags=0x%08x size=%d
\n
"
,
dsbcaps
.
dwFlags
,
dsbcaps
.
dwBufferBytes
);
...
...
@@ -353,7 +344,7 @@ 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=%
s size=%d
\n
"
,
DXGetErrorString8
(
rc
)
,
size
);
"returned the needed size: rc=%
08x size=%d
\n
"
,
rc
,
size
);
ok
(
size
==
sizeof
(
WAVEFORMATEX
)
||
size
==
sizeof
(
WAVEFORMATEXTENSIBLE
),
"Expected a correct structure size, got %d
\n
"
,
size
);
...
...
@@ -367,7 +358,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
wfx
=
wfxe
.
Format
;
}
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IDirectSoundBuffer_GetFormat() failed: %
08x
\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
"
,
is_primary
?
"Primary"
:
"Secondary"
,
...
...
@@ -378,13 +369,13 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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 "
...
...
@@ -394,11 +385,10 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
/* DSOUND: Error: Invalid status pointer */
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSoundBuffer_GetStatus() should have "
"returned DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
0
,
"status=0x%x instead of 0
\n
"
,
status
);
if
(
is_primary
)
{
...
...
@@ -406,28 +396,26 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
/* 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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
init_format
(
&
wfx2
,
WAVE_FORMAT_PCM
,
11025
,
16
,
2
);
rc
=
IDirectSoundBuffer_SetFormat
(
*
dsbo
,
&
wfx2
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
s
\n
"
,
format_string
(
&
wfx2
),
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
08x
\n
"
,
format_string
(
&
wfx2
),
rc
);
/* There is no guarantee that SetFormat will actually change the
* format to what we asked for. It depends on what the soundcard
* supports. So we must re-query the format.
*/
rc
=
IDirectSoundBuffer_GetFormat
(
*
dsbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
(
wfx
.
wFormatTag
!=
wfx2
.
wFormatTag
||
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
...
...
@@ -444,8 +432,7 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" new Caps: flags=0x%08x size=%d
\n
"
,
new_dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwBufferBytes
);
...
...
@@ -467,8 +454,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
/* 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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
}
if
(
play
)
{
...
...
@@ -498,7 +484,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
}
...
...
@@ -507,8 +493,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
rc
=
IDirectSoundBuffer_QueryInterface
(
*
dsbo
,
&
IID_IDirectSound3DBuffer
,
(
LPVOID
*
)
&
buffer
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -516,8 +501,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==*
dsbo
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
*
dsbo
);
ref
=
IDirectSoundBuffer_Release
(
temp_buffer
);
...
...
@@ -529,8 +513,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
&
IID_IDirectSoundBuffer
,
(
LPVOID
*
)
&
temp_buffer
);
ok
(
rc
==
DS_OK
&&
temp_buffer
!=
NULL
,
"IDirectSound3DBuffer_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound3DBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==*
dsbo
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
*
dsbo
);
ref
=
IDirectSoundBuffer_Release
(
temp_buffer
);
...
...
@@ -545,41 +528,37 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
&
IID_IDirectSoundBuffer
,
(
LPVOID
*
)
dsbo
);
ok
(
rc
==
DS_OK
&&
*
dsbo
!=
NULL
,
"IDirectSound3DBuffer_QueryInterface() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
/* DSOUND: Error: Invalid buffer */
rc
=
IDirectSound3DBuffer_GetAllParameters
(
buffer
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound3DBuffer_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
buffer_param
.
dwSize
=
sizeof
(
buffer_param
);
rc
=
IDirectSound3DBuffer_GetAllParameters
(
buffer
,
&
buffer_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3DBuffer_GetAllParameters() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3DBuffer_GetAllParameters() failed: %08x
\n
"
,
rc
);
}
if
(
set_volume
)
{
if
(
dsbcaps
.
dwFlags
&
DSBCAPS_CTRLVOLUME
)
{
LONG
val
;
rc
=
IDirectSoundBuffer_GetVolume
(
*
dsbo
,
&
val
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetVolume
(
*
dsbo
,
volume
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume() failed: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x
\n
"
,
rc
);
}
}
...
...
@@ -587,18 +566,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetPan
(
*
dsbo
,
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan() failed: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x
\n
"
,
rc
);
}
}
...
...
@@ -607,14 +583,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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned %
08x
\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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned %
08x
\n
"
,
rc
);
if
(
set_frequency
)
state
.
wave
=
wave_generate_la
(
&
wfx
,(
duration
*
frequency
)
/
wfx
.
nSamplesPerSec
,
&
state
.
wave_len
);
...
...
@@ -628,12 +604,10 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Play() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
(
DSBSTATUS_PLAYING
|
DSBSTATUS_LOOPING
),
"GetStatus: bad status: %x
\n
"
,
status
);
...
...
@@ -643,7 +617,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
move_listener
)
{
listener_param
.
vPosition
.
x
=
-
5
.
0
f
;
listener_param
.
vVelocity
.
x
=
(
float
)(
10
.
0
/
duration
);
...
...
@@ -651,8 +625,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
rc
=
IDirectSound3DListener_SetAllParameters
(
listener
,
&
listener_param
,
DS3D_IMMEDIATE
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %08x
\n
"
,
rc
);
}
if
(
buffer3d
)
{
if
(
move_sound
)
{
...
...
@@ -662,8 +635,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dBuffer_SetPosition() failed: %08x
\n
"
,
rc
);
}
start_time
=
GetTickCount
();
...
...
@@ -677,8 +649,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %08x
\n
"
,
rc
);
}
if
(
buffer3d
&&
move_sound
)
{
buffer_param
.
vPosition
.
x
=
(
float
)(
100
-
200
.
0
*
(
now
-
start_time
)
/
1000
/
duration
);
...
...
@@ -687,8 +658,7 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dBuffer_SetPosition() failed: %08x
\n
"
,
rc
);
}
}
/* Check the sound duration was within 10% of the expected value */
...
...
@@ -703,7 +673,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
}
if
(
buffer3d
)
{
ref
=
IDirectSound3DBuffer_Release
(
buffer
);
...
...
@@ -728,16 +698,14 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -750,14 +718,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: "
"%s
\n
"
,
has_3d
?
"3D "
:
""
,
DXGetErrorString8
(
rc
));
"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
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT1
;
...
...
@@ -766,8 +732,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed to get a 3D listener: %08x
\n
"
,
rc
);
ref
=
IDirectSoundBuffer_Release
(
primary
);
ok
(
ref
==
0
,
"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0
\n
"
,
ref
);
...
...
@@ -778,22 +743,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
/* DSOUND: Error: Invalid buffer */
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
listener_param
.
dwSize
=
sizeof
(
listener_param
);
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
}
else
{
ok
(
listener
==
NULL
,
"IDirectSoundBuffer_QueryInterface() "
"failed but returned a listener anyway
\n
"
);
...
...
@@ -836,72 +799,60 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
}
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() "
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %
s
\n
"
,
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %
08x
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
move_listener
?
"moving "
:
""
,
listener
!=
NULL
?
"listener "
:
""
,
listener
&&
move_sound
?
"and moving sound "
:
move_sound
?
"moving sound "
:
""
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
getDSBCAPS
(
bufdesc
.
dwFlags
),
DXGetErrorString8
(
rc
)
);
getDSBCAPS
(
bufdesc
.
dwFlags
),
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
if
(
!
has_3d
)
{
LONG
refvol
,
vol
,
refpan
,
pan
;
/* Check the initial secondary buffer's volume and pan */
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: %08x
\n
"
,
rc
);
ok
(
vol
==
0
,
"wrong volume for a new secondary buffer: %d
\n
"
,
vol
);
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(secondary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==
0
,
"wrong pan for a new secondary buffer: %d
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(primary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetPan
(
primary
,
&
refpan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
-
1000
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
ok
(
vol
==-
1000
,
"secondary: wrong volume %d instead of -1000
\n
"
,
vol
);
rc
=
IDirectSoundBuffer_SetPan
(
secondary
,
-
1000
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==-
1000
,
"secondary: wrong pan %d instead of -1000
\n
"
,
pan
);
rc
=
IDirectSoundBuffer_GetVolume
(
primary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(primary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(primary) failed: %08x
\n
"
,
rc
);
ok
(
vol
==
refvol
,
"The primary volume changed from %d to %d
\n
"
,
refvol
,
vol
);
rc
=
IDirectSoundBuffer_GetPan
(
primary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==
refpan
,
"The primary pan changed from %d to %d
\n
"
,
refpan
,
pan
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetPan
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
}
if
(
has_duplicate
)
{
LPDIRECTSOUNDBUFFER
duplicated
=
NULL
;
...
...
@@ -910,26 +861,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
duplicated
=
NULL
;
rc
=
IDirectSound_DuplicateSoundBuffer
(
dso
,
secondary
,
&
duplicated
);
ok
(
rc
==
DS_OK
&&
duplicated
!=
NULL
,
"IDirectSound_DuplicateSoundBuffer() failed to duplicate "
"a secondary buffer: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"a secondary buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
duplicated
!=
NULL
)
{
ref
=
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -976,8 +927,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -997,7 +947,7 @@ static HRESULT test_for_driver(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1020,8 +970,7 @@ static HRESULT test_primary(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1029,15 +978,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -1048,8 +996,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"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
)
{
...
...
@@ -1084,8 +1031,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -1107,8 +1053,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1116,15 +1061,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -1134,7 +1078,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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, "
...
...
@@ -1145,7 +1089,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed to create a 3D primary buffer: %
08x
\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
,
...
...
@@ -1158,8 +1102,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -1181,8 +1124,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1190,15 +1132,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
primary
=
NULL
;
...
...
@@ -1207,13 +1148,13 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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() "
"failed to get a 3D listener: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed to get a 3D listener: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
listener
!=
NULL
)
{
LPDIRECTSOUNDBUFFER
temp_buffer
=
NULL
;
...
...
@@ -1221,8 +1162,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
rc
=
IDirectSoundBuffer_QueryInterface
(
primary
,
&
IID_IDirectSoundBuffer
,(
LPVOID
*
)
&
temp_buffer
);
ok
(
rc
==
DS_OK
&&
temp_buffer
!=
NULL
,
"IDirectSoundBuffer_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==
primary
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
primary
);
...
...
@@ -1235,8 +1175,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==
primary
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
primary
);
...
...
@@ -1322,7 +1261,7 @@ static void ds3d_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundEnumerateA
(
&
dsenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
08x
\n
"
,
rc
);
}
START_TEST
(
ds3d
)
...
...
dlls/dsound/tests/ds3d8.c
View file @
ca681835
...
...
@@ -29,7 +29,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "dxerr8.h"
#include "mmreg.h"
#include "dsound_test.h"
...
...
@@ -59,8 +58,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
...
...
@@ -72,8 +70,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Unlock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
return
size
;
...
...
@@ -88,8 +85,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
...
...
@@ -100,8 +96,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Unlock() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
-
1
;
return
size
;
...
...
@@ -113,8 +108,7 @@ static int buffer_service8(play_state_t* state)
HRESULT
rc
;
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
state
->
dsbo
,
&
play_pos
,
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCurrentPosition() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCurrentPosition() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
goto
STOP
;
}
...
...
@@ -173,8 +167,7 @@ STOP:
if
(
winetest_debug
>
1
)
trace
(
"stopping playback
\n
"
);
rc
=
IDirectSoundBuffer_Stop
(
state
->
dsbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Stop() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Stop() failed: %08x
\n
"
,
rc
);
return
0
;
}
...
...
@@ -193,19 +186,18 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
dsbcaps
.
dwSize
=
sizeof
(
dsbcaps
);
rc
=
IDirectSoundBuffer_GetCaps
(
*
dsbo
,
&
dsbcaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: flags=0x%08x size=%d
\n
"
,
dsbcaps
.
dwFlags
,
dsbcaps
.
dwBufferBytes
);
...
...
@@ -215,7 +207,7 @@ 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=%
s size=%d
\n
"
,
DXGetErrorString8
(
rc
)
,
size
);
"returned the needed size: rc=%
08x size=%d
\n
"
,
rc
,
size
);
ok
(
size
==
sizeof
(
WAVEFORMATEX
)
||
size
==
sizeof
(
WAVEFORMATEXTENSIBLE
),
"Expected a correct structure size, got %d
\n
"
,
size
);
...
...
@@ -227,8 +219,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc
=
IDirectSoundBuffer_GetFormat
(
*
dsbo
,(
WAVEFORMATEX
*
)
&
wfxe
,
size
,
NULL
);
wfx
=
wfxe
.
Format
;
}
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %08x
\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
"
,
is_primary
?
"Primary"
:
"Secondary"
,
...
...
@@ -239,13 +230,13 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IDirectSoundBuffer_GetFrequency() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ok
(
freq
==
wfx
.
nSamplesPerSec
,
"The frequency returned by GetFrequency "
"%d does not match the format %d
\n
"
,
freq
,
wfx
.
nSamplesPerSec
);
...
...
@@ -254,11 +245,10 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
/* DSOUND: Error: Invalid status pointer */
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSoundBuffer_GetStatus() should have "
"returned DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
0
,
"status=0x%x instead of 0
\n
"
,
status
);
if
(
is_primary
)
{
...
...
@@ -267,27 +257,26 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
init_format
(
&
wfx2
,
WAVE_FORMAT_PCM
,
11025
,
16
,
2
);
rc
=
IDirectSoundBuffer_SetFormat
(
*
dsbo
,
&
wfx2
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
s
\n
"
,
format_string
(
&
wfx2
),
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
08x
\n
"
,
format_string
(
&
wfx2
),
rc
);
/* There is no guarantee that SetFormat will actually change the
* format to what we asked for. It depends on what the soundcard
* supports. So we must re-query the format.
*/
rc
=
IDirectSoundBuffer_GetFormat
(
*
dsbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
(
wfx
.
wFormatTag
!=
wfx2
.
wFormatTag
||
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
...
...
@@ -304,8 +293,7 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" new Caps: flags=0x%08x size=%d
\n
"
,
new_dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwBufferBytes
);
...
...
@@ -328,7 +316,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
}
if
(
play
)
{
...
...
@@ -352,8 +340,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound8_SetCooperativeLevel(DSSCL_WRITEPRIMARY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
}
...
...
@@ -362,8 +349,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc
=
IDirectSoundBuffer_QueryInterface
(
*
dsbo
,
&
IID_IDirectSound3DBuffer
,
(
LPVOID
*
)
&
buffer
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -371,8 +357,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==*
dsbo
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
*
dsbo
);
ref
=
IDirectSoundBuffer_Release
(
temp_buffer
);
...
...
@@ -383,8 +368,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc
=
IDirectSound3DBuffer_QueryInterface
(
*
dsbo
,
&
IID_IDirectSoundBuffer
,
(
LPVOID
*
)
&
temp_buffer
);
ok
(
rc
==
DS_OK
&&
temp_buffer
!=
NULL
,
"IDirectSound3DBuffer_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound3DBuffer_QueryInterface() failed: %08x
\n
"
,
rc
);
ok
(
temp_buffer
==*
dsbo
,
"COM interface broken: %p != %p
\n
"
,
temp_buffer
,
*
dsbo
);
ref
=
IDirectSoundBuffer_Release
(
temp_buffer
);
...
...
@@ -399,41 +383,37 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
&
IID_IDirectSoundBuffer
,
(
LPVOID
*
)
dsbo
);
ok
(
rc
==
DS_OK
&&
*
dsbo
!=
NULL
,
"IDirectSound3DBuffer_QueryInterface() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
/* DSOUND: Error: Invalid buffer */
rc
=
IDirectSound3DBuffer_GetAllParameters
(
buffer
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound3DBuffer_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
buffer_param
.
dwSize
=
sizeof
(
buffer_param
);
rc
=
IDirectSound3DBuffer_GetAllParameters
(
buffer
,
&
buffer_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3DBuffer_GetAllParameters() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3DBuffer_GetAllParameters() failed: %08x
\n
"
,
rc
);
}
if
(
set_volume
)
{
if
(
dsbcaps
.
dwFlags
&
DSBCAPS_CTRLVOLUME
)
{
LONG
val
;
rc
=
IDirectSoundBuffer_GetVolume
(
*
dsbo
,
&
val
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetVolume
(
*
dsbo
,
volume
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume() failed: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x
\n
"
,
rc
);
}
}
...
...
@@ -441,18 +421,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetPan
(
*
dsbo
,
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan() failed: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_CONTROLUNAVAIL, returned: %08x
\n
"
,
rc
);
}
}
...
...
@@ -461,14 +438,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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned %
08x
\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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned %
08x
\n
"
,
rc
);
state
.
wave
=
wave_generate_la
(
&
wfx
,
duration
,
&
state
.
wave_len
);
...
...
@@ -479,12 +456,10 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Play() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
(
DSBSTATUS_PLAYING
|
DSBSTATUS_LOOPING
),
"GetStatus: bad status: %x
\n
"
,
status
);
...
...
@@ -493,7 +468,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
listener_param
.
dwSize
=
sizeof
(
listener_param
);
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
move_listener
)
{
listener_param
.
vPosition
.
x
=
-
5
.
0
f
;
listener_param
.
vVelocity
.
x
=
(
float
)(
10
.
0
/
duration
);
...
...
@@ -501,8 +476,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc
=
IDirectSound3DListener_SetAllParameters
(
listener
,
&
listener_param
,
DS3D_IMMEDIATE
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %08x
\n
"
,
rc
);
}
if
(
buffer3d
)
{
if
(
move_sound
)
{
...
...
@@ -512,8 +486,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dBuffer_SetPosition() failed: %08x
\n
"
,
rc
);
}
start_time
=
GetTickCount
();
...
...
@@ -527,8 +500,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_SetPosition() failed: %08x
\n
"
,
rc
);
}
if
(
buffer3d
&&
move_sound
)
{
buffer_param
.
vPosition
.
x
=
(
float
)(
100
-
200
.
0
*
(
now
-
start_time
)
/
1000
/
duration
);
...
...
@@ -537,8 +509,7 @@ 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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound3dBuffer_SetPosition() failed: %08x
\n
"
,
rc
);
}
}
/* Check the sound duration was within 10% of the expected value */
...
...
@@ -553,7 +524,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
}
if
(
buffer3d
)
{
ref
=
IDirectSound3DBuffer_Release
(
buffer
);
...
...
@@ -578,16 +549,14 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -600,14 +569,12 @@ static HRESULT test_secondary8(LPGUID lpGuid, int 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: "
"%s
\n
"
,
has_3d
?
"3D "
:
""
,
DXGetErrorString8
(
rc
));
"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
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT1
;
...
...
@@ -617,7 +584,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
(
void
**
)
&
listener
);
ok
(
rc
==
DS_OK
&&
listener
!=
NULL
,
"IDirectSoundBuffer_QueryInterface() failed to get a 3D "
"listener %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"listener %
08x
\n
"
,
rc
);
ref
=
IDirectSoundBuffer_Release
(
primary
);
ok
(
ref
==
0
,
"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0
\n
"
,
ref
);
...
...
@@ -628,22 +595,20 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
/* DSOUND: Error: Invalid buffer */
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound3dListener_GetAllParameters() should have "
"returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
listener_param
.
dwSize
=
sizeof
(
listener_param
);
rc
=
IDirectSound3DListener_GetAllParameters
(
listener
,
&
listener_param
);
ok
(
rc
==
DS_OK
,
"IDirectSound3dListener_GetAllParameters() "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
}
else
{
ok
(
listener
==
NULL
,
"IDirectSoundBuffer_QueryInterface() "
"failed but returned a listener anyway
\n
"
);
...
...
@@ -676,8 +641,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSound8_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound8_CreateSoundBuffer(secondary) should have "
"returned DSERR_INVALIDPARAM, returned %s
\n
"
,
DXGetErrorString8
(
rc
));
"returned DSERR_INVALIDPARAM, returned %08x
\n
"
,
rc
);
if
(
secondary
)
ref
=
IDirectSoundBuffer_Release
(
secondary
);
init_format
(
&
wfx
,
WAVE_FORMAT_PCM
,
22050
,
16
,
1
);
...
...
@@ -698,72 +662,60 @@ static HRESULT test_secondary8(LPGUID lpGuid, int 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): %
s
\n
"
,
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %
08x
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
move_listener
?
"moving "
:
""
,
listener
!=
NULL
?
"listener "
:
""
,
listener
&&
move_sound
?
"and moving sound "
:
move_sound
?
"moving sound "
:
""
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
getDSBCAPS
(
bufdesc
.
dwFlags
),
DXGetErrorString8
(
rc
)
);
getDSBCAPS
(
bufdesc
.
dwFlags
),
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
if
(
!
has_3d
)
{
LONG
refvol
,
vol
,
refpan
,
pan
;
/* Check the initial secondary buffer's volume and pan */
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: %08x
\n
"
,
rc
);
ok
(
vol
==
0
,
"wrong volume for a new secondary buffer: %d
\n
"
,
vol
);
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(secondary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==
0
,
"wrong pan for a new secondary buffer: %d
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(primary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetPan
(
primary
,
&
refpan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
-
1000
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
ok
(
vol
==-
1000
,
"secondary: wrong volume %d instead of -1000
\n
"
,
vol
);
rc
=
IDirectSoundBuffer_SetPan
(
secondary
,
-
1000
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==-
1000
,
"secondary: wrong pan %d instead of -1000
\n
"
,
pan
);
rc
=
IDirectSoundBuffer_GetVolume
(
primary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_`GetVolume(primary) failed: i"
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_`GetVolume(primary) failed: i%08x
\n
"
,
rc
);
ok
(
vol
==
refvol
,
"The primary volume changed from %d to %d
\n
"
,
refvol
,
vol
);
rc
=
IDirectSoundBuffer_GetPan
(
primary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetPan(primary) failed: %08x
\n
"
,
rc
);
ok
(
pan
==
refpan
,
"The primary pan changed from %d to %d
\n
"
,
refpan
,
pan
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetPan
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: %08x
\n
"
,
rc
);
}
if
(
has_duplicate
)
{
LPDIRECTSOUNDBUFFER
duplicated
=
NULL
;
...
...
@@ -772,26 +724,26 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSound8_DuplicateSoundBuffer
(
dso
,
0
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound8_DuplicateSoundBuffer() should have returned "
"DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
duplicated
=
NULL
;
rc
=
IDirectSound8_DuplicateSoundBuffer
(
dso
,
secondary
,
&
duplicated
);
ok
(
rc
==
DS_OK
&&
duplicated
!=
NULL
,
"IDirectSound8_DuplicateSoundBuffer() failed to duplicate "
"a secondary buffer: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"a secondary buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
duplicated
!=
NULL
)
{
ref
=
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -838,8 +790,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -859,7 +810,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -882,8 +833,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -891,15 +841,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -910,8 +859,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"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
)
{
...
...
@@ -945,8 +893,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -968,8 +915,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -977,15 +923,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -995,7 +940,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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, "
...
...
@@ -1006,7 +951,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed to create a 3D primary buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
test_buffer8
(
dso
,
&
primary
,
1
,
FALSE
,
0
,
FALSE
,
0
,
winetest_interactive
&&
...
...
@@ -1019,8 +964,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -1042,8 +986,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1051,15 +994,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
primary
=
NULL
;
...
...
@@ -1068,14 +1010,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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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() "
"failed to get a 3D listener: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed to get a 3D listener: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
listener
!=
NULL
)
{
LPDIRECTSOUNDBUFFER
temp_buffer
=
NULL
;
...
...
@@ -1084,8 +1026,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\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
);
...
...
@@ -1096,8 +1037,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSoundBuffer_QueryInterface() failed: %08x
\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, "
...
...
@@ -1181,7 +1121,7 @@ static void ds3d8_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundEnumerateA
(
&
dsenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
08x
\n
"
,
rc
);
}
START_TEST
(
ds3d8
)
...
...
dlls/dsound/tests/dsound.c
View file @
ca681835
...
...
@@ -30,7 +30,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "dxerr8.h"
#include "dsconf.h"
#include "mmreg.h"
#include "initguid.h"
...
...
@@ -60,20 +59,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_QueryInterface(IID_IUnknown) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSound_Release
(
unknown
);
rc
=
IDirectSound_QueryInterface
(
dso
,
&
IID_IDirectSound
,(
LPVOID
*
)
&
ds
);
ok
(
rc
==
DS_OK
,
"IDirectSound_QueryInterface(IID_IDirectSound) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_QueryInterface(IID_IDirectSound) failed: %08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSound8_Release
(
ds8
);
...
...
@@ -81,27 +78,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound_GetCaps
(
dso
,
&
dscaps
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound_Compact
(
dso
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound_Compact() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound_GetSpeakerConfig
(
dso
,
&
speaker_config
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound_GetSpeakerConfig() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound_Initialize
(
dso
,
lpGuid
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"IDirectSound_Initialize() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IDirectSound_Initialize() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DSERR_NODRIVER
)
{
trace
(
" No Driver
\n
"
);
goto
EXIT
;
...
...
@@ -116,58 +109,49 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
rc
=
IDirectSound_Initialize
(
dso
,
lpGuid
);
ok
(
rc
==
DSERR_ALREADYINITIALIZED
,
"IDirectSound_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_ALREADYINITIALIZED: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
dscaps
.
dwSize
=
sizeof
(
dscaps
);
/* DSOUND: Running on a certified driver */
rc
=
IDirectSound_GetCaps
(
dso
,
&
dscaps
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\n
"
,
rc
);
rc
=
IDirectSound_Compact
(
dso
);
ok
(
rc
==
DSERR_PRIOLEVELNEEDED
,
"IDirectSound_Compact() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DSERR_PRIOLEVELNEEDED
,
"IDirectSound_Compact() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSound_SetCooperativeLevel
(
dso
,
get_hwnd
(),
DSSCL_PRIORITY
);
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSound_Compact
(
dso
);
ok
(
rc
==
DS_OK
,
"IDirectSound_Compact() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_Compact() failed: %
08x
\n
"
,
rc
);
rc
=
IDirectSound_GetSpeakerConfig
(
dso
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound_GetSpeakerConfig(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound_GetSpeakerConfig
(
dso
,
&
speaker_config
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_GetSpeakerConfig() failed: %08x
\n
"
,
rc
);
speaker_config
=
DSSPEAKER_COMBINED
(
DSSPEAKER_STEREO
,
DSSPEAKER_GEOMETRY_WIDE
);
rc
=
IDirectSound_SetSpeakerConfig
(
dso
,
speaker_config
);
ok
(
rc
==
DS_OK
,
"IDirectSound_SetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
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_GetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_GetSpeakerConfig() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
speaker_config
!=
new_speaker_config
)
trace
(
"IDirectSound_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08x, got 0x%08x
\n
"
,
...
...
@@ -190,18 +174,17 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
rc
=
CoGetClassObject
(
&
CLSID_DirectSound
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
cf
);
ok
(
rc
==
S_OK
,
"CoGetClassObject(CLSID_DirectSound, IID_IUnknown) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound_test
(
dso
,
FALSE
,
NULL
);
...
...
@@ -209,8 +192,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound_test
(
dso
,
FALSE
,
&
DSDEVID_DefaultPlayback
);
...
...
@@ -218,8 +200,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound_test
(
dso
,
FALSE
,
&
DSDEVID_DefaultVoicePlayback
);
...
...
@@ -229,7 +210,7 @@ static void IDirectSound_tests(void)
&
CLSID_DirectSoundPrivate
,
(
void
**
)
&
dso
);
ok
(
rc
==
E_NOINTERFACE
,
"CoCreateInstance(CLSID_DirectSound,CLSID_DirectSoundPrivate) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
/* try the COM class factory method of creation with a bad
* GUID and IID specified */
...
...
@@ -237,35 +218,33 @@ static void IDirectSound_tests(void)
&
IID_IDirectSound
,
(
void
**
)
&
dso
);
ok
(
rc
==
REGDB_E_CLASSNOTREG
,
"CoCreateInstance(CLSID_DirectSoundPrivate,IID_IDirectSound) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
/* try with no device specified */
rc
=
pDirectSoundCreate
(
NULL
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate(NULL) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate(NULL) failed: %
08x
\n
"
,
rc
);
if
(
rc
==
S_OK
&&
dso
)
IDirectSound_test
(
dso
,
TRUE
,
NULL
);
/* try with default playback device specified */
rc
=
pDirectSoundCreate
(
&
DSDEVID_DefaultPlayback
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound_test
(
dso
,
TRUE
,
NULL
);
/* try with default voice playback device specified */
rc
=
pDirectSoundCreate
(
&
DSDEVID_DefaultVoicePlayback
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound_test
(
dso
,
TRUE
,
NULL
);
/* try with a bad device specified */
rc
=
pDirectSoundCreate
(
&
DSDEVID_DefaultVoiceCapture
,
&
dso
,
NULL
);
ok
(
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate(DSDEVID_DefaultVoiceCapture) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound_Release
(
dso
);
}
...
...
@@ -279,12 +258,12 @@ static HRESULT test_dsound(LPGUID lpGuid)
/* DSOUND: Error: Invalid interface buffer */
rc
=
pDirectSoundCreate
(
lpGuid
,
0
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DirectSoundCreate() should have returned "
"DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -294,20 +273,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound_test
(
dso
,
FALSE
,
lpGuid
);
/* Create a DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUND
dso1
=
NULL
;
/* Create a second DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso1
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
/* Release the second DirectSound object */
ref
=
IDirectSound_Release
(
dso1
);
...
...
@@ -327,7 +305,7 @@ static HRESULT test_dsound(LPGUID lpGuid)
/* Create a DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUNDBUFFER
secondary
;
DSBUFFERDESC
bufdesc
;
...
...
@@ -343,13 +321,13 @@ static HRESULT test_dsound(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"buffer %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
LPDIRECTSOUND3DBUFFER
buffer3d
;
rc
=
IDirectSound_QueryInterface
(
secondary
,
&
IID_IDirectSound3DBuffer
,
(
void
**
)
&
buffer3d
);
ok
(
rc
==
DS_OK
&&
buffer3d
!=
NULL
,
"IDirectSound_QueryInterface() "
"failed:
%s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed:
%08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
buffer3d
!=
NULL
)
{
ref
=
IDirectSound3DBuffer_AddRef
(
buffer3d
);
ok
(
ref
==
2
,
"IDirectSound3DBuffer_AddRef() has %d references, "
...
...
@@ -384,7 +362,7 @@ static HRESULT test_primary(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -392,22 +370,21 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() should have failed: %08x
\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=%
s
,"
"dsbo=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound_CreateSoundBuffer() should have failed: rc=%
08x
,"
"dsbo=%p
\n
"
,
rc
,
primary
);
/* DSOUND: Error: Invalid size */
/* DSOUND: Error: Invalid buffer description */
...
...
@@ -416,8 +393,8 @@ 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=%
s
,"
"primary=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound_CreateSoundBuffer() should have failed: rc=%
08x
,"
"primary=%p
\n
"
,
rc
,
primary
);
/* DSOUND: Error: DSBCAPS_PRIMARYBUFFER flag with non-NULL lpwfxFormat */
/* DSOUND: Error: Invalid buffer description pointer */
...
...
@@ -428,8 +405,8 @@ 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=%
s
,"
"primary=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound_CreateSoundBuffer() should have failed: rc=%
08x
,"
"primary=%p
\n
"
,
rc
,
primary
);
/* DSOUND: Error: No DSBCAPS_PRIMARYBUFFER flag with NULL lpwfxFormat */
/* DSOUND: Error: Invalid buffer description pointer */
...
...
@@ -440,14 +417,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=%
s
,"
"primary=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound_CreateSoundBuffer() should have failed: rc=%
08x
,"
"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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -460,7 +436,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
IDirectSoundBuffer_Release
(
primary
);
...
...
@@ -470,8 +446,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: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"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
)
{
...
...
@@ -483,7 +458,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"primary buffer: %
08x
\n
"
,
rc
);
ref
=
IDirectSoundBuffer_Release
(
second
);
ok
(
ref
==
1
,
"IDirectSoundBuffer_Release() primary has %d references, "
"should have 1
\n
"
,
ref
);
...
...
@@ -493,11 +468,10 @@ 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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetVolume
(
primary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %08x
\n
"
,
rc
);
if
(
winetest_interactive
)
{
trace
(
"Playing a 5 seconds reference tone at the current "
...
...
@@ -519,8 +493,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() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -548,7 +521,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -556,15 +529,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -573,8 +545,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 "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
for
(
f
=
0
;
f
<
NB_FORMATS
;
f
++
)
{
...
...
@@ -583,8 +554,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -594,19 +564,18 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
rc
=
IDirectSoundBuffer_SetFormat
(
primary
,
&
wfx
);
if
(
wfx
.
wBitsPerSample
<=
16
)
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
s
\n
"
,
format_string
(
&
wfx
),
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
08x
\n
"
,
format_string
(
&
wfx
),
rc
);
else
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"SetFormat (%s) failed: %
s
\n
"
,
format_string
(
&
wfx
),
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"SetFormat (%s) failed: %
08x
\n
"
,
format_string
(
&
wfx
),
rc
);
/* There is no guarantee that SetFormat will actually change the
* format to what we asked for. It depends on what the soundcard
* supports. So we must re-query the format.
*/
rc
=
IDirectSoundBuffer_GetFormat
(
primary
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
(
wfx
.
wFormatTag
!=
wfx2
.
wFormatTag
||
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
...
...
@@ -624,8 +593,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
init_format
(
&
wfx2
,
WAVE_FORMAT_PCM
,
11025
,
16
,
2
);
...
...
@@ -644,8 +612,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
}
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
test_buffer
(
dso
,
&
secondary
,
0
,
FALSE
,
0
,
FALSE
,
0
,
...
...
@@ -665,8 +632,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -691,7 +657,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -699,15 +665,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -716,13 +681,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 "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
rc
=
IDirectSoundBuffer_GetFormat
(
primary
,
&
wfx1
,
sizeof
(
wfx1
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT1
;
...
...
@@ -738,8 +701,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -755,16 +717,15 @@ static HRESULT test_secondary(LPGUID lpGuid)
{
if
(
wfx
.
wBitsPerSample
>
16
)
ok
(
rc
==
DSERR_CONTROLUNAVAIL
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() "
"should have returned DSERR_CONTROLUNAVAIL and NULL, returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"should have returned DSERR_CONTROLUNAVAIL and NULL, returned: %
08x
%p
\n
"
,
rc
,
secondary
);
else
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x
\n
"
,
rc
);
}
else
ok
(
rc
==
E_INVALIDARG
,
"Creating %d bpp buffer on dx < 8 returned: %p %
s
\n
"
,
wfx
.
wBitsPerSample
,
secondary
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
E_INVALIDARG
,
"Creating %d bpp buffer on dx < 8 returned: %p %
08x
\n
"
,
wfx
.
wBitsPerSample
,
secondary
,
rc
);
if
(
!
gotdx8
)
{
...
...
@@ -789,8 +750,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -798,8 +759,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
DSERR_CONTROLUNAVAIL
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -807,8 +768,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
wfxe
.
SubFormat
=
GUID_NULL
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
wfxe
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_PCM
;
...
...
@@ -816,8 +777,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
++
wfxe
.
Samples
.
wValidBitsPerSample
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
--
wfxe
.
Samples
.
wValidBitsPerSample
;
...
...
@@ -825,16 +786,15 @@ 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: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
wfxe
.
Samples
.
wValidBitsPerSample
=
wfxe
.
Format
.
wBitsPerSample
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x
\n
"
,
rc
);
no_wfe:
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
...
...
@@ -861,8 +821,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -887,7 +846,7 @@ static HRESULT test_block_align(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -899,15 +858,14 @@ static HRESULT test_block_align(LPGUID lpGuid)
bufdesc
.
lpwfxFormat
=&
wfx
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSound_CreateSoundBuffer() "
"should have returned DS_OK, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DS_OK, returned: %08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
wfx
.
nBlockAlign
>
1
)
{
ok
(
dsbcaps
.
dwBufferBytes
==
(
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
),
...
...
@@ -916,13 +874,13 @@ static HRESULT test_block_align(LPGUID lpGuid)
dsbcaps
.
dwBufferBytes
,
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
);
rc
=
IDirectSoundBuffer_SetCurrentPosition
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"Could not set position to 0: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"Could not set position to 0: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
secondary
,
&
pos
,
NULL
);
ok
(
rc
==
DS_OK
,
"Could not get position: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"Could not get position: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_SetCurrentPosition
(
secondary
,
1
);
ok
(
rc
==
DS_OK
,
"Could not set position to 1: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"Could not set position to 1: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
secondary
,
&
pos2
,
NULL
);
ok
(
rc
==
DS_OK
,
"Could not get new position: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
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
);
}
ref
=
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -959,7 +917,7 @@ static HRESULT test_frequency(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -967,15 +925,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -984,13 +941,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 "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
rc
=
IDirectSoundBuffer_GetFormat
(
primary
,
&
wfx1
,
sizeof
(
wfx1
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT1
;
...
...
@@ -1013,8 +968,7 @@ static HRESULT test_frequency(LPGUID lpGuid)
}
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
test_buffer
(
dso
,
&
secondary
,
0
,
FALSE
,
0
,
FALSE
,
0
,
...
...
@@ -1035,8 +989,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound_Release
(
dso
);
...
...
@@ -1084,7 +1037,7 @@ static void dsound_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundEnumerateA
(
&
dsenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
08x
\n
"
,
rc
);
}
START_TEST
(
dsound
)
...
...
dlls/dsound/tests/dsound8.c
View file @
ca681835
...
...
@@ -30,7 +30,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "dxerr8.h"
#include "dsconf.h"
#include "mmreg.h"
#include "ks.h"
...
...
@@ -60,21 +59,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_QueryInterface(IID_IUnknown) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSound8_Release
(
unknown
);
rc
=
IDirectSound8_QueryInterface
(
dso
,
&
IID_IDirectSound
,(
LPVOID
*
)
&
ds
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_QueryInterface(IID_IDirectSound) failed: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
IDirectSound8_Release
(
ds8
);
...
...
@@ -82,32 +78,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_GetCaps
(
dso
,
&
dscaps
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound8_GetCaps() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_Compact
(
dso
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound8_Compact() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_GetSpeakerConfig
(
dso
,
&
speaker_config
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound8_GetSpeakerConfig() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_VerifyCertification
(
dso
,
&
certified
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"IDirectSound8_VerifyCertification() "
"should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_UNINITIALIZED, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_Initialize
(
dso
,
lpGuid
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"IDirectSound8_Initialize() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IDirectSound8_Initialize() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DSERR_NODRIVER
)
{
trace
(
" No Driver
\n
"
);
goto
EXIT
;
...
...
@@ -122,58 +113,49 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
rc
=
IDirectSound8_Initialize
(
dso
,
lpGuid
);
ok
(
rc
==
DSERR_ALREADYINITIALIZED
,
"IDirectSound8_Initialize() "
"should have returned DSERR_ALREADYINITIALIZED: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_ALREADYINITIALIZED: %08x
\n
"
,
rc
);
/* DSOUND: Error: Invalid caps buffer */
rc
=
IDirectSound8_GetCaps
(
dso
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound8_GetCaps() "
"should have returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
dscaps
.
dwSize
=
sizeof
(
dscaps
);
/* DSOUND: Running on a certified driver */
rc
=
IDirectSound8_GetCaps
(
dso
,
&
dscaps
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\n
"
,
rc
);
rc
=
IDirectSound8_Compact
(
dso
);
ok
(
rc
==
DSERR_PRIOLEVELNEEDED
,
"IDirectSound8_Compact() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DSERR_PRIOLEVELNEEDED
,
"IDirectSound8_Compact() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_SetCooperativeLevel
(
dso
,
get_hwnd
(),
DSSCL_PRIORITY
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_Compact
(
dso
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_Compact() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_Compact() failed: %
08x
\n
"
,
rc
);
rc
=
IDirectSound8_GetSpeakerConfig
(
dso
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"IDirectSound8_GetSpeakerConfig(NULL) "
"should have returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
rc
=
IDirectSound8_GetSpeakerConfig
(
dso
,
&
speaker_config
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetSpeakerConfig() failed: %08x
\n
"
,
rc
);
speaker_config
=
DSSPEAKER_COMBINED
(
DSSPEAKER_STEREO
,
DSSPEAKER_GEOMETRY_WIDE
);
rc
=
IDirectSound8_SetSpeakerConfig
(
dso
,
speaker_config
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
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_GetSpeakerConfig() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetSpeakerConfig() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
speaker_config
!=
new_speaker_config
)
trace
(
"IDirectSound8_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08x, got 0x%08x
\n
"
,
...
...
@@ -181,8 +163,7 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
}
rc
=
IDirectSound8_VerifyCertification
(
dso
,
&
certified
);
ok
(
rc
==
DS_OK
||
rc
==
E_NOTIMPL
,
"IDirectSound8_VerifyCertification() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
||
rc
==
E_NOTIMPL
,
"IDirectSound8_VerifyCertification() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -200,18 +181,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
rc
=
CoGetClassObject
(
&
CLSID_DirectSound8
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
cf
);
ok
(
rc
==
S_OK
,
"CoGetClassObject(CLSID_DirectSound8, IID_IUnknown) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
||
rc
==
REGDB_E_CLASSNOTREG
,
"CoCreateInstance() failed: %08x
\n
"
,
rc
);
if
(
rc
==
REGDB_E_CLASSNOTREG
)
{
trace
(
" Class Not Registered
\n
"
);
return
;
...
...
@@ -223,8 +203,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound8) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound8_test
(
dso
,
FALSE
,
&
DSDEVID_DefaultPlayback
);
...
...
@@ -232,8 +211,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound8) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound8_test
(
dso
,
FALSE
,
&
DSDEVID_DefaultVoicePlayback
);
...
...
@@ -243,7 +221,7 @@ static void IDirectSound8_tests(void)
&
CLSID_DirectSoundPrivate
,
(
void
**
)
&
dso
);
ok
(
rc
==
E_NOINTERFACE
,
"CoCreateInstance(CLSID_DirectSound8,CLSID_DirectSoundPrivate) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
/* try the COM class factory method of creation with a bad
* GUID and IID specified */
...
...
@@ -251,33 +229,33 @@ static void IDirectSound8_tests(void)
&
IID_IDirectSound8
,
(
void
**
)
&
dso
);
ok
(
rc
==
REGDB_E_CLASSNOTREG
,
"CoCreateInstance(CLSID_DirectSoundPrivate,IID_IDirectSound8) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
/* try with no device specified */
rc
=
pDirectSoundCreate8
(
NULL
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with default playback device specified */
rc
=
pDirectSoundCreate8
(
&
DSDEVID_DefaultPlayback
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with default voice playback device specified */
rc
=
pDirectSoundCreate8
(
&
DSDEVID_DefaultVoicePlayback
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with a bad device specified */
rc
=
pDirectSoundCreate8
(
&
DSDEVID_DefaultVoiceCapture
,
&
dso
,
NULL
);
ok
(
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
"should have failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed: %
08x
\n
"
,
rc
);
}
static
HRESULT
test_dsound8
(
LPGUID
lpGuid
)
...
...
@@ -289,12 +267,12 @@ static HRESULT test_dsound8(LPGUID lpGuid)
/* DSOUND: Error: Invalid interface buffer */
rc
=
pDirectSoundCreate8
(
lpGuid
,
0
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DirectSoundCreate8() should have returned "
"DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
/* Create the DirectSound8 object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -304,20 +282,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSound) failed: %08x
\n
"
,
rc
);
if
(
dso
)
IDirectSound8_test
(
dso
,
FALSE
,
lpGuid
);
/* Create a DirectSound8 object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUND8
dso1
=
NULL
;
/* Create a second DirectSound8 object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso1
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
/* Release the second DirectSound8 object */
ref
=
IDirectSound8_Release
(
dso1
);
...
...
@@ -338,7 +315,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
/* Create a DirectSound8 object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUNDBUFFER
secondary
;
DSBUFFERDESC
bufdesc
;
...
...
@@ -354,7 +331,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
LPDIRECTSOUND3DBUFFER
buffer3d
;
LPDIRECTSOUNDBUFFER8
buffer8
;
...
...
@@ -362,8 +339,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
&
IID_IDirectSound3DBuffer
,
(
void
**
)
&
buffer3d
);
ok
(
rc
==
DS_OK
&&
buffer3d
!=
NULL
,
"IDirectSound8_QueryInterface() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"IDirectSound8_QueryInterface() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
buffer3d
!=
NULL
)
{
ref
=
IDirectSound3DBuffer_AddRef
(
buffer3d
);
ok
(
ref
==
2
,
"IDirectSound3DBuffer_AddRef() has %d references, "
...
...
@@ -407,7 +383,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -415,7 +391,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -423,14 +399,14 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSERR_INVALIDPARAM, returned: %
08x
\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=%
s
,dsbo=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"DSERR_INVALIDPARAM, returned: rc=%
08x
,dsbo=%p
\n
"
,
rc
,
primary
);
ZeroMemory
(
&
bufdesc
,
sizeof
(
bufdesc
));
bufdesc
.
dwSize
=
sizeof
(
DSBUFFERDESC
);
...
...
@@ -438,8 +414,8 @@ 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=%
s
,"
"dsbo=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%
08x
,"
"dsbo=%p
\n
"
,
rc
,
primary
);
ZeroMemory
(
&
bufdesc
,
sizeof
(
bufdesc
));
...
...
@@ -447,14 +423,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=%
s
,"
"primary=%p
\n
"
,
DXGetErrorString8
(
rc
)
,
primary
);
"IDirectSound8_CreateSoundBuffer() should have failed: rc=%
08x
,"
"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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -467,7 +442,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
IDirectSoundBuffer_Release
(
primary
);
...
...
@@ -478,7 +453,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: "
"%
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"%
08x
\n
"
,
rc
);
if
(
rc
==
DSERR_CONTROLUNAVAIL
)
trace
(
" No Primary
\n
"
);
else
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
...
...
@@ -490,7 +465,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"primary buffer: %
08x
\n
"
,
rc
);
ref
=
IDirectSoundBuffer_Release
(
second
);
ok
(
ref
==
1
,
"IDirectSoundBuffer_Release() primary has %d references, "
"should have 1
\n
"
,
ref
);
...
...
@@ -500,15 +475,14 @@ 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 %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"should have failed %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
FAILED
(
rc
),
"Primary buffer does have an IDirectSoundBuffer8: %
08x
\n
"
,
rc
);
rc
=
IDirectSoundBuffer_GetVolume
(
primary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume() failed: %08x
\n
"
,
rc
);
if
(
winetest_interactive
)
{
trace
(
"Playing a 5 seconds reference tone at the current volume.
\n
"
);
...
...
@@ -529,8 +503,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -559,7 +532,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -567,15 +540,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -585,7 +557,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 "
"%
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"%
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
for
(
f
=
0
;
f
<
NB_FORMATS
;
f
++
)
{
...
...
@@ -594,8 +566,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -603,16 +574,15 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
formats
[
f
][
2
]);
wfx2
=
wfx
;
rc
=
IDirectSoundBuffer_SetFormat
(
primary
,
&
wfx
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
s
\n
"
,
format_string
(
&
wfx
),
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetFormat(%s) failed: %
08x
\n
"
,
format_string
(
&
wfx
),
rc
);
/* There is no guarantee that SetFormat will actually change the
* format to what we asked for. It depends on what the soundcard
* supports. So we must re-query the format.
*/
rc
=
IDirectSoundBuffer_GetFormat
(
primary
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
(
wfx
.
wFormatTag
!=
wfx2
.
wFormatTag
||
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
...
...
@@ -630,8 +600,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
init_format
(
&
wfx2
,
WAVE_FORMAT_PCM
,
11025
,
16
,
2
);
...
...
@@ -651,7 +620,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"buffer %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
test_buffer8
(
dso
,
&
secondary
,
0
,
FALSE
,
0
,
FALSE
,
0
,
...
...
@@ -671,8 +640,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -697,7 +665,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
/* Create the DirectSound object */
rc
=
pDirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
,
"DirectSoundCreate8() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate8() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -705,15 +673,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound8_GetCaps() failed: %
08x
\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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -723,12 +690,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 "
"%
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"%
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
rc
=
IDirectSoundBuffer_GetFormat
(
primary
,
&
wfx1
,
sizeof
(
wfx1
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer8_Getformat() failed: %08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT1
;
...
...
@@ -744,8 +710,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"should have returned DSERR_INVALIDPARAM, returned: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -759,12 +724,12 @@ static HRESULT test_secondary8(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
if
(
wfx
.
wBitsPerSample
!=
8
&&
wfx
.
wBitsPerSample
!=
16
)
ok
(
rc
==
DSERR_CONTROLUNAVAIL
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() "
"should have returned DSERR_CONTROLUNAVAIL and NULL, returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"should have returned DSERR_CONTROLUNAVAIL and NULL, returned: %
08x
%p
\n
"
,
rc
,
secondary
);
else
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"buffer %
08x
\n
"
,
rc
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
secondary
=
NULL
;
...
...
@@ -779,8 +744,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -788,8 +753,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
DSERR_CONTROLUNAVAIL
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
...
...
@@ -797,8 +762,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
wfxe
.
SubFormat
=
GUID_NULL
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
wfxe
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_PCM
;
...
...
@@ -806,8 +771,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
++
wfxe
.
Samples
.
wValidBitsPerSample
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
--
wfxe
.
Samples
.
wValidBitsPerSample
;
...
...
@@ -815,8 +780,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
wfxe
.
Samples
.
wValidBitsPerSample
=
0
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %
s
%p
\n
"
,
DXGetErrorString8
(
rc
)
,
secondary
);
"IDirectSound_CreateSoundBuffer() returned: %
08x
%p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
IDirectSoundBuffer_Release
(
secondary
);
wfxe
.
Samples
.
wValidBitsPerSample
=
wfxe
.
Format
.
wBitsPerSample
;
...
...
@@ -824,7 +789,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"buffer %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
if
(
winetest_interactive
)
{
...
...
@@ -850,8 +815,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSound8_SetCooperativeLevel() failed: %08x
\n
"
,
rc
);
EXIT:
ref
=
IDirectSound8_Release
(
dso
);
...
...
@@ -887,7 +851,7 @@ static void dsound8_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundEnumerateA
(
&
dsenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
08x
\n
"
,
rc
);
}
const
char
*
get_file_version
(
const
char
*
file_name
)
...
...
dlls/dsound/tests/duplex.c
View file @
ca681835
...
...
@@ -25,7 +25,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "mmreg.h"
#include "dxerr8.h"
#include "dsconf.h"
#include "dsound_test.h"
...
...
@@ -48,8 +47,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
DS_OK
,
"IDirectSoundFullDuplex_QueryInterface(IID_IUnknown) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ref
=
IDirectSoundFullDuplex_Release
(
unknown
);
ok
(
ref
==
0
,
"IDirectSoundFullDuplex_Release() has %d references, "
...
...
@@ -57,8 +55,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: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
rc
==
(
initialized
?
DS_OK
:
E_NOINTERFACE
),
"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSound) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ref
=
IDirectSound_Release
(
ds
);
ok
(
ref
==
0
,
"IDirectSound_Release() has %d references, "
...
...
@@ -67,12 +64,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ref
=
IDirectSoundFullDuplex_Release
(
dsfd1
);
ok
(
ref
==
1
,
"IDirectSoundFullDuplex_Release() has %d references, "
...
...
@@ -85,7 +82,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ref
=
IDirectSoundCapture_Release
(
dsc
);
ok
(
ref
==
0
,
"IDirectSoundCapture_Release() has %d references, "
...
...
@@ -94,7 +91,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
rc
=
IDirectSoundFullDuplex_QueryInterface
(
dsfdo
,
&
IID_IDirectSoundFullDuplex
,(
LPVOID
*
)
&
dsfd
);
ok
(
rc
==
DS_OK
,
"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSoundFullDuplex) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
)
{
ok
(
dsfdo
==
dsfd
,
"different interfaces
\n
"
);
ref
=
IDirectSound8_Release
(
dsfd
);
...
...
@@ -122,8 +119,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: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x
\n
"
,
rc
);
if
(
rc
==
REGDB_E_CLASSNOTREG
)
{
trace
(
" Class Not Registered
\n
"
);
return
;
...
...
@@ -139,8 +135,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: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x
\n
"
,
rc
);
if
(
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
FALSE
,
&
DSDEVID_DefaultCapture
,
&
DSDEVID_DefaultPlayback
);
...
...
@@ -150,8 +145,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: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x
\n
"
,
rc
);
if
(
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
FALSE
,
&
DSDEVID_DefaultVoiceCapture
,
&
DSDEVID_DefaultVoicePlayback
);
...
...
@@ -163,7 +157,7 @@ static void IDirectSoundFullDuplex_tests(void)
(
void
**
)
&
dsfdo
);
ok
(
rc
==
E_NOINTERFACE
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex,CLSID_DirectSoundPrivate) "
"should have failed:
%s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
)
,
rc
);
"should have failed:
0x%08x
\n
"
,
rc
);
ZeroMemory
(
&
wfex
,
sizeof
(
wfex
));
wfex
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
@@ -190,7 +184,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(NULL,NULL) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundFullDuplexCreate(NULL,NULL) failed: %
08x
\n
"
,
rc
);
if
(
rc
==
S_OK
&&
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
TRUE
,
NULL
,
NULL
);
...
...
@@ -201,8 +195,7 @@ static void IDirectSoundFullDuplex_tests(void)
&
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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DSDEVID_DefaultPlayback) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
TRUE
,
NULL
,
NULL
);
...
...
@@ -213,8 +206,7 @@ static void IDirectSoundFullDuplex_tests(void)
&
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: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DSDEVID_DefaultVoicePlayback) failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
TRUE
,
NULL
,
NULL
);
...
...
@@ -225,8 +217,7 @@ static void IDirectSoundFullDuplex_tests(void)
&
dsfdo
,
&
pDSCBuffer8
,
&
pDSBuffer8
,
NULL
);
ok
(
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_INVALIDCALL
,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback,"
"DSDEVID_DefaultVoiceCapture) should have failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
"DSDEVID_DefaultVoiceCapture) should have failed: %08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
dsfdo
)
IDirectSoundFullDuplex_Release
(
dsfdo
);
}
...
...
dlls/dsound/tests/propset.c
View file @
ca681835
...
...
@@ -25,7 +25,6 @@
#include "wine/test.h"
#include "dsound.h"
#include "dsconf.h"
#include "dxerr8.h"
#include "dsound_test.h"
...
...
@@ -192,20 +191,20 @@ static void propset_private_tests(void)
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSound
,
&
IID_IClassFactory
,
(
void
**
)
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DllGetClassObject(CLSID_DirectSound, "
"IID_IClassFactory) should have returned DSERR_INVALIDPARAM, "
"returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned: %
08x
\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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned: %
08x
\n
"
,
rc
);
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSound
,
&
IID_IUnknown
,
(
void
**
)(
&
pcf
));
ok
(
rc
==
DS_OK
,
"DllGetClassObject(CLSID_DirectSound, "
"IID_IUnknown) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IID_IUnknown) failed: %
08x
\n
"
,
rc
);
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSound
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
pcf
==
0
)
return
;
...
...
@@ -214,18 +213,18 @@ static void propset_private_tests(void)
rc
=
IClassFactory_CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"CreateInstance(IID_IKsPropertySet) should have "
"returned DSERR_INVALIDPARAM, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned DSERR_INVALIDPARAM, returned: %
08x
\n
"
,
rc
);
rc
=
IClassFactory_CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
rc
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned E_NOINTERFACE, returned: %
08x
\n
"
,
rc
);
/* and the direct sound 8 version */
if
(
pDirectSoundCreate8
)
{
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSound8
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
pcf
==
0
)
return
;
...
...
@@ -233,7 +232,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 E_NOINTERFACE, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned E_NOINTERFACE, returned: %
08x
\n
"
,
rc
);
}
/* try direct sound capture next */
...
...
@@ -241,7 +240,7 @@ static void propset_private_tests(void)
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSoundCapture
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed: %
08x
\n
"
,
rc
);
if
(
pcf
==
0
)
return
;
...
...
@@ -249,7 +248,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 E_NOINTERFACE,returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned E_NOINTERFACE,returned: %
08x
\n
"
,
rc
);
}
/* and the direct sound capture 8 version */
...
...
@@ -257,7 +256,7 @@ static void propset_private_tests(void)
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSoundCapture8
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundCapture8, "
"IID_IClassFactory) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IID_IClassFactory) failed: %
08x
\n
"
,
rc
);
if
(
pcf
==
0
)
return
;
...
...
@@ -265,7 +264,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 E_NOINTERFACE, returned: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned E_NOINTERFACE, returned: %
08x
\n
"
,
rc
);
}
/* try direct sound full duplex next */
...
...
@@ -273,7 +272,7 @@ static void propset_private_tests(void)
rc
=
(
pDllGetClassObject
)(
&
CLSID_DirectSoundFullDuplex
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundFullDuplex, "
"IID_IClassFactory) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"IID_IClassFactory) failed: %
08x
\n
"
,
rc
);
if
(
pcf
==
0
)
return
;
...
...
@@ -281,7 +280,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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"returned NOINTERFACE, returned: %
08x
\n
"
,
rc
);
}
/* try direct sound private last */
...
...
@@ -295,8 +294,8 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"CreateInstance(IID_IKsPropertySet) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -306,8 +305,8 @@ static void propset_private_tests(void)
&
support
);
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
E_INVALIDARG
)
trace
(
" Not Supported
\n
"
);
...
...
@@ -327,8 +326,8 @@ static void propset_private_tests(void)
&
support
);
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
E_INVALIDARG
)
trace
(
" Not Supported
\n
"
);
...
...
@@ -348,8 +347,8 @@ static void propset_private_tests(void)
&
support
);
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
E_INVALIDARG
)
trace
(
" Not Supported
\n
"
);
...
...
@@ -369,8 +368,8 @@ static void propset_private_tests(void)
&
support
);
ok
(
rc
==
DS_OK
||
rc
==
E_INVALIDARG
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
E_INVALIDARG
)
trace
(
" Not Supported
\n
"
);
...
...
@@ -388,8 +387,8 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -404,8 +403,8 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -420,8 +419,8 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -438,8 +437,8 @@ static void propset_private_tests(void)
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -468,8 +467,8 @@ static void propset_private_tests(void)
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -498,8 +497,8 @@ static void propset_private_tests(void)
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -528,8 +527,8 @@ static void propset_private_tests(void)
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
,
&
support
);
ok
(
rc
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W) failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W) failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -567,7 +566,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
rc
=
pDirectSoundCreate
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
||
rc
==
DSERR_NODRIVER
||
rc
==
DSERR_ALLOCATED
||
rc
==
E_FAIL
,
"DirectSoundCreate() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"DirectSoundCreate() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
{
if
(
rc
==
DSERR_NODRIVER
)
trace
(
" No Driver
\n
"
);
...
...
@@ -581,8 +580,8 @@ 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: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"IDirectSound_SetCooperativeLevel() failed: %
08x
\n
"
,
rc
);
if
(
rc
!=
DS_OK
)
goto
EXIT
;
...
...
@@ -593,7 +592,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
bufdesc
.
dwFlags
=
DSBCAPS_PRIMARYBUFFER
|
DSBCAPS_LOCHARDWARE
|
DSBCAPS_CTRL3D
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
primary
,
NULL
);
ok
(
rc
==
DS_OK
&&
primary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() failed to "
"create a hardware 3D primary buffer: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"create a hardware 3D primary buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
primary
!=
NULL
)
{
ZeroMemory
(
&
wfx
,
sizeof
(
wfx
));
wfx
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
@@ -611,7 +610,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
);
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() "
"failed to create a secondary buffer: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
"failed to create a secondary buffer: %
08x
\n
"
,
rc
);
if
(
rc
==
DS_OK
&&
secondary
!=
NULL
)
{
IKsPropertySet
*
pPropertySet
=
NULL
;
rc
=
IDirectSoundBuffer_QueryInterface
(
secondary
,
...
...
@@ -703,7 +702,7 @@ static void propset_buffer_tests(void)
{
HRESULT
rc
;
rc
=
pDirectSoundEnumerateA
(
&
dsenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
s
\n
"
,
DXGetErrorString8
(
rc
)
);
ok
(
rc
==
DS_OK
,
"DirectSoundEnumerateA() failed: %
08x
\n
"
,
rc
);
}
START_TEST
(
propset
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment