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
9be3c537
Commit
9be3c537
authored
Jul 27, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use the heap_*() functions in regedit.c where possible.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3e043b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
regedit.c
programs/regedit/regedit.c
+6
-7
No files found.
programs/regedit/regedit.c
View file @
9be3c537
...
...
@@ -42,12 +42,11 @@ static void output_writeconsole(const WCHAR *str, DWORD wlen)
* we should call WriteFile() and assume the console encoding is still correct.
*/
len
=
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
str
,
wlen
,
NULL
,
0
,
NULL
,
NULL
);
msgA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
!
msgA
)
return
;
msgA
=
heap_xalloc
(
len
);
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
str
,
wlen
,
msgA
,
len
,
NULL
,
NULL
);
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
msgA
,
len
,
&
count
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
msgA
);
heap_free
(
msgA
);
}
}
...
...
@@ -123,13 +122,13 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
size
=
SearchPathW
(
NULL
,
filename
,
NULL
,
0
,
NULL
,
NULL
);
if
(
size
>
0
)
{
realname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
realname
=
heap_xalloc
(
size
*
sizeof
(
WCHAR
));
size
=
SearchPathW
(
NULL
,
filename
,
NULL
,
size
,
realname
,
NULL
);
}
if
(
size
==
0
)
{
output_message
(
STRING_FILE_NOT_FOUND
,
filename
);
HeapFree
(
GetProcessHeap
(),
0
,
realname
);
heap_free
(
realname
);
return
;
}
reg_file
=
_wfopen
(
realname
,
rb_mode
);
...
...
@@ -138,14 +137,14 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
WCHAR
regedit
[]
=
{
'r'
,
'e'
,
'g'
,
'e'
,
'd'
,
'i'
,
't'
,
0
};
_wperror
(
regedit
);
output_message
(
STRING_CANNOT_OPEN_FILE
,
filename
);
HeapFree
(
GetProcessHeap
(),
0
,
realname
);
heap_free
(
realname
);
return
;
}
}
import_registry_file
(
reg_file
);
if
(
realname
)
{
HeapFree
(
GetProcessHeap
(),
0
,
realname
);
heap_free
(
realname
);
fclose
(
reg_file
);
}
break
;
...
...
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