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
6d2a2e1a
Commit
6d2a2e1a
authored
Oct 01, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Oct 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Introduce tests for the merged view of HKEY_CLASSES_ROOT.
parent
cad2aaff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
registry.c
dlls/advapi32/tests/registry.c
+55
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
6d2a2e1a
...
...
@@ -1912,6 +1912,60 @@ static void test_redirection(void)
RegCloseKey
(
root64
);
}
static
void
test_classesroot
(
void
)
{
HKEY
hkey
,
hkcr
;
DWORD
size
=
8
;
DWORD
type
=
REG_SZ
;
static
CHAR
buffer
[
8
];
LONG
res
;
/* create a key in the user's classes */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Classes
\\
WineTestCls"
,
&
hkey
))
delete_key
(
hkey
);
if
(
RegCreateKeyExA
(
HKEY_CURRENT_USER
,
"Software
\\
Classes
\\
WineTestCls"
,
0
,
NULL
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
NULL
,
&
hkey
,
NULL
))
return
;
/* try to open that key in hkcr */
res
=
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"WineTestCls"
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
&
hkcr
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
||
broken
(
res
==
ERROR_FILE_NOT_FOUND
/* Win9x */
),
"test key not found in hkcr: %d
\n
"
,
res
);
/* set a value in user's classes */
res
=
RegSetValueExA
(
hkey
,
"val1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"user"
,
sizeof
(
"user"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
/* try to find the value in hkcr */
res
=
RegQueryValueExA
(
hkcr
,
"val1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
||
broken
(
res
==
ERROR_BADKEY
/* Win9x */
)
||
broken
(
res
==
ERROR_INVALID_HANDLE
/* NT+ */
),
"RegQueryValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"user"
)
||
broken
(
!
strcmp
(
buffer
,
""
)
/* Win9x */
),
"value set to '%s'
\n
"
,
buffer
);
}
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcr
,
"val1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
todo_wine
ok
(
res
==
ERROR_SUCCESS
||
broken
(
res
==
ERROR_BADKEY
/* Win9x */
)
||
broken
(
res
==
ERROR_INVALID_HANDLE
/* NT+ */
),
"RegSetValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
/* check if the value is also modified in user's classes */
res
=
RegQueryValueExA
(
hkey
,
"val1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buffer
,
"hkcr"
)
||
broken
(
!
strcmp
(
buffer
,
"user"
)
/* Win9x */
),
"value set to '%s'
\n
"
,
buffer
);
/* cleanup */
delete_key
(
hkey
);
}
static
void
test_deleted_key
(
void
)
{
HKEY
hkey
,
hkey2
;
...
...
@@ -2004,6 +2058,7 @@ START_TEST(registry)
test_string_termination
();
test_symlinks
();
test_redirection
();
test_classesroot
();
/* SaveKey/LoadKey require the SE_BACKUP_NAME privilege to be set */
if
(
set_privileges
(
SE_BACKUP_NAME
,
TRUE
)
&&
...
...
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