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
abeb60f0
Commit
abeb60f0
authored
Jan 26, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add some more tests for kernel object names.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2142bde3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
1 deletion
+65
-1
om.c
dlls/ntdll/tests/om.c
+65
-1
No files found.
dlls/ntdll/tests/om.c
View file @
abeb60f0
...
...
@@ -884,10 +884,13 @@ static void test_query_object(void)
char
buffer
[
1024
];
NTSTATUS
status
;
ULONG
len
,
expected_len
;
UNICODE_STRING
*
str
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
path
,
*
str
;
char
dir
[
MAX_PATH
],
tmp_path
[
MAX_PATH
],
file1
[
MAX_PATH
+
16
];
LARGE_INTEGER
size
;
InitializeObjectAttributes
(
&
attr
,
&
path
,
0
,
0
,
0
);
handle
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
"test_event"
);
len
=
0
;
...
...
@@ -917,9 +920,12 @@ static void test_query_object(void)
str
=
(
UNICODE_STRING
*
)
buffer
;
ok
(
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
)
==
len
,
"unexpected len %u
\n
"
,
len
);
ok
(
str
->
Length
>=
sizeof
(
name
),
"unexpected len %u
\n
"
,
str
->
Length
);
ok
(
len
>
sizeof
(
UNICODE_STRING
)
+
sizeof
(
"
\\
test_event"
)
*
sizeof
(
WCHAR
),
"name too short %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
/* there can be a \\Sessions prefix in the name */
ok
(
!
memcmp
(
str
->
Buffer
+
(
str
->
Length
-
sizeof
(
name
))
/
sizeof
(
WCHAR
),
name
,
sizeof
(
name
)
),
"wrong name %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
len
-=
sizeof
(
WCHAR
);
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
len
,
&
len
);
...
...
@@ -1053,6 +1059,64 @@ static void test_query_object(void)
ok
(
str
->
Buffer
&&
!
memcmp
(
str
->
Buffer
,
type_section
,
sizeof
(
type_section
)
),
"wrong/bad type name %s (%p)
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
str
->
Buffer
);
pNtClose
(
handle
);
handle
=
CreateMailslotA
(
"
\\\\
.
\\
mailslot
\\
test_mailslot"
,
100
,
1000
,
NULL
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateMailslot failed err %u
\n
"
,
GetLastError
()
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject returned %x
\n
"
,
status
);
str
=
(
UNICODE_STRING
*
)
buffer
;
ok
(
len
>
sizeof
(
UNICODE_STRING
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
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
);
todo_wine
ok
(
len
>
sizeof
(
UNICODE_STRING
)
+
sizeof
(
"
\\
test_mailslot"
)
*
sizeof
(
WCHAR
),
"name too short %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
pNtClose
(
handle
);
handle
=
CreateNamedPipeA
(
"
\\\\
.
\\
pipe
\\
test_pipe"
,
PIPE_ACCESS_DUPLEX
,
PIPE_READMODE_BYTE
,
1
,
1000
,
1000
,
1000
,
NULL
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed err %u
\n
"
,
GetLastError
()
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject returned %x
\n
"
,
status
);
str
=
(
UNICODE_STRING
*
)
buffer
;
todo_wine
ok
(
len
>
sizeof
(
UNICODE_STRING
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
);
todo_wine
ok
(
len
==
expected_len
||
broken
(
len
==
expected_len
-
sizeof
(
WCHAR
)),
/* NT4 */
"unexpected len %u
\n
"
,
len
);
todo_wine
ok
(
len
>
sizeof
(
UNICODE_STRING
)
+
sizeof
(
"
\\
test_pipe"
)
*
sizeof
(
WCHAR
),
"name too short %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
pNtClose
(
handle
);
pRtlCreateUnicodeStringFromAsciiz
(
&
path
,
"
\\
REGISTRY
\\
Machine
\\
Software
\\
Classes"
);
status
=
pNtCreateKey
(
&
handle
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
handle
!=
0
,
"NtCreateKey failed status %x
\n
"
,
status
);
pRtlFreeUnicodeString
(
&
path
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject returned %x
\n
"
,
status
);
str
=
(
UNICODE_STRING
*
)
buffer
;
todo_wine
ok
(
len
>
sizeof
(
UNICODE_STRING
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
);
todo_wine
ok
(
len
==
expected_len
||
broken
(
len
==
expected_len
-
sizeof
(
WCHAR
)),
/* NT4 */
"unexpected len %u
\n
"
,
len
);
todo_wine
ok
(
len
>
sizeof
(
UNICODE_STRING
)
+
sizeof
(
"
\\
Classes"
)
*
sizeof
(
WCHAR
),
"name too short %s
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
)
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
pNtClose
(
handle
);
}
static
void
test_type_mismatch
(
void
)
...
...
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