Changeset 84648 in vbox for trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
- Timestamp:
- Jun 3, 2020 8:11:04 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138400
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r84551 r84648 193 193 } 194 194 195 /** 196 * Sets the task's progress object to an error using a string message. 197 * 198 * @returns Returns \a hr for covenience. 199 * @param hr Progress operation result to set. 200 * @param strMsg Message to set. 201 */ 195 202 HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg) 196 203 { 197 LogFlowFunc(("hr=%Rhrc, strMsg=%s\n", 198 hr, strMsg.c_str())); 204 LogFlowFunc(("hr=%Rhrc, strMsg=%s\n", hr, strMsg.c_str())); 199 205 200 206 if (mProgress.isNull()) /* Progress is optional. */ … … 218 224 } 219 225 220 HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hrc, int vrc, const char *pszFormat, ...) 221 { 222 LogFlowFunc(("hrc=%Rhrc, vrc=%Rrc, pszFormat=%s\n", hrc, vrc, pszFormat)); 223 224 /* The progress object is optional. */ 225 if (!mProgress.isNull()) 226 { 227 BOOL fCanceled; 228 BOOL fCompleted; 229 if ( SUCCEEDED(mProgress->COMGETTER(Canceled(&fCanceled))) 230 && !fCanceled 231 && SUCCEEDED(mProgress->COMGETTER(Completed(&fCompleted))) 232 && !fCompleted) 233 { 234 va_list va; 235 va_start(va, pszFormat); 236 HRESULT hrc2 = mProgress->i_notifyCompleteBothV(hrc, vrc, COM_IIDOF(IGuestSession), 237 GuestSession::getStaticComponentName(), pszFormat, va); 238 va_end(va); 239 if (FAILED(hrc2)) 240 hrc = hrc2; 241 } 242 } 243 return hrc; 226 /** 227 * Sets the task's progress object to an error using a string message and a guest error info object. 228 * 229 * @returns Returns \a hr for covenience. 230 * @param hr Progress operation result to set. 231 * @param strMsg Message to set. 232 * @param guestErrorInfo Guest error info to use. 233 */ 234 HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg, const GuestErrorInfo &guestErrorInfo) 235 { 236 return setProgressErrorMsg(hr, strMsg + Utf8Str(": ") + GuestBase::getErrorAsString(guestErrorInfo)); 244 237 } 245 238 … … 353 346 * 354 347 * @return VBox status code. 348 * @param strSrcFile Full path of source file on the host to copy. 355 349 * @param srcFile Guest file (source) to copy to the host. Must be in opened and ready state already. 350 * @param strDstFile Full destination path and file name (guest style) to copy file to. 356 351 * @param phDstFile Pointer to host file handle (destination) to copy to. Must be in opened and ready state already. 357 352 * @param fFileCopyFlags File copy flags. … … 359 354 * @param cbSize Size (in bytes) to copy from the source file. 360 355 */ 361 int GuestSessionTask::fileCopyFromGuestInner(ComObjPtr<GuestFile> &srcFile, PRTFILE phDstFile, FileCopyFlag_T fFileCopyFlags, 362 uint64_t offCopy, uint64_t cbSize) 356 int GuestSessionTask::fileCopyFromGuestInner(const Utf8Str &strSrcFile, ComObjPtr<GuestFile> &srcFile, 357 const Utf8Str &strDstFile, PRTFILE phDstFile, 358 FileCopyFlag_T fFileCopyFlags, uint64_t offCopy, uint64_t cbSize) 363 359 { 364 360 RT_NOREF(fFileCopyFlags); … … 379 375 { 380 376 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 381 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 failed: %Rrc"), offCopy, rc)); 377 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 of guest file \"%s\" failed: %Rrc"), 378 offCopy, strSrcFile.c_str(), rc)); 382 379 return rc; 383 380 } … … 393 390 { 394 391 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 395 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from guest failed: %Rrc"), cbChunk, cbWrittenTotal, rc)); 392 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from guest \"%s\" failed: %Rrc"), 393 cbChunk, cbWrittenTotal, strSrcFile.c_str(), rc)); 396 394 break; 397 395 } … … 401 399 { 402 400 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 403 Utf8StrFmt(GuestSession::tr("Writing %RU32 bytes to file on host failed: %Rrc"), cbRead, rc)); 401 Utf8StrFmt(GuestSession::tr("Writing %RU32 bytes to host file \"%s\" failed: %Rrc"), 402 cbRead, strDstFile.c_str(), rc)); 404 403 break; 405 404 } … … 439 438 * to the destination -> access denied. */ 440 439 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 441 Utf8StrFmt(GuestSession::tr("Writing guest file to host failed: Access denied"))); 440 Utf8StrFmt(GuestSession::tr("Writing guest file \"%s\" to host file \"%s\" failed: Access denied"), 441 strSrcFile.c_str(), strDstFile.c_str())); 442 442 rc = VERR_ACCESS_DENIED; 443 443 } … … 446 446 /* If we did not copy all let the user know. */ 447 447 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 448 Utf8StrFmt(GuestSession::tr("Copying guest file to host tofailed (%RU64/%RU64 bytes transfered)"),449 cbWrittenTotal, cbSize));448 Utf8StrFmt(GuestSession::tr("Copying guest file \"%s\" to host file \"%s\" failed (%RU64/%RU64 bytes transfered)"), 449 strSrcFile.c_str(), strDstFile.c_str(), cbWrittenTotal, cbSize)); 450 450 rc = VERR_INTERRUPTED; 451 451 } … … 463 463 * @param fFileCopyFlags File copy flags. 464 464 */ 465 int GuestSessionTask::fileCopyFromGuest(const Utf8Str &strS ource, const Utf8Str &strDest, FileCopyFlag_T fFileCopyFlags)466 { 467 LogFlowThisFunc(("strSource=%s, strDest=%s, enmFileCopyFlags=0x%x\n", strS ource.c_str(), strDest.c_str(), fFileCopyFlags));465 int GuestSessionTask::fileCopyFromGuest(const Utf8Str &strSrc, const Utf8Str &strDest, FileCopyFlag_T fFileCopyFlags) 466 { 467 LogFlowThisFunc(("strSource=%s, strDest=%s, enmFileCopyFlags=0x%x\n", strSrc.c_str(), strDest.c_str(), fFileCopyFlags)); 468 468 469 469 GuestFileOpenInfo srcOpenInfo; 470 srcOpenInfo.mFilename = strS ource;470 srcOpenInfo.mFilename = strSrc; 471 471 srcOpenInfo.mOpenAction = FileOpenAction_OpenExisting; 472 472 srcOpenInfo.mAccessMode = FileAccessMode_ReadOnly; … … 477 477 GuestFsObjData srcObjData; 478 478 int rcGuest = VERR_IPE_UNINITIALIZED_STATUS; 479 int rc = mSession->i_fsQueryInfo(strS ource, TRUE /* fFollowSymlinks */, srcObjData, &rcGuest);479 int rc = mSession->i_fsQueryInfo(strSrc, TRUE /* fFollowSymlinks */, srcObjData, &rcGuest); 480 480 if (RT_FAILURE(rc)) 481 481 { 482 switch (rc) 483 { 484 case VERR_GSTCTL_GUEST_ERROR: 485 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest)); 482 if (rc == VERR_GSTCTL_GUEST_ERROR) 483 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file lookup failed"), 484 GuestErrorInfo(GuestErrorInfo::Type_ToolStat, rcGuest, strSrc.c_str())); 485 else 486 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 487 Utf8StrFmt(GuestSession::tr("Guest file lookup for \"%s\" failed: %Rrc"), strSrc.c_str(), rc)); 488 } 489 else 490 { 491 switch (srcObjData.mType) 492 { 493 case FsObjType_File: 494 break; 495 496 case FsObjType_Symlink: 497 if (!(fFileCopyFlags & FileCopyFlag_FollowLinks)) 498 { 499 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 500 Utf8StrFmt(GuestSession::tr("Guest file \"%s\" is a symbolic link"), 501 strSrc.c_str())); 502 rc = VERR_IS_A_SYMLINK; 503 } 486 504 break; 487 505 488 506 default: 489 507 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 490 Utf8StrFmt(GuestSession::tr("Source file lookup for \"%s\" failed: %Rrc"), 491 strSource.c_str(), rc)); 492 break; 493 } 494 } 495 else 496 { 497 switch (srcObjData.mType) 498 { 499 case FsObjType_File: 500 break; 501 502 case FsObjType_Symlink: 503 if (!(fFileCopyFlags & FileCopyFlag_FollowLinks)) 504 { 505 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 506 Utf8StrFmt(GuestSession::tr("Source file \"%s\" is a symbolic link"), 507 strSource.c_str(), rc)); 508 rc = VERR_IS_A_SYMLINK; 509 } 510 break; 511 512 default: 513 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 514 Utf8StrFmt(GuestSession::tr("Source element \"%s\" is not a file"), strSource.c_str())); 508 Utf8StrFmt(GuestSession::tr("Guest object \"%s\" is not a file"), strSrc.c_str())); 515 509 rc = VERR_NOT_A_FILE; 516 510 break; … … 524 518 if (RT_FAILURE(rc)) 525 519 { 526 switch (rc) 527 { 528 case VERR_GSTCTL_GUEST_ERROR: 529 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest)); 530 break; 531 532 default: 533 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 534 Utf8StrFmt(GuestSession::tr("Source file \"%s\" could not be opened: %Rrc"), 535 strSource.c_str(), rc)); 536 break; 537 } 520 if (rc == VERR_GSTCTL_GUEST_ERROR) 521 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file could not be opened"), 522 GuestErrorInfo(GuestErrorInfo::Type_File, rcGuest, strSrc.c_str())); 523 else 524 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 525 Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"), strSrc.c_str(), rc)); 538 526 } 539 527 … … 555 543 { 556 544 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 557 Utf8StrFmt(GuestSession::tr(" Destinationfile \"%s\" already exists"), strDest.c_str()));545 Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str())); 558 546 rc = VERR_ALREADY_EXISTS; 559 547 } … … 566 554 { 567 555 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 568 Utf8StrFmt(GuestSession::tr(" Destinationfile \"%s\" has same or newer modification date"),556 Utf8StrFmt(GuestSession::tr("Host file \"%s\" has same or newer modification date"), 569 557 strDest.c_str())); 570 558 fSkip = true; … … 576 564 if (rc != VERR_FILE_NOT_FOUND) /* Destination file does not exist (yet)? */ 577 565 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 578 Utf8StrFmt(GuestSession::tr(" Destinationfile lookup for \"%s\" failed: %Rrc"),566 Utf8StrFmt(GuestSession::tr("Host file lookup for \"%s\" failed: %Rrc"), 579 567 strDest.c_str(), rc)); 580 568 } … … 595 583 { 596 584 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 597 Utf8StrFmt(GuestSession::tr("Destination file \"%s\" already exists"), 598 strDest.c_str(), rc)); 585 Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str())); 599 586 rc = VERR_ALREADY_EXISTS; 600 587 } … … 612 599 RTPathAppend(szDstPath, sizeof(szDstPath), "/"); /* IPRT can handle / on all hosts. */ 613 600 614 RTPathAppend(szDstPath, sizeof(szDstPath), RTPathFilenameEx(strS ource.c_str(), mfPathStyle));601 RTPathAppend(szDstPath, sizeof(szDstPath), RTPathFilenameEx(strSrc.c_str(), mfPathStyle)); 615 602 616 603 pszDstFile = RTStrDup(szDstPath); … … 621 608 { 622 609 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 623 Utf8StrFmt(GuestSession::tr(" Destinationfile \"%s\" is a symbolic link"),624 strDest.c_str() , rc));610 Utf8StrFmt(GuestSession::tr("Host file \"%s\" is a symbolic link"), 611 strDest.c_str())); 625 612 rc = VERR_IS_A_SYMLINK; 626 613 } … … 652 639 if (RT_SUCCESS(rc)) 653 640 { 654 LogFlowThisFunc(("Copying '%s' to '%s' (%RI64 bytes) ...\n", strSource.c_str(), pszDstFile, srcObjData.mObjectSize)); 655 656 rc = fileCopyFromGuestInner(srcFile, &hDstFile, fFileCopyFlags, 0 /* Offset, unused */, (uint64_t)srcObjData.mObjectSize); 641 LogFlowThisFunc(("Copying '%s' to '%s' (%RI64 bytes) ...\n", 642 strSrc.c_str(), pszDstFile, srcObjData.mObjectSize)); 643 644 rc = fileCopyFromGuestInner(strSrc, srcFile, pszDstFile, &hDstFile, fFileCopyFlags, 645 0 /* Offset, unused */, (uint64_t)srcObjData.mObjectSize); 657 646 658 647 int rc2 = RTFileClose(hDstFile); … … 661 650 else 662 651 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 663 Utf8StrFmt(GuestSession::tr("Opening/creating destinationfile \"%s\" failed: %Rrc"),652 Utf8StrFmt(GuestSession::tr("Opening/creating host file \"%s\" failed: %Rrc"), 664 653 pszDstFile, rc)); 665 654 } … … 679 668 * 680 669 * @return VBox status code. 670 * @param strSrcFile Full path of source file on the host to copy. 681 671 * @param hVfsFile The VFS file handle to read from. 682 * @param dstFile Guest file (destination) to copy to the guest. Must be in opened and ready state already. 672 * @param strDstFile Full destination path and file name (guest style) to copy file to. 673 * @param fileDst Guest file (destination) to copy to the guest. Must be in opened and ready state already. 683 674 * @param fFileCopyFlags File copy flags. 684 675 * @param offCopy Offset (in bytes) where to start copying the source file. 685 676 * @param cbSize Size (in bytes) to copy from the source file. 686 677 */ 687 int GuestSessionTask::fileCopyToGuestInner(RTVFSFILE hVfsFile, ComObjPtr<GuestFile> &dstFile, FileCopyFlag_T fFileCopyFlags, 688 uint64_t offCopy, uint64_t cbSize) 678 int GuestSessionTask::fileCopyToGuestInner(const Utf8Str &strSrcFile, RTVFSFILE hVfsFile, 679 const Utf8Str &strDstFile, ComObjPtr<GuestFile> &fileDst, 680 FileCopyFlag_T fFileCopyFlags, uint64_t offCopy, uint64_t cbSize) 689 681 { 690 682 RT_NOREF(fFileCopyFlags); … … 705 697 { 706 698 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 707 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 failed: %Rrc"), offCopy, rc)); 699 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 of host file \"%s\" failed: %Rrc"), 700 offCopy, strSrcFile.c_str(), rc)); 708 701 return rc; 709 702 } … … 719 712 { 720 713 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 721 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from host failed: %Rrc"), cbChunk, cbWrittenTotal, rc)); 714 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from host file \"%s\" failed: %Rrc"), 715 cbChunk, cbWrittenTotal, strSrcFile.c_str(), rc)); 722 716 break; 723 717 } 724 718 725 rc = dstFile->i_writeData(uTimeoutMs, byBuf, (uint32_t)cbRead, NULL /* No partial writes */);719 rc = fileDst->i_writeData(uTimeoutMs, byBuf, (uint32_t)cbRead, NULL /* No partial writes */); 726 720 if (RT_FAILURE(rc)) 727 721 { 728 722 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 729 Utf8StrFmt(GuestSession::tr("Writing %zu bytes to file on guest failed: %Rrc"), cbRead, rc)); 723 Utf8StrFmt(GuestSession::tr("Writing %zu bytes to guest file \"%s\" failed: %Rrc"), 724 cbRead, strDstFile.c_str(), rc)); 730 725 break; 731 726 } … … 761 756 * to the destination -> access denied. */ 762 757 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 763 Utf8StrFmt(GuestSession::tr("Writing to destination file failed: Access denied"))); 758 Utf8StrFmt(GuestSession::tr("Writing to guest file \"%s\" failed: Access denied"), 759 strDstFile.c_str())); 764 760 rc = VERR_ACCESS_DENIED; 765 761 } … … 768 764 /* If we did not copy all let the user know. */ 769 765 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 770 Utf8StrFmt(GuestSession::tr("Copying to destinationfailed (%RU64/%RU64 bytes transfered)"),771 cbWrittenTotal, cbSize));766 Utf8StrFmt(GuestSession::tr("Copying to guest file \"%s\" failed (%RU64/%RU64 bytes transfered)"), 767 strDstFile.c_str(), cbWrittenTotal, cbSize)); 772 768 rc = VERR_INTERRUPTED; 773 769 } … … 805 801 if (RT_FAILURE(rc)) 806 802 { 807 setProgressErrorMsg(VBOX_E_IPRT_ERROR, rc == VERR_GSTCTL_GUEST_ERROR ? rcGuest : rc, 808 GuestSession::tr("Destination file \"%s\" could not be opened: %Rrc"), 809 strDstFinal.c_str(), rc == VERR_GSTCTL_GUEST_ERROR ? rcGuest : rc); 803 if (rc == VERR_GSTCTL_GUEST_ERROR) 804 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file could not be opened"), 805 GuestErrorInfo(GuestErrorInfo::Type_File, rcGuest, strSrc.c_str())); 806 else 807 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 808 Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"), strSrc.c_str(), rc)); 810 809 return rc; 811 810 } … … 824 823 { 825 824 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 826 Utf8StrFmt(GuestSession::tr(" Source path lookup for\"%s\" failed: %Rrc"),825 Utf8StrFmt(GuestSession::tr("Host path lookup for file \"%s\" failed: %Rrc"), 827 826 strSrc.c_str(), rc)); 828 827 } … … 843 842 if (RTTimeSpecCompare(&dstModificationTimeTS, &srcObjInfo.ModificationTime) <= 0) 844 843 { 845 LogRel2(("Guest Control: Destinationfile \"%s\" has same or newer modification date, skipping",844 LogRel2(("Guest Control: Guest file \"%s\" has same or newer modification date, skipping", 846 845 strDstFinal.c_str())); 847 846 fSkip = true; … … 875 874 { 876 875 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 877 Utf8StrFmt(GuestSession::tr(" Sourcefile lookup for \"%s\" failed: %Rrc"),876 Utf8StrFmt(GuestSession::tr("Host file lookup for \"%s\" failed: %Rrc"), 878 877 szSrcReal, rc)); 879 878 } … … 897 896 szSrcReal, strDstFinal.c_str(), srcObjInfo.cbObject)); 898 897 899 rc = fileCopyToGuestInner(hSrcFile, dstFile, fFileCopyFlags, 0 /* Offset, unused */, srcObjInfo.cbObject); 898 rc = fileCopyToGuestInner(szSrcReal, hSrcFile, strDstFinal, dstFile, 899 fFileCopyFlags, 0 /* Offset, unused */, srcObjInfo.cbObject); 900 900 901 901 int rc2 = RTVfsFileRelease(hSrcFile); … … 904 904 else 905 905 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 906 Utf8StrFmt(GuestSession::tr("Opening sourcefile \"%s\" failed: %Rrc"),906 Utf8StrFmt(GuestSession::tr("Opening host file \"%s\" failed: %Rrc"), 907 907 szSrcReal, rc)); 908 908 } … … 1531 1531 if (strErrorInfo.isEmpty()) 1532 1532 strErrorInfo = Utf8StrFmt(GuestSession::tr("Failed with %Rrc"), vrc); 1533 setProgressErrorMsg(VBOX_E_IPRT_ERROR, vrc, "%s", strErrorInfo.c_str());1533 setProgressErrorMsg(VBOX_E_IPRT_ERROR, strErrorInfo); 1534 1534 } 1535 1535 … … 2030 2030 2031 2031 int GuestSessionTaskUpdateAdditions::copyFileToGuest(GuestSession *pSession, RTVFS hVfsIso, 2032 Utf8Str const &strFileS ource, const Utf8Str &strFileDest,2032 Utf8Str const &strFileSrc, const Utf8Str &strFileDst, 2033 2033 bool fOptional) 2034 2034 { … … 2037 2037 2038 2038 RTVFSFILE hVfsFile = NIL_RTVFSFILE; 2039 int rc = RTVfsFileOpen(hVfsIso, strFileS ource.c_str(),2039 int rc = RTVfsFileOpen(hVfsIso, strFileSrc.c_str(), 2040 2040 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, & hVfsFile); 2041 2041 if (RT_SUCCESS(rc)) … … 2046 2046 { 2047 2047 LogRel(("Copying Guest Additions installer file \"%s\" to \"%s\" on guest ...\n", 2048 strFileS ource.c_str(), strFileDest.c_str()));2048 strFileSrc.c_str(), strFileDst.c_str())); 2049 2049 2050 2050 GuestFileOpenInfo dstOpenInfo; 2051 dstOpenInfo.mFilename = strFileD est;2051 dstOpenInfo.mFilename = strFileDst; 2052 2052 dstOpenInfo.mOpenAction = FileOpenAction_CreateOrReplace; 2053 2053 dstOpenInfo.mAccessMode = FileAccessMode_WriteOnly; … … 2062 2062 { 2063 2063 case VERR_GSTCTL_GUEST_ERROR: 2064 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest ));2064 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest, strFileDst.c_str())); 2065 2065 break; 2066 2066 2067 2067 default: 2068 2068 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 2069 Utf8StrFmt(GuestSession::tr(" Destinationfile \"%s\" could not be opened: %Rrc"),2070 strFileD est.c_str(), rc));2069 Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"), 2070 strFileDst.c_str(), rc)); 2071 2071 break; 2072 2072 } … … 2074 2074 else 2075 2075 { 2076 rc = fileCopyToGuestInner(hVfsFile, dstFile, FileCopyFlag_None, 0 /*cbOffset*/, cbSrcSize); 2076 rc = fileCopyToGuestInner(strFileSrc, hVfsFile, strFileDst, dstFile, 2077 FileCopyFlag_None, 0 /*cbOffset*/, cbSrcSize); 2077 2078 2078 2079 int rc2 = dstFile->i_closeFile(&rcGuest); … … 2124 2125 2125 2126 case VERR_GSTCTL_GUEST_ERROR: 2126 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest)); 2127 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Running update file on guest failed"), 2128 GuestErrorInfo(GuestErrorInfo::Type_Process, rcGuest, procInfo.mExecutable.c_str())); 2127 2129 break; 2128 2130 … … 2388 2390 { 2389 2391 case VERR_GSTCTL_GUEST_ERROR: 2390 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest)); 2392 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Creating installation directory on guest failed"), 2393 GuestErrorInfo(GuestErrorInfo::Type_Directory, rcGuest, strUpdateDir.c_str())); 2391 2394 break; 2392 2395 2393 2396 default: 2394 2397 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, 2395 Utf8StrFmt(GuestSession::tr(" Error creating installation directory \"%s\" on the guest: %Rrc"),2398 Utf8StrFmt(GuestSession::tr("Creating installation directory \"%s\" on guest failed: %Rrc"), 2396 2399 strUpdateDir.c_str(), rc)); 2397 2400 break;
Note:
See TracChangeset
for help on using the changeset viewer.