VirtualBox

Changeset 45600 in vbox


Ignore:
Timestamp:
Apr 18, 2013 9:58:31 AM (12 years ago)
Author:
vboxsync
Message:

ApplianceImplExport.cpp: Added check for pAudioAdapter->COMGETTER(Enabled) result. Removed unused Bstr variables (confusing). Moved variables to where they are used.

File:
1 edited

Legend:

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

    r45367 r45600  
    8787        pNewDesc->m->pMachine = this;
    8888
    89         // now fill it with description items
    90         Bstr bstrName1;
    91         Bstr bstrDescription;
    92         Bstr bstrGuestOSType;
    93         uint32_t cCPUs;
    94         uint32_t ulMemSizeMB;
     89        // first, call the COM methods, as they request locks
     90        ComPtr<IUSBController> pUsbController;
     91        rc = COMGETTER(USBController)(pUsbController.asOutParam());
    9592        BOOL fUSBEnabled;
    96         BOOL fAudioEnabled;
    97         AudioControllerType_T audioController;
    98 
    99         ComPtr<IUSBController> pUsbController;
    100         ComPtr<IAudioAdapter> pAudioAdapter;
    101 
    102         // first, call the COM methods, as they request locks
    103         rc = COMGETTER(USBController)(pUsbController.asOutParam());
    10493        if (FAILED(rc))
    10594            fUSBEnabled = false;
    10695        else
     96        {
    10797            rc = pUsbController->COMGETTER(Enabled)(&fUSBEnabled);
     98            if (FAILED(rc)) throw rc;
     99        }
    108100
    109101        // request the machine lock while accessing internal members
    110102        AutoReadLock alock1(this COMMA_LOCKVAL_SRC_POS);
    111103
    112         pAudioAdapter = mAudioAdapter;
     104        ComPtr<IAudioAdapter> pAudioAdapter = mAudioAdapter;
     105        BOOL fAudioEnabled;
    113106        rc = pAudioAdapter->COMGETTER(Enabled)(&fAudioEnabled);
    114107        if (FAILED(rc)) throw rc;
     108        AudioControllerType_T audioController;
    115109        rc = pAudioAdapter->COMGETTER(AudioController)(&audioController);
    116110        if (FAILED(rc)) throw rc;
     
    123117        Utf8Str strOsTypeVBox = mUserData->s.strOsType;
    124118        // CPU count
    125         cCPUs = mHWData->mCPUCount;
     119        uint32_t cCPUs = mHWData->mCPUCount;
    126120        // memory size in MB
    127         ulMemSizeMB = mHWData->mMemorySize;
     121        uint32_t ulMemSizeMB = mHWData->mMemorySize;
    128122        // VRAM size?
    129123        // BIOS settings?
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