VirtualBox

vbox的更動 58258 路徑 trunk/src/VBox/Storage/RAW.cpp


忽略:
時間撮記:
2015-10-15 上午10:21:38 (9 年 以前)
作者:
vboxsync
訊息:

Storage/RAW: fix conversion to raw (it previously overwrote the converted data with zeroes due to accidentally removed offAccess updating)

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Storage/RAW.cpp

    r58132 r58258  
    639639    PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    640640
     641    /* For sequential access do not allow to go back. */
     642    if (   pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL
     643        && uOffset < pImage->offAccess)
     644    {
     645        *pcbActuallyRead = 0;
     646        return VERR_INVALID_PARAMETER;
     647    }
     648
    641649    rc = vdIfIoIntFileReadUser(pImage->pIfIo, pImage->pStorage, uOffset,
    642650                               pIoCtx, cbRead);
    643651    if (RT_SUCCESS(rc))
     652    {
    644653        *pcbActuallyRead = cbRead;
     654        pImage->offAccess = uOffset + cbRead;
     655    }
    645656
    646657    return rc;
     
    655666    PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    656667
     668    /* For sequential access do not allow to go back. */
     669    if (   pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL
     670        && uOffset < pImage->offAccess)
     671    {
     672        *pcbWriteProcess = 0;
     673        *pcbPostRead = 0;
     674        *pcbPreRead  = 0;
     675        return VERR_INVALID_PARAMETER;
     676    }
     677
    657678    rc = vdIfIoIntFileWriteUser(pImage->pIfIo, pImage->pStorage, uOffset,
    658679                                pIoCtx, cbWrite, NULL, NULL);
     
    662683        *pcbPostRead = 0;
    663684        *pcbPreRead  = 0;
     685        pImage->offAccess = uOffset + cbWrite;
    664686    }
    665687
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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