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
de70686f
Commit
de70686f
authored
Jun 29, 2008
by
Alexander Dorofeyev
Committed by
Alexandre Julliard
Jul 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Move locating category key to function, use it ParseDisplayName.
parent
cd5fa7de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
34 deletions
+47
-34
createdevenum.c
dlls/devenum/createdevenum.c
+34
-24
devenum_private.h
dlls/devenum/devenum_private.h
+5
-0
parsedisplayname.c
dlls/devenum/parsedisplayname.c
+8
-10
No files found.
dlls/devenum/createdevenum.c
View file @
de70686f
...
...
@@ -96,6 +96,35 @@ static ULONG WINAPI DEVENUM_ICreateDevEnum_Release(ICreateDevEnum * iface)
return
1
;
/* non-heap based object */
}
HRESULT
DEVENUM_GetCategoryKey
(
REFCLSID
clsidDeviceClass
,
HKEY
*
pBaseKey
,
WCHAR
*
wszRegKeyName
,
UINT
maxLen
)
{
if
(
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_AudioRendererCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_AudioInputDeviceCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_VideoInputDeviceCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_MidiRendererCategory
))
{
*
pBaseKey
=
HKEY_CURRENT_USER
;
strcpyW
(
wszRegKeyName
,
wszActiveMovieKey
);
if
(
!
StringFromGUID2
(
clsidDeviceClass
,
wszRegKeyName
+
strlenW
(
wszRegKeyName
),
maxLen
-
strlenW
(
wszRegKeyName
)))
return
E_OUTOFMEMORY
;
}
else
{
*
pBaseKey
=
HKEY_CLASSES_ROOT
;
strcpyW
(
wszRegKeyName
,
clsid_keyname
);
strcatW
(
wszRegKeyName
,
wszRegSeparator
);
if
(
!
StringFromGUID2
(
clsidDeviceClass
,
wszRegKeyName
+
CLSID_STR_LEN
,
maxLen
-
CLSID_STR_LEN
))
return
E_OUTOFMEMORY
;
strcatW
(
wszRegKeyName
,
wszRegSeparator
);
strcatW
(
wszRegKeyName
,
wszInstanceKeyName
);
}
return
S_OK
;
}
/**********************************************************************
* DEVENUM_ICreateDevEnum_CreateClassEnumerator
*/
...
...
@@ -108,6 +137,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
WCHAR
wszRegKey
[
MAX_PATH
];
HKEY
hkey
;
HKEY
hbasekey
;
HRESULT
hr
;
CreateDevEnumImpl
*
This
=
(
CreateDevEnumImpl
*
)
iface
;
TRACE
(
"(%p)->(%s, %p, %x)
\n\t
DeviceClass:
\t
%s
\n
"
,
This
,
debugstr_guid
(
clsidDeviceClass
),
ppEnumMoniker
,
dwFlags
,
debugstr_guid
(
clsidDeviceClass
));
...
...
@@ -117,29 +147,9 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
*
ppEnumMoniker
=
NULL
;
if
(
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_AudioRendererCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_AudioInputDeviceCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_VideoInputDeviceCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_MidiRendererCategory
))
{
hbasekey
=
HKEY_CURRENT_USER
;
strcpyW
(
wszRegKey
,
wszActiveMovieKey
);
if
(
!
StringFromGUID2
(
clsidDeviceClass
,
wszRegKey
+
strlenW
(
wszRegKey
),
MAX_PATH
-
strlenW
(
wszRegKey
)))
return
E_OUTOFMEMORY
;
}
else
{
hbasekey
=
HKEY_CLASSES_ROOT
;
strcpyW
(
wszRegKey
,
clsid_keyname
);
strcatW
(
wszRegKey
,
wszRegSeparator
);
if
(
!
StringFromGUID2
(
clsidDeviceClass
,
wszRegKey
+
CLSID_STR_LEN
,
MAX_PATH
-
CLSID_STR_LEN
))
return
E_OUTOFMEMORY
;
strcatW
(
wszRegKey
,
wszRegSeparator
);
strcatW
(
wszRegKey
,
wszInstanceKeyName
);
}
hr
=
DEVENUM_GetCategoryKey
(
clsidDeviceClass
,
&
hbasekey
,
wszRegKey
,
MAX_PATH
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
RegOpenKeyW
(
hbasekey
,
wszRegKey
,
&
hkey
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -148,7 +158,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_VideoInputDeviceCategory
)
||
IsEqualGUID
(
clsidDeviceClass
,
&
CLSID_MidiRendererCategory
))
{
HRESULT
hr
=
DEVENUM_CreateSpecialCategories
();
hr
=
DEVENUM_CreateSpecialCategories
();
if
(
FAILED
(
hr
))
return
hr
;
if
(
RegOpenKeyW
(
hbasekey
,
wszRegKey
,
&
hkey
)
!=
ERROR_SUCCESS
)
...
...
dlls/devenum/devenum_private.h
View file @
de70686f
...
...
@@ -93,6 +93,11 @@ extern CreateDevEnumImpl DEVENUM_CreateDevEnum;
extern
ParseDisplayNameImpl
DEVENUM_ParseDisplayName
;
/**********************************************************************
* Private helper function to get AM filter category key location
*/
HRESULT
DEVENUM_GetCategoryKey
(
REFCLSID
clsidDeviceClass
,
HKEY
*
pBaseKey
,
WCHAR
*
wszRegKeyName
,
UINT
maxLen
);
/**********************************************************************
* Global string constant declarations
*/
extern
const
WCHAR
clsid_keyname
[
6
];
...
...
dlls/devenum/parsedisplayname.c
View file @
de70686f
...
...
@@ -90,11 +90,13 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
{
LPOLESTR
pszBetween
=
NULL
;
LPOLESTR
pszClass
=
NULL
;
IEnumMoniker
*
pEm
=
NULL
;
MediaCatMoniker
*
pMoniker
=
NULL
;
CLSID
clsidDevice
;
HRESULT
res
=
S_OK
;
WCHAR
wszRegKeyName
[
MAX_PATH
];
HKEY
hbasekey
;
int
classlen
;
static
const
WCHAR
wszRegSeparator
[]
=
{
'\\'
,
0
};
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
pbc
,
debugstr_w
(
pszDisplayName
),
pchEaten
,
ppmkOut
);
...
...
@@ -122,9 +124,7 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
if
(
SUCCEEDED
(
res
))
{
res
=
DEVENUM_ICreateDevEnum_CreateClassEnumerator
((
ICreateDevEnum
*
)(
char
*
)
&
DEVENUM_CreateDevEnum
,
&
clsidDevice
,
&
pEm
,
0
);
if
(
res
==
S_FALSE
)
/* S_FALSE means no category */
res
=
MK_E_NOOBJECT
;
res
=
DEVENUM_GetCategoryKey
(
&
clsidDevice
,
&
hbasekey
,
wszRegKeyName
,
MAX_PATH
);
}
if
(
SUCCEEDED
(
res
))
...
...
@@ -132,9 +132,10 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
pMoniker
=
DEVENUM_IMediaCatMoniker_Construct
();
if
(
pMoniker
)
{
if
(
RegCreateKeyW
(((
EnumMonikerImpl
*
)
pEm
)
->
hkey
,
pszBetween
,
&
pMoniker
->
hkey
)
==
ERROR_SUCCESS
)
strcatW
(
wszRegKeyName
,
wszRegSeparator
);
strcatW
(
wszRegKeyName
,
pszBetween
);
if
(
RegCreateKeyW
(
hbasekey
,
wszRegKeyName
,
&
pMoniker
->
hkey
)
==
ERROR_SUCCESS
)
*
ppmkOut
=
(
LPMONIKER
)
pMoniker
;
else
{
...
...
@@ -144,9 +145,6 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
}
}
if
(
pEm
)
IEnumMoniker_Release
(
pEm
);
CoTaskMemFree
(
pszClass
);
TRACE
(
"-- returning: %x
\n
"
,
res
);
...
...
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