mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
Regression fixes for Nt{Read|Write}File:
- actually block in TIMEOUT mode - in overlapped mode, if any data is already available then process it without returning a pending status code
This commit is contained in:
parent
2caec6fe3b
commit
a851c88001
1 changed files with 26 additions and 0 deletions
|
@ -416,6 +416,19 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
|
|||
ret = register_new_async(&ovp->async);
|
||||
if (ret != STATUS_SUCCESS)
|
||||
return ret;
|
||||
if (flags & FD_FLAG_TIMEOUT)
|
||||
{
|
||||
NtWaitForSingleObject(hEvent, TRUE, NULL);
|
||||
NtClose(hEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
LARGE_INTEGER timeout;
|
||||
|
||||
/* let some APC be run, this will read some already pending data */
|
||||
timeout.s.LowPart = timeout.s.HighPart = 0;
|
||||
NtDelayExecution( TRUE, &timeout );
|
||||
}
|
||||
return io_status->u.Status;
|
||||
}
|
||||
switch (type)
|
||||
|
@ -577,6 +590,19 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
|
|||
ret = register_new_async(&ovp->async);
|
||||
if (ret != STATUS_SUCCESS)
|
||||
return ret;
|
||||
if (flags & FD_FLAG_TIMEOUT)
|
||||
{
|
||||
NtWaitForSingleObject(hEvent, TRUE, NULL);
|
||||
NtClose(hEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
LARGE_INTEGER timeout;
|
||||
|
||||
/* let some APC be run, this will write as much data as possible */
|
||||
timeout.s.LowPart = timeout.s.HighPart = 0;
|
||||
NtDelayExecution( TRUE, &timeout );
|
||||
}
|
||||
return io_status->u.Status;
|
||||
}
|
||||
switch (type)
|
||||
|
|
Loading…
Reference in a new issue