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
4a6b990c
Commit
4a6b990c
authored
Mar 11, 2002
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set an overlapped hEvent before calling any APCs.
parent
c2503b55
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
12 deletions
+15
-12
comm.c
dlls/kernel/comm.c
+1
-0
file.c
files/file.c
+11
-12
file.h
include/file.h
+1
-0
synchro.c
scheduler/synchro.c
+2
-0
No files found.
dlls/kernel/comm.c
View file @
4a6b990c
...
...
@@ -1606,6 +1606,7 @@ static BOOL COMM_WaitCommEvent(
close
(
fd
);
return
FALSE
;
}
ovp
->
event
=
lpOverlapped
->
hEvent
;
ovp
->
lpOverlapped
=
lpOverlapped
;
ovp
->
func
=
COMM_WaitCommEventService
;
ovp
->
buffer
=
(
char
*
)
lpdwEvents
;
...
...
files/file.c
View file @
4a6b990c
...
...
@@ -1370,7 +1370,8 @@ async_end:
*/
static
BOOL
FILE_ReadFileEx
(
HANDLE
hFile
,
LPVOID
buffer
,
DWORD
bytesToRead
,
LPOVERLAPPED
overlapped
,
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
,
HANDLE
hEvent
)
{
async_private
*
ovp
;
int
fd
;
...
...
@@ -1400,6 +1401,7 @@ static BOOL FILE_ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
close
(
fd
);
return
FALSE
;
}
ovp
->
event
=
hEvent
;
ovp
->
lpOverlapped
=
overlapped
;
ovp
->
count
=
bytesToRead
;
ovp
->
completion_func
=
lpCompletionRoutine
;
...
...
@@ -1435,12 +1437,7 @@ BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
{
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
0
;
return
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
overlapped
,
lpCompletionRoutine
);
}
static
VOID
CALLBACK
FILE_OverlappedComplete
(
DWORD
status
,
DWORD
count
,
LPOVERLAPPED
ov
)
{
NtSetEvent
(
ov
->
hEvent
,
NULL
);
return
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
overlapped
,
lpCompletionRoutine
,
INVALID_HANDLE_VALUE
);
}
static
BOOL
FILE_TimeoutRead
(
HANDLE
hFile
,
LPVOID
buffer
,
DWORD
bytesToRead
,
LPDWORD
bytesRead
)
...
...
@@ -1453,7 +1450,7 @@ static BOOL FILE_TimeoutRead(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPD
ZeroMemory
(
&
ov
,
sizeof
(
OVERLAPPED
));
if
(
STATUS_SUCCESS
==
NtCreateEvent
(
&
ov
.
hEvent
,
SYNCHRONIZE
,
NULL
,
0
,
0
))
{
if
(
ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
&
ov
,
FILE_OverlappedComplete
))
if
(
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
&
ov
,
NULL
,
ov
.
hEvent
))
{
r
=
GetOverlappedResult
(
hFile
,
&
ov
,
bytesRead
,
TRUE
);
}
...
...
@@ -1520,7 +1517,7 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
result
;
if
(
!
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
overlapped
,
FILE_OverlappedComplete
))
if
(
!
FILE_ReadFileEx
(
hFile
,
buffer
,
bytesToRead
,
overlapped
,
NULL
,
overlapped
->
hEvent
))
return
FALSE
;
/* fail on return, with ERROR_IO_PENDING */
...
...
@@ -1617,7 +1614,8 @@ async_end:
*/
static
BOOL
FILE_WriteFileEx
(
HANDLE
hFile
,
LPCVOID
buffer
,
DWORD
bytesToWrite
,
LPOVERLAPPED
overlapped
,
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
LPOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
,
HANDLE
hEvent
)
{
async_private
*
ovp
;
...
...
@@ -1647,6 +1645,7 @@ static BOOL FILE_WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
return
FALSE
;
}
ovp
->
lpOverlapped
=
overlapped
;
ovp
->
event
=
hEvent
;
ovp
->
func
=
FILE_AsyncWriteService
;
ovp
->
buffer
=
(
LPVOID
)
buffer
;
ovp
->
count
=
bytesToWrite
;
...
...
@@ -1681,7 +1680,7 @@ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
0
;
return
FILE_WriteFileEx
(
hFile
,
buffer
,
bytesToWrite
,
overlapped
,
lpCompletionRoutine
);
return
FILE_WriteFileEx
(
hFile
,
buffer
,
bytesToWrite
,
overlapped
,
lpCompletionRoutine
,
INVALID_HANDLE_VALUE
);
}
/***********************************************************************
...
...
@@ -1744,7 +1743,7 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
overlapped
->
Internal
=
STATUS_PENDING
;
overlapped
->
InternalHigh
=
result
;
if
(
!
FILE_WriteFileEx
(
hFile
,
buffer
,
bytesToWrite
,
overlapped
,
FILE_OverlappedComplete
))
if
(
!
FILE_WriteFileEx
(
hFile
,
buffer
,
bytesToWrite
,
overlapped
,
NULL
,
overlapped
->
hEvent
))
return
FALSE
;
/* fail on return, with ERROR_IO_PENDING */
...
...
include/file.h
View file @
4a6b990c
...
...
@@ -52,6 +52,7 @@ typedef struct async_private
{
LPOVERLAPPED
lpOverlapped
;
HANDLE
handle
;
HANDLE
event
;
int
fd
;
char
*
buffer
;
async_handler
func
;
...
...
scheduler/synchro.c
View file @
4a6b990c
...
...
@@ -84,6 +84,8 @@ void finish_async(async_private *ovp, DWORD status)
ovp
->
prev
=
NULL
;
close
(
ovp
->
fd
);
if
(
ovp
->
event
!=
INVALID_HANDLE_VALUE
)
NtSetEvent
(
ovp
->
event
,
NULL
);
if
(
!
ovp
->
completion_func
)
HeapFree
(
GetProcessHeap
(),
0
,
ovp
);
}
...
...
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