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
9c7366c0
Commit
9c7366c0
authored
Dec 02, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Dec 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: More tests for the merged view of HKEY_CLASSES_ROOT.
parent
6374205e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
1 deletion
+84
-1
registry.c
dlls/advapi32/tests/registry.c
+84
-1
No files found.
dlls/advapi32/tests/registry.c
View file @
9c7366c0
...
@@ -1914,7 +1914,7 @@ static void test_redirection(void)
...
@@ -1914,7 +1914,7 @@ static void test_redirection(void)
static
void
test_classesroot
(
void
)
static
void
test_classesroot
(
void
)
{
{
HKEY
hkey
,
hkcr
;
HKEY
hkey
,
hk
lm
,
hk
cr
;
DWORD
size
=
8
;
DWORD
size
=
8
;
DWORD
type
=
REG_SZ
;
DWORD
type
=
REG_SZ
;
static
CHAR
buffer
[
8
];
static
CHAR
buffer
[
8
];
...
@@ -1963,8 +1963,91 @@ static void test_classesroot(void)
...
@@ -1963,8 +1963,91 @@ static void test_classesroot(void)
/* cleanup */
/* cleanup */
delete_key
(
hkey
);
delete_key
(
hkey
);
delete_key
(
hkcr
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkcr
);
RegCloseKey
(
hkcr
);
/* create a key in the hklm classes */
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Classes
\\
WineTestCls"
,
&
hklm
))
{
delete_key
(
hklm
);
RegCloseKey
(
hklm
);
}
res
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Classes
\\
WineTestCls"
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
hklm
,
NULL
);
if
(
res
==
ERROR_ACCESS_DENIED
)
{
skip
(
"not enough privileges to add a system class
\n
"
);
return
;
}
/* try to open that key in hkcr */
res
=
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"WineTestCls"
,
0
,
KEY_QUERY_VALUE
|
KEY_SET_VALUE
,
&
hkcr
);
ok
(
res
==
ERROR_SUCCESS
,
"test key not found in hkcr: %d
\n
"
,
res
);
if
(
res
)
{
delete_key
(
hklm
);
RegCloseKey
(
hklm
);
return
;
}
/* set a value in hklm classes */
res
=
RegSetValueExA
(
hklm
,
"val2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hklm"
,
sizeof
(
"user"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
/* try to find the value in hkcr */
res
=
RegQueryValueExA
(
hkcr
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"hklm"
),
"value set to '%s'
\n
"
,
buffer
);
/* 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
);
/* check that the value is not modified in hklm classes */
res
=
RegQueryValueExA
(
hklm
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"hklm"
),
"value set to '%s'
\n
"
,
buffer
);
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
);
ok
(
res
==
ERROR_SUCCESS
,
"test key not found in hkcr: %d
\n
"
,
res
);
/* set a value in user's classes */
res
=
RegSetValueExA
(
hkey
,
"val2"
,
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
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"user"
),
"value set to '%s'
\n
"
,
buffer
);
/* modify the value in hklm */
res
=
RegSetValueExA
(
hklm
,
"val2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hklm"
,
sizeof
(
"user"
));
ok
(
res
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
/* check that the value is not overwritten in hkcr or user's classes */
res
=
RegQueryValueExA
(
hkcr
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"user"
),
"value set to '%s'
\n
"
,
buffer
);
res
=
RegQueryValueExA
(
hkey
,
"val2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegQueryValueExA failed: %d, GLE=%x
\n
"
,
res
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"user"
),
"value set to '%s'
\n
"
,
buffer
);
/* cleanup */
delete_key
(
hkey
);
delete_key
(
hklm
);
delete_key
(
hkcr
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hklm
);
RegCloseKey
(
hkcr
);
}
}
static
void
test_deleted_key
(
void
)
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