From 8f1c767593ecc77fe7e23872fe73b83676650c3d Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sun, 11 Oct 2015 16:18:55 -0400 Subject: [PATCH] Revert "VBOX: Fix a crashing bug on Windows. If we fail to acquire a machine state lock, just report a VM start failure instead of crashing." This reverts commit 7efd4b474b3168cdc281ee2d4977250e53866621. --- samples/vboxwrapper/vbox_mscom_impl.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/samples/vboxwrapper/vbox_mscom_impl.cpp b/samples/vboxwrapper/vbox_mscom_impl.cpp index 0e5a3b996b..9a95a456d6 100644 --- a/samples/vboxwrapper/vbox_mscom_impl.cpp +++ b/samples/vboxwrapper/vbox_mscom_impl.cpp @@ -1394,28 +1394,25 @@ int VBOX_VM::start() { // We should now own what goes on with the VM. // - rc = pMachineRO->LockMachine(m_pPrivate->m_pSession, LockType_Write); - if (CHECK_ERROR(rc)) goto CLEANUP; - - rc = m_pPrivate->m_pSession->get_Machine(&m_pPrivate->m_pMachine); - if (CHECK_ERROR(rc)) goto CLEANUP; + pMachineRO->LockMachine(m_pPrivate->m_pSession, LockType_Write); + m_pPrivate->m_pSession->get_Machine(&m_pPrivate->m_pMachine); rc = m_pPrivate->m_pMachine->get_SessionPID((ULONG*)&vm_pid); if (CHECK_ERROR(rc)) goto CLEANUP; vm_pid_handle = OpenProcess( - PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION, - FALSE, - vm_pid + PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION, + FALSE, + vm_pid ); // Make sure we are in a running state before proceeding // timeout = dtime() + 300; do { - poll(false); - if (online) break; - boinc_sleep(1.0); + poll(false); + if (online) break; + boinc_sleep(1.0); } while (timeout >= dtime()); vboxlog_msg("Successfully started VM. (PID = '%d')", vm_pid);