From 4c5b9eb9f448499c7109c982d14cc1527be9bc7f Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 12 Jul 2016 23:13:43 -0700 Subject: [PATCH] VBOX: Fix build break. --- samples/vboxwrapper/vbox_mscom_impl.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/vboxwrapper/vbox_mscom_impl.cpp b/samples/vboxwrapper/vbox_mscom_impl.cpp index dea4742b0c..16e9995883 100644 --- a/samples/vboxwrapper/vbox_mscom_impl.cpp +++ b/samples/vboxwrapper/vbox_mscom_impl.cpp @@ -1612,7 +1612,7 @@ int VBOX_VM::capture_screenshot() { GuestMonitorStatus monitorStatus; string virtual_machine_slot_directory; string screenshot_location; - HRESULT rc, rc2; + HRESULT rc; FILE* f = NULL; SAFEARRAY* pScreenshot = NULL; CComSafeArray aScreenshot; @@ -1628,13 +1628,16 @@ int VBOX_VM::capture_screenshot() { if (CHECK_ERROR(rc)) { } else { rc = pConsole->get_Display(&pDisplay); - rc2 = pConsole->get_Keyboard(&pKeyboard); - if (CHECK_ERROR(rc) || CHECK_ERROR(rc2)) { + if (CHECK_ERROR(rc)) { } else { // Due to a recently fixed bug in VirtualBox we are going to attempt to prevent receiving garbage // by waking up the console. We'll attempt to virtually tap the 'spacebar'. - pKeyboard->PutScancode(0x39); - boinc_sleep(1); + rc = pConsole->get_Keyboard(&pKeyboard); + if (CHECK_ERROR(rc)) { + } else { + pKeyboard->PutScancode(0x39); + boinc_sleep(1); + } rc = pDisplay->GetScreenResolution(0, &width, &height, &bpp, &xOrigin, &yOrigin, &monitorStatus); if (CHECK_ERROR(rc)) {