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
e891be17
Commit
e891be17
authored
Oct 17, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return NULL key on NtCreateKey failure.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eeb4ed4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
reg.c
dlls/ntdll/reg.c
+3
-5
reg.c
dlls/ntdll/tests/reg.c
+11
-1
No files found.
dlls/ntdll/reg.c
View file @
e891be17
...
@@ -71,11 +71,9 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT
...
@@ -71,11 +71,9 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT
req
->
options
=
options
;
req
->
options
=
options
;
wine_server_add_data
(
req
,
objattr
,
len
);
wine_server_add_data
(
req
,
objattr
,
len
);
if
(
class
)
wine_server_add_data
(
req
,
class
->
Buffer
,
class
->
Length
);
if
(
class
)
wine_server_add_data
(
req
,
class
->
Buffer
,
class
->
Length
);
if
(
!
(
ret
=
wine_server_call
(
req
)))
ret
=
wine_server_call
(
req
);
{
*
retkey
=
wine_server_ptr_handle
(
reply
->
hkey
);
*
retkey
=
wine_server_ptr_handle
(
reply
->
hkey
);
if
(
dispos
&&
!
ret
)
*
dispos
=
reply
->
created
?
REG_CREATED_NEW_KEY
:
REG_OPENED_EXISTING_KEY
;
if
(
dispos
)
*
dispos
=
reply
->
created
?
REG_CREATED_NEW_KEY
:
REG_OPENED_EXISTING_KEY
;
}
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
...
...
dlls/ntdll/tests/reg.c
View file @
e891be17
...
@@ -364,16 +364,22 @@ static void test_NtOpenKey(void)
...
@@ -364,16 +364,22 @@ static void test_NtOpenKey(void)
/* Zero accessmask */
/* Zero accessmask */
attr
.
Length
=
sizeof
(
attr
);
attr
.
Length
=
sizeof
(
attr
);
key
=
(
HANDLE
)
0xdeadbeef
;
status
=
pNtOpenKey
(
&
key
,
0
,
&
attr
);
status
=
pNtOpenKey
(
&
key
,
0
,
&
attr
);
todo_wine
todo_wine
ok
(
status
==
STATUS_ACCESS_DENIED
,
"Expected STATUS_ACCESS_DENIED, got: 0x%08x
\n
"
,
status
);
ok
(
status
==
STATUS_ACCESS_DENIED
,
"Expected STATUS_ACCESS_DENIED, got: 0x%08x
\n
"
,
status
);
todo_wine
ok
(
!
key
,
"key = %p
\n
"
,
key
);
if
(
status
==
STATUS_SUCCESS
)
NtClose
(
key
);
if
(
status
==
STATUS_SUCCESS
)
NtClose
(
key
);
/* Calling without parent key requres full registry path. */
/* Calling without parent key requres full registry path. */
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
"Machine"
);
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
"Machine"
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
0
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
0
);
key
=
(
HANDLE
)
0xdeadbeef
;
status
=
pNtOpenKey
(
&
key
,
KEY_READ
,
&
attr
);
status
=
pNtOpenKey
(
&
key
,
KEY_READ
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_OBJECT_PATH_SYNTAX_BAD
,
"NtOpenKey Failed: 0x%08x
\n
"
,
status
);
todo_wine
ok
(
status
==
STATUS_OBJECT_PATH_SYNTAX_BAD
,
"NtOpenKey Failed: 0x%08x
\n
"
,
status
);
todo_wine
ok
(
!
key
,
"key = %p
\n
"
,
key
);
pRtlFreeUnicodeString
(
&
str
);
pRtlFreeUnicodeString
(
&
str
);
/* Open is case sensitive unless OBJ_CASE_INSENSITIVE is specified. */
/* Open is case sensitive unless OBJ_CASE_INSENSITIVE is specified. */
...
@@ -1070,8 +1076,10 @@ static void test_symlinks(void)
...
@@ -1070,8 +1076,10 @@ static void test_symlinks(void)
/* try opening the target through the link */
/* try opening the target through the link */
attr
.
ObjectName
=
&
link_str
;
attr
.
ObjectName
=
&
link_str
;
key
=
(
HANDLE
)
0xdeadbeef
;
status
=
pNtOpenKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
);
status
=
pNtOpenKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"NtOpenKey wrong status 0x%08x
\n
"
,
status
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"NtOpenKey wrong status 0x%08x
\n
"
,
status
);
ok
(
!
key
,
"key = %p
\n
"
,
key
);
attr
.
ObjectName
=
&
target_str
;
attr
.
ObjectName
=
&
target_str
;
status
=
pNtCreateKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
0
,
0
,
0
);
status
=
pNtCreateKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
0
,
0
,
0
);
...
@@ -1271,8 +1279,10 @@ static void test_symlinks(void)
...
@@ -1271,8 +1279,10 @@ static void test_symlinks(void)
ok
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
ok
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"NtOpenKey wrong status 0x%08x
\n
"
,
status
);
"NtOpenKey wrong status 0x%08x
\n
"
,
status
);
status
=
pNtCreateKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
0
,
REG_OPTION_CREATE_LINK
,
0
);
key
=
(
HKEY
)
0xdeadbeef
;
status
=
pNtCreateKey
(
&
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
0
,
REG_OPTION_CREATE_LINK
,
NULL
);
ok
(
status
==
STATUS_OBJECT_NAME_COLLISION
,
"NtCreateKey failed: 0x%08x
\n
"
,
status
);
ok
(
status
==
STATUS_OBJECT_NAME_COLLISION
,
"NtCreateKey failed: 0x%08x
\n
"
,
status
);
ok
(
!
key
,
"key = %p
\n
"
,
key
);
status
=
pNtDeleteKey
(
link
);
status
=
pNtDeleteKey
(
link
);
ok
(
status
==
STATUS_SUCCESS
,
"NtDeleteKey failed: 0x%08x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"NtDeleteKey failed: 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