Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
3507999f
Commit
3507999f
authored
22 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Delete registry key at exit.
parent
ab910c50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shlwapi/tests/shreg.c
+25
-3
25 additions, 3 deletions
dlls/shlwapi/tests/shreg.c
with
25 additions
and
3 deletions
dlls/shlwapi/tests/shreg.c
+
25
−
3
View file @
3507999f
...
...
@@ -42,7 +42,28 @@ static unsigned sExpLen2;
static
char
*
sEmptyBuffer
=
"0123456789"
;
static
void
create_test_entrys
(
void
)
/* delete key and all its subkeys */
static
DWORD
delete_key
(
HKEY
hkey
)
{
WCHAR
name
[
MAX_PATH
];
DWORD
ret
;
while
(
!
(
ret
=
RegEnumKeyW
(
hkey
,
0
,
name
,
sizeof
(
name
))))
{
HKEY
tmp
;
if
(
!
(
ret
=
RegOpenKeyExW
(
hkey
,
name
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
tmp
)))
{
ret
=
delete_key
(
tmp
);
RegCloseKey
(
tmp
);
}
if
(
ret
)
break
;
}
if
(
ret
!=
ERROR_NO_MORE_ITEMS
)
return
ret
;
RegDeleteKeyA
(
hkey
,
NULL
);
return
0
;
}
static
HKEY
create_test_entries
(
void
)
{
HKEY
hKey
;
...
...
@@ -56,7 +77,6 @@ static void create_test_entrys(void)
ok
(
!
RegSetValueExA
(
hKey
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed"
);
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)
+
1
),
"RegSetValueExA failed"
);
RegCloseKey
(
hKey
);
}
sExpLen1
=
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
...
...
@@ -64,6 +84,7 @@ static void create_test_entrys(void)
ok
(
sExpLen1
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath1
);
ok
(
sExpLen2
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath2
);
return
hKey
;
}
static
void
test_SHGetValue
(
void
)
...
...
@@ -243,9 +264,10 @@ static void test_SHCopyKey(void)
START_TEST
(
shreg
)
{
create_test_entr
y
s
();
HKEY
hkey
=
create_test_entr
ie
s
();
test_SHGetValue
();
test_SHQUeryValueEx
();
test_SHGetRegPath
();
test_SHCopyKey
();
delete_key
(
hkey
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment