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
68684365
Commit
68684365
authored
Mar 31, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sxs: Use CRT memory allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6341e6d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
appwiz.c
dlls/appwiz.cpl/appwiz.c
+22
-22
No files found.
dlls/appwiz.cpl/appwiz.c
View file @
68684365
...
...
@@ -106,19 +106,19 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
*/
static
void
FreeAppInfo
(
APPINFO
*
info
)
{
HeapFree
(
GetProcessHeap
(),
0
,
info
->
title
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
path
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
path_modify
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
icon
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
publisher
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
version
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
contact
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
helplink
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
helptelephone
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
readme
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
urlupdateinfo
);
HeapFree
(
GetProcessHeap
(),
0
,
info
->
comments
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
->
title
);
free
(
info
->
path
);
free
(
info
->
path_modify
);
free
(
info
->
icon
);
free
(
info
->
publisher
);
free
(
info
->
version
);
free
(
info
->
contact
);
free
(
info
->
helplink
);
free
(
info
->
helptelephone
);
free
(
info
->
readme
);
free
(
info
->
urlupdateinfo
);
free
(
info
->
comments
);
free
(
info
);
}
static
WCHAR
*
get_reg_str
(
HKEY
hkey
,
const
WCHAR
*
value
)
...
...
@@ -127,7 +127,7 @@ static WCHAR *get_reg_str(HKEY hkey, const WCHAR *value)
WCHAR
*
ret
=
NULL
;
if
(
!
RegQueryValueExW
(
hkey
,
value
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
type
==
REG_SZ
)
{
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
return
NULL
;
if
(
!
(
ret
=
malloc
(
len
)))
return
NULL
;
RegQueryValueExW
(
hkey
,
value
,
0
,
0
,
(
BYTE
*
)
ret
,
&
len
);
}
return
ret
;
...
...
@@ -176,12 +176,12 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
{
int
len
=
lstrlenW
(
L"msiexec /x%s"
)
+
lstrlenW
(
subKeyName
);
if
(
!
(
command
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
))))
goto
err
;
if
(
!
(
command
=
malloc
(
len
*
sizeof
(
WCHAR
))))
goto
err
;
wsprintfW
(
command
,
L"msiexec /x%s"
,
subKeyName
);
}
else
if
(
!
RegQueryValueExW
(
hkeyApp
,
L"UninstallString"
,
0
,
0
,
NULL
,
&
uninstlen
))
{
if
(
!
(
command
=
HeapAlloc
(
GetProcessHeap
(),
0
,
uninstlen
)))
goto
err
;
if
(
!
(
command
=
malloc
(
uninstlen
)))
goto
err
;
RegQueryValueExW
(
hkeyApp
,
L"UninstallString"
,
0
,
0
,
(
BYTE
*
)
command
,
&
uninstlen
);
}
else
...
...
@@ -191,10 +191,10 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
continue
;
}
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
APPINFO
));
info
=
calloc
(
1
,
sizeof
(
*
info
));
if
(
!
info
)
goto
err
;
info
->
title
=
HeapAlloc
(
GetProcessHeap
(),
0
,
displen
);
info
->
title
=
malloc
(
displen
);
if
(
!
info
->
title
)
goto
err
;
...
...
@@ -209,7 +209,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
info
->
icon
=
0
;
else
{
info
->
icon
=
HeapAlloc
(
GetProcessHeap
(),
0
,
displen
);
info
->
icon
=
malloc
(
displen
);
if
(
!
info
->
icon
)
goto
err
;
...
...
@@ -259,12 +259,12 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
{
int
len
=
lstrlenW
(
L"msiexec /i%s"
)
+
lstrlenW
(
subKeyName
);
if
(
!
(
info
->
path_modify
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
))))
goto
err
;
if
(
!
(
info
->
path_modify
=
malloc
(
len
*
sizeof
(
WCHAR
))))
goto
err
;
wsprintfW
(
info
->
path_modify
,
L"msiexec /i%s"
,
subKeyName
);
}
else
if
(
!
RegQueryValueExW
(
hkeyApp
,
L"ModifyPath"
,
0
,
0
,
NULL
,
&
displen
))
{
if
(
!
(
info
->
path_modify
=
HeapAlloc
(
GetProcessHeap
(),
0
,
displen
)))
goto
err
;
if
(
!
(
info
->
path_modify
=
malloc
(
displen
)))
goto
err
;
RegQueryValueExW
(
hkeyApp
,
L"ModifyPath"
,
0
,
0
,
(
BYTE
*
)
info
->
path_modify
,
&
displen
);
}
}
...
...
@@ -286,7 +286,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
err:
RegCloseKey
(
hkeyApp
);
if
(
info
)
FreeAppInfo
(
info
);
HeapFree
(
GetProcessHeap
(),
0
,
command
);
free
(
command
);
return
FALSE
;
}
...
...
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