Changeset 17553 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 9, 2009 9:34:22 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r17419 r17553 591 591 else 592 592 { 593 ComPtr <IUSBDeviceCollection> coll;594 CHECK_ERROR_BREAK (console, COMGETTER(USBDevices)( coll.asOutParam()));593 SafeIfaceArray <IUSBDevice> coll; 594 CHECK_ERROR_BREAK (console, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll))); 595 595 ComPtr <IUSBDevice> dev; 596 CHECK_ERROR_BREAK (coll, FindByAddress (Bstr (a->argv [2]), dev.asOutParam())); 596 CHECK_ERROR_BREAK (console, FindUSBDeviceByAddress (Bstr (a->argv [2]), 597 dev.asOutParam())); 597 598 CHECK_ERROR_BREAK (dev, COMGETTER(Id) (usbId.asOutParam())); 598 599 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r17336 r17553 1313 1313 RTPrintf ("Currently Attached USB Devices:\n\n"); 1314 1314 1315 ComPtr <IUSBDeviceCollection> coll; 1316 CHECK_ERROR_RET (console, COMGETTER(USBDevices) (coll.asOutParam()), rc); 1317 1318 ComPtr <IUSBDeviceEnumerator> en; 1319 CHECK_ERROR_RET (coll, Enumerate (en.asOutParam()), rc); 1320 1321 BOOL more = FALSE; 1322 ASSERT(SUCCEEDED(rc = en->HasMore (&more))); 1323 if (FAILED(rc)) 1324 return rc; 1325 1326 if (!more) 1315 SafeIfaceArray <IUSBDevice> coll; 1316 CHECK_ERROR_RET (console, COMGETTER(USBDevices) (ComSafeArrayAsOutParam(coll)), rc); 1317 1318 if (coll.size() == 0) 1327 1319 { 1328 1320 if (details != VMINFO_MACHINEREADABLE) … … 1330 1322 } 1331 1323 else 1332 while (more)1333 1324 { 1334 ComPtr <IUSBDevice> dev; 1335 ASSERT(SUCCEEDED(rc = en->GetNext (dev.asOutParam()))); 1336 if (FAILED(rc)) 1337 return rc; 1338 1339 /* Query info. */ 1340 Guid id; 1341 CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc); 1342 USHORT usVendorId; 1343 CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc); 1344 USHORT usProductId; 1345 CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc); 1346 USHORT bcdRevision; 1347 CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc); 1348 1349 if (details == VMINFO_MACHINEREADABLE) 1350 RTPrintf("USBAttachedUUID%d=\"%S\"\n" 1351 "USBAttachedVendorId%d=\"%#06x\"\n" 1352 "USBAttachedProductId%d=\"%#06x\"\n" 1353 "USBAttachedRevision%d=\"%#04x%02x\"\n", 1354 index + 1, id.toString().raw(), 1355 index + 1, usVendorId, 1356 index + 1, usProductId, 1357 index + 1, bcdRevision >> 8, bcdRevision & 0xff); 1358 else 1359 RTPrintf("UUID: %S\n" 1360 "VendorId: 0x%04x (%04X)\n" 1361 "ProductId: 0x%04x (%04X)\n" 1362 "Revision: %u.%u (%02u%02u)\n", 1363 id.toString().raw(), 1364 usVendorId, usVendorId, usProductId, usProductId, 1365 bcdRevision >> 8, bcdRevision & 0xff, 1366 bcdRevision >> 8, bcdRevision & 0xff); 1367 1368 /* optional stuff. */ 1369 Bstr bstr; 1370 CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc); 1371 if (!bstr.isEmpty()) 1325 for (index = 0; index < coll.size(); ++index) 1372 1326 { 1327 ComPtr <IUSBDevice> dev = coll[index]; 1328 1329 /* Query info. */ 1330 Guid id; 1331 CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc); 1332 USHORT usVendorId; 1333 CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc); 1334 USHORT usProductId; 1335 CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc); 1336 USHORT bcdRevision; 1337 CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc); 1338 1373 1339 if (details == VMINFO_MACHINEREADABLE) 1374 RTPrintf("USBAttachedManufacturer%d=\"%lS\"\n", index + 1, bstr.raw()); 1340 RTPrintf("USBAttachedUUID%zu=\"%S\"\n" 1341 "USBAttachedVendorId%zu=\"%#06x\"\n" 1342 "USBAttachedProductId%zu=\"%#06x\"\n" 1343 "USBAttachedRevision%zu=\"%#04x%02x\"\n", 1344 index + 1, id.toString().raw(), 1345 index + 1, usVendorId, 1346 index + 1, usProductId, 1347 index + 1, bcdRevision >> 8, bcdRevision & 0xff); 1375 1348 else 1376 RTPrintf("Manufacturer: %lS\n", bstr.raw()); 1349 RTPrintf("UUID: %S\n" 1350 "VendorId: 0x%04x (%04X)\n" 1351 "ProductId: 0x%04x (%04X)\n" 1352 "Revision: %u.%u (%02u%02u)\n", 1353 id.toString().raw(), 1354 usVendorId, usVendorId, usProductId, usProductId, 1355 bcdRevision >> 8, bcdRevision & 0xff, 1356 bcdRevision >> 8, bcdRevision & 0xff); 1357 1358 /* optional stuff. */ 1359 Bstr bstr; 1360 CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc); 1361 if (!bstr.isEmpty()) 1362 { 1363 if (details == VMINFO_MACHINEREADABLE) 1364 RTPrintf("USBAttachedManufacturer%zu=\"%lS\"\n", index + 1, bstr.raw()); 1365 else 1366 RTPrintf("Manufacturer: %lS\n", bstr.raw()); 1367 } 1368 CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc); 1369 if (!bstr.isEmpty()) 1370 { 1371 if (details == VMINFO_MACHINEREADABLE) 1372 RTPrintf("USBAttachedProduct%zu=\"%lS\"\n", index + 1, bstr.raw()); 1373 else 1374 RTPrintf("Product: %lS\n", bstr.raw()); 1375 } 1376 CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc); 1377 if (!bstr.isEmpty()) 1378 { 1379 if (details == VMINFO_MACHINEREADABLE) 1380 RTPrintf("USBAttachedSerialNumber%zu=\"%lS\"\n", index + 1, bstr.raw()); 1381 else 1382 RTPrintf("SerialNumber: %lS\n", bstr.raw()); 1383 } 1384 CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc); 1385 if (!bstr.isEmpty()) 1386 { 1387 if (details == VMINFO_MACHINEREADABLE) 1388 RTPrintf("USBAttachedAddress%zu=\"%lS\"\n", index + 1, bstr.raw()); 1389 else 1390 RTPrintf("Address: %lS\n", bstr.raw()); 1391 } 1392 1393 if (details != VMINFO_MACHINEREADABLE) 1394 RTPrintf("\n"); 1377 1395 } 1378 CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);1379 if (!bstr.isEmpty())1380 {1381 if (details == VMINFO_MACHINEREADABLE)1382 RTPrintf("USBAttachedProduct%d=\"%lS\"\n", index + 1, bstr.raw());1383 else1384 RTPrintf("Product: %lS\n", bstr.raw());1385 }1386 CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);1387 if (!bstr.isEmpty())1388 {1389 if (details == VMINFO_MACHINEREADABLE)1390 RTPrintf("USBAttachedSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());1391 else1392 RTPrintf("SerialNumber: %lS\n", bstr.raw());1393 }1394 CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);1395 if (!bstr.isEmpty())1396 {1397 if (details == VMINFO_MACHINEREADABLE)1398 RTPrintf("USBAttachedAddress%d=\"%lS\"\n", index + 1, bstr.raw());1399 else1400 RTPrintf("Address: %lS\n", bstr.raw());1401 }1402 1403 if (details != VMINFO_MACHINEREADABLE)1404 RTPrintf("\n");1405 1406 ASSERT(SUCCEEDED(rc = en->HasMore (&more)));1407 if (FAILED(rc))1408 return rc;1409 1410 index ++;1411 1396 } 1412 1397 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r17377 r17553 1976 1976 mDevicesUSBMenu->setEnabled (isRunningOrPaused); 1977 1977 1978 CUSBDevice Enumerator en = cconsole.GetUSBDevices().Enumerate();1979 while (en.HasMore())1978 CUSBDeviceVector devsvec = cconsole.GetUSBDevices(); 1979 for (int i = 0; i < devsvec.size(); ++i) 1980 1980 { 1981 CUSBDevice usb = en.GetNext();1981 CUSBDevice usb = devsvec[i]; 1982 1982 info += QString ("<br><b><nobr>%1</nobr></b>") 1983 1983 .arg (vboxGlobal().details (usb)); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r17476 r17553 5544 5544 { 5545 5545 CUSBDevice attachedUSB = 5546 mConsole. GetUSBDevices().FindById (usb.GetId());5546 mConsole.FindUSBDeviceById (usb.GetId()); 5547 5547 action->setChecked (!attachedUSB.isNull()); 5548 5548 action->setEnabled (dev.GetState() !=
Note:
See TracChangeset
for help on using the changeset viewer.