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
27cf4a41
Commit
27cf4a41
authored
Dec 19, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Dec 19, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented timed-out non-overlapped ReadFile.
parent
690d24f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
file.c
files/file.c
+29
-0
No files found.
files/file.c
View file @
27cf4a41
...
...
@@ -1427,6 +1427,30 @@ BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
return
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
overlapped
,
lpCompletionRoutine
);
}
static
VOID
CALLBACK
FILE_TimeoutComplete
(
DWORD
status
,
DWORD
count
,
LPOVERLAPPED
ov
)
{
NtSetEvent
(
ov
->
hEvent
,
NULL
);
}
static
BOOL
FILE_TimeoutRead
(
HANDLE
hFile
,
LPVOID
buffer
,
DWORD
bytesToRead
,
LPDWORD
bytesRead
)
{
OVERLAPPED
ov
;
BOOL
r
=
FALSE
;
TRACE
(
"%d %p %ld %p
\n
"
,
hFile
,
buffer
,
bytesToRead
,
bytesRead
);
ZeroMemory
(
&
ov
,
sizeof
(
OVERLAPPED
));
if
(
STATUS_SUCCESS
==
NtCreateEvent
(
&
ov
.
hEvent
,
SYNCHRONIZE
,
NULL
,
0
,
0
))
{
if
(
ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
&
ov
,
FILE_TimeoutComplete
))
{
r
=
GetOverlappedResult
(
hFile
,
&
ov
,
bytesRead
,
TRUE
);
}
}
CloseHandle
(
ov
.
hEvent
);
return
r
;
}
/***********************************************************************
* ReadFile (KERNEL32.@)
*/
...
...
@@ -1485,6 +1509,11 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
case
FD_TYPE_CONSOLE
:
return
ReadConsoleA
(
hFile
,
buffer
,
bytesToRead
,
bytesRead
,
NULL
);
case
FD_TYPE_TIMEOUT
:
close
(
unix_handle
);
return
FILE_TimeoutRead
(
hFile
,
buffer
,
bytesToRead
,
bytesRead
);
default:
/* normal unix files */
if
(
unix_handle
==
-
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