VirtualBox

Changeset 36475 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 30, 2011 4:08:57 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70865
Message:

USB: Store original config descriptor and refer to it for some non-standard data.

File:
1 edited

Legend:

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

    r35353 r36475  
    320320
    321321            memcpy(cur_if, ifd, sizeof(cur_if->Core));
    322             /** @todo copy any additional descriptor bytes into pvMore */
     322
     323            /* Point to additional interface descriptor bytes, if any. */
     324            AssertCompile(sizeof(cur_if->Core) == VUSB_DT_INTERFACE_MIN_LEN);
     325            if (cur_if->Core.bLength - VUSB_DT_INTERFACE_MIN_LEN > 0)
     326                cur_if->pvMore = tmp + VUSB_DT_INTERFACE_MIN_LEN;
     327            else
     328                cur_if->pvMore = NULL;
    323329
    324330            pIf->cSettings++;
     
    343349
    344350            memcpy(cur_ep, epd, sizeof(cur_ep->Core));
    345             /** @todo copy any additional descriptor bytes into pvMore */
     351
     352            /* Point to additional endpoint descriptor bytes, if any. */
     353            AssertCompile(sizeof(cur_ep->Core) == VUSB_DT_ENDPOINT_MIN_LEN);
     354            if (cur_ep->Core.bLength - VUSB_DT_ENDPOINT_MIN_LEN > 0)
     355                cur_ep->pvMore = tmp + VUSB_DT_ENDPOINT_MIN_LEN;
     356            else
     357                cur_ep->pvMore = NULL;
     358
    346359            cur_ep->Core.wMaxPacketSize = RT_LE2H_U16(cur_ep->Core.wMaxPacketSize);
    347360
     
    405418    }
    406419
     420    /* Stash a pointer to the raw config descriptor; we may need bits of it later.  */
     421    out->pvOriginal = descs;
     422
    407423    pIf = (PVUSBINTERFACE)out->paIfs;
    408424    ifd = (PVUSBDESCINTERFACEEX)&pIf[cnt.num_if];
     
    426442                }
    427443
    428     free_desc(descs);
    429444    return true;
    430445err:
     
    669684    {
    670685        for (unsigned i = 0; i < pThis->DevDesc.bNumConfigurations; i++)
     686        {
    671687            RTMemFree((void *)pThis->paCfgDescs[i].paIfs);
     688            RTMemFree((void *)pThis->paCfgDescs[i].pvOriginal);
     689        }
    672690        /** @todo bugref{2693} cleanup */
    673691        RTMemFree(pThis->paCfgDescs);
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