VirtualBox

Ignore:
Timestamp:
Sep 30, 2013 7:11:56 PM (11 years ago)
Author:
vboxsync
Message:

VBoxService/GuestCtrl: Only write desired amount to guest files, debug logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r48725 r48775  
    402402        if (pFile)
    403403        {
    404             rc = RTFileWrite(pFile->hFile, pvScratchBuf, cbScratchBuf, &cbWritten);
     404            rc = RTFileWrite(pFile->hFile, pvScratchBuf, cbToWrite, &cbWritten);
     405#ifdef DEBUG
     406            VBoxServiceVerbose(4, "[File %s]: Writing pvScratchBuf=%p, cbToWrite=%RU32, cbWritten=%zu, rc=%Rrc\n",
     407                               pFile->szName, pvScratchBuf, cbToWrite, cbWritten, rc);
     408#endif
    405409        }
    406410        else
     
    447451        {
    448452            rc = RTFileWriteAt(pFile->hFile, iOffset,
    449                                pvScratchBuf, cbScratchBuf, &cbWritten);
     453                               pvScratchBuf, cbToWrite, &cbWritten);
     454#ifdef DEBUG
     455            VBoxServiceVerbose(4, "[File %s]: Writing iOffset=%RI64, pvScratchBuf=%p, cbToWrite=%RU32, cbWritten=%zu, rc=%Rrc\n",
     456                               pFile->szName, iOffset, pvScratchBuf, cbToWrite, cbWritten, rc);
     457#endif
    450458        }
    451459        else
     
    510518
    511519            if (RT_SUCCESS(rc))
     520            {
    512521                rc = RTFileSeek(pFile->hFile, (int64_t)uOffset,
    513522                                uSeekMethodIPRT, &uOffsetActual);
     523#ifdef DEBUG
     524                VBoxServiceVerbose(4, "[File %s]: Seeking to iOffset=%RI64, uSeekMethodIPRT=%RU16, rc=%Rrc\n",
     525                                   pFile->szName, (int64_t)uOffset, uSeekMethodIPRT, rc);
     526#endif
     527            }
    514528        }
    515529        else
     
    550564        {
    551565            uOffsetActual = RTFileTell(pFile->hFile);
     566#ifdef DEBUG
     567            VBoxServiceVerbose(4, "[File %s]: Telling uOffsetActual=%RU64\n",
     568                               pFile->szName, uOffsetActual);
     569#endif
    552570        }
    553571        else
Note: See TracChangeset for help on using the changeset viewer.

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