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
eea911a5
Commit
eea911a5
authored
Jun 14, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl/tests: Add initial test for WSK listen socket.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
136d4603
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
driver4.c
dlls/ntoskrnl.exe/tests/driver4.c
+51
-0
No files found.
dlls/ntoskrnl.exe/tests/driver4.c
View file @
eea911a5
...
...
@@ -163,6 +163,56 @@ static void test_wsk_get_address_info(void)
provider_npi
.
Dispatch
->
WskFreeAddressInfo
(
provider_npi
.
Client
,
result
);
}
struct
socket_context
{
};
static
void
test_wsk_listen_socket
(
void
)
{
static
const
WSK_CLIENT_LISTEN_DISPATCH
client_listen_dispatch
;
const
WSK_PROVIDER_LISTEN_DISPATCH
*
dispatch
;
struct
socket_context
context
;
NTSTATUS
status
;
WSK_SOCKET
*
s
;
status
=
provider_npi
.
Dispatch
->
WskSocket
(
NULL
,
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
WSK_FLAG_LISTEN_SOCKET
,
&
context
,
&
client_listen_dispatch
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Got unexpected status %#x.
\n
"
,
status
);
IoReuseIrp
(
wsk_irp
,
STATUS_UNSUCCESSFUL
);
IoSetCompletionRoutine
(
wsk_irp
,
irp_completion_routine
,
&
irp_complete_event
,
TRUE
,
TRUE
,
TRUE
);
status
=
provider_npi
.
Dispatch
->
WskSocket
(
NULL
,
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
WSK_FLAG_LISTEN_SOCKET
,
&
context
,
&
client_listen_dispatch
,
NULL
,
NULL
,
NULL
,
wsk_irp
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Got unexpected status %#x.
\n
"
,
status
);
IoReuseIrp
(
wsk_irp
,
STATUS_UNSUCCESSFUL
);
IoSetCompletionRoutine
(
wsk_irp
,
irp_completion_routine
,
&
irp_complete_event
,
TRUE
,
TRUE
,
TRUE
);
wsk_irp
->
IoStatus
.
Status
=
0xdeadbeef
;
wsk_irp
->
IoStatus
.
Information
=
0xdeadbeef
;
status
=
provider_npi
.
Dispatch
->
WskSocket
(
provider_npi
.
Client
,
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
WSK_FLAG_LISTEN_SOCKET
,
&
context
,
&
client_listen_dispatch
,
NULL
,
NULL
,
NULL
,
wsk_irp
);
ok
(
status
==
STATUS_PENDING
,
"Got unexpected status %#x.
\n
"
,
status
);
status
=
KeWaitForSingleObject
(
&
irp_complete_event
,
Executive
,
KernelMode
,
FALSE
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#x.
\n
"
,
status
);
ok
(
wsk_irp
->
IoStatus
.
Status
==
STATUS_SUCCESS
,
"Got unexpected status %#x.
\n
"
,
wsk_irp
->
IoStatus
.
Status
);
ok
(
wsk_irp
->
IoStatus
.
Information
,
"Got zero Information.
\n
"
);
s
=
(
WSK_SOCKET
*
)
wsk_irp
->
IoStatus
.
Information
;
dispatch
=
s
->
Dispatch
;
IoReuseIrp
(
wsk_irp
,
STATUS_UNSUCCESSFUL
);
IoSetCompletionRoutine
(
wsk_irp
,
irp_completion_routine
,
&
irp_complete_event
,
TRUE
,
TRUE
,
TRUE
);
wsk_irp
->
IoStatus
.
Status
=
0xdeadbeef
;
wsk_irp
->
IoStatus
.
Information
=
0xdeadbeef
;
status
=
dispatch
->
Basic
.
WskCloseSocket
(
s
,
wsk_irp
);
ok
(
status
==
STATUS_PENDING
,
"Got unexpected status %#x.
\n
"
,
status
);
status
=
KeWaitForSingleObject
(
&
irp_complete_event
,
Executive
,
KernelMode
,
FALSE
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#x.
\n
"
,
status
);
ok
(
wsk_irp
->
IoStatus
.
Status
==
STATUS_SUCCESS
,
"Got unexpected status %#x.
\n
"
,
wsk_irp
->
IoStatus
.
Status
);
ok
(
!
wsk_irp
->
IoStatus
.
Information
,
"Got unexpected Information %#lx.
\n
"
,
wsk_irp
->
IoStatus
.
Information
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
{
ULONG
length
=
stack
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
...
...
@@ -188,6 +238,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
netio_init
();
test_wsk_get_address_info
();
test_wsk_listen_socket
();
if
(
winetest_debug
)
{
...
...
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