VirtualBox

Changeset 49231 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 22, 2013 2:38:45 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90133
Message:

VMDK: Sketched the code for using RTZipBlockDecompress in vmdkFileInflateSync.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VMDK.cpp

    r49039 r49231  
    639639}
    640640
     641/*#define VMDK_USE_BLOCK_DECOMP_API - test and enable */
     642#ifndef VMDK_USE_BLOCK_DECOMP_API
    641643static DECLCALLBACK(int) vmdkFileInflateHelper(void *pvUser, void *pvBuf, size_t cbBuf, size_t *pcbBuf)
    642644{
     
    668670    return VINF_SUCCESS;
    669671}
     672#endif
    670673
    671674/**
     
    679682{
    680683    int rc;
     684#ifndef VMDK_USE_BLOCK_DECOMP_API
    681685    PRTZIPDECOMP pZip = NULL;
     686#endif
    682687    VMDKMARKER *pMarker = (VMDKMARKER *)pExtent->pvCompGrain;
    683688    size_t cbCompSize, cbActuallyRead;
     
    727732                                  512);
    728733
     734#ifdef VMDK_USE_BLOCK_DECOMP_API
     735    rc = RTZipBlockDecompress(RTZIPTYPE_ZLIB, 0 /*fFlags*/,
     736                              pExtent->pvCompGrain, cbCompSize + RT_OFFSETOF(VMDKMARKER, uType), NULL,
     737                              pvBuf, cbToRead, &cbActuallyRead);
     738#else
    729739    VMDKCOMPRESSIO InflateState;
    730740    InflateState.pImage = pImage;
     
    738748    rc = RTZipDecompress(pZip, pvBuf, cbToRead, &cbActuallyRead);
    739749    RTZipDecompDestroy(pZip);
     750#endif /* !VMDK_USE_BLOCK_DECOMP_API */
    740751    if (RT_FAILURE(rc))
    741752    {
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