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
8d48b745
Commit
8d48b745
authored
Jul 29, 2010
by
Octavian Voicu
Committed by
Alexandre Julliard
Jul 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi/tests: Prevent crash when GetMixFormat fails.
parent
bb201bb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
36 deletions
+38
-36
capture.c
dlls/mmdevapi/tests/capture.c
+19
-18
render.c
dlls/mmdevapi/tests/render.c
+19
-18
No files found.
dlls/mmdevapi/tests/capture.c
View file @
8d48b745
...
...
@@ -193,26 +193,27 @@ static void test_audioclient(IAudioClient *ac)
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
pwfx
);
ok
(
hr
==
S_OK
,
"Valid GetMixFormat returns %08x
\n
"
,
hr
);
trace
(
"Tag: %04x
\n
"
,
pwfx
->
wFormatTag
);
trace
(
"bits: %u
\n
"
,
pwfx
->
wBitsPerSample
);
trace
(
"chan: %u
\n
"
,
pwfx
->
nChannels
);
trace
(
"rate: %u
\n
"
,
pwfx
->
nSamplesPerSec
);
trace
(
"align: %u
\n
"
,
pwfx
->
nBlockAlign
);
trace
(
"extra: %u
\n
"
,
pwfx
->
cbSize
);
ok
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
,
"wFormatTag is %x
\n
"
,
pwfx
->
wFormatTag
);
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
WAVEFORMATEXTENSIBLE
*
pwfxe
=
(
void
*
)
pwfx
;
trace
(
"Res: %u
\n
"
,
pwfxe
->
Samples
.
wReserved
);
trace
(
"Mask: %x
\n
"
,
pwfxe
->
dwChannelMask
);
trace
(
"Alg: %s
\n
"
,
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)
?
"PCM"
:
(
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
)
?
"FLOAT"
:
"Other"
));
}
if
(
hr
==
S_OK
)
{
trace
(
"pwfx: %p
\n
"
,
pwfx
);
trace
(
"Tag: %04x
\n
"
,
pwfx
->
wFormatTag
);
trace
(
"bits: %u
\n
"
,
pwfx
->
wBitsPerSample
);
trace
(
"chan: %u
\n
"
,
pwfx
->
nChannels
);
trace
(
"rate: %u
\n
"
,
pwfx
->
nSamplesPerSec
);
trace
(
"align: %u
\n
"
,
pwfx
->
nBlockAlign
);
trace
(
"extra: %u
\n
"
,
pwfx
->
cbSize
);
ok
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
,
"wFormatTag is %x
\n
"
,
pwfx
->
wFormatTag
);
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
WAVEFORMATEXTENSIBLE
*
pwfxe
=
(
void
*
)
pwfx
;
trace
(
"Res: %u
\n
"
,
pwfxe
->
Samples
.
wReserved
);
trace
(
"Mask: %x
\n
"
,
pwfxe
->
dwChannelMask
);
trace
(
"Alg: %s
\n
"
,
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)
?
"PCM"
:
(
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
)
?
"FLOAT"
:
"Other"
));
}
hr
=
IAudioClient_IsFormatSupported
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
pwfx
,
&
pwfx2
);
ok
(
hr
==
S_OK
,
"Valid IsFormatSupported(Shared) call returns %08x
\n
"
,
hr
);
ok
(
pwfx2
==
NULL
,
"pwfx2 is non-null
\n
"
);
...
...
dlls/mmdevapi/tests/render.c
View file @
8d48b745
...
...
@@ -126,26 +126,27 @@ static void test_audioclient(IAudioClient *ac)
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
pwfx
);
ok
(
hr
==
S_OK
,
"Valid GetMixFormat returns %08x
\n
"
,
hr
);
trace
(
"Tag: %04x
\n
"
,
pwfx
->
wFormatTag
);
trace
(
"bits: %u
\n
"
,
pwfx
->
wBitsPerSample
);
trace
(
"chan: %u
\n
"
,
pwfx
->
nChannels
);
trace
(
"rate: %u
\n
"
,
pwfx
->
nSamplesPerSec
);
trace
(
"align: %u
\n
"
,
pwfx
->
nBlockAlign
);
trace
(
"extra: %u
\n
"
,
pwfx
->
cbSize
);
ok
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
,
"wFormatTag is %x
\n
"
,
pwfx
->
wFormatTag
);
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
WAVEFORMATEXTENSIBLE
*
pwfxe
=
(
void
*
)
pwfx
;
trace
(
"Res: %u
\n
"
,
pwfxe
->
Samples
.
wReserved
);
trace
(
"Mask: %x
\n
"
,
pwfxe
->
dwChannelMask
);
trace
(
"Alg: %s
\n
"
,
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)
?
"PCM"
:
(
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
)
?
"FLOAT"
:
"Other"
));
}
if
(
hr
==
S_OK
)
{
trace
(
"pwfx: %p
\n
"
,
pwfx
);
trace
(
"Tag: %04x
\n
"
,
pwfx
->
wFormatTag
);
trace
(
"bits: %u
\n
"
,
pwfx
->
wBitsPerSample
);
trace
(
"chan: %u
\n
"
,
pwfx
->
nChannels
);
trace
(
"rate: %u
\n
"
,
pwfx
->
nSamplesPerSec
);
trace
(
"align: %u
\n
"
,
pwfx
->
nBlockAlign
);
trace
(
"extra: %u
\n
"
,
pwfx
->
cbSize
);
ok
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
,
"wFormatTag is %x
\n
"
,
pwfx
->
wFormatTag
);
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
WAVEFORMATEXTENSIBLE
*
pwfxe
=
(
void
*
)
pwfx
;
trace
(
"Res: %u
\n
"
,
pwfxe
->
Samples
.
wReserved
);
trace
(
"Mask: %x
\n
"
,
pwfxe
->
dwChannelMask
);
trace
(
"Alg: %s
\n
"
,
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)
?
"PCM"
:
(
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
)
?
"FLOAT"
:
"Other"
));
}
hr
=
IAudioClient_IsFormatSupported
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
pwfx
,
&
pwfx2
);
ok
(
hr
==
S_OK
,
"Valid IsFormatSupported(Shared) call returns %08x
\n
"
,
hr
);
ok
(
pwfx2
==
NULL
,
"pwfx2 is non-null
\n
"
);
...
...
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