Changeset 93704 in vbox for trunk/src/VBox
- Timestamp:
- Feb 11, 2022 7:06:56 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r93703 r93704 101 101 USAGE_UNREGISTERVM, 102 102 USAGE_CREATEVM, 103 USAGE_MODIFYVM,104 103 USAGE_STARTVM, 105 104 USAGE_CONTROLVM, … … 274 273 #ifndef VBOX_ONLY_DOCS 275 274 void parseGroups(const char *pcszGroups, com::SafeArray<BSTR> *pGroups); 275 # ifdef VBOX_WITH_RECORDING 276 int parseScreens(const char *pcszScreens, com::SafeArray<BOOL> *pScreens); 277 # endif 276 278 #endif 277 279 RTEXITCODE handleModifyVM(HandlerArg *a); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r93561 r93704 531 531 532 532 #ifdef VBOX_WITH_RECORDING 533 staticint parseScreens(const char *pcszScreens, com::SafeArray<BOOL> *pScreens)533 int parseScreens(const char *pcszScreens, com::SafeArray<BOOL> *pScreens) 534 534 { 535 if (!RTStrICmp(pcszScreens, "all")) 536 { 537 for (uint32_t i = 0; i < pScreens->size(); i++) 538 (*pScreens)[i] = TRUE; 539 return VINF_SUCCESS; 540 } 541 if (!RTStrICmp(pcszScreens, "none")) 542 { 543 for (uint32_t i = 0; i < pScreens->size(); i++) 544 (*pScreens)[i] = FALSE; 545 return VINF_SUCCESS; 546 } 535 547 while (pcszScreens && *pcszScreens) 536 548 { … … 539 551 int rc = RTStrToUInt32Ex(pcszScreens, &pszNext, 0, &iScreen); 540 552 if (RT_FAILURE(rc)) 541 return 1;553 return VERR_PARSE_ERROR; 542 554 if (iScreen >= pScreens->size()) 543 return 1;555 return VERR_PARSE_ERROR; 544 556 if (pszNext && *pszNext) 545 557 { 546 558 pszNext = RTStrStripL(pszNext); 547 559 if (*pszNext != ',') 548 return 1;560 return VERR_PARSE_ERROR; 549 561 pszNext++; 550 562 } … … 552 564 pcszScreens = pszNext; 553 565 } 554 return 0;566 return VINF_SUCCESS; 555 567 } 556 568 #endif … … 590 602 * individually. */ 591 603 if (a->argc < 2) 592 return errorSyntax( USAGE_MODIFYVM,ModifyVM::tr("Not enough parameters"));604 return errorSyntax(ModifyVM::tr("Not enough parameters")); 593 605 594 606 /* try to find the given sessionMachine */ … … 824 836 int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX); 825 837 if (RT_FAILURE(vrc)) 826 return errorSyntax( USAGE_MODIFYVM, ModifyVM::tr("Missing or Invalid argument to '%s'"),838 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), 827 839 GetOptState.pDef->pszLong); 828 840 aValue[i] = ValueUnion.u32; … … 1941 1953 if (*ch == 0) \ 1942 1954 { \ 1943 return errorSyntax(USAGE_MODIFYVM, \ 1944 ModifyVM::tr("Missing or Invalid argument to '%s'"), \ 1945 GetOptState.pDef->pszLong); \ 1955 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), \ 1956 GetOptState.pDef->pszLong); \ 1946 1957 } \ 1947 1958 ch++; \ … … 2042 2053 vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_STRING); 2043 2054 if (RT_FAILURE(vrc)) 2044 return errorSyntax( USAGE_MODIFYVM,ModifyVM::tr("Not enough parameters"));2055 return errorSyntax(ModifyVM::tr("Not enough parameters")); 2045 2056 CHECK_ERROR(engine, RemoveRedirect(Bstr(ValueUnion.psz).raw())); 2046 2057 } … … 2334 2345 int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_STRING); 2335 2346 if (RT_FAILURE(vrc)) 2336 return errorSyntax(USAGE_MODIFYVM, 2337 ModifyVM::tr("Missing or Invalid argument to '%s'"), 2347 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), 2338 2348 GetOptState.pDef->pszLong); 2339 2349 … … 2393 2403 } 2394 2404 else 2395 return errorSyntax(USAGE_MODIFYVM, 2396 ModifyVM::tr("Invalid argument to '%s'"), 2405 return errorSyntax(ModifyVM::tr("Invalid argument to '%s'"), 2397 2406 GetOptState.pDef->pszLong); 2398 2407 break; … … 2415 2424 int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_UINT32) != MODIFYVM_UART; 2416 2425 if (RT_FAILURE(vrc)) 2417 return errorSyntax(USAGE_MODIFYVM, 2418 ModifyVM::tr("Missing or Invalid argument to '%s'"), 2426 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), 2419 2427 GetOptState.pDef->pszLong); 2420 2428 … … 2459 2467 int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_UINT32) != MODIFYVM_LPT; 2460 2468 if (RT_FAILURE(vrc)) 2461 return errorSyntax(USAGE_MODIFYVM, 2462 ModifyVM::tr("Missing or Invalid argument to '%s'"), 2469 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), 2463 2470 GetOptState.pDef->pszLong); 2464 2471 … … 2896 2903 int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_STRING); 2897 2904 if (RT_FAILURE(vrc)) 2898 return errorSyntax(USAGE_MODIFYVM, 2899 ModifyVM::tr("Missing or Invalid argument to '%s'"), 2905 return errorSyntax(ModifyVM::tr("Missing or invalid argument to '%s'"), 2900 2906 GetOptState.pDef->pszLong); 2901 2907 const char *pszNewName = ValueUnion.psz; … … 3240 3246 CHECK_ERROR(pGraphicsAdapter, COMGETTER(MonitorCount)(&cMonitors)); 3241 3247 com::SafeArray<BOOL> screens(cMonitors); 3242 if ( parseScreens(ValueUnion.psz, &screens))3248 if (RT_FAILURE(parseScreens(ValueUnion.psz, &screens))) 3243 3249 { 3244 3250 errorArgument(ModifyVM::tr("Invalid list of screens specified\n")); … … 3484 3490 3485 3491 default: 3486 errorGetOpt( USAGE_MODIFYVM,c, &ValueUnion);3492 errorGetOpt(c, &ValueUnion); 3487 3493 rc = E_FAIL; 3488 3494 break;
Note:
See TracChangeset
for help on using the changeset viewer.