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
9cb53818
Commit
9cb53818
authored
Aug 16, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Add COM aggregation to DirectSound for internal use.
parent
bd4c6739
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
dsound.c
dlls/dsound/dsound.c
+17
-10
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
No files found.
dlls/dsound/dsound.c
View file @
9cb53818
...
...
@@ -42,8 +42,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
typedef
struct
IDirectSoundImpl
{
IUnknown
IUnknown_i
face
;
/* Separate refcount, not for COM aggregation */
IUnknown
IUnknown_i
nner
;
IDirectSound8
IDirectSound8_iface
;
IUnknown
*
outer_unk
;
/* internal */
LONG
ref
,
refds
,
numIfaces
;
DirectSoundDevice
*
device
;
BOOL
has_ds8
;
...
...
@@ -129,7 +130,7 @@ static void directsound_destroy(IDirectSoundImpl *This)
*/
static
inline
IDirectSoundImpl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectSoundImpl
,
IUnknown_i
face
);
return
CONTAINING_RECORD
(
iface
,
IDirectSoundImpl
,
IUnknown_i
nner
);
}
static
HRESULT
WINAPI
IUnknownImpl_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -145,7 +146,7 @@ static HRESULT WINAPI IUnknownImpl_QueryInterface(IUnknown *iface, REFIID riid,
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppv
=
&
This
->
IUnknown_i
face
;
*
ppv
=
&
This
->
IUnknown_i
nner
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectSound
)
||
(
IsEqualIID
(
riid
,
&
IID_IDirectSound8
)
&&
This
->
has_ds8
))
*
ppv
=
&
This
->
IDirectSound8_iface
;
...
...
@@ -204,7 +205,7 @@ static HRESULT WINAPI IDirectSound8Impl_QueryInterface(IDirectSound8 *iface, REF
{
IDirectSoundImpl
*
This
=
impl_from_IDirectSound8
(
iface
);
TRACE
(
"(%p,%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
IUnknown_QueryInterface
(
&
This
->
IUnknown_iface
,
riid
,
ppv
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
IDirectSound8Impl_AddRef
(
IDirectSound8
*
iface
)
...
...
@@ -317,7 +318,7 @@ static const IDirectSound8Vtbl ds8_vtbl =
IDirectSound8Impl_VerifyCertification
};
static
HRESULT
IDirectSoundImpl_Create
(
REFIID
riid
,
void
**
ppv
,
BOOL
has_ds8
)
HRESULT
IDirectSoundImpl_Create
(
IUnknown
*
outer_unk
,
REFIID
riid
,
void
**
ppv
,
BOOL
has_ds8
)
{
IDirectSoundImpl
*
obj
;
HRESULT
hr
;
...
...
@@ -333,7 +334,7 @@ static HRESULT IDirectSoundImpl_Create(REFIID riid, void **ppv, BOOL has_ds8)
setup_dsound_options
();
obj
->
IUnknown_i
face
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IUnknown_i
nner
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IDirectSound8_iface
.
lpVtbl
=
&
ds8_vtbl
;
obj
->
ref
=
1
;
obj
->
refds
=
0
;
...
...
@@ -341,20 +342,26 @@ static HRESULT IDirectSoundImpl_Create(REFIID riid, void **ppv, BOOL has_ds8)
obj
->
device
=
NULL
;
obj
->
has_ds8
=
has_ds8
;
hr
=
IUnknown_QueryInterface
(
&
obj
->
IUnknown_iface
,
riid
,
ppv
);
IUnknown_Release
(
&
obj
->
IUnknown_iface
);
/* COM aggregation supported only internally */
if
(
outer_unk
)
obj
->
outer_unk
=
outer_unk
;
else
obj
->
outer_unk
=
&
obj
->
IUnknown_inner
;
hr
=
IUnknown_QueryInterface
(
&
obj
->
IUnknown_inner
,
riid
,
ppv
);
IUnknown_Release
(
&
obj
->
IUnknown_inner
);
return
hr
;
}
HRESULT
DSOUND_Create
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundImpl_Create
(
riid
,
ppv
,
FALSE
);
return
IDirectSoundImpl_Create
(
NULL
,
riid
,
ppv
,
FALSE
);
}
HRESULT
DSOUND_Create8
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundImpl_Create
(
riid
,
ppv
,
TRUE
);
return
IDirectSoundImpl_Create
(
NULL
,
riid
,
ppv
,
TRUE
);
}
/*******************************************************************************
...
...
dlls/dsound/dsound_private.h
View file @
9cb53818
...
...
@@ -263,6 +263,7 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks) DEC
HRESULT
DSOUND_Create
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_Create8
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
IDirectSoundImpl_Create
(
IUnknown
*
outer_unk
,
REFIID
riid
,
void
**
ppv
,
BOOL
has_ds8
)
DECLSPEC_HIDDEN
;
/* primary.c */
...
...
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