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
01afb21b
Commit
01afb21b
authored
Jul 22, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Move the event reset in WSAEnumNetworkEvents() to the server.
So that it is done atomically with retrieving events. Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=52474
parent
0a33ac4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
socket.c
dlls/ws2_32/socket.c
+1
-3
afd.c
dlls/ws2_32/tests/afd.c
+14
-0
sock.c
server/sock.c
+16
-0
No files found.
dlls/ws2_32/socket.c
View file @
01afb21b
...
...
@@ -3604,10 +3604,8 @@ int WINAPI WSAEnumNetworkEvents( SOCKET s, WSAEVENT event, WSANETWORKEVENTS *ret
TRACE
(
"socket %#Ix, event %p, events %p
\n
"
,
s
,
event
,
ret_events
);
ResetEvent
(
event
);
status
=
NtDeviceIoControlFile
(
(
HANDLE
)
s
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_GET_EVENTS
,
NULL
,
0
,
&
params
,
sizeof
(
params
)
);
event
,
0
,
&
params
,
sizeof
(
params
)
);
if
(
!
status
)
{
ret_events
->
lNetworkEvents
=
afd_poll_flag_to_win32
(
params
.
flags
);
...
...
dlls/ws2_32/tests/afd.c
View file @
01afb21b
...
...
@@ -1969,6 +1969,20 @@ static void test_get_events(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
params
.
status
);
++
i
)
ok
(
!
params
.
status
[
i
],
"got status[%u] %#x
\n
"
,
i
,
params
.
status
[
i
]);
SetEvent
(
event
);
memset
(
&
params
,
0xcc
,
sizeof
(
params
));
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_GET_EVENTS
,
event
,
0
,
&
params
,
sizeof
(
params
));
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
params
.
flags
,
"got flags %#x
\n
"
,
params
.
flags
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
params
.
status
);
++
i
)
ok
(
!
params
.
status
[
i
],
"got status[%u] %#x
\n
"
,
i
,
params
.
status
[
i
]);
ret
=
WaitForSingleObject
(
event
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %d
\n
"
,
ret
);
closesocket
(
client
);
closesocket
(
server
);
...
...
server/sock.c
View file @
01afb21b
...
...
@@ -3919,6 +3919,7 @@ DECL_HANDLER(socket_get_events)
{
struct
sock
*
sock
=
(
struct
sock
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
sock_ops
);
unsigned
int
status
[
13
];
struct
event
*
event
=
NULL
;
unsigned
int
i
;
if
(
get_reply_max_size
()
<
sizeof
(
status
))
...
...
@@ -3929,6 +3930,15 @@ DECL_HANDLER(socket_get_events)
if
(
!
sock
)
return
;
if
(
req
->
event
)
{
if
(
!
(
event
=
get_event_obj
(
current
->
process
,
req
->
event
,
EVENT_MODIFY_STATE
)))
{
release_object
(
sock
);
return
;
}
}
reply
->
flags
=
sock
->
pending_events
&
sock
->
mask
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
status
);
++
i
)
status
[
i
]
=
sock_get_ntstatus
(
sock
->
errors
[
i
]
);
...
...
@@ -3936,6 +3946,12 @@ DECL_HANDLER(socket_get_events)
sock
->
pending_events
&=
~
sock
->
mask
;
sock_reselect
(
sock
);
if
(
event
)
{
reset_event
(
event
);
release_object
(
event
);
}
set_reply_data
(
status
,
sizeof
(
status
)
);
release_object
(
sock
);
...
...
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