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
f4c3e0f4
Commit
f4c3e0f4
authored
Jul 09, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jul 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use unicode for all key deletion.
parent
0a225750
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
32 deletions
+24
-32
regedit.c
programs/regedit/regedit.c
+5
-1
regproc.c
programs/regedit/regproc.c
+17
-29
regproc.h
programs/regedit/regproc.h
+2
-2
No files found.
programs/regedit/regedit.c
View file @
f4c3e0f4
...
...
@@ -186,8 +186,12 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
getAppName
());
fprintf
(
stderr
,
usage
);
exit
(
1
);
}
else
{
WCHAR
*
reg_key_nameW
=
GetWideString
(
reg_key_name
,
lstrlenA
(
reg_key_name
)
+
1
);
delete_registry_key
(
reg_key_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
reg_key_nameW
);
}
delete_registry_key
(
reg_key_name
);
break
;
}
case
ACTION_EXPORT
:
{
...
...
programs/regedit/regproc.c
View file @
f4c3e0f4
...
...
@@ -75,6 +75,20 @@ if (!(p)) \
}
/******************************************************************************
* Allocates memory and convers input from multibyte to wide chars
* Returned string must be freed by the caller
*/
WCHAR
*
GetWideString
(
char
*
strA
,
int
len
)
{
WCHAR
*
strW
=
NULL
;
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
CHECK_ENOUGH_MEMORY
(
strW
);
MultiByteToWideChar
(
CP_ACP
,
0
,
strA
,
len
,
strW
,
len
);
return
strW
;
}
/******************************************************************************
* Allocates memory and convers input from wide chars to multibyte
* Returned string must be freed by the caller
*/
...
...
@@ -529,12 +543,8 @@ static void processRegEntry(LPSTR stdInput)
/* delete the key if we encounter '-' at the start of reg key */
if
(
stdInput
[
0
]
==
'-'
)
{
WCHAR
*
stdInputW
=
NULL
;
int
size
=
keyEnd
-
stdInput
-
1
;
stdInputW
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
*
sizeof
(
WCHAR
));
CHECK_ENOUGH_MEMORY
(
stdInputW
);
MultiByteToWideChar
(
CP_ACP
,
0
,
stdInput
+
1
,
size
,
stdInputW
,
size
);
delete_registry_keyW
(
stdInputW
);
WCHAR
*
stdInputW
=
GetWideString
(
stdInput
+
1
,
keyEnd
-
stdInput
);
delete_registry_key
(
stdInputW
);
HeapFree
(
GetProcessHeap
(),
0
,
stdInputW
);
}
else
if
(
openKey
(
stdInput
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -1062,29 +1072,7 @@ BOOL import_registry_file(LPTSTR filename)
* reg_key_name - full name of registry branch to delete. Ignored if is NULL,
* empty, points to register key class, does not exist.
*/
void
delete_registry_key
(
CHAR
*
reg_key_name
)
{
CHAR
*
key_name
;
HKEY
key_class
;
if
(
!
reg_key_name
||
!
reg_key_name
[
0
])
return
;
if
(
!
parseKeyName
(
reg_key_name
,
&
key_class
,
&
key_name
))
{
fprintf
(
stderr
,
"%s: Incorrect registry class specification in '%s'
\n
"
,
getAppName
(),
reg_key_name
);
exit
(
1
);
}
if
(
!*
key_name
)
{
fprintf
(
stderr
,
"%s: Can't delete registry class '%s'
\n
"
,
getAppName
(),
reg_key_name
);
exit
(
1
);
}
RegDeleteTreeA
(
key_class
,
key_name
);
}
void
delete_registry_keyW
(
WCHAR
*
reg_key_name
)
void
delete_registry_key
(
WCHAR
*
reg_key_name
)
{
WCHAR
*
key_name
=
NULL
;
HKEY
key_class
;
...
...
programs/regedit/regproc.h
View file @
f4c3e0f4
...
...
@@ -23,6 +23,6 @@ const CHAR *getAppName(void);
BOOL
export_registry_key
(
CHAR
*
file_name
,
CHAR
*
reg_key_name
);
BOOL
import_registry_file
(
LPTSTR
filename
);
void
delete_registry_key
(
CHAR
*
reg_key_name
);
void
delete_registry_keyW
(
WCHAR
*
reg_key_name
);
void
delete_registry_key
(
W
CHAR
*
reg_key_name
);
WCHAR
*
GetWideString
(
char
*
strA
,
int
len
);
void
processRegLines
(
FILE
*
in
);
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