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
3507999f
Commit
3507999f
authored
Sep 12, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete registry key at exit.
parent
ab910c50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
shreg.c
dlls/shlwapi/tests/shreg.c
+25
-3
No files found.
dlls/shlwapi/tests/shreg.c
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_entry
s
();
HKEY
hkey
=
create_test_entrie
s
();
test_SHGetValue
();
test_SHQUeryValueEx
();
test_SHGetRegPath
();
test_SHCopyKey
();
delete_key
(
hkey
);
}
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