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
64ba011d
Commit
64ba011d
authored
Apr 10, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Determine the async read avail_mode flag from the client side.
parent
6dcb280b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
file.c
dlls/ntdll/file.c
+39
-2
No files found.
dlls/ntdll/file.c
View file @
64ba011d
...
@@ -465,6 +465,40 @@ static inline int get_next_io_timeout( struct io_timeouts *timeouts, ULONG alrea
...
@@ -465,6 +465,40 @@ static inline int get_next_io_timeout( struct io_timeouts *timeouts, ULONG alrea
}
}
/* retrieve the avail_mode flag for async reads */
static
NTSTATUS
get_io_avail_mode
(
HANDLE
handle
,
enum
server_fd_type
type
,
BOOL
*
avail_mode
)
{
NTSTATUS
status
=
STATUS_SUCCESS
;
switch
(
type
)
{
case
FD_TYPE_SERIAL
:
{
/* GetCommTimeouts */
SERIAL_TIMEOUTS
st
;
IO_STATUS_BLOCK
io
;
status
=
NtDeviceIoControlFile
(
handle
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_SERIAL_GET_TIMEOUTS
,
NULL
,
0
,
&
st
,
sizeof
(
st
)
);
if
(
status
)
break
;
*
avail_mode
=
(
!
st
.
ReadTotalTimeoutMultiplier
&&
!
st
.
ReadTotalTimeoutConstant
&&
st
.
ReadIntervalTimeout
==
MAXDWORD
);
}
break
;
case
FD_TYPE_MAILSLOT
:
case
FD_TYPE_SOCKET
:
case
FD_TYPE_PIPE
:
*
avail_mode
=
TRUE
;
break
;
default:
*
avail_mode
=
FALSE
;
break
;
}
return
status
;
}
/******************************************************************************
/******************************************************************************
* NtReadFile [NTDLL.@]
* NtReadFile [NTDLL.@]
* ZwReadFile [NTDLL.@]
* ZwReadFile [NTDLL.@]
...
@@ -553,8 +587,11 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
...
@@ -553,8 +587,11 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
if
(
flags
&
FD_FLAG_OVERLAPPED
)
if
(
flags
&
FD_FLAG_OVERLAPPED
)
{
{
async_fileio_read
*
fileio
;
async_fileio_read
*
fileio
;
BOOL
avail_mode
;
if
(
total
&&
(
flags
&
FD_FLAG_AVAILABLE
))
if
((
status
=
get_io_avail_mode
(
hFile
,
type
,
&
avail_mode
)))
goto
done
;
if
(
total
&&
avail_mode
)
{
{
status
=
STATUS_SUCCESS
;
status
=
STATUS_SUCCESS
;
goto
done
;
goto
done
;
...
@@ -569,7 +606,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
...
@@ -569,7 +606,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
fileio
->
already
=
total
;
fileio
->
already
=
total
;
fileio
->
count
=
length
;
fileio
->
count
=
length
;
fileio
->
buffer
=
buffer
;
fileio
->
buffer
=
buffer
;
fileio
->
avail_mode
=
(
flags
&
FD_FLAG_AVAILABLE
)
;
fileio
->
avail_mode
=
avail_mode
;
SERVER_START_REQ
(
register_async
)
SERVER_START_REQ
(
register_async
)
{
{
...
...
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