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
31f070f7
Commit
31f070f7
authored
Jun 28, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Support use of registry views when deleting registry keys.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d42cb9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
delete.c
programs/reg/delete.c
+11
-7
delete.c
programs/reg/tests/delete.c
+9
-9
No files found.
programs/reg/delete.c
View file @
31f070f7
...
...
@@ -59,25 +59,29 @@ static int run_delete(HKEY root, WCHAR *path, REGSAM sam, WCHAR *key_name, WCHAR
}
}
if
((
rc
=
RegOpenKeyExW
(
root
,
path
,
0
,
KEY_READ
|
KEY_SET_VALUE
|
sam
,
&
hkey
)))
{
output_error
(
rc
);
return
1
;
}
/* Delete registry key if no /v* option is given */
if
(
!
value_name
&&
!
value_empty
&&
!
value_all
)
{
if
((
rc
=
RegDeleteTreeW
(
root
,
path
)))
if
((
rc
=
RegDeleteTreeW
(
hkey
,
NULL
)))
{
RegCloseKey
(
hkey
);
output_error
(
rc
);
return
1
;
}
RegDeleteKeyW
(
hkey
,
L""
);
RegCloseKey
(
hkey
);
output_message
(
STRING_SUCCESS
);
return
0
;
}
if
((
rc
=
RegOpenKeyExW
(
root
,
path
,
0
,
KEY_READ
|
KEY_SET_VALUE
|
sam
,
&
hkey
)))
{
output_error
(
rc
);
return
1
;
}
op_delete_key
=
FALSE
;
if
(
value_all
)
...
...
programs/reg/tests/delete.c
View file @
31f070f7
...
...
@@ -284,19 +284,19 @@ static void test_registry_view_win64(void)
verify_key
(
hkey
,
"Subkey"
,
KEY_WOW64_32KEY
);
run_reg_exe
(
"reg delete HKLM
\\
"
KEY_BASE
"
\\
Subkey /f /reg:32"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey"
,
KEY_WOW64_32KEY
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey"
,
KEY_WOW64_32KEY
);
close_key
(
hkey
);
run_reg_exe
(
"reg delete HKLM
\\
"
KEY_BASE
" /f /reg:32"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
/* Test deletion from the 64-bit registry view (64-bit Windows) */
create_test_key
(
KEY_WOW64_64KEY
);
todo_wine
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
open_key
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
,
&
hkey
);
...
...
@@ -394,14 +394,14 @@ static void test_registry_view_wow64(void)
verify_key
(
hkey
,
"Subkey"
,
KEY_WOW64_64KEY
);
run_reg_exe
(
"reg delete HKLM
\\
"
KEY_BASE
"
\\
Subkey /f /reg:64"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey"
,
KEY_WOW64_64KEY
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey"
,
KEY_WOW64_64KEY
);
close_key
(
hkey
);
run_reg_exe
(
"reg delete HKLM
\\
"
KEY_BASE
" /f /reg:64"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
);
}
START_TEST
(
delete
)
...
...
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