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
b7f6c1e1
Commit
b7f6c1e1
authored
Apr 20, 2009
by
Jesse Allen
Committed by
Alexandre Julliard
Apr 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Allow a special cbSize case in CreateSoundBuffer.
parent
410c00fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
dsound.c
dlls/dsound/dsound.c
+5
-1
dsound8.c
dlls/dsound/tests/dsound8.c
+34
-0
No files found.
dlls/dsound/dsound.c
View file @
b7f6c1e1
...
...
@@ -1586,13 +1586,17 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
}
if
(
pwfxe
->
Format
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
/* check if cbSize is at least 22 bytes */
if
(
pwfxe
->
Format
.
cbSize
<
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)))
{
WARN
(
"Too small a cbSize %u
\n
"
,
pwfxe
->
Format
.
cbSize
);
return
DSERR_INVALIDPARAM
;
}
if
(
pwfxe
->
Format
.
cbSize
>
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)))
/* cbSize should be 22 bytes, with one possible exception */
if
(
pwfxe
->
Format
.
cbSize
>
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
))
&&
!
(
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)
&&
pwfxe
->
Format
.
cbSize
==
sizeof
(
WAVEFORMATEXTENSIBLE
)))
{
WARN
(
"Too big a cbSize %u
\n
"
,
pwfxe
->
Format
.
cbSize
);
return
DSERR_CONTROLUNAVAIL
;
...
...
dlls/dsound/tests/dsound8.c
View file @
b7f6c1e1
...
...
@@ -780,8 +780,42 @@ static HRESULT test_secondary8(LPGUID lpGuid)
IDirectSoundBuffer_Release
(
secondary
);
secondary
=
NULL
;
}
wfxe
.
Format
.
cbSize
=
sizeof
(
wfxe
);
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
((
rc
==
DSERR_CONTROLUNAVAIL
||
rc
==
DSERR_INVALIDCALL
)
&&
!
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %08x %p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
{
IDirectSoundBuffer_Release
(
secondary
);
secondary
=
NULL
;
}
wfxe
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_PCM
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DS_OK
&&
secondary
,
"IDirectSound_CreateSoundBuffer() returned: %08x %p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
{
IDirectSoundBuffer_Release
(
secondary
);
secondary
=
NULL
;
}
wfxe
.
Format
.
cbSize
=
sizeof
(
wfxe
)
+
1
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(((
rc
==
DSERR_CONTROLUNAVAIL
||
DSERR_INVALIDCALL
/* 2003 */
)
&&
!
secondary
)
||
rc
==
DS_OK
/* driver dependent? */
,
"IDirectSound_CreateSoundBuffer() returned: %08x %p
\n
"
,
rc
,
secondary
);
if
(
secondary
)
{
IDirectSoundBuffer_Release
(
secondary
);
secondary
=
NULL
;
}
wfxe
.
Format
.
cbSize
=
sizeof
(
wfxe
)
-
sizeof
(
wfx
);
++
wfxe
.
Samples
.
wValidBitsPerSample
;
rc
=
IDirectSound_CreateSoundBuffer
(
dso
,
&
bufdesc
,
&
secondary
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
&&
!
secondary
,
...
...
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