VirtualBox

Changeset 29937 in vbox for trunk/src


Ignore:
Timestamp:
Jun 1, 2010 8:41:32 AM (15 years ago)
Author:
vboxsync
Message:

Main: Reapplied r62200 with bug fixes.

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

Legend:

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

    r29934 r29937  
    98419841
    98429842    if (!mData->mSession.mProgress.isNull())
    9843         mData->mSession.mProgress->setOtherProgressObject(aProgress, 7);
     9843        mData->mSession.mProgress->setOtherProgressObject(aProgress);
    98449844
    98459845    return S_OK;
     
    98639863    if (mData->mSession.mProgress)
    98649864    {
    9865         mData->mSession.mProgress->clearOtherProgressObject(tr("Finalizing"), 1);
    98669865        mData->mSession.mProgress->notifyComplete((HRESULT)iResult);
    98679866        mData->mSession.mProgress.setNull();
  • trunk/src/VBox/Main/ProgressProxyImpl.cpp

    r29934 r29937  
    4646HRESULT ProgressProxy::FinalConstruct()
    4747{
    48     mcOtherProgressObjects = 1;
    49     miCurOtherProgressObject = 0;
     48    mfMultiOperation = false;
     49    muOtherProgressStartWeight = 0;
     50    muOtherProgressWeight = 0;
     51    muOtherProgressStartOperation = 0;
    5052
    5153    HRESULT rc = Progress::FinalConstruct();
     
    6668                            BOOL fCancelable)
    6769{
    68     miCurOtherProgressObject = 0;
    69     mcOtherProgressObjects = 0;
     70    mfMultiOperation = false;
     71    muOtherProgressStartWeight = 1;
     72    muOtherProgressWeight = 1;
     73    muOtherProgressStartOperation = 1;
    7074
    7175    return Progress::init(
     
    8488
    8589/**
    86  * Initialize for proxying one or more other objects, assuming we start out and
    87  * end without proxying anyone.
    88  *
    89  * The user must call clearOtherProgressObject when there are no more progress
    90  * objects to be proxied or we'll leave threads waiting forever.
     90 * Initialize for proxying one other progress object.
     91 *
     92 * This is tailored explicitly for the openRemoteSession code, so we start out
     93 * with one operation where we don't have any remote object (powerUp).  Then a
     94 * remote object is added and stays with us till the end.
     95 *
     96 * The user must do normal completion notification or risk leave the threads
     97 * waiting forever!
    9198 */
    9299HRESULT ProgressProxy::init(
     
    97104                            CBSTR bstrDescription,
    98105                            BOOL fCancelable,
    99                             ULONG cOtherProgressObjects,
    100106                            ULONG uTotalOperationsWeight,
    101107                            CBSTR bstrFirstOperationDescription,
    102108                            ULONG uFirstOperationWeight,
    103                             OUT_GUID pId)
    104 {
    105     miCurOtherProgressObject = 0;
    106     mcOtherProgressObjects = cOtherProgressObjects;
     109                            ULONG cOtherProgressObjectOperations)
     110{
     111    mfMultiOperation = false;
     112    muOtherProgressStartWeight    = uFirstOperationWeight;
     113    muOtherProgressWeight         = uTotalOperationsWeight - uFirstOperationWeight;
     114    muOtherProgressStartOperation = 1;
    107115
    108116    return Progress::init(
     
    113121                          bstrDescription,
    114122                          fCancelable,
    115                           1 + cOtherProgressObjects + 1 /* cOperations */,
     123                          1 + cOtherProgressObjectOperations /* cOperations */,
    116124                          uTotalOperationsWeight,
    117125                          bstrFirstOperationDescription,
    118126                          uFirstOperationWeight,
    119                           pId);
     127                          NULL);
    120128}
    121129
     
    123131{
    124132    uninit();
    125     miCurOtherProgressObject = 0;
     133    mfMultiOperation = false;
     134    muOtherProgressStartWeight    = 0;
     135    muOtherProgressWeight         = 0;
     136    muOtherProgressStartOperation = 0;
    126137}
    127138
     
    136147// Public methods
    137148////////////////////////////////////////////////////////////////////////////////
    138 
    139 /** Just a wrapper so we can automatically do the handover before setting
    140  *  the result locally. */
    141 HRESULT ProgressProxy::setResultCode(HRESULT aResultCode)
    142 {
    143     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    144     clearOtherProgressObjectInternal(true /* fEarly */);
    145     return Progress::setResultCode(aResultCode);
    146 }
    147149
    148150/** Just a wrapper so we can automatically do the handover before setting
     
    152154    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    153155    clearOtherProgressObjectInternal(true /* fEarly */);
    154     return Progress::notifyComplete(aResultCode);
     156    HRESULT hrc = S_OK;
     157    if (!mCompleted)
     158         hrc = Progress::notifyComplete(aResultCode);
     159    return hrc;
    155160}
    156161
     
    166171    clearOtherProgressObjectInternal(true /* fEarly */);
    167172
    168     va_list va;
    169     va_start(va, aText);
    170     HRESULT hrc = Progress::notifyCompleteV(aResultCode, aIID, aComponent, aText, va);
    171     va_end(va);
    172     return hrc;
    173 }
    174 
    175 /** Just a wrapper so we can automatically do the handover before setting
    176  *  the result locally. */
    177 bool    ProgressProxy::notifyPointOfNoReturn(void)
    178 {
    179     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    180     clearOtherProgressObjectInternal(true /* fEarly */);
    181     return Progress::notifyPointOfNoReturn();
     173    HRESULT hrc = S_OK;
     174    if (!mCompleted)
     175    {
     176        va_list va;
     177        va_start(va, aText);
     178        HRESULT hrc = Progress::notifyCompleteV(aResultCode, aIID, aComponent, aText, va);
     179        va_end(va);
     180    }
     181    return hrc;
    182182}
    183183
     
    188188 * @returns false if failed/canceled, true if not.
    189189 * @param   pOtherProgress      The other progress object. Must not be NULL.
    190  * @param   uOperationWeight    The weight of this operation.  (The description
    191  *                              is taken from the other progress object.)
    192190 */
    193 bool ProgressProxy::setOtherProgressObject(IProgress *pOtherProgress, ULONG uOperationWeight)
    194 {
    195     LogFlowThisFunc(("setOtherProgressObject: %p %u\n", pOtherProgress, uOperationWeight));
     191bool ProgressProxy::setOtherProgressObject(IProgress *pOtherProgress)
     192{
     193    LogFlowThisFunc(("setOtherProgressObject: %p\n", pOtherProgress));
    196194    ComPtr<IProgress> ptrOtherProgress = pOtherProgress;
    197195
    198     /* Get the description first. */
    199     Bstr    bstrOperationDescription;
    200     HRESULT hrc = pOtherProgress->COMGETTER(Description)(bstrOperationDescription.asOutParam());
     196    /*
     197     * Query information from the other progress object before we grab the
     198     * lock.
     199     */
     200    ULONG cOperations;
     201    HRESULT hrc = pOtherProgress->COMGETTER(OperationCount)(&cOperations);
     202    if (FAILED(hrc))
     203        cOperations = 1;
     204
     205    Bstr bstrOperationDescription;
     206    hrc = pOtherProgress->COMGETTER(Description)(bstrOperationDescription.asOutParam());
    201207    if (FAILED(hrc))
    202208        bstrOperationDescription = "oops";
    203209
     210
     211    /*
     212     * Take the lock and check for cancelation, cancel the other object if
     213     * we've been canceled already.
     214     */
    204215    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    205216
    206     /* Do the hand over from any previous progress object. */
    207     clearOtherProgressObjectInternal(false /*fEarly*/);
    208217    BOOL fCompletedOrCanceled = mCompleted || mCanceled;
    209218    if (!fCompletedOrCanceled)
    210219    {
    211         /* Advance to the next object and operation, checking for cancelation
    212            and completion right away to be on the safe side. */
    213         Assert(miCurOtherProgressObject < mcOtherProgressObjects);
     220        /*
     221         * Advance to the next object and operation. If the other object has
     222         * more operations than anticipated, adjust our internal count.
     223         */
    214224        mptrOtherProgress = ptrOtherProgress;
    215 
    216         Progress::SetNextOperation(bstrOperationDescription, uOperationWeight);
    217 
     225        mfMultiOperation  = cOperations > 1;
     226
     227        muOtherProgressStartWeight = m_ulOperationsCompletedWeight + m_ulCurrentOperationWeight;
     228        muOtherProgressWeight      = m_ulTotalOperationsWeight - muOtherProgressStartWeight;
     229        Progress::SetNextOperation(bstrOperationDescription, muOtherProgressWeight);
     230
     231        muOtherProgressStartOperation = m_ulCurrentOperation;
     232        m_cOperations = cOperations + m_ulCurrentOperation;
     233
     234        /*
     235         * Check for cancelation and completion.
     236         */
    218237        BOOL f;
    219238        hrc = ptrOtherProgress->COMGETTER(Completed)(&f);
     
    233252        else
    234253        {
    235             /* Mirror the cancelable property. */
     254            /*
     255             * Finally, mirror the cancelable property.
     256             * Note! Note necessary if we do passthru!
     257             */
    236258            if (mCancelable)
    237259            {
     
    257279}
    258280
    259 /**
    260  * Clears the last other progress objects.
    261  *
    262  * @returns false if failed/canceled, true if not.
    263  * @param   pszLastOperationDescription     The description of the final bit.
    264  * @param   uLastOperationWeight            The weight of the final bit.
    265  */
    266 bool ProgressProxy::clearOtherProgressObject(const char *pszLastOperationDescription, ULONG uLastOperationWeight)
    267 {
    268     LogFlowThisFunc(("%p %u\n", pszLastOperationDescription, uLastOperationWeight));
    269     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    270 
    271     clearOtherProgressObjectInternal(false /* fEarly */);
    272 
    273     /* Advance to the next operation if applicable. */
    274     bool fCompletedOrCanceled = mCompleted || mCanceled;
    275     if (!fCompletedOrCanceled)
    276         Progress::SetNextOperation(Bstr(pszLastOperationDescription), uLastOperationWeight);
    277 
    278     LogFlowThisFunc(("Returns %RTbool\n", !fCompletedOrCanceled));
    279     return !fCompletedOrCanceled;
    280 }
    281 
    282281// Internal methods.
    283282////////////////////////////////////////////////////////////////////////////////
     
    285284
    286285/**
    287  * Internal version of clearOtherProgressObject that doesn't advance to the next
    288  * operation.
    289  *
    290  * This is used both by clearOtherProgressObject as well as a number of places
    291  * where we automatically do the hand over because of failure/completion.
     286 * Clear the other progress object reference, first copying over its state.
     287 *
     288 * This is used internally when completion is signalled one way or another.
    292289 *
    293290 * @param   fEarly          Early clearing or not.
     
    295292void ProgressProxy::clearOtherProgressObjectInternal(bool fEarly)
    296293{
    297     if (!mptrOtherProgress.isNull())
     294    if (mptrOtherProgress.isNotNull())
    298295    {
    299296        ComPtr<IProgress> ptrOtherProgress = mptrOtherProgress;
    300297        mptrOtherProgress.setNull();
    301298        copyProgressInfo(ptrOtherProgress, fEarly);
    302 
    303         miCurOtherProgressObject++;
    304         Assert(miCurOtherProgressObject <= mcOtherProgressObjects);
    305299    }
    306300}
     
    413407////////////////////////////////////////////////////////////////////////////////
    414408
     409STDMETHODIMP ProgressProxy::COMGETTER(Cancelable)(BOOL *aCancelable)
     410{
     411    CheckComArgOutPointerValid(aCancelable);
     412
     413    AutoCaller autoCaller(this);
     414    HRESULT hrc = autoCaller.rc();
     415    if (SUCCEEDED(hrc))
     416    {
     417        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     418
     419        /* ASSUME: The cancelable property can only change to FALSE. */
     420        if (!mCancelable || mptrOtherProgress.isNull())
     421            *aCancelable = mCancelable;
     422        else
     423        {
     424            hrc = mptrOtherProgress->COMGETTER(Cancelable)(aCancelable);
     425            if (SUCCEEDED(hrc) && !*aCancelable)
     426            {
     427                LogFlowThisFunc(("point-of-no-return reached\n"));
     428                mCancelable = FALSE;
     429            }
     430        }
     431    }
     432    return hrc;
     433}
     434
    415435STDMETHODIMP ProgressProxy::COMGETTER(Percent)(ULONG *aPercent)
    416436{
    417 #if 0
    418437    CheckComArgOutPointerValid(aPercent);
    419438
    420439    AutoCaller autoCaller(this);
    421440    HRESULT hrc = autoCaller.rc();
    422     if (SUCCEEDED(rc))
     441    if (SUCCEEDED(hrc))
    423442    {
    424443        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    428447        else
    429448        {
     449            /*
     450             * Get the overall percent of the other object and adjust it with
     451             * the weighting given to the period before proxying started.
     452             */
    430453            ULONG uPct;
    431454            hrc = mptrOtherProgress->COMGETTER(Percent)(&uPct);
    432             ....
    433         }
    434     }
    435     return hrc;
    436 #else
    437     return Progress::COMGETTER(Percent)(aPercent);
    438 #endif
     455            if (SUCCEEDED(hrc))
     456            {
     457                double rdPercent = ((double)uPct / 100 * muOtherProgressWeight + muOtherProgressStartWeight)
     458                                 / m_ulTotalOperationsWeight * 100;
     459                *aPercent = RT_MIN((ULONG)rdPercent, 99); /* mptrOtherProgress is cleared when its completed, so we can never return 100%. */
     460            }
     461        }
     462    }
     463    return hrc;
     464}
     465
     466STDMETHODIMP ProgressProxy::COMGETTER(TimeRemaining)(LONG *aTimeRemaining)
     467{
     468    CheckComArgOutPointerValid(aTimeRemaining);
     469
     470    AutoCaller autoCaller(this);
     471    HRESULT hrc = autoCaller.rc();
     472    if (SUCCEEDED(hrc))
     473    {
     474        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     475
     476        if (mptrOtherProgress.isNull())
     477            hrc = Progress::COMGETTER(TimeRemaining)(aTimeRemaining);
     478        else
     479            hrc = mptrOtherProgress->COMGETTER(TimeRemaining)(aTimeRemaining);
     480    }
     481    return hrc;
    439482}
    440483
    441484STDMETHODIMP ProgressProxy::COMGETTER(Completed)(BOOL *aCompleted)
    442485{
    443     /* Not proxied since we EXPECT a hand back call. */
     486    /* Not proxied since we EXPECT a normal completion notification call. */
    444487    return Progress::COMGETTER(Completed)(aCompleted);
    445488}
     
    458501        if (   SUCCEEDED(hrc)
    459502            && !*aCanceled
    460             && !mptrOtherProgress.isNull())
     503            && mptrOtherProgress.isNotNull()
     504            && mCancelable)
    461505        {
    462506            hrc = mptrOtherProgress->COMGETTER(Canceled)(aCanceled);
    463507            if (SUCCEEDED(hrc) && *aCanceled)
    464                 clearOtherProgressObjectInternal(true /*fEarly*/);
     508                /* This will not complete the object, only mark it as canceled. */
     509                clearOtherProgressObjectInternal(false /*fEarly*/);
    465510        }
    466511    }
     
    470515STDMETHODIMP ProgressProxy::COMGETTER(ResultCode)(LONG *aResultCode)
    471516{
    472     /* Not proxied yet since we EXPECT a hand back call. */
     517    /* Not proxied since we EXPECT a normal completion notification call. */
    473518    return Progress::COMGETTER(ResultCode)(aResultCode);
    474519}
     
    476521STDMETHODIMP ProgressProxy::COMGETTER(ErrorInfo)(IVirtualBoxErrorInfo **aErrorInfo)
    477522{
    478     /* Not proxied yet since we EXPECT a hand back call. */
     523    /* Not proxied since we EXPECT a normal completion notification call. */
    479524    return Progress::COMGETTER(ErrorInfo)(aErrorInfo);
    480525}
    481526
     527STDMETHODIMP ProgressProxy::COMGETTER(Operation)(ULONG *aOperation)
     528{
     529    CheckComArgOutPointerValid(aOperation);
     530
     531    AutoCaller autoCaller(this);
     532    HRESULT hrc = autoCaller.rc();
     533    if (SUCCEEDED(hrc))
     534    {
     535        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     536        if (mptrOtherProgress.isNull())
     537            hrc =  Progress::COMGETTER(Operation)(aOperation);
     538        else
     539        {
     540            ULONG uCurOtherOperation;
     541            hrc = mptrOtherProgress->COMGETTER(Operation)(&uCurOtherOperation);
     542            if (SUCCEEDED(hrc))
     543                *aOperation = uCurOtherOperation + muOtherProgressStartOperation;
     544        }
     545    }
     546    return hrc;
     547}
     548
     549STDMETHODIMP ProgressProxy::COMGETTER(OperationDescription)(BSTR *aOperationDescription)
     550{
     551    CheckComArgOutPointerValid(aOperationDescription);
     552
     553    AutoCaller autoCaller(this);
     554    HRESULT hrc = autoCaller.rc();
     555    if (SUCCEEDED(hrc))
     556    {
     557        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     558        if (mptrOtherProgress.isNull() || !mfMultiOperation)
     559            hrc = Progress::COMGETTER(OperationDescription)(aOperationDescription);
     560        else
     561            hrc = mptrOtherProgress->COMGETTER(OperationDescription)(aOperationDescription);
     562    }
     563    return hrc;
     564}
     565
    482566STDMETHODIMP ProgressProxy::COMGETTER(OperationPercent)(ULONG *aOperationPercent)
    483567{
    484     /* Not proxied, should be proxied later on. */
    485     return Progress::COMGETTER(OperationPercent)(aOperationPercent);
     568    CheckComArgOutPointerValid(aOperationPercent);
     569
     570    AutoCaller autoCaller(this);
     571    HRESULT hrc = autoCaller.rc();
     572    if (SUCCEEDED(hrc))
     573    {
     574        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     575        if (mptrOtherProgress.isNull() || !mfMultiOperation)
     576            hrc = Progress::COMGETTER(OperationPercent)(aOperationPercent);
     577        else
     578            hrc = mptrOtherProgress->COMGETTER(OperationPercent)(aOperationPercent);
     579    }
     580    return hrc;
    486581}
    487582
     
    512607    LogFlowThisFunc(("aTimeout=%d\n", aTimeout));
    513608
    514     /* For now we'll always block locally. */
     609    /* No need to wait on the proxied object for these since we'll get the
     610       normal completion notifications. */
    515611    hrc = Progress::WaitForCompletion(aTimeout);
    516612
     
    521617STDMETHODIMP ProgressProxy::WaitForOperationCompletion(ULONG aOperation, LONG aTimeout)
    522618{
    523     HRESULT hrc;
    524619    LogFlowThisFuncEnter();
    525620    LogFlowThisFunc(("aOperation=%d aTimeout=%d\n", aOperation, aTimeout));
    526621
    527     /* For now we'll always block locally. Later though, we could consider
    528        blocking remotely when we can. */
    529     hrc = Progress::WaitForOperationCompletion(aOperation, aTimeout);
     622    AutoCaller autoCaller(this);
     623    HRESULT hrc = autoCaller.rc();
     624    if (SUCCEEDED(hrc))
     625    {
     626        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     627
     628        CheckComArgExpr(aOperation, aOperation < m_cOperations);
     629
     630        /*
     631         * Check if we can wait locally.
     632         */
     633        if (   aOperation + 1 == m_cOperations /* final operation */
     634            || mptrOtherProgress.isNull())
     635        {
     636            /* ASSUMES that Progress::WaitForOperationCompletion is using
     637               AutoWriteLock::leave() as it saves us from duplicating the code! */
     638            hrc = Progress::WaitForOperationCompletion(aOperation, aTimeout);
     639        }
     640        else
     641        {
     642            LogFlowThisFunc(("calling the other object...\n"));
     643            ComPtr<IProgress> ptrOtherProgress = mptrOtherProgress;
     644            alock.release();
     645
     646            hrc = ptrOtherProgress->WaitForOperationCompletion(aOperation, aTimeout);
     647        }
     648    }
    530649
    531650    LogFlowThisFuncLeave();
     
    541660    {
    542661        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    543         if (mCancelable)
    544         {
    545             if (!mptrOtherProgress.isNull())
    546             {
    547                 hrc = mptrOtherProgress->Cancel();
    548                 if (SUCCEEDED(hrc))
    549                 {
    550                     if (m_pfnCancelCallback)
    551                         m_pfnCancelCallback(m_pvCancelUserArg);
    552                     clearOtherProgressObjectInternal(true /*fEarly*/);
    553                 }
    554             }
    555             else
    556                 hrc = Progress::Cancel();
    557         }
    558         else
    559             hrc = setError(E_FAIL, tr("Operation cannot be canceled"));
     662        if (mptrOtherProgress.isNull() || !mCancelable)
     663            hrc = Progress::Cancel();
     664        else
     665        {
     666            hrc = mptrOtherProgress->Cancel();
     667            if (SUCCEEDED(hrc))
     668                clearOtherProgressObjectInternal(false /*fEarly*/);
     669        }
    560670    }
    561671
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r29934 r29937  
    19951995                    E_INVALIDARG);
    19961996
     1997    /* get the teleporter enable state for the progress object init. */
     1998    BOOL fTeleporterEnabled;
     1999    rc = machine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled);
     2000    if (FAILED(rc))
     2001        return rc;
     2002
    19972003    /* create a progress object */
    19982004    ComObjPtr<ProgressProxy> progress;
    19992005    progress.createObject();
    20002006    rc = progress->init(this,
    2001                         static_cast <IMachine *>(machine),
     2007                        static_cast<IMachine *>(machine),
    20022008                        Bstr(tr("Spawning session")),
    20032009                        TRUE /* aCancelable */,
    2004                         1 /* cOtherProgressObjects */,
    2005                         10 /* uTotalOperationsWeight */,
     2010                        fTeleporterEnabled ? 20 : 10 /* uTotalOperationsWeight */,
    20062011                        Bstr(tr("Spawning session")),
    2007                         3 /* uFirstOperationWeight */,
    2008                         NULL /* pId */);
     2012                        2 /* uFirstOperationWeight */,
     2013                        fTeleporterEnabled ? 3 : 1 /* cOtherProgressObjectOperations */);
    20092014    if (SUCCEEDED(rc))
    20102015    {
     
    45214526        ComPtr<IVirtualBoxCallback> cbI;
    45224527        ComPtr<IDispatch> cbD;
    4523    
     4528
    45244529        cbI = sp;
    45254530        cbD = sp;
    45264531
    45274532        /**
    4528          * Would be like this in ideal world, unfortunately our consumers want to be invoked via IDispatch, 
     4533         * Would be like this in ideal world, unfortunately our consumers want to be invoked via IDispatch,
    45294534         * thus going the hard way.
    45304535         */
    4531 #if 0   
     4536#if 0
    45324537        if (cbI != NULL)
    4533         {   
     4538        {
    45344539            HRESULT hrc = handleCallback(cbI);
    45354540            if (hrc == VBOX_E_DONT_CALL_AGAIN)
     
    45444549
    45454550             ::VariantClear(&varResult);
    4546              ::VariantClear(&arg1); 
     4551             ::VariantClear(&arg1);
    45474552             ::VariantClear(&arg2);
    4548              
     4553
    45494554             VARIANTARG args[] = {arg1, arg2};
    45504555             DISPPARAMS disp = { args, NULL, sizeof(args)/sizeof(args[0]), 0};
    45514556
    45524557             cbD->Invoke(dispid, IID_NULL,
    4553                          LOCALE_USER_DEFAULT, 
    4554                          DISPATCH_METHOD, 
    4555                          &disp, &varResult, 
     4558                         LOCALE_USER_DEFAULT,
     4559                         DISPATCH_METHOD,
     4560                         &disp, &varResult,
    45564561                         NULL, NULL);
    45574562        }
  • trunk/src/VBox/Main/include/ProgressProxyImpl.h

    r29934 r29937  
    5959                 CBSTR bstrDescription,
    6060                 BOOL fCancelable,
    61                  ULONG cOtherProgressObjects,
    6261                 ULONG uTotalOperationsWeight,
    6362                 CBSTR bstrFirstOperationDescription,
    6463                 ULONG uFirstOperationWeight,
    65                  OUT_GUID pId = NULL);
     64                 ULONG cOtherProgressObjectOperations);
    6665    void    uninit();
    6766
    6867    // IProgress properties
     68    STDMETHOD(COMGETTER(Cancelable))(BOOL *aCancelable);
    6969    STDMETHOD(COMGETTER(Percent))(ULONG *aPercent);
     70    STDMETHOD(COMGETTER(TimeRemaining))(LONG *aTimeRemaining);
    7071    STDMETHOD(COMGETTER(Completed))(BOOL *aCompleted);
    7172    STDMETHOD(COMGETTER(Canceled))(BOOL *aCanceled);
    7273    STDMETHOD(COMGETTER(ResultCode))(LONG *aResultCode);
    7374    STDMETHOD(COMGETTER(ErrorInfo))(IVirtualBoxErrorInfo **aErrorInfo);
     75    //STDMETHOD(COMGETTER(OperationCount))(ULONG *aOperationCount); - not necessary
     76    STDMETHOD(COMGETTER(Operation))(ULONG *aOperation);
     77    STDMETHOD(COMGETTER(OperationDescription))(BSTR *aOperationDescription);
    7478    STDMETHOD(COMGETTER(OperationPercent))(ULONG *aOperationPercent);
    7579    STDMETHOD(COMSETTER(Timeout))(ULONG aTimeout);
     
    8589    // public methods only for internal purposes
    8690
    87     HRESULT setResultCode(HRESULT aResultCode);
    8891    HRESULT notifyComplete(HRESULT aResultCode);
    8992    HRESULT notifyComplete(HRESULT aResultCode,
     
    9194                           const Bstr &aComponent,
    9295                           const char *aText, ...);
    93     bool    notifyPointOfNoReturn(void);
    94     bool    setOtherProgressObject(IProgress *pOtherProgress, ULONG uOperationWeight);
    95     bool    clearOtherProgressObject(const char *pszLastOperationDescription, ULONG uLastOperationWeight);
     96    bool    setOtherProgressObject(IProgress *pOtherProgress);
    9697
    9798    /** For com::SupportErrorInfoImpl. */
     
    105106    /** The other progress object.  This can be NULL. */
    106107    ComPtr<IProgress> mptrOtherProgress;
    107     /** The number of other progress objects expected. */
    108     ULONG mcOtherProgressObjects;
    109     /** The current other progress object. */
    110     ULONG miCurOtherProgressObject;
     108    /** Set if the other progress object has multiple operations. */
     109    bool mfMultiOperation;
     110    /** The weight the other progress object started at. */
     111    ULONG muOtherProgressStartWeight;
     112    /** The weight of other progress object. */
     113    ULONG muOtherProgressWeight;
     114    /** The operation number the other progress object started at. */
     115    ULONG muOtherProgressStartOperation;
    111116
    112117};
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