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
0ca3b3b4
Commit
0ca3b3b4
authored
Jun 28, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Check the output pointer first in RegOpenKey, with test.
parent
5a91cffc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
registry.c
dlls/advapi32/registry.c
+7
-1
registry.c
dlls/advapi32/tests/registry.c
+9
-0
No files found.
dlls/advapi32/registry.c
View file @
0ca3b3b4
...
...
@@ -381,6 +381,9 @@ LSTATUS WINAPI RegOpenKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, REGSAM acc
*/
LSTATUS
WINAPI
RegOpenKeyW
(
HKEY
hkey
,
LPCWSTR
name
,
PHKEY
retkey
)
{
if
(
!
retkey
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
name
||
!*
name
)
{
*
retkey
=
hkey
;
...
...
@@ -402,10 +405,13 @@ LSTATUS WINAPI RegOpenKeyW( HKEY hkey, LPCWSTR name, PHKEY retkey )
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: A standard Win32 error code. retkey is set to 0.
* Failure: A standard Win32 error code.
When retkey is valid, *
retkey is set to 0.
*/
LSTATUS
WINAPI
RegOpenKeyA
(
HKEY
hkey
,
LPCSTR
name
,
PHKEY
retkey
)
{
if
(
!
retkey
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
name
||
!*
name
)
{
*
retkey
=
hkey
;
...
...
dlls/advapi32/tests/registry.c
View file @
0ca3b3b4
...
...
@@ -956,9 +956,18 @@ static void test_reg_open_key(void)
RegCloseKey
(
hkResult
);
/* send in NULL hkResult */
SetLastError
(
0xdeadbeef
);
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
RegOpenKeyA
(
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
ret
);
/* beginning backslash character */
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"
\\
Software
\\
Wine
\\
Test"
,
&
hkResult
);
ok
(
ret
==
ERROR_BAD_PATHNAME
||
/* NT/2k/XP */
...
...
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