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
4d2d6666
Commit
4d2d6666
authored
Dec 09, 2023
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Use switch statements for moniker type handling.
Fixes -Wsometimes-uninitialized clang warnings by using DEFAULT_UNREACHABLE.
parent
68f8b53d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
mediacatenum.c
dlls/devenum/mediacatenum.c
+21
-14
No files found.
dlls/devenum/mediacatenum.c
View file @
4d2d6666
...
...
@@ -124,8 +124,9 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface,
if
(
!
name
||
!
var
)
return
E_POINTER
;
if
(
moniker
->
type
==
DEVICE_DMO
)
switch
(
moniker
->
type
)
{
case
DEVICE_DMO
:
if
(
!
wcscmp
(
name
,
L"FriendlyName"
))
{
if
(
SUCCEEDED
(
hr
=
DMOGetName
(
&
moniker
->
clsid
,
dmo_name
)))
...
...
@@ -135,7 +136,7 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface,
}
return
hr
;
}
else
if
(
!
wcscmp
(
name
,
L"FilterData"
))
if
(
!
wcscmp
(
name
,
L"FilterData"
))
{
DMO_PARTIAL_MEDIATYPE
*
types
=
NULL
,
*
new_array
;
ULONG
count
=
1
,
input_count
,
output_count
,
i
;
...
...
@@ -196,10 +197,8 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface,
return
hr
;
}
return
HRESULT_FROM_WIN32
(
ERROR_NOT_FOUND
);
}
if
(
moniker
->
type
==
DEVICE_FILTER
)
{
case
DEVICE_FILTER
:
wcscpy
(
path
,
L"CLSID
\\
"
);
if
(
moniker
->
has_class
)
{
...
...
@@ -208,15 +207,19 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface,
}
if
((
ret
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
path
,
0
,
0
,
&
parent
)))
return
HRESULT_FROM_WIN32
(
ret
);
}
else
if
(
moniker
->
type
==
DEVICE_CODEC
)
{
break
;
case
DEVICE_CODEC
:
wcscpy
(
path
,
L"Software
\\
Microsoft
\\
ActiveMovie
\\
devenum
\\
"
);
if
(
moniker
->
has_class
)
StringFromGUID2
(
&
moniker
->
class
,
path
+
wcslen
(
path
),
CHARS_IN_GUID
);
if
((
ret
=
RegOpenKeyExW
(
HKEY_CURRENT_USER
,
path
,
0
,
0
,
&
parent
)))
return
HRESULT_FROM_WIN32
(
ret
);
break
;
DEFAULT_UNREACHABLE
;
}
ret
=
RegOpenKeyExW
(
parent
,
moniker
->
name
,
0
,
KEY_READ
,
&
key
);
RegCloseKey
(
parent
);
if
(
ret
)
...
...
@@ -302,11 +305,12 @@ static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *name,
TRACE
(
"moniker %p, name %s, var %s.
\n
"
,
moniker
,
debugstr_w
(
name
),
debugstr_variant
(
var
));
if
(
moniker
->
type
==
DEVICE_DMO
)
switch
(
moniker
->
type
)
{
case
DEVICE_DMO
:
return
E_ACCESSDENIED
;
if
(
moniker
->
type
==
DEVICE_FILTER
)
{
case
DEVICE_FILTER
:
wcscpy
(
path
,
L"CLSID
\\
"
);
if
(
moniker
->
has_class
)
{
...
...
@@ -315,14 +319,17 @@ static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *name,
}
if
((
ret
=
RegCreateKeyExW
(
HKEY_CLASSES_ROOT
,
path
,
0
,
NULL
,
0
,
0
,
NULL
,
&
parent
,
NULL
)))
return
HRESULT_FROM_WIN32
(
ret
);
}
else
if
(
moniker
->
type
==
DEVICE_CODEC
)
{
break
;
case
DEVICE_CODEC
:
wcscpy
(
path
,
L"Software
\\
Microsoft
\\
ActiveMovie
\\
devenum
\\
"
);
if
(
moniker
->
has_class
)
StringFromGUID2
(
&
moniker
->
class
,
path
+
wcslen
(
path
),
CHARS_IN_GUID
);
if
((
ret
=
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
path
,
0
,
NULL
,
0
,
0
,
NULL
,
&
parent
,
NULL
)))
return
HRESULT_FROM_WIN32
(
ret
);
break
;
DEFAULT_UNREACHABLE
;
}
ret
=
RegCreateKeyExW
(
parent
,
moniker
->
name
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
RegCloseKey
(
parent
);
...
...
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