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
5115e51a
Commit
5115e51a
authored
Jul 01, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Verify key opening and key deletion in delete_tree().
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7995d686
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
add.c
programs/reg/tests/add.c
+5
-2
reg_test.h
programs/reg/tests/reg_test.h
+2
-1
No files found.
programs/reg/tests/add.c
View file @
5115e51a
...
...
@@ -154,7 +154,7 @@ void delete_key_(const char *file, unsigned line, HKEY root, const char *path, R
}
}
LONG
delete_tree
(
HKEY
root
,
const
char
*
path
,
REGSAM
sam
)
LONG
delete_tree
_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
)
{
HKEY
hkey
;
LONG
ret
;
...
...
@@ -163,6 +163,7 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam)
static
const
char
empty
[
1
];
ret
=
RegOpenKeyExA
(
root
,
path
,
0
,
KEY_READ
|
sam
,
&
hkey
);
lok
(
!
ret
||
ret
==
ERROR_FILE_NOT_FOUND
,
"RegOpenKeyExA failed, got error %d
\n
"
,
ret
);
if
(
ret
)
return
ret
;
ret
=
RegQueryInfoKeyA
(
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
&
max_subkey_len
,
...
...
@@ -184,7 +185,7 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam)
ret
=
RegEnumKeyExA
(
hkey
,
0
,
subkey_name
,
&
subkey_len
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
ret
==
ERROR_NO_MORE_ITEMS
)
break
;
if
(
ret
)
goto
cleanup
;
ret
=
delete_tree
(
hkey
,
subkey_name
,
sam
);
ret
=
delete_tree
_
(
file
,
line
,
hkey
,
subkey_name
,
sam
);
if
(
ret
)
goto
cleanup
;
}
...
...
@@ -193,6 +194,8 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam)
else
ret
=
RegDeleteKeyExA
(
hkey
,
empty
,
sam
,
0
);
lok
(
!
ret
,
"Failed to delete registry key, got error %d
\n
"
,
ret
);
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
subkey_name
);
RegCloseKey
(
hkey
);
...
...
programs/reg/tests/reg_test.h
View file @
5115e51a
...
...
@@ -64,7 +64,8 @@ void add_key_(const char *file, unsigned line, const HKEY root, const char *path
#define delete_key(r,p,s) delete_key_(__FILE__,__LINE__,r,p,s)
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
LONG
delete_tree
(
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
#define delete_tree(r,p,s) delete_tree_(__FILE__,__LINE__,r,p,s)
LONG
delete_tree_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
#define add_value(k,n,t,d,s) add_value_(__FILE__,__LINE__,k,n,t,d,s)
void
add_value_
(
const
char
*
file
,
unsigned
line
,
HKEY
hkey
,
const
char
*
name
,
...
...
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