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
520a8487
Commit
520a8487
authored
May 17, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Cache the synchronous I/O event in the per-thread data.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9172ca5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
socket.c
dlls/ws2_32/socket.c
+13
-5
ws2_32_private.h
dlls/ws2_32/ws2_32_private.h
+1
-0
No files found.
dlls/ws2_32/socket.c
View file @
520a8487
...
...
@@ -1280,6 +1280,8 @@ static void free_per_thread_data(void)
if
(
!
ptb
)
return
;
CloseHandle
(
ptb
->
sync_event
);
/* delete scratch buffers */
HeapFree
(
GetProcessHeap
(),
0
,
ptb
->
he_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
ptb
->
se_buffer
);
...
...
@@ -1290,6 +1292,16 @@ static void free_per_thread_data(void)
NtCurrentTeb
()
->
WinSockData
=
NULL
;
}
static
HANDLE
get_sync_event
(
void
)
{
struct
per_thread_data
*
data
;
if
(
!
(
data
=
get_per_thread_data
()))
return
NULL
;
if
(
!
data
->
sync_event
)
data
->
sync_event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
return
data
->
sync_event
;
}
/***********************************************************************
* DllMain (WS2_32.init)
*/
...
...
@@ -2339,19 +2351,15 @@ SOCKET WINAPI WS_accept( SOCKET s, struct WS_sockaddr *addr, int *len )
TRACE
(
"%#lx
\n
"
,
s
);
if
(
!
(
sync_event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
)))
return
INVALID_SOCKET
;
if
(
!
(
sync_event
=
get_sync_event
(
)))
return
INVALID_SOCKET
;
status
=
NtDeviceIoControlFile
(
SOCKET2HANDLE
(
s
),
(
HANDLE
)((
ULONG_PTR
)
sync_event
|
0
),
NULL
,
NULL
,
&
io
,
IOCTL_AFD_WINE_ACCEPT
,
NULL
,
0
,
&
accept_handle
,
sizeof
(
accept_handle
)
);
if
(
status
==
STATUS_PENDING
)
{
if
(
WaitForSingleObject
(
sync_event
,
INFINITE
)
==
WAIT_FAILED
)
{
CloseHandle
(
sync_event
);
return
SOCKET_ERROR
;
}
status
=
io
.
u
.
Status
;
}
CloseHandle
(
sync_event
);
if
(
status
)
{
WARN
(
"failed; status %#x
\n
"
,
status
);
...
...
dlls/ws2_32/ws2_32_private.h
View file @
520a8487
...
...
@@ -181,6 +181,7 @@ UINT sock_get_error( int err ) DECLSPEC_HIDDEN;
struct
per_thread_data
{
HANDLE
sync_event
;
/* event to wait on for synchronous ioctls */
int
opentype
;
struct
WS_hostent
*
he_buffer
;
struct
WS_servent
*
se_buffer
;
...
...
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