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
4e4a1098
Commit
4e4a1098
authored
May 07, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add more overlapped tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5ff326f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
6 deletions
+39
-6
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+39
-6
No files found.
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
4e4a1098
...
@@ -35,6 +35,7 @@ static HANDLE device;
...
@@ -35,6 +35,7 @@ static HANDLE device;
static
BOOL
(
WINAPI
*
pRtlDosPathNameToNtPathName_U
)(
const
WCHAR
*
,
UNICODE_STRING
*
,
WCHAR
**
,
CURDIR
*
);
static
BOOL
(
WINAPI
*
pRtlDosPathNameToNtPathName_U
)(
const
WCHAR
*
,
UNICODE_STRING
*
,
WCHAR
**
,
CURDIR
*
);
static
BOOL
(
WINAPI
*
pRtlFreeUnicodeString
)(
UNICODE_STRING
*
);
static
BOOL
(
WINAPI
*
pRtlFreeUnicodeString
)(
UNICODE_STRING
*
);
static
BOOL
(
WINAPI
*
pCancelIoEx
)(
HANDLE
,
OVERLAPPED
*
);
static
BOOL
(
WINAPI
*
pCancelIoEx
)(
HANDLE
,
OVERLAPPED
*
);
static
BOOL
(
WINAPI
*
pSetFileCompletionNotificationModes
)(
HANDLE
,
UCHAR
);
static
void
load_resource
(
const
char
*
name
,
char
*
filename
)
static
void
load_resource
(
const
char
*
name
,
char
*
filename
)
{
{
...
@@ -198,17 +199,19 @@ static void test_basic_ioctl(void)
...
@@ -198,17 +199,19 @@ static void test_basic_ioctl(void)
ok
(
!
strcmp
(
buf
,
teststr
),
"got '%s'
\n
"
,
buf
);
ok
(
!
strcmp
(
buf
,
teststr
),
"got '%s'
\n
"
,
buf
);
}
}
static
void
test_
cancel_io
(
void
)
static
void
test_
overlapped
(
void
)
{
{
OVERLAPPED
overlapped
,
overlapped2
;
OVERLAPPED
overlapped
,
overlapped2
,
*
o
;
DWORD
cancel_cnt
;
DWORD
cancel_cnt
,
size
;
HANDLE
file
;
HANDLE
file
,
port
;
ULONG_PTR
key
;
BOOL
res
;
BOOL
res
;
overlapped
.
hEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
overlapped
.
hEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
overlapped2
.
hEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
overlapped2
.
hEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
file
=
CreateFileA
(
"
\\\\
.
\\
WineTestDriver"
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_OVERLAPPED
,
NULL
);
file
=
CreateFileA
(
"
\\\\
.
\\
WineTestDriver"
,
FILE_READ_ATTRIBUTES
|
FILE_WRITE_ATTRIBUTES
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_OVERLAPPED
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to open device: %u
\n
"
,
GetLastError
());
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to open device: %u
\n
"
,
GetLastError
());
/* test cancelling all device requests */
/* test cancelling all device requests */
...
@@ -275,6 +278,34 @@ static void test_cancel_io(void)
...
@@ -275,6 +278,34 @@ static void test_cancel_io(void)
ok
(
cancel_cnt
==
2
,
"cancel_cnt = %u
\n
"
,
cancel_cnt
);
ok
(
cancel_cnt
==
2
,
"cancel_cnt = %u
\n
"
,
cancel_cnt
);
}
}
port
=
CreateIoCompletionPort
(
file
,
NULL
,
0xdeadbeef
,
0
);
ok
(
port
!=
NULL
,
"CreateIoCompletionPort failed, error %u
\n
"
,
GetLastError
());
res
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
o
,
0
);
ok
(
!
res
&&
GetLastError
()
==
WAIT_TIMEOUT
,
"GetQueuedCompletionStatus returned %x(%u)
\n
"
,
res
,
GetLastError
());
res
=
DeviceIoControl
(
file
,
IOCTL_WINETEST_RESET_CANCEL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
&
overlapped
);
todo_wine
ok
(
res
,
"DeviceIoControl failed: %u
\n
"
,
GetLastError
());
if
(
!
res
&&
GetLastError
()
==
ERROR_IO_PENDING
)
WaitForSingleObject
(
overlapped
.
hEvent
,
INFINITE
);
res
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
o
,
0
);
ok
(
res
,
"GetQueuedCompletionStatus failed: %u
\n
"
,
GetLastError
());
ok
(
o
==
&
overlapped
,
"o != overlapped
\n
"
);
if
(
pSetFileCompletionNotificationModes
)
{
res
=
pSetFileCompletionNotificationModes
(
file
,
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
);
ok
(
res
,
"SetFileCompletionNotificationModes failed: %u
\n
"
,
GetLastError
());
res
=
DeviceIoControl
(
file
,
IOCTL_WINETEST_RESET_CANCEL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
&
overlapped
);
todo_wine
ok
(
res
,
"DeviceIoControl failed: %u
\n
"
,
GetLastError
());
if
(
!
res
&&
GetLastError
()
==
ERROR_IO_PENDING
)
WaitForSingleObject
(
overlapped
.
hEvent
,
INFINITE
);
res
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
o
,
0
);
todo_wine
ok
(
!
res
&&
GetLastError
()
==
WAIT_TIMEOUT
,
"GetQueuedCompletionStatus returned %x(%u)
\n
"
,
res
,
GetLastError
());
}
CloseHandle
(
port
);
CloseHandle
(
overlapped
.
hEvent
);
CloseHandle
(
overlapped
.
hEvent
);
CloseHandle
(
overlapped2
.
hEvent
);
CloseHandle
(
overlapped2
.
hEvent
);
CloseHandle
(
file
);
CloseHandle
(
file
);
...
@@ -337,6 +368,8 @@ START_TEST(ntoskrnl)
...
@@ -337,6 +368,8 @@ START_TEST(ntoskrnl)
pRtlDosPathNameToNtPathName_U
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlDosPathNameToNtPathName_U"
);
pRtlDosPathNameToNtPathName_U
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlDosPathNameToNtPathName_U"
);
pRtlFreeUnicodeString
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlFreeUnicodeString"
);
pRtlFreeUnicodeString
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlFreeUnicodeString"
);
pCancelIoEx
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"CancelIoEx"
);
pCancelIoEx
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"CancelIoEx"
);
pSetFileCompletionNotificationModes
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"SetFileCompletionNotificationModes"
);
if
(
!
(
service
=
load_driver
(
filename
,
"driver.dll"
,
"WineTestDriver"
)))
if
(
!
(
service
=
load_driver
(
filename
,
"driver.dll"
,
"WineTestDriver"
)))
return
;
return
;
...
@@ -352,7 +385,7 @@ START_TEST(ntoskrnl)
...
@@ -352,7 +385,7 @@ START_TEST(ntoskrnl)
test_basic_ioctl
();
test_basic_ioctl
();
main_test
();
main_test
();
test_
cancel_io
();
test_
overlapped
();
test_load_driver
(
service2
);
test_load_driver
(
service2
);
unload_driver
(
service2
);
unload_driver
(
service2
);
...
...
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