VirtualBox

Changeset 72950 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Jul 7, 2018 4:31:24 PM (7 years ago)
Author:
vboxsync
Message:

MediumIOImpl.cpp: Fix gcc warnings and errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumIOImpl.cpp

    r72948 r72950  
    3131#include <iprt/fsvfs.h>
    3232#include <iprt/dvm.h>
     33#include <iprt/cpp/utils.h>
    3334
    3435
     
    4142struct MediumIO::Data
    4243{
    43     Data(Medium * const a_pMedium = NULL, bool a_fWritable = false, uint32_t a_cbSector = 512)
     44    Data(Medium * const a_pMedium, bool a_fWritable, uint32_t a_cbSector = 512)
    4445        : ptrMedium(a_pMedium)
    4546        , fWritable(a_fWritable)
    4647        , cbSector(a_cbSector)
    47         , SecretKeyStore(false /*fKeyBufNonPageable*/)
     48        , PasswordStore(false /*fKeyBufNonPageable*/)
    4849        , pHdd(NULL)
    4950        , hVfsFile(NIL_RTVFSFILE)
     
    5859    uint32_t                        cbSector;
    5960    /** Secret key store used to hold the passwords for encrypted medium. */
    60     SecretKeyStore                  SecretKeyStore;
     61    SecretKeyStore                  PasswordStore;
    6162    /** Crypto filter settings. */
    6263    MediumCryptoFilterSettings      CryptoSettings;
     
    6768    /** VFS file for the HDD instance. */
    6869    RTVFSFILE                       hVfsFile;
     70
     71private:
     72    Data() : PasswordStore(false) { }
    6973};
    7074
     
    129133        if (rStrKeyId.isNotEmpty())
    130134        {
    131             int vrc = m->SecretKeyStore.addSecretKey(rStrKeyId, (const uint8_t *)rStrPassword.c_str(),
    132                                                      rStrPassword.length() + 1 /*including the Schwarzenegger character*/);
     135            int vrc = m->PasswordStore.addSecretKey(rStrKeyId, (const uint8_t *)rStrPassword.c_str(),
     136                                                    rStrPassword.length() + 1 /*including the Schwarzenegger character*/);
    133137            if (vrc == VERR_NO_MEMORY)
    134138                hrc = setError(E_OUTOFMEMORY, tr("Failed to allocate enough secure memory for the key/password"));
     
    142146        if (SUCCEEDED(hrc))
    143147        {
    144             hrc = pMedium->i_openHddForIO(fWritable, &m->SecretKeyStore, &m->pHdd, &m->LockList, &m->CryptoSettings);
     148            hrc = pMedium->i_openHddForIO(fWritable, &m->PasswordStore, &m->pHdd, &m->LockList, &m->CryptoSettings);
    145149            if (SUCCEEDED(hrc))
    146150            {
     
    326330    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    327331    RTERRINFOSTATIC ErrInfo;
    328     int vrc = RTFsFatVolFormat(m->hVfsFile, 0, 0, a_fQuick ? RTFSFATVOL_FMT_F_QUICK : RTFSFATVOL_FMT_F_FULL, m->cbSector, 0,
    329                                RTFSFATTYPE_INVALID, 0, 0, 0, 0, 0, RTErrInfoInitStatic(&ErrInfo));
     332    int vrc = RTFsFatVolFormat(m->hVfsFile, 0, 0, a_fQuick ? RTFSFATVOL_FMT_F_QUICK : RTFSFATVOL_FMT_F_FULL,
     333                               (uint16_t)m->cbSector, 0, RTFSFATTYPE_INVALID, 0, 0, 0, 0, 0, RTErrInfoInitStatic(&ErrInfo));
    330334    alock.release();
    331335
     
    430434    m->LockList.Clear();
    431435    m->ptrMedium.setNull();
    432     m->SecretKeyStore.deleteAllSecretKeys(false /* fSuspend */, true /* fForce */);
    433 }
    434 
     436    m->PasswordStore.deleteAllSecretKeys(false /* fSuspend */, true /* fForce */);
     437}
     438
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