Changeset 59127 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Dec 14, 2015 3:56:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
r59121 r59127 131 131 } 132 132 133 if ( version.u32Major != USBDRV_MAJOR_VERSION134 133 if ( version.u32Major != USBDRV_MAJOR_VERSION 134 || version.u32Minor < USBDRV_MINOR_VERSION) 135 135 { 136 136 AssertMsgFailed(("Invalid version %d:%d vs %d:%d\n", version.u32Major, version.u32Minor, USBDRV_MAJOR_VERSION, USBDRV_MINOR_VERSION)); … … 280 280 281 281 return VINF_SUCCESS; 282 }283 284 static void usbLibDevFree(PUSBDEVICE pDevice)285 {286 RTStrFree((char*)pDevice->pszAddress);287 RTStrFree((char*)pDevice->pszHubName);288 if (pDevice->pszManufacturer)289 RTStrFree((char*)pDevice->pszManufacturer);290 if (pDevice->pszProduct)291 RTStrFree((char*)pDevice->pszProduct);292 if (pDevice->pszSerialNumber)293 RTStrFree((char*)pDevice->pszSerialNumber);294 RTMemFree(pDevice);295 }296 297 static void usbLibDevFreeList(PUSBDEVICE pDevice)298 {299 while (pDevice)300 {301 PUSBDEVICE pNext = pDevice->pNext;302 usbLibDevFree(pDevice);303 pDevice = pNext;304 }305 282 } 306 283 … … 322 299 pDev->enmState = USBDEVICESTATE_USED_BY_HOST_CAPTURABLE; 323 300 pDev->enmSpeed = USBDEVICESPEED_UNKNOWN; 324 pDev->pszAddress = RTStrDup(lpszDrvKeyName); 301 int rc = RTStrAPrintf((char **)&pDev->pszAddress, "%s", lpszDrvKeyName); 302 if (RT_FAILURE(rc)) 303 return rc; 304 pDev->pszBackend = RTStrDup("host"); 305 if (!pDev->pszBackend) 306 { 307 RTStrFree((char *)pDev->pszAddress); 308 return VERR_NO_STR_MEMORY; 309 } 325 310 pDev->pszHubName = RTStrDup(lpszHubName); 326 311 pDev->bNumConfigurations = 0; 327 312 pDev->u64SerialHash = 0; 328 pDev->pszBackend = RTStrDup("host");329 313 330 314 for (; pDrList; pDrList = pDrList->pNext) … … 351 335 * 352 336 * */ 353 intrc = RTUtf16ToUtf8((PCRTUTF16)pDrList->StrDr.bString, lppszString);337 rc = RTUtf16ToUtf8((PCRTUTF16)pDrList->StrDr.bString, lppszString); 354 338 if (RT_FAILURE(rc)) 355 339 { … … 811 795 812 796 PUSBDEVICE pDev = (PUSBDEVICE)RTMemAllocZ(sizeof (*pDev)); 813 rc = usbLibDevPopulate(pDev, pConInfo, iPort, lpszName, lpcszHubName, pList); 814 AssertRC(rc); 815 if (RT_SUCCESS(rc)) 816 { 817 pDev->pNext = *ppDevs; 818 *ppDevs = pDev; 819 ++*pcDevs; 820 } 797 if (RT_LIKELY(pDev)) 798 { 799 rc = usbLibDevPopulate(pDev, pConInfo, iPort, lpszName, lpcszHubName, pList); 800 if (RT_SUCCESS(rc)) 801 { 802 pDev->pNext = *ppDevs; 803 *ppDevs = pDev; 804 ++*pcDevs; 805 } 806 else 807 RTMemFree(pDev); 808 } 809 else 810 rc = VERR_NO_MEMORY; 821 811 822 812 if (pCfgDr) … … 830 820 usbLibDevStrDrEntryFreeList(pList); 831 821 832 return VINF_SUCCESS;822 return rc; 833 823 } 834 824 … … 870 860 for (ULONG i = 1; i <= NodeInfo.u.HubInformation.HubDescriptor.bNumberOfPorts; ++i) 871 861 { 862 /* Just skip devices for which we failed to create the device structure. */ 872 863 usbLibDevGetHubPortDevices(hDev, lpszName, i, ppDevs, pcDevs); 873 864 } … … 1010 1001 { 1011 1002 /* dbg breakpoint */ 1012 Assert (0);1003 AssertFailed(); 1013 1004 } 1014 1005 #endif … … 1261 1252 1262 1253 /* 1263 * Register the Window Class and the hitten window create.1254 * Register the Window Class and create the hidden window. 1264 1255 */ 1265 1256 WNDCLASS wc; … … 1467 1458 * We're DONE! 1468 1459 * 1469 * Jus eensure that the event is set so the1460 * Just ensure that the event is set so the 1470 1461 * first "wait change" request is processed. 1471 1462 */
Note:
See TracChangeset
for help on using the changeset viewer.