Changeset 69321 in vbox for trunk/src/VBox/Main/src-server/MediumImpl.cpp
- Timestamp:
- Oct 25, 2017 6:57:26 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r68789 r69321 242 242 /* Set up a per-operation progress interface, can be used freely (for 243 243 * binary operations you can use it either on the source or target). */ 244 mVDIfProgress .pfnProgress = vdProgressCall;244 mVDIfProgress = VDINTERFACEPROGRESS_INITALIZER(aProgress->i_vdProgressCallback); 245 245 int vrc = VDInterfaceAdd(&mVDIfProgress.Core, 246 246 "Medium::Task::vdInterfaceProgress", 247 247 VDINTERFACETYPE_PROGRESS, 248 248 mProgress, 249 sizeof( VDINTERFACEPROGRESS),249 sizeof(mVDIfProgress), 250 250 &mVDOperationIfaces); 251 251 AssertRC(vrc); … … 315 315 316 316 const ComObjPtr<Progress> mProgress; 317 318 static DECLCALLBACK(int) vdProgressCall(void *pvUser, unsigned uPercent);319 317 320 318 VDINTERFACEPROGRESS mVDIfProgress; … … 800 798 VDINTERFACECRYPTO vdIfCrypto; 801 799 }; 802 803 /**804 * PFNVDPROGRESS callback handler for Task operations.805 *806 * @param pvUser Pointer to the Progress instance.807 * @param uPercent Completion percentage (0-100).808 */809 /*static*/810 DECLCALLBACK(int) Medium::Task::vdProgressCall(void *pvUser, unsigned uPercent)811 {812 Progress *that = static_cast<Progress *>(pvUser);813 814 if (that != NULL)815 {816 /* update the progress object, capping it at 99% as the final percent817 * is used for additional operations like setting the UUIDs and similar. */818 HRESULT rc = that->SetCurrentOperationProgress(uPercent * 99 / 100);819 if (FAILED(rc))820 {821 if (rc == E_FAIL)822 return VERR_CANCELLED;823 else824 return VERR_INVALID_STATE;825 }826 }827 828 return VINF_SUCCESS;829 }830 800 831 801 /**
Note:
See TracChangeset
for help on using the changeset viewer.