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
6e4f03d7
Commit
6e4f03d7
authored
Jun 14, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use IOCTL_AFD_EVENT_SELECT.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bbf3ab9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
17 deletions
+38
-17
socket.c
dlls/ws2_32/socket.c
+38
-17
No files found.
dlls/ws2_32/socket.c
View file @
6e4f03d7
...
...
@@ -4379,30 +4379,51 @@ int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEvent, LPWSANETWORKEVENTS lp
return
SOCKET_ERROR
;
}
/***********************************************************************
* WSAEventSelect (WS2_32.39)
*/
int
WINAPI
WSAEventSelect
(
SOCKET
s
,
WSAEVENT
hEvent
,
LONG
lEvent
)
static
unsigned
int
afd_poll_flag_from_win32
(
unsigned
int
flags
)
{
int
ret
;
static
const
unsigned
int
map
[]
=
{
AFD_POLL_READ
,
AFD_POLL_WRITE
,
AFD_POLL_OOB
,
AFD_POLL_ACCEPT
,
AFD_POLL_CONNECT
|
AFD_POLL_CONNECT_ERR
,
AFD_POLL_RESET
|
AFD_POLL_HUP
,
};
TRACE
(
"%04lx, hEvent %p, event %08x
\n
"
,
s
,
hEvent
,
lEvent
)
;
unsigned
int
i
,
ret
=
0
;
SERVER_START_REQ
(
set_socket_event
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
map
);
++
i
)
{
req
->
handle
=
wine_server_obj_handle
(
SOCKET2HANDLE
(
s
)
);
req
->
mask
=
lEvent
;
req
->
event
=
wine_server_obj_handle
(
hEvent
);
req
->
window
=
0
;
req
->
msg
=
0
;
ret
=
wine_server_call
(
req
);
if
(
flags
&
(
1
<<
i
))
ret
|=
map
[
i
];
}
SERVER_END_REQ
;
if
(
!
ret
)
return
0
;
SetLastError
(
WSAEINVAL
);
return
SOCKET_ERROR
;
return
ret
;
}
/***********************************************************************
* WSAEventSelect (ws2_32.@)
*/
int
WINAPI
WSAEventSelect
(
SOCKET
s
,
WSAEVENT
event
,
LONG
mask
)
{
struct
afd_event_select_params
params
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
TRACE
(
"socket %#lx, event %p, mask %#x
\n
"
,
s
,
event
,
mask
);
params
.
event
=
event
;
params
.
mask
=
afd_poll_flag_from_win32
(
mask
);
status
=
NtDeviceIoControlFile
(
(
HANDLE
)
s
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
SetLastError
(
NtStatusToWSAError
(
status
)
);
return
status
?
-
1
:
0
;
}
/**********************************************************************
* WSAGetOverlappedResult (WS2_32.40)
*/
...
...
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