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
ea4f32c4
Commit
ea4f32c4
authored
Oct 17, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 17, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate code to overlapped timeouts into FILE_GetTimeout.
parent
fb0ff053
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
30 deletions
+25
-30
file.c
files/file.c
+25
-30
No files found.
files/file.c
View file @
ea4f32c4
...
...
@@ -1338,6 +1338,25 @@ static void add_timeout( struct timeval *when, int timeout )
}
/***********************************************************************
* FILE_GetTimeout (INTERNAL)
*/
static
BOOL
FILE_GetTimeout
(
HANDLE
hFile
,
DWORD
txcount
,
DWORD
type
,
int
*
timeout
)
{
BOOL
ret
;
SERVER_START_REQ
(
create_async
)
{
req
->
count
=
txcount
;
req
->
type
=
type
;
req
->
file_handle
=
hFile
;
ret
=
SERVER_CALL
();
if
(
timeout
)
*
timeout
=
req
->
timeout
;
}
SERVER_END_REQ
;
return
!
ret
;
}
/***********************************************************************
* FILE_ReadFileEx (INTERNAL)
*/
static
BOOL
FILE_ReadFileEx
(
HANDLE
hFile
,
LPVOID
buffer
,
DWORD
bytesToRead
,
...
...
@@ -1345,7 +1364,7 @@ static BOOL FILE_ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
{
async_private
*
ovp
;
int
fd
,
timeout
,
ret
;
int
fd
,
timeout
=
0
;
TRACE
(
"file %d to buf %p num %ld %p func %p
\n
"
,
hFile
,
buffer
,
bytesToRead
,
overlapped
,
lpCompletionRoutine
);
...
...
@@ -1358,23 +1377,9 @@ static BOOL FILE_ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
return
FALSE
;
}
/*
* Although the overlapped transfer will be done in this thread
* we still need to register the operation with the server, in
* case it is cancelled and to get a file handle and the timeout info.
*/
SERVER_START_REQ
(
create_async
)
{
req
->
count
=
bytesToRead
;
req
->
type
=
ASYNC_TYPE_READ
;
req
->
file_handle
=
hFile
;
ret
=
SERVER_CALL
();
timeout
=
req
->
timeout
;
}
SERVER_END_REQ
;
if
(
ret
)
if
(
!
FILE_GetTimeout
(
hFile
,
bytesToRead
,
ASYNC_TYPE_READ
,
&
timeout
)
)
{
TRACE
(
"
server call
failed
\n
"
);
TRACE
(
"
FILE_GetTimeout
failed
\n
"
);
return
FALSE
;
}
...
...
@@ -1576,7 +1581,7 @@ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
{
async_private
*
ovp
;
int
timeout
,
ret
;
int
timeout
=
0
;
TRACE
(
"file %d to buf %p num %ld %p func %p stub
\n
"
,
hFile
,
buffer
,
bytesToWrite
,
overlapped
,
lpCompletionRoutine
);
...
...
@@ -1590,19 +1595,9 @@ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
0
;
/* need to check the server to get the timeout info */
SERVER_START_REQ
(
create_async
)
{
req
->
count
=
bytesToWrite
;
req
->
type
=
ASYNC_TYPE_WRITE
;
req
->
file_handle
=
hFile
;
ret
=
SERVER_CALL
();
timeout
=
req
->
timeout
;
}
SERVER_END_REQ
;
if
(
ret
)
if
(
!
FILE_GetTimeout
(
hFile
,
bytesToWrite
,
ASYNC_TYPE_WRITE
,
&
timeout
))
{
TRACE
(
"
server call
failed
\n
"
);
TRACE
(
"
FILE_GetTimeout
failed
\n
"
);
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