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
cca635b4
Commit
cca635b4
authored
Feb 16, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Feb 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add tests for the off-by-one fixing behaviour of RegSetValueExA and RegSetValueExW.
parent
628183c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
registry.c
dlls/advapi32/tests/registry.c
+12
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
cca635b4
...
...
@@ -349,6 +349,12 @@ static void test_set_value(void)
test_hkey_main_Value_A
(
name1A
,
emptyA
,
sizeof
(
emptyA
));
test_hkey_main_Value_W
(
name1W
,
emptyW
,
sizeof
(
emptyW
));
/* test RegSetValueExA with off-by-one size */
ret
=
RegSetValueExA
(
hkey_main
,
name1A
,
0
,
REG_SZ
,
(
const
BYTE
*
)
string1A
,
sizeof
(
string1A
)
-
sizeof
(
string1A
[
0
]));
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
test_hkey_main_Value_A
(
name1A
,
string1A
,
sizeof
(
string1A
));
test_hkey_main_Value_W
(
name1W
,
string1W
,
sizeof
(
string1W
));
/* test RegSetValueExA with normal string */
ret
=
RegSetValueExA
(
hkey_main
,
name1A
,
0
,
REG_SZ
,
(
const
BYTE
*
)
string1A
,
sizeof
(
string1A
));
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
...
...
@@ -393,6 +399,12 @@ static void test_set_value(void)
ret
=
RegSetValueW
(
hkey_main
,
NULL
,
REG_MULTI_SZ
,
string2W
,
sizeof
(
string2W
));
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"RegSetValueW should have returned ERROR_INVALID_PARAMETER instead of %d
\n
"
,
ret
);
/* test RegSetValueExW with off-by-one size */
ret
=
RegSetValueExW
(
hkey_main
,
name1W
,
0
,
REG_SZ
,
(
const
BYTE
*
)
string1W
,
sizeof
(
string1W
)
-
sizeof
(
string1W
[
0
]));
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValueExW failed: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
test_hkey_main_Value_A
(
name1A
,
string1A
,
sizeof
(
string1A
));
test_hkey_main_Value_W
(
name1W
,
string1W
,
sizeof
(
string1W
));
/* test RegSetValueExW with normal string */
ret
=
RegSetValueExW
(
hkey_main
,
name1W
,
0
,
REG_SZ
,
(
const
BYTE
*
)
string1W
,
sizeof
(
string1W
));
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValueExW failed: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
...
...
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