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
33ce8e04
Commit
33ce8e04
authored
Sep 24, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use the wcsdup function instead or reimplementing it.
parent
0a7084f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
19 deletions
+6
-19
edit.c
programs/regedit/edit.c
+1
-2
listview.c
programs/regedit/listview.c
+2
-9
regproc.c
programs/regedit/regproc.c
+3
-8
No files found.
programs/regedit/edit.c
View file @
33ce8e04
...
@@ -637,8 +637,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
...
@@ -637,8 +637,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
}
else
{
}
else
{
LPWSTR
srcSubKey_copy
;
LPWSTR
srcSubKey_copy
;
parentPath
=
malloc
((
lstrlenW
(
keyPath
)
+
1
)
*
sizeof
(
WCHAR
));
parentPath
=
wcsdup
(
keyPath
);
lstrcpyW
(
parentPath
,
keyPath
);
srcSubKey_copy
=
wcsrchr
(
parentPath
,
'\\'
);
srcSubKey_copy
=
wcsrchr
(
parentPath
,
'\\'
);
*
srcSubKey_copy
=
0
;
*
srcSubKey_copy
=
0
;
srcSubKey
=
srcSubKey_copy
+
1
;
srcSubKey
=
srcSubKey_copy
+
1
;
...
...
programs/regedit/listview.c
View file @
33ce8e04
...
@@ -73,8 +73,7 @@ BOOL update_listview_path(const WCHAR *path)
...
@@ -73,8 +73,7 @@ BOOL update_listview_path(const WCHAR *path)
{
{
free
(
g_currentPath
);
free
(
g_currentPath
);
g_currentPath
=
malloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
));
g_currentPath
=
wcsdup
(
path
);
lstrcpyW
(
g_currentPath
,
path
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -154,13 +153,7 @@ int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWOR
...
@@ -154,13 +153,7 @@ int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWOR
linfo
=
malloc
(
sizeof
(
LINE_INFO
));
linfo
=
malloc
(
sizeof
(
LINE_INFO
));
linfo
->
dwValType
=
dwValType
;
linfo
->
dwValType
=
dwValType
;
linfo
->
val_len
=
dwCount
;
linfo
->
val_len
=
dwCount
;
linfo
->
name
=
wcsdup
(
Name
);
if
(
Name
)
{
linfo
->
name
=
malloc
((
lstrlenW
(
Name
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
linfo
->
name
,
Name
);
}
else
linfo
->
name
=
NULL
;
if
(
ValBuf
&&
dwCount
)
if
(
ValBuf
&&
dwCount
)
{
{
...
...
programs/regedit/regproc.c
View file @
33ce8e04
...
@@ -447,10 +447,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
...
@@ -447,10 +447,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
KEY_ALL_ACCESS
,
NULL
,
&
parser
->
hkey
,
NULL
);
KEY_ALL_ACCESS
,
NULL
,
&
parser
->
hkey
,
NULL
);
if
(
res
==
ERROR_SUCCESS
)
if
(
res
==
ERROR_SUCCESS
)
{
parser
->
key_name
=
wcsdup
(
path
);
parser
->
key_name
=
malloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
parser
->
key_name
,
path
);
}
else
else
parser
->
hkey
=
NULL
;
parser
->
hkey
=
NULL
;
...
@@ -699,8 +696,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos)
...
@@ -699,8 +696,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos)
goto
invalid
;
goto
invalid
;
/* copy the value name in case we need to parse multiple lines and the buffer is overwritten */
/* copy the value name in case we need to parse multiple lines and the buffer is overwritten */
parser
->
value_name
=
malloc
((
lstrlenW
(
val_name
)
+
1
)
*
sizeof
(
WCHAR
));
parser
->
value_name
=
wcsdup
(
val_name
);
lstrcpyW
(
parser
->
value_name
,
val_name
);
set_state
(
parser
,
DATA_START
);
set_state
(
parser
,
DATA_START
);
return
p
;
return
p
;
...
@@ -1486,8 +1482,7 @@ static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode)
...
@@ -1486,8 +1482,7 @@ static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode)
return
FALSE
;
return
FALSE
;
}
}
class_name
=
malloc
((
lstrlenW
(
reg_class_namesW
[
i
])
+
1
)
*
sizeof
(
WCHAR
));
class_name
=
wcsdup
(
reg_class_namesW
[
i
]);
lstrcpyW
(
class_name
,
reg_class_namesW
[
i
]);
export_registry_data
(
fp
,
classes
[
i
],
class_name
,
unicode
);
export_registry_data
(
fp
,
classes
[
i
],
class_name
,
unicode
);
...
...
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