mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
In GetQueuedCompletionStatus function:
- change order of arguments of NtRemoveIoCompletion function, - check maybe it returns STATUS_TIMEOUT. svn path=/trunk/; revision=38141
This commit is contained in:
parent
52eab0439a
commit
466378bd87
1 changed files with 11 additions and 10 deletions
|
@ -99,9 +99,10 @@ GetQueuedCompletionStatus(
|
|||
{
|
||||
NTSTATUS errCode;
|
||||
IO_STATUS_BLOCK IoStatus;
|
||||
ULONG_PTR CompletionKey;
|
||||
LARGE_INTEGER Interval;
|
||||
|
||||
if (!lpNumberOfBytesTransferred||!lpCompletionKey||!lpOverlapped)
|
||||
if (!lpNumberOfBytesTransferred || !lpCompletionKey || !lpOverlapped)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
|
@ -113,18 +114,19 @@ GetQueuedCompletionStatus(
|
|||
}
|
||||
|
||||
errCode = NtRemoveIoCompletion(CompletionHandle,
|
||||
(PVOID*)lpCompletionKey,
|
||||
(PVOID*)lpNumberOfBytesTransferred,
|
||||
(PVOID*)&CompletionKey,
|
||||
(PVOID*)lpOverlapped,
|
||||
&IoStatus,
|
||||
dwMilliseconds == INFINITE ? NULL : &Interval);
|
||||
|
||||
if (!NT_SUCCESS(errCode)) {
|
||||
if (!NT_SUCCESS(errCode) || errCode == STATUS_TIMEOUT) {
|
||||
*lpOverlapped = NULL;
|
||||
SetLastErrorByStatus(errCode);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*lpOverlapped = (LPOVERLAPPED)IoStatus.Information;
|
||||
*lpCompletionKey = CompletionKey;
|
||||
*lpNumberOfBytesTransferred = IoStatus.Information;
|
||||
|
||||
if (!NT_SUCCESS(IoStatus.Status)){
|
||||
//failed io operation
|
||||
|
@ -133,7 +135,6 @@ GetQueuedCompletionStatus(
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,10 +153,10 @@ PostQueuedCompletionStatus(
|
|||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtSetIoCompletion(CompletionHandle,
|
||||
(PVOID)dwCompletionKey,
|
||||
(PVOID)lpOverlapped,//CompletionValue
|
||||
STATUS_SUCCESS, //IoStatusBlock->Status
|
||||
dwNumberOfBytesTransferred); //IoStatusBlock->Information
|
||||
(PVOID)dwCompletionKey, // KeyContext
|
||||
(PVOID)lpOverlapped, // ApcContext
|
||||
STATUS_SUCCESS, // IoStatusBlock->Status
|
||||
dwNumberOfBytesTransferred); // IoStatusBlock->Information
|
||||
|
||||
if ( !NT_SUCCESS(errCode) )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue