VirtualBox

Changeset 107662 in vbox


Ignore:
Timestamp:
Jan 10, 2025 3:01:24 PM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166754
Message:

src/VBox/Main/src-client/GuestSessionImplTasks.cpp: Fixed warnings found by Parfait (change of signedness on implicit conversion). Also fixes VFS seeking when copying a file to the guest (unused so far). Needs backport. jiraref:VBP-1424

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r107585 r107662  
    718718 * @param  fileDst            Guest file (destination) to copy to the guest. Must be in opened and ready state already.
    719719 * @param  fFileCopyFlags     File copy flags.
    720  * @param  offCopy            Offset (in bytes) where to start copying the source file.
     720 * @param  offCopy            Absolute offset (in bytes) where to start reading from the source file.
     721 *                            Set to UINT64_MAX to read following chunk at the current VFS file read position.
     722 *                            Set to 0 to rewind reading the file.
    721723 * @param  cbSize             Size (in bytes) to copy from the source file.
    722724 */
     
    736738    int vrc = VINF_SUCCESS;
    737739
    738     if (offCopy)
     740    if (offCopy != UINT64_MAX)
    739741    {
    740742        uint64_t offActual;
    741         vrc = RTVfsFileSeek(hVfsFile, offCopy, RTFILE_SEEK_END, &offActual);
     743        vrc = RTVfsFileSeek(hVfsFile, (RTFOFF)offCopy, RTFILE_SEEK_BEGIN, &offActual);
    742744        if (RT_FAILURE(vrc))
    743745        {
    744746            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    745                                 Utf8StrFmt(tr("Seeking to offset %RU64 of host file \"%s\" failed: %Rrc"),
    746                                            offCopy, strSrcFile.c_str(), vrc));
     747                                Utf8StrFmt(tr("Seeking to offset %RU64 (%#x) of host file \"%s\" failed: %Rrc"),
     748                                           offCopy, offCopy, strSrcFile.c_str(), vrc));
    747749            return vrc;
    748750        }
     
    963965
    964966            vrc = fileCopyToGuestInner(szSrcReal, hSrcFile, strDst, dstFile,
    965                                        fFileCopyFlags, 0 /* Offset, unused */, srcObjInfo.cbObject);
     967                                       fFileCopyFlags, UINT64_MAX /* Offset, unused */, srcObjInfo.cbObject);
    966968
    967969            int vrc2 = RTVfsFileRelease(hSrcFile);
     
    26722674            else
    26732675            {
    2674                 vrc = fileCopyToGuestInner(strFileSrc, hVfsFile, strFileDst, dstFile, FileCopyFlag_None, 0 /*offCopy*/, cbSrcSize);
     2676                vrc = fileCopyToGuestInner(strFileSrc, hVfsFile, strFileDst, dstFile, FileCopyFlag_None,
     2677                                           UINT64_MAX /* Offset, unused */, cbSrcSize);
    26752678
    26762679                int vrc2 = fileClose(dstFile);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette