VirtualBox

Changeset 21686 in vbox


Ignore:
Timestamp:
Jul 17, 2009 1:41:39 PM (16 years ago)
Author:
vboxsync
Message:

Main: back out r50147 until the locking is properly understood; will come back.

Location:
trunk/src/VBox/Main
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r21622 r21686  
    345345void Appliance::uninit()
    346346{
    347     /* Enclose the state transition Ready->InUninit->NotReady */
    348     AutoUninitSpan autoUninitSpan (this);
    349     if (autoUninitSpan.uninitDone())
    350         return;
    351 
    352347    delete m;
    353348    m = NULL;
  • trunk/src/VBox/Main/HostImpl.cpp

    r21622 r21686  
    152152void Host::FinalRelease()
    153153{
    154     uninit();
     154    if (isReady())
     155        uninit();
    155156}
    156157
     
    163164 * @param aParent   VirtualBox parent object.
    164165 */
    165 HRESULT Host::init(VirtualBox *aParent)
    166 {
    167     LogFlowThisFunc (("aParent=%p\n", aParent));
    168 
    169     /* Enclose the state transition NotReady->InInit->Ready */
    170     AutoInitSpan autoInitSpan (this);
    171     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     166HRESULT Host::init (VirtualBox *aParent)
     167{
     168    LogFlowThisFunc (("isReady=%d\n", isReady()));
     169
     170    ComAssertRet (aParent, E_INVALIDARG);
     171
     172    AutoWriteLock alock (this);
     173    ComAssertRet (!isReady(), E_FAIL);
    172174
    173175    mParent = aParent;
     
    258260#endif /* VBOX_WITH_CROGL */
    259261
    260     /* Confirm a successful initialization */
    261     autoInitSpan.setSucceeded();
    262 
     262    setReady(true);
    263263    return S_OK;
    264264}
     
    270270void Host::uninit()
    271271{
    272     LogFlowThisFunc (("\n"));
    273 
    274     /* Enclose the state transition Ready->InUninit->NotReady */
    275     AutoUninitSpan autoUninitSpan (this);
    276     if (autoUninitSpan.uninitDone())
    277         return;
     272    LogFlowThisFunc (("isReady=%d\n", isReady()));
     273
     274    AssertReturn (isReady(), (void) 0);
    278275
    279276#ifdef VBOX_WITH_RESOURCE_USAGE_API
     
    298295    mUSBDeviceFilters.clear();
    299296#endif
     297
     298    setReady (FALSE);
    300299}
    301300
     
    312311{
    313312    CheckComArgOutSafeArrayPointerValid(aDrives);
    314 
    315     AutoCaller autoCaller (this);
    316     CheckComRCReturnRC (autoCaller.rc());
    317 
    318     AutoWriteLock alock (this);
    319 
    320     std::list< ComObjPtr<HostDVDDrive> > list;
     313    AutoWriteLock alock (this);
     314    CHECK_READY();
     315    std::list <ComObjPtr <HostDVDDrive> > list;
    321316    HRESULT rc = S_OK;
    322317    try
     
    444439{
    445440    CheckComArgOutPointerValid(aDrives);
    446 
    447     AutoCaller autoCaller(this);
    448     CheckComRCReturnRC(autoCaller.rc());
    449 
    450     AutoWriteLock alock(this);
    451 
    452     std::list<ComObjPtr <HostFloppyDrive> > list;
     441    AutoWriteLock alock (this);
     442    CHECK_READY();
     443
     444    std::list <ComObjPtr <HostFloppyDrive> > list;
    453445    HRESULT rc = S_OK;
    454446
     
    562554        return E_POINTER;
    563555
    564     AutoCaller autoCaller (this);
    565     CheckComRCReturnRC (autoCaller.rc());
    566 
    567     AutoWriteLock alock (this);
     556    AutoWriteLock alock (this);
     557    CHECK_READY();
    568558
    569559    std::list <ComObjPtr <HostNetworkInterface> > list;
     
    843833    CheckComArgOutSafeArrayPointerValid(aUSBDevices);
    844834
    845     AutoCaller autoCaller (this);
    846     CheckComRCReturnRC (autoCaller.rc());
    847 
    848     AutoWriteLock alock (this);
     835    AutoWriteLock alock (this);
     836    CHECK_READY();
    849837
    850838    MultiResult rc = checkUSBProxyService();
     
    870858    CheckComArgOutSafeArrayPointerValid(aUSBDeviceFilters);
    871859
    872     AutoCaller autoCaller (this);
    873     CheckComRCReturnRC (autoCaller.rc());
    874 
    875     AutoWriteLock alock (this);
     860    AutoWriteLock alock (this);
     861    CHECK_READY();
    876862
    877863    MultiResult rc = checkUSBProxyService();
     
    903889{
    904890    CheckComArgOutPointerValid(aCount);
    905 //     AutoCaller autoCaller (this);
    906 //     CheckComRCReturnRC (autoCaller.rc());
    907 
    908 //     AutoReadLock alock (this);
    909 
     891    AutoWriteLock alock (this);
     892    CHECK_READY();
    910893    *aCount = RTMpGetPresentCount();
    911894    return S_OK;
     
    921904{
    922905    CheckComArgOutPointerValid(aCount);
    923 //     AutoCaller autoCaller (this);
    924 //     CheckComRCReturnRC (autoCaller.rc());
    925 
    926 //     AutoReadLock alock (this);
    927 
     906    AutoWriteLock alock (this);
     907    CHECK_READY();
    928908    *aCount = RTMpGetOnlineCount();
    929909    return S_OK;
     
    940920{
    941921    CheckComArgOutPointerValid(aSpeed);
    942 //     AutoCaller autoCaller (this);
    943 //     CheckComRCReturnRC (autoCaller.rc());
    944 
    945 //     AutoReadLock alock (this);
    946 
     922    AutoWriteLock alock (this);
     923    CHECK_READY();
    947924    *aSpeed = RTMpGetMaxFrequency(aCpuId);
    948925    return S_OK;
     
    958935{
    959936    CheckComArgOutPointerValid(aDescription);
    960 //     AutoCaller autoCaller (this);
    961 //     CheckComRCReturnRC (autoCaller.rc());
    962 
    963 //     AutoReadLock alock (this);
    964 
     937    AutoWriteLock alock (this);
     938    CHECK_READY();
    965939    /** @todo */
    966940    ReturnComNotImplemented();
     
    977951{
    978952    CheckComArgOutPointerValid(aSupported);
    979     AutoCaller autoCaller (this);
    980     CheckComRCReturnRC (autoCaller.rc());
    981 
    982     AutoReadLock alock (this);
     953    AutoWriteLock alock (this);
     954    CHECK_READY();
    983955
    984956    switch (aFeature)
     
    1011983{
    1012984    CheckComArgOutPointerValid(aSize);
    1013     AutoCaller autoCaller (this);
    1014     CheckComRCReturnRC (autoCaller.rc());
    1015 
    1016     AutoWriteLock alock (this);
    1017 
     985    AutoWriteLock alock (this);
     986    CHECK_READY();
    1018987    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
    1019988    pm::CollectorHAL *hal = pm::createHAL();
     
    10361005{
    10371006    CheckComArgOutPointerValid(aAvailable);
    1038     AutoCaller autoCaller (this);
    1039     CheckComRCReturnRC (autoCaller.rc());
    1040 
    1041     AutoWriteLock alock (this);
    1042 
     1007    AutoWriteLock alock (this);
     1008    CHECK_READY();
    10431009    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
    10441010    pm::CollectorHAL *hal = pm::createHAL();
     
    10611027{
    10621028    CheckComArgOutPointerValid(aOs);
    1063 //     AutoCaller autoCaller (this);
    1064 //     CheckComRCReturnRC (autoCaller.rc());
    1065 
    1066 //     AutoReadLock alock (this);
     1029    AutoWriteLock alock (this);
     1030    CHECK_READY();
    10671031
    10681032    char szOSName[80];
     
    10831047{
    10841048    CheckComArgOutPointerValid(aVersion);
    1085 //     AutoCaller autoCaller (this);
    1086 //     CheckComRCReturnRC (autoCaller.rc());
    1087 
    1088 //     AutoReadLock alock (this);
     1049    AutoWriteLock alock (this);
     1050    CHECK_READY();
    10891051
    10901052    /* Get the OS release. Reserve some buffer space for the service pack. */
     
    11221084{
    11231085    CheckComArgOutPointerValid(aUTCTime);
    1124 //     AutoCaller autoCaller (this);
    1125 //     CheckComRCReturnRC (autoCaller.rc());
    1126 
    1127 //     AutoReadLock alock (this);
    1128 
     1086    AutoWriteLock alock (this);
     1087    CHECK_READY();
    11291088    RTTIMESPEC now;
    11301089    *aUTCTime = RTTimeSpecGetMilli(RTTimeNow(&now));
    1131 
    11321090    return S_OK;
    11331091}
     
    11361094{
    11371095    CheckComArgOutPointerValid(aSupported);
    1138     AutoCaller autoCaller (this);
    1139     CheckComRCReturnRC (autoCaller.rc());
    1140 
    1141     AutoReadLock alock (this);
     1096
     1097    AutoWriteLock alock(this);
     1098    CHECK_READY();
    11421099
    11431100    *aSupported = f3DAccelerationSupported;
     
    11551112    CheckComArgOutPointerValid(aProgress);
    11561113
    1157     AutoCaller autoCaller (this);
    1158     CheckComRCReturnRC (autoCaller.rc());
    1159 
    1160     AutoWriteLock alock (this);
     1114    AutoWriteLock alock (this);
     1115    CHECK_READY();
    11611116
    11621117    int r = NetIfCreateHostOnlyNetworkInterface (mParent, aHostNetworkInterface, aProgress);
     
    11771132    CheckComArgOutPointerValid(aProgress);
    11781133
    1179     AutoCaller autoCaller (this);
    1180     CheckComRCReturnRC (autoCaller.rc());
    1181 
    1182     AutoWriteLock alock (this);
     1134    AutoWriteLock alock (this);
     1135    CHECK_READY();
    11831136
    11841137    /* first check whether an interface with the given name already exists */
     
    12061159    CheckComArgOutPointerValid(aFilter);
    12071160
    1208     AutoCaller autoCaller (this);
    1209     CheckComRCReturnRC (autoCaller.rc());
    1210 
    1211     AutoWriteLock alock (this);
     1161    AutoWriteLock alock (this);
     1162    CHECK_READY();
    12121163
    12131164    ComObjPtr <HostUSBDeviceFilter> filter;
     
    12341185
    12351186    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
    1236     AutoCaller autoCaller (this);
    1237     CheckComRCReturnRC (autoCaller.rc());
    1238 
    1239     AutoWriteLock alock (this);
     1187    AutoWriteLock alock (this);
     1188    CHECK_READY();
    12401189
    12411190    MultiResult rc = checkUSBProxyService();
     
    12851234
    12861235    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
    1287     AutoCaller autoCaller (this);
    1288     CheckComRCReturnRC (autoCaller.rc());
    1289 
    1290     AutoWriteLock alock (this);
     1236    AutoWriteLock alock (this);
     1237    CHECK_READY();
    12911238
    12921239    MultiResult rc = checkUSBProxyService();
     
    13441291    using namespace settings;
    13451292
    1346     AutoCaller autoCaller (this);
    1347     CheckComRCReturnRC (autoCaller.rc());
    1348 
    1349     AutoWriteLock alock (this);
     1293    AutoWriteLock alock (this);
     1294    CHECK_READY();
    13501295
    13511296    AssertReturn (!aGlobal.isNull(), E_FAIL);
     
    14081353    using namespace settings;
    14091354
    1410     AutoCaller autoCaller (this);
    1411     CheckComRCReturnRC (autoCaller.rc());
    1412 
    1413     AutoWriteLock alock (this);
     1355    AutoWriteLock alock (this);
     1356    CHECK_READY();
    14141357
    14151358    ComAssertRet (!aGlobal.isNull(), E_FAIL);
     
    14881431                                       BOOL aActiveChanged /* = FALSE */)
    14891432{
    1490     AutoCaller autoCaller (this);
    1491     CheckComRCReturnRC (autoCaller.rc());
    1492 
    1493     AutoWriteLock alock (this);
     1433    AutoWriteLock alock (this);
     1434    CHECK_READY();
    14941435
    14951436    if (aFilter->mInList)
     
    20682009HRESULT Host::checkUSBProxyService()
    20692010{
    2070     AutoCaller autoCaller (this);
    2071     CheckComRCReturnRC (autoCaller.rc());
    2072 
    2073     AutoWriteLock alock (this);
     2011    AutoWriteLock alock (this);
     2012    CHECK_READY();
    20742013
    20752014    AssertReturn (mUSBProxyService, E_FAIL);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r21622 r21686  
    51255125
    51265126        /* initialize the snapshot */
    5127         rc = snapshot->init(mParent, // VirtualBox object
    5128                             uuid,
    5129                             name,
    5130                             description,
    5131                             timeStamp,
    5132                             snapshotMachine,
    5133                             aParentSnapshot);
    5134         CheckComRCReturnRC(rc);
     5127        rc = snapshot->init (uuid, name, description, timeStamp,
     5128                             snapshotMachine, aParentSnapshot);
     5129        CheckComRCReturnRC (rc);
    51355130    }
    51365131
     
    92049199    ComObjPtr <Snapshot> snapshot;
    92059200    snapshot.createObject();
    9206     rc = snapshot->init(mParent,
    9207                         snapshotId,
    9208                         aName,
    9209                         aDescription,
    9210                         *RTTimeNow(&time),
    9211                         snapshotMachine,
    9212                         mData->mCurrentSnapshot);
     9201    rc = snapshot->init (snapshotId, aName, aDescription,
     9202                         *RTTimeNow (&time), snapshotMachine,
     9203                         mData->mCurrentSnapshot);
    92139204    AssertComRCReturnRC (rc);
    92149205
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r21622 r21686  
    6565 *  @param  aParent        parent snapshot (NULL if no parent)
    6666 */
    67 HRESULT Snapshot::init(VirtualBox *aVirtualBox,
    68                        const Guid &aId,
    69                        IN_BSTR aName,
    70                        IN_BSTR aDescription,
    71                        RTTIMESPEC aTimeStamp,
    72                        SnapshotMachine *aMachine,
    73                        Snapshot *aParent)
     67HRESULT Snapshot::init (const Guid &aId, IN_BSTR aName, IN_BSTR aDescription,
     68                        RTTIMESPEC aTimeStamp, SnapshotMachine *aMachine,
     69                        Snapshot *aParent)
    7470{
    7571    LogFlowMember (("Snapshot::init(aParent=%p)\n", aParent));
     
    7773    ComAssertRet (!aId.isEmpty() && aName && aMachine, E_INVALIDARG);
    7874
    79     /* Enclose the state transition NotReady->InInit->Ready */
    80     AutoInitSpan autoInitSpan (this);
    81     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    82 
    83     /* share parent weakly */
    84     unconst (mVirtualBox) = aVirtualBox;
     75    AutoWriteLock alock (this);
     76    ComAssertRet (!isReady(), E_FAIL);
    8577
    8678    mParent = aParent;
     
    9587        aParent->addDependentChild (this);
    9688
    97     /* Confirm a successful initialization when it's the case */
    98     autoInitSpan.setSucceeded();
     89    setReady (true);
    9990
    10091    return S_OK;
     
    110101    LogFlowMember (("Snapshot::uninit()\n"));
    111102
    112     /* Enclose the state transition Ready->InUninit->NotReady */
    113 //     AutoUninitSpan autoUninitSpan (this);         @todo this creates a deadlock, investigate what this does actually
    114 //     if (autoUninitSpan.uninitDone())
    115 //         return;
     103    AutoWriteLock alock (this);
     104
     105    LogFlowMember (("Snapshot::uninit(): isReady=%d\n", isReady()));
     106    if (!isReady())
     107        return;
    116108
    117109    // uninit all children
    118110    uninitDependentChildren();
    119111
     112    setReady (false);
     113
    120114    if (mParent)
    121115    {
     116        alock.leave();
    122117        mParent->removeDependentChild (this);
     118        alock.enter();
    123119        mParent.setNull();
    124120    }
     
    138134void Snapshot::discard()
    139135{
    140     AutoCaller autoCaller (this);
    141     if (FAILED(autoCaller.rc()))
    142         return;
    143 
    144     AutoWriteLock alock (this);
     136    LogFlowMember (("Snapshot::discard()\n"));
     137
     138    AutoWriteLock alock (this);
     139    AssertReturn (isReady(), (void) 0);
    145140
    146141    {
     
    174169    CheckComArgOutPointerValid(aId);
    175170
    176     AutoCaller autoCaller (this);
    177     CheckComRCReturnRC (autoCaller.rc());
    178 
    179     AutoReadLock alock (this);
     171    AutoWriteLock alock (this);
     172    CHECK_READY();
    180173
    181174    mData.mId.toUtf16().cloneTo (aId);
     
    187180    CheckComArgOutPointerValid(aName);
    188181
    189     AutoCaller autoCaller (this);
    190     CheckComRCReturnRC (autoCaller.rc());
    191 
    192     AutoReadLock alock (this);
     182    AutoWriteLock alock (this);
     183    CHECK_READY();
    193184
    194185    mData.mName.cloneTo (aName);
     
    204195    CheckComArgNotNull(aName);
    205196
    206     AutoCaller autoCaller (this);
    207     CheckComRCReturnRC (autoCaller.rc());
    208 
    209     AutoWriteLock alock (this);
     197    AutoWriteLock alock (this);
     198    CHECK_READY();
    210199
    211200    if (mData.mName != aName)
     
    225214    CheckComArgOutPointerValid(aDescription);
    226215
    227     AutoCaller autoCaller (this);
    228     CheckComRCReturnRC (autoCaller.rc());
    229 
    230     AutoReadLock alock (this);
     216    AutoWriteLock alock (this);
     217    CHECK_READY();
    231218
    232219    mData.mDescription.cloneTo (aDescription);
     
    238225    CheckComArgNotNull(aDescription);
    239226
    240     AutoCaller autoCaller (this);
    241     CheckComRCReturnRC (autoCaller.rc());
    242 
    243     AutoWriteLock alock (this);
     227    AutoWriteLock alock (this);
     228    CHECK_READY();
    244229
    245230    if (mData.mDescription != aDescription)
     
    259244    CheckComArgOutPointerValid(aTimeStamp);
    260245
    261     AutoCaller autoCaller (this);
    262     CheckComRCReturnRC (autoCaller.rc());
    263 
    264     AutoReadLock alock (this);
     246    AutoWriteLock alock (this);
     247    CHECK_READY();
    265248
    266249    *aTimeStamp = RTTimeSpecGetMilli (&mData.mTimeStamp);
     
    272255    CheckComArgOutPointerValid(aOnline);
    273256
    274     AutoCaller autoCaller (this);
    275     CheckComRCReturnRC (autoCaller.rc());
    276 
    277     AutoReadLock alock (this);
     257    AutoWriteLock alock (this);
     258    CHECK_READY();
    278259
    279260    *aOnline = !stateFilePath().isNull();
     
    285266    CheckComArgOutPointerValid(aMachine);
    286267
    287     AutoCaller autoCaller (this);
    288     CheckComRCReturnRC (autoCaller.rc());
    289 
    290     AutoReadLock alock (this);
     268    AutoWriteLock alock (this);
     269    CHECK_READY();
    291270
    292271    mData.mMachine.queryInterfaceTo (aMachine);
     
    298277    CheckComArgOutPointerValid(aParent);
    299278
    300     AutoCaller autoCaller (this);
    301     CheckComRCReturnRC (autoCaller.rc());
    302 
    303     AutoReadLock alock (this);
     279    AutoWriteLock alock (this);
     280    CHECK_READY();
    304281
    305282    mParent.queryInterfaceTo (aParent);
     
    311288    CheckComArgOutSafeArrayPointerValid(aChildren);
    312289
    313     AutoCaller autoCaller (this);
    314     CheckComRCReturnRC (autoCaller.rc());
    315 
    316     AutoReadLock alock (this);
    317     AutoReadLock chLock (childrenLock ());
     290    AutoWriteLock alock (this);
     291    CHECK_READY();
     292
     293    AutoWriteLock chLock (childrenLock ());
    318294
    319295    SafeIfaceArray <ISnapshot> collection (children());
     
    341317ULONG Snapshot::descendantCount()
    342318{
    343     AutoCaller autoCaller (this);
    344     AssertComRC(autoCaller.rc());
    345 
    346     AutoReadLock alock (this);
    347 
    348     AutoReadLock chLock (childrenLock ());
     319    AutoWriteLock alock(this);
     320    AssertReturn (isReady(), 0);
     321
     322    AutoWriteLock chLock (childrenLock ());
    349323
    350324    ULONG count = (ULONG)children().size();
     
    363337 *  etc. of this snapshot. This snapshot itself is also included in the search.
    364338 */
    365 ComObjPtr<Snapshot> Snapshot::findChildOrSelf (IN_GUID aId)
     339ComObjPtr <Snapshot> Snapshot::findChildOrSelf (IN_GUID aId)
    366340{
    367341    ComObjPtr <Snapshot> child;
    368342
    369     AutoCaller autoCaller (this);
    370     AssertComRC(autoCaller.rc());
    371 
    372     AutoReadLock alock (this);
     343    AutoWriteLock alock (this);
     344    AssertReturn (isReady(), child);
    373345
    374346    if (mData.mId == aId)
     
    397369    AssertReturn (aName, child);
    398370
    399     AutoCaller autoCaller (this);
    400     AssertComRC(autoCaller.rc());
    401 
    402     AutoReadLock alock (this);
     371    AutoWriteLock alock (this);
     372    AssertReturn (isReady(), child);
    403373
    404374    if (mData.mName == aName)
     
    435405    AssertReturnVoid (aNewPath);
    436406
    437     AutoCaller autoCaller (this);
    438     AssertComRC(autoCaller.rc());
    439 
    440     AutoWriteLock alock (this);
     407    AutoWriteLock alock (this);
     408    AssertReturnVoid (isReady());
    441409
    442410    Utf8Str path = mData.mMachine->mSSData->mStateFilePath;
     
    462430}
    463431
    464 /**
    465     * Returns VirtualBox::mSnapshotsTreeLockHandle(), for convenience. Don't forget
    466     * to follow these locking rules:
    467     *
    468     * 1. The write lock on this handle must be either held alone on the thread
    469     *    or requested *after* the VirtualBox object lock. Mixing with other
    470     *    locks is prohibited.
    471     *
    472     * 2. The read lock on this handle may be intermixed with any other lock
    473     *    with the exception that it must be requested *after* the VirtualBox
    474     *    object lock.
    475     */
    476 RWLockHandle* Snapshot::treeLock()
    477 {
    478     return mVirtualBox->snapshotTreeLockHandle();
    479 }
    480 
    481 /** Reimplements VirtualBoxWithTypedChildren::childrenLock() to return
    482     *  treeLock(). */
    483 RWLockHandle* Snapshot::childrenLock()
    484 {
    485     return treeLock();
    486 }
    487 
    488 
     432/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r21660 r21686  
    317317class ATL_NO_VTABLE USBDeviceFilter :
    318318    public VirtualBoxBase,
    319     public VirtualBoxSupportErrorInfoImpl<USBDeviceFilter, IUSBDeviceFilter>,
    320     public VirtualBoxSupportTranslation<USBDeviceFilter>,
     319    public VirtualBoxSupportErrorInfoImpl <USBDeviceFilter, IUSBDeviceFilter>,
     320    public VirtualBoxSupportTranslation <USBDeviceFilter>,
    321321    public IUSBDeviceFilter
    322322{
  • trunk/src/VBox/Main/VirtualBoxBase.cpp

    r21622 r21686  
    11531153 * @note Locks #childrenLock() for reading.
    11541154 */
    1155 VirtualBoxBase* VirtualBoxBaseWithChildrenNEXT::getDependentChild(const ComPtr<IUnknown> &aUnk)
     1155VirtualBoxBaseNEXT *
     1156VirtualBoxBaseWithChildrenNEXT::getDependentChild (const ComPtr <IUnknown> &aUnk)
    11561157{
    11571158    AssertReturn (!aUnk.isNull(), NULL);
     
    11731174
    11741175/** Helper for addDependentChild(). */
    1175 void VirtualBoxBaseWithChildrenNEXT::doAddDependentChild(IUnknown *aUnk,
    1176                                                          VirtualBoxBase *aChild)
     1176void VirtualBoxBaseWithChildrenNEXT::doAddDependentChild (
     1177    IUnknown *aUnk, VirtualBoxBaseNEXT *aChild)
    11771178{
    11781179    AssertReturnVoid (aUnk != NULL);
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r21622 r21686  
    3434class ATL_NO_VTABLE Appliance :
    3535    public VirtualBoxBaseWithChildrenNEXT,
    36     public VirtualBoxSupportErrorInfoImpl<Appliance, IAppliance>,
    37     public VirtualBoxSupportTranslation<Appliance>,
     36    public VirtualBoxSupportErrorInfoImpl <Appliance, IAppliance>,
     37    public VirtualBoxSupportTranslation <Appliance>,
    3838    VBOX_SCRIPTABLE_IMPL(IAppliance)
    3939{
     
    142142
    143143class ATL_NO_VTABLE VirtualSystemDescription :
    144     public VirtualBoxBaseWithChildren,
    145     public VirtualBoxSupportErrorInfoImpl<VirtualSystemDescription, IVirtualSystemDescription>,
    146     public VirtualBoxSupportTranslation<VirtualSystemDescription>,
     144    public VirtualBoxBaseWithChildrenNEXT,
     145    public VirtualBoxSupportErrorInfoImpl <VirtualSystemDescription, IVirtualSystemDescription>,
     146    public VirtualBoxSupportTranslation <VirtualSystemDescription>,
    147147    VBOX_SCRIPTABLE_IMPL(IVirtualSystemDescription)
    148148{
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r21622 r21686  
    3030
    3131class ATL_NO_VTABLE AudioAdapter :
    32     public VirtualBoxBase,
    33     public VirtualBoxSupportErrorInfoImpl<AudioAdapter, IAudioAdapter>,
    34     public VirtualBoxSupportTranslation<AudioAdapter>,
     32    public VirtualBoxBaseNEXT,
     33    public VirtualBoxSupportErrorInfoImpl <AudioAdapter, IAudioAdapter>,
     34    public VirtualBoxSupportTranslation <AudioAdapter>,
    3535    VBOX_SCRIPTABLE_IMPL(IAudioAdapter)
    3636{
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r21622 r21686  
    3131
    3232class ATL_NO_VTABLE BIOSSettings :
    33     public VirtualBoxSupportErrorInfoImpl<BIOSSettings, IBIOSSettings>,
    34     public VirtualBoxSupportTranslation<BIOSSettings>,
    35     public VirtualBoxBase,
     33    public VirtualBoxSupportErrorInfoImpl <BIOSSettings, IBIOSSettings>,
     34    public VirtualBoxSupportTranslation <BIOSSettings>,
     35    public VirtualBoxBaseNEXT,
    3636    VBOX_SCRIPTABLE_IMPL(IBIOSSettings)
    3737{
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r21647 r21686  
    7979class ATL_NO_VTABLE Console :
    8080    public VirtualBoxBaseWithChildrenNEXT,
    81     public VirtualBoxSupportErrorInfoImpl<Console, IConsole>,
    82     public VirtualBoxSupportTranslation<Console>,
     81    public VirtualBoxSupportErrorInfoImpl <Console, IConsole>,
     82    public VirtualBoxSupportTranslation <Console>,
    8383    VBOX_SCRIPTABLE_IMPL(IConsole)
    8484{
  • trunk/src/VBox/Main/include/ConsoleVRDPServer.h

    r21622 r21686  
    233233
    234234class ATL_NO_VTABLE RemoteDisplayInfo :
    235     public VirtualBoxBase,
    236     public VirtualBoxSupportErrorInfoImpl<RemoteDisplayInfo, IRemoteDisplayInfo>,
    237     public VirtualBoxSupportTranslation<RemoteDisplayInfo>,
     235    public VirtualBoxBaseNEXT,
     236    public VirtualBoxSupportErrorInfoImpl <RemoteDisplayInfo, IRemoteDisplayInfo>,
     237    public VirtualBoxSupportTranslation <RemoteDisplayInfo>,
    238238    VBOX_SCRIPTABLE_IMPL(IRemoteDisplayInfo)
    239239{
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r21622 r21686  
    3535
    3636class ATL_NO_VTABLE DHCPServer :
    37     public VirtualBoxBase,
    38     public VirtualBoxSupportErrorInfoImpl<DHCPServer, IDHCPServer>,
    39     public VirtualBoxSupportTranslation<DHCPServer>,
     37    public VirtualBoxBaseNEXT,
     38    public VirtualBoxSupportErrorInfoImpl <DHCPServer, IDHCPServer>,
     39    public VirtualBoxSupportTranslation <DHCPServer>,
    4040    VBOX_SCRIPTABLE_IMPL(IDHCPServer)
    4141{
  • trunk/src/VBox/Main/include/DVDDriveImpl.h

    r21622 r21686  
    3232
    3333class ATL_NO_VTABLE DVDDrive :
    34     public VirtualBoxBase,
    35     public VirtualBoxSupportErrorInfoImpl<DVDDrive, IDVDDrive>,
    36     public VirtualBoxSupportTranslation<DVDDrive>,
     34    public VirtualBoxBaseNEXT,
     35    public VirtualBoxSupportErrorInfoImpl <DVDDrive, IDVDDrive>,
     36    public VirtualBoxSupportTranslation <DVDDrive>,
    3737    VBOX_SCRIPTABLE_IMPL(IDVDDrive)
    3838{
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r21622 r21686  
    8383
    8484class ATL_NO_VTABLE Display :
    85     public VirtualBoxBase,
     85    public VirtualBoxBaseNEXT,
    8686    VBOX_SCRIPTABLE_IMPL(IConsoleCallback),
    87     public VirtualBoxSupportErrorInfoImpl<Display, IDisplay>,
    88     public VirtualBoxSupportTranslation<Display>,
     87    public VirtualBoxSupportErrorInfoImpl <Display, IDisplay>,
     88    public VirtualBoxSupportTranslation <Display>,
    8989    VBOX_SCRIPTABLE_IMPL(IDisplay)
    9090{
  • trunk/src/VBox/Main/include/FloppyDriveImpl.h

    r21622 r21686  
    3232
    3333class ATL_NO_VTABLE FloppyDrive :
    34     public VirtualBoxBase,
    35     public VirtualBoxSupportErrorInfoImpl<FloppyDrive, IFloppyDrive>,
    36     public VirtualBoxSupportTranslation<FloppyDrive>,
     34    public VirtualBoxBaseNEXT,
     35    public VirtualBoxSupportErrorInfoImpl <FloppyDrive, IFloppyDrive>,
     36    public VirtualBoxSupportTranslation <FloppyDrive>,
    3737    VBOX_SCRIPTABLE_IMPL(IFloppyDrive)
    3838{
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r21622 r21686  
    2929
    3030class ATL_NO_VTABLE Framebuffer :
    31     public VirtualBoxBase,
    32     public VirtualBoxSupportErrorInfoImpl<Framebuffer, IFramebuffer>,
    33     public VirtualBoxSupportTranslation<Framebuffer>,
     31    public VirtualBoxBaseNEXT,
     32    public VirtualBoxSupportErrorInfoImpl <Framebuffer, IFramebuffer>,
     33    public VirtualBoxSupportTranslation <Framebuffer>,
    3434    VBOX_SCRIPTABLE_IMPL(IFramebuffer)
    3535{
     
    7676                                   BOOL *aSupported) = 0;
    7777
    78     STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount,
    79                                ULONG *aCountCopied) = 0;
     78    STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount, 
     79                               ULONG *aCountCopied) = 0; 
    8080    STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount) = 0;
    8181
  • trunk/src/VBox/Main/include/GuestImpl.h

    r21622 r21686  
    3131
    3232class ATL_NO_VTABLE Guest :
    33     public VirtualBoxSupportErrorInfoImpl<Guest, IGuest>,
    34     public VirtualBoxSupportTranslation<Guest>,
    35     public VirtualBoxBase,
     33    public VirtualBoxSupportErrorInfoImpl <Guest, IGuest>,
     34    public VirtualBoxSupportTranslation <Guest>,
     35    public VirtualBoxBaseNEXT,
    3636    VBOX_SCRIPTABLE_IMPL(IGuest)
    3737{
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r21622 r21686  
    2929
    3030class ATL_NO_VTABLE GuestOSType :
    31     public VirtualBoxBase,
    32     public VirtualBoxSupportErrorInfoImpl<GuestOSType, IGuestOSType>,
    33     public VirtualBoxSupportTranslation<GuestOSType>,
     31    public VirtualBoxBaseNEXT,
     32    public VirtualBoxSupportErrorInfoImpl <GuestOSType, IGuestOSType>,
     33    public VirtualBoxSupportTranslation <GuestOSType>,
    3434    VBOX_SCRIPTABLE_IMPL(IGuestOSType)
    3535{
  • trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h

    r21622 r21686  
    2828
    2929class ATL_NO_VTABLE HardDiskAttachment :
    30     public VirtualBoxBase,
     30    public VirtualBoxBaseNEXT,
    3131    public com::SupportErrorInfoImpl<HardDiskAttachment, IHardDiskAttachment>,
    3232    public VirtualBoxSupportTranslation<HardDiskAttachment>,
  • trunk/src/VBox/Main/include/HardDiskFormatImpl.h

    r21622 r21686  
    4343 */
    4444class ATL_NO_VTABLE HardDiskFormat :
    45     public VirtualBoxBase,
    46     public VirtualBoxSupportErrorInfoImpl<HardDiskFormat, IHardDiskFormat>,
    47     public VirtualBoxSupportTranslation<HardDiskFormat>,
     45    public VirtualBoxBaseNEXT,
     46    public VirtualBoxSupportErrorInfoImpl <HardDiskFormat, IHardDiskFormat>,
     47    public VirtualBoxSupportTranslation <HardDiskFormat>,
    4848    VBOX_SCRIPTABLE_IMPL(IHardDiskFormat)
    4949{
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r21622 r21686  
    4646class ATL_NO_VTABLE HardDisk
    4747    : public com::SupportErrorInfoDerived<MediumBase, HardDisk, IHardDisk>
    48     , public VirtualBoxBaseWithTypedChildren<HardDisk>
     48    , public VirtualBoxBaseWithTypedChildrenNEXT<HardDisk>
    4949    , public VirtualBoxSupportTranslation<HardDisk>
    5050    , VBOX_SCRIPTABLE_IMPL(IHardDisk)
     
    5252public:
    5353
    54     typedef VirtualBoxBaseWithTypedChildren<HardDisk>::DependentChildren List;
     54    typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk>::DependentChildren
     55        List;
    5556
    5657    class MergeChain;
  • trunk/src/VBox/Main/include/HostDVDDriveImpl.h

    r21622 r21686  
    2626
    2727class ATL_NO_VTABLE HostDVDDrive :
    28     public VirtualBoxBase,
    29     public VirtualBoxSupportErrorInfoImpl<HostDVDDrive, IHostDVDDrive>,
    30     public VirtualBoxSupportTranslation<HostDVDDrive>,
     28    public VirtualBoxBaseNEXT,
     29    public VirtualBoxSupportErrorInfoImpl <HostDVDDrive, IHostDVDDrive>,
     30    public VirtualBoxSupportTranslation <HostDVDDrive>,
    3131    VBOX_SCRIPTABLE_IMPL(IHostDVDDrive)
    3232{
  • trunk/src/VBox/Main/include/HostFloppyDriveImpl.h

    r21622 r21686  
    2626
    2727class ATL_NO_VTABLE HostFloppyDrive :
    28     public VirtualBoxBase,
    29     public VirtualBoxSupportErrorInfoImpl<HostFloppyDrive, IHostFloppyDrive>,
    30     public VirtualBoxSupportTranslation<HostFloppyDrive>,
     28    public VirtualBoxBaseNEXT,
     29    public VirtualBoxSupportErrorInfoImpl <HostFloppyDrive, IHostFloppyDrive>,
     30    public VirtualBoxSupportTranslation <HostFloppyDrive>,
    3131    VBOX_SCRIPTABLE_IMPL(IHostFloppyDrive)
    3232{
  • trunk/src/VBox/Main/include/HostImpl.h

    r21622 r21686  
    5252class ATL_NO_VTABLE Host :
    5353    public VirtualBoxBaseWithChildren,
    54     public VirtualBoxSupportErrorInfoImpl<Host, IHost>,
    55     public VirtualBoxSupportTranslation<Host>,
     54    public VirtualBoxSupportErrorInfoImpl <Host, IHost>,
     55    public VirtualBoxSupportTranslation <Host>,
    5656    VBOX_SCRIPTABLE_IMPL(IHost)
    5757{
  • trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h

    r21622 r21686  
    3535
    3636class ATL_NO_VTABLE HostNetworkInterface :
    37     public VirtualBoxBase,
    38     public VirtualBoxSupportErrorInfoImpl<HostNetworkInterface, IHostNetworkInterface>,
    39     public VirtualBoxSupportTranslation<HostNetworkInterface>,
     37    public VirtualBoxBaseNEXT,
     38    public VirtualBoxSupportErrorInfoImpl <HostNetworkInterface, IHostNetworkInterface>,
     39    public VirtualBoxSupportTranslation <HostNetworkInterface>,
    4040    VBOX_SCRIPTABLE_IMPL(IHostNetworkInterface)
    4141{
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r21622 r21686  
    4848
    4949class ATL_NO_VTABLE Keyboard :
    50     public VirtualBoxBase,
    51     public VirtualBoxSupportErrorInfoImpl<Keyboard, IKeyboard>,
    52     public VirtualBoxSupportTranslation<Keyboard>,
     50    public VirtualBoxBaseNEXT,
     51    public VirtualBoxSupportErrorInfoImpl <Keyboard, IKeyboard>,
     52    public VirtualBoxSupportTranslation <Keyboard>,
    5353    VBOX_SCRIPTABLE_IMPL(IKeyboard)
    5454{
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r21622 r21686  
    3030
    3131class ATL_NO_VTABLE MachineDebugger :
    32     public VirtualBoxBase,
    33     public VirtualBoxSupportErrorInfoImpl<MachineDebugger, IMachineDebugger>,
    34     public VirtualBoxSupportTranslation<MachineDebugger>,
     32    public VirtualBoxBaseNEXT,
     33    public VirtualBoxSupportErrorInfoImpl <MachineDebugger, IMachineDebugger>,
     34    public VirtualBoxSupportTranslation <MachineDebugger>,
    3535    VBOX_SCRIPTABLE_IMPL(IMachineDebugger)
    3636{
  • trunk/src/VBox/Main/include/MachineImpl.h

    r21622 r21686  
    7878class ATL_NO_VTABLE Machine :
    7979    public VirtualBoxBaseWithChildrenNEXT,
    80     public VirtualBoxSupportErrorInfoImpl<Machine, IMachine>,
    81     public VirtualBoxSupportTranslation<Machine>,
     80    public VirtualBoxSupportErrorInfoImpl <Machine, IMachine>,
     81    public VirtualBoxSupportTranslation <Machine>,
    8282    VBOX_SCRIPTABLE_IMPL(IMachine)
    8383{
     
    873873 */
    874874class ATL_NO_VTABLE SessionMachine :
    875     public VirtualBoxSupportTranslation<SessionMachine>,
     875    public VirtualBoxSupportTranslation <SessionMachine>,
    876876    public Machine,
    877877    VBOX_SCRIPTABLE_IMPL(IInternalMachineControl)
     
    10481048 */
    10491049class ATL_NO_VTABLE SnapshotMachine :
    1050     public VirtualBoxSupportTranslation<SnapshotMachine>,
     1050    public VirtualBoxSupportTranslation <SnapshotMachine>,
    10511051    public Machine
    10521052{
  • trunk/src/VBox/Main/include/MediumImpl.h

    r21622 r21686  
    4747    virtual public VirtualBoxBaseProto,
    4848    public com::SupportErrorInfoBase,
    49     public VirtualBoxSupportTranslation<MediumBase>,
     49    public VirtualBoxSupportTranslation <MediumBase>,
    5050    VBOX_SCRIPTABLE_IMPL(IMedium)
    5151{
     
    212212class ATL_NO_VTABLE ImageMediumBase
    213213    : public MediumBase
    214     , public VirtualBoxBase
     214    , public VirtualBoxBaseNEXT
    215215{
    216216public:
     
    293293 */
    294294class ATL_NO_VTABLE FloppyImage
    295     : public com::SupportErrorInfoDerived<ImageMediumBase, FloppyImage, IFloppyImage>
    296     , public VirtualBoxSupportTranslation<FloppyImage>
     295    : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage, IFloppyImage>
     296    , public VirtualBoxSupportTranslation <FloppyImage>
    297297    , VBOX_SCRIPTABLE_IMPL(IFloppyImage)
    298298{
  • trunk/src/VBox/Main/include/MouseImpl.h

    r21622 r21686  
    5050
    5151class ATL_NO_VTABLE Mouse :
    52     public VirtualBoxBase,
    53     public VirtualBoxSupportErrorInfoImpl<Mouse, IMouse>,
    54     public VirtualBoxSupportTranslation<Mouse>,
     52    public VirtualBoxBaseNEXT,
     53    public VirtualBoxSupportErrorInfoImpl <Mouse, IMouse>,
     54    public VirtualBoxSupportTranslation <Mouse>,
    5555    VBOX_SCRIPTABLE_IMPL(IMouse)
    5656{
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r21622 r21686  
    3131
    3232class ATL_NO_VTABLE NetworkAdapter :
    33     public VirtualBoxBase,
    34     public VirtualBoxSupportErrorInfoImpl<NetworkAdapter, INetworkAdapter>,
    35     public VirtualBoxSupportTranslation<NetworkAdapter>,
     33    public VirtualBoxBaseNEXT,
     34    public VirtualBoxSupportErrorInfoImpl <NetworkAdapter, INetworkAdapter>,
     35    public VirtualBoxSupportTranslation <NetworkAdapter>,
    3636    VBOX_SCRIPTABLE_IMPL(INetworkAdapter)
    3737{
  • trunk/src/VBox/Main/include/ParallelPortImpl.h

    r21622 r21686  
    2929
    3030class ATL_NO_VTABLE ParallelPort :
    31     public VirtualBoxBase,
    32     public VirtualBoxSupportErrorInfoImpl<ParallelPort, IParallelPort>,
    33     public VirtualBoxSupportTranslation<ParallelPort>,
     31    public VirtualBoxBaseNEXT,
     32    public VirtualBoxSupportErrorInfoImpl <ParallelPort, IParallelPort>,
     33    public VirtualBoxSupportTranslation <ParallelPort>,
    3434    VBOX_SCRIPTABLE_IMPL(IParallelPort)
    3535{
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r21622 r21686  
    5252
    5353class ATL_NO_VTABLE PerformanceMetric :
    54     public VirtualBoxBase,
    55     public VirtualBoxSupportTranslation<PerformanceMetric>,
     54    public VirtualBoxBaseNEXT,
     55    public VirtualBoxSupportTranslation <PerformanceMetric>,
    5656    VBOX_SCRIPTABLE_IMPL(IPerformanceMetric)
    5757{
     
    121121
    122122class ATL_NO_VTABLE PerformanceCollector :
    123     public VirtualBoxBase,
    124     public VirtualBoxSupportErrorInfoImpl<PerformanceCollector, IPerformanceCollector>,
    125     public VirtualBoxSupportTranslation<PerformanceCollector>,
     123    public VirtualBoxBaseNEXT,
     124    public VirtualBoxSupportErrorInfoImpl <PerformanceCollector, IPerformanceCollector>,
     125    public VirtualBoxSupportTranslation <PerformanceCollector>,
    126126    VBOX_SCRIPTABLE_IMPL(IPerformanceCollector)
    127127{
  • trunk/src/VBox/Main/include/ProgressImpl.h

    r21622 r21686  
    4040 */
    4141class ATL_NO_VTABLE ProgressBase :
    42     public VirtualBoxBase,
     42    public VirtualBoxBaseNEXT,
    4343    public com::SupportErrorInfoBase,
    44     public VirtualBoxSupportTranslation<ProgressBase>,
     44    public VirtualBoxSupportTranslation <ProgressBase>,
    4545    VBOX_SCRIPTABLE_IMPL(IProgress)
    4646{
     
    133133 */
    134134class ATL_NO_VTABLE Progress :
    135     public com::SupportErrorInfoDerived<ProgressBase, Progress, IProgress>,
    136     public VirtualBoxSupportTranslation<Progress>
     135    public com::SupportErrorInfoDerived <ProgressBase, Progress, IProgress>,
     136    public VirtualBoxSupportTranslation <Progress>
    137137{
    138138
     
    305305 */
    306306class ATL_NO_VTABLE CombinedProgress :
    307     public com::SupportErrorInfoDerived<ProgressBase, CombinedProgress, IProgress>,
    308     public VirtualBoxSupportTranslation<CombinedProgress>
     307    public com::SupportErrorInfoDerived <ProgressBase, CombinedProgress, IProgress>,
     308    public VirtualBoxSupportTranslation <CombinedProgress>
    309309{
    310310
  • trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h

    r21622 r21686  
    3232
    3333class ATL_NO_VTABLE RemoteUSBDevice :
    34     public VirtualBoxBase,
    35     public VirtualBoxSupportErrorInfoImpl<RemoteUSBDevice, IHostUSBDevice>,
    36     public VirtualBoxSupportTranslation<RemoteUSBDevice>,
     34    public VirtualBoxBaseNEXT,
     35    public VirtualBoxSupportErrorInfoImpl <RemoteUSBDevice, IHostUSBDevice>,
     36    public VirtualBoxSupportTranslation <RemoteUSBDevice>,
    3737    VBOX_SCRIPTABLE_IMPL(IHostUSBDevice)
    3838{
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r21622 r21686  
    3131
    3232class ATL_NO_VTABLE SerialPort :
    33     public VirtualBoxBase,
    34     public VirtualBoxSupportErrorInfoImpl<SerialPort, ISerialPort>,
    35     public VirtualBoxSupportTranslation<SerialPort>,
     33    public VirtualBoxBaseNEXT,
     34    public VirtualBoxSupportErrorInfoImpl <SerialPort, ISerialPort>,
     35    public VirtualBoxSupportTranslation <SerialPort>,
    3636    VBOX_SCRIPTABLE_IMPL(ISerialPort)
    3737{
  • trunk/src/VBox/Main/include/SessionImpl.h

    r21622 r21686  
    4242
    4343class ATL_NO_VTABLE Session :
    44     public VirtualBoxBase,
    45     public VirtualBoxSupportErrorInfoImpl<Session, ISession>,
    46     public VirtualBoxSupportTranslation<Session>,
     44    public VirtualBoxBaseNEXT,
     45    public VirtualBoxSupportErrorInfoImpl <Session, ISession>,
     46    public VirtualBoxSupportTranslation <Session>,
    4747    VBOX_SCRIPTABLE_IMPL(ISession),
    4848    VBOX_SCRIPTABLE_IMPL(IInternalSessionControl)
     
    6262    BEGIN_COM_MAP(Session)
    6363        COM_INTERFACE_ENTRY2(IDispatch, ISession)
    64         COM_INTERFACE_ENTRY2(IDispatch, IInternalSessionControl)
     64        COM_INTERFACE_ENTRY2(IDispatch, IInternalSessionControl)       
    6565        COM_INTERFACE_ENTRY(IInternalSessionControl)
    6666        COM_INTERFACE_ENTRY(ISupportErrorInfo)
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r21622 r21686  
    3131
    3232class ATL_NO_VTABLE SharedFolder :
    33     public VirtualBoxBase,
    34     public VirtualBoxSupportErrorInfoImpl<SharedFolder, ISharedFolder>,
    35     public VirtualBoxSupportTranslation<SharedFolder>,
     33    public VirtualBoxBaseNEXT,
     34    public VirtualBoxSupportErrorInfoImpl <SharedFolder, ISharedFolder>,
     35    public VirtualBoxSupportTranslation <SharedFolder>,
    3636    VBOX_SCRIPTABLE_IMPL(ISharedFolder)
    3737{
  • trunk/src/VBox/Main/include/SnapshotImpl.h

    r21622 r21686  
    3030
    3131class SnapshotMachine;
    32 class VirtualBox;
    3332
    3433class ATL_NO_VTABLE Snapshot :
    35     public VirtualBoxSupportErrorInfoImpl<Snapshot, ISnapshot>,
    36     public VirtualBoxSupportTranslation<Snapshot>,
    37     public VirtualBoxBaseWithTypedChildren<Snapshot>,
     34    public VirtualBoxSupportErrorInfoImpl <Snapshot, ISnapshot>,
     35    public VirtualBoxSupportTranslation <Snapshot>,
     36    public VirtualBoxBaseWithTypedChildren <Snapshot>,
    3837    VBOX_SCRIPTABLE_IMPL(ISnapshot)
    3938{
     
    5251    };
    5352
    54     typedef VirtualBoxBaseWithTypedChildren<Snapshot>::DependentChildren SnapshotList;
     53    typedef VirtualBoxBaseWithTypedChildren <Snapshot>::DependentChildren
     54        SnapshotList;
    5555
    5656    DECLARE_NOT_AGGREGATABLE(Snapshot)
     
    6666    NS_DECL_ISUPPORTS
    6767
    68     Snapshot()
    69     { };
    70     ~Snapshot()
    71     { };
    72 
    7368    HRESULT FinalConstruct();
    7469    void FinalRelease();
    7570
    7671    // public initializer/uninitializer only for internal purposes
    77     HRESULT init(VirtualBox *aVirtualBox,
    78                  const Guid &aId,
    79                  IN_BSTR aName,
    80                  IN_BSTR aDescription,
    81                  RTTIMESPEC aTimeStamp,
    82                  SnapshotMachine *aMachine,
    83                  Snapshot *aParent);
     72    HRESULT init (const Guid &aId, IN_BSTR aName, IN_BSTR aDescription,
     73                  RTTIMESPEC aTimeStamp, SnapshotMachine *aMachine,
     74                  Snapshot *aParent);
    8475    void uninit();
    8576
     
    109100    ComObjPtr <Snapshot> parent() const { return (Snapshot *) mParent; }
    110101
     102    /** Shortcut to #dependentChildrenLock() */
     103    RWLockHandle *childrenLock() const { return dependentChildrenLock(); }
     104
    111105    /**
    112106     *  Shortcut to #dependentChildren().
     
    124118    static const wchar_t *getComponentName() { return L"Snapshot"; }
    125119
    126     RWLockHandle *treeLock();
    127     RWLockHandle *childrenLock();
    128 
    129120private:
    130121
    131     /** weak VirtualBox parent */
    132     const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    133 
    134     ComObjPtr<Snapshot, ComWeakRef> mParent;
     122    ComObjPtr <Snapshot, ComWeakRef> mParent;
    135123
    136124    Data mData;
  • trunk/src/VBox/Main/include/StorageControllerImpl.h

    r21622 r21686  
    3333class ATL_NO_VTABLE StorageController :
    3434    public VirtualBoxBaseWithChildrenNEXT,
    35     public VirtualBoxSupportErrorInfoImpl<StorageController, IStorageController>,
    36     public VirtualBoxSupportTranslation<StorageController>,
     35    public VirtualBoxSupportErrorInfoImpl <StorageController, IStorageController>,
     36    public VirtualBoxSupportTranslation <StorageController>,
    3737    VBOX_SCRIPTABLE_IMPL(IStorageController)
    3838{
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r21622 r21686  
    3535
    3636class ATL_NO_VTABLE SystemProperties :
    37     public VirtualBoxBase,
    38     public VirtualBoxSupportErrorInfoImpl<SystemProperties, ISystemProperties>,
    39     public VirtualBoxSupportTranslation<SystemProperties>,
     37    public VirtualBoxBaseNEXT,
     38    public VirtualBoxSupportErrorInfoImpl <SystemProperties, ISystemProperties>,
     39    public VirtualBoxSupportTranslation <SystemProperties>,
    4040    VBOX_SCRIPTABLE_IMPL(ISystemProperties)
    4141{
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r21622 r21686  
    4444class ATL_NO_VTABLE USBController :
    4545    public VirtualBoxBaseWithChildrenNEXT,
    46     public VirtualBoxSupportErrorInfoImpl<USBController, IUSBController>,
    47     public VirtualBoxSupportTranslation<USBController>,
     46    public VirtualBoxSupportErrorInfoImpl <USBController, IUSBController>,
     47    public VirtualBoxSupportTranslation <USBController>,
    4848    VBOX_SCRIPTABLE_IMPL(IUSBController)
    4949{
  • trunk/src/VBox/Main/include/USBDeviceImpl.h

    r21622 r21686  
    3333 */
    3434class ATL_NO_VTABLE OUSBDevice :
    35     public VirtualBoxBase,
     35    public VirtualBoxBaseNEXT,
    3636    public VirtualBoxSupportErrorInfoImpl<OUSBDevice, IUSBDevice>,
    3737    public VirtualBoxSupportTranslation<OUSBDevice>,
  • trunk/src/VBox/Main/include/VFSExplorerImpl.h

    r21622 r21686  
    3030
    3131class ATL_NO_VTABLE VFSExplorer :
    32     public VirtualBoxBase,
    33     public VirtualBoxSupportErrorInfoImpl<VFSExplorer, IVFSExplorer>,
    34     public VirtualBoxSupportTranslation<VFSExplorer>,
     32    public VirtualBoxBaseNEXT,
     33    public VirtualBoxSupportErrorInfoImpl <VFSExplorer, IVFSExplorer>,
     34    public VirtualBoxSupportTranslation <VFSExplorer>,
    3535    VBOX_SCRIPTABLE_IMPL(IVFSExplorer)
    3636{
  • trunk/src/VBox/Main/include/VRDPServerImpl.h

    r21622 r21686  
    3232
    3333class ATL_NO_VTABLE VRDPServer :
    34     public VirtualBoxBase,
    35     public VirtualBoxSupportErrorInfoImpl<VRDPServer, IVRDPServer>,
    36     public VirtualBoxSupportTranslation<VRDPServer>,
     34    public VirtualBoxBaseNEXT,
     35    public VirtualBoxSupportErrorInfoImpl <VRDPServer, IVRDPServer>,
     36    public VirtualBoxSupportTranslation <VRDPServer>,
    3737    VBOX_SCRIPTABLE_IMPL(IVRDPServer)
    3838{
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r21622 r21686  
    466466////////////////////////////////////////////////////////////////////////////////
    467467
     468/// @todo (dmik) remove after we switch to VirtualBoxBaseNEXT completely
     469/**
     470 *  Checks whether this object is ready or not. Objects are typically ready
     471 *  after they are successfully created by their parent objects and become
     472 *  not ready when the respective parent itself becomes not ready or gets
     473 *  destroyed while a reference to the child is still held by the caller
     474 *  (which prevents it from destruction).
     475 *
     476 *  When this object is not ready, the macro sets error info and returns
     477 *  E_ACCESSDENIED (the translatable error message is defined in null context).
     478 *  Otherwise, the macro does nothing.
     479 *
     480 *  This macro <b>must</b> be used at the beginning of all interface methods
     481 *  (right after entering the class lock) in classes derived from both
     482 *  VirtualBoxBase and VirtualBoxSupportErrorInfoImpl.
     483 */
     484#define CHECK_READY() \
     485    do { \
     486        if (!isReady()) \
     487            return setError (E_ACCESSDENIED, tr ("The object is not ready")); \
     488    } while (0)
     489
    468490/**
    469491 *  Declares an empty constructor and destructor for the given class.
     
    12181240////////////////////////////////////////////////////////////////////////////////
    12191241
     1242/// @todo (dmik) remove after we switch to VirtualBoxBaseNEXT completely
    12201243class ATL_NO_VTABLE VirtualBoxBase
    12211244    : virtual public VirtualBoxBaseProto
     
    12291252public:
    12301253    VirtualBoxBase()
    1231     {}
    1232 
     1254    {
     1255        mReady = false;
     1256    }
    12331257    virtual ~VirtualBoxBase()
    1234     {}
     1258    {
     1259    }
    12351260
    12361261    /**
     
    12411266     *  method's implementation must call setReady (false),
    12421267     */
    1243     virtual void uninit()
    1244     {}
     1268    virtual void uninit() {}
     1269
     1270
     1271    // sets the ready state of the object
     1272    void setReady(bool isReady)
     1273    {
     1274        mReady = isReady;
     1275    }
     1276    // get the ready state of the object
     1277    bool isReady()
     1278    {
     1279        return mReady;
     1280    }
    12451281
    12461282    static const char *translate (const char *context, const char *sourceText,
    12471283                                  const char *comment = 0);
     1284
     1285private:
     1286
     1287    // flag determining whether an object is ready
     1288    // for usage, i.e. methods may be called
     1289    bool mReady;
     1290    // mutex semaphore to lock the object
     1291};
     1292
     1293/**
     1294 *  Temporary class to disable deprecated methods of VirtualBoxBase.
     1295 *  Can be used as a base for components that are completely switched to
     1296 *  the new locking scheme (VirtualBoxBaseProto).
     1297 *
     1298 *  @todo remove after we switch to VirtualBoxBaseNEXT completely.
     1299 */
     1300class VirtualBoxBaseNEXT : public VirtualBoxBase
     1301{
     1302private:
     1303
     1304    void lock();
     1305    void unlock();
     1306    void setReady (bool isReady);
     1307    bool isReady();
    12481308};
    12491309
     
    13231383
    13241384template <class C>
    1325 const char *VirtualBoxSupportTranslation<C>::sClassName = NULL;
     1385const char *VirtualBoxSupportTranslation <C>::sClassName = NULL;
    13261386
    13271387/**
     
    13381398                                  const char *aComment = NULL) \
    13391399    { \
    1340         return VirtualBoxSupportTranslation<C>::tr (aSourceText, aComment); \
     1400        return VirtualBoxSupportTranslation <C>::tr (aSourceText, aComment); \
    13411401    }
    13421402
     
    20232083 *       has gone.
    20242084 */
    2025 class VirtualBoxBaseWithChildrenNEXT : public VirtualBoxBase
     2085class VirtualBoxBaseWithChildrenNEXT : public VirtualBoxBaseNEXT
    20262086{
    20272087public:
     
    21312191    void uninitDependentChildren();
    21322192
    2133     VirtualBoxBase *getDependentChild(const ComPtr <IUnknown> &aUnk);
     2193    VirtualBoxBaseNEXT *getDependentChild (const ComPtr <IUnknown> &aUnk);
    21342194
    21352195private:
    2136     void doAddDependentChild(IUnknown *aUnk, VirtualBoxBase *aChild);
     2196
     2197    /// @todo temporarily reinterpret VirtualBoxBase * as VirtualBoxBaseNEXT *
     2198    //  until ported HardDisk and Progress to the new scheme.
     2199    void doAddDependentChild (IUnknown *aUnk, VirtualBoxBase *aChild)
     2200    {
     2201        doAddDependentChild (aUnk,
     2202                             reinterpret_cast <VirtualBoxBaseNEXT *> (aChild));
     2203    }
     2204
     2205    void doAddDependentChild (IUnknown *aUnk, VirtualBoxBaseNEXT *aChild);
    21372206    void doRemoveDependentChild (IUnknown *aUnk);
    21382207
    2139     typedef std::map<IUnknown*, VirtualBoxBase*> DependentChildren;
     2208    typedef std::map <IUnknown *, VirtualBoxBaseNEXT *> DependentChildren;
    21402209    DependentChildren mDependentChildren;
    21412210};
    21422211
    21432212////////////////////////////////////////////////////////////////////////////////
     2213
     2214/**
     2215 *  Base class to track component's children of some particular type.
     2216 *
     2217 *  This class is similar to VirtualBoxBaseWithChildren, with the exception
     2218 *  that all children must be of the same type. For this reason, it's not
     2219 *  necessary to use a map to store children, so a list is used instead.
     2220 *
     2221 *  As opposed to VirtualBoxBaseWithChildren, children added by
     2222 *  #addDependentChild() are <b>strongly</b> referenced, so that they cannot
     2223 *  be externally destructed until #removeDependentChild() is called.
     2224 *
     2225 *  Also, this class doesn't have the
     2226 *  VirtualBoxBaseWithChildrenNEXT::getDependentChild() method because it would
     2227 *  be not fast for long lists.
     2228 *
     2229 *  @param C    type of child objects (must inherit VirtualBoxBase AND
     2230 *              implement some interface)
     2231 *
     2232 *  @deprecated Use VirtualBoxBaseWithTypedChildrenNEXT for new classes.
     2233 */
     2234template <class C>
     2235class VirtualBoxBaseWithTypedChildren : public VirtualBoxBase
     2236{
     2237public:
     2238
     2239    typedef std::list <ComObjPtr <C> > DependentChildren;
     2240
     2241    VirtualBoxBaseWithTypedChildren() : mInUninit (false) {}
     2242
     2243    virtual ~VirtualBoxBaseWithTypedChildren() {}
     2244
     2245    /**
     2246     *  Adds the given child to the list of dependent children.
     2247     *  Must be called from the child's init() method,
     2248     *  from under the child's lock.
     2249     *
     2250     *  @param C    the child object to add (must inherit VirtualBoxBase AND
     2251     *              implement some interface)
     2252     */
     2253    void addDependentChild (C *child)
     2254    {
     2255        AssertReturn (child, (void) 0);
     2256
     2257        AutoWriteLock alock (mMapLock);
     2258        if (mInUninit)
     2259            return;
     2260
     2261        mDependentChildren.push_back (child);
     2262    }
     2263
     2264    /**
     2265     *  Removes the given child from the list of dependent children.
     2266     *  Must be called from the child's uninit() method,
     2267     *  under the child's lock.
     2268     *
     2269     *  @param C    the child object to remove (must inherit VirtualBoxBase AND
     2270     *              implement some interface)
     2271     */
     2272    void removeDependentChild (C *child)
     2273    {
     2274        AssertReturn (child, (void) 0);
     2275
     2276        AutoWriteLock alock (mMapLock);
     2277        if (mInUninit)
     2278            return;
     2279
     2280        mDependentChildren.remove (child);
     2281    }
     2282
     2283protected:
     2284
     2285    /**
     2286     *  Returns an internal lock handle to lock the list of children
     2287     *  returned by #dependentChildren() using AutoReadLock/AutoWriteLock:
     2288     *  <code>
     2289     *      AutoReadLock alock (dependentChildrenLock());
     2290     *  </code>
     2291     *
     2292     *  This is necessary for example to access the list of children returned by
     2293     *  #dependentChildren().
     2294     */
     2295    RWLockHandle *dependentChildrenLock() const { return &mMapLock; }
     2296
     2297    /**
     2298     *  Returns the read-only list of all dependent children.
     2299     *  @note
     2300     *      Access the returned list (iterate, get size etc.) only after
     2301     *      doing |AutoWriteLock alock (dependentChildrenLock());|!
     2302     */
     2303    const DependentChildren &dependentChildren() const { return mDependentChildren; }
     2304
     2305    /**
     2306     *  Uninitializes all dependent children registered with #addDependentChild().
     2307     *
     2308     *  @note
     2309     *      This method will call uninit() methods of children. If these methods
     2310     *      access the parent object, uninitDependentChildren() must be called
     2311     *      either at the beginning of the parent uninitialization sequence (when
     2312     *      it is still operational) or after setReady(false) is called to
     2313     *      indicate the parent is out of action.
     2314     */
     2315    void uninitDependentChildren()
     2316    {
     2317        AutoWriteLock alock (this);
     2318        AutoWriteLock mapLock (mMapLock);
     2319
     2320        if (mDependentChildren.size())
     2321        {
     2322            // set flag to ignore #removeDependentChild() called from child->uninit()
     2323            mInUninit = true;
     2324
     2325            // leave the locks to let children waiting for #removeDependentChild() run
     2326            mapLock.leave();
     2327            alock.leave();
     2328
     2329            for (typename DependentChildren::iterator it = mDependentChildren.begin();
     2330                it != mDependentChildren.end(); ++ it)
     2331            {
     2332                C *child = (*it);
     2333                Assert (child);
     2334                if (child)
     2335                    child->uninit();
     2336            }
     2337            mDependentChildren.clear();
     2338
     2339            alock.enter();
     2340            mapLock.enter();
     2341
     2342            mInUninit = false;
     2343        }
     2344    }
     2345
     2346    /**
     2347     *  Removes (detaches) all dependent children registered with
     2348     *  #addDependentChild(), without uninitializing them.
     2349     *
     2350     *  @note This method must be called from under the main object's lock
     2351     */
     2352    void removeDependentChildren()
     2353    {
     2354        AutoWriteLock alock (mMapLock);
     2355        mDependentChildren.clear();
     2356    }
     2357
     2358private:
     2359
     2360    DependentChildren mDependentChildren;
     2361
     2362    bool mInUninit;
     2363    mutable RWLockHandle mMapLock;
     2364};
    21442365
    21452366////////////////////////////////////////////////////////////////////////////////
     
    21712392 */
    21722393template <class C>
    2173 class VirtualBoxBaseWithTypedChildren : public VirtualBoxBase
     2394class VirtualBoxBaseWithTypedChildrenNEXT : public VirtualBoxBaseNEXT
    21742395{
    21752396public:
     
    21772398    typedef std::list <ComObjPtr <C> > DependentChildren;
    21782399
    2179     VirtualBoxBaseWithTypedChildren()
    2180     {}
    2181 
    2182     virtual ~VirtualBoxBaseWithTypedChildren()
    2183     {}
     2400    VirtualBoxBaseWithTypedChildrenNEXT() {}
     2401
     2402    virtual ~VirtualBoxBaseWithTypedChildrenNEXT() {}
    21842403
    21852404    /**
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r21622 r21686  
    6464class ATL_NO_VTABLE VirtualBox :
    6565    public VirtualBoxBaseWithChildrenNEXT,
    66     public VirtualBoxSupportErrorInfoImpl<VirtualBox, IVirtualBox>,
    67     public VirtualBoxSupportTranslation<VirtualBox>,
     66    public VirtualBoxSupportErrorInfoImpl <VirtualBox, IVirtualBox>,
     67    public VirtualBoxSupportTranslation <VirtualBox>,
    6868    VBOX_SCRIPTABLE_IMPL(IVirtualBox)
    6969#ifdef RT_OS_WINDOWS
     
    359359    RWLockHandle *hardDiskTreeLockHandle() { return &mHardDiskTreeLockHandle; }
    360360
    361     RWLockHandle *snapshotTreeLockHandle() { return &mSnapshotTreeLockHandle; }
    362 
    363361    /* for VirtualBoxSupportErrorInfoImpl */
    364362    static const wchar_t *getComponentName() { return L"VirtualBox"; }
     
    509507    RWLockHandle mHardDiskTreeLockHandle;
    510508    RWLockHandle mChildrenMapLockHandle;
    511     RWLockHandle mSnapshotTreeLockHandle;
    512509
    513510    static Bstr sVersion;
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