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
0e98500e
Commit
0e98500e
authored
Feb 16, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix the return value of NtOpenKey for some invalid parameters.
parent
2530304f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
registry.c
dlls/advapi32/registry.c
+1
-0
reg.c
dlls/ntdll/reg.c
+2
-2
reg.c
dlls/ntdll/tests/reg.c
+0
-2
No files found.
dlls/advapi32/registry.c
View file @
0e98500e
...
...
@@ -311,6 +311,7 @@ LSTATUS WINAPI RegOpenKeyExW( HKEY hkey, LPCWSTR name, DWORD options, REGSAM acc
/* NT+ allows beginning backslash for HKEY_CLASSES_ROOT */
if
(
hkey
==
HKEY_CLASSES_ROOT
&&
name
&&
*
name
==
'\\'
)
name
++
;
if
(
!
retkey
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
attr
.
Length
=
sizeof
(
attr
);
...
...
dlls/ntdll/reg.c
View file @
0e98500e
...
...
@@ -116,13 +116,13 @@ NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTR
NTSTATUS
ret
;
DWORD
len
;
if
(
!
attr
)
return
STATUS_ACCESS_VIOLATION
;
if
(
!
retkey
||
!
attr
)
return
STATUS_ACCESS_VIOLATION
;
if
(
attr
->
Length
>
sizeof
(
OBJECT_ATTRIBUTES
))
return
STATUS_INVALID_PARAMETER
;
len
=
attr
->
ObjectName
->
Length
;
TRACE
(
"(%p,%s,%x,%p)
\n
"
,
attr
->
RootDirectory
,
debugstr_us
(
attr
->
ObjectName
),
access
,
retkey
);
if
(
len
>
MAX_NAME_LENGTH
)
return
STATUS_BUFFER_OVERFLOW
;
if
(
!
retkey
)
return
STATUS_INVALID_PARAMETER
;
SERVER_START_REQ
(
open_key
)
{
...
...
dlls/ntdll/tests/reg.c
View file @
0e98500e
...
...
@@ -351,13 +351,11 @@ static void test_NtOpenKey(void)
/* NULL key */
status
=
pNtOpenKey
(
NULL
,
am
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got: 0x%08x
\n
"
,
status
);
/* Length > sizeof(OBJECT_ATTRIBUTES) */
attr
.
Length
*=
2
;
status
=
pNtOpenKey
(
&
key
,
am
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got: 0x%08x
\n
"
,
status
);
}
...
...
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