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
af68dafc
Commit
af68dafc
authored
May 13, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
May 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Use calloc() in enum_moniker_create().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b11afa17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
mediacatenum.c
dlls/devenum/mediacatenum.c
+18
-16
No files found.
dlls/devenum/mediacatenum.c
View file @
af68dafc
...
...
@@ -789,7 +789,7 @@ static ULONG WINAPI enum_moniker_Release(IEnumMoniker *iface)
IEnumDMO_Release
(
This
->
dmo_enum
);
RegCloseKey
(
This
->
sw_key
);
RegCloseKey
(
This
->
cm_key
);
CoTaskMemF
ree
(
This
);
f
ree
(
This
);
DEVENUM_UnlockModule
();
return
0
;
}
...
...
@@ -922,41 +922,43 @@ static const IEnumMonikerVtbl IEnumMoniker_Vtbl =
enum_moniker_Clone
,
};
HRESULT
enum_moniker_create
(
REFCLSID
class
,
IEnumMoniker
**
ppEnumMoniker
)
HRESULT
enum_moniker_create
(
REFCLSID
class
,
IEnumMoniker
**
out
)
{
EnumMonikerImpl
*
pEnumMoniker
=
CoTaskMemAlloc
(
sizeof
(
EnumMonikerImpl
))
;
EnumMonikerImpl
*
object
;
WCHAR
buffer
[
78
];
HRESULT
hr
;
if
(
!
pEnumMoniker
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
)))
)
return
E_OUTOFMEMORY
;
pEnumMoniker
->
IEnumMoniker_iface
.
lpVtbl
=
&
IEnumMoniker_Vtbl
;
pEnumMoniker
->
ref
=
1
;
pEnumMoniker
->
sw_index
=
0
;
pEnumMoniker
->
cm_index
=
0
;
pEnumMoniker
->
class
=
*
class
;
object
->
IEnumMoniker_iface
.
lpVtbl
=
&
IEnumMoniker_Vtbl
;
object
->
ref
=
1
;
object
->
class
=
*
class
;
lstrcpyW
(
buffer
,
clsidW
);
lstrcatW
(
buffer
,
backslashW
);
StringFromGUID2
(
class
,
buffer
+
lstrlenW
(
buffer
),
CHARS_IN_GUID
);
lstrcatW
(
buffer
,
instanceW
);
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
pEnumMoniker
->
sw_key
))
pEnumMoniker
->
sw_key
=
NULL
;
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
object
->
sw_key
))
object
->
sw_key
=
NULL
;
lstrcpyW
(
buffer
,
wszActiveMovieKey
);
StringFromGUID2
(
class
,
buffer
+
lstrlenW
(
buffer
),
CHARS_IN_GUID
);
if
(
RegOpenKeyExW
(
HKEY_CURRENT_USER
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
pEnumMoniker
->
cm_key
))
pEnumMoniker
->
cm_key
=
NULL
;
if
(
RegOpenKeyExW
(
HKEY_CURRENT_USER
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
object
->
cm_key
))
object
->
cm_key
=
NULL
;
hr
=
DMOEnum
(
class
,
0
,
0
,
NULL
,
0
,
NULL
,
&
pEnumMoniker
->
dmo_enum
);
hr
=
DMOEnum
(
class
,
0
,
0
,
NULL
,
0
,
NULL
,
&
object
->
dmo_enum
);
if
(
FAILED
(
hr
))
{
IEnumMoniker_Release
(
&
pEnumMoniker
->
IEnumMoniker_iface
);
if
(
object
->
cm_key
)
RegCloseKey
(
object
->
cm_key
);
if
(
object
->
sw_key
)
RegCloseKey
(
object
->
sw_key
);
free
(
object
);
return
hr
;
}
*
ppEnumMoniker
=
&
pEnumMoniker
->
IEnumMoniker_iface
;
*
out
=
&
object
->
IEnumMoniker_iface
;
DEVENUM_LockModule
();
...
...
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