VirtualBox

Changeset 69961 in vbox for trunk/src/VBox/Devices/USB/win


Ignore:
Timestamp:
Dec 6, 2017 7:29:03 PM (7 years ago)
Author:
vboxsync
Message:

VUSB/win: Report error early if further URBs cannot be queued.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp

    r69500 r69961  
    405405    Assert(pPriv);
    406406
     407    /* Don't even bother if we can't wait for that many objects. */
     408    if (pPriv->cPendingUrbs + pPriv->cQueuedUrbs >= (MAXIMUM_WAIT_OBJECTS - 1))
     409        return VERR_OUT_OF_RESOURCES;
     410    if (pPriv->cPendingUrbs >= RT_ELEMENTS(pPriv->aPendingUrbs))
     411        return VERR_OUT_OF_RESOURCES;
     412
    407413    /*
    408414     * Allocate and initialize a URB queue structure.
     
    476482            RTCritSectEnter(&pPriv->CritSect);
    477483            unsigned j = pPriv->cPendingUrbs;
     484            Assert(j < RT_ELEMENTS(pPriv->aPendingUrbs));
    478485            pPriv->aPendingUrbs[j] = pQUrbWin;
    479486            pPriv->cPendingUrbs++;
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