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
07d3c823
Commit
07d3c823
authored
Jun 29, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Jul 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Allow IOCTL_AFD_POLL for sockets without unix fd.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
parent
3a25d001
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
afd.c
dlls/ws2_32/tests/afd.c
+12
-3
sock.c
server/sock.c
+3
-2
No files found.
dlls/ws2_32/tests/afd.c
View file @
07d3c823
...
...
@@ -172,15 +172,17 @@ static void test_poll(void)
GUID
acceptex_guid
=
WSAID_ACCEPTEX
;
SOCKET
client
,
server
,
listener
;
OVERLAPPED
overlapped
=
{
0
};
HANDLE
event
,
afd_handle
;
LPFN_ACCEPTEX
pAcceptEx
;
struct
sockaddr_in
addr
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
string
;
DWORD
size
,
flags
=
0
;
char
*
large_buffer
;
IO_STATUS_BLOCK
io
;
LARGE_INTEGER
now
;
ULONG
params_size
;
WSABUF
wsabuf
;
HANDLE
event
;
int
ret
,
len
;
large_buffer
=
malloc
(
large_buffer_size
);
...
...
@@ -189,6 +191,11 @@ static void test_poll(void)
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
overlapped
.
hEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
RtlInitUnicodeString
(
&
string
,
L"
\\
Device
\\
Afd
\\
deadbeef"
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
0
,
NULL
,
NULL
);
ret
=
NtOpenFile
(
&
afd_handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
listener
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ret
=
bind
(
listener
,
(
const
struct
sockaddr
*
)
&
bind_addr
,
sizeof
(
bind_addr
));
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
...
...
@@ -246,7 +253,7 @@ static void test_poll(void)
in_params
->
sockets
[
0
].
status
=
0xdeadbeef
;
memset
(
out_params
,
0
,
params_size
);
ret
=
NtDeviceIoControlFile
(
(
HANDLE
)
listener
,
event
,
NULL
,
NULL
,
&
io
,
ret
=
NtDeviceIoControlFile
(
afd_handle
,
event
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_POLL
,
in_params
,
params_size
,
out_params
,
params_size
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
io
.
Status
,
"got %#lx
\n
"
,
io
.
Status
);
...
...
@@ -260,7 +267,7 @@ static void test_poll(void)
NtQuerySystemTime
(
&
now
);
in_params
->
timeout
=
now
.
QuadPart
;
ret
=
NtDeviceIoControlFile
(
(
HANDLE
)
listener
,
event
,
NULL
,
NULL
,
&
io
,
ret
=
NtDeviceIoControlFile
(
afd_handle
,
event
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_POLL
,
in_params
,
params_size
,
out_params
,
params_size
);
ok
(
ret
==
STATUS_PENDING
,
"got %#x
\n
"
,
ret
);
ret
=
WaitForSingleObject
(
event
,
100
);
...
...
@@ -899,6 +906,8 @@ static void test_poll(void)
CloseHandle
(
overlapped
.
hEvent
);
CloseHandle
(
event
);
free
(
large_buffer
);
CloseHandle
(
afd_handle
);
}
struct
poll_exclusive_thread_cb_ctx
...
...
server/sock.c
View file @
07d3c823
...
...
@@ -2186,11 +2186,12 @@ static struct accept_req *alloc_accept_req( struct sock *sock, struct sock *acce
static
void
sock_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
struct
async
*
async
)
{
struct
sock
*
sock
=
get_fd_user
(
fd
);
int
unix_fd
;
int
unix_fd
=
-
1
;
assert
(
sock
->
obj
.
ops
==
&
sock_ops
);
if
(
code
!=
IOCTL_AFD_WINE_CREATE
&&
(
unix_fd
=
get_unix_fd
(
fd
))
<
0
)
return
;
if
(
code
!=
IOCTL_AFD_WINE_CREATE
&&
code
!=
IOCTL_AFD_POLL
&&
(
unix_fd
=
get_unix_fd
(
fd
))
<
0
)
return
;
switch
(
code
)
{
...
...
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