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
8a42a8c1
Commit
8a42a8c1
authored
Jun 30, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix return codes for NtCreateKey (with tests).
parent
ad064915
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
reg.c
dlls/ntdll/reg.c
+2
-1
reg.c
dlls/ntdll/tests/reg.c
+28
-0
No files found.
dlls/ntdll/reg.c
View file @
8a42a8c1
...
...
@@ -58,8 +58,9 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT
TRACE
(
"(%p,%s,%s,%lx,%lx,%p)
\n
"
,
attr
->
RootDirectory
,
debugstr_us
(
attr
->
ObjectName
),
debugstr_us
(
class
),
options
,
access
,
retkey
);
if
(
!
retkey
||
!
attr
)
return
STATUS_ACCESS_VIOLATION
;
if
(
attr
->
Length
>
sizeof
(
OBJECT_ATTRIBUTES
))
return
STATUS_INVALID_PARAMETER
;
if
(
attr
->
ObjectName
->
Length
>
MAX_NAME_LENGTH
)
return
STATUS_BUFFER_OVERFLOW
;
if
(
!
retkey
)
return
STATUS_INVALID_PARAMETER
;
SERVER_START_REQ
(
create_key
)
{
...
...
dlls/ntdll/tests/reg.c
View file @
8a42a8c1
...
...
@@ -298,10 +298,38 @@ static void test_NtCreateKey(void)
ACCESS_MASK
am
=
GENERIC_ALL
;
NTSTATUS
status
;
/* All NULL */
status
=
pNtCreateKey
(
NULL
,
0
,
NULL
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx
\n
"
,
status
);
/* Only the key */
status
=
pNtCreateKey
(
&
key
,
0
,
NULL
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
/* W2K3/XP/W2K */
||
status
==
STATUS_INVALID_PARAMETER
/* NT4 */
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08lx
\n
"
,
status
);
/* Only accessmask */
status
=
pNtCreateKey
(
NULL
,
am
,
NULL
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx
\n
"
,
status
);
/* Key and accessmask */
status
=
pNtCreateKey
(
&
key
,
am
,
NULL
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
/* W2K3/XP/W2K */
||
status
==
STATUS_INVALID_PARAMETER
/* NT4 */
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08lx
\n
"
,
status
);
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
/* Only attributes */
status
=
pNtCreateKey
(
NULL
,
0
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx
\n
"
,
status
);
status
=
pNtCreateKey
(
&
key
,
am
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateKey Failed: 0x%08lx
\n
"
,
status
);
/* Length > sizeof(OBJECT_ATTRIBUTES) */
attr
.
Length
*=
2
;
status
=
pNtCreateKey
(
&
key
,
am
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got: 0x%08lx
\n
"
,
status
);
pNtClose
(
&
key
);
}
...
...
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