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
9e1fc626
Commit
9e1fc626
authored
Oct 10, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 10, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do overlapped reads if and only if the file was opened with
FILE_FLAG_OVERLAPPED.
parent
0136b813
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
file.c
files/file.c
+23
-8
No files found.
files/file.c
View file @
9e1fc626
...
...
@@ -1434,6 +1434,7 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
LPDWORD
bytesRead
,
LPOVERLAPPED
overlapped
)
{
int
unix_handle
,
result
;
DWORD
type
;
TRACE
(
"%d %p %ld %p %p
\n
"
,
hFile
,
buffer
,
bytesToRead
,
bytesRead
,
overlapped
);
...
...
@@ -1441,13 +1442,21 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
if
(
bytesRead
)
*
bytesRead
=
0
;
/* Do this before anything else */
if
(
!
bytesToRead
)
return
TRUE
;
/* this will only have impact if the overlapped structure is specified */
if
(
overlapped
)
unix_handle
=
FILE_GetUnixHandleType
(
hFile
,
GENERIC_READ
,
&
type
);
if
(
unix_handle
==
-
1
)
return
FALSE
;
switch
(
type
)
{
/* see if we can read some data already (this shouldn't block) */
unix_handle
=
FILE_GetUnixHandle
(
hFile
,
GENERIC_READ
);
if
(
unix_handle
==
-
1
)
case
FD_TYPE_OVERLAPPED
:
if
(
!
overlapped
)
{
close
(
unix_handle
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/* see if we can read some data already (this shouldn't block) */
result
=
read
(
unix_handle
,
buffer
,
bytesToRead
);
close
(
unix_handle
);
...
...
@@ -1474,10 +1483,16 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
/* fail on return, with ERROR_IO_PENDING */
SetLastError
(
ERROR_IO_PENDING
);
return
FALSE
;
}
unix_handle
=
FILE_GetUnixHandle
(
hFile
,
GENERIC_READ
);
if
(
unix_handle
==
-
1
)
return
FALSE
;
default:
if
(
overlapped
)
{
close
(
unix_handle
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
break
;
}
/* code for synchronous reads */
while
((
result
=
read
(
unix_handle
,
buffer
,
bytesToRead
))
==
-
1
)
...
...
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