Changeset 95140 in vbox
- Timestamp:
- May 31, 2022 9:11:39 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151631
- Location:
- trunk
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/errorprint.h
r93115 r95140 114 114 #define CHECK_ERROR(iface, method) \ 115 115 do { \ 116 rc = iface->method; \117 if (FAILED( rc) || SUCCEEDED_WARNING(rc)) \118 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \116 hrc = iface->method; \ 117 if (FAILED(hrc) || SUCCEEDED_WARNING(hrc)) \ 118 com::GlueHandleComError(iface, #method, hrc, __FILE__, __LINE__); \ 119 119 } while (0) 120 120 /** … … 146 146 #define CHECK_ERROR_STMT(iface, method, stmt) \ 147 147 do { \ 148 rc = iface->method; \149 if (FAILED( rc) || SUCCEEDED_WARNING(rc)) \150 { \ 151 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \152 if (!SUCCEEDED_WARNING( rc) \148 hrc = iface->method; \ 149 if (FAILED(hrc) || SUCCEEDED_WARNING(hrc)) \ 150 { \ 151 com::GlueHandleComError(iface, #method, hrc, __FILE__, __LINE__); \ 152 if (!SUCCEEDED_WARNING(hrc) \ 153 153 { \ 154 154 stmt; \ … … 188 188 __extension__ \ 189 189 ({ \ 190 rc = iface->method; \191 if (FAILED( rc) || SUCCEEDED_WARNING(rc)) \192 { \ 193 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \194 if (!SUCCEEDED_WARNING( rc)) \190 hrc = iface->method; \ 191 if (FAILED(hrc) || SUCCEEDED_WARNING(hrc)) \ 192 { \ 193 com::GlueHandleComError(iface, #method, hrc, __FILE__, __LINE__); \ 194 if (!SUCCEEDED_WARNING(hrc)) \ 195 195 break; \ 196 196 } \ … … 200 200 if (1) \ 201 201 { \ 202 rc = iface->method; \203 if (FAILED( rc)) \204 { \ 205 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \206 if (!SUCCEEDED_WARNING( rc)) \202 hrc = iface->method; \ 203 if (FAILED(hrc)) \ 204 { \ 205 com::GlueHandleComError(iface, #method, hrc, __FILE__, __LINE__); \ 206 if (!SUCCEEDED_WARNING(hrc)) \ 207 207 break; \ 208 208 } \ … … 250 250 #define CHECK_ERROR_RET(iface, method, ret) \ 251 251 do { \ 252 rc = iface->method; \253 if (FAILED( rc) || SUCCEEDED_WARNING(rc)) \254 { \ 255 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \256 if (!SUCCEEDED_WARNING( rc)) \252 hrc = iface->method; \ 253 if (FAILED(hrc) || SUCCEEDED_WARNING(hrc)) \ 254 { \ 255 com::GlueHandleComError(iface, #method, hrc, __FILE__, __LINE__); \ 256 if (!SUCCEEDED_WARNING(hrc)) \ 257 257 return (ret); \ 258 258 } \ … … 289 289 do { \ 290 290 LONG iRc; \ 291 rc = progress->COMGETTER(ResultCode)(&iRc); \292 if (FAILED( rc) || FAILED(iRc)) \293 { \ 294 if (SUCCEEDED( rc)) rc = iRc; else iRc =rc; \291 hrc = progress->COMGETTER(ResultCode)(&iRc); \ 292 if (FAILED(hrc) || FAILED(iRc)) \ 293 { \ 294 if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \ 295 295 RTMsgError msg; \ 296 296 com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \ … … 308 308 ({ \ 309 309 LONG iRc; \ 310 rc = progress->COMGETTER(ResultCode)(&iRc); \311 if (FAILED( rc) || FAILED(iRc)) \312 { \ 313 if (SUCCEEDED( rc)) rc = iRc; else iRc =rc; \310 hrc = progress->COMGETTER(ResultCode)(&iRc); \ 311 if (FAILED(hrc) || FAILED(iRc)) \ 312 { \ 313 if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \ 314 314 RTMsgError msg; \ 315 315 com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \ … … 322 322 { \ 323 323 LONG iRc; \ 324 rc = progress->COMGETTER(ResultCode)(&iRc); \325 if (FAILED( rc) || FAILED(iRc)) \326 { \ 327 if (SUCCEEDED( rc)) rc = iRc; else iRc =rc; \324 hrc = progress->COMGETTER(ResultCode)(&iRc); \ 325 if (FAILED(hrc) || FAILED(iRc)) \ 326 { \ 327 if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \ 328 328 RTMsgError msg; \ 329 329 com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \ -
trunk/src/VBox/Frontends/Common/PasswordInput.cpp
r93648 r95140 94 94 if (rcExit == RTEXITCODE_SUCCESS) 95 95 { 96 intrc;96 HRESULT hrc; 97 97 CHECK_ERROR(virtualBox, SetSettingsSecret(com::Bstr(passwd).raw())); 98 if (FAILED( rc))98 if (FAILED(hrc)) 99 99 rcExit = RTEXITCODE_FAILURE; 100 100 } -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStart.cpp
r95139 r95140 87 87 */ 88 88 com::SafeIfaceArray<IMachine> machines; 89 HRESULT rc = g_pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));90 if (SUCCEEDED( rc))89 HRESULT hrc = g_pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 90 if (SUCCEEDED(hrc)) 91 91 { 92 92 /* … … 131 131 * just to add this log, hence a bit of duplicate logic here. 132 132 */ 133 if (SUCCEEDED( rc))133 if (SUCCEEDED(hrc)) 134 134 { 135 135 if (machines.size() == 0) … … 142 142 } 143 143 else 144 autostartSvcLogError("Enumerating virtual machines failed with %Rhrc\n", rc);145 146 if ( SUCCEEDED( rc)144 autostartSvcLogError("Enumerating virtual machines failed with %Rhrc\n", hrc); 145 146 if ( SUCCEEDED(hrc) 147 147 && !listVM.empty()) 148 148 { … … 173 173 CHECK_ERROR_BREAK(machine, LaunchVMProcess(g_pSession, Bstr("headless").raw(), 174 174 ComSafeArrayNullInParam(), progress.asOutParam())); 175 if (SUCCEEDED( rc) && !progress.isNull())175 if (SUCCEEDED(hrc) && !progress.isNull()) 176 176 { 177 177 autostartSvcLogVerbose(1, "Waiting for machine '%ls' to power on ...\n", strName.raw()); 178 178 CHECK_ERROR(progress, WaitForCompletion(-1)); 179 if (SUCCEEDED( rc))179 if (SUCCEEDED(hrc)) 180 180 { 181 181 BOOL completed = true; 182 182 CHECK_ERROR(progress, COMGETTER(Completed)(&completed)); 183 if (SUCCEEDED( rc))183 if (SUCCEEDED(hrc)) 184 184 { 185 185 ASSERT(completed); … … 187 187 LONG iRc; 188 188 CHECK_ERROR(progress, COMGETTER(ResultCode)(&iRc)); 189 if (SUCCEEDED( rc))189 if (SUCCEEDED(hrc)) 190 190 { 191 191 if (FAILED(iRc)) … … 202 202 SessionState_T enmSessionState; 203 203 CHECK_ERROR(g_pSession, COMGETTER(State)(&enmSessionState)); 204 if (SUCCEEDED( rc) && enmSessionState == SessionState_Locked)204 if (SUCCEEDED(hrc) && enmSessionState == SessionState_Locked) 205 205 g_pSession->UnlockMachine(); 206 206 } -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp
r95139 r95140 49 49 static HRESULT autostartSaveVMState(ComPtr<IConsole> &console) 50 50 { 51 HRESULT rc = S_OK;51 HRESULT hrc = S_OK; 52 52 ComPtr<IMachine> machine; 53 53 ComPtr<IProgress> progress; … … 57 57 /* first pause so we don't trigger a live save which needs more time/resources */ 58 58 bool fPaused = false; 59 rc = console->Pause();60 if (FAILED( rc))59 hrc = console->Pause(); 60 if (FAILED(hrc)) 61 61 { 62 62 bool fError = true; 63 if ( rc == VBOX_E_INVALID_VM_STATE)63 if (hrc == VBOX_E_INVALID_VM_STATE) 64 64 { 65 65 /* check if we are already paused */ … … 67 67 CHECK_ERROR_BREAK(console, COMGETTER(State)(&machineState)); 68 68 /* the error code was lost by the previous instruction */ 69 rc = VBOX_E_INVALID_VM_STATE;69 hrc = VBOX_E_INVALID_VM_STATE; 70 70 if (machineState != MachineState_Paused) 71 71 { … … 85 85 CHECK_ERROR(console, COMGETTER(Machine)(machine.asOutParam())); 86 86 CHECK_ERROR(machine, SaveState(progress.asOutParam())); 87 if (FAILED( rc))87 if (FAILED(hrc)) 88 88 { 89 89 if (!fPaused) … … 92 92 } 93 93 94 rc = showProgress(progress);94 hrc = showProgress(progress); 95 95 CHECK_PROGRESS_ERROR(progress, ("Failed to save machine state")); 96 if (FAILED( rc))96 if (FAILED(hrc)) 97 97 { 98 98 if (!fPaused) … … 101 101 } while (0); 102 102 103 return rc;103 return hrc; 104 104 } 105 105 … … 116 116 */ 117 117 com::SafeIfaceArray<IMachine> machines; 118 HRESULT rc = g_pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));119 if (SUCCEEDED( rc))118 HRESULT hrc = g_pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 119 if (SUCCEEDED(hrc)) 120 120 { 121 121 /* … … 155 155 } 156 156 157 if ( SUCCEEDED( rc)157 if ( SUCCEEDED(hrc) 158 158 && !listVM.empty()) 159 159 { … … 197 197 case AutostopType_SaveState: 198 198 { 199 rc = autostartSaveVMState(console);199 hrc = autostartSaveVMState(console); 200 200 break; 201 201 } … … 204 204 CHECK_ERROR_BREAK(console, PowerDown(progress.asOutParam())); 205 205 206 rc = showProgress(progress);206 hrc = showProgress(progress); 207 207 CHECK_PROGRESS_ERROR(progress, ("Failed to powering off machine '%ls'", strName.raw())); 208 if (FAILED( rc))209 autostartSvcLogError("Powering off machine '%ls' failed with %Rhrc\n", strName.raw(), rc);208 if (FAILED(hrc)) 209 autostartSvcLogError("Powering off machine '%ls' failed with %Rhrc\n", strName.raw(), hrc); 210 210 break; 211 211 } … … 240 240 autostartSvcLogWarning("The guest of machine '%ls' does not support ACPI shutdown or is currently paused, saving state...\n", 241 241 strName.raw()); 242 rc = autostartSaveVMState(console);242 hrc = autostartSaveVMState(console); 243 243 } 244 244 break; -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r94660 r95140 992 992 } 993 993 994 HRESULT rc;995 int irc;996 997 rc = com::Initialize();994 HRESULT hrc; 995 int vrc; 996 997 hrc = com::Initialize(); 998 998 #ifdef VBOX_WITH_XPCOM 999 if ( rc == NS_ERROR_FILE_ACCESS_DENIED)999 if (hrc == NS_ERROR_FILE_ACCESS_DENIED) 1000 1000 { 1001 1001 char szHome[RTPATH_MAX] = ""; … … 1005 1005 } 1006 1006 #endif 1007 if (FAILED( rc))1007 if (FAILED(hrc)) 1008 1008 { 1009 1009 RTPrintf("VBoxHeadless: ERROR: failed to initialize COM!\n"); … … 1022 1022 do 1023 1023 { 1024 rc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient);1025 if (FAILED( rc))1024 hrc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 1025 if (FAILED(hrc)) 1026 1026 { 1027 1027 RTPrintf("VBoxHeadless: ERROR: failed to create the VirtualBoxClient object!\n"); … … 1029 1029 if (!info.isFullAvailable() && !info.isBasicAvailable()) 1030 1030 { 1031 com::GluePrintRCMessage( rc);1031 com::GluePrintRCMessage(hrc); 1032 1032 RTPrintf("Most likely, the VirtualBox COM server is not running or failed to start.\n"); 1033 1033 } … … 1037 1037 } 1038 1038 1039 rc = pVirtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam());1040 if (FAILED( rc))1041 { 1042 RTPrintf("Failed to get VirtualBox object (rc=%Rhrc)!\n", rc);1039 hrc = pVirtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam()); 1040 if (FAILED(hrc)) 1041 { 1042 RTPrintf("Failed to get VirtualBox object (rc=%Rhrc)!\n", hrc); 1043 1043 break; 1044 1044 } 1045 rc = pVirtualBoxClient->COMGETTER(Session)(session.asOutParam());1046 if (FAILED( rc))1047 { 1048 RTPrintf("Failed to get session object (rc=%Rhrc)!\n", rc);1045 hrc = pVirtualBoxClient->COMGETTER(Session)(session.asOutParam()); 1046 if (FAILED(hrc)) 1047 { 1048 RTPrintf("Failed to get session object (rc=%Rhrc)!\n", hrc); 1049 1049 break; 1050 1050 } … … 1053 1053 { 1054 1054 CHECK_ERROR(virtualBox, SetSettingsSecret(Bstr(pcszSettingsPw).raw())); 1055 if (FAILED( rc))1055 if (FAILED(hrc)) 1056 1056 break; 1057 1057 } … … 1065 1065 ComPtr<IMachine> m; 1066 1066 1067 rc = virtualBox->FindMachine(Bstr(pcszNameOrUUID).raw(), m.asOutParam());1068 if (FAILED( rc))1069 { 1070 LogError("Invalid machine name or UUID!\n", rc);1067 hrc = virtualBox->FindMachine(Bstr(pcszNameOrUUID).raw(), m.asOutParam()); 1068 if (FAILED(hrc)) 1069 { 1070 LogError("Invalid machine name or UUID!\n", hrc); 1071 1071 break; 1072 1072 } … … 1093 1093 } 1094 1094 Bstr bstrVMId; 1095 rc = m->COMGETTER(Id)(bstrVMId.asOutParam());1096 AssertComRC( rc);1097 if (FAILED( rc))1095 hrc = m->COMGETTER(Id)(bstrVMId.asOutParam()); 1096 AssertComRC(hrc); 1097 if (FAILED(hrc)) 1098 1098 break; 1099 1099 g_strVMUUID = bstrVMId; 1100 1100 1101 1101 Bstr bstrVMName; 1102 rc = m->COMGETTER(Name)(bstrVMName.asOutParam());1103 AssertComRC( rc);1104 if (FAILED( rc))1102 hrc = m->COMGETTER(Name)(bstrVMName.asOutParam()); 1103 AssertComRC(hrc); 1104 if (FAILED(hrc)) 1105 1105 break; 1106 1106 g_strVMName = bstrVMName; … … 1255 1255 RTPrintf("Error: Invalid VRDE property '%s'\n", aVRDEProperties[i]); 1256 1256 RTStrFree(pszProperty); 1257 rc = E_INVALIDARG;1257 hrc = E_INVALIDARG; 1258 1258 break; 1259 1259 } … … 1263 1263 { 1264 1264 RTPrintf("Error: Failed to allocate memory for VRDE property '%s'\n", aVRDEProperties[i]); 1265 rc = E_OUTOFMEMORY;1265 hrc = E_OUTOFMEMORY; 1266 1266 break; 1267 1267 } 1268 1268 } 1269 if (FAILED( rc))1269 if (FAILED(hrc)) 1270 1270 break; 1271 1271 } … … 1329 1329 CHECK_ERROR_BREAK(console, PowerUpPaused(progress.asOutParam())); 1330 1330 1331 rc = showProgress(progress);1332 if (FAILED( rc))1331 hrc = showProgress(progress); 1332 if (FAILED(hrc)) 1333 1333 { 1334 1334 com::ProgressErrorInfo info(progress); … … 1349 1349 */ 1350 1350 RTTHREAD hThrMsg; 1351 irc = RTThreadCreate(&hThrMsg,1352 windowsMessageMonitor, NULL,1353 0, /* :cbStack */1354 RTTHREADTYPE_MSG_PUMP, 0,1355 "MSG");1356 if (RT_FAILURE( irc)) /* not fatal */1357 LogRel(("VBoxHeadless: failed to start windows message monitor: %Rrc\n", irc));1351 vrc = RTThreadCreate(&hThrMsg, 1352 windowsMessageMonitor, NULL, 1353 0, /* :cbStack */ 1354 RTTHREADTYPE_MSG_PUMP, 0, 1355 "MSG"); 1356 if (RT_FAILURE(vrc)) /* not fatal */ 1357 LogRel(("VBoxHeadless: failed to start windows message monitor: %Rrc\n", vrc)); 1358 1358 #endif /* RT_OS_WINDOWS */ 1359 1359 … … 1365 1365 for (;;) 1366 1366 { 1367 irc = gEventQ->processEventQueue(RT_INDEFINITE_WAIT);1367 vrc = gEventQ->processEventQueue(RT_INDEFINITE_WAIT); 1368 1368 1369 1369 /* … … 1373 1373 if (g_fTerminateFE) 1374 1374 { 1375 LogRel(("VBoxHeadless: processEventQueue: %Rrc, termination requested\n", irc));1376 break; 1377 } 1378 1379 if (RT_FAILURE( irc))1380 { 1381 LogRel(("VBoxHeadless: processEventQueue: %Rrc\n", irc));1382 RTMsgError("event loop: %Rrc", irc);1375 LogRel(("VBoxHeadless: processEventQueue: %Rrc, termination requested\n", vrc)); 1376 break; 1377 } 1378 1379 if (RT_FAILURE(vrc)) 1380 { 1381 LogRel(("VBoxHeadless: processEventQueue: %Rrc\n", vrc)); 1382 RTMsgError("event loop: %Rrc", vrc); 1383 1383 break; 1384 1384 } … … 1409 1409 if (!machine.isNull()) 1410 1410 { 1411 rc = machine->COMGETTER(State)(&machineState);1412 if (SUCCEEDED( rc))1411 hrc = machine->COMGETTER(State)(&machineState); 1412 if (SUCCEEDED(hrc)) 1413 1413 Log(("machine state = %RU32\n", machineState)); 1414 1414 else 1415 Log(("IMachine::getState: %Rhrc\n", rc));1415 Log(("IMachine::getState: %Rhrc\n", hrc)); 1416 1416 } 1417 1417 else … … 1440 1440 CHECK_ERROR_BREAK(gConsole, PowerDown(pProgress.asOutParam())); 1441 1441 1442 rc = showProgress(pProgress);1443 if (FAILED( rc))1442 hrc = showProgress(pProgress); 1443 if (FAILED(hrc)) 1444 1444 { 1445 1445 com::ErrorInfo info; 1446 1446 if (!info.isFullAvailable() && !info.isBasicAvailable()) 1447 com::GluePrintRCMessage( rc);1447 com::GluePrintRCMessage(hrc); 1448 1448 else 1449 1449 com::GluePrintErrorInfo(info); … … 1518 1518 1519 1519 LogRel(("VBoxHeadless: exiting\n")); 1520 return FAILED(rc) ? 1 : 0;1520 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1521 1521 } 1522 1522 -
trunk/src/VBox/Frontends/VBoxHeadless/testcase/tstHeadless.cpp
r93115 r95140 69 69 name, operation); 70 70 71 HRESULT rc;72 73 rc = com::Initialize();74 if (FAILED( rc))71 HRESULT hrc; 72 73 hrc = com::Initialize(); 74 if (FAILED(hrc)) 75 75 { 76 76 RTPrintf("ERROR: failed to initialize COM!\n"); 77 return rc;77 return hrc; 78 78 } 79 79 … … 85 85 86 86 RTPrintf("Creating VirtualBox object...\n"); 87 rc = virtualBoxClient.createInprocObject(CLSID_VirtualBoxClient);88 if (SUCCEEDED( rc))89 rc = virtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam());90 if (FAILED( rc))87 hrc = virtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 88 if (SUCCEEDED(hrc)) 89 hrc = virtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam()); 90 if (FAILED(hrc)) 91 91 RTPrintf("ERROR: failed to create the VirtualBox object!\n"); 92 92 else 93 93 { 94 rc = session.createInprocObject(CLSID_Session);95 if (FAILED( rc))94 hrc = session.createInprocObject(CLSID_Session); 95 if (FAILED(hrc)) 96 96 RTPrintf("ERROR: failed to create a session object!\n"); 97 97 } 98 98 99 if (FAILED( rc))99 if (FAILED(hrc)) 100 100 { 101 101 com::ErrorInfo info; 102 102 if (!info.isFullAvailable() && !info.isBasicAvailable()) 103 103 { 104 com::GluePrintRCMessage( rc);104 com::GluePrintRCMessage(hrc); 105 105 RTPrintf("Most likely, the VirtualBox COM server is not running or failed to start.\n"); 106 106 } … … 204 204 RTPrintf("tstHeadless FINISHED.\n"); 205 205 206 return rc;206 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 207 207 } 208 208 -
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r94290 r95140 584 584 { 585 585 RT_NOREF(aSession); 586 HRESULT rc;586 HRESULT hrc; 587 587 588 588 /* … … 610 610 if (argc >= 3) 611 611 { 612 int irc = RTStrToInt64Ex(argv[2], NULL, 0, &offDelta);613 if (RT_FAILURE( irc))614 return errorArgument(argv[0], Internal::tr("Failed to read delta '%s', rc=%Rrc\n"), argv[2], rc);612 int vrc = RTStrToInt64Ex(argv[2], NULL, 0, &offDelta); 613 if (RT_FAILURE(vrc)) 614 return errorArgument(argv[0], Internal::tr("Failed to read delta '%s', rc=%Rrc\n"), argv[2], vrc); 615 615 } 616 616 … … 622 622 if (argc >= 5) 623 623 { 624 int irc = RTStrToUInt64Ex(argv[4], NULL, 0, &ModuleAddress);625 if (RT_FAILURE( irc))626 return errorArgument(argv[0], Internal::tr("Failed to read module address '%s', rc=%Rrc\n"), argv[4], rc);624 int vrc = RTStrToUInt64Ex(argv[4], NULL, 0, &ModuleAddress); 625 if (RT_FAILURE(vrc)) 626 return errorArgument(argv[0], Internal::tr("Failed to read module address '%s', rc=%Rrc\n"), argv[4], vrc); 627 627 } 628 628 … … 630 630 if (argc >= 6) 631 631 { 632 int irc = RTStrToUInt64Ex(argv[5], NULL, 0, &ModuleSize);633 if (RT_FAILURE( irc))634 return errorArgument(argv[0], Internal::tr("Failed to read module size '%s', rc=%Rrc\n"), argv[5], rc);632 int vrc = RTStrToUInt64Ex(argv[5], NULL, 0, &ModuleSize); 633 if (RT_FAILURE(vrc)) 634 return errorArgument(argv[0], Internal::tr("Failed to read module size '%s', rc=%Rrc\n"), argv[5], vrc); 635 635 } 636 636 … … 639 639 */ 640 640 Utf8Str KeyStr; 641 HRESULThrc = NewUniqueKey(machine, "VBoxInternal/DBGF/loadsyms", KeyStr);641 hrc = NewUniqueKey(machine, "VBoxInternal/DBGF/loadsyms", KeyStr); 642 642 if (SUCCEEDED(hrc)) 643 643 hrc = SetString(machine, "VBoxInternal/DBGF/loadsyms", KeyStr.c_str(), "Filename", pszFilename); … … 661 661 { 662 662 RT_NOREF(aSession); 663 HRESULT rc;663 HRESULT hrc; 664 664 665 665 /* … … 687 687 if (argc < 3) 688 688 return errorArgument(Internal::tr("Missing the module address argument!\n")); 689 int irc = RTStrToUInt64Ex(argv[2], NULL, 0, &ModuleAddress);690 if (RT_FAILURE( irc))691 return errorArgument(argv[0], Internal::tr("Failed to read module address '%s', rc=%Rrc\n"), argv[2], rc);689 int vrc = RTStrToUInt64Ex(argv[2], NULL, 0, &ModuleAddress); 690 if (RT_FAILURE(vrc)) 691 return errorArgument(argv[0], Internal::tr("Failed to read module address '%s', rc=%Rrc\n"), argv[2], vrc); 692 692 693 693 /* name (optional) */ … … 698 698 if (argc > 4) 699 699 { 700 irc = RTStrToUInt64Ex(argv[4], NULL, 0, &offSubtrahend);701 if (RT_FAILURE( irc))702 return errorArgument(argv[0], Internal::tr("Failed to read subtrahend '%s', rc=%Rrc\n"), argv[4], rc);700 vrc = RTStrToUInt64Ex(argv[4], NULL, 0, &offSubtrahend); 701 if (RT_FAILURE(vrc)) 702 return errorArgument(argv[0], Internal::tr("Failed to read subtrahend '%s', rc=%Rrc\n"), argv[4], vrc); 703 703 } 704 704 … … 706 706 if (argc > 5) 707 707 { 708 irc = RTStrToUInt32Ex(argv[5], NULL, 0, &iSeg);709 if (RT_FAILURE( irc))710 return errorArgument(argv[0], Internal::tr("Failed to read segment number '%s', rc=%Rrc\n"), argv[5], rc);708 vrc = RTStrToUInt32Ex(argv[5], NULL, 0, &iSeg); 709 if (RT_FAILURE(vrc)) 710 return errorArgument(argv[0], Internal::tr("Failed to read segment number '%s', rc=%Rrc\n"), argv[5], vrc); 711 711 } 712 712 … … 715 715 */ 716 716 Utf8Str KeyStr; 717 HRESULThrc = NewUniqueKey(machine, "VBoxInternal/DBGF/loadmap", KeyStr);717 hrc = NewUniqueKey(machine, "VBoxInternal/DBGF/loadmap", KeyStr); 718 718 if (SUCCEEDED(hrc)) 719 719 hrc = SetString(machine, "VBoxInternal/DBGF/loadmap", KeyStr.c_str(), "Filename", pszFilename); … … 1283 1283 { 1284 1284 RT_NOREF(aVirtualBox, aSession); 1285 HRESULT rc = S_OK;1285 HRESULT hrc = S_OK; 1286 1286 Utf8Str filename; 1287 1287 const char *pszMBRFilename = NULL; … … 1949 1949 vdInterfaceError.pfnMessage = handleVDMessage; 1950 1950 1951 rc = VDInterfaceAdd(&vdInterfaceError.Core, "VBoxManage_IError", VDINTERFACETYPE_ERROR,1952 NULL, sizeof(VDINTERFACEERROR), &pVDIfs);1951 hrc = VDInterfaceAdd(&vdInterfaceError.Core, "VBoxManage_IError", VDINTERFACETYPE_ERROR, 1952 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 1953 1953 AssertRC(vrc); 1954 1954 … … 1997 1997 } 1998 1998 1999 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1999 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2000 2000 2001 2001 out: … … 2477 2477 2478 2478 ComPtr<IMachine> ptrMachine; 2479 HRESULT rc;2479 HRESULT hrc; 2480 2480 CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]).raw(), 2481 2481 ptrMachine.asOutParam()), RTEXITCODE_FAILURE); … … 2644 2644 2645 2645 ComPtr<IMachine> ptrMachine; 2646 HRESULT rc;2646 HRESULT hrc; 2647 2647 CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]).raw(), 2648 2648 ptrMachine.asOutParam()), RTEXITCODE_FAILURE); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r94236 r95140 218 218 RTEXITCODE handleImportAppliance(HandlerArg *arg) 219 219 { 220 HRESULT rc = S_OK;220 HRESULT hrc = S_OK; 221 221 APPLIANCETYPE enmApplType = NOT_SET; 222 222 Utf8Str strOvfFilename; … … 497 497 RTStrFree(pszAbsFilePath); 498 498 499 rc = showProgress(progressRead);499 hrc = showProgress(progressRead); 500 500 CHECK_PROGRESS_ERROR_RET(progressRead, (Appliance::tr("Appliance read failed")), RTEXITCODE_FAILURE); 501 501 … … 511 511 // to tinker with the error info a bit 512 512 RTStrmPrintf(g_pStdErr, Appliance::tr("Interpreting %ls...\n"), path.raw()); 513 rc = pAppliance->Interpret();513 hrc = pAppliance->Interpret(); 514 514 com::ErrorInfoKeeper eik; 515 515 … … 528 528 529 529 eik.restore(); 530 if (FAILED( rc)) // during interpret, after printing warnings530 if (FAILED(hrc)) // during interpret, after printing warnings 531 531 { 532 com::GlueHandleComError(pAppliance, "Interpret()", rc, __FILE__, __LINE__);532 com::GlueHandleComError(pAppliance, "Interpret()", hrc, __FILE__, __LINE__); 533 533 break; 534 534 } … … 1394 1394 ImportMachines(ComSafeArrayAsInParam(options), progress.asOutParam())); 1395 1395 1396 rc = showProgress(progress);1396 hrc = showProgress(progress); 1397 1397 CHECK_PROGRESS_ERROR_RET(progress, (Appliance::tr("Appliance import failed")), RTEXITCODE_FAILURE); 1398 1398 1399 if (SUCCEEDED( rc))1399 if (SUCCEEDED(hrc)) 1400 1400 RTPrintf(Appliance::tr("Successfully imported the appliance.\n")); 1401 1401 } … … 1403 1403 } while (0); 1404 1404 1405 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1405 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1406 1406 } 1407 1407 … … 1485 1485 RTEXITCODE handleExportAppliance(HandlerArg *a) 1486 1486 { 1487 HRESULT rc = S_OK;1487 HRESULT hrc = S_OK; 1488 1488 1489 1489 Utf8Str strOutputFile; … … 1761 1761 } 1762 1762 1763 if (FAILED( rc))1763 if (FAILED(hrc)) 1764 1764 break; 1765 1765 } 1766 1766 1767 if (FAILED( rc))1767 if (FAILED(hrc)) 1768 1768 break; 1769 1769 … … 1928 1928 } 1929 1929 1930 if (FAILED( rc))1930 if (FAILED(hrc)) 1931 1931 break; 1932 1932 … … 1975 1975 RTStrFree(pszAbsFilePath); 1976 1976 1977 rc = showProgress(progress);1977 hrc = showProgress(progress); 1978 1978 CHECK_PROGRESS_ERROR_RET(progress, (Appliance::tr("Appliance write failed")), RTEXITCODE_FAILURE); 1979 1979 1980 if (SUCCEEDED( rc))1980 if (SUCCEEDED(hrc)) 1981 1981 RTPrintf(Appliance::tr("Successfully exported %d machine(s).\n", "", llMachines.size()), llMachines.size()); 1982 1982 … … 2039 2039 ComPtr<IProgress> progress1; 2040 2040 CHECK_ERROR_BREAK(oCloudClient, LaunchVM(pVSD, progress1.asOutParam())); 2041 rc = showProgress(progress1);2041 hrc = showProgress(progress1); 2042 2042 CHECK_PROGRESS_ERROR_RET(progress1, (Appliance::tr("Creating the cloud instance failed")), 2043 2043 RTEXITCODE_FAILURE); 2044 2044 2045 if (SUCCEEDED( rc))2045 if (SUCCEEDED(hrc)) 2046 2046 { 2047 2047 CHECK_ERROR_BREAK(pVSD, GetDescriptionByType(VirtualSystemDescriptionType_CloudInstanceId, … … 2062 2062 } while (0); 2063 2063 2064 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;2064 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2065 2065 } 2066 2066 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp
r94236 r95140 100 100 static RTEXITCODE handleBandwidthControlAdd(HandlerArg *a, ComPtr<IBandwidthControl> &bwCtrl) 101 101 { 102 HRESULT rc = S_OK;102 HRESULT hrc = S_OK; 103 103 static const RTGETOPTDEF g_aBWCtlAddOptions[] = 104 104 { … … 125 125 RT_ELEMENTS(g_aBWCtlAddOptions), 3, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 126 126 127 while ( SUCCEEDED( rc)127 while ( SUCCEEDED(hrc) 128 128 && (c = RTGetOpt(&GetState, &ValueUnion))) 129 129 { … … 135 135 pszType = ValueUnion.psz; 136 136 else 137 rc = E_FAIL;137 hrc = E_FAIL; 138 138 break; 139 139 } … … 151 151 } 152 152 else 153 rc = E_FAIL;153 hrc = E_FAIL; 154 154 break; 155 155 } … … 158 158 { 159 159 errorGetOpt(c, &ValueUnion); 160 rc = E_FAIL;160 hrc = E_FAIL; 161 161 break; 162 162 } … … 189 189 static RTEXITCODE handleBandwidthControlSet(HandlerArg *a, ComPtr<IBandwidthControl> &bwCtrl) 190 190 { 191 HRESULT rc = S_OK;191 HRESULT hrc = S_OK; 192 192 static const RTGETOPTDEF g_aBWCtlAddOptions[] = 193 193 { … … 206 206 RT_ELEMENTS(g_aBWCtlAddOptions), 3, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 207 207 208 while ( SUCCEEDED( rc)208 while ( SUCCEEDED(hrc) 209 209 && (c = RTGetOpt(&GetState, &ValueUnion))) 210 210 { … … 223 223 } 224 224 else 225 rc = E_FAIL;225 hrc = E_FAIL; 226 226 break; 227 227 } … … 230 230 { 231 231 errorGetOpt(c, &ValueUnion); 232 rc = E_FAIL;232 hrc = E_FAIL; 233 233 break; 234 234 } … … 241 241 ComPtr<IBandwidthGroup> bwGroup; 242 242 CHECK_ERROR2I_RET(bwCtrl, GetBandwidthGroup(name.raw(), bwGroup.asOutParam()), RTEXITCODE_FAILURE); 243 if (SUCCEEDED( rc))243 if (SUCCEEDED(hrc)) 244 244 { 245 245 CHECK_ERROR2I_RET(bwGroup, COMSETTER(MaxBytesPerSec)((LONG64)cMaxBytesPerSec), RTEXITCODE_FAILURE); … … 311 311 RTEXITCODE handleBandwidthControl(HandlerArg *a) 312 312 { 313 HRESULT rc = S_OK;313 HRESULT hrc = S_OK; 314 314 ComPtr<IMachine> machine; 315 315 ComPtr<IBandwidthControl> bwCtrl; … … 332 332 /* get the mutable session machine */ 333 333 a->session->COMGETTER(Machine)(machine.asOutParam()); 334 rc = machine->COMGETTER(BandwidthControl)(bwCtrl.asOutParam());335 if (FAILED( rc)) goto leave;334 hrc = machine->COMGETTER(BandwidthControl)(bwCtrl.asOutParam()); 335 if (FAILED(hrc)) goto leave; /** @todo r=andy Argh!! */ 336 336 337 337 if (!strcmp(a->argv[1], "add")) … … 342 342 goto leave; 343 343 } 344 rc = handleBandwidthControlAdd(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;344 hrc = handleBandwidthControlAdd(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 345 345 } 346 346 else if (!strcmp(a->argv[1], "remove")) … … 351 351 goto leave; 352 352 } 353 rc = handleBandwidthControlRemove(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;353 hrc = handleBandwidthControlRemove(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 354 354 } 355 355 else if (!strcmp(a->argv[1], "set")) 356 rc = handleBandwidthControlSet(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;356 hrc = handleBandwidthControlSet(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 357 357 else if (!strcmp(a->argv[1], "list")) 358 rc = handleBandwidthControlList(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;358 hrc = handleBandwidthControlList(a, bwCtrl) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 359 359 else 360 360 { 361 361 errorSyntax(BWControl::tr("Invalid parameter '%s'"), a->argv[1]); 362 rc = E_FAIL;362 hrc = E_FAIL; 363 363 } 364 364 365 365 /* commit changes */ 366 if (SUCCEEDED( rc))366 if (SUCCEEDED(hrc)) 367 367 CHECK_ERROR(machine, SaveSettings()); 368 368 … … 371 371 a->session->UnlockMachine(); 372 372 373 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;374 } 373 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 374 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r94660 r95140 213 213 com::SafeArray<LONG> saScancodes(llScancodes); 214 214 215 HRESULT rc = S_OK;215 HRESULT hrc = S_OK; 216 216 size_t i; 217 217 for (i = 0; i < saScancodes.size(); ++i) 218 218 { 219 rc = pKeyboard->PutScancode(saScancodes[i]);220 if (FAILED( rc))219 hrc = pKeyboard->PutScancode(saScancodes[i]); 220 if (FAILED(hrc)) 221 221 { 222 222 RTMsgError(ControlVM::tr("Failed to send a scancode.")); … … 227 227 } 228 228 229 return rc;229 return hrc; 230 230 } 231 231 … … 346 346 using namespace com; 347 347 bool fNeedsSaving = false; 348 HRESULT rc;348 HRESULT hrc; 349 349 350 350 if (a->argc < 2) … … 355 355 CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(), 356 356 machine.asOutParam())); 357 if (FAILED( rc))357 if (FAILED(hrc)) 358 358 return RTEXITCODE_FAILURE; 359 359 … … 396 396 { 397 397 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 398 rc = E_FAIL;398 hrc = E_FAIL; 399 399 break; 400 400 } … … 410 410 { 411 411 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 412 rc = E_FAIL;412 hrc = E_FAIL; 413 413 break; 414 414 } … … 424 424 { 425 425 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 426 rc = E_FAIL;426 hrc = E_FAIL; 427 427 break; 428 428 } … … 443 443 { 444 444 errorSyntax(ControlVM::tr("Invalid value '%s'."), a->argv[2]); 445 rc = E_FAIL;445 hrc = E_FAIL; 446 446 break; 447 447 } … … 452 452 { 453 453 errorSyntax(ControlVM::tr("Audio adapter not enabled in VM configuration.")); 454 rc = E_FAIL;454 hrc = E_FAIL; 455 455 break; 456 456 } … … 467 467 { 468 468 errorSyntax(ControlVM::tr("Invalid value '%s'."), a->argv[2]); 469 rc = E_FAIL;469 hrc = E_FAIL; 470 470 break; 471 471 } … … 476 476 { 477 477 errorSyntax(ControlVM::tr("Audio adapter not enabled in VM configuration.")); 478 rc = E_FAIL;478 hrc = E_FAIL; 479 479 break; 480 480 } … … 486 486 { 487 487 errorArgument(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 488 rc = E_FAIL;488 hrc = E_FAIL; 489 489 break; 490 490 } … … 497 497 { 498 498 errorSyntax(ControlVM::tr("Missing argument to '%s %s'."), a->argv[1], a->argv[2]); 499 rc = E_FAIL;499 hrc = E_FAIL; 500 500 break; 501 501 } … … 512 512 { 513 513 errorSyntax(ControlVM::tr("Invalid '%s %s' argument '%s'."), a->argv[1], a->argv[2], a->argv[3]); 514 rc = E_FAIL;514 hrc = E_FAIL; 515 515 break; 516 516 } 517 517 518 518 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(ClipboardMode)(mode)); 519 if (SUCCEEDED( rc))519 if (SUCCEEDED(hrc)) 520 520 fNeedsSaving = true; 521 521 } … … 527 527 { 528 528 errorSyntax(ControlVM::tr("Missing argument to '%s %s'."), a->argv[1], a->argv[2]); 529 rc = E_FAIL;529 hrc = E_FAIL; 530 530 break; 531 531 } … … 535 535 { 536 536 errorSyntax(ControlVM::tr("Invalid '%s %s' argument '%s'."), a->argv[1], a->argv[2], a->argv[3]); 537 rc = E_FAIL;537 hrc = E_FAIL; 538 538 break; 539 539 } … … 546 546 { 547 547 errorArgument(ControlVM::tr("Invalid '%s' argument '%s'."), a->argv[1], a->argv[2]); 548 rc = E_FAIL;548 hrc = E_FAIL; 549 549 break; 550 550 } … … 557 557 { 558 558 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 559 rc = E_FAIL;559 hrc = E_FAIL; 560 560 break; 561 561 } … … 573 573 { 574 574 errorSyntax(ControlVM::tr("Invalid '%s' argument '%s'."), a->argv[1], a->argv[2]); 575 rc = E_FAIL;576 } 577 if (SUCCEEDED( rc))575 hrc = E_FAIL; 576 } 577 if (SUCCEEDED(hrc)) 578 578 { 579 579 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(DnDMode)(mode)); 580 if (SUCCEEDED( rc))580 if (SUCCEEDED(hrc)) 581 581 fNeedsSaving = true; 582 582 } … … 588 588 CHECK_ERROR_BREAK(console, PowerDown(progress.asOutParam())); 589 589 590 rc = showProgress(progress);590 hrc = showProgress(progress); 591 591 CHECK_PROGRESS_ERROR(progress, (ControlVM::tr("Failed to power off machine."))); 592 592 } … … 596 596 /* first pause so we don't trigger a live save which needs more time/resources */ 597 597 bool fPaused = false; 598 rc = console->Pause();599 if (FAILED( rc))598 hrc = console->Pause(); 599 if (FAILED(hrc)) 600 600 { 601 601 bool fError = true; 602 if ( rc == VBOX_E_INVALID_VM_STATE)602 if (hrc == VBOX_E_INVALID_VM_STATE) 603 603 { 604 604 /* check if we are already paused */ … … 606 606 CHECK_ERROR_BREAK(console, COMGETTER(State)(&machineState)); 607 607 /* the error code was lost by the previous instruction */ 608 rc = VBOX_E_INVALID_VM_STATE;608 hrc = VBOX_E_INVALID_VM_STATE; 609 609 if (machineState != MachineState_Paused) 610 610 { … … 624 624 ComPtr<IProgress> progress; 625 625 CHECK_ERROR(sessionMachine, SaveState(progress.asOutParam())); 626 if (FAILED( rc))626 if (FAILED(hrc)) 627 627 { 628 628 if (!fPaused) … … 631 631 } 632 632 633 rc = showProgress(progress);633 hrc = showProgress(progress); 634 634 CHECK_PROGRESS_ERROR(progress, (ControlVM::tr("Failed to save machine state."))); 635 if (FAILED( rc))635 if (FAILED(hrc)) 636 636 { 637 637 if (!fPaused) … … 664 664 { 665 665 RTMsgError(ControlVM::tr("Guest not running.")); 666 rc = E_FAIL;666 hrc = E_FAIL; 667 667 break; 668 668 } … … 679 679 680 680 CHECK_ERROR(pGuest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags))); 681 if (FAILED( rc))682 { 683 if ( rc == VBOX_E_NOT_SUPPORTED)681 if (FAILED(hrc)) 682 { 683 if (hrc == VBOX_E_NOT_SUPPORTED) 684 684 { 685 685 if (fReboot) … … 699 699 { 700 700 RTMsgError(ControlVM::tr("Guest not running.")); 701 rc = E_FAIL;701 hrc = E_FAIL; 702 702 break; 703 703 } … … 707 707 errorSyntax(ControlVM::tr("Missing argument to '%s'. Expected IBM PC AT set 2 keyboard scancode(s)."), 708 708 a->argv[1]); 709 rc = E_FAIL;709 hrc = E_FAIL; 710 710 break; 711 711 } … … 722 722 { 723 723 uint8_t u8Scancode; 724 int irc = RTStrToUInt8Ex(a->argv[i], NULL, 16, &u8Scancode);725 if (RT_FAILURE ( irc))724 int vrc = RTStrToUInt8Ex(a->argv[i], NULL, 16, &u8Scancode); 725 if (RT_FAILURE (vrc)) 726 726 { 727 RTMsgError(ControlVM::tr("Converting '%s' returned %Rrc!"), a->argv[i], rc);728 rc = E_FAIL;727 RTMsgError(ControlVM::tr("Converting '%s' returned %Rrc!"), a->argv[i], vrc); 728 hrc = E_FAIL; 729 729 break; 730 730 } … … 735 735 { 736 736 RTMsgError(ControlVM::tr("'%s' is not a hex byte!"), a->argv[i]); 737 rc = E_FAIL;738 break; 739 } 740 } 741 742 if (FAILED( rc))743 break; 744 745 rc = keyboardPutScancodes(pKeyboard, llScancodes);737 hrc = E_FAIL; 738 break; 739 } 740 } 741 742 if (FAILED(hrc)) 743 break; 744 745 hrc = keyboardPutScancodes(pKeyboard, llScancodes); 746 746 } 747 747 else if (!strcmp(a->argv[1], "keyboardputstring")) … … 753 753 { 754 754 RTMsgError(ControlVM::tr("Guest not running.")); 755 rc = E_FAIL;755 hrc = E_FAIL; 756 756 break; 757 757 } … … 760 760 { 761 761 errorSyntax(ControlVM::tr("Missing argument to '%s'. Expected ASCII string(s)."), a->argv[1]); 762 rc = E_FAIL;763 break; 764 } 765 766 rc = keyboardPutString(pKeyboard, a->argc, a->argv);762 hrc = E_FAIL; 763 break; 764 } 765 766 hrc = keyboardPutString(pKeyboard, a->argc, a->argv); 767 767 } 768 768 else if (!strcmp(a->argv[1], "keyboardputfile")) … … 774 774 { 775 775 RTMsgError(ControlVM::tr("Guest not running.")); 776 rc = E_FAIL;776 hrc = E_FAIL; 777 777 break; 778 778 } … … 781 781 { 782 782 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 783 rc = E_FAIL;784 break; 785 } 786 787 rc = keyboardPutFile(pKeyboard, a->argv[2]);783 hrc = E_FAIL; 784 break; 785 } 786 787 hrc = keyboardPutFile(pKeyboard, a->argv[2]); 788 788 } 789 789 else if (!strncmp(a->argv[1], "setlinkstate", 12)) … … 795 795 if (!n) 796 796 { 797 rc = E_FAIL;797 hrc = E_FAIL; 798 798 break; 799 799 } … … 801 801 { 802 802 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 803 rc = E_FAIL;803 hrc = E_FAIL; 804 804 break; 805 805 } … … 813 813 { 814 814 errorSyntax(ControlVM::tr("Invalid link state '%s'."), a->argv[2]); 815 rc = E_FAIL;815 hrc = E_FAIL; 816 816 break; 817 817 } … … 833 833 if (!n) 834 834 { 835 rc = E_FAIL;835 hrc = E_FAIL; 836 836 break; 837 837 } … … 839 839 { 840 840 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 841 rc = E_FAIL;841 hrc = E_FAIL; 842 842 break; 843 843 } … … 859 859 { 860 860 errorSyntax(ControlVM::tr("Filename not specified for NIC %lu."), n); 861 rc = E_FAIL;861 hrc = E_FAIL; 862 862 break; 863 863 } 864 if (SUCCEEDED( rc))864 if (SUCCEEDED(hrc)) 865 865 fNeedsSaving = true; 866 866 } … … 877 877 if (!n) 878 878 { 879 rc = E_FAIL;879 hrc = E_FAIL; 880 880 break; 881 881 } … … 883 883 { 884 884 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 885 rc = E_FAIL;885 hrc = E_FAIL; 886 886 break; 887 887 } … … 900 900 { 901 901 errorSyntax(ControlVM::tr("Invalid nictrace%lu argument '%s'."), n, a->argv[2]); 902 rc = E_FAIL;902 hrc = E_FAIL; 903 903 break; 904 904 } … … 918 918 if (!n) 919 919 { 920 rc = E_FAIL;920 hrc = E_FAIL; 921 921 break; 922 922 } … … 924 924 { 925 925 errorArgument(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 926 rc = E_FAIL;926 hrc = E_FAIL; 927 927 break; 928 928 } … … 933 933 if (!adapter) 934 934 { 935 rc = E_FAIL;935 hrc = E_FAIL; 936 936 break; 937 937 } … … 940 940 if (!engine) 941 941 { 942 rc = E_FAIL;942 hrc = E_FAIL; 943 943 break; 944 944 } … … 1001 1001 #undef ITERATE_TO_NEXT_TERM 1002 1002 } 1003 if (SUCCEEDED( rc))1003 if (SUCCEEDED(hrc)) 1004 1004 fNeedsSaving = true; 1005 1005 } … … 1012 1012 if (!n) 1013 1013 { 1014 rc = E_FAIL;1014 hrc = E_FAIL; 1015 1015 break; 1016 1016 } … … 1018 1018 { 1019 1019 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1020 rc = E_FAIL;1020 hrc = E_FAIL; 1021 1021 break; 1022 1022 } … … 1043 1043 Bstr bstrValue = &pDelimiter[1]; 1044 1044 CHECK_ERROR(adapter, SetProperty(bstrName.raw(), bstrValue.raw())); 1045 if (SUCCEEDED( rc))1045 if (SUCCEEDED(hrc)) 1046 1046 fNeedsSaving = true; 1047 1047 } … … 1049 1049 { 1050 1050 errorSyntax(ControlVM::tr("Invalid nicproperty%d argument '%s'."), n, a->argv[2]); 1051 rc = E_FAIL;1051 hrc = E_FAIL; 1052 1052 } 1053 1053 RTStrFree(pszProperty); … … 1057 1057 RTMsgError(ControlVM::tr("Failed to allocate memory for nicproperty%d '%s'."), 1058 1058 n, a->argv[2]); 1059 rc = E_FAIL;1059 hrc = E_FAIL; 1060 1060 } 1061 if (FAILED( rc))1061 if (FAILED(hrc)) 1062 1062 break; 1063 1063 } … … 1074 1074 if (!n) 1075 1075 { 1076 rc = E_FAIL;1076 hrc = E_FAIL; 1077 1077 break; 1078 1078 } … … 1080 1080 { 1081 1081 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1082 rc = E_FAIL;1082 hrc = E_FAIL; 1083 1083 break; 1084 1084 } … … 1104 1104 { 1105 1105 errorSyntax(ControlVM::tr("Unknown promiscuous mode policy '%s'."), a->argv[2]); 1106 rc = E_INVALIDARG;1106 hrc = E_INVALIDARG; 1107 1107 break; 1108 1108 } 1109 1109 1110 1110 CHECK_ERROR(adapter, COMSETTER(PromiscModePolicy)(enmPromiscModePolicy)); 1111 if (SUCCEEDED( rc))1111 if (SUCCEEDED(hrc)) 1112 1112 fNeedsSaving = true; 1113 1113 } … … 1124 1124 if (!n) 1125 1125 { 1126 rc = E_FAIL;1126 hrc = E_FAIL; 1127 1127 break; 1128 1128 } … … 1130 1130 { 1131 1131 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1132 rc = E_FAIL;1132 hrc = E_FAIL; 1133 1133 break; 1134 1134 } … … 1159 1159 { 1160 1160 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[2]); 1161 rc = E_FAIL;1161 hrc = E_FAIL; 1162 1162 break; 1163 1163 } … … 1171 1171 { 1172 1172 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[2]); 1173 rc = E_FAIL;1173 hrc = E_FAIL; 1174 1174 break; 1175 1175 } … … 1183 1183 { 1184 1184 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[2]); 1185 rc = E_FAIL;1185 hrc = E_FAIL; 1186 1186 break; 1187 1187 } … … 1196 1196 { 1197 1197 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[2]); 1198 rc = E_FAIL;1198 hrc = E_FAIL; 1199 1199 break; 1200 1200 } … … 1207 1207 { 1208 1208 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[2]); 1209 rc = E_FAIL;1209 hrc = E_FAIL; 1210 1210 break; 1211 1211 } … … 1216 1216 { 1217 1217 errorSyntax(ControlVM::tr("Invalid type '%s' specfied for NIC %lu."), a->argv[2], n); 1218 rc = E_FAIL;1218 hrc = E_FAIL; 1219 1219 break; 1220 1220 } 1221 if (SUCCEEDED( rc))1221 if (SUCCEEDED(hrc)) 1222 1222 fNeedsSaving = true; 1223 1223 } … … 1236 1236 { 1237 1237 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1238 rc = E_FAIL;1238 hrc = E_FAIL; 1239 1239 break; 1240 1240 } … … 1248 1248 { 1249 1249 errorSyntax(ControlVM::tr("Invalid remote desktop server state '%s'."), a->argv[2]); 1250 rc = E_FAIL;1250 hrc = E_FAIL; 1251 1251 break; 1252 1252 } … … 1265 1265 { 1266 1266 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1267 rc = E_FAIL;1267 hrc = E_FAIL; 1268 1268 break; 1269 1269 } … … 1282 1282 1283 1283 CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(Bstr("TCP/Ports").raw(), ports.raw())); 1284 if (SUCCEEDED( rc))1284 if (SUCCEEDED(hrc)) 1285 1285 fNeedsSaving = true; 1286 1286 } … … 1296 1296 { 1297 1297 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1298 rc = E_FAIL;1298 hrc = E_FAIL; 1299 1299 break; 1300 1300 } … … 1307 1307 1308 1308 CHECK_ERROR(vrdeServer, SetVRDEProperty(Bstr("VideoChannel/Quality").raw(), value.raw())); 1309 if (SUCCEEDED( rc))1309 if (SUCCEEDED(hrc)) 1310 1310 fNeedsSaving = true; 1311 1311 } … … 1317 1317 { 1318 1318 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1319 rc = E_FAIL;1319 hrc = E_FAIL; 1320 1320 break; 1321 1321 } … … 1337 1337 Bstr bstrValue = &pDelimiter[1]; 1338 1338 CHECK_ERROR(vrdeServer, SetVRDEProperty(bstrName.raw(), bstrValue.raw())); 1339 if (SUCCEEDED( rc))1339 if (SUCCEEDED(hrc)) 1340 1340 fNeedsSaving = true; 1341 1341 } … … 1343 1343 { 1344 1344 errorSyntax(ControlVM::tr("Invalid vrdeproperty argument '%s'."), a->argv[2]); 1345 rc = E_FAIL;1345 hrc = E_FAIL; 1346 1346 } 1347 1347 RTStrFree(pszProperty); … … 1351 1351 RTMsgError(ControlVM::tr("Failed to allocate memory for VRDE property '%s'."), 1352 1352 a->argv[2]); 1353 rc = E_FAIL;1354 } 1355 } 1356 if (FAILED( rc))1353 hrc = E_FAIL; 1354 } 1355 } 1356 if (FAILED(hrc)) 1357 1357 { 1358 1358 break; … … 1371 1371 { 1372 1372 errorSyntax(ControlVM::tr("Not enough parameters.")); 1373 rc = E_FAIL;1373 hrc = E_FAIL; 1374 1374 break; 1375 1375 } … … 1377 1377 { 1378 1378 errorSyntax(ControlVM::tr("Wrong number of arguments.")); 1379 rc = E_FAIL;1379 hrc = E_FAIL; 1380 1380 break; 1381 1381 } … … 1391 1391 { 1392 1392 errorSyntax(ControlVM::tr("Invalid parameter '%s'."), a->argv[3]); 1393 rc = E_FAIL;1393 hrc = E_FAIL; 1394 1394 break; 1395 1395 } … … 1424 1424 { 1425 1425 errorSyntax(ControlVM::tr("Zero UUID argument '%s'."), a->argv[2]); 1426 rc = E_FAIL;1426 hrc = E_FAIL; 1427 1427 break; 1428 1428 } … … 1443 1443 { 1444 1444 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1445 rc = E_FAIL;1445 hrc = E_FAIL; 1446 1446 break; 1447 1447 } … … 1461 1461 { 1462 1462 errorSyntax(ControlVM::tr("Either \"yes\" or \"no\" is expected.")); 1463 rc = E_FAIL;1463 hrc = E_FAIL; 1464 1464 break; 1465 1465 } … … 1477 1477 { 1478 1478 RTMsgError(ControlVM::tr("Guest not running.")); 1479 rc = E_FAIL;1479 hrc = E_FAIL; 1480 1480 break; 1481 1481 } … … 1490 1490 { 1491 1491 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1492 rc = E_FAIL;1492 hrc = E_FAIL; 1493 1493 break; 1494 1494 } … … 1499 1499 { 1500 1500 RTMsgError(ControlVM::tr("Guest not running.")); 1501 rc = E_FAIL;1501 hrc = E_FAIL; 1502 1502 break; 1503 1503 } … … 1526 1526 { 1527 1527 errorSyntax(ControlVM::tr("Display status must be <on> or <off>.")); 1528 rc = E_FAIL;1528 hrc = E_FAIL; 1529 1529 break; 1530 1530 } … … 1541 1541 { 1542 1542 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1543 rc = E_FAIL;1543 hrc = E_FAIL; 1544 1544 break; 1545 1545 } … … 1568 1568 } 1569 1569 1570 if (FAILED( rc))1570 if (FAILED(hrc)) 1571 1571 break; 1572 1572 … … 1586 1586 { 1587 1587 errorSyntax(ControlVM::tr("Invalid parameter '%s'."), a->argv[5]); 1588 rc = E_FAIL;1588 hrc = E_FAIL; 1589 1589 break; 1590 1590 } … … 1598 1598 { 1599 1599 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1600 rc = E_FAIL;1600 hrc = E_FAIL; 1601 1601 break; 1602 1602 } … … 1612 1612 if (rcExit != RTEXITCODE_SUCCESS) 1613 1613 { 1614 rc = E_FAIL;1614 hrc = E_FAIL; 1615 1615 break; 1616 1616 } … … 1623 1623 { 1624 1624 RTMsgError(ControlVM::tr("Guest not running.")); 1625 rc = E_FAIL;1625 hrc = E_FAIL; 1626 1626 break; 1627 1627 } … … 1637 1637 { 1638 1638 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1639 rc = E_FAIL;1639 hrc = E_FAIL; 1640 1640 break; 1641 1641 } … … 1646 1646 { 1647 1647 errorSyntax(ControlVM::tr("Error parsing guest memory balloon size '%s'."), a->argv[2]); 1648 rc = E_FAIL;1648 hrc = E_FAIL; 1649 1649 break; 1650 1650 } 1651 1651 /* guest is running; update IGuest */ 1652 1652 ComPtr<IGuest> pGuest; 1653 rc = console->COMGETTER(Guest)(pGuest.asOutParam());1654 if (SUCCEEDED( rc))1653 hrc = console->COMGETTER(Guest)(pGuest.asOutParam()); 1654 if (SUCCEEDED(hrc)) 1655 1655 { 1656 1656 if (!pGuest) 1657 1657 { 1658 1658 RTMsgError(ControlVM::tr("Guest not running.")); 1659 rc = E_FAIL;1659 hrc = E_FAIL; 1660 1660 break; 1661 1661 } … … 1685 1685 int ch; 1686 1686 RTGETOPTUNION Value; 1687 while ( SUCCEEDED( rc)1687 while ( SUCCEEDED(hrc) 1688 1688 && (ch = RTGetOpt(&GetOptState, &Value))) 1689 1689 { … … 1698 1698 RTEXITCODE rcExit = readPasswordFile(Value.psz, &strPassword); 1699 1699 if (rcExit != RTEXITCODE_SUCCESS) 1700 rc = E_FAIL;1700 hrc = E_FAIL; 1701 1701 break; 1702 1702 } … … 1705 1705 default: 1706 1706 errorGetOpt(ch, &Value); 1707 rc = E_FAIL;1707 hrc = E_FAIL; 1708 1708 break; 1709 1709 } 1710 1710 } 1711 if (FAILED( rc))1711 if (FAILED(hrc)) 1712 1712 break; 1713 1713 … … 1720 1720 if (cMsTimeout) 1721 1721 { 1722 rc = progress->COMSETTER(Timeout)(cMsTimeout);1723 if (FAILED( rc) &&rc != VBOX_E_INVALID_OBJECT_STATE)1722 hrc = progress->COMSETTER(Timeout)(cMsTimeout); 1723 if (FAILED(hrc) && hrc != VBOX_E_INVALID_OBJECT_STATE) 1724 1724 CHECK_ERROR_BREAK(progress, COMSETTER(Timeout)(cMsTimeout)); /* lazyness */ 1725 1725 } 1726 1726 1727 rc = showProgress(progress);1727 hrc = showProgress(progress); 1728 1728 CHECK_PROGRESS_ERROR(progress, (ControlVM::tr("Teleportation failed"))); 1729 1729 } … … 1734 1734 { 1735 1735 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1736 rc = E_FAIL;1736 hrc = E_FAIL; 1737 1737 break; 1738 1738 } … … 1745 1745 { 1746 1746 errorSyntax(ControlVM::tr("Error parsing display number '%s'."), a->argv[3]); 1747 rc = E_FAIL;1747 hrc = E_FAIL; 1748 1748 break; 1749 1749 } … … 1754 1754 { 1755 1755 RTMsgError(ControlVM::tr("Guest not running.")); 1756 rc = E_FAIL;1756 hrc = E_FAIL; 1757 1757 break; 1758 1758 } … … 1768 1768 { 1769 1769 RTMsgError(ControlVM::tr("Failed to create file '%s' (%Rrc)."), a->argv[2], vrc); 1770 rc = E_FAIL;1770 hrc = E_FAIL; 1771 1771 break; 1772 1772 } … … 1775 1775 { 1776 1776 RTMsgError(ControlVM::tr("Failed to write screenshot to file '%s' (%Rrc)."), a->argv[2], vrc); 1777 rc = E_FAIL;1777 hrc = E_FAIL; 1778 1778 } 1779 1779 RTFileClose(pngFile); … … 1786 1786 { 1787 1787 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1788 rc = E_FAIL;1788 hrc = E_FAIL; 1789 1789 break; 1790 1790 } … … 1820 1820 { 1821 1821 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1822 rc = E_FAIL;1822 hrc = E_FAIL; 1823 1823 break; 1824 1824 } … … 1826 1826 { 1827 1827 errorSyntax(ControlVM::tr("Error parsing list of screen IDs '%s'."), a->argv[3]); 1828 rc = E_FAIL;1828 hrc = E_FAIL; 1829 1829 break; 1830 1830 } … … 1839 1839 { 1840 1840 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1841 rc = E_FAIL;1841 hrc = E_FAIL; 1842 1842 break; 1843 1843 } … … 1853 1853 { 1854 1854 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1855 rc = E_FAIL;1855 hrc = E_FAIL; 1856 1856 break; 1857 1857 } … … 1862 1862 { 1863 1863 errorSyntax(ControlVM::tr("Error parsing video width '%s'."), a->argv[3]); 1864 rc = E_FAIL;1864 hrc = E_FAIL; 1865 1865 break; 1866 1866 } … … 1871 1871 { 1872 1872 errorSyntax(ControlVM::tr("Error parsing video height '%s'."), a->argv[4]); 1873 rc = E_FAIL;1873 hrc = E_FAIL; 1874 1874 break; 1875 1875 } … … 1887 1887 { 1888 1888 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1889 rc = E_FAIL;1889 hrc = E_FAIL; 1890 1890 break; 1891 1891 } … … 1896 1896 { 1897 1897 errorSyntax(ControlVM::tr("Error parsing video rate '%s'."), a->argv[3]); 1898 rc = E_FAIL;1898 hrc = E_FAIL; 1899 1899 break; 1900 1900 } … … 1909 1909 { 1910 1910 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1911 rc = E_FAIL;1911 hrc = E_FAIL; 1912 1912 break; 1913 1913 } … … 1918 1918 { 1919 1919 errorSyntax(ControlVM::tr("Error parsing video FPS '%s'."), a->argv[3]); 1920 rc = E_FAIL;1920 hrc = E_FAIL; 1921 1921 break; 1922 1922 } … … 1931 1931 { 1932 1932 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1933 rc = E_FAIL;1933 hrc = E_FAIL; 1934 1934 break; 1935 1935 } … … 1940 1940 { 1941 1941 errorSyntax(ControlVM::tr("Error parsing maximum time '%s'."), a->argv[3]); 1942 rc = E_FAIL;1942 hrc = E_FAIL; 1943 1943 break; 1944 1944 } … … 1953 1953 { 1954 1954 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1955 rc = E_FAIL;1955 hrc = E_FAIL; 1956 1956 break; 1957 1957 } … … 1962 1962 { 1963 1963 errorSyntax(ControlVM::tr("Error parsing maximum file size '%s'."), a->argv[3]); 1964 rc = E_FAIL;1964 hrc = E_FAIL; 1965 1965 break; 1966 1966 } … … 1977 1977 { 1978 1978 errorSyntax(ControlVM::tr("Incorrect number of parameters.")); 1979 rc = E_FAIL;1979 hrc = E_FAIL; 1980 1980 break; 1981 1981 } … … 1991 1991 { 1992 1992 errorArgument(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 1993 rc = E_FAIL;1993 hrc = E_FAIL; 1994 1994 break; 1995 1995 } … … 2000 2000 { 2001 2001 RTMsgError(ControlVM::tr("Guest not running.")); 2002 rc = E_FAIL;2002 hrc = E_FAIL; 2003 2003 break; 2004 2004 } … … 2036 2036 { 2037 2037 errorArgument(ControlVM::tr("Invalid argument to '%s'."), a->argv[1]); 2038 rc = E_FAIL;2038 hrc = E_FAIL; 2039 2039 break; 2040 2040 } … … 2108 2108 if (!n) 2109 2109 { 2110 rc = E_FAIL;2110 hrc = E_FAIL; 2111 2111 break; 2112 2112 } … … 2114 2114 { 2115 2115 errorSyntax(ControlVM::tr("Missing argument to '%s'."), a->argv[1]); 2116 rc = E_FAIL;2116 hrc = E_FAIL; 2117 2117 break; 2118 2118 } … … 2128 2128 { 2129 2129 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2130 rc = E_FAIL;2130 hrc = E_FAIL; 2131 2131 break; 2132 2132 } … … 2143 2143 { 2144 2144 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2145 rc = E_FAIL;2145 hrc = E_FAIL; 2146 2146 break; 2147 2147 } … … 2184 2184 { 2185 2185 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2186 rc = E_FAIL;2186 hrc = E_FAIL; 2187 2187 break; 2188 2188 } … … 2197 2197 { 2198 2198 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2199 rc = E_FAIL;2199 hrc = E_FAIL; 2200 2200 break; 2201 2201 } … … 2204 2204 { 2205 2205 errorSyntax(ControlVM::tr("Invalid vm-process-priority '%s'."), a->argv[2]); 2206 rc = E_FAIL;2206 hrc = E_FAIL; 2207 2207 } 2208 2208 else … … 2218 2218 { 2219 2219 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2220 rc = E_FAIL;2220 hrc = E_FAIL; 2221 2221 break; 2222 2222 } … … 2225 2225 { 2226 2226 errorSyntax(ControlVM::tr("Invalid value '%s'."), a->argv[2]); 2227 rc = E_FAIL;2227 hrc = E_FAIL; 2228 2228 break; 2229 2229 } … … 2238 2238 { 2239 2239 errorSyntax(ControlVM::tr("Incorrect arguments to '%s'."), a->argv[1]); 2240 rc = E_FAIL;2240 hrc = E_FAIL; 2241 2241 break; 2242 2242 } … … 2247 2247 { 2248 2248 errorSyntax(ControlVM::tr("Invalid autostart delay number '%s'."), a->argv[2]); 2249 rc = E_FAIL;2249 hrc = E_FAIL; 2250 2250 break; 2251 2251 } 2252 2252 CHECK_ERROR(sessionMachine, COMSETTER(AutostartDelay)(u32)); 2253 if (SUCCEEDED( rc))2253 if (SUCCEEDED(hrc)) 2254 2254 fNeedsSaving = true; 2255 2255 break; … … 2258 2258 { 2259 2259 errorSyntax(ControlVM::tr("Invalid parameter '%s'."), a->argv[1]); 2260 rc = E_FAIL;2260 hrc = E_FAIL; 2261 2261 } 2262 2262 } while (0); … … 2268 2268 a->session->UnlockMachine(); 2269 2269 2270 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;2270 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2271 2271 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
r93115 r95140 907 907 * Find or create the server. 908 908 */ 909 HRESULT rc;909 HRESULT hrc; 910 910 Bstr NetName; 911 911 if (!pCtx->pszNetwork) … … 916 916 ComPtr<IHostNetworkInterface> hif; 917 917 CHECK_ERROR(host, FindHostNetworkInterfaceByName(Bstr(pCtx->pszInterface).mutableRaw(), hif.asOutParam())); 918 if (FAILED( rc))918 if (FAILED(hrc)) 919 919 return errorArgument(DHCPServer::tr("Could not find interface '%s'"), pCtx->pszInterface); 920 920 921 921 CHECK_ERROR(hif, COMGETTER(NetworkName) (NetName.asOutParam())); 922 if (FAILED( rc))922 if (FAILED(hrc)) 923 923 return errorArgument(DHCPServer::tr("Could not get network name for the interface '%s'"), pCtx->pszInterface); 924 924 } … … 928 928 } 929 929 930 rc = pCtx->pArg->virtualBox->FindDHCPServerByNetworkName(NetName.mutableRaw(), ptrDHCPServer.asOutParam());930 hrc = pCtx->pArg->virtualBox->FindDHCPServerByNetworkName(NetName.mutableRaw(), ptrDHCPServer.asOutParam()); 931 931 if (pCtx->pCmdDef->fSubcommandScope == HELP_SCOPE_DHCPSERVER_ADD) 932 932 { 933 if (SUCCEEDED( rc))933 if (SUCCEEDED(hrc)) 934 934 return errorArgument(DHCPServer::tr("DHCP server already exists")); 935 935 936 936 CHECK_ERROR(pCtx->pArg->virtualBox, CreateDHCPServer(NetName.mutableRaw(), ptrDHCPServer.asOutParam())); 937 if (FAILED( rc))937 if (FAILED(hrc)) 938 938 return errorArgument(DHCPServer::tr("Failed to create the DHCP server")); 939 939 } 940 else if (FAILED( rc))940 else if (FAILED(hrc)) 941 941 return errorArgument(DHCPServer::tr("DHCP server does not exist")); 942 942 … … 944 944 * Apply IDHCPServer settings: 945 945 */ 946 HRESULT hrc;947 946 if (pszServerIp || pszNetmask || pszLowerIp || pszUpperIp) 948 947 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r94236 r95140 171 171 bool fSilent) 172 172 { 173 HRESULT rc;173 HRESULT hrc; 174 174 Guid id(pszFilenameOrUuid); 175 175 char szFilenameAbs[RTPATH_MAX] = ""; … … 195 195 pMedium.asOutParam())); 196 196 else 197 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(),198 enmDevType,199 enmAccessMode,200 fForceNewUuidOnOpen,201 pMedium.asOutParam());202 203 return rc;197 hrc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 198 enmDevType, 199 enmAccessMode, 200 fForceNewUuidOnOpen, 201 pMedium.asOutParam()); 202 203 return hrc; 204 204 } 205 205 … … 208 208 AccessMode_T enmAccessMode, ComPtr<IMedium> &pMedium) 209 209 { 210 HRESULT rc;210 HRESULT hrc; 211 211 char szFilenameAbs[RTPATH_MAX] = ""; 212 212 … … 228 228 enmDevType, 229 229 pMedium.asOutParam())); 230 return rc;230 return hrc; 231 231 } 232 232 … … 298 298 std::list<MediumProperty> lstProperties; 299 299 300 HRESULT rc;300 HRESULT hrc; 301 301 int vrc; 302 302 const char *filename = NULL; … … 497 497 format = pszExt; 498 498 } 499 rc = openMedium(a, diffparent, DeviceType_HardDisk,500 AccessMode_ReadWrite, pParentMedium,501 false /* fForceNewUuidOnOpen */, false /* fSilent */);502 if (FAILED( rc))499 hrc = openMedium(a, diffparent, DeviceType_HardDisk, 500 AccessMode_ReadWrite, pParentMedium, 501 false /* fForceNewUuidOnOpen */, false /* fSilent */); 502 if (FAILED(hrc)) 503 503 return RTEXITCODE_FAILURE; 504 504 if (pParentMedium.isNull()) … … 506 506 MediumState_T state; 507 507 CHECK_ERROR(pParentMedium, COMGETTER(State)(&state)); 508 if (FAILED( rc))508 if (FAILED(hrc)) 509 509 return RTEXITCODE_FAILURE; 510 510 if (state == MediumState_Inaccessible) 511 511 { 512 512 CHECK_ERROR(pParentMedium, RefreshState(&state)); 513 if (FAILED( rc))513 if (FAILED(hrc)) 514 514 return RTEXITCODE_FAILURE; 515 515 } … … 539 539 ComPtr<IMedium> pMedium; 540 540 if (cmd == CMD_DISK) 541 rc = createMedium(a, format, filename, DeviceType_HardDisk,542 AccessMode_ReadWrite, pMedium);541 hrc = createMedium(a, format, filename, DeviceType_HardDisk, 542 AccessMode_ReadWrite, pMedium); 543 543 else if (cmd == CMD_DVD) 544 rc = createMedium(a, format, filename, DeviceType_DVD,545 AccessMode_ReadOnly, pMedium);544 hrc = createMedium(a, format, filename, DeviceType_DVD, 545 AccessMode_ReadOnly, pMedium); 546 546 else if (cmd == CMD_FLOPPY) 547 rc = createMedium(a, format, filename, DeviceType_Floppy,548 AccessMode_ReadWrite, pMedium);547 hrc = createMedium(a, format, filename, DeviceType_Floppy, 548 AccessMode_ReadWrite, pMedium); 549 549 else 550 rc = E_INVALIDARG; /* cannot happen but make gcc happy */551 552 553 if (SUCCEEDED( rc) && pMedium)550 hrc = E_INVALIDARG; /* cannot happen but make gcc happy */ 551 552 553 if (SUCCEEDED(hrc) && pMedium) 554 554 { 555 555 if (lstProperties.size() > 0) … … 594 594 { 595 595 com::Bstr bstrBase64Value; 596 HRESULThrc = bstrBase64Value.base64Encode(it->m_pszValue, it->m_cbValue);596 hrc = bstrBase64Value.base64Encode(it->m_pszValue, it->m_cbValue); 597 597 if (FAILED(hrc)) 598 598 return RTMsgErrorExit(RTEXITCODE_FAILURE, Disk::tr("Base64 encoding of the property %s failed. (%Rhrc)"), … … 617 617 else 618 618 CHECK_ERROR(pParentMedium, CreateDiffStorage(pMedium, ComSafeArrayAsInParam(l_variants), pProgress.asOutParam())); 619 if (SUCCEEDED( rc) && pProgress)620 { 621 rc = showProgress(pProgress);619 if (SUCCEEDED(hrc) && pProgress) 620 { 621 hrc = showProgress(pProgress); 622 622 CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to create medium"))); 623 623 } 624 624 } 625 625 626 if (SUCCEEDED( rc) && pMedium)626 if (SUCCEEDED(hrc) && pMedium) 627 627 { 628 628 Bstr uuid; … … 632 632 //CHECK_ERROR(pMedium, Close()); 633 633 } 634 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;634 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 635 635 } 636 636 … … 659 659 RTEXITCODE handleModifyMedium(HandlerArg *a) 660 660 { 661 HRESULT rc;661 HRESULT hrc; 662 662 int vrc; 663 663 enum { … … 747 747 { 748 748 errorArgument(Disk::tr("Invalid --property argument '%s'"), ValueUnion.psz); 749 rc = E_FAIL;749 hrc = E_FAIL; 750 750 } 751 751 RTStrFree(pszProperty); … … 755 755 RTStrmPrintf(g_pStdErr, Disk::tr("Error: Failed to allocate memory for medium property '%s'\n"), 756 756 ValueUnion.psz); 757 rc = E_FAIL;757 hrc = E_FAIL; 758 758 } 759 759 break; … … 836 836 /* Always open the medium if necessary, there is no other way. */ 837 837 if (cmd == CMD_DISK) 838 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,839 AccessMode_ReadWrite, pMedium,840 false /* fForceNewUuidOnOpen */, false /* fSilent */);838 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 839 AccessMode_ReadWrite, pMedium, 840 false /* fForceNewUuidOnOpen */, false /* fSilent */); 841 841 else if (cmd == CMD_DVD) 842 rc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD,843 AccessMode_ReadOnly, pMedium,844 false /* fForceNewUuidOnOpen */, false /* fSilent */);842 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD, 843 AccessMode_ReadOnly, pMedium, 844 false /* fForceNewUuidOnOpen */, false /* fSilent */); 845 845 else if (cmd == CMD_FLOPPY) 846 rc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy,847 AccessMode_ReadWrite, pMedium,848 false /* fForceNewUuidOnOpen */, false /* fSilent */);846 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy, 847 AccessMode_ReadWrite, pMedium, 848 false /* fForceNewUuidOnOpen */, false /* fSilent */); 849 849 else 850 rc = E_INVALIDARG; /* cannot happen but make gcc happy */851 if (FAILED( rc))850 hrc = E_INVALIDARG; /* cannot happen but make gcc happy */ 851 if (FAILED(hrc)) 852 852 return RTEXITCODE_FAILURE; 853 853 if (pMedium.isNull()) … … 903 903 ComPtr<IProgress> pProgress; 904 904 CHECK_ERROR(pMedium, Compact(pProgress.asOutParam())); 905 if (SUCCEEDED( rc))906 rc = showProgress(pProgress);907 if (FAILED( rc))908 { 909 if ( rc == E_NOTIMPL)905 if (SUCCEEDED(hrc)) 906 hrc = showProgress(pProgress); 907 if (FAILED(hrc)) 908 { 909 if (hrc == E_NOTIMPL) 910 910 RTMsgError(Disk::tr("Compact medium operation is not implemented!")); 911 else if ( rc == VBOX_E_NOT_SUPPORTED)911 else if (hrc == VBOX_E_NOT_SUPPORTED) 912 912 RTMsgError(Disk::tr("Compact medium operation for this format is not implemented yet!")); 913 913 else if (!pProgress.isNull()) … … 922 922 ComPtr<IProgress> pProgress; 923 923 CHECK_ERROR(pMedium, Resize(cbResize, pProgress.asOutParam())); 924 if (SUCCEEDED( rc))925 rc = showProgress(pProgress);926 if (FAILED( rc))924 if (SUCCEEDED(hrc)) 925 hrc = showProgress(pProgress); 926 if (FAILED(hrc)) 927 927 { 928 928 if (!pProgress.isNull()) 929 929 CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to resize medium"))); 930 else if ( rc == E_NOTIMPL)930 else if (hrc == E_NOTIMPL) 931 931 RTMsgError(Disk::tr("Resize medium operation is not implemented!")); 932 else if ( rc == VBOX_E_NOT_SUPPORTED)932 else if (hrc == VBOX_E_NOT_SUPPORTED) 933 933 RTMsgError(Disk::tr("Resize medium operation for this format is not implemented yet!")); 934 934 else … … 946 946 CHECK_ERROR(pMedium, MoveTo(Bstr(strLocation).raw(), pProgress.asOutParam())); 947 947 948 if (SUCCEEDED( rc) && !pProgress.isNull())948 if (SUCCEEDED(hrc) && !pProgress.isNull()) 949 949 { 950 rc = showProgress(pProgress);950 hrc = showProgress(pProgress); 951 951 CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to move medium"))); 952 952 } … … 978 978 } 979 979 980 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;980 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 981 981 } 982 982 … … 997 997 RTEXITCODE handleCloneMedium(HandlerArg *a) 998 998 { 999 HRESULT rc;999 HRESULT hrc; 1000 1000 int vrc; 1001 1001 enum { … … 1100 1100 1101 1101 if (cmd == CMD_DISK) 1102 rc = openMedium(a, pszSrc, DeviceType_HardDisk, AccessMode_ReadOnly, pSrcMedium,1103 false /* fForceNewUuidOnOpen */, false /* fSilent */);1102 hrc = openMedium(a, pszSrc, DeviceType_HardDisk, AccessMode_ReadOnly, pSrcMedium, 1103 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1104 1104 else if (cmd == CMD_DVD) 1105 rc = openMedium(a, pszSrc, DeviceType_DVD, AccessMode_ReadOnly, pSrcMedium,1106 false /* fForceNewUuidOnOpen */, false /* fSilent */);1105 hrc = openMedium(a, pszSrc, DeviceType_DVD, AccessMode_ReadOnly, pSrcMedium, 1106 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1107 1107 else if (cmd == CMD_FLOPPY) 1108 rc = openMedium(a, pszSrc, DeviceType_Floppy, AccessMode_ReadOnly, pSrcMedium,1109 false /* fForceNewUuidOnOpen */, false /* fSilent */);1108 hrc = openMedium(a, pszSrc, DeviceType_Floppy, AccessMode_ReadOnly, pSrcMedium, 1109 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1110 1110 else 1111 rc = E_INVALIDARG; /* cannot happen but make gcc happy */1112 if (FAILED( rc))1111 hrc = E_INVALIDARG; /* cannot happen but make gcc happy */ 1112 if (FAILED(hrc)) 1113 1113 return RTEXITCODE_FAILURE; 1114 1114 … … 1119 1119 { 1120 1120 if (cmd == CMD_DISK) 1121 rc = openMedium(a, pszDst, DeviceType_HardDisk, AccessMode_ReadWrite, pDstMedium,1122 false /* fForceNewUuidOnOpen */, false /* fSilent */);1121 hrc = openMedium(a, pszDst, DeviceType_HardDisk, AccessMode_ReadWrite, pDstMedium, 1122 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1123 1123 else if (cmd == CMD_DVD) 1124 rc = openMedium(a, pszDst, DeviceType_DVD, AccessMode_ReadOnly, pDstMedium,1125 false /* fForceNewUuidOnOpen */, false /* fSilent */);1124 hrc = openMedium(a, pszDst, DeviceType_DVD, AccessMode_ReadOnly, pDstMedium, 1125 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1126 1126 else if (cmd == CMD_FLOPPY) 1127 rc = openMedium(a, pszDst, DeviceType_Floppy, AccessMode_ReadWrite, pDstMedium,1128 false /* fForceNewUuidOnOpen */, false /* fSilent */);1129 if (FAILED( rc))1127 hrc = openMedium(a, pszDst, DeviceType_Floppy, AccessMode_ReadWrite, pDstMedium, 1128 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1129 if (FAILED(hrc)) 1130 1130 break; 1131 1131 … … 1157 1157 Utf8Str strFormat(format); 1158 1158 if (cmd == CMD_DISK) 1159 rc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_HardDisk,1160 AccessMode_ReadWrite, pDstMedium);1159 hrc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_HardDisk, 1160 AccessMode_ReadWrite, pDstMedium); 1161 1161 else if (cmd == CMD_DVD) 1162 rc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_DVD,1163 AccessMode_ReadOnly, pDstMedium);1162 hrc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_DVD, 1163 AccessMode_ReadOnly, pDstMedium); 1164 1164 else if (cmd == CMD_FLOPPY) 1165 rc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_Floppy,1166 AccessMode_ReadWrite, pDstMedium);1167 if (FAILED( rc))1165 hrc = createMedium(a, strFormat.c_str(), pszDst, DeviceType_Floppy, 1166 AccessMode_ReadWrite, pDstMedium); 1167 if (FAILED(hrc)) 1168 1168 break; 1169 1169 } … … 1181 1181 CHECK_ERROR_BREAK(pSrcMedium, CloneTo(pDstMedium, ComSafeArrayAsInParam(l_variants), NULL, pProgress.asOutParam())); 1182 1182 1183 rc = showProgress(pProgress);1183 hrc = showProgress(pProgress); 1184 1184 CHECK_PROGRESS_ERROR_BREAK(pProgress, (Disk::tr("Failed to clone medium"))); 1185 1185 … … 1192 1192 while (0); 1193 1193 1194 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1194 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1195 1195 } 1196 1196 … … 1384 1384 bool fOptLong) 1385 1385 { 1386 HRESULT rc = S_OK;1386 HRESULT hrc = S_OK; 1387 1387 do 1388 1388 { … … 1534 1534 Bstr strCipher; 1535 1535 Bstr strPasswordId; 1536 HRESULT rc2 = pMedium->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam());1537 if (SUCCEEDED( rc2))1536 HRESULT hrc2 = pMedium->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam()); 1537 if (SUCCEEDED(hrc2)) 1538 1538 { 1539 1539 RTPrintf(Disk::tr("Encryption: enabled\n")); … … 1626 1626 while (0); 1627 1627 1628 return rc;1628 return hrc; 1629 1629 } 1630 1630 … … 1705 1705 return errorSyntax(Disk::tr("Medium name or UUID required")); 1706 1706 1707 HRESULT rc = S_OK; /* Prevents warning. */1707 HRESULT hrc = S_OK; /* Prevents warning. */ 1708 1708 1709 1709 ComPtr<IMedium> pMedium; 1710 1710 if (cmd == CMD_DISK) 1711 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,1712 AccessMode_ReadOnly, pMedium,1713 false /* fForceNewUuidOnOpen */, false /* fSilent */);1711 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 1712 AccessMode_ReadOnly, pMedium, 1713 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1714 1714 else if (cmd == CMD_DVD) 1715 rc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD,1716 AccessMode_ReadOnly, pMedium,1717 false /* fForceNewUuidOnOpen */, false /* fSilent */);1715 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD, 1716 AccessMode_ReadOnly, pMedium, 1717 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1718 1718 else if (cmd == CMD_FLOPPY) 1719 rc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy,1720 AccessMode_ReadOnly, pMedium,1721 false /* fForceNewUuidOnOpen */, false /* fSilent */);1722 if (FAILED( rc))1719 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy, 1720 AccessMode_ReadOnly, pMedium, 1721 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1722 if (FAILED(hrc)) 1723 1723 return RTEXITCODE_FAILURE; 1724 1724 … … 1733 1733 } 1734 1734 1735 rc = showMediumInfo(a->virtualBox, pMedium, strParentUUID.c_str(), true);1736 1737 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1735 hrc = showMediumInfo(a->virtualBox, pMedium, strParentUUID.c_str(), true); 1736 1737 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1738 1738 } 1739 1739 … … 1748 1748 RTEXITCODE handleCloseMedium(HandlerArg *a) 1749 1749 { 1750 HRESULT rc = S_OK;1750 HRESULT hrc = S_OK; 1751 1751 enum { 1752 1752 CMD_NONE, … … 1822 1822 ComPtr<IMedium> pMedium; 1823 1823 if (cmd == CMD_DISK) 1824 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,1825 AccessMode_ReadWrite, pMedium,1826 false /* fForceNewUuidOnOpen */, false /* fSilent */);1824 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 1825 AccessMode_ReadWrite, pMedium, 1826 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1827 1827 else if (cmd == CMD_DVD) 1828 rc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD,1829 AccessMode_ReadOnly, pMedium,1830 false /* fForceNewUuidOnOpen */, false /* fSilent */);1828 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD, 1829 AccessMode_ReadOnly, pMedium, 1830 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1831 1831 else if (cmd == CMD_FLOPPY) 1832 rc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy,1833 AccessMode_ReadWrite, pMedium,1834 false /* fForceNewUuidOnOpen */, false /* fSilent */);1835 1836 if (SUCCEEDED( rc) && pMedium)1832 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy, 1833 AccessMode_ReadWrite, pMedium, 1834 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1835 1836 if (SUCCEEDED(hrc) && pMedium) 1837 1837 { 1838 1838 if (fDelete) … … 1840 1840 ComPtr<IProgress> pProgress; 1841 1841 CHECK_ERROR(pMedium, DeleteStorage(pProgress.asOutParam())); 1842 if (SUCCEEDED( rc))1842 if (SUCCEEDED(hrc)) 1843 1843 { 1844 rc = showProgress(pProgress);1844 hrc = showProgress(pProgress); 1845 1845 CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to delete medium"))); 1846 1846 } 1847 1847 else 1848 RTMsgError(Disk::tr("Failed to delete medium. Error code %R rc"),rc);1848 RTMsgError(Disk::tr("Failed to delete medium. Error code %Rhrc"), hrc); 1849 1849 } 1850 1850 CHECK_ERROR(pMedium, Close()); 1851 1851 } 1852 1852 1853 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1853 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1854 1854 } 1855 1855 1856 1856 RTEXITCODE handleMediumProperty(HandlerArg *a) 1857 1857 { 1858 HRESULT rc = S_OK;1858 HRESULT hrc = S_OK; 1859 1859 const char *pszCmd = NULL; 1860 1860 enum { … … 1913 1913 1914 1914 if (cmd == CMD_DISK) 1915 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,1916 AccessMode_ReadWrite, pMedium,1917 false /* fForceNewUuidOnOpen */, false /* fSilent */);1915 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 1916 AccessMode_ReadWrite, pMedium, 1917 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1918 1918 else if (cmd == CMD_DVD) 1919 rc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD,1920 AccessMode_ReadOnly, pMedium,1921 false /* fForceNewUuidOnOpen */, false /* fSilent */);1919 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_DVD, 1920 AccessMode_ReadOnly, pMedium, 1921 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1922 1922 else if (cmd == CMD_FLOPPY) 1923 rc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy,1924 AccessMode_ReadWrite, pMedium,1925 false /* fForceNewUuidOnOpen */, false /* fSilent */);1926 if (SUCCEEDED( rc) && !pMedium.isNull())1923 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_Floppy, 1924 AccessMode_ReadWrite, pMedium, 1925 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1926 if (SUCCEEDED(hrc) && !pMedium.isNull()) 1927 1927 { 1928 1928 if (!RTStrICmp(pszAction, "set")) … … 1943 1943 Bstr strVal; 1944 1944 CHECK_ERROR(pMedium, GetProperty(Bstr(pszProperty).raw(), strVal.asOutParam())); 1945 if (SUCCEEDED( rc))1945 if (SUCCEEDED(hrc)) 1946 1946 RTPrintf("%s=%ls\n", pszProperty, strVal.raw()); 1947 1947 } … … 1953 1953 } 1954 1954 1955 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1955 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1956 1956 } 1957 1957 … … 1966 1966 RTEXITCODE handleEncryptMedium(HandlerArg *a) 1967 1967 { 1968 HRESULT rc;1968 HRESULT hrc; 1969 1969 ComPtr<IMedium> hardDisk; 1970 1970 const char *pszPasswordNew = NULL; … … 2077 2077 2078 2078 /* Always open the medium if necessary, there is no other way. */ 2079 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,2080 AccessMode_ReadWrite, hardDisk,2081 false /* fForceNewUuidOnOpen */, false /* fSilent */);2082 if (FAILED( rc))2079 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 2080 AccessMode_ReadWrite, hardDisk, 2081 false /* fForceNewUuidOnOpen */, false /* fSilent */); 2082 if (FAILED(hrc)) 2083 2083 return RTEXITCODE_FAILURE; 2084 2084 if (hardDisk.isNull()) … … 2089 2089 Bstr(strPasswordNew).raw(), Bstr(pszNewPasswordId).raw(), 2090 2090 progress.asOutParam())); 2091 if (SUCCEEDED( rc))2092 rc = showProgress(progress);2093 if (FAILED( rc))2094 { 2095 if ( rc == E_NOTIMPL)2091 if (SUCCEEDED(hrc)) 2092 hrc = showProgress(progress); 2093 if (FAILED(hrc)) 2094 { 2095 if (hrc == E_NOTIMPL) 2096 2096 RTMsgError(Disk::tr("Encrypt hard disk operation is not implemented!")); 2097 else if ( rc == VBOX_E_NOT_SUPPORTED)2097 else if (hrc == VBOX_E_NOT_SUPPORTED) 2098 2098 RTMsgError(Disk::tr("Encrypt hard disk operation for this cipher is not implemented yet!")); 2099 2099 else if (!progress.isNull()) … … 2103 2103 } 2104 2104 2105 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;2105 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2106 2106 } 2107 2107 2108 2108 RTEXITCODE handleCheckMediumPassword(HandlerArg *a) 2109 2109 { 2110 HRESULT rc;2110 HRESULT hrc; 2111 2111 ComPtr<IMedium> hardDisk; 2112 2112 const char *pszFilenameOrUuid = NULL; … … 2136 2136 2137 2137 /* Always open the medium if necessary, there is no other way. */ 2138 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk,2139 AccessMode_ReadWrite, hardDisk,2140 false /* fForceNewUuidOnOpen */, false /* fSilent */);2141 if (FAILED( rc))2138 hrc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 2139 AccessMode_ReadWrite, hardDisk, 2140 false /* fForceNewUuidOnOpen */, false /* fSilent */); 2141 if (FAILED(hrc)) 2142 2142 return RTEXITCODE_FAILURE; 2143 2143 if (hardDisk.isNull()) … … 2145 2145 2146 2146 CHECK_ERROR(hardDisk, CheckEncryptionPassword(Bstr(strPassword).raw())); 2147 if (SUCCEEDED( rc))2147 if (SUCCEEDED(hrc)) 2148 2148 RTPrintf(Disk::tr("The given password is correct\n")); 2149 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;2149 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2150 2150 } 2151 2151 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r94234 r95140 494 494 { 495 495 int vrc = VINF_SUCCESS; 496 HRESULT rc;496 HRESULT hrc; 497 497 498 498 do … … 513 513 } while(0); 514 514 515 AssertMsgStmt(SUCCEEDED( rc), (GuestCtrl::tr("Could not lookup progress information\n")), vrc = VERR_COM_UNEXPECTED);515 AssertMsgStmt(SUCCEEDED(hrc), (GuestCtrl::tr("Could not lookup progress information\n")), vrc = VERR_COM_UNEXPECTED); 516 516 517 517 return vrc; … … 656 656 static RTEXITCODE gctlCtxInitVmSession(PGCTLCMDCTX pCtx) 657 657 { 658 HRESULT rc;658 HRESULT hrc; 659 659 AssertPtr(pCtx); 660 660 AssertPtr(pCtx->pArg); … … 665 665 ComPtr<IMachine> machine; 666 666 CHECK_ERROR(pCtx->pArg->virtualBox, FindMachine(Bstr(pCtx->pszVmNameOrUuid).raw(), machine.asOutParam())); 667 if (SUCCEEDED( rc))667 if (SUCCEEDED(hrc)) 668 668 { 669 669 MachineState_T enmMachineState; 670 670 CHECK_ERROR(machine, COMGETTER(State)(&enmMachineState)); 671 if ( SUCCEEDED( rc)671 if ( SUCCEEDED(hrc) 672 672 && enmMachineState == MachineState_Running) 673 673 { … … 676 676 */ 677 677 CHECK_ERROR(machine, LockMachine(pCtx->pArg->session, LockType_Shared)); 678 if (SUCCEEDED( rc))678 if (SUCCEEDED(hrc)) 679 679 { 680 680 pCtx->fLockedVmSession = true; 681 681 ComPtr<IConsole> ptrConsole; 682 682 CHECK_ERROR(pCtx->pArg->session, COMGETTER(Console)(ptrConsole.asOutParam())); 683 if (SUCCEEDED( rc))683 if (SUCCEEDED(hrc)) 684 684 { 685 685 if (ptrConsole.isNotNull()) 686 686 { 687 687 CHECK_ERROR(ptrConsole, COMGETTER(Guest)(pCtx->pGuest.asOutParam())); 688 if (SUCCEEDED( rc))688 if (SUCCEEDED(hrc)) 689 689 return RTEXITCODE_SUCCESS; 690 690 } … … 694 694 } 695 695 } 696 else if (SUCCEEDED( rc))696 else if (SUCCEEDED(hrc)) 697 697 RTMsgError(GuestCtrl::tr("Machine \"%s\" is not running (currently %s)!\n"), 698 698 pCtx->pszVmNameOrUuid, machineStateToName(enmMachineState, false)); … … 713 713 static RTEXITCODE gctlCtxInitGuestSession(PGCTLCMDCTX pCtx) 714 714 { 715 HRESULT rc;715 HRESULT hrc; 716 716 AssertPtr(pCtx); 717 717 Assert(!(pCtx->pCmdDef->fCmdCtx & GCTLCMDCTX_F_SESSION_ANONYMOUS)); … … 744 744 { 745 745 RTMsgError(GuestCtrl::tr("Out of memory setting up IGuest::CreateSession call")); 746 rc = E_OUTOFMEMORY;747 } 748 if (SUCCEEDED( rc))746 hrc = E_OUTOFMEMORY; 747 } 748 if (SUCCEEDED(hrc)) 749 749 { 750 750 /* … … 765 765 { 766 766 RTMsgError(GuestCtrl::tr("Out of memory setting up IGuestSession::WaitForArray call")); 767 rc = E_OUTOFMEMORY;768 } 769 if (SUCCEEDED( rc))767 hrc = E_OUTOFMEMORY; 768 } 769 if (SUCCEEDED(hrc)) 770 770 { 771 771 /* The WaitFlagNotSupported result may happen with GAs older than 4.3. */ … … 777 777 */ 778 778 CHECK_ERROR(pCtx->pGuestSession, COMGETTER(Id)(&pCtx->uSessionID)); 779 if (SUCCEEDED( rc))779 if (SUCCEEDED(hrc)) 780 780 { 781 781 if (pCtx->cVerbose) … … 790 790 CHECK_ERROR(pCtx->pGuestSession, COMGETTER(Status)(&enmSessionStatus)); 791 791 RTMsgError(GuestCtrl::tr("Error starting guest session (current status is: %s)\n"), 792 SUCCEEDED( rc) ? gctlGuestSessionStatusToText(enmSessionStatus) : GuestCtrl::tr("<unknown>"));792 SUCCEEDED(hrc) ? gctlGuestSessionStatusToText(enmSessionStatus) : GuestCtrl::tr("<unknown>")); 793 793 } 794 794 } … … 868 868 static void gctlCtxTerm(PGCTLCMDCTX pCtx) 869 869 { 870 HRESULT rc;870 HRESULT hrc; 871 871 AssertPtr(pCtx); 872 872 … … 1327 1327 return rcExit; 1328 1328 1329 HRESULT rc;1329 HRESULT hrc; 1330 1330 1331 1331 try … … 1544 1544 catch (std::bad_alloc &) 1545 1545 { 1546 rc = E_OUTOFMEMORY;1546 hrc = E_OUTOFMEMORY; 1547 1547 } 1548 1548 … … 1556 1556 * For the 'run' command the guest process quits with us. 1557 1557 */ 1558 if (!fRunCmd && SUCCEEDED( rc) && !g_fGuestCtrlCanceled)1558 if (!fRunCmd && SUCCEEDED(hrc) && !g_fGuestCtrlCanceled) 1559 1559 pCtx->fDetachGuestSession = true; 1560 1560 1561 1561 /* Make sure we return failure on failure. */ 1562 if (FAILED( rc) && rcExit == RTEXITCODE_SUCCESS)1562 if (FAILED(hrc) && rcExit == RTEXITCODE_SUCCESS) 1563 1563 rcExit = RTEXITCODE_FAILURE; 1564 1564 return rcExit; … … 1674 1674 } 1675 1675 1676 HRESULT rc = S_OK;1676 HRESULT hrc = S_OK; 1677 1677 1678 1678 bool fDstIsDir = false; … … 1689 1689 { 1690 1690 BOOL fDirExists = FALSE; 1691 rc = pCtx->pGuestSession->DirectoryExists(Bstr(pszDst).raw(), TRUE /* fFollowSymlinks */, &fDirExists);1692 if (SUCCEEDED( rc))1691 hrc = pCtx->pGuestSession->DirectoryExists(Bstr(pszDst).raw(), TRUE /* fFollowSymlinks */, &fDirExists); 1692 if (SUCCEEDED(hrc)) 1693 1693 fDstIsDir = RT_BOOL(fDirExists); 1694 1694 } … … 1736 1736 1737 1737 SafeArray<FileCopyFlag_T> aCopyFlags; 1738 rc = pCtx->pGuestSession->FileCopyToGuest(Bstr(szAbsSrc).raw(), Bstr(pszDst).raw(),1739 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam());1738 hrc = pCtx->pGuestSession->FileCopyToGuest(Bstr(szAbsSrc).raw(), Bstr(pszDst).raw(), 1739 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); 1740 1740 } 1741 1741 else if (RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode)) … … 1750 1750 if (fFollow) 1751 1751 aCopyFlags.push_back(DirectoryCopyFlag_FollowLinks); 1752 rc = pCtx->pGuestSession->DirectoryCopyToGuest(Bstr(szAbsSrc).raw(), Bstr(pszDst).raw(),1753 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam());1752 hrc = pCtx->pGuestSession->DirectoryCopyToGuest(Bstr(szAbsSrc).raw(), Bstr(pszDst).raw(), 1753 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); 1754 1754 } 1755 1755 else … … 1769 1769 /* We need to query the source type on the guest first in order to know which copy flavor we need. */ 1770 1770 ComPtr<IGuestFsObjInfo> pFsObjInfo; 1771 rc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(pszSource).raw(), TRUE /* fFollowSymlinks */, pFsObjInfo.asOutParam());1772 if (SUCCEEDED( rc))1771 hrc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(pszSource).raw(), TRUE /* fFollowSymlinks */, pFsObjInfo.asOutParam()); 1772 if (SUCCEEDED(hrc)) 1773 1773 { 1774 1774 FsObjType_T enmObjType; 1775 1775 CHECK_ERROR(pFsObjInfo,COMGETTER(Type)(&enmObjType)); 1776 if (SUCCEEDED( rc))1776 if (SUCCEEDED(hrc)) 1777 1777 { 1778 1778 /* Take action according to source file. */ … … 1788 1788 if (fFollow) 1789 1789 aCopyFlags.push_back(DirectoryCopyFlag_FollowLinks); 1790 rc = pCtx->pGuestSession->DirectoryCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(),1791 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam());1790 hrc = pCtx->pGuestSession->DirectoryCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(), 1791 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); 1792 1792 } 1793 1793 else if (enmObjType == FsObjType_File) … … 1799 1799 if (fFollow) 1800 1800 aCopyFlags.push_back(FileCopyFlag_FollowLinks); 1801 rc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(),1802 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam());1801 hrc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(), 1802 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); 1803 1803 } 1804 1804 else … … 1809 1809 } 1810 1810 else 1811 rcExit = RTMsgErrorExitFailure(GuestCtrl::tr("FsObjQueryInfo failed on '%s': %Rhrc"), pszSource, rc);1812 } 1813 1814 if (FAILED( rc))1811 rcExit = RTMsgErrorExitFailure(GuestCtrl::tr("FsObjQueryInfo failed on '%s': %Rhrc"), pszSource, hrc); 1812 } 1813 1814 if (FAILED(hrc)) 1815 1815 { 1816 1816 vrc = gctlPrintError(pCtx->pGuestSession, COM_IIDOF(IGuestSession)); … … 1819 1819 { 1820 1820 if (pCtx->cVerbose) 1821 rc = showProgress(pProgress);1821 hrc = showProgress(pProgress); 1822 1822 else 1823 rc = pProgress->WaitForCompletion(-1 /* No timeout */);1824 if (SUCCEEDED( rc))1823 hrc = pProgress->WaitForCompletion(-1 /* No timeout */); 1824 if (SUCCEEDED(hrc)) 1825 1825 CHECK_PROGRESS_ERROR(pProgress, (GuestCtrl::tr("File copy failed"))); 1826 1826 vrc = gctlPrintProgressError(pProgress); … … 1912 1912 try 1913 1913 { 1914 HRESULT rc;1914 HRESULT hrc; 1915 1915 CHECK_ERROR(pCtx->pGuestSession, DirectoryCreate(Bstr(ValueUnion.psz).raw(), 1916 1916 fDirMode, ComSafeArrayAsInParam(aDirCreateFlags))); 1917 if (FAILED( rc))1917 if (FAILED(hrc)) 1918 1918 rcExit = RTEXITCODE_FAILURE; 1919 1919 } … … 1990 1990 1991 1991 cDirRemoved++; 1992 HRESULT rc;1992 HRESULT hrc; 1993 1993 if (!fRecursive) 1994 1994 { … … 2027 2027 ComSafeArrayAsInParam(aRemRecFlags), 2028 2028 ptrProgress.asOutParam())); 2029 if (SUCCEEDED( rc))2029 if (SUCCEEDED(hrc)) 2030 2030 { 2031 2031 if (pCtx->cVerbose) 2032 rc = showProgress(ptrProgress);2032 hrc = showProgress(ptrProgress); 2033 2033 else 2034 rc = ptrProgress->WaitForCompletion(-1 /* indefinitely */);2035 if (SUCCEEDED( rc))2034 hrc = ptrProgress->WaitForCompletion(-1 /* indefinitely */); 2035 if (SUCCEEDED(hrc)) 2036 2036 CHECK_PROGRESS_ERROR(ptrProgress, (GuestCtrl::tr("Directory deletion failed"))); 2037 2037 ptrProgress.setNull(); … … 2047 2047 * This command returns immediately on failure since it's destructive in nature. 2048 2048 */ 2049 if (FAILED( rc))2049 if (FAILED(hrc)) 2050 2050 return RTEXITCODE_FAILURE; 2051 2051 break; … … 2118 2118 /** @todo How does IGuestSession::FsObjRemove work with read-only files? Do we 2119 2119 * need to do some chmod or whatever to better emulate the --force flag? */ 2120 HRESULT rc;2120 HRESULT hrc; 2121 2121 CHECK_ERROR(pCtx->pGuestSession, FsObjRemove(Bstr(ValueUnion.psz).raw())); 2122 if (FAILED( rc) && !fForce)2122 if (FAILED(hrc) && !fForce) 2123 2123 return RTEXITCODE_FAILURE; 2124 2124 } … … 2209 2209 cSources = vecSources.size(); 2210 2210 2211 HRESULT rc = S_OK;2211 HRESULT hrc = S_OK; 2212 2212 2213 2213 /* Destination must be a directory when specifying multiple sources. */ … … 2215 2215 { 2216 2216 ComPtr<IGuestFsObjInfo> pFsObjInfo; 2217 rc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(pszDst).raw(), FALSE /*followSymlinks*/, pFsObjInfo.asOutParam());2218 if (FAILED( rc))2217 hrc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(pszDst).raw(), FALSE /*followSymlinks*/, pFsObjInfo.asOutParam()); 2218 if (FAILED(hrc)) 2219 2219 { 2220 2220 return RTMsgErrorExit(RTEXITCODE_FAILURE, GuestCtrl::tr("Destination does not exist\n")); … … 2223 2223 { 2224 2224 FsObjType_T enmObjType = FsObjType_Unknown; /* Shut up MSC */ 2225 rc = pFsObjInfo->COMGETTER(Type)(&enmObjType);2226 if (SUCCEEDED( rc))2225 hrc = pFsObjInfo->COMGETTER(Type)(&enmObjType); 2226 if (SUCCEEDED(hrc)) 2227 2227 { 2228 2228 if (enmObjType != FsObjType_Directory) … … 2233 2233 return RTMsgErrorExit(RTEXITCODE_FAILURE, 2234 2234 GuestCtrl::tr("Unable to determine destination type: %Rhrc\n"), 2235 rc);2235 hrc); 2236 2236 } 2237 2237 } … … 2252 2252 ComPtr<IGuestFsObjInfo> pFsObjInfo; 2253 2253 FsObjType_T enmObjType = FsObjType_Unknown; /* Shut up MSC */ 2254 rc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(strSrcCur).raw(), FALSE /*followSymlinks*/, pFsObjInfo.asOutParam());2255 if (SUCCEEDED( rc))2256 rc = pFsObjInfo->COMGETTER(Type)(&enmObjType);2257 if (FAILED( rc))2254 hrc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(strSrcCur).raw(), FALSE /*followSymlinks*/, pFsObjInfo.asOutParam()); 2255 if (SUCCEEDED(hrc)) 2256 hrc = pFsObjInfo->COMGETTER(Type)(&enmObjType); 2257 if (FAILED(hrc)) 2258 2258 { 2259 2259 RTPrintf(GuestCtrl::tr("Cannot stat \"%s\": No such file or directory\n"), strSrcCur.c_str()); … … 2297 2297 } 2298 2298 2299 return FAILED( rc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS;2299 return FAILED(hrc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS; 2300 2300 } 2301 2301 … … 2390 2390 } 2391 2391 2392 HRESULT rc = S_OK;2392 HRESULT hrc = S_OK; 2393 2393 if (fDirectory) 2394 2394 { … … 2398 2398 fSecure, 2399 2399 bstrDirectory.asOutParam())); 2400 if (SUCCEEDED( rc))2400 if (SUCCEEDED(hrc)) 2401 2401 RTPrintf(GuestCtrl::tr("Directory name: %ls\n"), bstrDirectory.raw()); 2402 2402 } … … 2406 2406 /** @todo implement temporary file creation (we fend it off above, no 2407 2407 * worries). */ 2408 rc = E_FAIL;2409 } 2410 2411 return FAILED( rc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS;2408 hrc = E_FAIL; 2409 } 2410 2411 return FAILED(hrc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS; 2412 2412 } 2413 2413 … … 2568 2568 try 2569 2569 { 2570 HRESULT rc = S_OK;2570 HRESULT hrc = S_OK; 2571 2571 /** Whether we need to actually wait for the run level or if we already reached it. */ 2572 2572 bool fWait = false; … … 2745 2745 RTPrintf(GuestCtrl::tr("Updating Guest Additions ...\n")); 2746 2746 2747 HRESULT rc = S_OK;2747 HRESULT hrc = S_OK; 2748 2748 while (strSource.isEmpty()) 2749 2749 { … … 2773 2773 ComPtr<IGuest> guest; 2774 2774 rc = pConsole->COMGETTER(Guest)(guest.asOutParam()); 2775 if (SUCCEEDED( rc) && !guest.isNull())2775 if (SUCCEEDED(hrc) && !guest.isNull()) 2776 2776 { 2777 2777 SHOW_STRING_PROP_NOT_EMPTY(guest, OSTypeId, "GuestOSType", GuestCtrl::tr("OS type:")); … … 2779 2779 AdditionsRunLevelType_T guestRunLevel; /** @todo Add a runlevel-to-string (e.g. 0 = "None") method? */ 2780 2780 rc = guest->COMGETTER(AdditionsRunLevel)(&guestRunLevel); 2781 if (SUCCEEDED( rc))2781 if (SUCCEEDED(hrc)) 2782 2782 SHOW_ULONG_VALUE("GuestAdditionsRunLevel", GuestCtrl::tr("Additions run level:"), (ULONG)guestRunLevel, ""); 2783 2783 2784 2784 Bstr guestString; 2785 2785 rc = guest->COMGETTER(AdditionsVersion)(guestString.asOutParam()); 2786 if ( SUCCEEDED( rc)2786 if ( SUCCEEDED(hrc) 2787 2787 && !guestString.isEmpty()) 2788 2788 { 2789 2789 ULONG uRevision; 2790 2790 rc = guest->COMGETTER(AdditionsRevision)(&uRevision); 2791 if (FAILED( rc))2791 if (FAILED(hrc)) 2792 2792 uRevision = 0; 2793 2793 RTStrPrintf(szValue, sizeof(szValue), "%ls r%u", guestString.raw(), uRevision); … … 2822 2822 Bstr strGstVerCur; 2823 2823 ULONG uGstRevCur = 0; 2824 rc = pCtx->pGuest->COMGETTER(AdditionsVersion)(strGstVerCur.asOutParam());2825 if ( SUCCEEDED( rc)2824 hrc = pCtx->pGuest->COMGETTER(AdditionsVersion)(strGstVerCur.asOutParam()); 2825 if ( SUCCEEDED(hrc) 2826 2826 && !strGstVerCur.isEmpty()) 2827 2827 { 2828 rc = pCtx->pGuest->COMGETTER(AdditionsRevision)(&uGstRevCur);2829 if (SUCCEEDED( rc))2828 hrc = pCtx->pGuest->COMGETTER(AdditionsRevision)(&uGstRevCur); 2829 if (SUCCEEDED(hrc)) 2830 2830 { 2831 2831 if (pCtx->cVerbose) … … 2844 2844 ComSafeArrayAsInParam(aUpdateFlags), 2845 2845 pProgress.asOutParam())); 2846 if (FAILED( rc))2846 if (FAILED(hrc)) 2847 2847 vrc = gctlPrintError(pCtx->pGuest, COM_IIDOF(IGuest)); 2848 2848 else 2849 2849 { 2850 2850 if (pCtx->cVerbose) 2851 rc = showProgress(pProgress);2851 hrc = showProgress(pProgress); 2852 2852 else 2853 rc = pProgress->WaitForCompletion((int32_t)cMsTimeout);2854 2855 if (SUCCEEDED( rc))2853 hrc = pProgress->WaitForCompletion((int32_t)cMsTimeout); 2854 2855 if (SUCCEEDED(hrc)) 2856 2856 CHECK_PROGRESS_ERROR(pProgress, (GuestCtrl::tr("Guest Additions update failed"))); 2857 2857 vrc = gctlPrintProgressError(pProgress); … … 2868 2868 aShutdownFlags.push_back(GuestShutdownFlag_Reboot); 2869 2869 CHECK_ERROR(pCtx->pGuest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags))); 2870 if (FAILED( rc))2870 if (FAILED(hrc)) 2871 2871 { 2872 if ( rc == VBOX_E_NOT_SUPPORTED)2872 if (hrc == VBOX_E_NOT_SUPPORTED) 2873 2873 { 2874 2874 RTPrintf(GuestCtrl::tr("Current installed Guest Additions don't support automatic rebooting. " … … 2897 2897 Bstr strGstVerNew; 2898 2898 ULONG uGstRevNew = 0; 2899 rc = pCtx->pGuest->COMGETTER(AdditionsVersion)(strGstVerNew.asOutParam());2900 if ( SUCCEEDED( rc)2899 hrc = pCtx->pGuest->COMGETTER(AdditionsVersion)(strGstVerNew.asOutParam()); 2900 if ( SUCCEEDED(hrc) 2901 2901 && !strGstVerNew.isEmpty()) 2902 2902 { 2903 rc = pCtx->pGuest->COMGETTER(AdditionsRevision)(&uGstRevNew);2904 if (FAILED( rc))2903 hrc = pCtx->pGuest->COMGETTER(AdditionsRevision)(&uGstRevNew); 2904 if (FAILED(hrc)) 2905 2905 uGstRevNew = 0; 2906 2906 } … … 3084 3084 /** @todo Do we need a machine-readable output here as well? */ 3085 3085 3086 HRESULT rc;3086 HRESULT hrc; 3087 3087 size_t cTotalProcs = 0; 3088 3088 size_t cTotalFiles = 0; … … 3090 3090 SafeIfaceArray <IGuestSession> collSessions; 3091 3091 CHECK_ERROR(pCtx->pGuest, COMGETTER(Sessions)(ComSafeArrayAsOutParam(collSessions))); 3092 if (SUCCEEDED( rc))3092 if (SUCCEEDED(hrc)) 3093 3093 { 3094 3094 size_t const cSessions = collSessions.size(); … … 3186 3186 } 3187 3187 3188 if (FAILED( rc)) /** @todo yeah, right... Only the last error? */3188 if (FAILED(hrc)) /** @todo yeah, right... Only the last error? */ 3189 3189 rcExit = RTEXITCODE_FAILURE; 3190 3190 … … 3276 3276 return rcExit; 3277 3277 3278 HRESULT rc = S_OK;3278 HRESULT hrc = S_OK; 3279 3279 3280 3280 ComPtr<IGuestSession> pSession; … … 3363 3363 pSession.setNull(); 3364 3364 3365 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;3365 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 3366 3366 } 3367 3367 … … 3430 3430 return rcExit; 3431 3431 3432 HRESULT rc = S_OK;3432 HRESULT hrc = S_OK; 3433 3433 3434 3434 do … … 3475 3475 { 3476 3476 RTPrintf(GuestCtrl::tr("No guest session(s) found\n")); 3477 rc = E_ABORT; /* To set exit code accordingly. */3477 hrc = E_ABORT; /* To set exit code accordingly. */ 3478 3478 } 3479 3479 3480 3480 } while (0); 3481 3481 3482 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;3482 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 3483 3483 } 3484 3484 … … 3527 3527 return rcExit; 3528 3528 3529 HRESULT rc;3529 HRESULT hrc; 3530 3530 3531 3531 try … … 3586 3586 catch (std::bad_alloc &) 3587 3587 { 3588 rc = E_OUTOFMEMORY;3589 } 3590 3591 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;3588 hrc = E_OUTOFMEMORY; 3589 } 3590 3591 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 3592 3592 } 3593 3593 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrlListener.cpp
r94234 r95140 88 88 case VBoxEventType_OnGuestFileStateChanged: 89 89 { 90 HRESULT rc;90 HRESULT hrc; 91 91 do 92 92 { … … 144 144 case VBoxEventType_OnGuestProcessStateChanged: 145 145 { 146 HRESULT rc;146 HRESULT hrc; 147 147 do 148 148 { … … 196 196 if (!itProc->first.isNull()) 197 197 { 198 HRESULT rc;198 HRESULT hrc; 199 199 do 200 200 { … … 216 216 if (!itFile->first.isNull()) 217 217 { 218 HRESULT rc;218 HRESULT hrc; 219 219 do 220 220 { … … 238 238 case VBoxEventType_OnGuestFileRegistered: 239 239 { 240 HRESULT rc;240 HRESULT hrc; 241 241 do 242 242 { … … 302 302 case VBoxEventType_OnGuestProcessRegistered: 303 303 { 304 HRESULT rc;304 HRESULT hrc; 305 305 do 306 306 { … … 366 366 case VBoxEventType_OnGuestSessionStateChanged: 367 367 { 368 HRESULT rc;368 HRESULT hrc; 369 369 do 370 370 { … … 418 418 if (!itSession->first.isNull()) 419 419 { 420 HRESULT rc;420 HRESULT hrc; 421 421 do 422 422 { … … 441 441 case VBoxEventType_OnGuestSessionRegistered: 442 442 { 443 HRESULT rc;443 HRESULT hrc; 444 444 do 445 445 { … … 537 537 Assert(mRunLevelTarget != AdditionsRunLevelType_None); 538 538 539 HRESULT rc;539 HRESULT hrc; 540 540 541 541 switch (aType) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r94234 r95140 52 52 static RTEXITCODE handleGetGuestProperty(HandlerArg *a) 53 53 { 54 HRESULT rc = S_OK;54 HRESULT hrc = S_OK; 55 55 56 56 setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_GET); … … 91 91 } 92 92 } 93 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;93 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 94 94 } 95 95 96 96 static RTEXITCODE handleSetGuestProperty(HandlerArg *a) 97 97 { 98 HRESULT rc = S_OK;98 HRESULT hrc = S_OK; 99 99 100 100 setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_SET); … … 146 146 Bstr(pszFlags).raw())); 147 147 148 if (SUCCEEDED( rc))148 if (SUCCEEDED(hrc)) 149 149 CHECK_ERROR(machine, SaveSettings()); 150 150 151 151 a->session->UnlockMachine(); 152 152 } 153 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;153 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 154 154 } 155 155 156 156 static RTEXITCODE handleDeleteGuestProperty(HandlerArg *a) 157 157 { 158 HRESULT rc = S_OK;158 HRESULT hrc = S_OK; 159 159 160 160 setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_UNSET); … … 186 186 CHECK_ERROR(machine, DeleteGuestProperty(Bstr(pszName).raw())); 187 187 188 if (SUCCEEDED( rc))188 if (SUCCEEDED(hrc)) 189 189 CHECK_ERROR(machine, SaveSettings()); 190 190 191 191 a->session->UnlockMachine(); 192 192 } 193 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;193 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 194 194 } 195 195 … … 226 226 */ 227 227 ComPtr<IMachine> machine; 228 HRESULT rc;228 HRESULT hrc; 229 229 CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(), 230 230 machine.asOutParam())); … … 246 246 ComSafeArrayAsOutParam(timestamps), 247 247 ComSafeArrayAsOutParam(flags))); 248 if (SUCCEEDED( rc))248 if (SUCCEEDED(hrc)) 249 249 { 250 250 if (names.size() == 0) … … 255 255 } 256 256 } 257 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;257 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 258 258 } 259 259 … … 280 280 pszPatterns = a->argv[1]; 281 281 ComPtr<IMachine> machine; 282 HRESULT rc;282 HRESULT hrc; 283 283 CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(), 284 284 machine.asOutParam())); … … 334 334 335 335 ComPtr<IEvent> ev; 336 rc = es->GetEvent(listener, cMsWait, ev.asOutParam());337 if (ev) 336 hrc = es->GetEvent(listener, cMsWait, ev.asOutParam()); 337 if (ev) /** @todo r=andy Why not using SUCCEEDED(hrc) here? */ 338 338 { 339 339 VBoxEventType_T aType; 340 rc = ev->COMGETTER(Type)(&aType);340 hrc = ev->COMGETTER(Type)(&aType); 341 341 switch (aType) 342 342 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r94660 r95140 1077 1077 VMINFO_DETAILS details /*= VMINFO_NONE*/) 1078 1078 { 1079 HRESULT rc;1079 HRESULT hrc; 1080 1080 ComPtr<IConsole> pConsole; 1081 1081 if (pSession) … … 1118 1118 { 1119 1119 Bstr settingsFilePath; 1120 rc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());1120 hrc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam()); 1121 1121 RTPrintf(Info::tr("Config file: %ls\n"), settingsFilePath.raw()); 1122 1122 1123 1123 Bstr strCipher; 1124 1124 Bstr strPasswordId; 1125 HRESULT rc2 = machine->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam());1126 if (SUCCEEDED( rc2))1125 HRESULT hrc2 = machine->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam()); 1126 if (SUCCEEDED(hrc2)) 1127 1127 { 1128 1128 RTPrintf("Encryption: enabled\n"); … … 1134 1134 1135 1135 ComPtr<IVirtualBoxErrorInfo> accessError; 1136 rc = machine->COMGETTER(AccessError)(accessError.asOutParam());1136 hrc = machine->COMGETTER(AccessError)(accessError.asOutParam()); 1137 1137 RTPrintf(Info::tr("Access error details:\n")); 1138 1138 ErrorInfo ei(accessError); … … 1159 1159 Bstr strCipher; 1160 1160 Bstr strPasswordId; 1161 HRESULT rc2 = machine->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam());1162 if (SUCCEEDED( rc2))1161 HRESULT hrc2 = machine->GetEncryptionSettings(strCipher.asOutParam(), strPasswordId.asOutParam()); 1162 if (SUCCEEDED(hrc2)) 1163 1163 { 1164 1164 RTPrintf("Encryption: enabled\n"); … … 1250 1250 { 1251 1251 ULONG uLeaf, uSubLeaf, uEAX, uEBX, uECX, uEDX; 1252 rc = machine->GetCPUIDLeafByOrdinal(uOrdinal, &uLeaf, &uSubLeaf, &uEAX, &uEBX, &uECX, &uEDX);1253 if (SUCCEEDED( rc))1252 hrc = machine->GetCPUIDLeafByOrdinal(uOrdinal, &uLeaf, &uSubLeaf, &uEAX, &uEBX, &uECX, &uEDX); 1253 if (SUCCEEDED(hrc)) 1254 1254 { 1255 1255 if (details == VMINFO_MACHINEREADABLE) … … 1264 1264 else 1265 1265 { 1266 if ( rc != E_INVALIDARG)1267 com::GlueHandleComError(machine, "GetCPUIDLeaf", rc, __FILE__, __LINE__);1266 if (hrc != E_INVALIDARG) 1267 com::GlueHandleComError(machine, "GetCPUIDLeaf", hrc, __FILE__, __LINE__); 1268 1268 break; 1269 1269 } … … 1418 1418 1419 1419 GraphicsControllerType_T enmGraphics; 1420 rc = pGraphicsAdapter->COMGETTER(GraphicsControllerType)(&enmGraphics);1421 if (SUCCEEDED( rc))1420 hrc = pGraphicsAdapter->COMGETTER(GraphicsControllerType)(&enmGraphics); 1421 if (SUCCEEDED(hrc)) 1422 1422 { 1423 1423 const char *pszCtrl; … … 1559 1559 storageControllerTypeToName(enmCtlType, false), uInstance, cPorts, cMaxPorts, 1560 1560 fBootable ? Info::tr("Bootable") : Info::tr("Not bootable")); 1561 rc = showMediumAttachments(machine, storageCtl, details);1562 if (FAILED( rc))1563 return rc;1561 hrc = showMediumAttachments(machine, storageCtl, details); 1562 if (FAILED(hrc)) 1563 return hrc; 1564 1564 } 1565 1565 } … … 1571 1571 for (size_t j = 0; j < storageCtls.size(); ++ j) 1572 1572 { 1573 rc = showMediumAttachments(machine, storageCtls[j], details);1574 if (FAILED( rc))1575 return rc;1573 hrc = showMediumAttachments(machine, storageCtls[j], details); 1574 if (FAILED(hrc)) 1575 return hrc; 1576 1576 } 1577 1577 … … 1582 1582 { 1583 1583 ComPtr<INetworkAdapter> nic; 1584 rc = machine->GetNetworkAdapter(currentNIC, nic.asOutParam());1585 if (SUCCEEDED( rc) && nic)1584 hrc = machine->GetNetworkAdapter(currentNIC, nic.asOutParam()); 1585 if (SUCCEEDED(hrc) && nic) 1586 1586 { 1587 1587 FmtNm(szNm, details == VMINFO_MACHINEREADABLE ? "nic%u" : Info::tr("NIC %u:"), currentNIC + 1); … … 1766 1766 com::SafeArray<BSTR> aProperties; 1767 1767 com::SafeArray<BSTR> aValues; 1768 rc = nic->GetProperties(NULL,1769 ComSafeArrayAsOutParam(aProperties),1770 ComSafeArrayAsOutParam(aValues));1771 if (SUCCEEDED( rc))1768 hrc = nic->GetProperties(NULL, 1769 ComSafeArrayAsOutParam(aProperties), 1770 ComSafeArrayAsOutParam(aValues)); 1771 if (SUCCEEDED(hrc)) 1772 1772 { 1773 1773 strAttachment += " { "; … … 2003 2003 { 2004 2004 ComPtr<ISerialPort> uart; 2005 rc = machine->GetSerialPort(currentUART, uart.asOutParam());2006 if (SUCCEEDED( rc) && uart)2005 hrc = machine->GetSerialPort(currentUART, uart.asOutParam()); 2006 if (SUCCEEDED(hrc) && uart) 2007 2007 { 2008 2008 FmtNm(szNm, details == VMINFO_MACHINEREADABLE ? "uart%u" : Info::tr("UART %u:"), currentUART + 1); … … 2109 2109 { 2110 2110 ComPtr<IParallelPort> lpt; 2111 rc = machine->GetParallelPort(currentLPT, lpt.asOutParam());2112 if (SUCCEEDED( rc) && lpt)2111 hrc = machine->GetParallelPort(currentLPT, lpt.asOutParam()); 2112 if (SUCCEEDED(hrc) && lpt) 2113 2113 { 2114 2114 FmtNm(szNm, details == VMINFO_MACHINEREADABLE ? "lpt%u" : Info::tr("LPT %u:"), currentLPT + 1); … … 2145 2145 2146 2146 ComPtr<IAudioAdapter> AudioAdapter; 2147 rc = machine->COMGETTER(AudioAdapter)(AudioAdapter.asOutParam());2148 if (SUCCEEDED( rc))2147 hrc = machine->COMGETTER(AudioAdapter)(AudioAdapter.asOutParam()); 2148 if (SUCCEEDED(hrc)) 2149 2149 { 2150 2150 const char *pszDrv = Info::tr("Unknown"); … … 2152 2152 const char *pszCodec = Info::tr("Unknown"); 2153 2153 BOOL fEnabled; 2154 rc = AudioAdapter->COMGETTER(Enabled)(&fEnabled);2155 if (SUCCEEDED( rc) && fEnabled)2154 hrc = AudioAdapter->COMGETTER(Enabled)(&fEnabled); 2155 if (SUCCEEDED(hrc) && fEnabled) 2156 2156 { 2157 2157 AudioDriverType_T enmDrvType; 2158 rc = AudioAdapter->COMGETTER(AudioDriver)(&enmDrvType);2158 hrc = AudioAdapter->COMGETTER(AudioDriver)(&enmDrvType); 2159 2159 switch (enmDrvType) 2160 2160 { … … 2213 2213 } 2214 2214 AudioControllerType_T enmCtrlType; 2215 rc = AudioAdapter->COMGETTER(AudioController)(&enmCtrlType);2215 hrc = AudioAdapter->COMGETTER(AudioController)(&enmCtrlType); 2216 2216 switch (enmCtrlType) 2217 2217 { … … 2238 2238 } 2239 2239 AudioCodecType_T enmCodecType; 2240 rc = AudioAdapter->COMGETTER(AudioCodec)(&enmCodecType);2240 hrc = AudioAdapter->COMGETTER(AudioCodec)(&enmCodecType); 2241 2241 switch (enmCodecType) 2242 2242 { … … 2277 2277 const char *psz; 2278 2278 ClipboardMode_T enmMode = (ClipboardMode_T)0; 2279 rc = machine->COMGETTER(ClipboardMode)(&enmMode);2279 hrc = machine->COMGETTER(ClipboardMode)(&enmMode); 2280 2280 switch (enmMode) 2281 2281 { … … 2306 2306 const char *psz; 2307 2307 DnDMode_T enmMode; 2308 rc = machine->COMGETTER(DnDMode)(&enmMode);2308 hrc = machine->COMGETTER(DnDMode)(&enmMode); 2309 2309 switch (enmMode) 2310 2310 { … … 2330 2330 { 2331 2331 SessionState_T sessState; 2332 rc = machine->COMGETTER(SessionState)(&sessState);2333 if (SUCCEEDED( rc) && sessState != SessionState_Unlocked)2332 hrc = machine->COMGETTER(SessionState)(&sessState); 2333 if (SUCCEEDED(hrc) && sessState != SessionState_Unlocked) 2334 2334 { 2335 2335 Bstr sessName; 2336 rc = machine->COMGETTER(SessionName)(sessName.asOutParam());2337 if (SUCCEEDED( rc) && !sessName.isEmpty())2336 hrc = machine->COMGETTER(SessionName)(sessName.asOutParam()); 2337 if (SUCCEEDED(hrc) && !sessName.isEmpty()) 2338 2338 SHOW_BSTR_STRING("SessionName", Info::tr("Session name:"), sessName); 2339 2339 } … … 2345 2345 { 2346 2346 ComPtr<IDisplay> display; 2347 rc = pConsole->COMGETTER(Display)(display.asOutParam());2348 if ( rc == E_ACCESSDENIED || display.isNull())2347 hrc = pConsole->COMGETTER(Display)(display.asOutParam()); 2348 if (hrc == E_ACCESSDENIED || display.isNull()) 2349 2349 break; /* VM not powered up */ 2350 if (FAILED( rc))2351 { 2352 com::GlueHandleComError(pConsole, "COMGETTER(Display)(display.asOutParam())", rc, __FILE__, __LINE__);2353 return rc;2350 if (FAILED(hrc)) 2351 { 2352 com::GlueHandleComError(pConsole, "COMGETTER(Display)(display.asOutParam())", hrc, __FILE__, __LINE__); 2353 return hrc; 2354 2354 } 2355 2355 ULONG xRes, yRes, bpp; 2356 2356 LONG xOrigin, yOrigin; 2357 2357 GuestMonitorStatus_T monitorStatus; 2358 rc = display->GetScreenResolution(0, &xRes, &yRes, &bpp, &xOrigin, &yOrigin, &monitorStatus);2359 if ( rc == E_ACCESSDENIED)2358 hrc = display->GetScreenResolution(0, &xRes, &yRes, &bpp, &xOrigin, &yOrigin, &monitorStatus); 2359 if (hrc == E_ACCESSDENIED) 2360 2360 break; /* VM not powered up */ 2361 if (FAILED( rc))2361 if (FAILED(hrc)) 2362 2362 { 2363 2363 com::ErrorInfo info(display, COM_IIDOF(IDisplay)); 2364 2364 GluePrintErrorInfo(info); 2365 return rc;2365 return hrc; 2366 2366 } 2367 2367 if (details == VMINFO_MACHINEREADABLE) … … 2387 2387 */ 2388 2388 ComPtr<IVRDEServer> vrdeServer; 2389 rc = machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2390 if (SUCCEEDED( rc) && vrdeServer)2389 hrc = machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2390 if (SUCCEEDED(hrc) && vrdeServer) 2391 2391 { 2392 2392 BOOL fEnabled = false; … … 2442 2442 { 2443 2443 ComPtr<IVRDEServerInfo> vrdeServerInfo; 2444 CHECK_ERROR_RET(pConsole, COMGETTER(VRDEServerInfo)(vrdeServerInfo.asOutParam()), rc);2444 CHECK_ERROR_RET(pConsole, COMGETTER(VRDEServerInfo)(vrdeServerInfo.asOutParam()), hrc); 2445 2445 if (!vrdeServerInfo.isNull()) 2446 2446 { 2447 rc = vrdeServerInfo->COMGETTER(Port)(¤tPort);2448 if ( rc == E_ACCESSDENIED)2447 hrc = vrdeServerInfo->COMGETTER(Port)(¤tPort); 2448 if (hrc == E_ACCESSDENIED) 2449 2449 { 2450 2450 currentPort = -1; /* VM not powered up */ 2451 2451 } 2452 else if (FAILED( rc))2452 else if (FAILED(hrc)) 2453 2453 { 2454 2454 com::ErrorInfo info(vrdeServerInfo, COM_IIDOF(IVRDEServerInfo)); 2455 2455 GluePrintErrorInfo(info); 2456 return rc;2456 return hrc; 2457 2457 } 2458 2458 } … … 2523 2523 */ 2524 2524 SafeIfaceArray<IUSBController> USBCtlColl; 2525 rc = machine->COMGETTER(USBControllers)(ComSafeArrayAsOutParam(USBCtlColl));2526 if (SUCCEEDED( rc))2525 hrc = machine->COMGETTER(USBControllers)(ComSafeArrayAsOutParam(USBCtlColl)); 2526 if (SUCCEEDED(hrc)) 2527 2527 { 2528 2528 bool fOhciEnabled = false; … … 2534 2534 USBControllerType_T enmType; 2535 2535 2536 rc = USBCtlColl[i]->COMGETTER(Type)(&enmType);2537 if (SUCCEEDED( rc))2536 hrc = USBCtlColl[i]->COMGETTER(Type)(&enmType); 2537 if (SUCCEEDED(hrc)) 2538 2538 { 2539 2539 switch (enmType) … … 2560 2560 2561 2561 ComPtr<IUSBDeviceFilters> USBFlts; 2562 rc = machine->COMGETTER(USBDeviceFilters)(USBFlts.asOutParam());2563 if (SUCCEEDED( rc))2562 hrc = machine->COMGETTER(USBDeviceFilters)(USBFlts.asOutParam()); 2563 if (SUCCEEDED(hrc)) 2564 2564 { 2565 2565 SafeIfaceArray <IUSBDeviceFilter> Coll; 2566 rc = USBFlts->COMGETTER(DeviceFilters)(ComSafeArrayAsOutParam(Coll));2567 if (SUCCEEDED( rc))2566 hrc = USBFlts->COMGETTER(DeviceFilters)(ComSafeArrayAsOutParam(Coll)); 2567 if (SUCCEEDED(hrc)) 2568 2568 { 2569 2569 if (Coll.size() > 0) … … 2589 2589 { 2590 2590 ULONG fMaskedIfs; 2591 CHECK_ERROR_RET(DevPtr, COMGETTER(MaskedInterfaces)(&fMaskedIfs), rc);2591 CHECK_ERROR_RET(DevPtr, COMGETTER(MaskedInterfaces)(&fMaskedIfs), hrc); 2592 2592 if (fMaskedIfs) 2593 2593 RTPrintf("%-28s %#010x\n", Info::tr("Masked Interfaces:"), fMaskedIfs); … … 2603 2603 { 2604 2604 SafeIfaceArray<IHostUSBDevice> coll; 2605 CHECK_ERROR_RET(pConsole, COMGETTER(RemoteUSBDevices)(ComSafeArrayAsOutParam(coll)), rc);2606 rc = showUsbDevices(coll, "USBRemote", Info::tr("Available remote USB devices:"), details);2607 if (FAILED( rc))2608 return rc;2605 CHECK_ERROR_RET(pConsole, COMGETTER(RemoteUSBDevices)(ComSafeArrayAsOutParam(coll)), hrc); 2606 hrc = showUsbDevices(coll, "USBRemote", Info::tr("Available remote USB devices:"), details); 2607 if (FAILED(hrc)) 2608 return hrc; 2609 2609 } 2610 2610 2611 2611 { 2612 2612 SafeIfaceArray<IUSBDevice> coll; 2613 CHECK_ERROR_RET(pConsole, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)), rc);2613 CHECK_ERROR_RET(pConsole, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)), hrc); 2614 2614 showUsbDevices(coll, "USBAttach", Info::tr("Currently attached USB devices:"), details); 2615 if (FAILED( rc))2616 return rc;2615 if (FAILED(hrc)) 2616 return hrc; 2617 2617 } 2618 2618 } … … 2623 2623 { 2624 2624 SafeIfaceArray <IPCIDeviceAttachment> assignments; 2625 rc = machine->COMGETTER(PCIDeviceAssignments)(ComSafeArrayAsOutParam(assignments));2626 if (SUCCEEDED( rc))2625 hrc = machine->COMGETTER(PCIDeviceAssignments)(ComSafeArrayAsOutParam(assignments)); 2626 if (SUCCEEDED(hrc)) 2627 2627 { 2628 2628 if (assignments.size() > 0 && (details != VMINFO_MACHINEREADABLE)) … … 2666 2666 { 2667 2667 ComPtr<IBandwidthControl> bwCtrl; 2668 CHECK_ERROR_RET(machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam()), rc);2669 2670 rc = showBandwidthGroups(bwCtrl, details);2668 CHECK_ERROR_RET(machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam()), hrc); 2669 2670 hrc = showBandwidthGroups(bwCtrl, details); 2671 2671 } 2672 2672 … … 2694 2694 { 2695 2695 com::SafeIfaceArray <ISharedFolder> folders; 2696 CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), rc);2696 CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), hrc); 2697 2697 for (size_t i = 0; i < folders.size(); ++i) 2698 2698 { … … 2706 2706 { 2707 2707 com::SafeIfaceArray <ISharedFolder> folders; 2708 CHECK_ERROR_RET(pConsole, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), rc);2708 CHECK_ERROR_RET(pConsole, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), hrc); 2709 2709 for (size_t i = 0; i < folders.size(); ++i) 2710 2710 { … … 2728 2728 */ 2729 2729 ComPtr<IVRDEServerInfo> vrdeServerInfo; 2730 CHECK_ERROR_RET(pConsole, COMGETTER(VRDEServerInfo)(vrdeServerInfo.asOutParam()), rc);2730 CHECK_ERROR_RET(pConsole, COMGETTER(VRDEServerInfo)(vrdeServerInfo.asOutParam()), hrc); 2731 2731 BOOL fActive = FALSE; 2732 2732 ULONG cNumberOfClients = 0; … … 2746 2746 if (!vrdeServerInfo.isNull()) 2747 2747 { 2748 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(Active)(&fActive), rc);2749 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(NumberOfClients)(&cNumberOfClients), rc);2750 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BeginTime)(&BeginTime), rc);2751 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(EndTime)(&EndTime), rc);2752 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesSent)(&BytesSent), rc);2753 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesSentTotal)(&BytesSentTotal), rc);2754 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesReceived)(&BytesReceived), rc);2755 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesReceivedTotal)(&BytesReceivedTotal), rc);2756 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(User)(User.asOutParam()), rc);2757 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(Domain)(Domain.asOutParam()), rc);2758 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientName)(ClientName.asOutParam()), rc);2759 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientIP)(ClientIP.asOutParam()), rc);2760 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientVersion)(&ClientVersion), rc);2761 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(EncryptionStyle)(&EncryptionStyle), rc);2748 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(Active)(&fActive), hrc); 2749 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(NumberOfClients)(&cNumberOfClients), hrc); 2750 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BeginTime)(&BeginTime), hrc); 2751 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(EndTime)(&EndTime), hrc); 2752 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesSent)(&BytesSent), hrc); 2753 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesSentTotal)(&BytesSentTotal), hrc); 2754 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesReceived)(&BytesReceived), hrc); 2755 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(BytesReceivedTotal)(&BytesReceivedTotal), hrc); 2756 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(User)(User.asOutParam()), hrc); 2757 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(Domain)(Domain.asOutParam()), hrc); 2758 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientName)(ClientName.asOutParam()), hrc); 2759 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientIP)(ClientIP.asOutParam()), hrc); 2760 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(ClientVersion)(&ClientVersion), hrc); 2761 CHECK_ERROR_RET(vrdeServerInfo, COMGETTER(EncryptionStyle)(&EncryptionStyle), hrc); 2762 2762 } 2763 2763 … … 2814 2814 2815 2815 ComPtr<IRecordingSettings> recordingSettings; 2816 CHECK_ERROR_RET(machine, COMGETTER(RecordingSettings)(recordingSettings.asOutParam()), rc);2816 CHECK_ERROR_RET(machine, COMGETTER(RecordingSettings)(recordingSettings.asOutParam()), hrc); 2817 2817 2818 2818 SafeIfaceArray <IRecordingScreenSettings> saRecordingScreenScreens; 2819 CHECK_ERROR_RET(recordingSettings, COMGETTER(Screens)(ComSafeArrayAsOutParam(saRecordingScreenScreens)), rc);2819 CHECK_ERROR_RET(recordingSettings, COMGETTER(Screens)(ComSafeArrayAsOutParam(saRecordingScreenScreens)), hrc); 2820 2820 2821 2821 /* For now all screens have the same configuration; so take screen 0 and work with that. */ 2822 2822 ULONG fFeatures; 2823 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Features)(&fFeatures), rc);2823 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Features)(&fFeatures), hrc); 2824 2824 ULONG Width; 2825 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoWidth)(&Width), rc);2825 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoWidth)(&Width), hrc); 2826 2826 ULONG Height; 2827 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoHeight)(&Height), rc);2827 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoHeight)(&Height), hrc); 2828 2828 ULONG Rate; 2829 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoRate)(&Rate), rc);2829 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoRate)(&Rate), hrc); 2830 2830 ULONG Fps; 2831 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoFPS)(&Fps), rc);2831 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoFPS)(&Fps), hrc); 2832 2832 Bstr bstrFile; 2833 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Filename)(bstrFile.asOutParam()), rc);2833 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Filename)(bstrFile.asOutParam()), hrc); 2834 2834 Bstr bstrOptions; 2835 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Options)(bstrOptions.asOutParam()), rc);2835 CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Options)(bstrOptions.asOutParam()), hrc); 2836 2836 2837 2837 Utf8Str strOptions(bstrOptions); … … 2860 2860 { 2861 2861 BOOL fEnabled; 2862 CHECK_ERROR_RET(saRecordingScreenScreens[i], COMGETTER(Enabled)(&fEnabled), rc);2862 CHECK_ERROR_RET(saRecordingScreenScreens[i], COMGETTER(Enabled)(&fEnabled), hrc); 2863 2863 if (fEnabled && off < sizeof(szValue) - 3) 2864 2864 off += RTStrPrintf(&szValue[off], sizeof(szValue) - off, off ? ",%zu" : "%zu", i); … … 2923 2923 */ 2924 2924 ComPtr<ISnapshot> snapshot; 2925 rc = machine->FindSnapshot(Bstr().raw(), snapshot.asOutParam());2926 if (SUCCEEDED( rc) && snapshot)2925 hrc = machine->FindSnapshot(Bstr().raw(), snapshot.asOutParam()); 2926 if (SUCCEEDED(hrc) && snapshot) 2927 2927 { 2928 2928 ComPtr<ISnapshot> currentSnapshot; 2929 rc = machine->COMGETTER(CurrentSnapshot)(currentSnapshot.asOutParam());2930 if (SUCCEEDED( rc))2929 hrc = machine->COMGETTER(CurrentSnapshot)(currentSnapshot.asOutParam()); 2930 if (SUCCEEDED(hrc)) 2931 2931 { 2932 2932 if (details != VMINFO_MACHINEREADABLE) … … 2948 2948 { 2949 2949 ComPtr<IGuest> guest; 2950 rc = pConsole->COMGETTER(Guest)(guest.asOutParam());2951 if (SUCCEEDED( rc) && !guest.isNull())2950 hrc = pConsole->COMGETTER(Guest)(guest.asOutParam()); 2951 if (SUCCEEDED(hrc) && !guest.isNull()) 2952 2952 { 2953 2953 SHOW_STRING_PROP_NOT_EMPTY(guest, OSTypeId, "GuestOSType", Info::tr("OS type:")); 2954 2954 2955 2955 AdditionsRunLevelType_T guestRunLevel; /** @todo Add a runlevel-to-string (e.g. 0 = "None") method? */ 2956 rc = guest->COMGETTER(AdditionsRunLevel)(&guestRunLevel);2957 if (SUCCEEDED( rc))2956 hrc = guest->COMGETTER(AdditionsRunLevel)(&guestRunLevel); 2957 if (SUCCEEDED(hrc)) 2958 2958 SHOW_ULONG_VALUE("GuestAdditionsRunLevel", Info::tr("Additions run level:"), (ULONG)guestRunLevel, ""); 2959 2959 2960 2960 Bstr guestString; 2961 rc = guest->COMGETTER(AdditionsVersion)(guestString.asOutParam());2962 if ( SUCCEEDED( rc)2961 hrc = guest->COMGETTER(AdditionsVersion)(guestString.asOutParam()); 2962 if ( SUCCEEDED(hrc) 2963 2963 && !guestString.isEmpty()) 2964 2964 { 2965 2965 ULONG uRevision; 2966 rc = guest->COMGETTER(AdditionsRevision)(&uRevision);2967 if (FAILED( rc))2966 hrc = guest->COMGETTER(AdditionsRevision)(&uRevision); 2967 if (FAILED(hrc)) 2968 2968 uRevision = 0; 2969 2969 RTStrPrintf(szValue, sizeof(szValue), "%ls r%u", guestString.raw(), uRevision); … … 2973 2973 /* Print information about known Guest Additions facilities: */ 2974 2974 SafeIfaceArray <IAdditionsFacility> collFac; 2975 CHECK_ERROR_RET(guest, COMGETTER(Facilities)(ComSafeArrayAsOutParam(collFac)), rc);2975 CHECK_ERROR_RET(guest, COMGETTER(Facilities)(ComSafeArrayAsOutParam(collFac)), hrc); 2976 2976 if (collFac.size() > 0) 2977 2977 { … … 2986 2986 if (fac) 2987 2987 { 2988 CHECK_ERROR_RET(fac, COMGETTER(Name)(guestString.asOutParam()), rc);2988 CHECK_ERROR_RET(fac, COMGETTER(Name)(guestString.asOutParam()), hrc); 2989 2989 if (!guestString.isEmpty()) 2990 2990 { 2991 CHECK_ERROR_RET(fac, COMGETTER(Status)(&curStatus), rc);2992 CHECK_ERROR_RET(fac, COMGETTER(LastUpdated)(&lLastUpdatedMS), rc);2991 CHECK_ERROR_RET(fac, COMGETTER(Status)(&curStatus), hrc); 2992 CHECK_ERROR_RET(fac, COMGETTER(LastUpdated)(&lLastUpdatedMS), hrc); 2993 2993 if (details == VMINFO_MACHINEREADABLE) 2994 2994 RTPrintf("GuestAdditionsFacility_%ls=%u,%lld\n", … … 3038 3038 RTEXITCODE handleShowVMInfo(HandlerArg *a) 3039 3039 { 3040 HRESULT rc;3040 HRESULT hrc; 3041 3041 const char *VMNameOrUuid = NULL; 3042 3042 bool fLog = false; … … 3098 3098 CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMNameOrUuid).raw(), 3099 3099 machine.asOutParam())); 3100 if (FAILED( rc))3100 if (FAILED(hrc)) 3101 3101 return RTEXITCODE_FAILURE; 3102 3102 … … 3176 3176 3177 3177 /* open an existing session for the VM */ 3178 rc = machine->LockMachine(a->session, LockType_Shared);3179 if (SUCCEEDED( rc))3178 hrc = machine->LockMachine(a->session, LockType_Shared); 3179 if (SUCCEEDED(hrc)) 3180 3180 /* get the session machine */ 3181 rc = a->session->COMGETTER(Machine)(machine.asOutParam());3182 3183 rc = showVMInfo(a->virtualBox, machine, a->session, details);3181 hrc = a->session->COMGETTER(Machine)(machine.asOutParam()); 3182 3183 hrc = showVMInfo(a->virtualBox, machine, a->session, details); 3184 3184 3185 3185 a->session->UnlockMachine(); 3186 3186 } 3187 3187 3188 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;3188 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 3189 3189 } 3190 3190 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r94714 r95140 104 104 static HRESULT listInternalNetworks(const ComPtr<IVirtualBox> pVirtualBox) 105 105 { 106 HRESULT rc;106 HRESULT hrc; 107 107 com::SafeArray<BSTR> internalNetworks; 108 108 CHECK_ERROR(pVirtualBox, COMGETTER(InternalNetworks)(ComSafeArrayAsOutParam(internalNetworks))); … … 111 111 RTPrintf(List::tr("Name: %ls\n"), internalNetworks[i]); 112 112 } 113 return rc;113 return hrc; 114 114 } 115 115 … … 126 126 bool fIsBridged) 127 127 { 128 HRESULT rc;128 HRESULT hrc; 129 129 ComPtr<IHost> host; 130 130 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam())); … … 191 191 #endif 192 192 } 193 return rc;193 return hrc; 194 194 } 195 195 … … 205 205 static HRESULT listHostOnlyNetworks(const ComPtr<IVirtualBox> pVirtualBox) 206 206 { 207 HRESULT rc;207 HRESULT hrc; 208 208 com::SafeIfaceArray<IHostOnlyNetwork> hostOnlyNetworks; 209 209 CHECK_ERROR(pVirtualBox, COMGETTER(HostOnlyNetworks)(ComSafeArrayAsOutParam(hostOnlyNetworks))); … … 251 251 static HRESULT listCloudNetworks(const ComPtr<IVirtualBox> pVirtualBox) 252 252 { 253 HRESULT rc;253 HRESULT hrc; 254 254 com::SafeIfaceArray<ICloudNetwork> cloudNetworks; 255 255 CHECK_ERROR(pVirtualBox, COMGETTER(CloudNetworks)(ComSafeArrayAsOutParam(cloudNetworks))); … … 279 279 RTPrintf(List::tr("VBoxNetworkName: %ls\n\n"), netName.raw()); 280 280 } 281 return rc;281 return hrc; 282 282 } 283 283 #endif /* VBOX_WITH_CLOUD_NET */ … … 307 307 { ProcessorFeature_VirtVmsaveVmload, List::tr("virt. vmsave/vmload") }, 308 308 }; 309 HRESULT rc;309 HRESULT hrc; 310 310 ComPtr<IHost> Host; 311 311 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(Host.asOutParam())); … … 365 365 CHECK_ERROR(Host, COMGETTER(OSVersion)(oSVersion.asOutParam())); 366 366 RTPrintf(List::tr("Operating system version: %ls\n"), oSVersion.raw()); 367 return rc;367 return hrc; 368 368 } 369 369 … … 383 383 bool fOptLong) 384 384 { 385 HRESULT rc = S_OK;385 HRESULT hrc = S_OK; 386 386 for (size_t i = 0; i < aMedia.size(); ++i) 387 387 { 388 388 ComPtr<IMedium> pMedium = aMedia[i]; 389 389 390 rc = showMediumInfo(pVirtualBox, pMedium, pszParentUUIDStr, fOptLong);390 hrc = showMediumInfo(pVirtualBox, pMedium, pszParentUUIDStr, fOptLong); 391 391 392 392 RTPrintf("\n"); … … 400 400 401 401 // depth first listing of child media 402 rc = listMedia(pVirtualBox, children, Utf8Str(uuid).c_str(), fOptLong);403 } 404 } 405 406 return rc;402 hrc = listMedia(pVirtualBox, children, Utf8Str(uuid).c_str(), fOptLong); 403 } 404 } 405 406 return hrc; 407 407 } 408 408 … … 416 416 static HRESULT listHddBackends(const ComPtr<IVirtualBox> pVirtualBox) 417 417 { 418 HRESULT rc;418 HRESULT hrc; 419 419 ComPtr<ISystemProperties> systemProperties; 420 420 CHECK_ERROR(pVirtualBox, COMGETTER(SystemProperties)(systemProperties.asOutParam())); … … 494 494 RTPrintf(")\n"); 495 495 } 496 return rc;496 return hrc; 497 497 } 498 498 … … 506 506 static HRESULT listUsbHost(const ComPtr<IVirtualBox> &pVirtualBox) 507 507 { 508 HRESULT rc;508 HRESULT hrc; 509 509 ComPtr<IHost> Host; 510 510 CHECK_ERROR_RET(pVirtualBox, COMGETTER(Host)(Host.asOutParam()), 1); … … 631 631 } 632 632 } 633 return rc;633 return hrc; 634 634 } 635 635 … … 643 643 static HRESULT listUsbFilters(const ComPtr<IVirtualBox> &pVirtualBox) 644 644 { 645 HRESULT rc;645 HRESULT hrc; 646 646 647 647 RTPrintf(List::tr("Global USB Device Filters:\n\n")); … … 704 704 } 705 705 } 706 return rc;706 return hrc; 707 707 } 708 708 … … 1278 1278 static HRESULT listVideoInputDevices(const ComPtr<IVirtualBox> &pVirtualBox) 1279 1279 { 1280 HRESULT rc;1280 HRESULT hrc; 1281 1281 ComPtr<IHost> host; 1282 1282 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam())); … … 1295 1295 RTPrintf("%ls \"%ls\"\n%ls\n", alias.raw(), name.raw(), path.raw()); 1296 1296 } 1297 return rc;1297 return hrc; 1298 1298 } 1299 1299 … … 1306 1306 static HRESULT listScreenShotFormats(const ComPtr<IVirtualBox> &pVirtualBox) 1307 1307 { 1308 HRESULT rc = S_OK;1308 HRESULT hrc = S_OK; 1309 1309 ComPtr<ISystemProperties> systemProperties; 1310 1310 CHECK_ERROR(pVirtualBox, COMGETTER(SystemProperties)(systemProperties.asOutParam())); … … 1324 1324 RTPrintf(" BitmapFormat_%s (0x%08X)\n", szFormat, u32Format); 1325 1325 } 1326 return rc;1326 return hrc; 1327 1327 } 1328 1328 … … 1335 1335 static HRESULT listCloudProviders(const ComPtr<IVirtualBox> &pVirtualBox) 1336 1336 { 1337 HRESULT rc = S_OK;1337 HRESULT hrc = S_OK; 1338 1338 ComPtr<ICloudProviderManager> pCloudProviderManager; 1339 1339 CHECK_ERROR(pVirtualBox, COMGETTER(CloudProviderManager)(pCloudProviderManager.asOutParam())); … … 1356 1356 RTPrintf("\n"); 1357 1357 } 1358 return rc;1358 return hrc; 1359 1359 } 1360 1360 … … 1369 1369 static HRESULT listCloudProfiles(const ComPtr<IVirtualBox> &pVirtualBox, bool fOptLong) 1370 1370 { 1371 HRESULT rc = S_OK;1371 HRESULT hrc = S_OK; 1372 1372 ComPtr<ICloudProviderManager> pCloudProviderManager; 1373 1373 CHECK_ERROR(pVirtualBox, COMGETTER(CloudProviderManager)(pCloudProviderManager.asOutParam())); … … 1413 1413 } 1414 1414 } 1415 return rc;1415 return hrc; 1416 1416 } 1417 1417 … … 1682 1682 static HRESULT listHostDrives(const ComPtr<IVirtualBox> pVirtualBox, bool fOptLong) 1683 1683 { 1684 HRESULT rc = S_OK;1684 HRESULT hrc = S_OK; 1685 1685 ComPtr<IHost> pHost; 1686 1686 CHECK_ERROR2I_RET(pVirtualBox, COMGETTER(Host)(pHost.asOutParam()), hrcCheck); … … 1695 1695 com::Bstr bstrDrivePath; 1696 1696 CHECK_ERROR(pHostDrive,COMGETTER(DrivePath)(bstrDrivePath.asOutParam())); 1697 if (SUCCEEDED( rc))1697 if (SUCCEEDED(hrc)) 1698 1698 RTPrintf(List::tr("%sDrive: %ls\n"), i > 0 ? "\n" : "", bstrDrivePath.raw()); 1699 1699 else 1700 RTPrintf(List::tr("%sDrive: %Rhrc\n"), i > 0 ? "\n" : "", rc);1700 RTPrintf(List::tr("%sDrive: %Rhrc\n"), i > 0 ? "\n" : "", hrc); 1701 1701 1702 1702 com::Bstr bstrModel; 1703 1703 CHECK_ERROR(pHostDrive,COMGETTER(Model)(bstrModel.asOutParam())); 1704 if (FAILED( rc))1705 RTPrintf(List::tr("Model: %Rhrc\n"), rc);1704 if (FAILED(hrc)) 1705 RTPrintf(List::tr("Model: %Rhrc\n"), hrc); 1706 1706 else if (bstrModel.isNotEmpty()) 1707 1707 RTPrintf(List::tr("Model: \"%ls\"\n"), bstrModel.raw()); … … 1712 1712 with E_ACCESSDENIED. Typically means the user cannot read the drive. */ 1713 1713 com::Bstr bstrUuidDisk; 1714 rc = pHostDrive->COMGETTER(Uuid)(bstrUuidDisk.asOutParam());1715 if (SUCCEEDED( rc) && !com::Guid(bstrUuidDisk).isZero())1714 hrc = pHostDrive->COMGETTER(Uuid)(bstrUuidDisk.asOutParam()); 1715 if (SUCCEEDED(hrc) && !com::Guid(bstrUuidDisk).isZero()) 1716 1716 RTPrintf("UUID: %ls\n", bstrUuidDisk.raw()); 1717 else if ( rc == E_ACCESSDENIED)1717 else if (hrc == E_ACCESSDENIED) 1718 1718 { 1719 1719 RTPrintf(List::tr("Further disk and partitioning information is not available for drive \"%ls\". (E_ACCESSDENIED)\n"), … … 1721 1721 continue; 1722 1722 } 1723 else if (FAILED( rc))1724 { 1725 RTPrintf("UUID: %Rhrc\n", rc);1726 com::GlueHandleComErrorNoCtx(pHostDrive, rc);1723 else if (FAILED(hrc)) 1724 { 1725 RTPrintf("UUID: %Rhrc\n", hrc); 1726 com::GlueHandleComErrorNoCtx(pHostDrive, hrc); 1727 1727 } 1728 1728 1729 1729 LONG64 cbSize = 0; 1730 rc = pHostDrive->COMGETTER(Size)(&cbSize);1731 if (SUCCEEDED( rc) && fOptLong)1730 hrc = pHostDrive->COMGETTER(Size)(&cbSize); 1731 if (SUCCEEDED(hrc) && fOptLong) 1732 1732 RTPrintf(List::tr("Size: %llu bytes (%Rhcb)\n", "", cbSize), cbSize, cbSize); 1733 else if (SUCCEEDED( rc))1733 else if (SUCCEEDED(hrc)) 1734 1734 RTPrintf(List::tr("Size: %Rhcb\n"), cbSize); 1735 1735 else 1736 1736 { 1737 RTPrintf(List::tr("Size: %Rhrc\n"), rc);1738 com::GlueHandleComErrorNoCtx(pHostDrive, rc);1737 RTPrintf(List::tr("Size: %Rhrc\n"), hrc); 1738 com::GlueHandleComErrorNoCtx(pHostDrive, hrc); 1739 1739 } 1740 1740 1741 1741 ULONG cbSectorSize = 0; 1742 rc = pHostDrive->COMGETTER(SectorSize)(&cbSectorSize);1743 if (SUCCEEDED( rc))1742 hrc = pHostDrive->COMGETTER(SectorSize)(&cbSectorSize); 1743 if (SUCCEEDED(hrc)) 1744 1744 RTPrintf(List::tr("Sector Size: %u bytes\n", "", cbSectorSize), cbSectorSize); 1745 1745 else 1746 1746 { 1747 RTPrintf(List::tr("Sector Size: %Rhrc\n"), rc);1748 com::GlueHandleComErrorNoCtx(pHostDrive, rc);1747 RTPrintf(List::tr("Sector Size: %Rhrc\n"), hrc); 1748 com::GlueHandleComErrorNoCtx(pHostDrive, hrc); 1749 1749 } 1750 1750 1751 1751 PartitioningType_T partitioningType = (PartitioningType_T)9999; 1752 rc = pHostDrive->COMGETTER(PartitioningType)(&partitioningType);1753 if (SUCCEEDED( rc))1752 hrc = pHostDrive->COMGETTER(PartitioningType)(&partitioningType); 1753 if (SUCCEEDED(hrc)) 1754 1754 RTPrintf(List::tr("Scheme: %s\n"), partitioningType == PartitioningType_MBR ? "MBR" : "GPT"); 1755 1755 else 1756 1756 { 1757 RTPrintf(List::tr("Scheme: %Rhrc\n"), rc);1758 com::GlueHandleComErrorNoCtx(pHostDrive, rc);1757 RTPrintf(List::tr("Scheme: %Rhrc\n"), hrc); 1758 com::GlueHandleComErrorNoCtx(pHostDrive, hrc); 1759 1759 } 1760 1760 1761 1761 com::SafeIfaceArray<IHostDrivePartition> apHostDrivesPartitions; 1762 rc = pHostDrive->COMGETTER(Partitions)(ComSafeArrayAsOutParam(apHostDrivesPartitions));1763 if (FAILED( rc))1764 { 1765 RTPrintf(List::tr("Partitions: %Rhrc\n"), rc);1766 com::GlueHandleComErrorNoCtx(pHostDrive, rc);1762 hrc = pHostDrive->COMGETTER(Partitions)(ComSafeArrayAsOutParam(apHostDrivesPartitions)); 1763 if (FAILED(hrc)) 1764 { 1765 RTPrintf(List::tr("Partitions: %Rhrc\n"), hrc); 1766 com::GlueHandleComErrorNoCtx(pHostDrive, hrc); 1767 1767 } 1768 1768 else if (apHostDrivesPartitions.size() == 0) … … 1883 1883 } 1884 1884 } 1885 return rc;1885 return hrc; 1886 1886 } 1887 1887 … … 1944 1944 static HRESULT produceList(enum ListType_T enmCommand, bool fOptLong, bool fOptSorted, const ComPtr<IVirtualBox> &pVirtualBox) 1945 1945 { 1946 HRESULT rc = S_OK;1946 HRESULT hrc = S_OK; 1947 1947 switch (enmCommand) 1948 1948 { … … 1957 1957 */ 1958 1958 com::SafeIfaceArray<IMachine> machines; 1959 rc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));1960 if (SUCCEEDED( rc))1959 hrc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 1960 if (SUCCEEDED(hrc)) 1961 1961 { 1962 1962 /* … … 1967 1967 for (size_t i = 0; i < machines.size(); ++i) 1968 1968 if (machines[i]) 1969 rc = showVMInfo(pVirtualBox, machines[i], NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT);1969 hrc = showVMInfo(pVirtualBox, machines[i], NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT); 1970 1970 } 1971 1971 else … … 1989 1989 1990 1990 for (size_t i = 0; i < sortedMachines.size(); ++i) 1991 rc = showVMInfo(pVirtualBox, sortedMachines[i].second, NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT);1991 hrc = showVMInfo(pVirtualBox, sortedMachines[i].second, NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT); 1992 1992 } 1993 1993 } … … 2001 2001 */ 2002 2002 com::SafeIfaceArray<IMachine> machines; 2003 rc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));2003 hrc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 2004 2004 com::SafeArray<MachineState_T> states; 2005 if (SUCCEEDED( rc))2006 rc = pVirtualBox->GetMachineStates(ComSafeArrayAsInParam(machines), ComSafeArrayAsOutParam(states));2007 if (SUCCEEDED( rc))2005 if (SUCCEEDED(hrc)) 2006 hrc = pVirtualBox->GetMachineStates(ComSafeArrayAsInParam(machines), ComSafeArrayAsOutParam(states)); 2007 if (SUCCEEDED(hrc)) 2008 2008 { 2009 2009 /* … … 2022 2022 case MachineState_Paused: 2023 2023 case MachineState_TeleportingPausedVM: 2024 rc = showVMInfo(pVirtualBox, machines[i], NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT);2024 hrc = showVMInfo(pVirtualBox, machines[i], NULL, fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT); 2025 2025 break; 2026 2026 default: break; /* Shut up MSC */ … … 2035 2035 { 2036 2036 com::SafeIfaceArray<IGuestOSType> coll; 2037 rc = pVirtualBox->COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(coll));2038 if (SUCCEEDED( rc))2037 hrc = pVirtualBox->COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(coll)); 2038 if (SUCCEEDED(hrc)) 2039 2039 { 2040 2040 /* … … 2072 2072 com::SafeIfaceArray<IMedium> coll; 2073 2073 CHECK_ERROR(host, COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(coll))); 2074 if (SUCCEEDED( rc))2074 if (SUCCEEDED(hrc)) 2075 2075 { 2076 2076 for (size_t i = 0; i < coll.size(); ++i) … … 2094 2094 com::SafeIfaceArray<IMedium> coll; 2095 2095 CHECK_ERROR(host, COMGETTER(FloppyDrives)(ComSafeArrayAsOutParam(coll))); 2096 if (SUCCEEDED( rc))2096 if (SUCCEEDED(hrc)) 2097 2097 { 2098 2098 for (size_t i = 0; i < coll.size(); ++i) … … 2111 2111 2112 2112 case kListInternalNetworks: 2113 rc = listInternalNetworks(pVirtualBox);2113 hrc = listInternalNetworks(pVirtualBox); 2114 2114 break; 2115 2115 … … 2118 2118 case kListHostOnlyInterfaces: 2119 2119 #endif 2120 rc = listNetworkInterfaces(pVirtualBox, enmCommand == kListBridgedInterfaces);2120 hrc = listNetworkInterfaces(pVirtualBox, enmCommand == kListBridgedInterfaces); 2121 2121 break; 2122 2122 2123 2123 #if defined(VBOX_WITH_VMNET) 2124 2124 case kListHostOnlyNetworks: 2125 rc = listHostOnlyNetworks(pVirtualBox);2125 hrc = listHostOnlyNetworks(pVirtualBox); 2126 2126 break; 2127 2127 #endif … … 2129 2129 #if defined(VBOX_WITH_CLOUD_NET) 2130 2130 case kListCloudNetworks: 2131 rc = listCloudNetworks(pVirtualBox);2131 hrc = listCloudNetworks(pVirtualBox); 2132 2132 break; 2133 2133 #endif 2134 2134 case kListHostInfo: 2135 rc = listHostInfo(pVirtualBox);2135 hrc = listHostInfo(pVirtualBox); 2136 2136 break; 2137 2137 … … 2166 2166 2167 2167 case kListHddBackends: 2168 rc = listHddBackends(pVirtualBox);2168 hrc = listHddBackends(pVirtualBox); 2169 2169 break; 2170 2170 … … 2173 2173 com::SafeIfaceArray<IMedium> hdds; 2174 2174 CHECK_ERROR(pVirtualBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam(hdds))); 2175 rc = listMedia(pVirtualBox, hdds, List::tr("base"), fOptLong);2175 hrc = listMedia(pVirtualBox, hdds, List::tr("base"), fOptLong); 2176 2176 break; 2177 2177 } … … 2181 2181 com::SafeIfaceArray<IMedium> dvds; 2182 2182 CHECK_ERROR(pVirtualBox, COMGETTER(DVDImages)(ComSafeArrayAsOutParam(dvds))); 2183 rc = listMedia(pVirtualBox, dvds, NULL, fOptLong);2183 hrc = listMedia(pVirtualBox, dvds, NULL, fOptLong); 2184 2184 break; 2185 2185 } … … 2189 2189 com::SafeIfaceArray<IMedium> floppies; 2190 2190 CHECK_ERROR(pVirtualBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppies))); 2191 rc = listMedia(pVirtualBox, floppies, NULL, fOptLong);2191 hrc = listMedia(pVirtualBox, floppies, NULL, fOptLong); 2192 2192 break; 2193 2193 } 2194 2194 2195 2195 case kListUsbHost: 2196 rc = listUsbHost(pVirtualBox);2196 hrc = listUsbHost(pVirtualBox); 2197 2197 break; 2198 2198 2199 2199 case kListUsbFilters: 2200 rc = listUsbFilters(pVirtualBox);2200 hrc = listUsbFilters(pVirtualBox); 2201 2201 break; 2202 2202 2203 2203 case kListSystemProperties: 2204 rc = listSystemProperties(pVirtualBox);2204 hrc = listSystemProperties(pVirtualBox); 2205 2205 break; 2206 2206 2207 2207 #ifdef VBOX_WITH_UPDATE_AGENT 2208 2208 case kListUpdateAgents: 2209 rc = listUpdateAgents(pVirtualBox);2209 hrc = listUpdateAgents(pVirtualBox); 2210 2210 break; 2211 2211 #endif 2212 2212 case kListDhcpServers: 2213 rc = listDhcpServers(pVirtualBox);2213 hrc = listDhcpServers(pVirtualBox); 2214 2214 break; 2215 2215 2216 2216 case kListExtPacks: 2217 rc = listExtensionPacks(pVirtualBox);2217 hrc = listExtensionPacks(pVirtualBox); 2218 2218 break; 2219 2219 2220 2220 case kListGroups: 2221 rc = listGroups(pVirtualBox);2221 hrc = listGroups(pVirtualBox); 2222 2222 break; 2223 2223 2224 2224 case kListNatNetworks: 2225 rc = listNATNetworks(fOptLong, fOptSorted, pVirtualBox);2225 hrc = listNATNetworks(fOptLong, fOptSorted, pVirtualBox); 2226 2226 break; 2227 2227 2228 2228 case kListVideoInputDevices: 2229 rc = listVideoInputDevices(pVirtualBox);2229 hrc = listVideoInputDevices(pVirtualBox); 2230 2230 break; 2231 2231 2232 2232 case kListScreenShotFormats: 2233 rc = listScreenShotFormats(pVirtualBox);2233 hrc = listScreenShotFormats(pVirtualBox); 2234 2234 break; 2235 2235 2236 2236 case kListCloudProviders: 2237 rc = listCloudProviders(pVirtualBox);2237 hrc = listCloudProviders(pVirtualBox); 2238 2238 break; 2239 2239 2240 2240 case kListCloudProfiles: 2241 rc = listCloudProfiles(pVirtualBox, fOptLong);2241 hrc = listCloudProfiles(pVirtualBox, fOptLong); 2242 2242 break; 2243 2243 2244 2244 case kListCPUProfiles: 2245 rc = listCPUProfiles(pVirtualBox, fOptLong, fOptSorted);2245 hrc = listCPUProfiles(pVirtualBox, fOptLong, fOptSorted); 2246 2246 break; 2247 2247 2248 2248 case kListHostDrives: 2249 rc = listHostDrives(pVirtualBox, fOptLong);2249 hrc = listHostDrives(pVirtualBox, fOptLong); 2250 2250 break; 2251 2251 /* No default here, want gcc warnings. */ … … 2253 2253 } /* end switch */ 2254 2254 2255 return rc;2255 return hrc; 2256 2256 } 2257 2257 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
r94236 r95140 50 50 ComSafeArrayOut(IUnknown *, outObjects)) 51 51 { 52 HRESULT rc = S_OK;52 HRESULT hrc = S_OK; 53 53 com::SafeArray<BSTR> retMetrics(1); 54 54 com::SafeIfaceArray <IUnknown> retObjects; … … 79 79 { 80 80 ComPtr<IMachine> machine; 81 rc = aVirtualBox->FindMachine(Bstr(argv[0]).raw(),82 machine.asOutParam());83 if (SUCCEEDED( rc))81 hrc = aVirtualBox->FindMachine(Bstr(argv[0]).raw(), 82 machine.asOutParam()); 83 if (SUCCEEDED(hrc)) 84 84 { 85 85 retObjects.reset(1); … … 89 89 { 90 90 errorArgument(Metrics::tr("Invalid machine name: '%s'"), argv[0]); 91 return rc;91 return hrc; 92 92 } 93 93 } … … 98 98 retObjects.detachTo(ComSafeArrayOutArg(outObjects)); 99 99 100 return rc;100 return hrc; 101 101 } 102 102 … … 122 122 static Bstr getObjectName(ComPtr<IUnknown> aObject) 123 123 { 124 HRESULT rc;124 HRESULT hrc; 125 125 126 126 ComPtr<IHost> host = aObject; … … 133 133 Bstr name; 134 134 CHECK_ERROR(machine, COMGETTER(Name)(name.asOutParam())); 135 if (SUCCEEDED( rc))135 if (SUCCEEDED(hrc)) 136 136 return name; 137 137 } … … 141 141 static void listAffectedMetrics(ComSafeArrayIn(IPerformanceMetric*, aMetrics)) 142 142 { 143 HRESULT rc;143 HRESULT hrc; 144 144 com::SafeIfaceArray<IPerformanceMetric> metrics(ComSafeArrayInArg(aMetrics)); 145 145 if (metrics.size()) … … 172 172 ComPtr<IPerformanceCollector> performanceCollector) 173 173 { 174 HRESULT rc;174 HRESULT hrc; 175 175 com::SafeArray<BSTR> metrics; 176 176 com::SafeIfaceArray<IUnknown> objects; … … 178 178 setCurrentSubcommand(HELP_SCOPE_METRICS_LIST); 179 179 180 rc = parseFilterParameters(argc - 1, &argv[1], aVirtualBox,180 hrc = parseFilterParameters(argc - 1, &argv[1], aVirtualBox, 181 181 ComSafeArrayAsOutParam(metrics), 182 182 ComSafeArrayAsOutParam(objects)); 183 if (FAILED( rc))183 if (FAILED(hrc)) 184 184 return RTEXITCODE_FAILURE; 185 185 … … 223 223 ComPtr<IPerformanceCollector> performanceCollector) 224 224 { 225 HRESULT rc;225 HRESULT hrc; 226 226 com::SafeArray<BSTR> metrics; 227 227 com::SafeIfaceArray<IUnknown> objects; … … 259 259 } 260 260 261 rc = parseFilterParameters(argc - i, &argv[i], aVirtualBox,262 ComSafeArrayAsOutParam(metrics),263 ComSafeArrayAsOutParam(objects));264 if (FAILED( rc))261 hrc = parseFilterParameters(argc - i, &argv[i], aVirtualBox, 262 ComSafeArrayAsOutParam(metrics), 263 ComSafeArrayAsOutParam(objects)); 264 if (FAILED(hrc)) 265 265 return RTEXITCODE_FAILURE; 266 266 … … 270 270 ComSafeArrayAsInParam(objects), period, samples, 271 271 ComSafeArrayAsOutParam(affectedMetrics))); 272 if (FAILED( rc))272 if (FAILED(hrc)) 273 273 return RTEXITCODE_SYNTAX; /** @todo figure out why we must return 2 here. */ 274 274 … … 286 286 ComPtr<IPerformanceCollector> performanceCollector) 287 287 { 288 HRESULT rc;288 HRESULT hrc; 289 289 com::SafeArray<BSTR> metrics; 290 290 com::SafeIfaceArray<IUnknown> objects; … … 292 292 setCurrentSubcommand(HELP_SCOPE_METRICS_QUERY); 293 293 294 rc = parseFilterParameters(argc - 1, &argv[1], aVirtualBox,295 ComSafeArrayAsOutParam(metrics),296 ComSafeArrayAsOutParam(objects));297 if (FAILED( rc))294 hrc = parseFilterParameters(argc - 1, &argv[1], aVirtualBox, 295 ComSafeArrayAsOutParam(metrics), 296 ComSafeArrayAsOutParam(objects)); 297 if (FAILED(hrc)) 298 298 return RTEXITCODE_FAILURE; 299 299 … … 395 395 ComPtr<IPerformanceCollector> performanceCollector) 396 396 { 397 HRESULT rc;397 HRESULT hrc; 398 398 com::SafeArray<BSTR> metrics; 399 399 com::SafeIfaceArray<IUnknown> objects; … … 434 434 } 435 435 436 rc = parseFilterParameters(argc - i, &argv[i], aVirtualBox,437 ComSafeArrayAsOutParam(metrics),438 ComSafeArrayAsOutParam(objects));439 if (FAILED( rc))436 hrc = parseFilterParameters(argc - i, &argv[i], aVirtualBox, 437 ComSafeArrayAsOutParam(metrics), 438 ComSafeArrayAsOutParam(objects)); 439 if (FAILED(hrc)) 440 440 return RTEXITCODE_FAILURE; 441 441 … … 471 471 ComSafeArrayAsInParam(objectsFiltered), period, samples, 472 472 ComSafeArrayAsOutParam(affectedMetrics))); 473 if (FAILED( rc))473 if (FAILED(hrc)) 474 474 return RTEXITCODE_SYNTAX; /** @todo figure out why we must return 2 here. */ 475 475 … … 551 551 ComPtr<IPerformanceCollector> performanceCollector) 552 552 { 553 HRESULT rc;553 HRESULT hrc; 554 554 com::SafeArray<BSTR> metrics; 555 555 com::SafeIfaceArray<IUnknown> objects; … … 568 568 } 569 569 570 rc = parseFilterParameters(argc - i, &argv[i], aVirtualBox,571 ComSafeArrayAsOutParam(metrics),572 ComSafeArrayAsOutParam(objects));573 if (FAILED( rc))570 hrc = parseFilterParameters(argc - i, &argv[i], aVirtualBox, 571 ComSafeArrayAsOutParam(metrics), 572 ComSafeArrayAsOutParam(objects)); 573 if (FAILED(hrc)) 574 574 return RTEXITCODE_FAILURE; 575 575 … … 579 579 ComSafeArrayAsInParam(objects), 580 580 ComSafeArrayAsOutParam(affectedMetrics))); 581 if (FAILED( rc))581 if (FAILED(hrc)) 582 582 return RTEXITCODE_SYNTAX; /** @todo figure out why we must return 2 here. */ 583 583 … … 595 595 ComPtr<IPerformanceCollector> performanceCollector) 596 596 { 597 HRESULT rc;597 HRESULT hrc; 598 598 com::SafeArray<BSTR> metrics; 599 599 com::SafeIfaceArray<IUnknown> objects; … … 612 612 } 613 613 614 rc = parseFilterParameters(argc - i, &argv[i], aVirtualBox,615 ComSafeArrayAsOutParam(metrics),616 ComSafeArrayAsOutParam(objects));617 if (FAILED( rc))614 hrc = parseFilterParameters(argc - i, &argv[i], aVirtualBox, 615 ComSafeArrayAsOutParam(metrics), 616 ComSafeArrayAsOutParam(objects)); 617 if (FAILED(hrc)) 618 618 return RTEXITCODE_FAILURE; 619 619 … … 623 623 ComSafeArrayAsInParam(objects), 624 624 ComSafeArrayAsOutParam(affectedMetrics))); 625 if (FAILED( rc))625 if (FAILED(hrc)) 626 626 return RTEXITCODE_SYNTAX; /** @todo figure out why we must return 2 here. */ 627 627 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r94992 r95140 66 66 RTEXITCODE handleRegisterVM(HandlerArg *a) 67 67 { 68 HRESULT rc;68 HRESULT hrc; 69 69 const char *VMName = NULL; 70 70 … … 131 131 * and the client's interpretation of relative paths. Remove after the API 132 132 * has been redesigned. */ 133 rc = a->virtualBox->OpenMachine(Bstr(a->argv[0]).raw(),134 Bstr(strPassword).raw(),135 machine.asOutParam());136 if ( rc == VBOX_E_FILE_ERROR)133 hrc = a->virtualBox->OpenMachine(Bstr(a->argv[0]).raw(), 134 Bstr(strPassword).raw(), 135 machine.asOutParam()); 136 if (hrc == VBOX_E_FILE_ERROR) 137 137 { 138 138 char szVMFileAbs[RTPATH_MAX] = ""; … … 145 145 machine.asOutParam())); 146 146 } 147 else if (FAILED( rc))147 else if (FAILED(hrc)) 148 148 CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(a->argv[0]).raw(), 149 149 Bstr(strPassword).raw(), 150 150 machine.asOutParam())); 151 if (SUCCEEDED( rc))151 if (SUCCEEDED(hrc)) 152 152 { 153 153 ASSERT(machine); 154 154 CHECK_ERROR(a->virtualBox, RegisterMachine(machine)); 155 155 } 156 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;156 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 157 157 } 158 158 … … 165 165 RTEXITCODE handleUnregisterVM(HandlerArg *a) 166 166 { 167 HRESULT rc;167 HRESULT hrc; 168 168 const char *VMName = NULL; 169 169 bool fDelete = false; … … 223 223 RTEXITCODE_FAILURE); 224 224 225 rc = showProgress(pProgress);225 hrc = showProgress(pProgress); 226 226 CHECK_PROGRESS_ERROR_RET(pProgress, (Misc::tr("Machine delete failed")), RTEXITCODE_FAILURE); 227 227 } … … 236 236 IMedium *pMedium = aMedia[i]; 237 237 if (pMedium) 238 rc = pMedium->Close();239 } 240 rc = S_OK;238 hrc = pMedium->Close(); 239 } 240 hrc = S_OK; /** @todo r=andy Why overwriting the result from closing the medium above? */ 241 241 } 242 242 return RTEXITCODE_SUCCESS; … … 268 268 RTEXITCODE handleCreateVM(HandlerArg *a) 269 269 { 270 HRESULT rc;270 HRESULT hrc; 271 271 Bstr bstrBaseFolder; 272 272 Bstr bstrName; … … 412 412 while (0); 413 413 414 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;414 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 415 415 } 416 416 … … 423 423 RTEXITCODE handleMoveVM(HandlerArg *a) 424 424 { 425 HRESULT rc;425 HRESULT hrc; 426 426 const char *pszSrcName = NULL; 427 427 const char *pszType = NULL; … … 499 499 progress.asOutParam()), 500 500 RTEXITCODE_FAILURE); 501 rc = showProgress(progress);501 hrc = showProgress(progress); 502 502 CHECK_PROGRESS_ERROR_RET(progress, (Misc::tr("Move VM failed")), RTEXITCODE_FAILURE); 503 503 … … 577 577 RTEXITCODE handleCloneVM(HandlerArg *a) 578 578 { 579 HRESULT rc;579 HRESULT hrc; 580 580 const char *pszSrcName = NULL; 581 581 const char *pszSnapshotName = NULL; … … 704 704 progress.asOutParam()), 705 705 RTEXITCODE_FAILURE); 706 rc = showProgress(progress);706 hrc = showProgress(progress); 707 707 CHECK_PROGRESS_ERROR_RET(progress, (Misc::tr("Clone VM failed")), RTEXITCODE_FAILURE); 708 708 … … 719 719 RTEXITCODE handleStartVM(HandlerArg *a) 720 720 { 721 HRESULT rc = S_OK;721 HRESULT hrc = S_OK; 722 722 std::list<const char *> VMs; 723 723 Bstr sessionType; … … 846 846 ++it) 847 847 { 848 HRESULT rc2 =rc;848 HRESULT hrc2 = hrc; 849 849 const char *pszVM = *it; 850 850 ComPtr<IMachine> machine; … … 856 856 { 857 857 CHECK_ERROR(machine, AddEncryptionPassword(Bstr(pszPasswordId).raw(), Bstr(strPassword).raw())); 858 if ( rc == VBOX_E_PASSWORD_INCORRECT)858 if (hrc == VBOX_E_PASSWORD_INCORRECT) 859 859 RTMsgError("Password incorrect!"); 860 860 } 861 if (SUCCEEDED( rc))861 if (SUCCEEDED(hrc)) 862 862 { 863 863 ComPtr<IProgress> progress; 864 864 CHECK_ERROR(machine, LaunchVMProcess(a->session, sessionType.raw(), 865 865 ComSafeArrayAsInParam(aBstrEnv), progress.asOutParam())); 866 if (SUCCEEDED( rc) && !progress.isNull())866 if (SUCCEEDED(hrc) && !progress.isNull()) 867 867 { 868 868 RTPrintf("Waiting for VM \"%s\" to power on...\n", pszVM); 869 869 CHECK_ERROR(progress, WaitForCompletion(-1)); 870 if (SUCCEEDED( rc))870 if (SUCCEEDED(hrc)) 871 871 { 872 872 BOOL completed = true; 873 873 CHECK_ERROR(progress, COMGETTER(Completed)(&completed)); 874 if (SUCCEEDED( rc))874 if (SUCCEEDED(hrc)) 875 875 { 876 876 ASSERT(completed); … … 878 878 LONG iRc; 879 879 CHECK_ERROR(progress, COMGETTER(ResultCode)(&iRc)); 880 if (SUCCEEDED( rc))880 if (SUCCEEDED(hrc)) 881 881 { 882 882 if (SUCCEEDED(iRc)) … … 887 887 com::GluePrintErrorInfo(info); 888 888 } 889 rc = iRc;889 hrc = iRc; 890 890 } 891 891 } … … 899 899 900 900 /* make sure that we remember the failed state */ 901 if (FAILED( rc2))902 rc =rc2;903 } 904 905 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;901 if (FAILED(hrc2)) 902 hrc = hrc2; 903 } 904 905 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 906 906 } 907 907 … … 918 918 RTEXITCODE handleSetVMEncryption(HandlerArg *a, const char *pszFilenameOrUuid) 919 919 { 920 HRESULT rc;920 HRESULT hrc; 921 921 ComPtr<IMachine> machine; 922 922 const char *pszPasswordNew = NULL; … … 1032 1032 Bstr(strPasswordNew).raw(), Bstr(pszNewPasswordId).raw(), 1033 1033 fForce, progress.asOutParam())); 1034 if (SUCCEEDED( rc))1035 rc = showProgress(progress);1036 if (FAILED( rc))1037 { 1038 if ( rc == E_NOTIMPL)1034 if (SUCCEEDED(hrc)) 1035 hrc = showProgress(progress); 1036 if (FAILED(hrc)) 1037 { 1038 if (hrc == E_NOTIMPL) 1039 1039 RTMsgError("Encrypt VM operation is not implemented!"); 1040 else if ( rc == VBOX_E_NOT_SUPPORTED)1040 else if (hrc == VBOX_E_NOT_SUPPORTED) 1041 1041 RTMsgError("Encrypt VM operation for this cipher is not implemented yet!"); 1042 1042 else if (!progress.isNull()) … … 1046 1046 } 1047 1047 } 1048 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1048 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1049 1049 } 1050 1050 1051 1051 RTEXITCODE handleCheckVMPassword(HandlerArg *a, const char *pszFilenameOrUuid) 1052 1052 { 1053 HRESULT rc;1053 HRESULT hrc; 1054 1054 ComPtr<IMachine> machine; 1055 1055 Utf8Str strPassword; … … 1080 1080 { 1081 1081 CHECK_ERROR(machine, CheckEncryptionPassword(Bstr(strPassword).raw())); 1082 if (SUCCEEDED( rc))1082 if (SUCCEEDED(hrc)) 1083 1083 RTPrintf("The given password is correct\n"); 1084 1084 } 1085 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1085 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1086 1086 } 1087 1087 … … 1094 1094 RTEXITCODE handleAddVMPassword(HandlerArg *a, const char *pszFilenameOrUuid) 1095 1095 { 1096 HRESULT rc;1096 HRESULT hrc; 1097 1097 ComPtr<IMachine> machine; 1098 1098 const char *pszPassword = NULL; … … 1167 1167 ComPtr<IProgress> progress; 1168 1168 CHECK_ERROR(machine, AddEncryptionPassword(Bstr(pszPasswordId).raw(), Bstr(strPassword).raw())); 1169 if ( rc == VBOX_E_PASSWORD_INCORRECT)1169 if (hrc == VBOX_E_PASSWORD_INCORRECT) 1170 1170 RTMsgError("Password incorrect!"); 1171 1171 } 1172 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1172 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1173 1173 } 1174 1174 1175 1175 RTEXITCODE handleRemoveVMPassword(HandlerArg *a, const char *pszFilenameOrUuid) 1176 1176 { 1177 HRESULT rc;1177 HRESULT hrc; 1178 1178 ComPtr<IMachine> machine; 1179 1179 … … 1186 1186 { 1187 1187 CHECK_ERROR(machine, RemoveEncryptionPassword(Bstr(a->argv[0]).raw())); 1188 if ( rc == VBOX_E_INVALID_VM_STATE)1188 if (hrc == VBOX_E_INVALID_VM_STATE) 1189 1189 RTMsgError("The machine is in online or transient state\n"); 1190 1190 } 1191 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1191 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1192 1192 } 1193 1193 … … 1216 1216 RTEXITCODE handleDiscardState(HandlerArg *a) 1217 1217 { 1218 HRESULT rc;1218 HRESULT hrc; 1219 1219 1220 1220 if (a->argc != 1) … … 1240 1240 } 1241 1241 1242 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1242 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1243 1243 } 1244 1244 1245 1245 RTEXITCODE handleAdoptState(HandlerArg *a) 1246 1246 { 1247 HRESULT rc;1247 HRESULT hrc; 1248 1248 1249 1249 if (a->argc != 2) … … 1275 1275 } 1276 1276 1277 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1277 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1278 1278 } 1279 1279 1280 1280 RTEXITCODE handleGetExtraData(HandlerArg *a) 1281 1281 { 1282 HRESULT rc = S_OK;1282 HRESULT hrc = S_OK; 1283 1283 1284 1284 if (a->argc > 2 || a->argc < 1) … … 1354 1354 } 1355 1355 } 1356 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1356 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1357 1357 } 1358 1358 1359 1359 RTEXITCODE handleSetExtraData(HandlerArg *a) 1360 1360 { 1361 HRESULT rc = S_OK;1361 HRESULT hrc = S_OK; 1362 1362 1363 1363 if (a->argc < 2) … … 1400 1400 } 1401 1401 } 1402 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1402 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1403 1403 } 1404 1404 1405 1405 RTEXITCODE handleSetProperty(HandlerArg *a) 1406 1406 { 1407 HRESULT rc;1407 HRESULT hrc; 1408 1408 1409 1409 /* there must be two arguments: property name and value */ … … 1536 1536 return errorSyntax(Misc::tr("Invalid parameter '%s'"), a->argv[0]); 1537 1537 1538 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1538 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1539 1539 } 1540 1540 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyNvram.cpp
r94236 r95140 422 422 RTEXITCODE handleModifyNvram(HandlerArg *a) 423 423 { 424 HRESULT rc = S_OK;424 HRESULT hrc = S_OK; 425 425 ComPtr<IMachine> machine; 426 426 ComPtr<INvramStore> nvramStore; … … 438 438 /* get the mutable session machine */ 439 439 a->session->COMGETTER(Machine)(machine.asOutParam()); 440 rc = machine->COMGETTER(NonVolatileStore)(nvramStore.asOutParam());441 if (FAILED( rc)) goto leave;440 hrc = machine->COMGETTER(NonVolatileStore)(nvramStore.asOutParam()); 441 if (FAILED(hrc)) goto leave; 442 442 443 443 if (!strcmp(a->argv[1], "inituefivarstore")) 444 444 { 445 445 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_INITUEFIVARSTORE); 446 rc = handleModifyNvramInitUefiVarStore(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;446 hrc = handleModifyNvramInitUefiVarStore(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 447 447 } 448 448 else if (!strcmp(a->argv[1], "enrollmssignatures")) 449 449 { 450 450 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_ENROLLMSSIGNATURES); 451 rc = handleModifyNvramEnrollMsSignatures(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;451 hrc = handleModifyNvramEnrollMsSignatures(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 452 452 } 453 453 else if (!strcmp(a->argv[1], "enrollpk")) 454 454 { 455 455 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_ENROLLPK); 456 rc = handleModifyNvramEnrollPlatformKey(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;456 hrc = handleModifyNvramEnrollPlatformKey(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 457 457 } 458 458 else if (!strcmp(a->argv[1], "enrollorclpk")) 459 459 { 460 460 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_ENROLLORCLPK); 461 rc = handleModifyNvramEnrollOraclePlatformKey(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;461 hrc = handleModifyNvramEnrollOraclePlatformKey(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 462 462 } 463 463 else if (!strcmp(a->argv[1], "listvars")) 464 464 { 465 465 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_LISTVARS); 466 rc = handleModifyNvramListUefiVars(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;466 hrc = handleModifyNvramListUefiVars(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 467 467 } 468 468 else if (!strcmp(a->argv[1], "queryvar")) 469 469 { 470 470 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_QUERYVAR); 471 rc = handleModifyNvramQueryUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;471 hrc = handleModifyNvramQueryUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 472 472 } 473 473 else if (!strcmp(a->argv[1], "deletevar")) 474 474 { 475 475 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_DELETEVAR); 476 rc = handleModifyNvramDeleteUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;476 hrc = handleModifyNvramDeleteUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 477 477 } 478 478 else if (!strcmp(a->argv[1], "changevar")) 479 479 { 480 480 setCurrentSubcommand(HELP_SCOPE_MODIFYNVRAM_CHANGEVAR); 481 rc = handleModifyNvramChangeUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;481 hrc = handleModifyNvramChangeUefiVar(a, nvramStore) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 482 482 } 483 483 else … … 485 485 486 486 /* commit changes */ 487 if (SUCCEEDED( rc))487 if (SUCCEEDED(hrc)) 488 488 CHECK_ERROR(machine, SaveSettings()); 489 489 … … 492 492 a->session->UnlockMachine(); 493 493 494 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;495 } 494 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 495 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r94234 r95140 599 599 { 600 600 int c; 601 HRESULT rc;601 HRESULT hrc; 602 602 Bstr name; 603 603 … … 634 634 635 635 RTGETOPTUNION ValueUnion; 636 while ( SUCCEEDED ( rc)636 while ( SUCCEEDED (hrc) 637 637 && (c = RTGetOpt(&GetOptState, &ValueUnion))) 638 638 { … … 669 669 { 670 670 RTMsgError(ModifyVM::tr("Cannot open file \"%s\": %Rrc"), ValueUnion.psz, vrc); 671 rc = E_FAIL;671 hrc = E_FAIL; 672 672 break; 673 673 } … … 677 677 { 678 678 RTMsgError(ModifyVM::tr("Cannot get size of file \"%s\": %Rrc"), ValueUnion.psz, vrc); 679 rc = E_FAIL;679 hrc = E_FAIL; 680 680 break; 681 681 } … … 683 683 { 684 684 RTMsgError(ModifyVM::tr("File \"%s\" is bigger than 256KByte"), ValueUnion.psz); 685 rc = E_FAIL;685 hrc = E_FAIL; 686 686 break; 687 687 } 688 688 SafeArray<BYTE> icon((size_t)cbSize); 689 rc = RTFileRead(iconFile, icon.raw(), (size_t)cbSize, NULL);689 hrc = RTFileRead(iconFile, icon.raw(), (size_t)cbSize, NULL); 690 690 if (RT_FAILURE(vrc)) 691 691 { 692 692 RTMsgError(ModifyVM::tr("Cannot read contents of file \"%s\": %Rrc"), ValueUnion.psz, vrc); 693 rc = E_FAIL;693 hrc = E_FAIL; 694 694 break; 695 695 } … … 742 742 { 743 743 errorArgument(ModifyVM::tr("Invalid --firmware argument '%s'"), ValueUnion.psz); 744 rc = E_FAIL;744 hrc = E_FAIL; 745 745 } 746 746 break; … … 813 813 { 814 814 errorArgument(ModifyVM::tr("Invalid --paravirtprovider argument '%s'"), ValueUnion.psz); 815 rc = E_FAIL;815 hrc = E_FAIL; 816 816 } 817 817 break; … … 984 984 { 985 985 errorArgument(ModifyVM::tr("Invalid --graphicscontroller argument '%s'"), ValueUnion.psz); 986 rc = E_FAIL;986 hrc = E_FAIL; 987 987 } 988 988 break; … … 1050 1050 { 1051 1051 errorArgument(ModifyVM::tr("Invalid --biosbootmenu argument '%s'"), ValueUnion.psz); 1052 rc = E_FAIL;1052 hrc = E_FAIL; 1053 1053 } 1054 1054 break; … … 1074 1074 { 1075 1075 errorArgument(ModifyVM::tr("Invalid --biosapic argument '%s'"), ValueUnion.psz); 1076 rc = E_FAIL;1076 hrc = E_FAIL; 1077 1077 } 1078 1078 break; … … 1161 1161 { 1162 1162 ComPtr<IMedium> hardDisk; 1163 rc = openMedium(a, ValueUnion.psz, DeviceType_HardDisk,1163 hrc = openMedium(a, ValueUnion.psz, DeviceType_HardDisk, 1164 1164 AccessMode_ReadWrite, hardDisk, 1165 1165 false /* fForceNewUuidOnOpen */, 1166 1166 false /* fSilent */); 1167 if (FAILED( rc))1167 if (FAILED(hrc)) 1168 1168 break; 1169 1169 if (hardDisk) … … 1175 1175 } 1176 1176 else 1177 rc = E_FAIL;1177 hrc = E_FAIL; 1178 1178 } 1179 1179 break; … … 1201 1201 { 1202 1202 errorArgument(ModifyVM::tr("Invalid --idecontroller argument '%s'"), ValueUnion.psz); 1203 rc = E_FAIL;1203 hrc = E_FAIL; 1204 1204 } 1205 1205 break; … … 1212 1212 SataCtl.asOutParam())); 1213 1213 1214 if (SUCCEEDED( rc) && ValueUnion.u32 > 0)1214 if (SUCCEEDED(hrc) && ValueUnion.u32 > 0) 1215 1215 CHECK_ERROR(SataCtl, COMSETTER(PortCount)(ValueUnion.u32)); 1216 1216 break; … … 1238 1238 if (!RTStrICmp(ValueUnion.psz, "none")) 1239 1239 { 1240 rc = sessionMachine->DetachDevice(Bstr("LsiLogic").raw(),1240 hrc = sessionMachine->DetachDevice(Bstr("LsiLogic").raw(), 1241 1241 GetOptState.uIndex, 0); 1242 if (FAILED( rc))1242 if (FAILED(hrc)) 1243 1243 CHECK_ERROR(sessionMachine, DetachDevice(Bstr("BusLogic").raw(), 1244 1244 GetOptState.uIndex, 0)); … … 1247 1247 { 1248 1248 ComPtr<IMedium> hardDisk; 1249 rc = openMedium(a, ValueUnion.psz, DeviceType_HardDisk,1249 hrc = openMedium(a, ValueUnion.psz, DeviceType_HardDisk, 1250 1250 AccessMode_ReadWrite, hardDisk, 1251 1251 false /* fForceNewUuidOnOpen */, 1252 1252 false /* fSilent */); 1253 if (FAILED( rc))1253 if (FAILED(hrc)) 1254 1254 break; 1255 1255 if (hardDisk) 1256 1256 { 1257 rc = sessionMachine->AttachDevice(Bstr("LsiLogic").raw(),1257 hrc = sessionMachine->AttachDevice(Bstr("LsiLogic").raw(), 1258 1258 GetOptState.uIndex, 0, 1259 1259 DeviceType_HardDisk, 1260 1260 hardDisk); 1261 if (FAILED( rc))1261 if (FAILED(hrc)) 1262 1262 CHECK_ERROR(sessionMachine, 1263 1263 AttachDevice(Bstr("BusLogic").raw(), … … 1267 1267 } 1268 1268 else 1269 rc = E_FAIL;1269 hrc = E_FAIL; 1270 1270 } 1271 1271 break; … … 1278 1278 if (!RTStrICmp(ValueUnion.psz, "LsiLogic")) 1279 1279 { 1280 rc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw());1281 if (FAILED( rc))1280 hrc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw()); 1281 if (FAILED(hrc)) 1282 1282 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("LsiLogic").raw())); 1283 1283 … … 1287 1287 ctl.asOutParam())); 1288 1288 1289 if (SUCCEEDED( rc))1289 if (SUCCEEDED(hrc)) 1290 1290 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic)); 1291 1291 } 1292 1292 else if (!RTStrICmp(ValueUnion.psz, "BusLogic")) 1293 1293 { 1294 rc = sessionMachine->RemoveStorageController(Bstr("LsiLogic").raw());1295 if (FAILED( rc))1294 hrc = sessionMachine->RemoveStorageController(Bstr("LsiLogic").raw()); 1295 if (FAILED(hrc)) 1296 1296 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("BusLogic").raw())); 1297 1297 … … 1301 1301 ctl.asOutParam())); 1302 1302 1303 if (SUCCEEDED( rc))1303 if (SUCCEEDED(hrc)) 1304 1304 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic)); 1305 1305 } … … 1318 1318 StorageBus_SCSI, 1319 1319 ctl.asOutParam())); 1320 if (SUCCEEDED( rc))1320 if (SUCCEEDED(hrc)) 1321 1321 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic)); 1322 1322 } 1323 1323 else if (!RTStrICmp(ValueUnion.psz, "off") || !RTStrICmp(ValueUnion.psz, "disable")) 1324 1324 { 1325 rc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw());1326 if (FAILED( rc))1325 hrc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw()); 1326 if (FAILED(hrc)) 1327 1327 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("LsiLogic").raw())); 1328 1328 } … … 1352 1352 ComPtr<IHost> host; 1353 1353 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 1354 rc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5).raw(),1354 hrc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5).raw(), 1355 1355 dvdMedium.asOutParam()); 1356 1356 if (!dvdMedium) … … 1361 1361 { 1362 1362 errorArgument(ModifyVM::tr("Invalid host DVD drive name \"%s\""), ValueUnion.psz + 5); 1363 rc = E_FAIL;1363 hrc = E_FAIL; 1364 1364 break; 1365 1365 } 1366 rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(),1366 hrc = host->FindHostDVDDrive(Bstr(szPathReal).raw(), 1367 1367 dvdMedium.asOutParam()); 1368 1368 if (!dvdMedium) 1369 1369 { 1370 1370 errorArgument(ModifyVM::tr("Invalid host DVD drive name \"%s\""), ValueUnion.psz + 5); 1371 rc = E_FAIL;1371 hrc = E_FAIL; 1372 1372 break; 1373 1373 } … … 1376 1376 else 1377 1377 { 1378 rc = openMedium(a, ValueUnion.psz, DeviceType_DVD,1378 hrc = openMedium(a, ValueUnion.psz, DeviceType_DVD, 1379 1379 AccessMode_ReadOnly, dvdMedium, 1380 1380 false /* fForceNewUuidOnOpen */, 1381 1381 false /* fSilent */); 1382 if (FAILED( rc))1382 if (FAILED(hrc)) 1383 1383 break; 1384 1384 if (!dvdMedium) 1385 1385 { 1386 rc = E_FAIL;1386 hrc = E_FAIL; 1387 1387 break; 1388 1388 } … … 1430 1430 ComPtr<IHost> host; 1431 1431 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 1432 rc = host->FindHostFloppyDrive(Bstr(ValueUnion.psz + 5).raw(),1432 hrc = host->FindHostFloppyDrive(Bstr(ValueUnion.psz + 5).raw(), 1433 1433 floppyMedium.asOutParam()); 1434 1434 if (!floppyMedium) 1435 1435 { 1436 1436 errorArgument(ModifyVM::tr("Invalid host floppy drive name \"%s\""), ValueUnion.psz + 5); 1437 rc = E_FAIL;1437 hrc = E_FAIL; 1438 1438 break; 1439 1439 } … … 1441 1441 else 1442 1442 { 1443 rc = openMedium(a, ValueUnion.psz, DeviceType_Floppy,1443 hrc = openMedium(a, ValueUnion.psz, DeviceType_Floppy, 1444 1444 AccessMode_ReadWrite, floppyMedium, 1445 1445 false /* fForceNewUuidOnOpen */, 1446 1446 false /* fSilent */); 1447 if (FAILED( rc))1447 if (FAILED(hrc)) 1448 1448 break; 1449 1449 if (!floppyMedium) 1450 1450 { 1451 rc = E_FAIL;1451 hrc = E_FAIL; 1452 1452 break; 1453 1453 } … … 1515 1515 { 1516 1516 errorArgument(ModifyVM::tr("Invalid --nicproperty%d argument '%s'"), GetOptState.uIndex, ValueUnion.psz); 1517 rc = E_FAIL;1517 hrc = E_FAIL; 1518 1518 } 1519 1519 RTStrFree(pszProperty); … … 1523 1523 RTStrmPrintf(g_pStdErr, ModifyVM::tr("Error: Failed to allocate memory for --nicproperty%d '%s'\n"), 1524 1524 GetOptState.uIndex, ValueUnion.psz); 1525 rc = E_FAIL;1525 hrc = E_FAIL; 1526 1526 } 1527 1527 } … … 1597 1597 errorArgument(ModifyVM::tr("Invalid NIC type '%s' specified for NIC %u"), 1598 1598 ValueUnion.psz, GetOptState.uIndex); 1599 rc = E_FAIL;1599 hrc = E_FAIL; 1600 1600 } 1601 1601 break; … … 1631 1631 { 1632 1632 errorArgument(ModifyVM::tr("Invalid boot priority '%u' specfied for NIC %u"), ValueUnion.u32, GetOptState.uIndex); 1633 rc = E_FAIL;1633 hrc = E_FAIL; 1634 1634 } 1635 1635 else … … 1653 1653 { 1654 1654 errorArgument(ModifyVM::tr("Unknown promiscuous mode policy '%s'"), ValueUnion.psz); 1655 rc = E_INVALIDARG;1655 hrc = E_INVALIDARG; 1656 1656 break; 1657 1657 } … … 1689 1689 CHECK_ERROR(sessionMachine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam())); 1690 1690 1691 if (SUCCEEDED( rc))1691 if (SUCCEEDED(hrc)) 1692 1692 { 1693 1693 CHECK_ERROR(bwCtrl, GetBandwidthGroup(Bstr(ValueUnion.psz).raw(), bwGroup.asOutParam())); 1694 if (SUCCEEDED( rc))1694 if (SUCCEEDED(hrc)) 1695 1695 { 1696 1696 CHECK_ERROR(nic, COMSETTER(BandwidthGroup)(bwGroup)); … … 1788 1788 { 1789 1789 errorArgument(ModifyVM::tr("Invalid type '%s' specfied for NIC %u"), ValueUnion.psz, GetOptState.uIndex); 1790 rc = E_FAIL;1790 hrc = E_FAIL; 1791 1791 } 1792 1792 break; … … 2072 2072 { 2073 2073 errorArgument(ModifyVM::tr("Invalid proto '%s' specfied for NIC %u"), ValueUnion.psz, GetOptState.uIndex); 2074 rc = E_FAIL;2074 hrc = E_FAIL; 2075 2075 break; 2076 2076 } … … 2268 2268 { 2269 2269 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBMouse)); 2270 if (SUCCEEDED( rc))2270 if (SUCCEEDED(hrc)) 2271 2271 fEnableUsb = true; 2272 2272 } … … 2274 2274 { 2275 2275 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBTablet)); 2276 if (SUCCEEDED( rc))2276 if (SUCCEEDED(hrc)) 2277 2277 fEnableUsb = true; 2278 2278 } … … 2280 2280 { 2281 2281 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBMultiTouch)); 2282 if (SUCCEEDED( rc))2282 if (SUCCEEDED(hrc)) 2283 2283 fEnableUsb = true; 2284 2284 } … … 2290 2290 { 2291 2291 errorArgument(ModifyVM::tr("Invalid type '%s' specfied for pointing device"), ValueUnion.psz); 2292 rc = E_FAIL;2292 hrc = E_FAIL; 2293 2293 } 2294 2294 if (fEnableUsb) … … 2297 2297 ULONG cOhciCtrls = 0; 2298 2298 ULONG cXhciCtrls = 0; 2299 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);2300 if (SUCCEEDED( rc)) {2301 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls);2302 if ( SUCCEEDED( rc)2299 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 2300 if (SUCCEEDED(hrc)) { 2301 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls); 2302 if ( SUCCEEDED(hrc) 2303 2303 && cOhciCtrls + cXhciCtrls == 0) 2304 2304 { … … 2323 2323 { 2324 2324 CHECK_ERROR(sessionMachine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_USBKeyboard)); 2325 if (SUCCEEDED( rc))2325 if (SUCCEEDED(hrc)) 2326 2326 fEnableUsb = true; 2327 2327 } … … 2329 2329 { 2330 2330 CHECK_ERROR(sessionMachine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_None)); 2331 if (SUCCEEDED( rc))2331 if (SUCCEEDED(hrc)) 2332 2332 fEnableUsb = true; 2333 2333 } … … 2335 2335 { 2336 2336 errorArgument(ModifyVM::tr("Invalid type '%s' specfied for keyboard"), ValueUnion.psz); 2337 rc = E_FAIL;2337 hrc = E_FAIL; 2338 2338 } 2339 2339 if (fEnableUsb) … … 2342 2342 ULONG cOhciCtrls = 0; 2343 2343 ULONG cXhciCtrls = 0; 2344 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);2345 if (SUCCEEDED( rc)) {2346 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls);2347 if ( SUCCEEDED( rc)2344 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 2345 if (SUCCEEDED(hrc)) { 2346 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls); 2347 if ( SUCCEEDED(hrc) 2348 2348 && cOhciCtrls + cXhciCtrls == 0) 2349 2349 { … … 2538 2538 { 2539 2539 errorArgument(ModifyVM::tr("Invalid --audiocontroller argument '%s'"), ValueUnion.psz); 2540 rc = E_FAIL;2540 hrc = E_FAIL; 2541 2541 } 2542 2542 break; … … 2560 2560 { 2561 2561 errorArgument(ModifyVM::tr("Invalid --audiocodec argument '%s'"), ValueUnion.psz); 2562 rc = E_FAIL;2562 hrc = E_FAIL; 2563 2563 } 2564 2564 break; … … 2632 2632 { 2633 2633 errorArgument(ModifyVM::tr("Invalid --audio argument '%s'"), ValueUnion.psz); 2634 rc = E_FAIL;2634 hrc = E_FAIL; 2635 2635 } 2636 2636 break; … … 2672 2672 { 2673 2673 errorArgument(ModifyVM::tr("Invalid --clipboard-mode argument '%s'"), ValueUnion.psz); 2674 rc = E_FAIL;2675 } 2676 if (SUCCEEDED( rc))2674 hrc = E_FAIL; 2675 } 2676 if (SUCCEEDED(hrc)) 2677 2677 { 2678 2678 CHECK_ERROR(sessionMachine, COMSETTER(ClipboardMode)(mode)); … … 2692 2692 { 2693 2693 errorArgument(ModifyVM::tr("Invalid --clipboard-file-transfers argument '%s'"), ValueUnion.psz); 2694 rc = E_FAIL;2695 } 2696 if (SUCCEEDED( rc))2694 hrc = E_FAIL; 2695 } 2696 if (SUCCEEDED(hrc)) 2697 2697 { 2698 2698 CHECK_ERROR(sessionMachine, COMSETTER(ClipboardFileTransfersEnabled)(fEnabled)); … … 2717 2717 { 2718 2718 errorArgument(ModifyVM::tr("Invalid --draganddrop argument '%s'"), ValueUnion.psz); 2719 rc = E_FAIL;2720 } 2721 if (SUCCEEDED( rc))2719 hrc = E_FAIL; 2720 } 2721 if (SUCCEEDED(hrc)) 2722 2722 { 2723 2723 CHECK_ERROR(sessionMachine, COMSETTER(DnDMode)(mode)); … … 2771 2771 2772 2772 errorArgument(ModifyVM::tr("Invalid --vrdeproperty argument '%s'"), ValueUnion.psz); 2773 rc = E_FAIL;2773 hrc = E_FAIL; 2774 2774 break; 2775 2775 } … … 2780 2780 RTStrmPrintf(g_pStdErr, ModifyVM::tr("Error: Failed to allocate memory for VRDE property '%s'\n"), 2781 2781 ValueUnion.psz); 2782 rc = E_FAIL;2782 hrc = E_FAIL; 2783 2783 } 2784 2784 } … … 2841 2841 { 2842 2842 errorArgument(ModifyVM::tr("Invalid --vrdeauthtype argument '%s'"), ValueUnion.psz); 2843 rc = E_FAIL;2843 hrc = E_FAIL; 2844 2844 } 2845 2845 break; … … 2959 2959 { 2960 2960 errorArgument(ModifyVM::tr("Invalid --usbrename parameters, nothing renamed")); 2961 rc = E_FAIL;2961 hrc = E_FAIL; 2962 2962 } 2963 2963 break; … … 2967 2967 { 2968 2968 ULONG cXhciCtrls = 0; 2969 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls);2970 if (SUCCEEDED( rc))2969 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls); 2970 if (SUCCEEDED(hrc)) 2971 2971 { 2972 2972 if (!cXhciCtrls && ValueUnion.f) … … 3000 3000 { 3001 3001 ULONG cEhciCtrls = 0; 3002 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_EHCI, &cEhciCtrls);3003 if (SUCCEEDED( rc))3002 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_EHCI, &cEhciCtrls); 3003 if (SUCCEEDED(hrc)) 3004 3004 { 3005 3005 if (!cEhciCtrls && ValueUnion.f) … … 3033 3033 { 3034 3034 ULONG cOhciCtrls = 0; 3035 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);3036 if (SUCCEEDED( rc))3035 hrc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 3036 if (SUCCEEDED(hrc)) 3037 3037 { 3038 3038 if (!cOhciCtrls && ValueUnion.f) … … 3101 3101 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &password); 3102 3102 if (rcExit != RTEXITCODE_SUCCESS) 3103 rc = E_FAIL;3103 hrc = E_FAIL; 3104 3104 else 3105 3105 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterPassword)(Bstr(password).raw())); … … 3169 3169 { 3170 3170 errorArgument(ModifyVM::tr("Invalid --chipset argument '%s' (valid: piix3,ich9)"), ValueUnion.psz); 3171 rc = E_FAIL;3171 hrc = E_FAIL; 3172 3172 } 3173 3173 break; … … 3187 3187 #else 3188 3188 errorArgument(ModifyVM::tr("Invalid --iommu argument '%s' (valid: none,amd,automatic)"), ValueUnion.psz); 3189 rc = E_FAIL;3189 hrc = E_FAIL; 3190 3190 #endif 3191 3191 } … … 3201 3201 { 3202 3202 errorArgument(ModifyVM::tr("Invalid --iommu argument '%s'"), ValueUnion.psz); 3203 rc = E_FAIL;3203 hrc = E_FAIL; 3204 3204 } 3205 3205 break; … … 3226 3226 { 3227 3227 errorArgument(ModifyVM::tr("Invalid --tpm-type argument '%s'"), ValueUnion.psz); 3228 rc = E_FAIL;3228 hrc = E_FAIL; 3229 3229 } 3230 3230 break; … … 3283 3283 { 3284 3284 errorArgument(ModifyVM::tr("Invalid list of screens specified\n")); 3285 rc = E_FAIL;3285 hrc = E_FAIL; 3286 3286 break; 3287 3287 } … … 3305 3305 { 3306 3306 errorArgument(ModifyVM::tr("Cannot convert filename \"%s\" to absolute path\n"), ValueUnion.psz); 3307 rc = E_FAIL;3307 hrc = E_FAIL; 3308 3308 break; 3309 3309 } … … 3336 3336 errorArgument(ModifyVM::tr("Error parsing video resolution '%s' (expected <width>x<height>)"), 3337 3337 ValueUnion.psz); 3338 rc = E_FAIL;3338 hrc = E_FAIL; 3339 3339 break; 3340 3340 } … … 3345 3345 errorArgument(ModifyVM::tr("Error parsing video resolution '%s' (expected <width>x<height>)"), 3346 3346 ValueUnion.psz); 3347 rc = E_FAIL;3347 hrc = E_FAIL; 3348 3348 break; 3349 3349 } … … 3420 3420 errorArgument(ModifyVM::tr("Invalid --autostop-type argument '%s' (valid: disabled, savestate, poweroff, acpishutdown)"), 3421 3421 ValueUnion.psz); 3422 rc = E_FAIL;3423 } 3424 3425 if (SUCCEEDED( rc))3422 hrc = E_FAIL; 3423 } 3424 3425 if (SUCCEEDED(hrc)) 3426 3426 CHECK_ERROR(sessionMachine, COMSETTER(AutostopType)(enmAutostopType)); 3427 3427 break; … … 3440 3440 errorArgument(ModifyVM::tr("Invalid --pciattach argument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')"), 3441 3441 ValueUnion.psz); 3442 rc = E_FAIL;3442 hrc = E_FAIL; 3443 3443 } 3444 3444 else … … 3457 3457 { 3458 3458 errorArgument(ModifyVM::tr("Invalid --pcidetach argument '%s' (valid: 'HB:HD.HF')"), ValueUnion.psz); 3459 rc = E_FAIL;3459 hrc = E_FAIL; 3460 3460 } 3461 3461 else … … 3491 3491 { 3492 3492 errorArgument(ModifyVM::tr("Invalid --vm-process-priority '%s'"), ValueUnion.psz); 3493 rc = E_FAIL;3493 hrc = E_FAIL; 3494 3494 } 3495 3495 else … … 3501 3501 3502 3502 case MODIFYVM_TESTING_ENABLED: 3503 rc = setExtraData(sessionMachine, "VBoxInternal/Devices/VMMDev/0/Config/TestingEnabled", ValueUnion.f ? "1" : "");3503 hrc = setExtraData(sessionMachine, "VBoxInternal/Devices/VMMDev/0/Config/TestingEnabled", ValueUnion.f ? "1" : ""); 3504 3504 break; 3505 3505 3506 3506 case MODIFYVM_TESTING_MMIO: 3507 rc = setExtraData(sessionMachine, "VBoxInternal/Devices/VMMDev/0/Config/TestingMMIO", ValueUnion.f ? "1" : "");3507 hrc = setExtraData(sessionMachine, "VBoxInternal/Devices/VMMDev/0/Config/TestingMMIO", ValueUnion.f ? "1" : ""); 3508 3508 break; 3509 3509 … … 3516 3516 char szValue[32]; 3517 3517 RTStrPrintf(szValue, sizeof(szValue), "%u", ValueUnion.u32); 3518 rc = setExtraData(sessionMachine, szVar, szValue);3519 } 3520 else 3521 rc = errorArgumentHr(ModifyVM::tr("--testing-cfg-dword index %u is out of range: 0 thru 9"),3518 hrc = setExtraData(sessionMachine, szVar, szValue); 3519 } 3520 else 3521 hrc = errorArgumentHr(ModifyVM::tr("--testing-cfg-dword index %u is out of range: 0 thru 9"), 3522 3522 GetOptState.uIndex); 3523 3523 break; … … 3525 3525 default: 3526 3526 errorGetOpt(c, &ValueUnion); 3527 rc = E_FAIL;3527 hrc = E_FAIL; 3528 3528 break; 3529 3529 } … … 3531 3531 3532 3532 /* commit changes */ 3533 if (SUCCEEDED( rc))3533 if (SUCCEEDED(hrc)) 3534 3534 CHECK_ERROR(sessionMachine, SaveSettings()); 3535 3535 … … 3537 3537 a->session->UnlockMachine(); 3538 3538 3539 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;3539 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 3540 3540 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp
r94322 r95140 86 86 bool fLong = true) 87 87 { 88 HRESULT rc;88 HRESULT hrc; 89 89 90 90 do … … 157 157 } while (0); 158 158 159 return rc;159 return hrc; 160 160 } 161 161 162 162 static RTEXITCODE handleNATList(HandlerArg *a) 163 163 { 164 HRESULT rc;164 HRESULT hrc; 165 165 166 166 RTPrintf(Nat::tr("NAT Networks:\n\n")); … … 188 188 } 189 189 190 rc = printNATNetwork(pNATNet);191 if (FAILED( rc))190 hrc = printNATNetwork(pNATNet); 191 if (FAILED(hrc)) 192 192 break; 193 193 … … 195 195 } 196 196 197 if (SUCCEEDED( rc))197 if (SUCCEEDED(hrc)) 198 198 RTPrintf(Nat::tr("%zu %s found\n"), cFound, cFound == 1 ? Nat::tr("network") : Nat::tr("networks", "", cFound)); 199 199 200 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;200 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 201 201 } 202 202 … … 397 397 } 398 398 399 HRESULT rc;399 HRESULT hrc; 400 400 Bstr NetName; 401 401 NetName = Bstr(pNetName); 402 402 403 403 ComPtr<INATNetwork> net; 404 rc = a->virtualBox->FindNATNetworkByName(NetName.mutableRaw(), net.asOutParam());404 hrc = a->virtualBox->FindNATNetworkByName(NetName.mutableRaw(), net.asOutParam()); 405 405 if (enmCode == OP_ADD) 406 406 { 407 if (SUCCEEDED( rc))407 if (SUCCEEDED(hrc)) 408 408 return errorArgument(Nat::tr("NATNetwork server already exists")); 409 409 410 410 CHECK_ERROR(a->virtualBox, CreateNATNetwork(NetName.raw(), net.asOutParam())); 411 if (FAILED( rc))411 if (FAILED(hrc)) 412 412 return errorArgument(Nat::tr("Failed to create the NAT network service")); 413 413 } 414 else if (FAILED( rc))414 else if (FAILED(hrc)) 415 415 return errorArgument(Nat::tr("NATNetwork server does not exist")); 416 416 … … 423 423 { 424 424 CHECK_ERROR(net, COMSETTER(Network)(Bstr(pPrefixIPv4).raw())); 425 if (FAILED( rc))425 if (FAILED(hrc)) 426 426 return errorArgument(Nat::tr("Failed to set configuration")); 427 427 } … … 429 429 { 430 430 CHECK_ERROR(net, COMSETTER(NeedDhcpServer) ((BOOL)dhcp)); 431 if (FAILED( rc))431 if (FAILED(hrc)) 432 432 return errorArgument(Nat::tr("Failed to set configuration")); 433 433 } … … 441 441 { 442 442 CHECK_ERROR(net, COMSETTER(IPv6Enabled)(FALSE)); 443 if (FAILED( rc))443 if (FAILED(hrc)) 444 444 return errorArgument(Nat::tr("Failed to set configuration")); 445 445 } … … 448 448 { 449 449 CHECK_ERROR(net, COMSETTER(IPv6Prefix)(Bstr(pPrefixIPv6).raw())); 450 if (FAILED( rc))450 if (FAILED(hrc)) 451 451 return errorArgument(Nat::tr("Failed to set configuration")); 452 452 } … … 459 459 { 460 460 CHECK_ERROR(net, COMSETTER(IPv6Enabled)(TRUE)); 461 if (FAILED( rc))461 if (FAILED(hrc)) 462 462 return errorArgument(Nat::tr("Failed to set configuration")); 463 463 } … … 467 467 BOOL fIPv6Default = RT_BOOL(ipv6_default); 468 468 CHECK_ERROR(net, COMSETTER(AdvertiseDefaultIPv6RouteEnabled)(fIPv6Default)); 469 if (FAILED( rc))469 if (FAILED(hrc)) 470 470 return errorArgument(Nat::tr("Failed to set configuration")); 471 471 } … … 478 478 CHECK_ERROR(net, RemovePortForwardRule((BOOL)(*it).fIPv6, 479 479 Bstr((*it).szName).raw())); 480 if (FAILED( rc))480 if (FAILED(hrc)) 481 481 return errorArgument(Nat::tr("Failed to delete pf")); 482 482 } … … 503 503 Bstr((*it).szPfrGuestAddr).raw(), 504 504 (*it).u16PfrGuestPort)); 505 if (FAILED( rc))505 if (FAILED(hrc)) 506 506 return errorArgument(Nat::tr("Failed to add pf")); 507 507 } … … 562 562 { 563 563 CHECK_ERROR(net, COMSETTER(Enabled) ((BOOL)enable)); 564 if (FAILED( rc))564 if (FAILED(hrc)) 565 565 return errorArgument(Nat::tr("Failed to set configuration")); 566 566 } … … 570 570 { 571 571 CHECK_ERROR(a->virtualBox, RemoveNATNetwork(net)); 572 if (FAILED( rc))572 if (FAILED(hrc)) 573 573 return errorArgument(Nat::tr("Failed to remove nat network")); 574 574 break; … … 577 577 { 578 578 CHECK_ERROR(net, Start()); 579 if (FAILED( rc))579 if (FAILED(hrc)) 580 580 return errorArgument(Nat::tr("Failed to start network")); 581 581 break; … … 584 584 { 585 585 CHECK_ERROR(net, Stop()); 586 if (FAILED( rc))586 if (FAILED(hrc)) 587 587 return errorArgument(Nat::tr("Failed to stop network")); 588 588 break; … … 645 645 const ComPtr<IVirtualBox> &pVirtualBox) 646 646 { 647 HRESULT rc;647 HRESULT hrc; 648 648 649 649 com::SafeIfaceArray<INATNetwork> aNets; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r93115 r95140 56 56 uint32_t uSnapshotLevel) 57 57 { 58 HRESULT rc;58 HRESULT hrc; 59 59 60 60 do … … 134 134 uint32_t uLevel) 135 135 { 136 HRESULT rc;136 HRESULT hrc; 137 137 do 138 138 { … … 219 219 void DumpSnapshot(ComPtr<IMachine> &pMachine) 220 220 { 221 HRESULT rc;221 HRESULT hrc; 222 222 223 223 do … … 316 316 RTEXITCODE handleSnapshot(HandlerArg *a) 317 317 { 318 HRESULT rc;318 HRESULT hrc; 319 319 320 320 /** @todo r=bird: sub-standard command line parsing here! … … 358 358 { 359 359 errorSyntax(Snapshot::tr("Missing snapshot name")); 360 rc = E_FAIL;360 hrc = E_FAIL; 361 361 break; 362 362 } … … 382 382 RTGETOPTUNION Value; 383 383 int vrc; 384 while ( SUCCEEDED( rc)384 while ( SUCCEEDED(hrc) 385 385 && (ch = RTGetOpt(&GetOptState, &Value))) 386 386 { … … 407 407 default: 408 408 errorGetOpt(ch, &Value); 409 rc = E_FAIL;409 hrc = E_FAIL; 410 410 break; 411 411 } 412 412 } 413 if (FAILED( rc))413 if (FAILED(hrc)) 414 414 break; 415 415 … … 417 417 { 418 418 ComPtr<ISnapshot> pSnapshot; 419 rc = sessionMachine->FindSnapshot(name.raw(),420 pSnapshot.asOutParam());421 if (SUCCEEDED( rc) || (enmUnique & SnapshotUniqueFlags_Force))419 hrc = sessionMachine->FindSnapshot(name.raw(), 420 pSnapshot.asOutParam()); 421 if (SUCCEEDED(hrc) || (enmUnique & SnapshotUniqueFlags_Force)) 422 422 { 423 423 /* there is a duplicate, need to create a unique name */ … … 455 455 tryName = BstrFmt("%ls%s", name.raw(), suffix.c_str()); 456 456 count++; 457 rc = sessionMachine->FindSnapshot(tryName.raw(),458 pSnapshot.asOutParam());459 if (FAILED( rc))457 hrc = sessionMachine->FindSnapshot(tryName.raw(), 458 pSnapshot.asOutParam()); 459 if (FAILED(hrc)) 460 460 { 461 461 name = tryName; … … 463 463 } 464 464 } 465 if (SUCCEEDED( rc))465 if (SUCCEEDED(hrc)) 466 466 { 467 467 errorArgument(Snapshot::tr("Failed to generate a unique snapshot name")); 468 rc = E_FAIL;468 hrc = E_FAIL; 469 469 break; 470 470 } 471 471 } 472 rc = S_OK;472 hrc = S_OK; 473 473 } 474 474 … … 479 479 progress.asOutParam())); 480 480 481 rc = showProgress(progress);482 if (SUCCEEDED( rc))481 hrc = showProgress(progress); 482 if (SUCCEEDED(hrc)) 483 483 RTPrintf(Snapshot::tr("Snapshot taken. UUID: %ls\n"), snapId.raw()); 484 484 else … … 499 499 { 500 500 errorSyntax(Snapshot::tr("Too many arguments")); 501 rc = E_FAIL;501 hrc = E_FAIL; 502 502 break; 503 503 } … … 507 507 { 508 508 errorSyntax(Snapshot::tr("Expecting snapshot name only")); 509 rc = E_FAIL;509 hrc = E_FAIL; 510 510 break; 511 511 } … … 551 551 } 552 552 553 rc = showProgress(pProgress);553 hrc = showProgress(pProgress); 554 554 CHECK_PROGRESS_ERROR(pProgress, (Snapshot::tr("Snapshot operation failed"))); 555 555 } … … 560 560 { 561 561 errorSyntax(Snapshot::tr("Missing snapshot name")); 562 rc = E_FAIL;562 hrc = E_FAIL; 563 563 break; 564 564 } … … 583 583 int ch; 584 584 RTGETOPTUNION Value; 585 while ( SUCCEEDED( rc)585 while ( SUCCEEDED(hrc) 586 586 && (ch = RTGetOpt(&GetOptState, &Value))) 587 587 { … … 611 611 default: 612 612 errorGetOpt(ch, &Value); 613 rc = E_FAIL;613 hrc = E_FAIL; 614 614 break; 615 615 } 616 616 } 617 617 618 if (FAILED( rc))618 if (FAILED(hrc)) 619 619 break; 620 620 } … … 627 627 { 628 628 errorSyntax(Snapshot::tr("Expecting snapshot name only")); 629 rc = E_FAIL;629 hrc = E_FAIL; 630 630 break; 631 631 } … … 644 644 { 645 645 setCurrentSubcommand(HELP_SCOPE_SNAPSHOT_LIST); 646 rc = handleSnapshotList(a, sessionMachine) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;646 hrc = handleSnapshotList(a, sessionMachine) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 647 647 } 648 648 else if (!strcmp(a->argv[1], "dump")) // undocumented parameter to debug snapshot info … … 651 651 { 652 652 errorSyntax(Snapshot::tr("Invalid parameter '%s'"), a->argv[1]); 653 rc = E_FAIL;653 hrc = E_FAIL; 654 654 } 655 655 } while (0); … … 657 657 a->session->UnlockMachine(); 658 658 659 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;659 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 660 660 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r94236 r95140 77 77 { 78 78 int c = VERR_INTERNAL_ERROR; /* initialized to shut up gcc */ 79 HRESULT rc = S_OK;79 HRESULT hrc = S_OK; 80 80 ULONG port = ~0U; 81 81 ULONG device = ~0U; … … 118 118 RT_ELEMENTS(g_aStorageAttachOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 119 119 120 while ( SUCCEEDED( rc)120 while ( SUCCEEDED(hrc) 121 121 && (c = RTGetOpt(&GetState, &ValueUnion))) 122 122 { … … 128 128 pszCtl = ValueUnion.psz; 129 129 else 130 rc = E_FAIL;130 hrc = E_FAIL; 131 131 break; 132 132 } … … 149 149 pszMedium = ValueUnion.psz; 150 150 else 151 rc = E_FAIL;151 hrc = E_FAIL; 152 152 break; 153 153 } … … 167 167 } 168 168 else 169 rc = E_FAIL;169 hrc = E_FAIL; 170 170 break; 171 171 } … … 176 176 pszPassThrough = ValueUnion.psz; 177 177 else 178 rc = E_FAIL;178 hrc = E_FAIL; 179 179 break; 180 180 } … … 185 185 pszTempEject = ValueUnion.psz; 186 186 else 187 rc = E_FAIL;187 hrc = E_FAIL; 188 188 break; 189 189 } … … 194 194 pszNonRotational = ValueUnion.psz; 195 195 else 196 rc = E_FAIL;196 hrc = E_FAIL; 197 197 break; 198 198 } … … 203 203 pszDiscard = ValueUnion.psz; 204 204 else 205 rc = E_FAIL;205 hrc = E_FAIL; 206 206 break; 207 207 } … … 212 212 pszHotPluggable = ValueUnion.psz; 213 213 else 214 rc = E_FAIL;214 hrc = E_FAIL; 215 215 break; 216 216 } … … 221 221 pszBandwidthGroup = ValueUnion.psz; 222 222 else 223 rc = E_FAIL;223 hrc = E_FAIL; 224 224 break; 225 225 } … … 235 235 bstrComment = ValueUnion.psz; 236 236 else 237 rc = E_FAIL;237 hrc = E_FAIL; 238 238 break; 239 239 … … 245 245 } 246 246 else 247 rc = E_FAIL;247 hrc = E_FAIL; 248 248 break; 249 249 … … 255 255 } 256 256 else 257 rc = E_FAIL;257 hrc = E_FAIL; 258 258 break; 259 259 … … 291 291 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &utf8Password); 292 292 if (rcExit != RTEXITCODE_SUCCESS) 293 rc = E_FAIL;293 hrc = E_FAIL; 294 294 bstrPassword = utf8Password; 295 295 break; … … 315 315 { 316 316 errorGetOpt(c, &ValueUnion); 317 rc = E_FAIL;317 hrc = E_FAIL; 318 318 break; 319 319 } … … 321 321 } 322 322 323 if (FAILED( rc))323 if (FAILED(hrc)) 324 324 return RTEXITCODE_FAILURE; 325 325 … … 351 351 352 352 /* check if the storage controller is present */ 353 rc = machine->GetStorageControllerByName(Bstr(pszCtl).raw(),354 storageCtl.asOutParam());355 if (FAILED( rc))353 hrc = machine->GetStorageControllerByName(Bstr(pszCtl).raw(), 354 storageCtl.asOutParam()); 355 if (FAILED(hrc)) 356 356 throw Utf8StrFmt(Storage::tr("Could not find a controller named '%s'\n"), pszCtl); 357 357 … … 408 408 ComPtr<IMediumAttachment> mediumAttachment; 409 409 DeviceType_T deviceType = DeviceType_Null; 410 rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, device,411 mediumAttachment.asOutParam());412 if (SUCCEEDED( rc))410 hrc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, device, 411 mediumAttachment.asOutParam()); 412 if (SUCCEEDED(hrc)) 413 413 { 414 414 mediumAttachment->COMGETTER(Type)(&deviceType); … … 435 435 } 436 436 437 if ( FAILED( rc)437 if ( FAILED(hrc) 438 438 || !( deviceType == DeviceType_DVD 439 439 || deviceType == DeviceType_Floppy) … … 496 496 */ 497 497 ComPtr<IMediumAttachment> mediumAttachment; 498 rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port,499 device,500 mediumAttachment.asOutParam());501 if (SUCCEEDED( rc))498 hrc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, 499 device, 500 mediumAttachment.asOutParam()); 501 if (SUCCEEDED(hrc)) 502 502 { 503 503 DeviceType_T deviceType; … … 520 520 } 521 521 ComPtr<IMedium> pExistingMedium; 522 rc = openMedium(a, pszMedium, deviceType,523 AccessMode_ReadWrite,524 pExistingMedium,525 false /* fForceNewUuidOnOpen */,526 true /* fSilent */);527 if (SUCCEEDED( rc) && pExistingMedium)522 hrc = openMedium(a, pszMedium, deviceType, 523 AccessMode_ReadWrite, 524 pExistingMedium, 525 false /* fForceNewUuidOnOpen */, 526 true /* fSilent */); 527 if (SUCCEEDED(hrc) && pExistingMedium) 528 528 { 529 529 if ( (deviceType == DeviceType_DVD) … … 547 547 548 548 CHECK_ERROR(systemProperties, GetDeviceTypesForStorageBus(storageBus, ComSafeArrayAsOutParam(saDeviceTypes))); 549 if (SUCCEEDED( rc))549 if (SUCCEEDED(hrc)) 550 550 { 551 551 ULONG driveCheck = 0; … … 569 569 if (devTypeRequested == DeviceType_DVD) 570 570 { 571 rc = host->FindHostDVDDrive(Bstr(pszMedium + 5).raw(),572 pMedium2Mount.asOutParam());571 hrc = host->FindHostDVDDrive(Bstr(pszMedium + 5).raw(), 572 pMedium2Mount.asOutParam()); 573 573 if (!pMedium2Mount) 574 574 { … … 577 577 if (RT_FAILURE(RTPathReal(pszMedium + 5, szPathReal, sizeof(szPathReal)))) 578 578 throw Utf8StrFmt(Storage::tr("Invalid host DVD drive name \"%s\""), pszMedium + 5); 579 rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(),580 pMedium2Mount.asOutParam());579 hrc = host->FindHostDVDDrive(Bstr(szPathReal).raw(), 580 pMedium2Mount.asOutParam()); 581 581 if (!pMedium2Mount) 582 582 throw Utf8StrFmt(Storage::tr("Invalid host DVD drive name \"%s\""), pszMedium + 5); … … 586 586 { 587 587 // floppy 588 rc = host->FindHostFloppyDrive(Bstr(pszMedium + 5).raw(),589 pMedium2Mount.asOutParam());588 hrc = host->FindHostFloppyDrive(Bstr(pszMedium + 5).raw(), 589 pMedium2Mount.asOutParam()); 590 590 if (!pMedium2Mount) 591 591 throw Utf8StrFmt(Storage::tr("Invalid host floppy drive name \"%s\""), pszMedium + 5); … … 616 616 DeviceType_HardDisk, 617 617 pMedium2Mount.asOutParam())); 618 if (FAILED( rc)) goto leave;618 if (FAILED(hrc)) goto leave; /** @todo r=andy Argh!! Why not using exceptions here? */ 619 619 if (!bstrPort.isEmpty()) 620 620 bstrServer = BstrFmt("%ls:%ls", bstrServer.raw(), bstrPort.raw()); … … 659 659 CHECK_ERROR(pMedium2Mount, SetProperties(ComSafeArrayAsInParam(names), 660 660 ComSafeArrayAsInParam(values))); 661 if (FAILED( rc)) goto leave;661 if (FAILED(hrc)) goto leave; 662 662 Bstr guid; 663 663 CHECK_ERROR(pMedium2Mount, COMGETTER(Id)(guid.asOutParam())); 664 if (FAILED( rc)) goto leave;664 if (FAILED(hrc)) goto leave; 665 665 RTPrintf(Storage::tr("iSCSI disk created. UUID: %s\n"), Utf8Str(guid).c_str()); 666 666 } … … 670 670 { 671 671 ComPtr<IMediumAttachment> mediumAttachment; 672 rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port,673 device,674 mediumAttachment.asOutParam());675 if (FAILED( rc))672 hrc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, 673 device, 674 mediumAttachment.asOutParam()); 675 if (FAILED(hrc)) 676 676 throw Utf8Str(Storage::tr("Missing --medium argument")); 677 677 } … … 679 679 { 680 680 Bstr bstrMedium(pszMedium); 681 rc = openMedium(a, pszMedium, devTypeRequested,682 AccessMode_ReadWrite, pMedium2Mount,683 fSetNewUuid, false /* fSilent */);684 if (FAILED( rc) || !pMedium2Mount)681 hrc = openMedium(a, pszMedium, devTypeRequested, 682 AccessMode_ReadWrite, pMedium2Mount, 683 fSetNewUuid, false /* fSilent */); 684 if (FAILED(hrc) || !pMedium2Mount) 685 685 throw Utf8StrFmt(Storage::tr("Invalid UUID or filename \"%s\""), pszMedium); 686 686 } … … 692 692 CHECK_ERROR(pMedium2Mount, SetIds(fSetNewUuid, bstrNewUuid.raw(), 693 693 fSetNewParentUuid, bstrNewParentUuid.raw())); 694 if (FAILED( rc))694 if (FAILED(hrc)) 695 695 throw Utf8Str(Storage::tr("Failed to set the medium/parent medium UUID")); 696 696 } … … 701 701 MediumType_T enmMediumTypeOld; 702 702 CHECK_ERROR(pMedium2Mount, COMGETTER(Type)(&enmMediumTypeOld)); 703 if (SUCCEEDED( rc))703 if (SUCCEEDED(hrc)) 704 704 { 705 705 if (enmMediumTypeOld != enmMediumType) 706 706 { 707 707 CHECK_ERROR(pMedium2Mount, COMSETTER(Type)(enmMediumType)); 708 if (FAILED( rc))708 if (FAILED(hrc)) 709 709 throw Utf8Str(Storage::tr("Failed to set the medium type")); 710 710 } … … 728 728 ComPtr<IMediumAttachment> mediumAttachment; 729 729 // check if there is a dvd/floppy drive at the given location, if not attach one first 730 rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(),731 port,732 device,733 mediumAttachment.asOutParam());734 if (SUCCEEDED( rc))730 hrc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), 731 port, 732 device, 733 mediumAttachment.asOutParam()); 734 if (SUCCEEDED(hrc)) 735 735 { 736 736 DeviceType_T deviceType; … … 739 739 { 740 740 machine->DetachDevice(Bstr(pszCtl).raw(), port, device); 741 rc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(),742 port,743 device,744 devTypeRequested); // DeviceType_DVD or DeviceType_Floppy741 hrc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(), 742 port, 743 device, 744 devTypeRequested); // DeviceType_DVD or DeviceType_Floppy 745 745 } 746 746 } 747 747 else 748 748 { 749 rc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(),750 port,751 device,752 devTypeRequested); // DeviceType_DVD or DeviceType_Floppy749 hrc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(), 750 port, 751 device, 752 devTypeRequested); // DeviceType_DVD or DeviceType_Floppy 753 753 } 754 754 } … … 783 783 784 784 if ( pszPassThrough 785 && (SUCCEEDED( rc)))785 && (SUCCEEDED(hrc))) 786 786 { 787 787 ComPtr<IMediumAttachment> mattach; … … 789 789 device, mattach.asOutParam())); 790 790 791 if (SUCCEEDED( rc))791 if (SUCCEEDED(hrc)) 792 792 { 793 793 if (!RTStrICmp(pszPassThrough, "on")) … … 809 809 810 810 if ( pszTempEject 811 && (SUCCEEDED( rc)))811 && (SUCCEEDED(hrc))) 812 812 { 813 813 ComPtr<IMediumAttachment> mattach; … … 815 815 device, mattach.asOutParam())); 816 816 817 if (SUCCEEDED( rc))817 if (SUCCEEDED(hrc)) 818 818 { 819 819 if (!RTStrICmp(pszTempEject, "on")) … … 835 835 836 836 if ( pszNonRotational 837 && (SUCCEEDED( rc)))837 && (SUCCEEDED(hrc))) 838 838 { 839 839 ComPtr<IMediumAttachment> mattach; … … 841 841 device, mattach.asOutParam())); 842 842 843 if (SUCCEEDED( rc))843 if (SUCCEEDED(hrc)) 844 844 { 845 845 if (!RTStrICmp(pszNonRotational, "on")) … … 861 861 862 862 if ( pszDiscard 863 && (SUCCEEDED( rc)))863 && (SUCCEEDED(hrc))) 864 864 { 865 865 ComPtr<IMediumAttachment> mattach; … … 867 867 device, mattach.asOutParam())); 868 868 869 if (SUCCEEDED( rc))869 if (SUCCEEDED(hrc)) 870 870 { 871 871 if (!RTStrICmp(pszDiscard, "on")) … … 887 887 888 888 if ( pszHotPluggable 889 && (SUCCEEDED( rc)))889 && (SUCCEEDED(hrc))) 890 890 { 891 891 ComPtr<IMediumAttachment> mattach; … … 893 893 device, mattach.asOutParam())); 894 894 895 if (SUCCEEDED( rc))895 if (SUCCEEDED(hrc)) 896 896 { 897 897 if (!RTStrICmp(pszHotPluggable, "on")) … … 914 914 if ( pszBandwidthGroup 915 915 && !fRunTime 916 && SUCCEEDED( rc))916 && SUCCEEDED(hrc)) 917 917 { 918 918 … … 930 930 CHECK_ERROR(machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam())); 931 931 932 if (SUCCEEDED( rc))932 if (SUCCEEDED(hrc)) 933 933 { 934 934 CHECK_ERROR(bwCtrl, GetBandwidthGroup(Bstr(pszBandwidthGroup).raw(), bwGroup.asOutParam())); 935 if (SUCCEEDED( rc))935 if (SUCCEEDED(hrc)) 936 936 { 937 937 CHECK_ERROR(machine, SetBandwidthGroupForDevice(Bstr(pszCtl).raw(), … … 943 943 944 944 /* commit changes */ 945 if (SUCCEEDED( rc))945 if (SUCCEEDED(hrc)) 946 946 CHECK_ERROR(machine, SaveSettings()); 947 947 } … … 949 949 { 950 950 errorArgument("%s", strError.c_str()); 951 rc = E_FAIL;951 hrc = E_FAIL; 952 952 } 953 953 … … 956 956 a->session->UnlockMachine(); 957 957 958 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;958 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 959 959 } 960 960 … … 1038 1038 } 1039 1039 1040 HRESULT rc;1040 HRESULT hrc; 1041 1041 1042 1042 /* try to find the given machine */ … … 1118 1118 { 1119 1119 errorArgument(Storage::tr("Invalid --add argument '%s'"), pszBusType); 1120 rc = E_FAIL;1120 hrc = E_FAIL; 1121 1121 } 1122 1122 } 1123 1123 1124 1124 if ( pszCtlType 1125 && SUCCEEDED( rc))1125 && SUCCEEDED(hrc)) 1126 1126 { 1127 1127 ComPtr<IStorageController> ctl; … … 1130 1130 ctl.asOutParam())); 1131 1131 1132 if (SUCCEEDED( rc))1132 if (SUCCEEDED(hrc)) 1133 1133 { 1134 1134 if (!RTStrICmp(pszCtlType, "lsilogic")) … … 1179 1179 { 1180 1180 errorArgument(Storage::tr("Invalid --type argument '%s'"), pszCtlType); 1181 rc = E_FAIL;1181 hrc = E_FAIL; 1182 1182 } 1183 1183 } … … 1185 1185 { 1186 1186 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1187 rc = E_FAIL;1187 hrc = E_FAIL; 1188 1188 } 1189 1189 } 1190 1190 1191 1191 if ( (portcount != ~0U) 1192 && SUCCEEDED( rc))1192 && SUCCEEDED(hrc)) 1193 1193 { 1194 1194 ComPtr<IStorageController> ctl; … … 1197 1197 ctl.asOutParam())); 1198 1198 1199 if (SUCCEEDED( rc))1199 if (SUCCEEDED(hrc)) 1200 1200 { 1201 1201 CHECK_ERROR(ctl, COMSETTER(PortCount)(portcount)); … … 1204 1204 { 1205 1205 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1206 rc = E_FAIL;1206 hrc = E_FAIL; /** @todo r=andy Overwrites original hrc. */ 1207 1207 } 1208 1208 } 1209 1209 1210 1210 if ( pszHostIOCache 1211 && SUCCEEDED( rc))1211 && SUCCEEDED(hrc)) 1212 1212 { 1213 1213 ComPtr<IStorageController> ctl; … … 1216 1216 ctl.asOutParam())); 1217 1217 1218 if (SUCCEEDED( rc))1218 if (SUCCEEDED(hrc)) 1219 1219 { 1220 1220 if (!RTStrICmp(pszHostIOCache, "on")) … … 1229 1229 { 1230 1230 errorArgument(Storage::tr("Invalid --hostiocache argument '%s'"), pszHostIOCache); 1231 rc = E_FAIL;1231 hrc = E_FAIL; 1232 1232 } 1233 1233 } … … 1235 1235 { 1236 1236 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1237 rc = E_FAIL;1237 hrc = E_FAIL; /** @todo r=andy Ditto. */ 1238 1238 } 1239 1239 } 1240 1240 1241 1241 if ( pszBootable 1242 && SUCCEEDED( rc))1243 { 1244 if (SUCCEEDED( rc))1242 && SUCCEEDED(hrc)) 1243 { 1244 if (SUCCEEDED(hrc)) 1245 1245 { 1246 1246 if (!RTStrICmp(pszBootable, "on")) … … 1255 1255 { 1256 1256 errorArgument(Storage::tr("Invalid --bootable argument '%s'"), pszBootable); 1257 rc = E_FAIL;1257 hrc = E_FAIL; 1258 1258 } 1259 1259 } … … 1261 1261 { 1262 1262 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1263 rc = E_FAIL;1263 hrc = E_FAIL; 1264 1264 } 1265 1265 } 1266 1266 1267 1267 if ( pszCtlNewName 1268 && SUCCEEDED( rc))1268 && SUCCEEDED(hrc)) 1269 1269 { 1270 1270 ComPtr<IStorageController> ctl; … … 1273 1273 ctl.asOutParam())); 1274 1274 1275 if (SUCCEEDED( rc))1275 if (SUCCEEDED(hrc)) 1276 1276 { 1277 1277 CHECK_ERROR(ctl, COMSETTER(Name)(Bstr(pszCtlNewName).raw())); … … 1280 1280 { 1281 1281 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1282 rc = E_FAIL;1282 hrc = E_FAIL; 1283 1283 } 1284 1284 } … … 1287 1287 1288 1288 /* commit changes */ 1289 if (SUCCEEDED( rc))1289 if (SUCCEEDED(hrc)) 1290 1290 CHECK_ERROR(machine, SaveSettings()); 1291 1291 … … 1293 1293 a->session->UnlockMachine(); 1294 1294 1295 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;1295 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1296 1296 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageUSB.cpp
r94213 r95140 171 171 RTEXITCODE handleUSBFilter(HandlerArg *a) 172 172 { 173 HRESULT rc = S_OK;173 HRESULT hrc = S_OK; 174 174 USBFilterCmd cmd; 175 175 … … 551 551 if (cmd.mMachine) 552 552 { 553 if (SUCCEEDED( rc))553 if (SUCCEEDED(hrc)) 554 554 { 555 555 /* commit the session */ … … 560 560 } 561 561 562 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;562 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 563 563 } 564 564 565 565 RTEXITCODE handleUSBDevSource(HandlerArg *a) 566 566 { 567 HRESULT rc = S_OK;567 HRESULT hrc = S_OK; 568 568 569 569 /* at least: 0: command, 1: source id */ … … 612 612 } 613 613 614 return SUCCEEDED( rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;614 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 615 615 } 616 616 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageUpdateCheck.cpp
r94981 r95140 277 277 */ 278 278 ComPtr<IProgress> pProgress; 279 HRESULT rc = pUpdateAgent->CheckFor(pProgress.asOutParam());280 if (FAILED( rc))279 HRESULT hrc = pUpdateAgent->CheckFor(pProgress.asOutParam()); 280 if (FAILED(hrc)) 281 281 { 282 282 if (pProgress.isNull()) 283 RTStrmPrintf(g_pStdErr, UpdateCheck::tr("Failed to create update progress object: %Rhrc\n"), rc);283 RTStrmPrintf(g_pStdErr, UpdateCheck::tr("Failed to create update progress object: %Rhrc\n"), hrc); 284 284 else 285 285 com::GlueHandleComError(pUpdateAgent, "HostUpdate(UpdateChannel_Stable, pProgress.asOutParam())", 286 rc, __FILE__, __LINE__);286 hrc, __FILE__, __LINE__); 287 287 return RTEXITCODE_FAILURE; 288 288 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageUtils.cpp
r94234 r95140 35 35 ULONG NetworkAdapterCount = 0; 36 36 do { 37 HRESULT rc;37 HRESULT hrc; 38 38 39 39 ComPtr<ISystemProperties> info; -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r93115 r95140 57 57 HRESULT readAndChangeMachineSettings(IMachine *machine, IMachine *readonlyMachine = 0) 58 58 { 59 HRESULT rc = S_OK;59 HRESULT hrc = S_OK; 60 60 61 61 Bstr name; 62 62 RTPrintf("Getting machine name...\n"); 63 CHECK_ERROR_RET(machine, COMGETTER(Name)(name.asOutParam()), rc);63 CHECK_ERROR_RET(machine, COMGETTER(Name)(name.asOutParam()), hrc); 64 64 RTPrintf("Name: {%ls}\n", name.raw()); 65 65 … … 67 67 Bstr guid; 68 68 CHECK_ERROR(machine, COMGETTER(Id)(guid.asOutParam())); 69 if (SUCCEEDED( rc) && !guid.isEmpty()) {69 if (SUCCEEDED(hrc) && !guid.isEmpty()) { 70 70 RTPrintf("Guid::toString(): {%s}\n", Utf8Str(guid).c_str()); 71 71 } else { … … 75 75 ULONG memorySize; 76 76 RTPrintf("Getting memory size...\n"); 77 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySize), rc);77 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySize), hrc); 78 78 RTPrintf("Memory size: %d\n", memorySize); 79 79 80 80 MachineState_T machineState; 81 81 RTPrintf("Getting machine state...\n"); 82 CHECK_ERROR_RET(machine, COMGETTER(State)(&machineState), rc);82 CHECK_ERROR_RET(machine, COMGETTER(State)(&machineState), hrc); 83 83 RTPrintf("Machine state: %d\n", machineState); 84 84 … … 86 86 RTPrintf("Are any settings modified?...\n"); 87 87 CHECK_ERROR(machine, COMGETTER(SettingsModified)(&modified)); 88 if (SUCCEEDED( rc))88 if (SUCCEEDED(hrc)) 89 89 RTPrintf("%s\n", modified ? "yes" : "no"); 90 90 … … 93 93 CHECK_ERROR(machine, COMSETTER(MemorySize)(memorySizeBig)); 94 94 95 if (SUCCEEDED( rc))95 if (SUCCEEDED(hrc)) 96 96 { 97 97 RTPrintf("Are any settings modified now?...\n"); 98 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), rc);98 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), hrc); 99 99 RTPrintf("%s\n", modified ? "yes" : "no"); 100 100 ASSERT_RET(modified, 0); … … 102 102 ULONG memorySizeGot; 103 103 RTPrintf("Getting memory size again...\n"); 104 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySizeGot), rc);104 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySizeGot), hrc); 105 105 RTPrintf("Memory size: %d\n", memorySizeGot); 106 106 ASSERT_RET(memorySizeGot == memorySizeBig, 0); … … 116 116 117 117 RTPrintf("Discarding recent changes...\n"); 118 CHECK_ERROR_RET(machine, DiscardSettings(), rc);118 CHECK_ERROR_RET(machine, DiscardSettings(), hrc); 119 119 RTPrintf("Are any settings modified after discarding?...\n"); 120 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), rc);120 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), hrc); 121 121 RTPrintf("%s\n", modified ? "yes" : "no"); 122 122 ASSERT_RET(!modified, 0); 123 123 124 124 RTPrintf("Getting memory size once more...\n"); 125 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySizeGot), rc);125 CHECK_ERROR_RET(machine, COMGETTER(MemorySize)(&memorySizeGot), hrc); 126 126 RTPrintf("Memory size: %d\n", memorySizeGot); 127 127 ASSERT_RET(memorySizeGot == memorySize, 0); … … 129 129 memorySize = memorySize > 128 ? memorySize / 2 : memorySize * 2; 130 130 RTPrintf("Changing memory size to %d...\n", memorySize); 131 CHECK_ERROR_RET(machine, COMSETTER(MemorySize)(memorySize), rc);131 CHECK_ERROR_RET(machine, COMSETTER(MemorySize)(memorySize), hrc); 132 132 } 133 133 134 134 Bstr desc; 135 135 RTPrintf("Getting description...\n"); 136 CHECK_ERROR_RET(machine, COMGETTER(Description)(desc.asOutParam()), rc);136 CHECK_ERROR_RET(machine, COMGETTER(Description)(desc.asOutParam()), hrc); 137 137 RTPrintf("Description is: \"%ls\"\n", desc.raw()); 138 138 139 139 desc = L"This is an exemplary description (changed)."; 140 140 RTPrintf("Setting description to \"%ls\"...\n", desc.raw()); 141 CHECK_ERROR_RET(machine, COMSETTER(Description)(desc.raw()), rc);141 CHECK_ERROR_RET(machine, COMSETTER(Description)(desc.raw()), hrc); 142 142 143 143 RTPrintf("Saving machine settings...\n"); 144 144 CHECK_ERROR(machine, SaveSettings()); 145 if (SUCCEEDED( rc))145 if (SUCCEEDED(hrc)) 146 146 { 147 147 RTPrintf("Are any settings modified after saving?...\n"); 148 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), rc);148 CHECK_ERROR_RET(machine, COMGETTER(SettingsModified)(&modified), hrc); 149 149 RTPrintf("%s\n", modified ? "yes" : "no"); 150 150 ASSERT_RET(!modified, 0); … … 162 162 Bstr extraData; 163 163 RTPrintf("Getting extra data key {%ls}...\n", extraDataKey.raw()); 164 CHECK_ERROR_RET(machine, GetExtraData(extraDataKey.raw(), extraData.asOutParam()), rc);164 CHECK_ERROR_RET(machine, GetExtraData(extraDataKey.raw(), extraData.asOutParam()), hrc); 165 165 if (!extraData.isEmpty()) { 166 166 RTPrintf("Extra data value: {%ls}\n", extraData.raw()); … … 177 177 CHECK_ERROR(machine, SetExtraData(extraDataKey.raw(), extraData.raw())); 178 178 179 if (SUCCEEDED( rc)) {179 if (SUCCEEDED(hrc)) { 180 180 RTPrintf("Getting extra data key {%ls} again...\n", extraDataKey.raw()); 181 CHECK_ERROR_RET(machine, GetExtraData(extraDataKey.raw(), extraData.asOutParam()), rc);181 CHECK_ERROR_RET(machine, GetExtraData(extraDataKey.raw(), extraData.asOutParam()), hrc); 182 182 if (!extraData.isEmpty()) { 183 183 RTPrintf("Extra data value: {%ls}\n", extraData.raw()); … … 187 187 } 188 188 189 return rc;189 return hrc; 190 190 } 191 191 … … 201 201 RTR3InitExe(argc, &argv, 0); 202 202 203 HRESULT rc;203 HRESULT hrc; 204 204 205 205 { … … 211 211 RTPrintf("Initializing COM...\n"); 212 212 213 rc = com::Initialize();214 if (FAILED( rc))213 hrc = com::Initialize(); 214 if (FAILED(hrc)) 215 215 { 216 216 RTPrintf("ERROR: failed to initialize COM!\n"); 217 return rc;217 return hrc; 218 218 } 219 219 … … 243 243 244 244 RTPrintf("Creating VirtualBox object...\n"); 245 rc = virtualBoxClient.createInprocObject(CLSID_VirtualBoxClient);246 if (SUCCEEDED( rc))247 rc = virtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam());248 if (FAILED( rc))245 hrc = virtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 246 if (SUCCEEDED(hrc)) 247 hrc = virtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam()); 248 if (FAILED(hrc)) 249 249 RTPrintf("ERROR: failed to create the VirtualBox object!\n"); 250 250 else 251 251 { 252 rc = session.createInprocObject(CLSID_Session);253 if (FAILED( rc))252 hrc = session.createInprocObject(CLSID_Session); 253 if (FAILED(hrc)) 254 254 RTPrintf("ERROR: failed to create a session object!\n"); 255 255 } 256 256 257 if (FAILED( rc))257 if (FAILED(hrc)) 258 258 { 259 259 com::ErrorInfo info; 260 260 if (!info.isFullAvailable() && !info.isBasicAvailable()) 261 261 { 262 com::GluePrintRCMessage( rc);262 com::GluePrintRCMessage(hrc); 263 263 RTPrintf("Most likely, the VirtualBox COM server is not running or failed to start.\n"); 264 264 } … … 1592 1592 RTPrintf("tstAPI FINISHED.\n"); 1593 1593 1594 return rc;1594 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1595 1595 } 1596 1596 -
trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp
r94660 r95140 57 57 static BOOL tstApiIVirtualBox(IVirtualBox *pVBox) 58 58 { 59 HRESULT rc;59 HRESULT hrc; 60 60 Bstr bstrTmp; 61 61 ULONG ulTmp; … … 63 63 RTTestSub(g_hTest, "IVirtualBox::version"); 64 64 CHECK_ERROR(pVBox, COMGETTER(Version)(bstrTmp.asOutParam())); 65 if (SUCCEEDED( rc))65 if (SUCCEEDED(hrc)) 66 66 RTTestPassed(g_hTest, "IVirtualBox::version"); 67 67 else … … 70 70 RTTestSub(g_hTest, "IVirtualBox::versionNormalized"); 71 71 CHECK_ERROR(pVBox, COMGETTER(VersionNormalized)(bstrTmp.asOutParam())); 72 if (SUCCEEDED( rc))72 if (SUCCEEDED(hrc)) 73 73 RTTestPassed(g_hTest, "IVirtualBox::versionNormalized"); 74 74 else … … 77 77 RTTestSub(g_hTest, "IVirtualBox::revision"); 78 78 CHECK_ERROR(pVBox, COMGETTER(Revision)(&ulTmp)); 79 if (SUCCEEDED( rc))79 if (SUCCEEDED(hrc)) 80 80 RTTestPassed(g_hTest, "IVirtualBox::revision"); 81 81 else … … 84 84 RTTestSub(g_hTest, "IVirtualBox::packageType"); 85 85 CHECK_ERROR(pVBox, COMGETTER(PackageType)(bstrTmp.asOutParam())); 86 if (SUCCEEDED( rc))86 if (SUCCEEDED(hrc)) 87 87 RTTestPassed(g_hTest, "IVirtualBox::packageType"); 88 88 else … … 91 91 RTTestSub(g_hTest, "IVirtualBox::APIVersion"); 92 92 CHECK_ERROR(pVBox, COMGETTER(APIVersion)(bstrTmp.asOutParam())); 93 if (SUCCEEDED( rc))93 if (SUCCEEDED(hrc)) 94 94 RTTestPassed(g_hTest, "IVirtualBox::APIVersion"); 95 95 else … … 98 98 RTTestSub(g_hTest, "IVirtualBox::homeFolder"); 99 99 CHECK_ERROR(pVBox, COMGETTER(HomeFolder)(bstrTmp.asOutParam())); 100 if (SUCCEEDED( rc))100 if (SUCCEEDED(hrc)) 101 101 RTTestPassed(g_hTest, "IVirtualBox::homeFolder"); 102 102 else … … 105 105 RTTestSub(g_hTest, "IVirtualBox::settingsFilePath"); 106 106 CHECK_ERROR(pVBox, COMGETTER(SettingsFilePath)(bstrTmp.asOutParam())); 107 if (SUCCEEDED( rc))107 if (SUCCEEDED(hrc)) 108 108 RTTestPassed(g_hTest, "IVirtualBox::settingsFilePath"); 109 109 else … … 113 113 RTTestSub(g_hTest, "IVirtualBox::guestOSTypes"); 114 114 CHECK_ERROR(pVBox, COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(guestOSTypes))); 115 if (SUCCEEDED( rc))115 if (SUCCEEDED(hrc)) 116 116 RTTestPassed(g_hTest, "IVirtualBox::guestOSTypes"); 117 117 else … … 132 132 NULL, /** Password */ 133 133 ptrMachine.asOutParam())); /** Machine */ 134 if (SUCCEEDED( rc))134 if (SUCCEEDED(hrc)) 135 135 RTTestPassed(g_hTest, "IVirtualBox::CreateMachine"); 136 136 else … … 142 142 RTTestSub(g_hTest, "IVirtualBox::RegisterMachine"); 143 143 CHECK_ERROR(pVBox, RegisterMachine(ptrMachine)); 144 if (SUCCEEDED( rc))144 if (SUCCEEDED(hrc)) 145 145 RTTestPassed(g_hTest, "IVirtualBox::RegisterMachine"); 146 146 else … … 153 153 RTTestSub(g_hTest, "IVirtualBox::host"); 154 154 CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam())); 155 if (SUCCEEDED( rc))155 if (SUCCEEDED(hrc)) 156 156 { 157 157 /** @todo Add IHost testing here. */ … … 164 164 RTTestSub(g_hTest, "IVirtualBox::systemProperties"); 165 165 CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam())); 166 if (SUCCEEDED( rc))166 if (SUCCEEDED(hrc)) 167 167 { 168 168 /** @todo Add ISystemProperties testing here. */ … … 175 175 RTTestSub(g_hTest, "IVirtualBox::machines"); 176 176 CHECK_ERROR(pVBox, COMGETTER(Machines)(ComSafeArrayAsOutParam(machines))); 177 if (SUCCEEDED( rc))177 if (SUCCEEDED(hrc)) 178 178 { 179 179 bool bFound = FALSE; … … 183 183 { 184 184 Bstr tmpName; 185 rc = machines[i]->COMGETTER(Name)(tmpName.asOutParam());186 if (SUCCEEDED( rc))185 hrc = machines[i]->COMGETTER(Name)(tmpName.asOutParam()); 186 if (SUCCEEDED(hrc)) 187 187 { 188 188 if (tmpName == tstMachineName) … … 219 219 RTTestSub(g_hTest, "IVirtualBox::hardDisks"); 220 220 CHECK_ERROR(pVBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam(hardDisks))); 221 if (SUCCEEDED( rc))221 if (SUCCEEDED(hrc)) 222 222 { 223 223 /** @todo Add hardDisks testing here. */ … … 230 230 RTTestSub(g_hTest, "IVirtualBox::DVDImages"); 231 231 CHECK_ERROR(pVBox, COMGETTER(DVDImages)(ComSafeArrayAsOutParam(DVDImages))); 232 if (SUCCEEDED( rc))232 if (SUCCEEDED(hrc)) 233 233 { 234 234 /** @todo Add DVDImages testing here. */ … … 241 241 RTTestSub(g_hTest, "IVirtualBox::floppyImages"); 242 242 CHECK_ERROR(pVBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppyImages))); 243 if (SUCCEEDED( rc))243 if (SUCCEEDED(hrc)) 244 244 { 245 245 /** @todo Add floppyImages testing here. */ … … 252 252 RTTestSub(g_hTest, "IVirtualBox::progressOperations"); 253 253 CHECK_ERROR(pVBox, COMGETTER(ProgressOperations)(ComSafeArrayAsOutParam(progressOperations))); 254 if (SUCCEEDED( rc))254 if (SUCCEEDED(hrc)) 255 255 { 256 256 /** @todo Add IProgress testing here. */ … … 263 263 RTTestSub(g_hTest, "IVirtualBox::performanceCollector"); 264 264 CHECK_ERROR(pVBox, COMGETTER(PerformanceCollector)(performanceCollector.asOutParam())); 265 if (SUCCEEDED( rc))265 if (SUCCEEDED(hrc)) 266 266 { 267 267 /** @todo Add IPerformanceCollector testing here. */ … … 274 274 RTTestSub(g_hTest, "IVirtualBox::DHCPServers"); 275 275 CHECK_ERROR(pVBox, COMGETTER(DHCPServers)(ComSafeArrayAsOutParam(DHCPServers))); 276 if (SUCCEEDED( rc))276 if (SUCCEEDED(hrc)) 277 277 { 278 278 /** @todo Add IDHCPServers testing here. */ … … 285 285 RTTestSub(g_hTest, "IVirtualBox::NATNetworks"); 286 286 CHECK_ERROR(pVBox, COMGETTER(NATNetworks)(ComSafeArrayAsOutParam(NATNetworks))); 287 if (SUCCEEDED( rc))287 if (SUCCEEDED(hrc)) 288 288 { 289 289 /** @todo Add INATNetworks testing here. */ … … 296 296 RTTestSub(g_hTest, "IVirtualBox::eventSource"); 297 297 CHECK_ERROR(pVBox, COMGETTER(EventSource)(eventSource.asOutParam())); 298 if (SUCCEEDED( rc))298 if (SUCCEEDED(hrc)) 299 299 { 300 300 /** @todo Add IEventSource testing here. */ … … 307 307 RTTestSub(g_hTest, "IVirtualBox::extensionPackManager"); 308 308 CHECK_ERROR(pVBox, COMGETTER(ExtensionPackManager)(extensionPackManager.asOutParam())); 309 if (SUCCEEDED( rc))309 if (SUCCEEDED(hrc)) 310 310 { 311 311 /** @todo Add IExtPackManager testing here. */ … … 318 318 RTTestSub(g_hTest, "IVirtualBox::internalNetworks"); 319 319 CHECK_ERROR(pVBox, COMGETTER(InternalNetworks)(ComSafeArrayAsOutParam(internalNetworks))); 320 if (SUCCEEDED( rc))320 if (SUCCEEDED(hrc)) 321 321 { 322 322 RTTestPassed(g_hTest, "IVirtualBox::internalNetworks"); … … 328 328 RTTestSub(g_hTest, "IVirtualBox::genericNetworkDrivers"); 329 329 CHECK_ERROR(pVBox, COMGETTER(GenericNetworkDrivers)(ComSafeArrayAsOutParam(genericNetworkDrivers))); 330 if (SUCCEEDED( rc))330 if (SUCCEEDED(hrc)) 331 331 { 332 332 RTTestPassed(g_hTest, "IVirtualBox::genericNetworkDrivers"); … … 341 341 static BOOL tstApiClean(IVirtualBox *pVBox) 342 342 { 343 HRESULT rc;343 HRESULT hrc; 344 344 345 345 /** Delete created VM and its files */
Note:
See TracChangeset
for help on using the changeset viewer.