- Timestamp:
- May 31, 2022 9:31:45 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151632
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
r93115 r95141 194 194 return VINF_SUCCESS; /* Nothing to do. */ 195 195 196 HRESULT rc;196 HRESULT hrc; 197 197 ComPtr <IMachine> machine; 198 198 CHECK_ERROR_RET(g_pVirtualBox, FindMachine(strUuid.raw(), … … 248 248 /* First pause so we don't trigger a live save which needs more time/resources. */ 249 249 bool fPaused = false; 250 rc = console->Pause();251 if (FAILED( rc))250 hrc = console->Pause(); 251 if (FAILED(hrc)) 252 252 { 253 253 bool fError = true; 254 if ( rc == VBOX_E_INVALID_VM_STATE)254 if (hrc == VBOX_E_INVALID_VM_STATE) 255 255 { 256 256 /* Check if we are already paused. */ 257 257 CHECK_ERROR_BREAK(console, COMGETTER(State)(&machineState)); 258 258 /* The error code was lost by the previous instruction. */ 259 rc = VBOX_E_INVALID_VM_STATE;259 hrc = VBOX_E_INVALID_VM_STATE; 260 260 if (machineState != MachineState_Paused) 261 261 { … … 274 274 275 275 CHECK_ERROR(sessionMachine, SaveState(progress.asOutParam())); 276 if (SUCCEEDED( rc))276 if (SUCCEEDED(hrc)) 277 277 { 278 278 progress->WaitForCompletion(cMsTimeout); … … 281 281 } 282 282 283 if (SUCCEEDED( rc))283 if (SUCCEEDED(hrc)) 284 284 { 285 285 serviceLogVerbose(("apimon: State of machine \"%ls\" saved, powering off ...\n", strUuid.raw())); … … 314 314 315 315 316 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR;316 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; 317 317 } 318 318 … … 458 458 static DECLCALLBACK(int) VBoxModAPIMonitorInit(void) 459 459 { 460 HRESULT rc = S_OK;460 HRESULT hrc = S_OK; 461 461 462 462 do … … 518 518 } while (0); 519 519 520 if (SUCCEEDED( rc))520 if (SUCCEEDED(hrc)) 521 521 { 522 522 g_uAPIMonIslnLastBeatMS = 0; 523 523 } 524 524 525 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; /** @todo Find a better rc! */525 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; /** @todo Find a better rc! */ 526 526 } 527 527 … … 536 536 537 537 int vrc = VINF_SUCCESS; 538 HRESULT rc;538 HRESULT hrc; 539 539 540 540 #ifdef DEBUG … … 548 548 CHECK_ERROR_BREAK(g_pVirtualBox, GetExtraData(Bstr("Watchdog/APIMonitor/Heartbeat").raw(), 549 549 strHeartbeat.asOutParam())); 550 if ( SUCCEEDED( rc)550 if ( SUCCEEDED(hrc) 551 551 && !strHeartbeat.isEmpty() 552 552 && g_strAPIMonIslnLastBeat.compare(strHeartbeat, Bstr::CaseSensitive)) … … 571 571 } while (0); 572 572 573 if (FAILED( rc))573 if (FAILED(hrc)) 574 574 vrc = VERR_COM_IPRT_ERROR; 575 575 -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
r93115 r95141 189 189 190 190 Bstr strValue; 191 HRESULT hr = g_pVirtualBox->GetExtraData(Bstr("VBoxInternal/Guest/BalloonSizeMax").raw(),192 strValue.asOutParam());193 if ( SUCCEEDED(hr )191 HRESULT hrc = g_pVirtualBox->GetExtraData(Bstr("VBoxInternal/Guest/BalloonSizeMax").raw(), 192 strValue.asOutParam()); 193 if ( SUCCEEDED(hrc) 194 194 && strValue.isNotEmpty()) 195 195 { … … 254 254 255 255 Bstr strValue; 256 HRESULT hr = rptrMachine->GetExtraData(Bstr("VBoxInternal2/Watchdog/BalloonCtrl/BalloonSizeMax").raw(),257 strValue.asOutParam());258 if ( SUCCEEDED(hr )256 HRESULT hrc = rptrMachine->GetExtraData(Bstr("VBoxInternal2/Watchdog/BalloonCtrl/BalloonSizeMax").raw(), 257 strValue.asOutParam()); 258 if ( SUCCEEDED(hrc) 259 259 && strValue.isNotEmpty()) 260 260 { … … 265 265 else 266 266 { 267 hr = rptrMachine->GetExtraData(Bstr("VBoxInternal/Guest/BalloonSizeMax").raw(),268 strValue.asOutParam());269 if ( SUCCEEDED(hr )267 hrc = rptrMachine->GetExtraData(Bstr("VBoxInternal/Guest/BalloonSizeMax").raw(), 268 strValue.asOutParam()); 269 if ( SUCCEEDED(hrc) 270 270 && strValue.isNotEmpty()) 271 271 { … … 276 276 } 277 277 278 if ( FAILED(hr )278 if ( FAILED(hrc) 279 279 || strValue.isEmpty()) 280 280 { … … 303 303 304 304 Bstr strValue; 305 HRESULT hr = g_pVirtualBox->GetExtraData(Bstr("VBoxInternal/Guest/BalloonEnabled").raw(),306 strValue.asOutParam());307 if ( SUCCEEDED(hr )305 HRESULT hrc = g_pVirtualBox->GetExtraData(Bstr("VBoxInternal/Guest/BalloonEnabled").raw(), 306 strValue.asOutParam()); 307 if ( SUCCEEDED(hrc) 308 308 && strValue.isNotEmpty()) 309 309 { … … 313 313 else 314 314 { 315 hr = rptrMachine->GetExtraData(Bstr("VBoxInternal2/Watchdog/BalloonCtrl/BalloonEnabled").raw(),316 strValue.asOutParam());317 if (SUCCEEDED(hr ))315 hrc = rptrMachine->GetExtraData(Bstr("VBoxInternal2/Watchdog/BalloonCtrl/BalloonEnabled").raw(), 316 strValue.asOutParam()); 317 if (SUCCEEDED(hrc)) 318 318 { 319 319 if (g_fVerbose) … … 379 379 strMetricNames.cloneTo(&metricNames[0]); 380 380 381 HRESULT rc = m.queryInterfaceTo(&metricObjects[0]);381 HRESULT hrc = m.queryInterfaceTo(&metricObjects[0]); 382 382 383 383 #ifdef VBOX_WATCHDOG_GLOBAL_PERFCOL … … 397 397 ComSafeArrayAsOutParam(metricAffected))); 398 398 #endif 399 if (FAILED( rc))399 if (FAILED(hrc)) 400 400 vrc = VERR_COM_IPRT_ERROR; /** @todo Find better rc! */ 401 401 … … 515 515 516 516 /* Open a session for the VM. */ 517 HRESULT rc;517 HRESULT hrc; 518 518 CHECK_ERROR_RET(pMachine->machine, LockMachine(g_pSession, LockType_Shared), VERR_ACCESS_DENIED); 519 519 … … 525 525 526 526 ComPtr <IGuest> guest; 527 rc = console->COMGETTER(Guest)(guest.asOutParam());528 if (SUCCEEDED( rc))527 hrc = console->COMGETTER(Guest)(guest.asOutParam()); 528 if (SUCCEEDED(hrc)) 529 529 CHECK_ERROR_BREAK(guest, COMSETTER(MemoryBalloonSize)((LONG)cMbBalloonCur)); 530 530 else 531 531 serviceLog("Error: Unable to set new balloon size %RU32 for machine '%ls', rc=%Rhrc\n", 532 cMbBalloonCur, pMachine->strName.raw(), rc);533 if (FAILED( rc))532 cMbBalloonCur, pMachine->strName.raw(), hrc); 533 if (FAILED(hrc)) 534 534 vrc = VERR_COM_IPRT_ERROR; 535 535 -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
r93115 r95141 189 189 Bstr uuid; 190 190 BOOL fRegistered; 191 HRESULT hr = pEvent->COMGETTER(Registered)(&fRegistered);192 if (SUCCEEDED(hr ))193 hr = pEvent->COMGETTER(MachineId)(uuid.asOutParam());194 195 if (SUCCEEDED(hr ))191 HRESULT hrc = pEvent->COMGETTER(Registered)(&fRegistered); 192 if (SUCCEEDED(hrc)) 193 hrc = pEvent->COMGETTER(MachineId)(uuid.asOutParam()); 194 195 if (SUCCEEDED(hrc)) 196 196 { 197 197 int rc = RTCritSectEnter(&g_csMachines); … … 218 218 Bstr uuid; 219 219 220 HRESULT hr = pEvent->COMGETTER(State)(&machineState);221 if (SUCCEEDED(hr ))222 hr = pEvent->COMGETTER(MachineId)(uuid.asOutParam());223 224 if (SUCCEEDED(hr ))220 HRESULT hrc = pEvent->COMGETTER(State)(&machineState); 221 if (SUCCEEDED(hrc)) 222 hrc = pEvent->COMGETTER(MachineId)(uuid.asOutParam()); 223 224 if (SUCCEEDED(hrc)) 225 225 { 226 226 int rc = RTCritSectEnter(&g_csMachines); … … 349 349 static int machineAdd(const Bstr &strUuid) 350 350 { 351 HRESULT rc;351 HRESULT hrc; 352 352 353 353 /** @todo Add exception handling! */ … … 423 423 if (RT_FAILURE(rc2)) 424 424 serviceLog("OnMachineRegistered: Module '%s' reported an error: %Rrc\n", 425 g_aModules[j].pDesc->pszName, rc);425 g_aModules[j].pDesc->pszName, hrc); 426 426 /* Keep going. */ 427 427 } … … 431 431 /** @todo Add std exception handling! */ 432 432 433 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; /** @todo Find a better error! */433 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; /** @todo Find a better error! */ 434 434 } 435 435 … … 696 696 static RTEXITCODE watchdogMain(/*HandlerArg *a */) 697 697 { 698 HRESULT rc = S_OK;698 HRESULT hrc = S_OK; 699 699 700 700 do … … 797 797 798 798 if (RT_FAILURE(vrc)) 799 rc = VBOX_E_IPRT_ERROR;799 hrc = VBOX_E_IPRT_ERROR; 800 800 801 801 } while (0); 802 802 803 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;803 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 804 804 } 805 805 … … 934 934 * Setup VirtualBox + session interfaces. 935 935 */ 936 HRESULT rc = g_pVirtualBoxClient->COMGETTER(VirtualBox)(g_pVirtualBox.asOutParam());937 if (SUCCEEDED( rc))938 { 939 rc = g_pSession.createInprocObject(CLSID_Session);940 if (FAILED( rc))941 RTMsgError("Failed to create a session object (rc=%Rhrc)!", rc);936 HRESULT hrc = g_pVirtualBoxClient->COMGETTER(VirtualBox)(g_pVirtualBox.asOutParam()); 937 if (SUCCEEDED(hrc)) 938 { 939 hrc = g_pSession.createInprocObject(CLSID_Session); 940 if (FAILED(hrc)) 941 RTMsgError("Failed to create a session object (rc=%Rhrc)!", hrc); 942 942 } 943 943 else 944 RTMsgError("Failed to get VirtualBox object (rc=%Rhrc)!", rc);945 946 if (FAILED( rc))944 RTMsgError("Failed to get VirtualBox object (rc=%Rhrc)!", hrc); 945 946 if (FAILED(hrc)) 947 947 return VERR_COM_OBJECT_NOT_FOUND; 948 948 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r93901 r95141 869 869 } 870 870 871 HRESULT rc;871 HRESULT hrc; 872 872 int vrc; 873 873 Guid uuidVM; … … 1386 1386 } 1387 1387 1388 rc = com::Initialize();1388 hrc = com::Initialize(); 1389 1389 #ifdef VBOX_WITH_XPCOM 1390 if ( rc == NS_ERROR_FILE_ACCESS_DENIED)1390 if (hrc == NS_ERROR_FILE_ACCESS_DENIED) 1391 1391 { 1392 1392 char szHome[RTPATH_MAX] = ""; … … 1396 1396 } 1397 1397 #endif 1398 if (FAILED( rc))1399 { 1400 RTPrintf("Error: COM initialization failed (rc=%Rhrc)!\n", rc);1398 if (FAILED(hrc)) 1399 { 1400 RTPrintf("Error: COM initialization failed (rc=%Rhrc)!\n", hrc); 1401 1401 return 1; 1402 1402 } … … 1418 1418 ComPtr<IGraphicsAdapter> pGraphicsAdapter; 1419 1419 1420 rc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient);1421 if (FAILED( rc))1420 hrc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 1421 if (FAILED(hrc)) 1422 1422 { 1423 1423 com::ErrorInfo info; … … 1426 1426 info.getText().raw(), info.getComponent().raw()); 1427 1427 else 1428 RTPrintf("Failed to create VirtualBoxClient object! No error information available (rc=%Rhrc).\n", rc);1428 RTPrintf("Failed to create VirtualBoxClient object! No error information available (rc=%Rhrc).\n", hrc); 1429 1429 goto leave; 1430 1430 } 1431 1431 1432 rc = pVirtualBoxClient->COMGETTER(VirtualBox)(pVirtualBox.asOutParam());1433 if (FAILED( rc))1434 { 1435 RTPrintf("Failed to get VirtualBox object (rc=%Rhrc)!\n", rc);1432 hrc = pVirtualBoxClient->COMGETTER(VirtualBox)(pVirtualBox.asOutParam()); 1433 if (FAILED(hrc)) 1434 { 1435 RTPrintf("Failed to get VirtualBox object (rc=%Rhrc)!\n", hrc); 1436 1436 goto leave; 1437 1437 } 1438 rc = pVirtualBoxClient->COMGETTER(Session)(pSession.asOutParam());1439 if (FAILED( rc))1440 { 1441 RTPrintf("Failed to get session object (rc=%Rhrc)!\n", rc);1438 hrc = pVirtualBoxClient->COMGETTER(Session)(pSession.asOutParam()); 1439 if (FAILED(hrc)) 1440 { 1441 RTPrintf("Failed to get session object (rc=%Rhrc)!\n", hrc); 1442 1442 goto leave; 1443 1443 } … … 1446 1446 { 1447 1447 CHECK_ERROR(pVirtualBox, SetSettingsSecret(Bstr(pcszSettingsPw).raw())); 1448 if (FAILED( rc))1448 if (FAILED(hrc)) 1449 1449 goto leave; 1450 1450 } … … 1461 1461 if (uuidVM.isValid()) 1462 1462 { 1463 rc = pVirtualBox->FindMachine(uuidVM.toUtf16().raw(), pMachine.asOutParam());1464 if (FAILED( rc) || !pMachine)1463 hrc = pVirtualBox->FindMachine(uuidVM.toUtf16().raw(), pMachine.asOutParam()); 1464 if (FAILED(hrc) || !pMachine) 1465 1465 { 1466 1466 RTPrintf("Error: machine with the given ID not found!\n"); … … 1473 1473 * Do we have a name but no UUID? 1474 1474 */ 1475 rc = pVirtualBox->FindMachine(Bstr(vmName).raw(), pMachine.asOutParam());1476 if (( rc == S_OK) && pMachine)1475 hrc = pVirtualBox->FindMachine(Bstr(vmName).raw(), pMachine.asOutParam()); 1476 if ((hrc == S_OK) && pMachine) 1477 1477 { 1478 1478 Bstr bstrId; … … 1492 1492 AssertReleaseRC(vrc); 1493 1493 1494 rc = pVirtualBoxClient->CheckMachineError(pMachine);1495 if (FAILED( rc))1494 hrc = pVirtualBoxClient->CheckMachineError(pMachine); 1495 if (FAILED(hrc)) 1496 1496 { 1497 1497 com::ErrorInfo info; … … 1500 1500 info.getText().raw(), info.getComponent().raw()); 1501 1501 else 1502 RTPrintf("Failed to check for VM errors! No error information available (rc=%Rhrc).\n", rc);1502 RTPrintf("Failed to check for VM errors! No error information available (rc=%Rhrc).\n", hrc); 1503 1503 goto leave; 1504 1504 } … … 1520 1520 { 1521 1521 ComPtr<IProgress> progress; 1522 rc = pMachine->LaunchVMProcess(pSession, Bstr("headless").raw(), ComSafeArrayNullInParam(), progress.asOutParam());1523 if (SUCCEEDED( rc) && !progress.isNull())1522 hrc = pMachine->LaunchVMProcess(pSession, Bstr("headless").raw(), ComSafeArrayNullInParam(), progress.asOutParam()); 1523 if (SUCCEEDED(hrc) && !progress.isNull()) 1524 1524 { 1525 1525 RTPrintf("Waiting for VM to power on...\n"); 1526 rc = progress->WaitForCompletion(-1);1527 if (SUCCEEDED( rc))1526 hrc = progress->WaitForCompletion(-1); 1527 if (SUCCEEDED(hrc)) 1528 1528 { 1529 1529 BOOL completed = true; 1530 rc = progress->COMGETTER(Completed)(&completed);1531 if (SUCCEEDED( rc))1530 hrc = progress->COMGETTER(Completed)(&completed); 1531 if (SUCCEEDED(hrc)) 1532 1532 { 1533 1533 LONG iRc; 1534 rc = progress->COMGETTER(ResultCode)(&iRc);1535 if (SUCCEEDED( rc))1534 hrc = progress->COMGETTER(ResultCode)(&iRc); 1535 if (SUCCEEDED(hrc)) 1536 1536 { 1537 1537 if (FAILED(iRc)) … … 1554 1554 } 1555 1555 } 1556 if (FAILED( rc))1556 if (FAILED(hrc)) 1557 1557 { 1558 1558 RTPrintf("Error: failed to power up VM! No error text available.\n"); … … 1560 1560 } 1561 1561 1562 rc = pMachine->LockMachine(pSession, LockType_Shared);1562 hrc = pMachine->LockMachine(pSession, LockType_Shared); 1563 1563 } 1564 1564 else 1565 1565 { 1566 1566 pSession->COMSETTER(Name)(Bstr("GUI/SDL").raw()); 1567 rc = pMachine->LockMachine(pSession, LockType_VM);1568 } 1569 1570 if (FAILED( rc))1567 hrc = pMachine->LockMachine(pSession, LockType_VM); 1568 } 1569 1570 if (FAILED(hrc)) 1571 1571 { 1572 1572 com::ErrorInfo info; … … 1694 1694 ComPtr<IHost> pHost; 1695 1695 CHECK_ERROR_BREAK(pVirtualBox, COMGETTER(Host)(pHost.asOutParam())); 1696 rc = pHost->FindHostFloppyDrive(bstrFdaFile.raw(),1696 hrc = pHost->FindHostFloppyDrive(bstrFdaFile.raw(), 1697 1697 pMedium.asOutParam()); 1698 if (FAILED( rc))1698 if (FAILED(hrc)) 1699 1699 { 1700 1700 /* try to find an existing one */ 1701 rc = pVirtualBox->OpenMedium(bstrFdaFile.raw(),1701 hrc = pVirtualBox->OpenMedium(bstrFdaFile.raw(), 1702 1702 DeviceType_Floppy, 1703 1703 AccessMode_ReadWrite, 1704 1704 FALSE /* fForceNewUuid */, 1705 1705 pMedium.asOutParam()); 1706 if (FAILED( rc))1706 if (FAILED(hrc)) 1707 1707 { 1708 1708 /* try to add to the list */ … … 1756 1756 } 1757 1757 while (0); 1758 if (FAILED( rc))1758 if (FAILED(hrc)) 1759 1759 goto leave; 1760 1760 … … 1779 1779 ComPtr<IHost> pHost; 1780 1780 CHECK_ERROR_BREAK(pVirtualBox, COMGETTER(Host)(pHost.asOutParam())); 1781 rc = pHost->FindHostDVDDrive(bstrCdromFile.raw(), pMedium.asOutParam());1782 if (FAILED( rc))1781 hrc = pHost->FindHostDVDDrive(bstrCdromFile.raw(), pMedium.asOutParam()); 1782 if (FAILED(hrc)) 1783 1783 { 1784 1784 /* try to find an existing one */ 1785 rc = pVirtualBox->OpenMedium(bstrCdromFile.raw(),1785 hrc = pVirtualBox->OpenMedium(bstrCdromFile.raw(), 1786 1786 DeviceType_DVD, 1787 1787 AccessMode_ReadWrite, 1788 1788 FALSE /* fForceNewUuid */, 1789 1789 pMedium.asOutParam()); 1790 if (FAILED( rc))1790 if (FAILED(hrc)) 1791 1791 { 1792 1792 /* try to add to the list */ … … 1840 1840 } 1841 1841 while (0); 1842 if (FAILED( rc))1842 if (FAILED(hrc)) 1843 1843 goto leave; 1844 1844 … … 1867 1867 ComPtr<ISnapshot> pCurrentSnapshot; 1868 1868 CHECK_ERROR(gpMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam())); 1869 if (FAILED( rc))1869 if (FAILED(hrc)) 1870 1870 goto leave; 1871 1871 1872 1872 CHECK_ERROR(gpMachine, RestoreSnapshot(pCurrentSnapshot, gpProgress.asOutParam())); 1873 rc = gpProgress->WaitForCompletion(-1);1873 hrc = gpProgress->WaitForCompletion(-1); 1874 1874 } 1875 1875 } … … 1891 1891 if (bootDevice != DeviceType_Null) 1892 1892 { 1893 rc = gpMachine->SetBootOrder(1, bootDevice);1894 if ( rc != S_OK)1893 hrc = gpMachine->SetBootOrder(1, bootDevice); 1894 if (hrc != S_OK) 1895 1895 { 1896 1896 RTPrintf("Error: could not set boot device, using default.\n"); … … 1901 1901 if (memorySize) 1902 1902 { 1903 rc = gpMachine->COMSETTER(MemorySize)(memorySize);1904 if ( rc != S_OK)1903 hrc = gpMachine->COMSETTER(MemorySize)(memorySize); 1904 if (hrc != S_OK) 1905 1905 { 1906 1906 ULONG ramSize = 0; … … 1910 1910 } 1911 1911 1912 rc = gpMachine->COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam());1913 if ( rc != S_OK)1912 hrc = gpMachine->COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam()); 1913 if (hrc != S_OK) 1914 1914 { 1915 1915 RTPrintf("Error: could not get graphics adapter object\n"); … … 1919 1919 if (vramSize) 1920 1920 { 1921 rc = pGraphicsAdapter->COMSETTER(VRAMSize)(vramSize);1922 if ( rc != S_OK)1921 hrc = pGraphicsAdapter->COMSETTER(VRAMSize)(vramSize); 1922 if (hrc != S_OK) 1923 1923 { 1924 1924 pGraphicsAdapter->COMGETTER(VRAMSize)((ULONG*)&vramSize); … … 1951 1951 // create our SDL framebuffer instance 1952 1952 gpFramebuffer[i].createObject(); 1953 rc = gpFramebuffer[i]->init(i, fFullscreen, fResizable, fShowSDLConfig, false,1953 hrc = gpFramebuffer[i]->init(i, fFullscreen, fResizable, fShowSDLConfig, false, 1954 1954 fixedWidth, fixedHeight, fixedBPP, fSeparate); 1955 if (FAILED( rc))1955 if (FAILED(hrc)) 1956 1956 { 1957 1957 RTPrintf("Error: could not create framebuffer object!\n"); … … 2031 2031 { 2032 2032 // register our framebuffer 2033 rc = gpDisplay->AttachFramebuffer(i, gpFramebuffer[i], gaFramebufferId[i].asOutParam());2034 if (FAILED( rc))2033 hrc = gpDisplay->AttachFramebuffer(i, gpFramebuffer[i], gaFramebufferId[i].asOutParam()); 2034 if (FAILED(hrc)) 2035 2035 { 2036 2036 RTPrintf("Error: could not register framebuffer object!\n"); … … 2040 2040 LONG xOrigin, yOrigin; 2041 2041 GuestMonitorStatus_T monitorStatus; 2042 rc = gpDisplay->GetScreenResolution(i, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);2042 hrc = gpDisplay->GetScreenResolution(i, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus); 2043 2043 gpFramebuffer[i]->setOrigin(xOrigin, yOrigin); 2044 2044 } … … 2091 2091 if (pszPortVRDP) 2092 2092 { 2093 rc = gpMachine->COMGETTER(VRDEServer)(gpVRDEServer.asOutParam());2094 AssertMsg(( rc == S_OK) && gpVRDEServer, ("Could not get VRDP Server! rc = 0x%x\n",rc));2093 hrc = gpMachine->COMGETTER(VRDEServer)(gpVRDEServer.asOutParam()); 2094 AssertMsg((hrc == S_OK) && gpVRDEServer, ("Could not get VRDP Server! rc = 0x%x\n", hrc)); 2095 2095 if (gpVRDEServer) 2096 2096 { … … 2098 2098 if (strcmp(pszPortVRDP, "0")) 2099 2099 { 2100 rc = gpVRDEServer->SetVRDEProperty(Bstr("TCP/Ports").raw(), Bstr(pszPortVRDP).raw());2101 if ( rc != S_OK)2100 hrc = gpVRDEServer->SetVRDEProperty(Bstr("TCP/Ports").raw(), Bstr(pszPortVRDP).raw()); 2101 if (hrc != S_OK) 2102 2102 { 2103 RTPrintf("Error: could not set VRDP port! rc = 0x%x\n", rc);2103 RTPrintf("Error: could not set VRDP port! rc = 0x%x\n", hrc); 2104 2104 goto leave; 2105 2105 } 2106 2106 } 2107 2107 // now enable VRDP 2108 rc = gpVRDEServer->COMSETTER(Enabled)(TRUE);2109 if ( rc != S_OK)2110 { 2111 RTPrintf("Error: could not enable VRDP server! rc = 0x%x\n", rc);2108 hrc = gpVRDEServer->COMSETTER(Enabled)(TRUE); 2109 if (hrc != S_OK) 2110 { 2111 RTPrintf("Error: could not enable VRDP server! rc = 0x%x\n", hrc); 2112 2112 goto leave; 2113 2113 } … … 2115 2115 } 2116 2116 2117 rc = E_FAIL;2117 hrc = E_FAIL; 2118 2118 #ifdef VBOXSDL_ADVANCED_OPTIONS 2119 2119 if (u32WarpDrive != 0) … … 2188 2188 { 2189 2189 LogFlow(("Powering up the VM...\n")); 2190 rc = gpConsole->PowerUp(gpProgress.asOutParam());2191 if ( rc != S_OK)2190 hrc = gpConsole->PowerUp(gpProgress.asOutParam()); 2191 if (hrc != S_OK) 2192 2192 { 2193 2193 com::ErrorInfo info(gpConsole, COM_IIDOF(IConsole)); … … 2228 2228 do 2229 2229 { 2230 rc = gpMachine->COMGETTER(State)(&machineState);2231 if ( rc == S_OK2230 hrc = gpMachine->COMGETTER(State)(&machineState); 2231 if ( hrc == S_OK 2232 2232 && ( machineState == MachineState_Starting 2233 2233 || machineState == MachineState_Restoring … … 2280 2280 ULONG dummy; 2281 2281 GuestMonitorStatus_T monitorStatus; 2282 rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);2282 hrc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus); 2283 2283 gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin); 2284 2284 break; … … 2325 2325 } 2326 2326 eventQ->processEventQueue(0); 2327 } while ( rc == S_OK2327 } while ( hrc == S_OK 2328 2328 && ( machineState == MachineState_Starting 2329 2329 || machineState == MachineState_Restoring … … 2347 2347 PrintError("Failed to power up VM", info.getText().raw()); 2348 2348 else 2349 RTPrintf("Error: failed to power up VM! No error text available (rc = 0x%x state = %d)\n", rc, machineState);2349 RTPrintf("Error: failed to power up VM! No error text available (rc = 0x%x state = %d)\n", hrc, machineState); 2350 2350 goto leave; 2351 2351 } … … 2355 2355 pConsoleListener->getWrapped()->ignorePowerOffEvents(false); 2356 2356 2357 rc = gpConsole->COMGETTER(Keyboard)(gpKeyboard.asOutParam());2357 hrc = gpConsole->COMGETTER(Keyboard)(gpKeyboard.asOutParam()); 2358 2358 if (!gpKeyboard) 2359 2359 { … … 2841 2841 ULONG dummy; 2842 2842 GuestMonitorStatus_T monitorStatus; 2843 rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);2843 hrc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus); 2844 2844 gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin); 2845 2845 break; … … 2937 2937 2938 2938 if (gpVRDEServer) 2939 rc = gpVRDEServer->COMSETTER(Enabled)(FALSE);2939 hrc = gpVRDEServer->COMSETTER(Enabled)(FALSE); 2940 2940 2941 2941 /* … … 2968 2968 CHECK_ERROR_BREAK(pProgress, COMGETTER(Completed)(&completed)); 2969 2969 ASSERT(completed); 2970 LONG hrc ;2971 CHECK_ERROR_BREAK(pProgress, COMGETTER(ResultCode)(&hrc ));2972 if (FAILED(hrc ))2970 LONG hrc2; 2971 CHECK_ERROR_BREAK(pProgress, COMGETTER(ResultCode)(&hrc2)); 2972 if (FAILED(hrc2)) 2973 2973 { 2974 2974 com::ErrorInfo info; … … 2977 2977 info.getText().raw(), info.getComponent().raw()); 2978 2978 else 2979 RTPrintf("Failed to power down virtual machine! No error information available (rc = 0x%x).\n", hrc);2979 RTPrintf("Failed to power down virtual machine! No error information available (rc=%Rhrc).\n", hrc2); 2980 2980 break; 2981 2981 } … … 3001 3001 && machineState != MachineState_AbortedSaved) 3002 3002 { 3003 rc = gpMachine->DiscardSettings();3004 AssertMsg(SUCCEEDED( rc), ("DiscardSettings %Rhrc, machineState %d\n",rc, machineState));3003 hrc = gpMachine->DiscardSettings(); 3004 AssertMsg(SUCCEEDED(hrc), ("DiscardSettings %Rhrc, machineState %d\n", hrc, machineState)); 3005 3005 } 3006 3006 … … 3008 3008 if (sessionOpened) 3009 3009 { 3010 rc = pSession->UnlockMachine();3011 AssertComRC( rc);3010 hrc = pSession->UnlockMachine(); 3011 AssertComRC(hrc); 3012 3012 } 3013 3013 … … 3121 3121 LogFlow(("Returning from main()!\n")); 3122 3122 RTLogFlush(NULL); 3123 return FAILED( rc) ? 1 : 0;3123 return FAILED(hrc) ? 1 : 0; 3124 3124 } 3125 3125 … … 4125 4125 UpdateTitlebar(TITLEBAR_SAVE); 4126 4126 gpProgress = NULL; 4127 HRESULT rc = gpMachine->SaveState(gpProgress.asOutParam());4128 if (FAILED( rc))4129 { 4130 RTPrintf("Error saving state! rc = 0x%x\n",rc);4127 HRESULT hrc = gpMachine->SaveState(gpProgress.asOutParam()); 4128 if (FAILED(hrc)) 4129 { 4130 RTPrintf("Error saving state! rc=%Rhrc\n", hrc); 4131 4131 return; 4132 4132 } … … 4142 4142 { 4143 4143 BOOL fCompleted = false; 4144 rc = gpProgress->COMGETTER(Completed)(&fCompleted);4145 if (FAILED( rc) || fCompleted)4144 hrc = gpProgress->COMGETTER(Completed)(&fCompleted); 4145 if (FAILED(hrc) || fCompleted) 4146 4146 break; 4147 4147 ULONG cPercentNow; 4148 rc = gpProgress->COMGETTER(Percent)(&cPercentNow);4149 if (FAILED( rc))4148 hrc = gpProgress->COMGETTER(Percent)(&cPercentNow); 4149 if (FAILED(hrc)) 4150 4150 break; 4151 4151 if (cPercentNow != cPercent) … … 4156 4156 4157 4157 /* wait */ 4158 rc = gpProgress->WaitForCompletion(100);4159 if (FAILED( rc))4158 hrc = gpProgress->WaitForCompletion(100); 4159 if (FAILED(hrc)) 4160 4160 break; 4161 4161 /// @todo process gui events. … … 4174 4174 */ 4175 4175 BOOL fCompleted = false; 4176 rc = gpProgress->COMGETTER(Completed)(&fCompleted);4177 if (FAILED( rc) || fCompleted)4176 hrc = gpProgress->COMGETTER(Completed)(&fCompleted); 4177 if (FAILED(hrc) || fCompleted) 4178 4178 break; 4179 4179 ULONG cPercentNow; 4180 rc = gpProgress->COMGETTER(Percent)(&cPercentNow);4181 if (FAILED( rc))4180 hrc = gpProgress->COMGETTER(Percent)(&cPercentNow); 4181 if (FAILED(hrc)) 4182 4182 break; 4183 4183 if (cPercentNow != cPercent) … … 4238 4238 */ 4239 4239 LONG lrc; 4240 rc = gpProgress->COMGETTER(ResultCode)(&lrc);4241 if (FAILED( rc))4240 hrc = gpProgress->COMGETTER(ResultCode)(&lrc); 4241 if (FAILED(hrc)) 4242 4242 lrc = ~0; 4243 4243 if (!lrc) … … 4324 4324 { 4325 4325 ULONG cPercentNow; 4326 HRESULT rc = gpProgress->COMGETTER(Percent)(&cPercentNow);4327 if (SUCCEEDED( rc))4326 HRESULT hrc = gpProgress->COMGETTER(Percent)(&cPercentNow); 4327 if (SUCCEEDED(hrc)) 4328 4328 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 4329 4329 " - Restoring %d%%...", (int)cPercentNow); … … 4335 4335 { 4336 4336 ULONG cPercentNow; 4337 HRESULT rc = gpProgress->COMGETTER(Percent)(&cPercentNow);4338 if (SUCCEEDED( rc))4337 HRESULT hrc = gpProgress->COMGETTER(Percent)(&cPercentNow); 4338 if (SUCCEEDED(hrc)) 4339 4339 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 4340 4340 " - Teleporting %d%%...", (int)cPercentNow); … … 4873 4873 RTStrPrintf(pszSnapshotName, sizeof(pszSnapshotName), "Snapshot %d", cSnapshots + 1); 4874 4874 gpProgress = NULL; 4875 HRESULT rc;4875 HRESULT hrc; 4876 4876 Bstr snapId; 4877 4877 CHECK_ERROR(gpMachine, TakeSnapshot(Bstr(pszSnapshotName).raw(), … … 4879 4879 TRUE, snapId.asOutParam(), 4880 4880 gpProgress.asOutParam())); 4881 if (FAILED( rc))4882 { 4883 RTPrintf("Error taking snapshot! rc = 0x%x\n",rc);4881 if (FAILED(hrc)) 4882 { 4883 RTPrintf("Error taking snapshot! rc=%Rhrc\n", hrc); 4884 4884 /* continue operation */ 4885 4885 return VINF_SUCCESS; … … 4893 4893 { 4894 4894 BOOL fCompleted = false; 4895 rc = gpProgress->COMGETTER(Completed)(&fCompleted);4896 if (FAILED( rc) || fCompleted)4895 hrc = gpProgress->COMGETTER(Completed)(&fCompleted); 4896 if (FAILED(hrc) || fCompleted) 4897 4897 break; 4898 4898 ULONG cPercentNow; 4899 rc = gpProgress->COMGETTER(Percent)(&cPercentNow);4900 if (FAILED( rc))4899 hrc = gpProgress->COMGETTER(Percent)(&cPercentNow); 4900 if (FAILED(hrc)) 4901 4901 break; 4902 4902 if (cPercentNow != cPercent) … … 4907 4907 4908 4908 /* wait */ 4909 rc = gpProgress->WaitForCompletion(100);4910 if (FAILED( rc))4909 hrc = gpProgress->WaitForCompletion(100); 4910 if (FAILED(hrc)) 4911 4911 break; 4912 4912 /// @todo process gui events. -
trunk/src/VBox/ImageMounter/vboximg-mount/vboximgMedia.cpp
r93115 r95141 316 316 vboximgListVMs(IVirtualBox *pVirtualBox) 317 317 { 318 HRESULT rc = 0;318 HRESULT hrc = 0; 319 319 com::SafeIfaceArray<IMachine> pMachines; 320 320 CHECK_ERROR(pVirtualBox, COMGETTER(Machines)(ComSafeArrayAsOutParam(pMachines))); … … 372 372 } 373 373 } 374 rc = listMedia(pVirtualBox, pMachine,374 hrc = listMedia(pVirtualBox, pMachine, 375 375 RTStrDup(CSTR(machineName)), RTStrDup(CSTR(machineUuid))); 376 376 RTPrintf("\n"); … … 379 379 } 380 380 } 381 return rc;382 } 381 return hrc; 382 }
Note:
See TracChangeset
for help on using the changeset viewer.