VBOX: Clean-up Vbox 4.2/4.3/5.0 support.

This commit is contained in:
Rom Walton 2015-04-01 15:29:18 -04:00
parent 228e82a4b7
commit fc621bf1c8
1 changed files with 9 additions and 11 deletions

View File

@ -428,17 +428,16 @@ int VBOX_VM::create_vm() {
// Tweak the VM's USB Configuration
//
vboxlog_msg("Disabling USB Support for VM.");
#ifdef _VIRTUALBOX43_
rc = pMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &lOHCICtrls);
if (SUCCEEDED(rc) && lOHCICtrls) {
pMachine->RemoveUSBController(CComBSTR("OHCI"));
}
#endif
#ifdef _VIRTUALBOX42_
rc = pMachine->get_USBController(&pUSBContoller);
if (SUCCEEDED(rc)) {
pUSBContoller->put_Enabled(FALSE);
}
#else
rc = pMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &lOHCICtrls);
if (SUCCEEDED(rc) && lOHCICtrls) {
pMachine->RemoveUSBController(CComBSTR("OHCI"));
}
#endif
// Tweak the VM's COM Port Support
@ -1007,16 +1006,15 @@ int VBOX_VM::deregister_vm(bool delete_media) {
pMedium->Close();
}
#ifdef _VIRTUALBOX43_
pMachineRO->DeleteConfig(pEmptyHardDisks, &pProgress);
#ifdef _VIRTUALBOX42_
pMachineRO->Delete(pEmptyHardDisks, &pProgress);
if (SUCCEEDED(rc)) {
pProgress->WaitForCompletion(-1);
} else {
CHECK_ERROR(rc);
}
#endif
#ifdef _VIRTUALBOX42_
pMachineRO->Delete(pEmptyHardDisks, &pProgress);
#else
pMachineRO->DeleteConfig(pEmptyHardDisks, &pProgress);
if (SUCCEEDED(rc)) {
pProgress->WaitForCompletion(-1);
} else {