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
e5216332
Commit
e5216332
authored
Aug 04, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d8e66774
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
createdevenum.c
dlls/devenum/createdevenum.c
+8
-9
mediacatenum.c
dlls/devenum/mediacatenum.c
+2
-2
No files found.
dlls/devenum/createdevenum.c
View file @
e5216332
...
...
@@ -155,7 +155,7 @@ static void DEVENUM_ReadPinTypes(HKEY hkeyPinKey, REGFILTERPINS2 *rgPin)
{
HKEY
hkeyMajorType
=
NULL
;
WCHAR
wszMajorTypeName
[
64
];
DWORD
cName
=
sizeof
(
wszMajorTypeName
)
/
sizeof
(
WCHAR
);
DWORD
cName
=
ARRAY_SIZE
(
wszMajorTypeName
);
DWORD
dwMinorTypes
,
i1
;
if
(
RegEnumKeyExW
(
hkeyTypes
,
i
,
wszMajorTypeName
,
&
cName
,
NULL
,
NULL
,
NULL
,
NULL
)
!=
ERROR_SUCCESS
)
continue
;
...
...
@@ -175,7 +175,7 @@ static void DEVENUM_ReadPinTypes(HKEY hkeyPinKey, REGFILTERPINS2 *rgPin)
CLSID
*
clsMajorType
=
NULL
,
*
clsMinorType
=
NULL
;
HRESULT
hr
;
cName
=
sizeof
(
wszMinorTypeName
)
/
sizeof
(
WCHAR
);
cName
=
ARRAY_SIZE
(
wszMinorTypeName
);
if
(
RegEnumKeyExW
(
hkeyMajorType
,
i1
,
wszMinorTypeName
,
&
cName
,
NULL
,
NULL
,
NULL
,
NULL
)
!=
ERROR_SUCCESS
)
continue
;
clsMinorType
=
CoTaskMemAlloc
(
sizeof
(
CLSID
));
...
...
@@ -261,7 +261,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
{
HKEY
hkeyPinKey
=
NULL
;
WCHAR
wszPinName
[
MAX_PATH
];
DWORD
cName
=
sizeof
(
wszPinName
)
/
sizeof
(
WCHAR
);
DWORD
cName
=
ARRAY_SIZE
(
wszPinName
);
REGFILTERPINS2
*
rgPin
=
&
rgPins
[
rgf2
->
u
.
s2
.
cPins2
];
DWORD
value
,
size
,
Type
;
LONG
lRet
;
...
...
@@ -408,7 +408,7 @@ static void register_legacy_filters(void)
for
(
i
=
0
;
i
<
dwFilterSubkeys
;
i
++
)
{
WCHAR
wszFilterSubkeyName
[
64
];
DWORD
cName
=
sizeof
(
wszFilterSubkeyName
)
/
sizeof
(
WCHAR
);
DWORD
cName
=
ARRAY_SIZE
(
wszFilterSubkeyName
);
IPropertyBag
*
prop_bag
=
NULL
;
WCHAR
wszRegKey
[
MAX_PATH
];
HKEY
classkey
=
NULL
;
...
...
@@ -944,7 +944,7 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory)
strcpyW
(
wszRegKey
,
wszActiveMovieKey
);
if
(
!
StringFromGUID2
(
clsidCategory
,
wszRegKey
+
strlenW
(
wszRegKey
),
sizeof
(
wszRegKey
)
/
sizeof
(
wszRegKey
[
0
]
)
-
strlenW
(
wszRegKey
)))
if
(
!
StringFromGUID2
(
clsidCategory
,
wszRegKey
+
strlenW
(
wszRegKey
),
ARRAY_SIZE
(
wszRegKey
)
-
strlenW
(
wszRegKey
)))
res
=
E_INVALIDARG
;
if
(
SUCCEEDED
(
res
))
...
...
@@ -1016,13 +1016,12 @@ static HRESULT register_codecs(void)
{
WCHAR
szDeviceName
[
32
],
szDeviceVersion
[
32
],
szDevicePath
[
10
];
if
(
capGetDriverDescriptionW
((
WORD
)
i
,
szDeviceName
,
sizeof
(
szDeviceName
)
/
sizeof
(
WCHAR
),
szDeviceVersion
,
sizeof
(
szDeviceVersion
)
/
sizeof
(
WCHAR
)))
if
(
capGetDriverDescriptionW
(
i
,
szDeviceName
,
ARRAY_SIZE
(
szDeviceName
),
szDeviceVersion
,
ARRAY_SIZE
(
szDeviceVersion
)))
{
IMoniker
*
pMoniker
=
NULL
;
WCHAR
dprintf
[]
=
{
'v'
,
'i'
,
'd'
,
'e'
,
'o'
,
'%'
,
'd'
,
0
};
snprintfW
(
szDevicePath
,
sizeof
(
szDevicePath
)
/
sizeof
(
WCHAR
),
dprintf
,
i
);
snprintfW
(
szDevicePath
,
ARRAY_SIZE
(
szDevicePath
),
dprintf
,
i
);
/* The above code prevents 1 device with a different ID overwriting another */
rfp2
.
nMediaTypes
=
1
;
...
...
dlls/devenum/mediacatenum.c
View file @
e5216332
...
...
@@ -889,7 +889,7 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
StringFromGUID2
(
&
This
->
class
,
buffer
+
CHARS_IN_GUID
-
1
,
CHARS_IN_GUID
);
}
/* try DirectShow filters */
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
sw_key
,
This
->
sw_index
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))))
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
sw_key
,
This
->
sw_index
,
buffer
,
ARRAY_SIZE
(
buffer
))))
{
This
->
sw_index
++
;
if
((
res
=
RegOpenKeyExW
(
This
->
sw_key
,
buffer
,
0
,
KEY_QUERY_VALUE
,
&
hkey
)))
...
...
@@ -908,7 +908,7 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
strcpyW
(
pMoniker
->
name
,
buffer
);
}
/* then try codecs */
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
cm_key
,
This
->
cm_index
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))))
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
cm_key
,
This
->
cm_index
,
buffer
,
ARRAY_SIZE
(
buffer
))))
{
This
->
cm_index
++
;
...
...
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