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
2ddcd97b
Commit
2ddcd97b
authored
Mar 02, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Mar 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix RegDeleteTreeW when an empty string is passed.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6780c203
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
registry.c
dlls/advapi32/registry.c
+3
-3
registry.c
dlls/advapi32/tests/registry.c
+14
-0
No files found.
dlls/advapi32/registry.c
View file @
2ddcd97b
...
...
@@ -3030,7 +3030,7 @@ LSTATUS WINAPI RegDeleteTreeW( HKEY hkey, const WCHAR *subkey )
TRACE
(
"(%p, %s)
\n
"
,
hkey
,
debugstr_w
(
subkey
)
);
if
(
subkey
)
if
(
subkey
&&
*
subkey
)
{
ret
=
RegOpenKeyExW
(
hkey
,
subkey
,
0
,
KEY_READ
,
&
hkey
);
if
(
ret
)
return
ret
;
...
...
@@ -3060,7 +3060,7 @@ LSTATUS WINAPI RegDeleteTreeW( HKEY hkey, const WCHAR *subkey )
}
/* Delete the key itself */
if
(
subkey
)
if
(
subkey
&&
*
subkey
)
{
ret
=
RegDeleteKeyW
(
hkey
,
emptyW
);
goto
cleanup
;
...
...
@@ -3081,7 +3081,7 @@ LSTATUS WINAPI RegDeleteTreeW( HKEY hkey, const WCHAR *subkey )
cleanup:
heap_free
(
name_buf
);
if
(
subkey
)
if
(
subkey
&&
*
subkey
)
RegCloseKey
(
hkey
);
return
ret
;
}
...
...
dlls/advapi32/tests/registry.c
View file @
2ddcd97b
...
...
@@ -2246,6 +2246,20 @@ static void test_reg_delete_tree(void)
dwsize
=
MAX_PATH
;
ok
(
RegQueryValueExA
(
subkey
,
"value"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
dwsize
),
"Value is still present
\n
"
);
ret
=
RegCloseKey
(
subkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegOpenKeyA
(
hkey_main
,
"subkey"
,
&
subkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"subkey was deleted
\n
"
);
ret
=
pRegDeleteTreeA
(
subkey
,
""
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegCloseKey
(
subkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegOpenKeyA
(
hkey_main
,
"subkey"
,
&
subkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"subkey was deleted
\n
"
);
ret
=
RegCloseKey
(
subkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
pRegDeleteTreeA
(
hkey_main
,
"not-here"
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
...
...
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