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
89e1cf3d
Commit
89e1cf3d
authored
May 18, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use IOCTL_AFD_WINE_SHUTDOWN in WS2_DisconnectEx().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e68f41e4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
27 deletions
+31
-27
socket.c
dlls/ws2_32/socket.c
+20
-9
sock.c
dlls/ws2_32/tests/sock.c
+11
-18
No files found.
dlls/ws2_32/socket.c
View file @
89e1cf3d
...
...
@@ -3110,23 +3110,34 @@ static BOOL WINAPI WS2_ConnectEx( SOCKET s, const struct WS_sockaddr *name, int
return
!
status
;
}
/***********************************************************************
* DisconnectEx
*/
static
BOOL
WINAPI
WS2_DisconnectEx
(
SOCKET
s
,
LPOVERLAPPED
ov
,
DWORD
flags
,
DWORD
reserved
)
static
BOOL
WINAPI
WS2_DisconnectEx
(
SOCKET
s
,
OVERLAPPED
*
overlapped
,
DWORD
flags
,
DWORD
reserved
)
{
TRACE
(
"socket %04lx, ov %p, flags 0x%x, reserved 0x%x
\n
"
,
s
,
ov
,
flags
,
reserved
);
IO_STATUS_BLOCK
iosb
,
*
piosb
=
&
iosb
;
void
*
cvalue
=
NULL
;
int
how
=
SD_SEND
;
HANDLE
event
=
0
;
NTSTATUS
status
;
TRACE
(
"socket %#lx, overlapped %p, flags %#x, reserved %#x
\n
"
,
s
,
overlapped
,
flags
,
reserved
);
if
(
flags
&
TF_REUSE_SOCKET
)
FIXME
(
"Reusing socket not supported yet
\n
"
);
if
(
ov
)
if
(
ov
erlapped
)
{
ov
->
Internal
=
STATUS_PENDING
;
ov
->
InternalHigh
=
0
;
piosb
=
(
IO_STATUS_BLOCK
*
)
overlapped
;
if
(
!
((
ULONG_PTR
)
overlapped
->
hEvent
&
1
))
cvalue
=
overlapped
;
event
=
overlapped
->
hEvent
;
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
0
;
}
return
!
WS_shutdown
(
s
,
SD_BOTH
);
status
=
NtDeviceIoControlFile
(
(
HANDLE
)
s
,
event
,
NULL
,
cvalue
,
piosb
,
IOCTL_AFD_WINE_SHUTDOWN
,
&
how
,
sizeof
(
how
),
NULL
,
0
);
if
(
!
status
&&
overlapped
)
status
=
STATUS_PENDING
;
SetLastError
(
NtStatusToWSAError
(
status
)
);
return
!
status
;
}
/***********************************************************************
...
...
dlls/ws2_32/tests/sock.c
View file @
89e1cf3d
...
...
@@ -6732,7 +6732,7 @@ static void test_DisconnectEx(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
pDisconnectEx
(
client
,
&
overlapped
,
0
,
0
);
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAENOTCONN
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
WSAGetLastError
()
==
WSAENOTCONN
,
"got error %u
\n
"
,
WSAGetLastError
());
ret
=
connect
(
client
,
(
struct
sockaddr
*
)
&
server_addr
,
sizeof
(
server_addr
));
ok
(
!
ret
,
"failed to connect, error %u
\n
"
,
WSAGetLastError
());
...
...
@@ -6741,18 +6741,15 @@ static void test_DisconnectEx(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
pDisconnectEx
(
client
,
&
overlapped
,
0
,
0
);
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
WSAGetLastError
());
if
(
WSAGetLastError
()
==
ERROR_IO_PENDING
)
{
ret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
1000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
size
=
0xdeadbeef
;
ret
=
GetOverlappedResult
((
HANDLE
)
client
,
&
overlapped
,
&
size
,
FALSE
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!
size
,
"got size %u
\n
"
,
size
);
}
ret
=
connect
(
client
,
(
struct
sockaddr
*
)
&
server_addr
,
sizeof
(
server_addr
));
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
...
...
@@ -6805,8 +6802,8 @@ static void test_DisconnectEx(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
pDisconnectEx
(
client
,
NULL
,
0
,
0
);
todo_wine
ok
(
ret
,
"expected success
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
()
||
WSAGetLastError
()
==
0xdeadbeef
/* < 7 */
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
ret
,
"expected success
\n
"
);
ok
(
!
WSAGetLastError
()
||
WSAGetLastError
()
==
0xdeadbeef
/* < 7 */
,
"got error %u
\n
"
,
WSAGetLastError
());
ret
=
connect
(
client
,
(
struct
sockaddr
*
)
&
server_addr
,
sizeof
(
server_addr
));
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
...
...
@@ -8552,10 +8549,9 @@ static void test_shutdown_completion_port(void)
SetLastError
(
0xdeadbeef
);
ret
=
pDisconnectEx
(
client
,
&
overlapped
,
0
,
0
);
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
GetLastError
());
if
(
GetLastError
()
==
ERROR_IO_PENDING
)
{
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
1000
);
ok
(
!
ret
,
"wait failed
\n
"
);
...
...
@@ -8563,7 +8559,6 @@ static void test_shutdown_completion_port(void)
ret
=
GetOverlappedResult
((
HANDLE
)
client
,
&
overlapped
,
&
size
,
TRUE
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!
size
,
"got %u bytes
\n
"
,
size
);
}
size
=
0xdeadbeef
;
key
=
0xdeadbeef
;
...
...
@@ -8617,10 +8612,9 @@ static void test_shutdown_completion_port(void)
SetLastError
(
0xdeadbeef
);
ret
=
pDisconnectEx
(
client
,
&
overlapped
,
0
,
0
);
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
GetLastError
());
if
(
GetLastError
()
==
ERROR_IO_PENDING
)
{
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"got error %u
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
1000
);
ok
(
!
ret
,
"wait failed
\n
"
);
...
...
@@ -8628,7 +8622,6 @@ static void test_shutdown_completion_port(void)
ret
=
GetOverlappedResult
((
HANDLE
)
client
,
&
overlapped
,
&
size
,
TRUE
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!
size
,
"got %u bytes
\n
"
,
size
);
}
ret
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
overlapped_ptr
,
0
);
ok
(
!
ret
,
"expected failure
\n
"
);
...
...
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