Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
ea4f32c4
Commit
ea4f32c4
authored
23 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Separate code to overlapped timeouts into FILE_GetTimeout.
parent
fb0ff053
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
files/file.c
+25
-30
25 additions, 30 deletions
files/file.c
with
25 additions
and
30 deletions
files/file.c
+
25
−
30
View file @
ea4f32c4
...
...
@@ -1337,6 +1337,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)
*/
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment