VirtualBox

Changeset 20114 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 28, 2009 12:08:25 PM (16 years ago)
Author:
vboxsync
Message:

SSM: Added SSMR3Skip.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/SSM.cpp

    r18045 r20114  
    34173417
    34183418
     3419/**
     3420 * Skips a number of bytes in the current data unit.
     3421 *
     3422 * @returns VBox status code.
     3423 * @param   pSSM                The SSM handle.
     3424 * @param   cb                  The number of bytes to skip.
     3425 */
     3426VMMR3DECL(int) SSMR3Skip(PSSMHANDLE pSSM, size_t cb)
     3427{
     3428    AssertMsgReturn(   pSSM->enmOp == SSMSTATE_LOAD_EXEC
     3429                    || pSSM->enmOp == SSMSTATE_OPEN_READ,
     3430                    ("Invalid state %d\n", pSSM->enmOp),
     3431                    VERR_SSM_INVALID_STATE);
     3432    while (cb > 0)
     3433    {
     3434        uint8_t abBuf[8192];
     3435        size_t  cbCur = RT_MIN(sizeof(abBuf), cb);
     3436        cb -= cbCur;
     3437        int rc = ssmR3Read(pSSM, abBuf, cbCur);
     3438        if (RT_FAILURE(rc))
     3439            return rc;
     3440    }
     3441
     3442    return VINF_SUCCESS;
     3443}
     3444
    34193445
    34203446/**
     
    34723498/**
    34733499 * Get the current unit byte offset (uncompressed).
    3474  * 
    3475  * @returns The offset. UINT64_MAX if called at a wrong time. 
    3476  * @param   pSSM            SSM operation handle. 
     3500 *
     3501 * @returns The offset. UINT64_MAX if called at a wrong time.
     3502 * @param   pSSM            SSM operation handle.
    34773503 */
    34783504VMMR3DECL(uint64_t) SSMR3HandleGetUnitOffset(PSSMHANDLE pSSM)
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