VirtualBox

Changeset 67228 in vbox for trunk


Ignore:
Timestamp:
Jun 2, 2017 11:10:06 AM (7 years ago)
Author:
vboxsync
Message:

IPRT: vfsprogress.cpp: adjustments

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r67222 r67228  
    24272427# define RTVfsUtilDummyPollOne                          RT_MANGLER(RTVfsUtilDummyPollOne)
    24282428# define RTVfsUtilPumpIoStreams                         RT_MANGLER(RTVfsUtilPumpIoStreams)
    2429 # define RTVfsCreateProcessForFile                      RT_MANGLER(RTVfsCreateProcessForFile)
    2430 # define RTVfsCreateProcessForIoStream                  RT_MANGLER(RTVfsCreateProcessForIoStream)
     2429# define RTVfsCreateProgressForFile                     RT_MANGLER(RTVfsCreateProgressForFile)
     2430# define RTVfsCreateProgressForIoStream                 RT_MANGLER(RTVfsCreateProgressForIoStream)
    24312431# define RTVfsCreateReadAheadForFile                    RT_MANGLER(RTVfsCreateReadAheadForFile)
    24322432# define RTVfsCreateReadAheadForIoStream                RT_MANGLER(RTVfsCreateReadAheadForIoStream)
  • trunk/include/iprt/vfs.h

    r67224 r67228  
    13121312 * @param   hVfsIos             The I/O stream to wrap.
    13131313 * @param   pfnProgress         The progress callback.  The return code is
    1314  *                              ignored by default, but can be enabled using
    1315  *                              RTVFSPROGRESS_F_ALLOW_CANCEL.
     1314 *                              ignored by default, see
     1315 *                              RTVFSPROGRESS_F_CANCELABLE.
    13161316 * @param   pvUser              The user argument to @a pfnProgress.
    13171317 * @param   fFlags              RTVFSPROGRESS_F_XXX
     
    13201320 * @param   phVfsIos            Where to return the I/O stream handle.
    13211321 */
    1322 RTDECL(int) RTVfsCreateProcessForIoStream(RTVFSIOSTREAM hVfsIos, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
    1323                                           uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSIOSTREAM phVfsIos);
     1322RTDECL(int) RTVfsCreateProgressForIoStream(RTVFSIOSTREAM hVfsIos, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
     1323                                           uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSIOSTREAM phVfsIos);
    13241324
    13251325/**
     
    13291329 * @param   hVfsFile            The file to wrap.
    13301330 * @param   pfnProgress         The progress callback.  The return code is
    1331  *                              ignored by default, but can be enabled using
    1332  *                              RTVFSPROGRESS_F_ALLOW_CANCEL.
     1331 *                              ignored by default, see
     1332 *                              RTVFSPROGRESS_F_CANCELABLE.
    13331333 * @param   pvUser              The user argument to @a pfnProgress.
    13341334 * @param   fFlags              RTVFSPROGRESS_F_XXX
     
    13371337 * @param   phVfsFile           Where to return the file handle.
    13381338 */
    1339 RTDECL(int) RTVfsCreateProcessForFile(RTVFSFILE hVfsFile, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
    1340                                       uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSFILE phVfsFile);
     1339RTDECL(int) RTVfsCreateProgressForFile(RTVFSFILE hVfsFile, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
     1340                                       uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSFILE phVfsFile);
    13411341
    13421342/** @name RTVFSPROGRESS_F_XXX - Flags for RTVfsCreateProcessForIoStream and
    13431343 *        RTVfsCreateProcessForFile.
    13441344 * @{ */
    1345 /** Allow cancellation, forcing every access to return the pfnProgress failure
    1346  * status triggering it.  The cancelation is generally delayed till the next
    1347  * operation after the cancel was seen. */
    1348 #define RTVFSPROGRESS_F_ALLOW_CANCEL            RT_BIT_32(0)
     1345/** Cancel if the callback returns a failure status code.
     1346 * This isn't default behavior because the cancelation is delayed one I/O
     1347 * operation in most cases and it's uncertain how the VFS user will handle the
     1348 * cancellation status code. */
     1349#define RTVFSPROGRESS_F_CANCELABLE             RT_BIT_32(0)
    13491350/** Account forward seeks as reads. */
    13501351#define RTVFSPROGRESS_F_FORWARD_SEEK_AS_READ    RT_BIT_32(1)
  • trunk/src/VBox/Runtime/common/vfs/vfsprogress.cpp

    r67224 r67228  
    9393
    9494    int rc = pThis->pfnProgress(uPct, pThis->pvUser);
    95     if (!(pThis->fFlags & RTVFSPROGRESS_F_ALLOW_CANCEL))
     95    if (!(pThis->fFlags & RTVFSPROGRESS_F_CANCELABLE))
    9696        rc = VINF_SUCCESS;
    9797    else if (RT_FAILURE(rc) && RT_SUCCESS(pThis->rcCanceled))
     
    447447
    448448
    449 RTDECL(int) RTVfsIoStrmCreateProgress(RTVFSIOSTREAM hVfsIos, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
    450                                       uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSIOSTREAM phVfsIos)
     449RTDECL(int) RTVfsCreateProgressForIoStream(RTVFSIOSTREAM hVfsIos, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
     450                                           uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSIOSTREAM phVfsIos)
    451451{
    452452    AssertPtrReturn(pfnProgress, VERR_INVALID_POINTER);
     
    482482
    483483
    484 RTDECL(int) RTVfsFileCreateProgress(RTVFSFILE hVfsFile, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
    485                                     uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSFILE phVfsFile)
     484RTDECL(int) RTVfsCreateProgressForFile(RTVFSFILE hVfsFile, PFNRTPROGRESS pfnProgress, void *pvUser, uint32_t fFlags,
     485                                       uint64_t cbExpectedRead, uint64_t cbExpectedWritten, PRTVFSFILE phVfsFile)
    486486{
    487487    AssertPtrReturn(pfnProgress, VERR_INVALID_POINTER);
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