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
850b294e
Commit
850b294e
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 DirectSoundCapture for internal use.
parent
ac3cd73c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
capture.c
dlls/dsound/capture.c
+17
-10
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
No files found.
dlls/dsound/capture.c
View file @
850b294e
...
...
@@ -997,9 +997,10 @@ static HRESULT DirectSoundCaptureDevice_Initialize(
*/
typedef
struct
IDirectSoundCaptureImpl
{
IUnknown
IUnknown_i
face
;
/* Separate refcount */
IUnknown
IUnknown_i
nner
;
IDirectSoundCapture
IDirectSoundCapture_iface
;
LONG
ref
,
refdsc
,
numIfaces
;
IUnknown
*
outer_unk
;
/* internal */
DirectSoundCaptureDevice
*
device
;
BOOL
has_dsc8
;
}
IDirectSoundCaptureImpl
;
...
...
@@ -1017,7 +1018,7 @@ static void capture_destroy(IDirectSoundCaptureImpl *This)
*/
static
inline
IDirectSoundCaptureImpl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectSoundCaptureImpl
,
IUnknown_i
face
);
return
CONTAINING_RECORD
(
iface
,
IDirectSoundCaptureImpl
,
IUnknown_i
nner
);
}
static
HRESULT
WINAPI
IUnknownImpl_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -1033,7 +1034,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_IDirectSoundCapture
))
*
ppv
=
&
This
->
IDirectSoundCapture_iface
;
else
{
...
...
@@ -1089,7 +1090,7 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_QueryInterface(IDirectSoundCapture
{
IDirectSoundCaptureImpl
*
This
=
impl_from_IDirectSoundCapture
(
iface
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
return
IUnknown_QueryInterface
(
&
This
->
IUnknown_iface
,
riid
,
ppv
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
IDirectSoundCaptureImpl_AddRef
(
IDirectSoundCapture
*
iface
)
...
...
@@ -1219,7 +1220,7 @@ static const IDirectSoundCaptureVtbl dscvt =
IDirectSoundCaptureImpl_Initialize
};
static
HRESULT
IDirectSoundCaptureImpl_Create
(
REFIID
riid
,
void
**
ppv
,
BOOL
has_dsc8
)
HRESULT
IDirectSoundCaptureImpl_Create
(
IUnknown
*
outer_unk
,
REFIID
riid
,
void
**
ppv
,
BOOL
has_dsc8
)
{
IDirectSoundCaptureImpl
*
obj
;
HRESULT
hr
;
...
...
@@ -1235,7 +1236,7 @@ static HRESULT IDirectSoundCaptureImpl_Create(REFIID riid, void **ppv, BOOL has_
setup_dsound_options
();
obj
->
IUnknown_i
face
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IUnknown_i
nner
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IDirectSoundCapture_iface
.
lpVtbl
=
&
dscvt
;
obj
->
ref
=
1
;
obj
->
refdsc
=
0
;
...
...
@@ -1243,20 +1244,26 @@ static HRESULT IDirectSoundCaptureImpl_Create(REFIID riid, void **ppv, BOOL has_
obj
->
device
=
NULL
;
obj
->
has_dsc8
=
has_dsc8
;
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_CaptureCreate
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundCaptureImpl_Create
(
riid
,
ppv
,
FALSE
);
return
IDirectSoundCaptureImpl_Create
(
NULL
,
riid
,
ppv
,
FALSE
);
}
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundCaptureImpl_Create
(
riid
,
ppv
,
TRUE
);
return
IDirectSoundCaptureImpl_Create
(
NULL
,
riid
,
ppv
,
TRUE
);
}
/***************************************************************************
...
...
dlls/dsound/dsound_private.h
View file @
850b294e
...
...
@@ -301,6 +301,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN;
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
IDirectSoundCaptureImpl_Create
(
IUnknown
*
outer_unk
,
REFIID
riid
,
void
**
ppv
,
BOOL
has_dsc8
)
DECLSPEC_HIDDEN
;
#define STATE_STOPPED 0
#define STATE_STARTING 1
...
...
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