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
2399e7f2
Commit
2399e7f2
authored
Dec 30, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Dec 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Test how creating a subkey in HKCR affect HKLM/HKCU.
parent
f284719c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
registry.c
dlls/advapi32/tests/registry.c
+34
-11
No files found.
dlls/advapi32/tests/registry.c
View file @
2399e7f2
...
...
@@ -2,6 +2,7 @@
* Unit tests for registry functions
*
* Copyright (c) 2002 Alexandre Julliard
* Copyright (c) 2010 André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -1914,7 +1915,7 @@ static void test_redirection(void)
static
void
test_classesroot
(
void
)
{
HKEY
hkey
,
hklm
,
hkcr
,
hkeysub1
,
hklmsub1
,
hkcrsub1
;
HKEY
hkey
,
hklm
,
hkcr
,
hkeysub1
,
hklmsub1
,
hkcrsub1
,
hklmsub2
,
hkcrsub2
;
DWORD
size
=
8
;
DWORD
type
=
REG_SZ
;
static
CHAR
buffer
[
8
];
...
...
@@ -1954,7 +1955,7 @@ static void test_classesroot(void)
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcr
,
"val1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"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
);
...
...
@@ -1972,7 +1973,7 @@ static void test_classesroot(void)
/* modify the value in user's classes */
res
=
RegSetValueExA
(
hkcr
,
"val0"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"user"
,
sizeof
(
"user"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
, GLE=%x
\n
"
,
res
,
GetLastError
()
);
/* check if the value is also modified in hkcr */
res
=
RegQueryValueExA
(
hkey
,
"val0"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
...
...
@@ -2022,7 +2023,7 @@ static void test_classesroot(void)
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcr
,
"val2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
, GLE=%x
\n
"
,
res
,
GetLastError
()
);
/* check that the value is not modified in hklm classes */
res
=
RegQueryValueExA
(
hklm
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
...
...
@@ -2061,7 +2062,7 @@ static void test_classesroot(void)
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcr
,
"val2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
, GLE=%x
\n
"
,
res
,
GetLastError
()
);
/* check that the value is overwritten in hklm and user's classes */
res
=
RegQueryValueExA
(
hkcr
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
...
...
@@ -2089,7 +2090,7 @@ static void test_classesroot(void)
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcrsub1
,
"subval1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
, GLE=%x
\n
"
,
res
,
GetLastError
()
);
/* check that the value is modified in hklm classes */
res
=
RegQueryValueExA
(
hklmsub1
,
"subval1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
...
...
@@ -2123,29 +2124,51 @@ static void test_classesroot(void)
/* modify the value in hkcr */
res
=
RegSetValueExA
(
hkcrsub1
,
"subval1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
, GLE=%x
\n
"
,
res
,
GetLastError
()
);
/* check that the value is
overwritten in hklm and
user's classes */
res
=
RegQueryValueExA
(
hk
cr
sub1
,
"subval1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
/* check that the value is
not overwritten in hklm, but in
user's classes */
res
=
RegQueryValueExA
(
hk
lm
sub1
,
"subval1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"hk
cr
"
),
"value set to '%s'
\n
"
,
buffer
);
ok
(
!
strcmp
(
buffer
,
"hk
lm
"
),
"value set to '%s'
\n
"
,
buffer
);
res
=
RegQueryValueExA
(
hkeysub1
,
"subval1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"hkcr"
),
"value set to '%s'
\n
"
,
buffer
);
/* cleanup */
/* new subkey in hkcr */
if
(
RegCreateKeyExA
(
hkcr
,
"subkey2"
,
0
,
NULL
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
NULL
,
&
hkcrsub2
,
NULL
))
return
;
res
=
RegSetValueExA
(
hkcrsub2
,
"subval1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hkcr"
,
sizeof
(
"hkcr"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
/* try to open that new subkey in user's classes and hklm */
res
=
RegOpenKeyExA
(
hkey
,
"subkey2"
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
&
hklmsub2
);
ok
(
res
!=
ERROR_SUCCESS
,
"test key found in user's classes: %d
\n
"
,
res
);
hklmsub2
=
0
;
res
=
RegOpenKeyExA
(
hklm
,
"subkey2"
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
&
hklmsub2
);
ok
(
res
==
ERROR_SUCCESS
,
"test key not found in hklm: %d
\n
"
,
res
);
/* check that the value is present in hklm */
res
=
RegQueryValueExA
(
hklmsub2
,
"subval1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"hkcr"
),
"value set to '%s'
\n
"
,
buffer
);
/* final cleanup */
delete_key
(
hkey
);
delete_key
(
hklm
);
delete_key
(
hkcr
);
delete_key
(
hkeysub1
);
delete_key
(
hklmsub1
);
delete_key
(
hkcrsub1
);
delete_key
(
hklmsub2
);
delete_key
(
hkcrsub2
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hklm
);
RegCloseKey
(
hkcr
);
RegCloseKey
(
hkeysub1
);
RegCloseKey
(
hklmsub1
);
RegCloseKey
(
hkcrsub1
);
RegCloseKey
(
hklmsub2
);
RegCloseKey
(
hkcrsub2
);
}
static
void
test_deleted_key
(
void
)
...
...
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