Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
65aac34c
Commit
65aac34c
authored
Oct 10, 2006
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound/tests: Win64 printf format warning fixes.
parent
699d4413
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
121 additions
and
122 deletions
+121
-122
Makefile.in
dlls/dsound/tests/Makefile.in
+0
-1
capture.c
dlls/dsound/tests/capture.c
+9
-9
ds3d.c
dlls/dsound/tests/ds3d.c
+28
-28
ds3d8.c
dlls/dsound/tests/ds3d8.c
+26
-26
dsound.c
dlls/dsound/tests/dsound.c
+13
-13
dsound8.c
dlls/dsound/tests/dsound8.c
+10
-10
duplex.c
dlls/dsound/tests/duplex.c
+4
-4
propset.c
dlls/dsound/tests/propset.c
+31
-31
No files found.
dlls/dsound/tests/Makefile.in
View file @
65aac34c
...
...
@@ -5,7 +5,6 @@ VPATH = @srcdir@
TESTDLL
=
dsound.dll
IMPORTS
=
dsound ole32 version user32 kernel32
EXTRALIBS
=
-ldxguid
-luuid
-ldxerr8
EXTRADEFS
=
-DWINE_NO_LONG_AS_INT
CTESTS
=
\
capture.c
\
...
...
dlls/dsound/tests/capture.c
View file @
65aac34c
...
...
@@ -95,7 +95,7 @@ const char * format_string(const WAVEFORMATEX* wfx)
{
static
char
str
[
64
];
sprintf
(
str
,
"%5
l
dx%2dx%d %s"
,
sprintf
(
str
,
"%5dx%2dx%d %s"
,
wfx
->
nSamplesPerSec
,
wfx
->
wBitsPerSample
,
wfx
->
nChannels
,
get_format_str
(
wfx
->
wFormatTag
));
...
...
@@ -354,7 +354,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: size = %
ld flags=0x%08lx buffer size=%l
d
\n
"
,
trace
(
" Caps: size = %
d flags=0x%08x buffer size=%
d
\n
"
,
dscbcaps
.
dwSize
,
dscbcaps
.
dwFlags
,
dscbcaps
.
dwBufferBytes
);
}
...
...
@@ -369,14 +369,14 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
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=%
l
d
\n
"
,
"have returned the needed size: rc=%s, size=%d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
rc
=
IDirectSoundCaptureBuffer_GetFormat
(
dscbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Format: tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
" Format: tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
}
...
...
@@ -391,7 +391,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Status=0x%04
l
x
\n
"
,
status
);
trace
(
" Status=0x%04x
\n
"
,
status
);
}
ZeroMemory
(
&
state
,
sizeof
(
state
));
...
...
@@ -439,7 +439,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
status
==
(
DSCBSTATUS_CAPTURING
|
DSCBSTATUS_LOOPING
),
"GetStatus: bad status: %l
x
\n
"
,
status
);
"GetStatus: bad status: %
x
\n
"
,
status
);
if
(
rc
!=
DS_OK
)
return
;
...
...
@@ -447,10 +447,10 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
for
(
i
=
0
;
i
<
(
NOTIFICATIONS
*
2
);
i
++
)
{
rc
=
WaitForMultipleObjects
(
NOTIFICATIONS
,
state
.
event
,
FALSE
,
3000
);
ok
(
rc
==
(
WAIT_OBJECT_0
+
(
i
%
NOTIFICATIONS
)),
"WaitForMultipleObjects failed: 0x%
l
x
\n
"
,
rc
);
"WaitForMultipleObjects failed: 0x%x
\n
"
,
rc
);
if
(
rc
!=
(
WAIT_OBJECT_0
+
(
i
%
NOTIFICATIONS
)))
{
ok
((
rc
==
WAIT_TIMEOUT
)
||
(
rc
==
WAIT_FAILED
),
"Wrong notification: should be %d, got %
l
d
\n
"
,
"Wrong notification: should be %d, got %d
\n
"
,
i
%
NOTIFICATIONS
,
rc
-
WAIT_OBJECT_0
);
}
if
(
!
capture_buffer_service
(
&
state
))
...
...
@@ -512,7 +512,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
ok
(
rc
==
DS_OK
,
"IDirectSoundCapture_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: size=%
ld flags=0x%08lx formats=%05lx channels=%l
d
\n
"
,
trace
(
" Caps: size=%
d flags=0x%08x formats=%05x channels=%
d
\n
"
,
dsccaps
.
dwSize
,
dsccaps
.
dwFlags
,
dsccaps
.
dwFormats
,
dsccaps
.
dwChannels
);
}
...
...
dlls/dsound/tests/ds3d.c
View file @
65aac34c
...
...
@@ -225,7 +225,7 @@ static int buffer_service(play_state_t* state)
state
->
played
+=
play_pos
-
last_play_pos
;
if
(
winetest_debug
>
1
)
trace
(
"buf size=%
ld last_play_pos=%ld play_pos=%ld played=%ld / %l
d
\n
"
,
trace
(
"buf size=%
d last_play_pos=%d play_pos=%d played=%d / %
d
\n
"
,
state
->
buffer_size
,
last_play_pos
,
play_pos
,
state
->
played
,
state
->
wave_len
);
...
...
@@ -242,7 +242,7 @@ static int buffer_service(play_state_t* state)
buf_free
=
state
->
buffer_size
-
state
->
offset
+
play_pos
;
if
(
winetest_debug
>
1
)
trace
(
"offset=%
ld free=%ld written=%ld / %l
d
\n
"
,
trace
(
"offset=%
d free=%d written=%d / %
d
\n
"
,
state
->
offset
,
buf_free
,
state
->
written
,
state
->
wave_len
);
if
(
buf_free
==
0
)
return
1
;
...
...
@@ -254,14 +254,14 @@ static int buffer_service(play_state_t* state)
goto
STOP
;
buf_free
-=
w
;
if
(
state
->
written
==
state
->
wave_len
&&
winetest_debug
>
1
)
trace
(
"last sound byte at %
l
d
\n
"
,
trace
(
"last sound byte at %d
\n
"
,
(
state
->
written
%
state
->
buffer_size
));
}
if
(
buf_free
>
0
)
{
/* Fill with silence */
if
(
winetest_debug
>
1
)
trace
(
"writing %
l
d bytes of silence
\n
"
,
buf_free
);
trace
(
"writing %d bytes of silence
\n
"
,
buf_free
);
if
(
buffer_silence
(
state
,
buf_free
)
==-
1
)
goto
STOP
;
}
...
...
@@ -315,7 +315,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: flags=0x%08
lx size=%l
d
\n
"
,
dsbcaps
.
dwFlags
,
trace
(
" Caps: flags=0x%08
x size=%
d
\n
"
,
dsbcaps
.
dwFlags
,
dsbcaps
.
dwBufferBytes
);
}
...
...
@@ -323,13 +323,13 @@ 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=%
l
d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
"returned the needed size: rc=%s size=%d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
rc
=
IDirectSoundBuffer_GetFormat
(
*
dsbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Format: %s tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
" Format: %s tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
is_primary
?
"Primary"
:
"Secondary"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
...
...
@@ -348,7 +348,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
if
(
rc
==
DS_OK
)
{
DWORD
f
=
set_frequency
?
frequency
:
wfx
.
nSamplesPerSec
;
ok
(
freq
==
f
,
"The frequency returned by GetFrequency "
"%
ld does not match the format %l
d
\n
"
,
freq
,
f
);
"%
d does not match the format %
d
\n
"
,
freq
,
f
);
}
/* DSOUND: Error: Invalid status pointer */
...
...
@@ -359,7 +359,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
status
==
0
,
"status=0x%
l
x instead of 0
\n
"
,
status
);
ok
(
status
==
0
,
"status=0x%x instead of 0
\n
"
,
status
);
if
(
is_primary
)
{
DSBCAPS
new_dsbcaps
;
...
...
@@ -393,10 +393,10 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
wfx
.
wBitsPerSample
!=
wfx2
.
wBitsPerSample
||
wfx
.
nChannels
!=
wfx2
.
nChannels
))
{
trace
(
"Requested format tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Requested format tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx2
.
wFormatTag
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
,
wfx2
.
nAvgBytesPerSec
,
wfx2
.
nBlockAlign
);
trace
(
"Got tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Got tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
}
...
...
@@ -407,20 +407,20 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" new Caps: flags=0x%08
lx size=%l
d
\n
"
,
new_dsbcaps
.
dwFlags
,
trace
(
" new Caps: flags=0x%08
x size=%
d
\n
"
,
new_dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwBufferBytes
);
}
/* Check for primary buffer size change */
ok
(
new_dsbcaps
.
dwBufferBytes
==
dsbcaps
.
dwBufferBytes
,
" buffer size changed after SetFormat() - "
"previous size was %
lu, current size is %l
u
\n
"
,
"previous size was %
u, current size is %
u
\n
"
,
dsbcaps
.
dwBufferBytes
,
new_dsbcaps
.
dwBufferBytes
);
/* Check for primary buffer flags change */
ok
(
new_dsbcaps
.
dwFlags
==
dsbcaps
.
dwFlags
,
" flags changed after SetFormat() - "
"previous flags were %08
lx, current flags are %08l
x
\n
"
,
"previous flags were %08
x, current flags are %08
x
\n
"
,
dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwFlags
);
/* Set the CooperativeLevel back to normal */
...
...
@@ -441,12 +441,12 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
if
(
winetest_interactive
)
{
if
(
set_frequency
)
trace
(
" Playing %g second 440Hz tone at %
l
dx%dx%d with a "
"frequency of %
ld (%l
dHz)
\n
"
,
duration
,
trace
(
" Playing %g second 440Hz tone at %dx%dx%d with a "
"frequency of %
d (%
dHz)
\n
"
,
duration
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
frequency
,
(
440
*
frequency
)
/
wfx
.
nSamplesPerSec
);
else
trace
(
" Playing %g second 440Hz tone at %
l
dx%dx%d
\n
"
,
duration
,
trace
(
" Playing %g second 440Hz tone at %dx%dx%d
\n
"
,
duration
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
);
}
...
...
@@ -594,7 +594,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
status
==
(
DSBSTATUS_PLAYING
|
DSBSTATUS_LOOPING
),
"GetStatus: bad status: %
l
x
\n
"
,
status
);
"GetStatus: bad status: %x
\n
"
,
status
);
if
(
listener
)
{
ZeroMemory
(
&
listener_param
,
sizeof
(
listener_param
));
...
...
@@ -655,7 +655,7 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
/* Check the sound duration was within 10% of the expected value */
now
=
GetTickCount
();
ok
(
fabs
(
1000
*
duration
-
now
+
start_time
)
<=
100
*
duration
,
"The sound played for %
l
d ms instead of %g ms
\n
"
,
"The sound played for %d ms instead of %g ms
\n
"
,
now
-
start_time
,
1000
*
duration
);
free
(
state
.
wave
);
...
...
@@ -783,8 +783,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx
;
if
(
winetest_interactive
)
{
trace
(
" Testing a %s%ssecondary buffer %s%s%s%sat %
l
dx%dx%d "
"with a primary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a %s%ssecondary buffer %s%s%s%sat %dx%dx%d "
"with a primary buffer at %dx%dx%d
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
...
...
@@ -797,7 +797,7 @@ 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 %
l
dx%dx%d (%s): %s
\n
"
,
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %s
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
move_listener
?
"moving "
:
""
,
listener
!=
NULL
?
"listener "
:
""
,
...
...
@@ -813,11 +813,11 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
vol
==
0
,
"wrong volume for a new secondary buffer: %
l
d
\n
"
,
vol
);
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
(
pan
==
0
,
"wrong pan for a new secondary buffer: %
l
d
\n
"
,
pan
);
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
...
...
@@ -835,7 +835,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
vol
==-
1000
,
"secondary: wrong volume %
l
d instead of -1000
\n
"
,
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: "
...
...
@@ -843,18 +843,18 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
pan
==-
1000
,
"secondary: wrong pan %
l
d instead of -1000
\n
"
,
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
(
vol
==
refvol
,
"The primary volume changed from %
ld to %l
d
\n
"
,
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
(
pan
==
refpan
,
"The primary pan changed from %
ld to %l
d
\n
"
,
ok
(
pan
==
refpan
,
"The primary pan changed from %
d to %
d
\n
"
,
refpan
,
pan
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
0
);
...
...
dlls/dsound/tests/ds3d8.c
View file @
65aac34c
...
...
@@ -128,7 +128,7 @@ static int buffer_service8(play_state_t* state)
state
->
played
+=
play_pos
-
last_play_pos
;
if
(
winetest_debug
>
1
)
trace
(
"buf size=%
ld last_play_pos=%ld play_pos=%ld played=%ld / %l
d
\n
"
,
trace
(
"buf size=%
d last_play_pos=%d play_pos=%d played=%d / %
d
\n
"
,
state
->
buffer_size
,
last_play_pos
,
play_pos
,
state
->
played
,
state
->
wave_len
);
...
...
@@ -145,7 +145,7 @@ static int buffer_service8(play_state_t* state)
buf_free
=
state
->
buffer_size
-
state
->
offset
+
play_pos
;
if
(
winetest_debug
>
1
)
trace
(
"offset=%
ld free=%ld written=%ld / %l
d
\n
"
,
trace
(
"offset=%
d free=%d written=%d / %
d
\n
"
,
state
->
offset
,
buf_free
,
state
->
written
,
state
->
wave_len
);
if
(
buf_free
==
0
)
return
1
;
...
...
@@ -157,14 +157,14 @@ static int buffer_service8(play_state_t* state)
goto
STOP
;
buf_free
-=
w
;
if
(
state
->
written
==
state
->
wave_len
&&
winetest_debug
>
1
)
trace
(
"last sound byte at %
l
d
\n
"
,
trace
(
"last sound byte at %d
\n
"
,
(
state
->
written
%
state
->
buffer_size
));
}
if
(
buf_free
>
0
)
{
/* Fill with silence */
if
(
winetest_debug
>
1
)
trace
(
"writing %
l
d bytes of silence
\n
"
,
buf_free
);
trace
(
"writing %d bytes of silence
\n
"
,
buf_free
);
if
(
buffer_silence8
(
state
,
buf_free
)
==-
1
)
goto
STOP
;
}
...
...
@@ -208,7 +208,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Caps: flags=0x%08
lx size=%l
d
\n
"
,
dsbcaps
.
dwFlags
,
trace
(
" Caps: flags=0x%08
x size=%
d
\n
"
,
dsbcaps
.
dwFlags
,
dsbcaps
.
dwBufferBytes
);
}
...
...
@@ -216,13 +216,13 @@ 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=%
l
d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
"returned the needed size: rc=%s size=%d
\n
"
,
DXGetErrorString8
(
rc
),
size
);
rc
=
IDirectSoundBuffer_GetFormat
(
*
dsbo
,
&
wfx
,
sizeof
(
wfx
),
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetFormat() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" Format: %s tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
" Format: %s tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
is_primary
?
"Primary"
:
"Secondary"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
...
...
@@ -240,7 +240,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
"IDirectSoundBuffer_GetFrequency() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
{
ok
(
freq
==
wfx
.
nSamplesPerSec
,
"The frequency returned by GetFrequency "
"%
ld does not match the format %l
d
\n
"
,
freq
,
wfx
.
nSamplesPerSec
);
"%
d does not match the format %
d
\n
"
,
freq
,
wfx
.
nSamplesPerSec
);
}
/* DSOUND: Error: Invalid status pointer */
...
...
@@ -251,7 +251,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
rc
=
IDirectSoundBuffer_GetStatus
(
*
dsbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
status
==
0
,
"status=0x%
l
x instead of 0
\n
"
,
status
);
ok
(
status
==
0
,
"status=0x%x instead of 0
\n
"
,
status
);
if
(
is_primary
)
{
DSBCAPS
new_dsbcaps
;
...
...
@@ -285,10 +285,10 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
wfx
.
wBitsPerSample
!=
wfx2
.
wBitsPerSample
||
wfx
.
nChannels
!=
wfx2
.
nChannels
))
{
trace
(
"Requested format tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Requested format tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx2
.
wFormatTag
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
,
wfx2
.
nAvgBytesPerSec
,
wfx2
.
nBlockAlign
);
trace
(
"Got tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Got tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
}
...
...
@@ -299,20 +299,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
winetest_debug
>
1
)
{
trace
(
" new Caps: flags=0x%08
lx size=%l
d
\n
"
,
new_dsbcaps
.
dwFlags
,
trace
(
" new Caps: flags=0x%08
x size=%
d
\n
"
,
new_dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwBufferBytes
);
}
/* Check for primary buffer size change */
ok
(
new_dsbcaps
.
dwBufferBytes
==
dsbcaps
.
dwBufferBytes
,
" buffer size changed after SetFormat() - "
"previous size was %
lu, current size is %l
u
\n
"
,
"previous size was %
u, current size is %
u
\n
"
,
dsbcaps
.
dwBufferBytes
,
new_dsbcaps
.
dwBufferBytes
);
/* Check for primary buffer flags change */
ok
(
new_dsbcaps
.
dwFlags
==
dsbcaps
.
dwFlags
,
" flags changed after SetFormat() - "
"previous flags were %08
lx, current flags are %08l
x
\n
"
,
"previous flags were %08
x, current flags are %08
x
\n
"
,
dsbcaps
.
dwFlags
,
new_dsbcaps
.
dwFlags
);
/* Set the CooperativeLevel back to normal */
...
...
@@ -332,7 +332,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
DWORD
length1
;
if
(
winetest_interactive
)
{
trace
(
" Playing %g second 440Hz tone at %
l
dx%dx%d
\n
"
,
duration
,
trace
(
" Playing %g second 440Hz tone at %dx%dx%d
\n
"
,
duration
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
);
}
...
...
@@ -477,7 +477,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetStatus() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
status
==
(
DSBSTATUS_PLAYING
|
DSBSTATUS_LOOPING
),
"GetStatus: bad status: %
l
x
\n
"
,
status
);
"GetStatus: bad status: %x
\n
"
,
status
);
if
(
listener
)
{
ZeroMemory
(
&
listener_param
,
sizeof
(
listener_param
));
...
...
@@ -537,7 +537,7 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
/* Check the sound duration was within 10% of the expected value */
now
=
GetTickCount
();
ok
(
fabs
(
1000
*
duration
-
now
+
start_time
)
<=
100
*
duration
,
"The sound played for %
l
d ms instead of %g ms
\n
"
,
"The sound played for %d ms instead of %g ms
\n
"
,
now
-
start_time
,
1000
*
duration
);
free
(
state
.
wave
);
...
...
@@ -668,8 +668,8 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
}
if
(
winetest_interactive
)
{
trace
(
" Testing a %s%ssecondary buffer %s%s%s%sat %
l
dx%dx%d "
"with a primary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a %s%ssecondary buffer %s%s%s%sat %dx%dx%d "
"with a primary buffer at %dx%dx%d
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
...
...
@@ -682,7 +682,7 @@ 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 %
l
dx%dx%d (%s): %s
\n
"
,
"failed to create a %s%ssecondary buffer %s%s%s%sat %dx%dx%d (%s): %s
\n
"
,
has_3dbuffer
?
"3D "
:
""
,
has_duplicate
?
"duplicated "
:
""
,
listener
!=
NULL
||
move_sound
?
"with "
:
""
,
move_listener
?
"moving "
:
""
,
listener
!=
NULL
?
"listener "
:
""
,
...
...
@@ -698,11 +698,11 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
vol
==
0
,
"wrong volume for a new secondary buffer: %
l
d
\n
"
,
vol
);
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
(
pan
==
0
,
"wrong pan for a new secondary buffer: %
l
d
\n
"
,
pan
);
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
...
...
@@ -720,7 +720,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetVolume
(
secondary
,
&
vol
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetVolume(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
vol
==-
1000
,
"secondary: wrong volume %
l
d instead of -1000
\n
"
,
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: "
...
...
@@ -728,18 +728,18 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
rc
=
IDirectSoundBuffer_GetPan
(
secondary
,
&
pan
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_SetPan(secondary) failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
pan
==-
1000
,
"secondary: wrong pan %
l
d instead of -1000
\n
"
,
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
(
vol
==
refvol
,
"The primary volume changed from %
ld to %l
d
\n
"
,
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
(
pan
==
refpan
,
"The primary pan changed from %
ld to %l
d
\n
"
,
ok
(
pan
==
refpan
,
"The primary pan changed from %
d to %
d
\n
"
,
refpan
,
pan
);
rc
=
IDirectSoundBuffer_SetVolume
(
secondary
,
0
);
...
...
dlls/dsound/tests/dsound.c
View file @
65aac34c
...
...
@@ -159,7 +159,7 @@ static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
speaker_config
!=
new_speaker_config
)
trace
(
"IDirectSound_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08
lx, got 0x%08l
x
\n
"
,
"config: expected 0x%08
x, got 0x%08
x
\n
"
,
speaker_config
,
new_speaker_config
);
}
...
...
@@ -472,7 +472,7 @@ static HRESULT test_primary(LPGUID lpGuid)
trace
(
"Playing a 5 seconds reference tone at the current "
"volume.
\n
"
);
if
(
rc
==
DS_OK
)
trace
(
"(the current volume is %
l
d according to DirectSound)
\n
"
,
trace
(
"(the current volume is %d according to DirectSound)
\n
"
,
vol
);
trace
(
"All subsequent tones should be identical to this one.
\n
"
);
trace
(
"Listen for stutter, changes in pitch, volume, etc.
\n
"
);
...
...
@@ -576,11 +576,11 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
wfx
.
wBitsPerSample
!=
wfx2
.
wBitsPerSample
||
wfx
.
nChannels
!=
wfx2
.
nChannels
))
{
trace
(
"Requested primary format tag=0x%04x %
l
dx%dx%d "
"avg.B/s=%
l
d align=%d
\n
"
,
trace
(
"Requested primary format tag=0x%04x %dx%dx%d "
"avg.B/s=%d align=%d
\n
"
,
wfx2
.
wFormatTag
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
,
wfx2
.
nAvgBytesPerSec
,
wfx2
.
nBlockAlign
);
trace
(
"Got tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Got tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
}
...
...
@@ -601,8 +601,8 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx2
;
if
(
winetest_interactive
)
{
trace
(
" Testing a primary buffer at %
l
dx%dx%d with a "
"secondary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a primary buffer at %dx%dx%d with a "
"secondary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
);
}
...
...
@@ -714,8 +714,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx
;
if
(
winetest_interactive
)
{
trace
(
" Testing a secondary buffer at %
l
dx%dx%d "
"with a primary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a secondary buffer at %dx%dx%d "
"with a primary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx1
.
nSamplesPerSec
,
wfx1
.
wBitsPerSample
,
wfx1
.
nChannels
);
}
...
...
@@ -790,8 +790,8 @@ static HRESULT test_block_align(LPGUID lpGuid)
"returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
ok
(
dsbcaps
.
dwBufferBytes
==
(
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
),
"Buffer size not a multiple of nBlockAlign: requested %
l
d, "
"got %
ld, should be %l
d
\n
"
,
bufdesc
.
dwBufferBytes
,
"Buffer size not a multiple of nBlockAlign: requested %d, "
"got %
d, should be %
d
\n
"
,
bufdesc
.
dwBufferBytes
,
dsbcaps
.
dwBufferBytes
,
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
);
ref
=
IDirectSoundBuffer_Release
(
secondary
);
ok
(
ref
==
0
,
"IDirectSoundBuffer_Release() secondary has %d references, "
...
...
@@ -874,8 +874,8 @@ static HRESULT test_frequency(LPGUID lpGuid)
BUFFER_LEN
/
1000
,
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx
;
if
(
winetest_interactive
)
{
trace
(
" Testing a secondary buffer at %
l
dx%dx%d "
"with a primary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a secondary buffer at %dx%dx%d "
"with a primary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx1
.
nSamplesPerSec
,
wfx1
.
wBitsPerSample
,
wfx1
.
nChannels
);
}
...
...
dlls/dsound/tests/dsound8.c
View file @
65aac34c
...
...
@@ -174,7 +174,7 @@ static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
&&
speaker_config
!=
new_speaker_config
)
trace
(
"IDirectSound8_GetSpeakerConfig() failed to set speaker "
"config: expected 0x%08
lx, got 0x%08l
x
\n
"
,
"config: expected 0x%08
x, got 0x%08
x
\n
"
,
speaker_config
,
new_speaker_config
);
}
...
...
@@ -503,7 +503,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
if
(
winetest_interactive
)
{
trace
(
"Playing a 5 seconds reference tone at the current volume.
\n
"
);
if
(
rc
==
DS_OK
)
trace
(
"(the current volume is %
l
d according to DirectSound)
\n
"
,
trace
(
"(the current volume is %d according to DirectSound)
\n
"
,
vol
);
trace
(
"All subsequent tones should be identical to this one.
\n
"
);
trace
(
"Listen for stutter, changes in pitch, volume, etc.
\n
"
);
...
...
@@ -608,11 +608,11 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
wfx
.
nSamplesPerSec
!=
wfx2
.
nSamplesPerSec
||
wfx
.
wBitsPerSample
!=
wfx2
.
wBitsPerSample
||
wfx
.
nChannels
!=
wfx2
.
nChannels
))
{
trace
(
"Requested primary format tag=0x%04x %
l
dx%dx%d "
"avg.B/s=%
l
d align=%d
\n
"
,
trace
(
"Requested primary format tag=0x%04x %dx%dx%d "
"avg.B/s=%d align=%d
\n
"
,
wfx2
.
wFormatTag
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
,
wfx2
.
nAvgBytesPerSec
,
wfx2
.
nBlockAlign
);
trace
(
"Got tag=0x%04x %
ldx%dx%d avg.B/s=%l
d align=%d
\n
"
,
trace
(
"Got tag=0x%04x %
dx%dx%d avg.B/s=%
d align=%d
\n
"
,
wfx
.
wFormatTag
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx
.
nAvgBytesPerSec
,
wfx
.
nBlockAlign
);
}
...
...
@@ -633,8 +633,8 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx2
;
if
(
winetest_interactive
)
{
trace
(
" Testing a primary buffer at %
l
dx%dx%d with a "
"secondary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a primary buffer at %dx%dx%d with a "
"secondary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx2
.
nSamplesPerSec
,
wfx2
.
wBitsPerSample
,
wfx2
.
nChannels
);
}
...
...
@@ -746,8 +746,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
wfx
.
nBlockAlign
);
bufdesc
.
lpwfxFormat
=&
wfx
;
if
(
winetest_interactive
)
{
trace
(
" Testing a secondary buffer at %
l
dx%dx%d "
"with a primary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a secondary buffer at %dx%dx%d "
"with a primary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
,
wfx1
.
nSamplesPerSec
,
wfx1
.
wBitsPerSample
,
wfx1
.
nChannels
);
}
...
...
@@ -829,7 +829,7 @@ const char * get_file_version(const char * file_name)
VS_FIXEDFILEINFO
*
pFixedVersionInfo
;
UINT
len
;
if
(
VerQueryValueA
(
data
,
backslash
,
(
LPVOID
*
)
&
pFixedVersionInfo
,
&
len
))
{
sprintf
(
version
,
"%
ld.%ld.%ld.%l
d"
,
sprintf
(
version
,
"%
d.%d.%d.%
d"
,
pFixedVersionInfo
->
dwFileVersionMS
>>
16
,
pFixedVersionInfo
->
dwFileVersionMS
&
0xffff
,
pFixedVersionInfo
->
dwFileVersionLS
>>
16
,
...
...
dlls/dsound/tests/duplex.c
View file @
65aac34c
...
...
@@ -124,7 +124,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%08
l
x)
\n
"
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
if
(
rc
==
REGDB_E_CLASSNOTREG
)
{
trace
(
" Class Not Registered
\n
"
);
...
...
@@ -141,7 +141,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%08
l
x)
\n
"
,
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
if
(
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
FALSE
,
&
DSDEVID_DefaultCapture
,
...
...
@@ -152,7 +152,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%08
l
x)
\n
"
,
ok
(
rc
==
S_OK
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
if
(
dsfdo
)
IDirectSoundFullDuplex_test
(
dsfdo
,
FALSE
,
&
DSDEVID_DefaultVoiceCapture
,
...
...
@@ -165,7 +165,7 @@ static void IDirectSoundFullDuplex_tests(void)
(
void
**
)
&
dsfdo
);
ok
(
rc
==
E_NOINTERFACE
,
"CoCreateInstance(CLSID_DirectSoundFullDuplex,CLSID_DirectSoundPrivate) "
"should have failed: %s (0x%08
l
x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
"should have failed: %s (0x%08x)
\n
"
,
DXGetErrorString8
(
rc
),
rc
);
ZeroMemory
(
&
wfex
,
sizeof
(
wfex
));
wfex
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
dlls/dsound/tests/propset.c
View file @
65aac34c
...
...
@@ -83,7 +83,7 @@ BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
trace
(
" Description: %s
\n
"
,
data
->
Description
);
trace
(
" Module: %s
\n
"
,
data
->
Module
);
trace
(
" Interface: %s
\n
"
,
data
->
Interface
);
trace
(
" WaveDeviceId: %
l
d
\n
"
,
data
->
WaveDeviceId
);
trace
(
" WaveDeviceId: %d
\n
"
,
data
->
WaveDeviceId
);
return
TRUE
;
}
...
...
@@ -115,7 +115,7 @@ BOOL CALLBACK callback1(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA data,
trace
(
" ModuleA: %s
\n
"
,
data
->
ModuleA
);
WideCharToMultiByte
(
CP_ACP
,
0
,
data
->
ModuleW
,
-
1
,
moduleA
,
sizeof
(
moduleA
),
NULL
,
NULL
);
trace
(
" ModuleW: %s
\n
"
,
moduleA
);
trace
(
" WaveDeviceId: %
l
d
\n
"
,
data
->
WaveDeviceId
);
trace
(
" WaveDeviceId: %d
\n
"
,
data
->
WaveDeviceId
);
return
TRUE
;
}
...
...
@@ -141,7 +141,7 @@ BOOL CALLBACK callbackA(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA data,
trace
(
" Description: %s
\n
"
,
data
->
Description
);
trace
(
" Module: %s
\n
"
,
data
->
Module
);
trace
(
" Interface: %s
\n
"
,
data
->
Interface
);
trace
(
" WaveDeviceId: %
l
d
\n
"
,
data
->
WaveDeviceId
);
trace
(
" WaveDeviceId: %d
\n
"
,
data
->
WaveDeviceId
);
return
TRUE
;
}
...
...
@@ -174,7 +174,7 @@ BOOL CALLBACK callbackW(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data,
trace
(
"
\t
Description: %s
\n
"
,
descriptionA
);
trace
(
"
\t
Module: %s
\n
"
,
moduleA
);
trace
(
"
\t
Interface: %s
\n
"
,
interfaceA
);
trace
(
"
\t
WaveDeviceId: %
l
d
\n
"
,
data
->
WaveDeviceId
);
trace
(
"
\t
WaveDeviceId: %d
\n
"
,
data
->
WaveDeviceId
);
return
TRUE
;
}
...
...
@@ -324,10 +324,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -345,10 +345,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -366,10 +366,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -387,10 +387,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -403,10 +403,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: support = "
"0x%
l
x
\n
"
,
support
);
"0x%x
\n
"
,
support
);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -419,10 +419,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A: support = "
"0x%
l
x
\n
"
,
support
);
"0x%x
\n
"
,
support
);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W */
rc
=
IKsPropertySet_QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
...
...
@@ -435,10 +435,10 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W: support = "
"0x%
l
x
\n
"
,
support
);
"0x%x
\n
"
,
support
);
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE */
trace
(
"*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE ***
\n
"
);
...
...
@@ -453,9 +453,9 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%
l
x
\n
"
,
support
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%x
\n
"
,
support
);
if
(
support
&
KSPROPERTY_SUPPORT_GET
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA
data
;
...
...
@@ -467,7 +467,7 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_Get
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE
,
NULL
,
0
,
&
data
,
sizeof
(
data
),
&
bytes
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%
l
x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%x
\n
"
,
rc
);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 */
...
...
@@ -483,9 +483,9 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: support = 0x%
l
x
\n
"
,
support
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1: support = 0x%x
\n
"
,
support
);
if
(
support
&
KSPROPERTY_SUPPORT_GET
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
data
;
...
...
@@ -497,7 +497,7 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_Get
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
,
NULL
,
0
,
&
data
,
sizeof
(
data
),
&
bytes
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%
l
x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%x
\n
"
,
rc
);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A */
...
...
@@ -513,9 +513,9 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: support = 0x%
l
x
\n
"
,
support
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A: support = 0x%x
\n
"
,
support
);
if
(
support
&
KSPROPERTY_SUPPORT_GET
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
data
;
...
...
@@ -527,7 +527,7 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_Get
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
,
NULL
,
0
,
&
data
,
sizeof
(
data
),
&
bytes
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%
l
x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%x
\n
"
,
rc
);
}
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W */
...
...
@@ -543,9 +543,9 @@ static void propset_private_tests(void)
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: "
"support = 0x%
l
x
\n
"
,
support
);
"support = 0x%x
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set "
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: support = 0x%
l
x
\n
"
,
support
);
"DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W: support = 0x%x
\n
"
,
support
);
if
(
support
&
KSPROPERTY_SUPPORT_GET
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
data
;
...
...
@@ -557,7 +557,7 @@ static void propset_private_tests(void)
rc
=
IKsPropertySet_Get
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
,
NULL
,
0
,
&
data
,
sizeof
(
data
),
&
bytes
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%
l
x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"Couldn't enumerate: 0x%x
\n
"
,
rc
);
}
error:
...
...
@@ -618,7 +618,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
bufdesc
.
dwFlags
=
DSBCAPS_CTRLDEFAULT
|
DSBCAPS_GETCURRENTPOSITION2
;
bufdesc
.
dwBufferBytes
=
wfx
.
nAvgBytesPerSec
;
bufdesc
.
lpwfxFormat
=&
wfx
;
trace
(
" Testing a secondary buffer at %
l
dx%dx%d
\n
"
,
trace
(
" Testing a secondary buffer at %dx%dx%d
\n
"
,
wfx
.
nSamplesPerSec
,
wfx
.
wBitsPerSample
,
wfx
.
nChannels
);
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
!=
NULL
,
"IDirectSound_CreateSoundBuffer() "
...
...
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