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
2b54cf91
Commit
2b54cf91
authored
Sep 12, 2002
by
Martin Wilck
Committed by
Alexandre Julliard
Sep 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the behavior of GetOverlappedResult() and WSAGetOverlappedResult()
with non-manual-reset (auto-reset) events in the OVERLAPPED structures.
parent
3e2887a9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
12 deletions
+52
-12
socket.c
dlls/winsock/socket.c
+23
-7
file.c
files/file.c
+29
-5
No files found.
dlls/winsock/socket.c
View file @
2b54cf91
...
...
@@ -3266,9 +3266,19 @@ BOOL WINAPI WSAGetOverlappedResult ( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
return
FALSE
;
}
do
{
r
=
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
fWait
?
INFINITE
:
0
,
TRUE
);
}
while
(
r
==
STATUS_USER_APC
);
if
(
fWait
)
{
while
(
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
INFINITE
,
TRUE
)
==
STATUS_USER_APC
);
}
else
if
(
lpOverlapped
->
Internal
==
STATUS_PENDING
)
{
/* Wait in order to give APCs a chance to run. */
/* This is cheating, so we must set the event again in case of success -
it may be a non-manual reset event. */
while
(
(
r
=
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
0
,
TRUE
))
==
STATUS_USER_APC
);
if
(
r
==
WAIT_OBJECT_0
)
NtSetEvent
(
lpOverlapped
->
hEvent
,
NULL
);
}
if
(
lpcbTransfer
)
*
lpcbTransfer
=
lpOverlapped
->
InternalHigh
;
...
...
@@ -3276,12 +3286,18 @@ BOOL WINAPI WSAGetOverlappedResult ( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
if
(
lpdwFlags
)
*
lpdwFlags
=
lpOverlapped
->
Offset
;
if
(
r
==
WAIT_OBJECT_0
)
switch
(
lpOverlapped
->
Internal
)
{
case
STATUS_SUCCESS
:
return
TRUE
;
WSASetLastError
(
lpOverlapped
->
Internal
==
STATUS_PENDING
?
WSA_IO_INCOMPLETE
:
NtStatusToWSAError
(
lpOverlapped
->
Internal
)
);
case
STATUS_PENDING
:
WSASetLastError
(
WSA_IO_INCOMPLETE
);
if
(
fWait
)
ERR
(
"PENDING status after waiting!
\n
"
);
return
FALSE
;
default:
WSASetLastError
(
NtStatusToWSAError
(
lpOverlapped
->
Internal
));
return
FALSE
;
}
}
...
...
files/file.c
View file @
2b54cf91
...
...
@@ -1554,19 +1554,43 @@ BOOL WINAPI GetOverlappedResult(
return
FALSE
;
}
if
(
bWait
)
{
do
{
TRACE
(
"waiting on %p
\n
"
,
lpOverlapped
);
r
=
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
INFINITE
,
TRUE
);
TRACE
(
"wait on %p returned %ld
\n
"
,
lpOverlapped
,
r
);
}
while
(
r
==
STATUS_USER_APC
);
}
else
if
(
lpOverlapped
->
Internal
==
STATUS_PENDING
)
{
/* Wait in order to give APCs a chance to run. */
/* This is cheating, so we must set the event again in case of success -
it may be a non-manual reset event. */
do
{
TRACE
(
"waiting on %p
\n
"
,
lpOverlapped
);
r
=
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
bWait
?
INFINITE
:
0
,
TRUE
);
r
=
WaitForSingleObjectEx
(
lpOverlapped
->
hEvent
,
INFINITE
,
TRUE
);
TRACE
(
"wait on %p returned %ld
\n
"
,
lpOverlapped
,
r
);
}
while
(
r
==
STATUS_USER_APC
);
if
(
r
==
WAIT_OBJECT_0
)
NtSetEvent
(
lpOverlapped
->
hEvent
,
NULL
);
}
if
(
lpTransferred
)
*
lpTransferred
=
lpOverlapped
->
InternalHigh
;
SetLastError
(
lpOverlapped
->
Internal
==
STATUS_PENDING
?
ERROR_IO_INCOMPLETE
:
RtlNtStatusToDosError
(
lpOverlapped
->
Internal
)
);
return
(
r
==
WAIT_OBJECT_0
);
switch
(
lpOverlapped
->
Internal
)
{
case
STATUS_SUCCESS
:
return
TRUE
;
case
STATUS_PENDING
:
SetLastError
(
ERROR_IO_INCOMPLETE
);
if
(
bWait
)
ERR
(
"PENDING status after waiting!
\n
"
);
return
FALSE
;
default:
SetLastError
(
RtlNtStatusToDosError
(
lpOverlapped
->
Internal
)
);
return
FALSE
;
}
}
/***********************************************************************
...
...
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