VirtualBox

Changeset 54779 in vbox


Ignore:
Timestamp:
Mar 16, 2015 12:33:31 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98964
Message:

fix of misprint, calculation of memory size allocation used wrong structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbRt.cpp

    r54729 r54779  
    605605    {
    606606        pIfLe[i].InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(pCfgDr, pCfgDr, i, 0, -1, -1, -1);
    607                 pIfLe[i].Interface = NULL;
     607        pIfLe[i].Interface = NULL;
    608608        if (!pIfLe[i].InterfaceDescriptor)
    609609        {
     
    613613        }
    614614    }
    615         pIfLe[pCfgDr->bNumInterfaces].InterfaceDescriptor = NULL;
    616        
     615    pIfLe[pCfgDr->bNumInterfaces].InterfaceDescriptor = NULL;
     616
    617617    if (NT_SUCCESS(Status))
    618618    {
     
    635635                    for (i = 0; i < pDevExt->Rt.uNumInterfaces; i++)
    636636                    {
    637                         uint32_t uTotalIfaceInfoLength = sizeof (struct _URB_SELECT_INTERFACE) + ((pIfLe[i].Interface->NumberOfPipes > 0) ? (pIfLe[i].Interface->NumberOfPipes - 1) : 0) * sizeof(USBD_PIPE_INFORMATION);
     637                        size_t uTotalIfaceInfoLength = RT_OFFSETOF(struct _USBD_INTERFACE_INFORMATION, Pipes[RT_MAX(pIfLe[i].Interface->NumberOfPipes, 1)]);
    638638                        pDevExt->Rt.pVBIfaceInfo[i].pInterfaceInfo = (PUSBD_INTERFACE_INFORMATION)vboxUsbMemAlloc(uTotalIfaceInfoLength);
    639639                        if (!pDevExt->Rt.pVBIfaceInfo[i].pInterfaceInfo)
     
    658658                            pDevExt->Rt.pVBIfaceInfo[i].pPipeInfo = NULL;
    659659                        }
    660 
    661                         *pDevExt->Rt.pVBIfaceInfo[i].pInterfaceInfo = *pIfLe[i].Interface;
    662 
    663                                                 // AM try/catch for handle citrix case with wrong data from device.
    664                                                 __try
    665                                                 {
    666                                                         for (ULONG j = 0; j < pIfLe[i].Interface->NumberOfPipes; j++)
    667                                                         {
    668                                                                 pDevExt->Rt.pVBIfaceInfo[i].pInterfaceInfo->Pipes[j] = pIfLe[i].Interface->Pipes[j];
    669                                                                 pDevExt->Rt.pVBIfaceInfo[i].pPipeInfo[j].EndpointAddress = pIfLe[i].Interface->Pipes[j].EndpointAddress;
    670                                                                 pDevExt->Rt.pVBIfaceInfo[i].pPipeInfo[j].NextScheduledFrame = 0;
    671                                                         }
    672                                                 }
    673                                                 __except (EXCEPTION_EXECUTE_HANDLER)
    674                                                 {
    675                                                         Status = GetExceptionCode();
    676                                                         break;
    677                                                 }
     660                       
     661                        RtlCopyMemory(pDevExt->Rt.pVBIfaceInfo[i].pInterfaceInfo, pIfLe[i].Interface, uTotalIfaceInfoLength);
     662                       
     663                        for (ULONG j = 0; j < pIfLe[i].Interface->NumberOfPipes; j++)
     664                        {
     665                            pDevExt->Rt.pVBIfaceInfo[i].pPipeInfo[j].EndpointAddress = pIfLe[i].Interface->Pipes[j].EndpointAddress;
     666                            pDevExt->Rt.pVBIfaceInfo[i].pPipeInfo[j].NextScheduledFrame = 0;
     667                        }
    678668                    }
    679669
Note: See TracChangeset for help on using the changeset viewer.

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