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
689c45b9
Commit
689c45b9
authored
Sep 15, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Do not return STATUS_SUCCESS on failure in NtQueryObject().
parent
6dc12cdb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
om.c
dlls/ntdll/om.c
+5
-3
om.c
dlls/ntdll/tests/om.c
+19
-3
No files found.
dlls/ntdll/om.c
View file @
689c45b9
...
...
@@ -95,18 +95,20 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
if
(
!
(
status
=
server_get_unix_name
(
handle
,
&
unix_name
)))
{
UNICODE_STRING
nt_name
;
NTSTATUS
status
;
if
(
!
(
status
=
wine_unix_to_nt_file_name
(
&
unix_name
,
&
nt_name
)))
{
if
(
sizeof
(
*
p
)
+
nt_name
.
MaximumLength
<=
len
)
if
(
len
<
sizeof
(
*
p
))
status
=
STATUS_INFO_LENGTH_MISMATCH
;
else
if
(
len
<
sizeof
(
*
p
)
+
nt_name
.
MaximumLength
)
status
=
STATUS_BUFFER_OVERFLOW
;
else
{
p
->
Name
.
Buffer
=
(
WCHAR
*
)(
p
+
1
);
p
->
Name
.
Length
=
nt_name
.
Length
;
p
->
Name
.
MaximumLength
=
nt_name
.
MaximumLength
;
memcpy
(
p
->
Name
.
Buffer
,
nt_name
.
Buffer
,
nt_name
.
MaximumLength
);
}
else
status
=
STATUS_INFO_LENGTH_MISMATCH
;
if
(
used_len
)
*
used_len
=
sizeof
(
*
p
)
+
nt_name
.
MaximumLength
;
RtlFreeUnicodeString
(
&
nt_name
);
}
...
...
dlls/ntdll/tests/om.c
View file @
689c45b9
...
...
@@ -661,7 +661,7 @@ static void test_query_object(void)
HANDLE
handle
;
char
buffer
[
1024
];
NTSTATUS
status
;
ULONG
len
;
ULONG
len
,
expected_len
;
UNICODE_STRING
*
str
;
char
dir
[
MAX_PATH
];
...
...
@@ -713,10 +713,26 @@ static void test_query_object(void)
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
>
sizeof
(
UNICODE_STRING
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
ok
(
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
)
==
len
||
broken
(
sizeof
(
UNICODE_STRING
)
+
str
->
Length
==
len
),
/* NT4 */
expected_len
=
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
);
ok
(
len
==
expected_len
||
broken
(
len
==
expected_len
-
sizeof
(
WCHAR
)
),
/* NT4 */
"unexpected len %u
\n
"
,
len
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
0
,
&
len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
||
broken
(
status
==
STATUS_INSUFFICIENT_RESOURCES
),
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
==
expected_len
||
broken
(
!
len
||
len
==
sizeof
(
UNICODE_STRING
)),
"unexpected len %u
\n
"
,
len
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
sizeof
(
UNICODE_STRING
),
&
len
);
ok
(
status
==
STATUS_BUFFER_OVERFLOW
||
broken
(
status
==
STATUS_INSUFFICIENT_RESOURCES
||
status
==
STATUS_INFO_LENGTH_MISMATCH
),
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
==
expected_len
||
broken
(
!
len
),
"unexpected len %u
\n
"
,
len
);
pNtClose
(
handle
);
}
...
...
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