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
0c3530d6
Commit
0c3530d6
authored
Oct 29, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uninstaller: Use CRT allocation functions.
parent
8418962f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
main.c
programs/uninstaller/main.c
+8
-10
No files found.
programs/uninstaller/main.c
View file @
0c3530d6
...
...
@@ -61,12 +61,12 @@ static void output_writeconsole(const WCHAR *str, DWORD len)
* If this occurs, we should use an OEM codepage and call WriteFile.
*/
lenA
=
WideCharToMultiByte
(
GetOEMCP
(),
0
,
str
,
len
,
NULL
,
0
,
NULL
,
NULL
);
strA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenA
);
strA
=
malloc
(
lenA
);
if
(
strA
)
{
WideCharToMultiByte
(
GetOEMCP
(),
0
,
str
,
len
,
strA
,
lenA
,
NULL
,
NULL
);
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
strA
,
lenA
,
&
written
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
strA
);
free
(
strA
);
}
}
...
...
@@ -257,13 +257,12 @@ static int FetchFromRootKey(HKEY root)
if
(
!
RegQueryValueExW
(
hkeyApp
,
L"WindowsInstaller"
,
NULL
,
&
type
,
(
BYTE
*
)
&
value
,
&
size
)
&&
type
==
REG_DWORD
&&
value
==
1
)
{
command
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
L"msiexec /x"
)
+
wcslen
(
subKeyName
)
*
sizeof
(
WCHAR
));
command
=
malloc
(
sizeof
(
L"msiexec /x"
)
+
wcslen
(
subKeyName
)
*
sizeof
(
WCHAR
));
wsprintfW
(
command
,
L"msiexec /x%s"
,
subKeyName
);
}
else
if
(
!
RegQueryValueExW
(
hkeyApp
,
L"UninstallString"
,
NULL
,
NULL
,
NULL
,
&
uninstlen
))
{
command
=
HeapAlloc
(
GetProcessHeap
(),
0
,
uninstlen
);
command
=
malloc
(
uninstlen
);
RegQueryValueExW
(
hkeyApp
,
L"UninstallString"
,
0
,
0
,
(
BYTE
*
)
command
,
&
uninstlen
);
}
else
...
...
@@ -273,11 +272,10 @@ static int FetchFromRootKey(HKEY root)
continue
;
}
numentries
++
;
entries
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
entries
,
numentries
*
sizeof
(
uninst_entry
));
entries
=
realloc
(
entries
,
numentries
*
sizeof
(
uninst_entry
));
entries
[
numentries
-
1
].
root
=
root
;
entries
[
numentries
-
1
].
key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
subKeyName
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
entries
[
numentries
-
1
].
key
,
subKeyName
);
entries
[
numentries
-
1
].
descr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
displen
);
entries
[
numentries
-
1
].
key
=
wcsdup
(
subKeyName
);
entries
[
numentries
-
1
].
descr
=
malloc
(
displen
);
RegQueryValueExW
(
hkeyApp
,
L"DisplayName"
,
0
,
0
,
(
BYTE
*
)
entries
[
numentries
-
1
].
descr
,
&
displen
);
entries
[
numentries
-
1
].
command
=
command
;
entries
[
numentries
-
1
].
active
=
0
;
...
...
@@ -302,7 +300,7 @@ static int FetchUninstallInformation(void)
numentries
=
0
;
oldsel
=
-
1
;
if
(
!
entries
)
entries
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
uninst_entry
));
entries
=
malloc
(
sizeof
(
uninst_entry
));
if
(
!
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
PathUninstallW
,
0
,
KEY_READ
,
&
root
))
{
...
...
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