VirtualBox

Changeset 32426 in vbox


Ignore:
Timestamp:
Sep 11, 2010 2:40:48 PM (14 years ago)
Author:
vboxsync
Message:

IPRT/fileaio-win: Fix misunderstanding of GetQueuedCompletionStatus. It already returns the completion of the request if a I/O packet is dequeued (non NULL lpOverlapped).

GetOverlappedResult is not required. Fixes returning error codes of the request when returning from RTFileAioCtxWait instead of saving them
in the completed request.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/fileaio-win.cpp

    r29241 r32426  
    429429                                               dwTimeout);
    430430        ASMAtomicXchgBool(&pCtxInt->fWaiting, false);
    431         if (!fSucceeded)
     431        if (   !fSucceeded
     432            && !pOverlapped)
    432433        {
    433             /* Includes VERR_TIMEOUT */
     434            /* The call failed to dequeue a completion packet, includes VERR_TIMEOUT */
    434435            rc = RTErrConvertFromWin32(GetLastError());
    435436            break;
     
    438439        /* Check if we got woken up. */
    439440        if (lCompletionKey == AIO_CONTEXT_WAKEUP_EVENT)
     441        {
     442            Assert(fSucceeded && !pOverlapped)
    440443            break;
     444        }
    441445
    442446        /* A request completed. */
     
    448452        RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
    449453
    450         /* completion status. */
    451         fSucceeded = GetOverlappedResult(pReqInt->hFile,
    452                                          &pReqInt->Overlapped,
    453                                          &cbTransfered,
    454                                          FALSE);
    455454        pReqInt->cbTransfered = cbTransfered;
    456         pReqInt->Rc = VINF_SUCCESS;
     455        if (fSucceeded)
     456            pReqInt->Rc = VINF_SUCCESS;
     457        else
     458            pReqInt->Rc = RTErrConvertFromWin32(GetLastError());
    457459
    458460        pahReqs[cRequestsCompleted++] = (RTFILEAIOREQ)pReqInt;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette