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
282120a9
Commit
282120a9
authored
Nov 12, 2022
by
Jinoh Kang
Committed by
Alexandre Julliard
Nov 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use an acquire/release pair on the IOSB status.
parent
7c2af26a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
6 deletions
+32
-6
file.c
dlls/kernelbase/file.c
+5
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+22
-4
socket.c
dlls/ws2_32/socket.c
+5
-1
No files found.
dlls/kernelbase/file.c
View file @
282120a9
...
@@ -3156,7 +3156,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResultEx( HANDLE file, OVERLAPPED *ov
...
@@ -3156,7 +3156,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResultEx( HANDLE file, OVERLAPPED *ov
TRACE
(
"(%p %p %p %lu %d)
\n
"
,
file
,
overlapped
,
result
,
timeout
,
alertable
);
TRACE
(
"(%p %p %p %lu %d)
\n
"
,
file
,
overlapped
,
result
,
timeout
,
alertable
);
status
=
overlapped
->
Internal
;
/* Paired with the write-release in set_async_iosb() in ntdll; see the
* latter for details. */
status
=
ReadAcquire
(
(
LONG
*
)
&
overlapped
->
Internal
);
if
(
status
==
STATUS_PENDING
)
if
(
status
==
STATUS_PENDING
)
{
{
if
(
!
timeout
)
if
(
!
timeout
)
...
@@ -3173,6 +3175,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResultEx( HANDLE file, OVERLAPPED *ov
...
@@ -3173,6 +3175,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResultEx( HANDLE file, OVERLAPPED *ov
return
FALSE
;
return
FALSE
;
}
}
/* We don't need to give this load acquire semantics; the wait above
* already guarantees that the IOSB and output buffer are filled. */
status
=
overlapped
->
Internal
;
status
=
overlapped
->
Internal
;
if
(
status
==
STATUS_PENDING
)
status
=
STATUS_SUCCESS
;
if
(
status
==
STATUS_PENDING
)
status
=
STATUS_SUCCESS
;
}
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
282120a9
...
@@ -367,6 +367,24 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR
...
@@ -367,6 +367,24 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR
{
{
if
(
!
iosb
)
return
;
if
(
!
iosb
)
return
;
/* GetOverlappedResult() and WSAGetOverlappedResult() expect that if the
* status is written, that the information (and buffer, which was written
* earlier from the async callback) will be available. Hence we need to
* store the status last, with release semantics to ensure that those
* writes are visible. This release is paired with a read-acquire in
* GetOverlappedResult() and WSAGetOverlappedResult():
*
* CPU 0 (set_async_iosb) CPU 1 (GetOverlappedResultEx)
* =========================== ===========================
* write buffer
* write Information
* WriteRelease(Status) <--------.
* |
* |
* (paired with) `-> ReadAcquire(Status)
* read Information
*/
if
(
in_wow64_call
())
if
(
in_wow64_call
())
{
{
struct
iosb32
struct
iosb32
...
@@ -374,18 +392,18 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR
...
@@ -374,18 +392,18 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR
NTSTATUS
Status
;
NTSTATUS
Status
;
ULONG
Information
;
ULONG
Information
;
}
*
io
=
wine_server_get_ptr
(
iosb
);
}
*
io
=
wine_server_get_ptr
(
iosb
);
io
->
Status
=
status
;
io
->
Information
=
info
;
io
->
Information
=
info
;
WriteRelease
(
&
io
->
Status
,
status
);
}
}
else
else
{
{
IO_STATUS_BLOCK
*
io
=
wine_server_get_ptr
(
iosb
);
IO_STATUS_BLOCK
*
io
=
wine_server_get_ptr
(
iosb
);
io
->
Information
=
info
;
#ifdef NONAMELESSUNION
#ifdef NONAMELESSUNION
io
->
u
.
Status
=
status
;
WriteRelease
(
&
io
->
u
.
Status
,
status
)
;
#else
#else
io
->
Status
=
status
;
WriteRelease
(
&
io
->
Status
,
status
)
;
#endif
#endif
io
->
Information
=
info
;
}
}
}
}
...
...
dlls/ws2_32/socket.c
View file @
282120a9
...
@@ -3710,7 +3710,9 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
...
@@ -3710,7 +3710,9 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
return
FALSE
;
return
FALSE
;
}
}
status
=
lpOverlapped
->
Internal
;
/* Paired with the write-release in set_async_iosb() in ntdll; see the
* latter for details. */
status
=
ReadAcquire
(
(
LONG
*
)
&
lpOverlapped
->
Internal
);
if
(
status
==
STATUS_PENDING
)
if
(
status
==
STATUS_PENDING
)
{
{
if
(
!
fWait
)
if
(
!
fWait
)
...
@@ -3722,6 +3724,8 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
...
@@ -3722,6 +3724,8 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
if
(
WaitForSingleObject
(
lpOverlapped
->
hEvent
?
lpOverlapped
->
hEvent
:
SOCKET2HANDLE
(
s
),
if
(
WaitForSingleObject
(
lpOverlapped
->
hEvent
?
lpOverlapped
->
hEvent
:
SOCKET2HANDLE
(
s
),
INFINITE
)
==
WAIT_FAILED
)
INFINITE
)
==
WAIT_FAILED
)
return
FALSE
;
return
FALSE
;
/* We don't need to give this load acquire semantics; the wait above
* already guarantees that the IOSB and output buffer are filled. */
status
=
lpOverlapped
->
Internal
;
status
=
lpOverlapped
->
Internal
;
}
}
...
...
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