Changeset 91518 in vbox
- Timestamp:
- Oct 1, 2021 2:31:06 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 147210
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r91516 r91518 83 83 /* Start the directory process on the guest. */ 84 84 GuestProcessStartupInfo procInfo; 85 procInfo.mName = Utf8StrFmt(tr("Opening directory \"%s\""), openInfo.mPath.c_str());85 procInfo.mName.printf(tr("Opening directory \"%s\""), openInfo.mPath.c_str()); 86 86 procInfo.mTimeoutMS = 5 * 60 * 1000; /* 5 minutes timeout. */ 87 87 procInfo.mFlags = ProcessCreateFlag_WaitForStdOut; … … 236 236 237 237 Utf8Str strErr; 238 238 switch (rcGuest) 239 { 239 240 #define CASE_MSG(a_iRc, ...) \ 240 case a_iRc: strErr = Utf8StrFmt(__VA_ARGS__); break; 241 242 /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */ 243 switch (rcGuest) 244 { 241 case a_iRc: strErr.printf(__VA_ARGS__); break; 245 242 CASE_MSG(VERR_CANT_CREATE , tr("Access to guest directory \"%s\" is denied"), pcszWhat); 246 243 CASE_MSG(VERR_DIR_NOT_EMPTY, tr("Guest directory \"%s\" is not empty"), pcszWhat); 247 244 default: 248 { 249 char szDefine[80]; 250 RTErrQueryDefine(rcGuest, szDefine, sizeof(szDefine), false /*fFailIfUnknown*/); 251 strErr = Utf8StrFmt(tr("Error %s for guest directory \"%s\" occurred\n"), szDefine, pcszWhat); 245 strErr.printf(tr("Error %Rrc for guest directory \"%s\" occurred\n"), rcGuest, pcszWhat); 252 246 break; 253 }254 247 } 255 248 -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r91516 r91518 416 416 417 417 Utf8Str strErr; 418 418 switch (rcGuest) 419 { 419 420 #define CASE_MSG(a_iRc, ...) \ 420 case a_iRc: strErr = Utf8StrFmt(__VA_ARGS__); break; 421 422 /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */ 423 switch (rcGuest) 424 { 421 case a_iRc: strErr.printf(__VA_ARGS__); break; 425 422 CASE_MSG(VERR_ACCESS_DENIED , tr("Access to guest file \"%s\" denied"), pcszWhat); 426 423 CASE_MSG(VERR_ALREADY_EXISTS , tr("Guest file \"%s\" already exists"), pcszWhat); … … 429 426 CASE_MSG(VERR_SHARING_VIOLATION , tr("Sharing violation for guest file \"%s\""), pcszWhat); 430 427 default: 431 { 432 char szDefine[80]; 433 RTErrQueryDefine(rcGuest, szDefine, sizeof(szDefine), false /*fFailIfUnknown*/); 434 strErr = Utf8StrFmt(tr("Error %s for guest file \"%s\" occurred\n"), szDefine, pcszWhat); 435 break; 436 } 437 } 438 428 strErr.printf(tr("Error %Rrc for guest file \"%s\" occurred\n"), rcGuest, pcszWhat); 429 break; 439 430 #undef CASE_MSG 431 } 440 432 441 433 return strErr; -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r91517 r91518 500 500 501 501 Utf8Str strErr; 502 502 switch (rcGuest) 503 { 503 504 #define CASE_MSG(a_iRc, ...) \ 504 case a_iRc: strErr = Utf8StrFmt( __VA_ARGS__); break; 505 506 /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */ 507 switch (rcGuest) 508 { 505 case a_iRc: strErr.printf(__VA_ARGS__); break; 506 509 507 CASE_MSG(VERR_FILE_NOT_FOUND, tr("No such file or directory \"%s\" on guest"), pcszWhat); /* This is the most likely error. */ 510 508 CASE_MSG(VERR_PATH_NOT_FOUND, tr("No such file or directory \"%s\" on guest"), pcszWhat); … … 519 517 CASE_MSG(VERR_NOT_FOUND, tr("The guest execution service is not ready (yet)")); 520 518 default: 521 { 522 char szDefine[80]; 523 RTErrQueryDefine(rcGuest, szDefine, sizeof(szDefine), false /*fFailIfUnknown*/); 524 strErr = Utf8StrFmt(tr("Error %s for guest process \"%s\" occurred\n"), szDefine, pcszWhat); 525 break; 526 } 527 } 528 519 strErr.printf(tr("Error %Rrc for guest process \"%s\" occurred\n"), rcGuest, pcszWhat); 520 break; 529 521 #undef CASE_MSG 522 } 530 523 531 524 return strErr; … … 2611 2604 2612 2605 /* static */ 2613 Utf8Str GuestProcessTool::guestErrorToString(const char *pszTool, const GuestErrorInfo &guestErrorInfo)2606 Utf8Str GuestProcessTool::guestErrorToString(const char *pszTool, const GuestErrorInfo &guestErrorInfo) 2614 2607 { 2615 2608 Utf8Str strErr; … … 2619 2612 { 2620 2613 case VERR_ACCESS_DENIED: 2621 strErr = Utf8StrFmt(tr("Access to \"%s\" denied"), guestErrorInfo.getWhat().c_str());2614 strErr.printf(tr("Access to \"%s\" denied"), guestErrorInfo.getWhat().c_str()); 2622 2615 break; 2623 2616 … … 2625 2618 RT_FALL_THROUGH(); 2626 2619 case VERR_PATH_NOT_FOUND: 2627 strErr = Utf8StrFmt(tr("No such file or directory \"%s\""), guestErrorInfo.getWhat().c_str());2620 strErr.printf(tr("No such file or directory \"%s\""), guestErrorInfo.getWhat().c_str()); 2628 2621 break; 2629 2622 2630 2623 case VERR_INVALID_VM_HANDLE: 2631 strErr = Utf8StrFmt(tr("VMM device is not available (is the VM running?)"));2624 strErr.printf(tr("VMM device is not available (is the VM running?)")); 2632 2625 break; 2633 2626 2634 2627 case VERR_HGCM_SERVICE_NOT_FOUND: 2635 strErr = Utf8StrFmt(tr("The guest execution service is not available"));2628 strErr.printf(tr("The guest execution service is not available")); 2636 2629 break; 2637 2630 2638 2631 case VERR_BAD_EXE_FORMAT: 2639 strErr = Utf8StrFmt(tr("The file \"%s\" is not an executable format"), 2640 guestErrorInfo.getWhat().c_str()); 2632 strErr.printf(tr("The file \"%s\" is not an executable format"), guestErrorInfo.getWhat().c_str()); 2641 2633 break; 2642 2634 2643 2635 case VERR_AUTHENTICATION_FAILURE: 2644 strErr = Utf8StrFmt(tr("The user \"%s\" was not able to logon"), guestErrorInfo.getWhat().c_str());2636 strErr.printf(tr("The user \"%s\" was not able to logon"), guestErrorInfo.getWhat().c_str()); 2645 2637 break; 2646 2638 2647 2639 case VERR_INVALID_NAME: 2648 strErr = Utf8StrFmt(tr("The file \"%s\" is an invalid name"), guestErrorInfo.getWhat().c_str());2640 strErr.printf(tr("The file \"%s\" is an invalid name"), guestErrorInfo.getWhat().c_str()); 2649 2641 break; 2650 2642 2651 2643 case VERR_TIMEOUT: 2652 strErr = Utf8StrFmt(tr("The guest did not respond within time"));2644 strErr.printf(tr("The guest did not respond within time")); 2653 2645 break; 2654 2646 2655 2647 case VERR_CANCELLED: 2656 strErr = Utf8StrFmt(tr("The execution operation was canceled"));2648 strErr.printf(tr("The execution operation was canceled")); 2657 2649 break; 2658 2650 2659 2651 case VERR_GSTCTL_MAX_CID_OBJECTS_REACHED: 2660 strErr = Utf8StrFmt(tr("Maximum number of concurrent guest processes has been reached"));2652 strErr.printf(tr("Maximum number of concurrent guest processes has been reached")); 2661 2653 break; 2662 2654 2663 2655 case VERR_NOT_FOUND: 2664 strErr = Utf8StrFmt(tr("The guest execution service is not ready (yet)"));2656 strErr.printf(tr("The guest execution service is not ready (yet)")); 2665 2657 break; 2666 2658 2667 2659 default: 2668 strErr = Utf8StrFmt(tr("Unhandled error %Rrc for \"%s\" occurred for tool \"%s\" on guest -- please file a bug report"),2669 2660 strErr.printf(tr("Unhandled error %Rrc for \"%s\" occurred for tool \"%s\" on guest -- please file a bug report"), 2661 guestErrorInfo.getRc(), guestErrorInfo.getWhat().c_str(), pszTool); 2670 2662 break; 2671 2663 }
Note:
See TracChangeset
for help on using the changeset viewer.