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
7a7fc1e6
Commit
7a7fc1e6
authored
Jun 02, 2015
by
Qian Hong
Committed by
Alexandre Julliard
Jun 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add a few more ObjectTypeInformation tests.
parent
71080cc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
1 deletion
+67
-1
om.c
dlls/ntdll/tests/om.c
+67
-1
No files found.
dlls/ntdll/tests/om.c
View file @
7a7fc1e6
...
...
@@ -54,6 +54,7 @@ static NTSTATUS (WINAPI *pNtCreateKeyedEvent)( HANDLE *, ACCESS_MASK, const OBJE
static
NTSTATUS
(
WINAPI
*
pNtOpenKeyedEvent
)(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
);
static
NTSTATUS
(
WINAPI
*
pNtWaitForKeyedEvent
)(
HANDLE
,
const
void
*
,
BOOLEAN
,
const
LARGE_INTEGER
*
);
static
NTSTATUS
(
WINAPI
*
pNtReleaseKeyedEvent
)(
HANDLE
,
const
void
*
,
BOOLEAN
,
const
LARGE_INTEGER
*
);
static
NTSTATUS
(
WINAPI
*
pNtCreateIoCompletion
)(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
,
ULONG
);
#define KEYEDEVENT_WAIT 0x0001
#define KEYEDEVENT_WAKE 0x0002
...
...
@@ -674,12 +675,16 @@ static void test_query_object(void)
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'_'
,
'e'
,
'v'
,
'e'
,
'n'
,
't'
};
static
const
WCHAR
type_event
[]
=
{
'E'
,
'v'
,
'e'
,
'n'
,
't'
};
static
const
WCHAR
type_file
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
};
static
const
WCHAR
type_iocompletion
[]
=
{
'I'
,
'o'
,
'C'
,
'o'
,
'm'
,
'p'
,
'l'
,
'e'
,
't'
,
'i'
,
'o'
,
'n'
};
static
const
WCHAR
type_directory
[]
=
{
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
};
static
const
WCHAR
type_section
[]
=
{
'S'
,
'e'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
};
HANDLE
handle
;
char
buffer
[
1024
];
NTSTATUS
status
;
ULONG
len
,
expected_len
;
UNICODE_STRING
*
str
;
char
dir
[
MAX_PATH
];
char
dir
[
MAX_PATH
],
tmp_path
[
MAX_PATH
],
file1
[
MAX_PATH
+
16
];
LARGE_INTEGER
size
;
handle
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
"test_event"
);
...
...
@@ -786,6 +791,66 @@ static void test_query_object(void)
"wrong/bad type name %s (%p)
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
str
->
Buffer
);
pNtClose
(
handle
);
GetTempPathA
(
MAX_PATH
,
tmp_path
);
GetTempFileNameA
(
tmp_path
,
"foo"
,
0
,
file1
);
handle
=
CreateFileA
(
file1
,
GENERIC_WRITE
|
DELETE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
len
=
0
;
memset
(
buffer
,
0
,
sizeof
(
buffer
)
);
status
=
pNtQueryObject
(
handle
,
ObjectTypeInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
todo_wine
ok
(
len
>
sizeof
(
OBJECT_TYPE_INFORMATION
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
OBJECT_TYPE_INFORMATION
)
+
str
->
Length
+
sizeof
(
WCHAR
);
todo_wine
ok
(
len
>=
expected_len
,
"unexpected len %u
\n
"
,
len
);
todo_wine
ok
(
str
->
Buffer
&&
!
memcmp
(
str
->
Buffer
,
type_file
,
sizeof
(
type_file
)
),
"wrong/bad type name %s (%p)
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
str
->
Buffer
);
DeleteFileA
(
file1
);
pNtClose
(
handle
);
status
=
pNtCreateIoCompletion
(
&
handle
,
IO_COMPLETION_ALL_ACCESS
,
NULL
,
0
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateIoCompletion failed %x
\n
"
,
status
);
len
=
0
;
memset
(
buffer
,
0
,
sizeof
(
buffer
)
);
status
=
pNtQueryObject
(
handle
,
ObjectTypeInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
>
sizeof
(
OBJECT_TYPE_INFORMATION
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
OBJECT_TYPE_INFORMATION
)
+
str
->
Length
+
sizeof
(
WCHAR
);
ok
(
len
>=
expected_len
,
"unexpected len %u
\n
"
,
len
);
todo_wine
ok
(
str
->
Buffer
&&
!
memcmp
(
str
->
Buffer
,
type_iocompletion
,
sizeof
(
type_iocompletion
)
),
"wrong/bad type name %s (%p)
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
str
->
Buffer
);
pNtClose
(
handle
);
status
=
pNtCreateDirectoryObject
(
&
handle
,
DIRECTORY_QUERY
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Failed to create Directory %08x
\n
"
,
status
);
len
=
0
;
memset
(
buffer
,
0
,
sizeof
(
buffer
)
);
status
=
pNtQueryObject
(
handle
,
ObjectTypeInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
>
sizeof
(
OBJECT_TYPE_INFORMATION
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
OBJECT_TYPE_INFORMATION
)
+
str
->
Length
+
sizeof
(
WCHAR
);
ok
(
len
>=
expected_len
,
"unexpected len %u
\n
"
,
len
);
ok
(
str
->
Buffer
&&
!
memcmp
(
str
->
Buffer
,
type_directory
,
sizeof
(
type_directory
)
),
"wrong/bad type name %s (%p)
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
str
->
Buffer
);
pNtClose
(
handle
);
size
.
u
.
LowPart
=
256
;
size
.
u
.
HighPart
=
0
;
status
=
pNtCreateSection
(
&
handle
,
SECTION_MAP_WRITE
,
NULL
,
&
size
,
PAGE_READWRITE
,
SEC_COMMIT
,
0
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection returned %x
\n
"
,
status
);
len
=
0
;
memset
(
buffer
,
0
,
sizeof
(
buffer
)
);
status
=
pNtQueryObject
(
handle
,
ObjectTypeInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
>
sizeof
(
OBJECT_TYPE_INFORMATION
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
expected_len
=
sizeof
(
OBJECT_TYPE_INFORMATION
)
+
str
->
Length
+
sizeof
(
WCHAR
);
ok
(
len
>=
expected_len
,
"unexpected len %u
\n
"
,
len
);
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
);
}
static
void
test_type_mismatch
(
void
)
...
...
@@ -1164,6 +1229,7 @@ START_TEST(om)
pNtOpenKeyedEvent
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtOpenKeyedEvent"
);
pNtWaitForKeyedEvent
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtWaitForKeyedEvent"
);
pNtReleaseKeyedEvent
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtReleaseKeyedEvent"
);
pNtCreateIoCompletion
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtCreateIoCompletion"
);
test_case_sensitive
();
test_namespace_pipe
();
...
...
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