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
693c9916
Commit
693c9916
authored
Feb 21, 2010
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Pass a property bag to IBaseFilter in IMMDevice::Activate.
parent
55b48ff6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
devenum.c
dlls/mmdevapi/devenum.c
+79
-0
No files found.
dlls/mmdevapi/devenum.c
View file @
693c9916
...
...
@@ -94,6 +94,12 @@ typedef struct MMDevColImpl
DWORD
state
;
}
MMDevColImpl
;
typedef
struct
IPropertyBagImpl
{
const
IPropertyBagVtbl
*
lpVtbl
;
GUID
devguid
;
}
IPropertyBagImpl
;
static
const
IPropertyBagVtbl
PB_Vtbl
;
static
HRESULT
MMDevPropStore_Create
(
MMDevice
*
This
,
DWORD
access
,
IPropertyStore
**
ppv
);
/* Creates or updates the state of a device
...
...
@@ -275,6 +281,26 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
hr
=
CoCreateInstance
(
&
CLSID_DSoundRender
,
NULL
,
clsctx
,
riid
,
ppv
);
else
ERR
(
"Not supported for recording?
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
IPersistPropertyBag
*
ppb
;
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
*
ppv
,
&
IID_IPersistPropertyBag
,
(
void
*
)
&
ppb
);
if
(
SUCCEEDED
(
hr
))
{
/* ::Load cannot assume the interface stays alive after the function returns,
* so just create the interface on the stack, saves a lot of complicated code */
IPropertyBagImpl
bag
=
{
&
PB_Vtbl
,
This
->
devguid
};
hr
=
IPersistPropertyBag_Load
(
ppb
,
(
IPropertyBag
*
)
&
bag
,
NULL
);
IPersistPropertyBag_Release
(
ppb
);
if
(
FAILED
(
hr
))
IBaseFilter_Release
((
IBaseFilter
*
)
*
ppv
);
}
else
{
FIXME
(
"Wine doesn't support IPersistPropertyBag on DSoundRender yet, ignoring..
\n
"
);
hr
=
S_OK
;
}
}
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDeviceTopology
))
{
...
...
@@ -1035,3 +1061,56 @@ static const IPropertyStoreVtbl MMDevPropVtbl =
MMDevPropStore_SetValue
,
MMDevPropStore_Commit
};
/* Property bag for IBaseFilter activation */
static
HRESULT
WINAPI
PB_QueryInterface
(
IPropertyBag
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ERR
(
"Should not be called
\n
"
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
PB_AddRef
(
IPropertyBag
*
iface
)
{
ERR
(
"Should not be called
\n
"
);
return
2
;
}
static
ULONG
WINAPI
PB_Release
(
IPropertyBag
*
iface
)
{
ERR
(
"Should not be called
\n
"
);
return
1
;
}
static
HRESULT
WINAPI
PB_Read
(
IPropertyBag
*
iface
,
LPCOLESTR
name
,
VARIANT
*
var
,
IErrorLog
*
log
)
{
static
const
WCHAR
dsguid
[]
=
{
'D'
,
'S'
,
'G'
,
'u'
,
'i'
,
'd'
,
0
};
IPropertyBagImpl
*
This
=
(
IPropertyBagImpl
*
)
iface
;
TRACE
(
"Trying to read %s, type %u
\n
"
,
debugstr_w
(
name
),
var
->
n1
.
n2
.
vt
);
if
(
!
lstrcmpW
(
name
,
dsguid
))
{
WCHAR
guidstr
[
39
];
StringFromGUID2
(
&
This
->
devguid
,
guidstr
,
sizeof
(
guidstr
)
/
sizeof
(
*
guidstr
));
var
->
n1
.
n2
.
vt
=
VT_BSTR
;
var
->
n1
.
n2
.
n3
.
bstrVal
=
SysAllocString
(
guidstr
);
return
S_OK
;
}
ERR
(
"Unknown property '%s' queried
\n
"
,
debugstr_w
(
name
));
return
E_FAIL
;
}
static
HRESULT
WINAPI
PB_Write
(
IPropertyBag
*
iface
,
LPCOLESTR
name
,
VARIANT
*
var
)
{
ERR
(
"Should not be called
\n
"
);
return
E_FAIL
;
}
static
const
IPropertyBagVtbl
PB_Vtbl
=
{
PB_QueryInterface
,
PB_AddRef
,
PB_Release
,
PB_Read
,
PB_Write
};
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