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
2cd06283
Commit
2cd06283
authored
Aug 20, 2012
by
Dan Kegel
Committed by
Alexandre Julliard
Aug 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: RegSetValueExW should not crash when passed 1 instead of L"1".
parent
8b774cb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
registry.c
dlls/advapi32/registry.c
+3
-0
registry.c
dlls/advapi32/tests/registry.c
+9
-0
No files found.
dlls/advapi32/registry.c
View file @
2cd06283
...
...
@@ -1177,6 +1177,9 @@ LSTATUS WINAPI RegSetValueExW( HKEY hkey, LPCWSTR name, DWORD reserved,
UNICODE_STRING
nameW
;
/* no need for version check, not implemented on win9x anyway */
if
(
data
&&
((
ULONG_PTR
)
data
>>
16
)
==
0
)
return
ERROR_NOACCESS
;
if
(
count
&&
is_string
(
type
))
{
LPCWSTR
str
=
(
LPCWSTR
)
data
;
...
...
dlls/advapi32/tests/registry.c
View file @
2cd06283
...
...
@@ -346,6 +346,9 @@ static void test_set_value(void)
/* Crashes on NT4, Windows 2000 and XP SP1 */
ret
=
RegSetValueW
(
hkey_main
,
NULL
,
REG_SZ
,
NULL
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"RegSetValueW should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
ret
);
RegSetValueExA
(
hkey_main
,
name2A
,
0
,
REG_SZ
,
(
const
BYTE
*
)
1
,
1
);
RegSetValueExA
(
hkey_main
,
name2A
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
1
,
1
);
}
ret
=
RegSetValueW
(
hkey_main
,
NULL
,
REG_SZ
,
string1W
,
sizeof
(
string1W
));
...
...
@@ -395,6 +398,12 @@ static void test_set_value(void)
ok
(
ret
==
ERROR_SUCCESS
,
"RegSetValueExW failed: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
test_hkey_main_Value_A
(
name2A
,
string2A
,
sizeof
(
string2A
));
test_hkey_main_Value_W
(
name2W
,
string2W
,
sizeof
(
string2W
));
/* test RegSetValueExW with data = 1 */
ret
=
RegSetValueExW
(
hkey_main
,
name2W
,
0
,
REG_SZ
,
(
const
BYTE
*
)
1
,
1
);
ok
(
ret
==
ERROR_NOACCESS
,
"RegSetValueExW should have failed with with ERROR_NOACCESS: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
ret
=
RegSetValueExW
(
hkey_main
,
name2W
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
1
,
1
);
ok
(
ret
==
ERROR_NOACCESS
,
"RegSetValueExW should have failed with with ERROR_NOACCESS: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
}
static
void
create_test_entries
(
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