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
ff0ee8f8
Commit
ff0ee8f8
authored
Jan 05, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Return an error from RegSetValueExW if passed a NULL data pointer and non-zero size.
parent
823c037c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
registry.c
dlls/advapi32/registry.c
+1
-1
registry.c
dlls/advapi32/tests/registry.c
+21
-0
No files found.
dlls/advapi32/registry.c
View file @
ff0ee8f8
...
...
@@ -1201,7 +1201,7 @@ LSTATUS WINAPI RegSetValueExW( HKEY hkey, LPCWSTR name, DWORD reserved,
/* no need for version check, not implemented on win9x anyway */
if
(
data
&&
((
ULONG_PTR
)
data
>>
16
)
==
0
)
return
ERROR_NOACCESS
;
if
(
(
data
&&
((
ULONG_PTR
)
data
>>
16
)
==
0
)
||
(
!
data
&&
count
)
)
return
ERROR_NOACCESS
;
if
(
count
&&
is_string
(
type
))
{
...
...
dlls/advapi32/tests/registry.c
View file @
ff0ee8f8
...
...
@@ -436,6 +436,21 @@ static void test_set_value(void)
ret
=
RegSetValueExW
(
hkey_main
,
name2W
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
1
,
1
);
ok
(
ret
==
ERROR_NOACCESS
,
"RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
if
(
pRegGetValueA
)
/* avoid a crash on Windows 2000 */
{
ret
=
RegSetValueExW
(
hkey_main
,
NULL
,
0
,
REG_SZ
,
NULL
,
4
);
ok
(
ret
==
ERROR_NOACCESS
,
"RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
ret
=
RegSetValueExW
(
hkey_main
,
NULL
,
0
,
REG_SZ
,
NULL
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %d
\n
"
,
ret
);
ret
=
RegSetValueExW
(
hkey_main
,
NULL
,
0
,
REG_DWORD
,
NULL
,
4
);
ok
(
ret
==
ERROR_NOACCESS
,
"RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d
\n
"
,
ret
,
GetLastError
());
ret
=
RegSetValueExW
(
hkey_main
,
NULL
,
0
,
REG_DWORD
,
NULL
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %d
\n
"
,
ret
);
}
/* RegSetKeyValue */
if
(
!
pRegSetKeyValueW
)
win_skip
(
"RegSetKeyValue() is not supported.
\n
"
);
...
...
@@ -464,6 +479,12 @@ static void test_set_value(void)
ret
=
pRegSetKeyValueW
(
hkey_main
,
subkeyW
,
name1W
,
REG_SZ
,
NULL
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %d
\n
"
,
ret
);
ret
=
pRegSetKeyValueW
(
hkey_main
,
subkeyW
,
name1W
,
REG_SZ
,
NULL
,
4
);
ok
(
ret
==
ERROR_NOACCESS
,
"got %d
\n
"
,
ret
);
ret
=
pRegSetKeyValueW
(
hkey_main
,
subkeyW
,
name1W
,
REG_DWORD
,
NULL
,
4
);
ok
(
ret
==
ERROR_NOACCESS
,
"got %d
\n
"
,
ret
);
RegCloseKey
(
subkey
);
}
}
...
...
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