VirtualBox

Changeset 77038 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 30, 2019 11:16:17 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128481
Message:

Guest Control/Main: Fixed the number of operations when copying from guest to the host (better fix, with debug assertion).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r77036 r77038  
    177177        && !fCompleted)
    178178    {
     179#ifdef VBOX_STRICT
     180        ULONG uCurOp; mProgress->COMGETTER(Operation(&uCurOp));
     181        ULONG cOps;   mProgress->COMGETTER(OperationCount(&cOps));
     182        AssertMsg(uCurOp + 1 /* Zero-based */ == cOps, ("Not all operations done yet (%u/%u)\n", uCurOp + 1, cOps));
     183#endif
    179184        HRESULT hr = mProgress->i_notifyComplete(S_OK);
    180185        if (FAILED(hr))
     
    14731478        Utf8Str strFirstOp = mDest + mVecLists[0]->mVecEntries[0]->strPath;
    14741479        hr = pProgress->init(static_cast<IGuestSession*>(mSession), Bstr(mDesc).raw(),
    1475                              TRUE /* aCancelable */, cOperations /* Number of operations */, Bstr(strFirstOp).raw());
     1480                             TRUE /* aCancelable */, cOperations + 1 /* Number of operations */, Bstr(strFirstOp).raw());
    14761481    }
    14771482    else /* If no operations have been defined, go with an "empty" progress object when will be used for error handling. */
     
    15361541                    strDstAbs.findReplace('\\', '/');
    15371542            }
     1543
     1544            mProgress->SetNextOperation(Bstr(strSrcAbs).raw(), 1);
    15381545
    15391546            switch (pEntry->fMode & RTFS_TYPE_MASK)
     
    15771584                break;
    15781585
    1579             mProgress->SetNextOperation(Bstr(strSrcAbs).raw(), 1);
    1580 
    15811586            ++itEntry;
    15821587        }
     
    17251730        Assert(mVecLists[0]->mVecEntries.size());
    17261731
    1727         Utf8Str strFirstOp = mDest + mVecLists[0]->mVecEntries[0]->strPath;
    1728 
    17291732        hr = pProgress->init(static_cast<IGuestSession*>(mSession), Bstr(mDesc).raw(),
    1730                              TRUE /* aCancelable */, cOperations /* Number of operations */,
    1731                              Bstr(strFirstOp).raw());
     1733                             TRUE /* aCancelable */, cOperations + 1 /* Number of operations */,
     1734                             Bstr(mDesc).raw());
    17321735    }
    17331736    else /* If no operations have been defined, go with an "empty" progress object when will be used for error handling. */
     
    18011804                strDstAbs += pEntry->strPath;
    18021805            }
     1806
     1807            mProgress->SetNextOperation(Bstr(strSrcAbs).raw(), 1);
    18031808
    18041809            switch (pEntry->fMode & RTFS_TYPE_MASK)
     
    18401845            if (RT_FAILURE(rc))
    18411846                break;
    1842 
    1843             mProgress->SetNextOperation(Bstr(strSrcAbs).raw(), 1);
    18441847
    18451848            ++itEntry;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette