Skip to content

Commit 0fe2140

Browse files
committed
VBOX: Adjust the startup logic to support Vbox 5.1 (MSCOM)
1 parent 5d0ac6d commit 0fe2140

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

samples/vboxwrapper/vboxwrapper.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#include "vbox_mscom42.h"
8282
#include "vbox_mscom43.h"
8383
#include "vbox_mscom50.h"
84+
#include "vbox_mscom51.h"
8485
#endif
8586
#include "vbox_vboxmanage.h"
8687

@@ -450,7 +451,9 @@ int main(int argc, char** argv) {
450451

451452
if (BOINC_SUCCESS != vbox42::VBOX_VM::get_version_information(vbox_version_raw, vbox_version_display)) {
452453
if (BOINC_SUCCESS != vbox43::VBOX_VM::get_version_information(vbox_version_raw, vbox_version_display)) {
453-
vbox50::VBOX_VM::get_version_information(vbox_version_raw, vbox_version_display);
454+
if (BOINC_SUCCESS != vbox50::VBOX_VM::get_version_information(vbox_version_raw, vbox_version_display)) {
455+
vbox51::VBOX_VM::get_version_information(vbox_version_raw, vbox_version_display);
456+
}
454457
}
455458
}
456459
if (!vbox_version_raw.empty()) {
@@ -471,14 +474,22 @@ int main(int argc, char** argv) {
471474
pVM = NULL;
472475
}
473476
}
474-
if ((5 == vbox_major) && (0 <= vbox_minor)) {
477+
if ((5 == vbox_major) && (0 == vbox_minor)) {
475478
pVM = (VBOX_VM*) new vbox50::VBOX_VM();
476479
retval = pVM->initialize();
477480
if (retval) {
478481
delete pVM;
479482
pVM = NULL;
480483
}
481484
}
485+
if ((5 == vbox_major) && (1 <= vbox_minor)) {
486+
pVM = (VBOX_VM*) new vbox51::VBOX_VM();
487+
retval = pVM->initialize();
488+
if (retval) {
489+
delete pVM;
490+
pVM = NULL;
491+
}
492+
}
482493
}
483494
if (!pVM) {
484495
pVM = (VBOX_VM*) new vboxmanage::VBOX_VM();

0 commit comments

Comments
 (0)