Changeset 26971 in vbox
- Timestamp:
- Mar 2, 2010 8:45:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r26936 r26971 1220 1220 case MODIFYVM_HIDPTR: 1221 1221 { 1222 bool fEnableUsb = false; 1222 1223 if (!strcmp(ValueUnion.psz, "ps2")) 1223 1224 { … … 1227 1228 { 1228 1229 CHECK_ERROR(machine, COMSETTER(PointingHidType)(PointingHidType_USBMouse)); 1230 if (SUCCEEDED(rc)) 1231 fEnableUsb = true; 1229 1232 } 1230 1233 else if (!strcmp(ValueUnion.psz, "usbtablet")) 1231 1234 { 1232 1235 CHECK_ERROR(machine, COMSETTER(PointingHidType)(PointingHidType_USBTablet)); 1236 if (SUCCEEDED(rc)) 1237 fEnableUsb = true; 1233 1238 } 1234 1239 else … … 1237 1242 rc = E_FAIL; 1238 1243 } 1244 if (fEnableUsb) 1245 { 1246 /* Make sure the OHCI controller is enabled. */ 1247 ComPtr<IUSBController> UsbCtl; 1248 rc = machine->COMGETTER(USBController)(UsbCtl.asOutParam()); 1249 if (SUCCEEDED(rc)) 1250 { 1251 BOOL fEnabled; 1252 rc = UsbCtl->COMGETTER(Enabled)(&fEnabled); 1253 if (FAILED(rc)) 1254 fEnabled = false; 1255 if (!fEnabled) 1256 CHECK_ERROR(UsbCtl, COMSETTER(Enabled)(true)); 1257 } 1258 } 1239 1259 break; 1240 1260 } … … 1242 1262 case MODIFYVM_HIDKBD: 1243 1263 { 1264 bool fEnableUsb = false; 1244 1265 if (!strcmp(ValueUnion.psz, "ps2")) 1245 1266 { … … 1249 1270 { 1250 1271 CHECK_ERROR(machine, COMSETTER(KeyboardHidType)(KeyboardHidType_USBKeyboard)); 1272 if (SUCCEEDED(rc)) 1273 fEnableUsb = true; 1251 1274 } 1252 1275 else … … 1254 1277 errorArgument("Invalid type '%s' specfied for keyboard", ValueUnion.psz); 1255 1278 rc = E_FAIL; 1279 } 1280 if (fEnableUsb) 1281 { 1282 /* Make sure the OHCI controller is enabled. */ 1283 ComPtr<IUSBController> UsbCtl; 1284 rc = machine->COMGETTER(USBController)(UsbCtl.asOutParam()); 1285 if (SUCCEEDED(rc)) 1286 { 1287 BOOL fEnabled; 1288 rc = UsbCtl->COMGETTER(Enabled)(&fEnabled); 1289 if (FAILED(rc)) 1290 fEnabled = false; 1291 if (!fEnabled) 1292 CHECK_ERROR(UsbCtl, COMSETTER(Enabled)(true)); 1293 } 1256 1294 } 1257 1295 break;
Note:
See TracChangeset
for help on using the changeset viewer.