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
604172dd
Commit
604172dd
authored
May 10, 2013
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Set FriendlyName and wave*ID for devices.
parent
71723ad0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
9 deletions
+46
-9
createdevenum.c
dlls/devenum/createdevenum.c
+45
-9
mediacatenum.c
dlls/devenum/mediacatenum.c
+1
-0
No files found.
dlls/devenum/createdevenum.c
View file @
604172dd
...
...
@@ -52,6 +52,9 @@ static const WCHAR wszAllowedZero[] = {'A','l','l','o','w','e','d','Z','e','r','
static
const
WCHAR
wszDirection
[]
=
{
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
wszIsRendered
[]
=
{
'I'
,
's'
,
'R'
,
'e'
,
'n'
,
'd'
,
'e'
,
'r'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
wszTypes
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
's'
,
0
};
static
const
WCHAR
wszFriendlyName
[]
=
{
'F'
,
'r'
,
'i'
,
'e'
,
'n'
,
'd'
,
'l'
,
'y'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
wszWaveInID
[]
=
{
'W'
,
'a'
,
'v'
,
'e'
,
'I'
,
'n'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
wszWaveOutID
[]
=
{
'W'
,
'a'
,
'v'
,
'e'
,
'O'
,
'u'
,
't'
,
'I'
,
'D'
,
0
};
static
ULONG
WINAPI
DEVENUM_ICreateDevEnum_AddRef
(
ICreateDevEnum
*
iface
);
static
HRESULT
DEVENUM_CreateSpecialCategories
(
void
);
...
...
@@ -629,6 +632,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
WAVEINCAPSW
wicaps
;
MIDIOUTCAPSW
mocaps
;
REGPINTYPES
*
pTypes
;
IPropertyBag
*
pPropBag
=
NULL
;
numDevs
=
waveOutGetNumDevs
();
...
...
@@ -666,10 +670,24 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
wocaps
.
szPname
,
&
rf2
);
/* FIXME: do additional stuff with IMoniker here, depending on what RegisterFilter does */
if
(
pMoniker
)
{
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_UNION
(
&
var
,
ulVal
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveOutID
,
&
var
);
else
pPropBag
=
NULL
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_UNION
(
&
var
,
bstrVal
)
=
wocaps
.
szPname
;
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
if
(
pPropBag
)
IPropertyBag_Release
(
pPropBag
);
IMoniker_Release
(
pMoniker
);
pMoniker
=
NULL
;
}
...
...
@@ -725,7 +743,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
rfp2
.
lpMediaType
=
pTypes
;
res
=
IFilterMapper2_RegisterFilter
(
pMapper
,
res
=
IFilterMapper2_RegisterFilter
(
pMapper
,
&
CLSID_AudioRecord
,
wicaps
.
szPname
,
&
pMoniker
,
...
...
@@ -733,10 +751,27 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
wicaps
.
szPname
,
&
rf2
);
/* FIXME: do additional stuff with IMoniker here, depending on what RegisterFilter does */
if
(
pMoniker
)
IMoniker_Release
(
pMoniker
);
if
(
pMoniker
)
{
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_UNION
(
&
var
,
ulVal
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveInID
,
&
var
);
else
pPropBag
=
NULL
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_UNION
(
&
var
,
bstrVal
)
=
wicaps
.
szPname
;
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
if
(
pPropBag
)
IPropertyBag_Release
(
pPropBag
);
IMoniker_Release
(
pMoniker
);
}
CoTaskMemFree
(
pTypes
);
}
...
...
@@ -803,7 +838,6 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
szDeviceVersion
,
sizeof
(
szDeviceVersion
)
/
sizeof
(
WCHAR
)))
{
IMoniker
*
pMoniker
=
NULL
;
IPropertyBag
*
pPropBag
=
NULL
;
WCHAR
dprintf
[]
=
{
'v'
,
'i'
,
'd'
,
'e'
,
'o'
,
'%'
,
'd'
,
0
};
snprintfW
(
szDevicePath
,
sizeof
(
szDevicePath
)
/
sizeof
(
WCHAR
),
dprintf
,
i
);
/* The above code prevents 1 device with a different ID overwriting another */
...
...
@@ -834,8 +868,10 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
V_VT
(
&
var
)
=
VT_I4
;
V_UNION
(
&
var
,
ulVal
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszVfwIndex
,
&
var
);
if
(
SUCCEEDED
(
res
))
{
res
=
IPropertyBag_Write
(
pPropBag
,
wszVfwIndex
,
&
var
);
IPropertyBag_Release
(
pPropBag
);
}
IMoniker_Release
(
pMoniker
);
}
...
...
dlls/devenum/mediacatenum.c
View file @
604172dd
...
...
@@ -232,6 +232,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
switch
(
V_VT
(
pVar
))
{
case
VT_BSTR
:
case
VT_LPWSTR
:
TRACE
(
"writing %s
\n
"
,
debugstr_w
(
V_UNION
(
pVar
,
bstrVal
)));
lpData
=
V_UNION
(
pVar
,
bstrVal
);
dwType
=
REG_SZ
;
...
...
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