- Timestamp:
- Mar 25, 2014 6:29:02 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 92972
- Location:
- trunk/src/VBox/Main
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r50832 r50874 729 729 VBoxC_SOURCES += \ 730 730 src-client/AudioSnifferInterface.cpp 731 endif 731 endif 732 732 VBoxC_SOURCES.win = \ 733 733 src-client/win/dllmain.cpp \ … … 841 841 LIBRARIES += VBoxCOM 842 842 VBoxCOM_TEMPLATE = VBoxMainLib 843 VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) 843 VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \ 844 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS) 844 845 VBoxCOM_SOURCES = \ 845 846 glue/com.cpp \ … … 851 852 glue/ErrorInfo.cpp \ 852 853 glue/errorprint.cpp 853 VBoxCOM_INCS += \854 VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \ 854 855 include 855 856 ifeq ($(KBUILD_TARGET),win) -
trunk/src/VBox/Main/include/GuestFileImpl.h
r50618 r50874 62 62 int i_openFile(uint32_t uTimeoutMS, int *pGuestRc); 63 63 int i_readData(uint32_t uSize, uint32_t uTimeoutMS, void* pvData, uint32_t cbData, uint32_t* pcbRead); 64 int i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS, void* pvData, size_t cbData, size_t* pcbRead); 64 int i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS, 65 void* pvData, size_t cbData, size_t* pcbRead); 65 66 int i_seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType, uint32_t uTimeoutMS, uint64_t *puOffset); 66 67 static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc); -
trunk/src/VBox/Main/include/GuestProcessImpl.h
r50709 r50874 52 52 static Utf8Str i_guestErrorToString(int guestRc); 53 53 int i_onRemove(void); 54 int i_readData(uint32_t uHandle, uint32_t uSize, uint32_t uTimeoutMS, void *pvData, size_t cbData, uint32_t *pcbRead, int *pGuestRc); 54 int i_readData(uint32_t uHandle, uint32_t uSize, uint32_t uTimeoutMS, void *pvData, 55 size_t cbData, uint32_t *pcbRead, int *pGuestRc); 55 56 static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc); 56 57 int i_startProcess(uint32_t uTimeoutMS, int *pGuestRc); 57 58 int i_startProcessAsync(void); 58 59 int i_terminateProcess(uint32_t uTimeoutMS, int *pGuestRc); 59 static ProcessWaitResult_T i_waitFlagsToResultEx(uint32_t fWaitFlags, ProcessStatus_T oldStatus, ProcessStatus_T newStatus, uint32_t uProcFlags, uint32_t uProtocol); 60 static ProcessWaitResult_T i_waitFlagsToResultEx(uint32_t fWaitFlags, ProcessStatus_T oldStatus, 61 ProcessStatus_T newStatus, uint32_t uProcFlags, 62 uint32_t uProtocol); 60 63 ProcessWaitResult_T i_waitFlagsToResult(uint32_t fWaitFlags); 61 64 int i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, ProcessWaitResult_T &waitResult, int *pGuestRc); 62 int i_waitForInputNotify(GuestWaitEvent *pEvent, uint32_t uHandle, uint32_t uTimeoutMS, ProcessInputStatus_T *pInputStatus, uint32_t *pcbProcessed); 63 int i_waitForOutput(GuestWaitEvent *pEvent, uint32_t uHandle, uint32_t uTimeoutMS, void* pvData, size_t cbData, uint32_t *pcbRead); 64 int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, ProcessStatus_T *pProcessStatus, int *pGuestRc); 65 static bool i_waitResultImpliesEx(ProcessWaitResult_T waitResult, ProcessStatus_T procStatus, uint32_t uProcFlags, uint32_t uProtocol); 66 int i_writeData(uint32_t uHandle, uint32_t uFlags, void *pvData, size_t cbData, uint32_t uTimeoutMS, uint32_t *puWritten, int *pGuestRc); 65 int i_waitForInputNotify(GuestWaitEvent *pEvent, uint32_t uHandle, uint32_t uTimeoutMS, 66 ProcessInputStatus_T *pInputStatus, uint32_t *pcbProcessed); 67 int i_waitForOutput(GuestWaitEvent *pEvent, uint32_t uHandle, uint32_t uTimeoutMS, 68 void* pvData, size_t cbData, uint32_t *pcbRead); 69 int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, 70 ProcessStatus_T *pProcessStatus, int *pGuestRc); 71 static bool i_waitResultImpliesEx(ProcessWaitResult_T waitResult, ProcessStatus_T procStatus, 72 uint32_t uProcFlags, uint32_t uProtocol); 73 int i_writeData(uint32_t uHandle, uint32_t uFlags, void *pvData, size_t cbData, 74 uint32_t uTimeoutMS, uint32_t *puWritten, int *pGuestRc); 67 75 /** @} */ 68 76 … … 182 190 static int i_run(GuestSession *pGuestSession, const GuestProcessStartupInfo &startupInfo, int *pGuestRc); 183 191 184 static int i_runEx(GuestSession *pGuestSession, const GuestProcessStartupInfo &startupInfo, GuestCtrlStreamObjects *pStrmOutObjects,185 uint32_t cStrmOutObjects, int *pGuestRc);192 static int i_runEx(GuestSession *pGuestSession, const GuestProcessStartupInfo &startupInfo, 193 GuestCtrlStreamObjects *pStrmOutObjects, uint32_t cStrmOutObjects, int *pGuestRc); 186 194 187 195 int i_terminatedOk(LONG *pExitCode); -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r50764 r50874 395 395 int i_directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags, int *pGuestRc); 396 396 int i_directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode, uint32_t uFlags, int *pGuestRc); 397 int i_objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, Utf8Str &strName, int *pGuestRc); 398 int i_directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo, ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc); 397 int i_objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, 398 Utf8Str &strName, int *pGuestRc); 399 int i_directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo, 400 ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc); 399 401 int i_directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc); 400 402 int i_dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb); … … 425 427 Guest *i_getParent(void) { return mParent; } 426 428 uint32_t i_getProtocolVersion(void) { return mData.mProtocolVersion; } 427 int i_pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags, int *pGuestRc); 429 int i_pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags, 430 int *pGuestRc); 428 431 int i_processRemoveFromList(GuestProcess *pProcess); 429 432 int i_processCreateExInteral(GuestProcessStartupInfo &procInfo, ComObjPtr<GuestProcess> &pProgress); … … 434 437 int i_setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc); 435 438 int i_signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */); 436 int i_startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress); 439 int i_startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, 440 ComObjPtr<Progress> &pProgress); 437 441 int i_queryInfo(void); 438 442 int i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc); 439 int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS, GuestSessionStatus_T *pSessionStatus, int *pGuestRc); 443 int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS, 444 GuestSessionStatus_T *pSessionStatus, int *pGuestRc); 440 445 /** @} */ 441 446 -
trunk/src/VBox/Main/include/ProgressImpl.h
r44528 r50874 20 20 #define ____H_PROGRESSIMPL 21 21 22 #include "ProgressWrap.h" 22 23 #include "VirtualBoxBase.h" 23 24 … … 30 31 */ 31 32 class ATL_NO_VTABLE Progress : 32 public VirtualBoxBase, 33 VBOX_SCRIPTABLE_IMPL(IProgress) 33 public ProgressWrap 34 34 { 35 35 protected: … … 37 37 DECLARE_EMPTY_CTOR_DTOR (Progress) 38 38 39 40 void checkForAutomaticTimeout(void); 39 void i_checkForAutomaticTimeout(void); 41 40 42 41 #if !defined (VBOX_COM_INPROC) … … 48 47 49 48 const Guid mId; 50 const Bstr mDescription;49 const com::Utf8Str mDescription; 51 50 52 51 uint64_t m_ullTimestamp; // progress object creation timestamp, for ETA computation … … 63 62 ComPtr<IVirtualBoxErrorInfo> mErrorInfo; 64 63 65 ULONG m_cOperations; // number of operations (so that progress dialog can display something like 1/3) 64 ULONG m_cOperations; // number of operations (so that progress dialog can 65 // display something like 1/3) 66 66 ULONG m_ulTotalOperationsWeight; // sum of weights of all operations, given to constructor 67 67 68 68 ULONG m_ulOperationsCompletedWeight; // summed-up weight of operations that have been completed; initially 0 69 69 70 ULONG m_ulCurrentOperation; // operations counter, incremented with each setNextOperation() 71 Bstr m_bstrOperationDescription; // name of current operation; initially from constructor, changed with setNextOperation() 70 ULONG m_ulCurrentOperation; // operations counter, incremented with 71 // each setNextOperation() 72 com::Utf8Str m_operationDescription; // name of current operation; initially 73 // from constructor, changed with setNextOperation() 72 74 ULONG m_ulCurrentOperationWeight; // weight of current operation, given to setNextOperation() 73 75 ULONG m_ulOperationPercent; // percentage of current operation, set with setCurrentOperationProgress() … … 75 77 76 78 public: 77 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Progress, IProgress)78 79 79 DECLARE_NOT_AGGREGATABLE (Progress) 80 81 DECLARE_PROTECT_FINAL_CONSTRUCT()82 83 BEGIN_COM_MAP (Progress)84 VBOX_DEFAULT_INTERFACE_ENTRIES (IProgress)85 END_COM_MAP()86 80 87 81 HRESULT FinalConstruct(); … … 105 99 #endif 106 100 IUnknown *aInitiator, 107 CBSTRaDescription,101 Utf8Str aDescription, 108 102 BOOL aCancelable, 109 103 OUT_GUID aId = NULL) … … 118 112 1, // cOperations 119 113 1, // ulTotalOperationsWeight 120 aDescription, // bstrFirstOperationDescription114 aDescription, // aFirstOperationDescription 121 115 1, // ulFirstOperationWeight 122 116 aId); … … 140 134 #endif 141 135 IUnknown *aInitiator, 142 CBSTRaDescription, BOOL aCancelable,136 Utf8Str aDescription, BOOL aCancelable, 143 137 ULONG cOperations, 144 CBSTR bstrFirstOperationDescription,138 Utf8Str aFirstOperationDescription, 145 139 OUT_GUID aId = NULL) 146 140 { … … 154 148 cOperations, // cOperations 155 149 cOperations, // ulTotalOperationsWeight = cOperations 156 bstrFirstOperationDescription, // bstrFirstOperationDescription150 aFirstOperationDescription, // aFirstOperationDescription 157 151 1, // ulFirstOperationWeight: weigh them all the same 158 152 aId); … … 164 158 #endif 165 159 IUnknown *aInitiator, 166 CBSTRaDescription,160 Utf8Str aDescription, 167 161 BOOL aCancelable, 168 162 ULONG cOperations, 169 163 ULONG ulTotalOperationsWeight, 170 CBSTR bstrFirstOperationDescription,164 Utf8Str aFirstOperationDescription, 171 165 ULONG ulFirstOperationWeight, 172 166 OUT_GUID aId = NULL); … … 174 168 HRESULT init(BOOL aCancelable, 175 169 ULONG aOperationCount, 176 CBSTRaOperationDescription);170 Utf8Str aOperationDescription); 177 171 178 172 // initializer/uninitializer for internal purposes only … … 182 176 #endif 183 177 IUnknown *aInitiator, 184 CBSTRaDescription, OUT_GUID aId = NULL);178 Utf8Str aDescription, OUT_GUID aId = NULL); 185 179 HRESULT init(AutoInitSpan &aAutoInitSpan); 186 180 void init(AutoUninitSpan &aAutoUninitSpan); … … 188 182 void uninit(AutoUninitSpan &aAutoUninitSpan); 189 183 190 // IProgress methods191 STDMETHOD(WaitForCompletion)(LONG aTimeout);192 STDMETHOD(WaitForOperationCompletion)(ULONG aOperation, LONG aTimeout);193 STDMETHOD(WaitForAsyncProgressCompletion)(IProgress *pProgressAsync);194 STDMETHOD(Cancel)();195 196 STDMETHOD(SetCurrentOperationProgress)(ULONG aPercent);197 STDMETHOD(SetNextOperation)(IN_BSTR bstrNextOperationDescription, ULONG ulNextOperationsWeight);198 184 199 185 // public methods only for internal purposes 200 201 HRESULT setResultCode(HRESULT aResultCode); 202 203 HRESULT notifyComplete(HRESULT aResultCode); 204 HRESULT notifyComplete(HRESULT aResultCode, 205 const GUID &aIID, 206 const char *pcszComponent, 207 const char *aText, 208 ...); 209 HRESULT notifyCompleteV(HRESULT aResultCode, 210 const GUID &aIID, 211 const char *pcszComponent, 212 const char *aText, 213 va_list va); 214 bool notifyPointOfNoReturn(void); 215 216 // IProgress properties 217 STDMETHOD(COMGETTER(Id)) (BSTR *aId); 218 STDMETHOD(COMGETTER(Description)) (BSTR *aDescription); 219 STDMETHOD(COMGETTER(Initiator)) (IUnknown **aInitiator); 220 221 // IProgress properties 222 STDMETHOD(COMGETTER(Cancelable)) (BOOL *aCancelable); 223 STDMETHOD(COMGETTER(Percent)) (ULONG *aPercent); 224 STDMETHOD(COMGETTER(TimeRemaining)) (LONG *aTimeRemaining); 225 STDMETHOD(COMGETTER(Completed)) (BOOL *aCompleted); 226 STDMETHOD(COMGETTER(Canceled)) (BOOL *aCanceled); 227 STDMETHOD(COMGETTER(ResultCode)) (LONG *aResultCode); 228 STDMETHOD(COMGETTER(ErrorInfo)) (IVirtualBoxErrorInfo **aErrorInfo); 229 STDMETHOD(COMGETTER(OperationCount)) (ULONG *aOperationCount); 230 STDMETHOD(COMGETTER(Operation)) (ULONG *aOperation); 231 STDMETHOD(COMGETTER(OperationDescription)) (BSTR *aOperationDescription); 232 STDMETHOD(COMGETTER(OperationPercent)) (ULONG *aOperationPercent); 233 STDMETHOD(COMGETTER(OperationWeight)) (ULONG *aOperationWeight); 234 STDMETHOD(COMSETTER(Timeout)) (ULONG aTimeout); 235 STDMETHOD(COMGETTER(Timeout)) (ULONG *aTimeout); 186 HRESULT i_setResultCode(HRESULT aResultCode); 187 188 HRESULT i_notifyComplete(HRESULT aResultCode); 189 HRESULT i_notifyComplete(HRESULT aResultCode, 190 const GUID &aIID, 191 const char *pcszComponent, 192 const char *aText, 193 ...); 194 HRESULT i_notifyCompleteV(HRESULT aResultCode, 195 const GUID &aIID, 196 const char *pcszComponent, 197 const char *aText, 198 va_list va); 199 bool i_notifyPointOfNoReturn(void); 236 200 237 201 // public methods only for internal purposes 238 239 bool setCancelCallback(void (*pfnCallback)(void *), void *pvUser); 240 202 bool i_setCancelCallback(void (*pfnCallback)(void *), void *pvUser); 241 203 242 204 // unsafe inline public methods for internal purposes only (ensure there is 243 205 // a caller and a read lock before calling them!) 244 BOOL getCompleted() const { return mCompleted; }245 HRESULT getResultCode() const { return mResultCode; }246 double calcTotalPercent();206 BOOL i_getCompleted() const { return mCompleted; } 207 HRESULT i_getResultCode() const { return mResultCode; } 208 double i_calcTotalPercent(); 247 209 248 210 private: 211 212 // Wrapped IProgress Data 213 HRESULT getId(com::Guid &aId); 214 HRESULT getDescription(com::Utf8Str &aDescription); 215 HRESULT getInitiator(ComPtr<IUnknown> &aInitiator); 216 HRESULT getCancelable(BOOL *aCancelable); 217 HRESULT getPercent(ULONG *aPercent); 218 HRESULT getTimeRemaining(LONG *aTimeRemaining); 219 HRESULT getCompleted(BOOL *aCompleted); 220 HRESULT getCanceled(BOOL *aCanceled); 221 HRESULT getResultCode(LONG *aResultCode); 222 HRESULT getErrorInfo(ComPtr<IVirtualBoxErrorInfo> &aErrorInfo); 223 HRESULT getOperationCount(ULONG *aOperationCount); 224 HRESULT getOperation(ULONG *aOperation); 225 HRESULT getOperationDescription(com::Utf8Str &aOperationDescription); 226 HRESULT getOperationPercent(ULONG *aOperationPercent); 227 HRESULT getOperationWeight(ULONG *aOperationWeight); 228 HRESULT getTimeout(ULONG *aTimeout); 229 HRESULT setTimeout(ULONG aTimeout); 230 HRESULT setCurrentOperationProgress(ULONG aPercent); 231 HRESULT setNextOperation(const com::Utf8Str &aNextOperationDescription, 232 ULONG aNextOperationsWeight); 233 234 // Wrapped Iprogress methods 235 HRESULT waitForCompletion(LONG aTimeout); 236 HRESULT waitForOperationCompletion(ULONG aOperation, 237 LONG aTimeout); 238 HRESULT waitForAsyncProgressCompletion(const ComPtr<IProgress> &aPProgressAsync); 239 HRESULT cancel(); 240 249 241 250 242 RTSEMEVENTMULTI mCompletedSem; -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r49130 r50874 234 234 * @param a_pVirtualBox Pointer to the VirtualBox object. 235 235 */ 236 HRESULT ExtPackFile::initWithFile(const char *a_pszFile, const char *a_pszDigest, ExtPackManager *a_pExtPackMgr, VirtualBox *a_pVirtualBox) 236 HRESULT ExtPackFile::initWithFile(const char *a_pszFile, const char *a_pszDigest, ExtPackManager *a_pExtPackMgr, 237 VirtualBox *a_pVirtualBox) 237 238 { 238 239 AutoInitSpan autoInitSpan(this); … … 313 314 * dropped. */ 314 315 if (!strSavedName.equalsIgnoreCase(m->Desc.strName)) 315 return initFailed(tr("Extension pack name mismatch between the downloaded file and the XML inside it (xml='%s' file='%s')"), 316 m->Desc.strName.c_str(), strSavedName.c_str()); 316 { 317 Utf8Str str; 318 str = "Extension pack name mismatch between the downloaded file"; 319 str += "and the XML inside it (xml='%s' file='%s')"; 320 return initFailed(tr(str.c_str()), m->Desc.strName.c_str(), strSavedName.c_str()); 321 } 317 322 318 323 m->fUsable = true; … … 530 535 strPreferredLocale.c_str(), strPreferredLanguage.c_str(), strFormat.c_str()); 531 536 else if (strPreferredLocale.isNotEmpty()) 532 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-%s.%s", strPreferredLocale.c_str(), strFormat.c_str()); 537 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-%s.%s", 538 strPreferredLocale.c_str(), strFormat.c_str()); 533 539 else if (strPreferredLanguage.isNotEmpty()) 534 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-_%s.%s", strPreferredLocale.c_str(), strFormat.c_str()); 540 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-_%s.%s", 541 strPreferredLocale.c_str(), strFormat.c_str()); 535 542 else 536 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX ".%s", strFormat.c_str());537 543 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX ".%s", 544 strFormat.c_str()); 538 545 /* 539 546 * Lock the extension pack. We need a write lock here as there must not be … … 1254 1261 { 1255 1262 if (RTFS_IS_SYMLINK(m->ObjInfoExtPack.Attr.fMode)) 1256 m->strWhyUnusable.printf(tr("'%s' is a symbolic link, this is not allowed"), m->strExtPackPath.c_str(), vrc); 1263 m->strWhyUnusable.printf(tr("'%s' is a symbolic link, this is not allowed"), 1264 m->strExtPackPath.c_str(), vrc); 1257 1265 else if (RTFS_IS_FILE(m->ObjInfoExtPack.Attr.fMode)) 1258 m->strWhyUnusable.printf(tr("'%s' is a symbolic file, not a directory"), m->strExtPackPath.c_str(), vrc); 1266 m->strWhyUnusable.printf(tr("'%s' is a symbolic file, not a directory"), 1267 m->strExtPackPath.c_str(), vrc); 1259 1268 else 1260 m->strWhyUnusable.printf(tr("'%s' is not a directory (fMode=%#x)"), m->strExtPackPath.c_str(), m->ObjInfoExtPack.Attr.fMode); 1269 m->strWhyUnusable.printf(tr("'%s' is not a directory (fMode=%#x)"), 1270 m->strExtPackPath.c_str(), m->ObjInfoExtPack.Attr.fMode); 1261 1271 return; 1262 1272 } … … 1813 1823 strPreferredLocale.c_str(), strPreferredLanguage.c_str(), strFormat.c_str()); 1814 1824 else if (strPreferredLocale.isNotEmpty()) 1815 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-%s.%s", strPreferredLocale.c_str(), strFormat.c_str()); 1825 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-%s.%s", 1826 strPreferredLocale.c_str(), strFormat.c_str()); 1816 1827 else if (strPreferredLanguage.isNotEmpty()) 1817 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-_%s.%s", strPreferredLocale.c_str(), strFormat.c_str()); 1828 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX "-_%s.%s", 1829 strPreferredLocale.c_str(), strFormat.c_str()); 1818 1830 else 1819 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX ".%s", strFormat.c_str()); 1831 RTStrPrintf(szName, sizeof(szName), VBOX_EXTPACK_LICENSE_NAME_PREFIX ".%s", 1832 strFormat.c_str()); 1820 1833 1821 1834 /* … … 2662 2675 PEXTPACKINSTALLJOB pJob = (PEXTPACKINSTALLJOB)pvJob; 2663 2676 HRESULT hrc = pJob->ptrExtPackMgr->doInstall(pJob->ptrExtPackFile, pJob->fReplace, &pJob->strDisplayInfo); 2664 pJob->ptrProgress-> notifyComplete(hrc);2677 pJob->ptrProgress->i_notifyComplete(hrc); 2665 2678 delete pJob; 2666 2679 … … 2793 2806 PEXTPACKUNINSTALLJOB pJob = (PEXTPACKUNINSTALLJOB)pvJob; 2794 2807 HRESULT hrc = pJob->ptrExtPackMgr->doUninstall(&pJob->strName, pJob->fForcedRemoval, &pJob->strDisplayInfo); 2795 pJob->ptrProgress-> notifyComplete(hrc);2808 pJob->ptrProgress->i_notifyComplete(hrc); 2796 2809 delete pJob; 2797 2810 … … 3094 3107 hrc = pExtPack->getVrdpLibraryName(a_pstrVrdeLibrary); 3095 3108 else 3096 hrc = setError(VBOX_E_OBJECT_NOT_FOUND, tr("No extension pack by the name '%s' was found"), a_pstrExtPack->c_str()); 3109 hrc = setError(VBOX_E_OBJECT_NOT_FOUND, tr("No extension pack by the name '%s' was found"), 3110 a_pstrExtPack->c_str()); 3097 3111 } 3098 3112 … … 3109 3123 * @param a_pstrVrdeLibrary Where to return the path. 3110 3124 */ 3111 HRESULT ExtPackManager::getLibraryPathForExtPack(const char *a_pszModuleName, Utf8Str const *a_pstrExtPack, Utf8Str *a_pstrLibrary) 3125 HRESULT ExtPackManager::getLibraryPathForExtPack(const char *a_pszModuleName, Utf8Str const *a_pstrExtPack, 3126 Utf8Str *a_pstrLibrary) 3112 3127 { 3113 3128 AutoCaller autoCaller(this); -
trunk/src/VBox/Main/src-all/ProgressImpl.cpp
r50355 r50874 58 58 ///////////////////////////////////////////////////////////////////////////// 59 59 60 STDMETHODIMP Progress::COMGETTER(Id)(BSTR *aId) 61 { 62 CheckComArgOutPointerValid(aId); 63 64 AutoCaller autoCaller(this); 65 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 66 60 HRESULT Progress::getId(com::Guid &aId) 61 { 67 62 /* mId is constant during life time, no need to lock */ 68 mId.toUtf16().cloneTo(aId); 69 70 return S_OK; 71 } 72 73 STDMETHODIMP Progress::COMGETTER(Description)(BSTR *aDescription) 74 { 75 CheckComArgOutPointerValid(aDescription); 76 77 AutoCaller autoCaller(this); 78 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 79 63 aId = mId; 64 65 return S_OK; 66 } 67 68 HRESULT Progress::getDescription(com::Utf8Str &aDescription) 69 { 80 70 /* mDescription is constant during life time, no need to lock */ 81 mDescription.cloneTo(aDescription); 82 83 return S_OK; 84 } 85 86 STDMETHODIMP Progress::COMGETTER(Initiator)(IUnknown **aInitiator) 87 { 88 CheckComArgOutPointerValid(aInitiator); 89 90 AutoCaller autoCaller(this); 91 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 71 aDescription = mDescription; 72 73 return S_OK; 74 } 75 HRESULT Progress::getInitiator(ComPtr<IUnknown> &aInitiator) 76 { 92 77 93 78 /* mInitiator/mParent are constant during life time, no need to lock */ … … 95 80 #if !defined(VBOX_COM_INPROC) 96 81 if (mInitiator) 97 mInitiator.queryInterfaceTo(aInitiator );82 mInitiator.queryInterfaceTo(aInitiator.asOutParam()); 98 83 else 99 84 { 100 85 ComObjPtr<VirtualBox> pVirtualBox(mParent); 101 pVirtualBox.queryInterfaceTo(aInitiator );86 pVirtualBox.queryInterfaceTo(aInitiator.asOutParam()); 102 87 } 103 88 #else 104 mInitiator.queryInterfaceTo(aInitiator );89 mInitiator.queryInterfaceTo(aInitiator.asOutParam()); 105 90 #endif 106 91 … … 108 93 } 109 94 110 STDMETHODIMP Progress::COMGETTER(Cancelable)(BOOL *aCancelable) 111 { 112 CheckComArgOutPointerValid(aCancelable); 113 114 AutoCaller autoCaller(this); 115 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 95 HRESULT Progress::getCancelable(BOOL *aCancelable) 96 { 116 97 117 98 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 131 112 * @return fractional percentage as a double value. 132 113 */ 133 double Progress:: calcTotalPercent()114 double Progress::i_calcTotalPercent() 134 115 { 135 116 // avoid division by zero … … 137 118 return 0; 138 119 139 double dPercent = ( (double)m_ulOperationsCompletedWeight // weight of operations that have been completed 140 + ((double)m_ulOperationPercent * (double)m_ulCurrentOperationWeight / (double)100) // plus partial weight of the current operation 120 double dPercent = ( (double)m_ulOperationsCompletedWeight // weight of operations that have been completed 121 + ((double)m_ulOperationPercent * 122 (double)m_ulCurrentOperationWeight / (double)100) // plus partial weight of the current operation 141 123 ) * (double)100 / (double)m_ulTotalOperationsWeight; 142 124 … … 149 131 * The caller should hold the object write lock. 150 132 */ 151 void Progress:: checkForAutomaticTimeout(void)133 void Progress::i_checkForAutomaticTimeout(void) 152 134 { 153 135 if ( m_cMsTimeout … … 159 141 } 160 142 161 162 STDMETHODIMP Progress::COMGETTER(TimeRemaining)(LONG *aTimeRemaining) 163 { 164 CheckComArgOutPointerValid(aTimeRemaining); 165 166 AutoCaller autoCaller(this); 167 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 168 143 HRESULT Progress::getTimeRemaining(LONG *aTimeRemaining) 144 { 169 145 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 170 146 … … 173 149 else 174 150 { 175 double dPercentDone = calcTotalPercent();151 double dPercentDone = i_calcTotalPercent(); 176 152 if (dPercentDone < 1) 177 153 *aTimeRemaining = -1; // unreliable, or avoid division by 0 below … … 183 159 uint64_t ullTimeRemaining = ullTimeTotal - ullTimeElapsed; 184 160 185 // Log(("Progress::GetTimeRemaining: dPercentDone %RI32, ullTimeNow = %RI64, ullTimeElapsed = %RI64, ullTimeTotal = %RI64, ullTimeRemaining = %RI64\n", 186 // (uint32_t)dPercentDone, ullTimeNow, ullTimeElapsed, ullTimeTotal, ullTimeRemaining)); 161 // Log(("Progress::GetTimeRemaining: dPercentDone %RI32, ullTimeNow = 162 // %RI64, ullTimeElapsed = %RI64, ullTimeTotal = %RI64, ullTimeRemaining = %RI64\n", 163 // (uint32_t)dPercentDone, ullTimeNow, ullTimeElapsed, ullTimeTotal, ullTimeRemaining)); 187 164 188 165 *aTimeRemaining = (LONG)(ullTimeRemaining / 1000); … … 193 170 } 194 171 195 STDMETHODIMP Progress::COMGETTER(Percent)(ULONG *aPercent) 196 { 197 CheckComArgOutPointerValid(aPercent); 198 199 AutoCaller autoCaller(this); 200 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 201 202 checkForAutomaticTimeout(); 172 HRESULT Progress::getPercent(ULONG *aPercent) 173 { 174 i_checkForAutomaticTimeout(); 203 175 204 176 /* checkForAutomaticTimeout requires a write lock. */ … … 209 181 else 210 182 { 211 ULONG ulPercent = (ULONG) calcTotalPercent();183 ULONG ulPercent = (ULONG)i_calcTotalPercent(); 212 184 // do not report 100% until we're really really done with everything as the Qt GUI dismisses progress dialogs in that case 213 185 if ( ulPercent == 100 … … 221 193 } 222 194 223 checkForAutomaticTimeout(); 224 225 return S_OK; 226 } 227 228 STDMETHODIMP Progress::COMGETTER(Completed)(BOOL *aCompleted) 229 { 230 CheckComArgOutPointerValid(aCompleted); 231 232 AutoCaller autoCaller(this); 233 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 234 195 i_checkForAutomaticTimeout(); 196 197 return S_OK; 198 } 199 200 HRESULT Progress::getCompleted(BOOL *aCompleted) 201 { 235 202 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 236 203 … … 240 207 } 241 208 242 STDMETHODIMP Progress::COMGETTER(Canceled)(BOOL *aCanceled) 243 { 244 CheckComArgOutPointerValid(aCanceled); 245 246 AutoCaller autoCaller(this); 247 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 248 209 HRESULT Progress::getCanceled(BOOL *aCanceled) 210 { 249 211 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 250 212 … … 254 216 } 255 217 256 STDMETHODIMP Progress::COMGETTER(ResultCode)(LONG *aResultCode) 257 { 258 CheckComArgOutPointerValid(aResultCode); 259 260 AutoCaller autoCaller(this); 261 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 262 218 HRESULT Progress::getResultCode(LONG *aResultCode) 219 { 263 220 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 264 221 … … 272 229 } 273 230 274 STDMETHODIMP Progress::COMGETTER(ErrorInfo)(IVirtualBoxErrorInfo **aErrorInfo) 275 { 276 CheckComArgOutPointerValid(aErrorInfo); 277 278 AutoCaller autoCaller(this); 279 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 280 231 HRESULT Progress::getErrorInfo(ComPtr<IVirtualBoxErrorInfo> &aErrorInfo) 232 { 281 233 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 282 234 … … 285 237 tr("Error info is not available, operation is still in progress")); 286 238 287 mErrorInfo.queryInterfaceTo(aErrorInfo); 288 289 return S_OK; 290 } 291 292 STDMETHODIMP Progress::COMGETTER(OperationCount)(ULONG *aOperationCount) 293 { 294 CheckComArgOutPointerValid(aOperationCount); 295 296 AutoCaller autoCaller(this); 297 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 298 239 mErrorInfo.queryInterfaceTo(aErrorInfo.asOutParam()); 240 241 return S_OK; 242 } 243 244 HRESULT Progress::getOperationCount(ULONG *aOperationCount) 245 { 299 246 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 300 247 … … 304 251 } 305 252 306 STDMETHODIMP Progress::COMGETTER(Operation)(ULONG *aOperation) 307 { 308 CheckComArgOutPointerValid(aOperation); 309 310 AutoCaller autoCaller(this); 311 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 312 253 HRESULT Progress::getOperation(ULONG *aOperation) 254 { 313 255 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 314 256 … … 318 260 } 319 261 320 STDMETHODIMP Progress::COMGETTER(OperationDescription)(BSTR *aOperationDescription) 321 { 322 CheckComArgOutPointerValid(aOperationDescription); 323 324 AutoCaller autoCaller(this); 325 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 262 HRESULT Progress::getOperationDescription(com::Utf8Str &aOperationDescription) 263 { 326 264 327 265 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 328 266 329 m_bstrOperationDescription.cloneTo(aOperationDescription); 330 331 return S_OK; 332 } 333 334 STDMETHODIMP Progress::COMGETTER(OperationPercent)(ULONG *aOperationPercent) 335 { 336 CheckComArgOutPointerValid(aOperationPercent); 337 338 AutoCaller autoCaller(this); 339 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 340 267 aOperationDescription = m_operationDescription; 268 269 return S_OK; 270 } 271 272 HRESULT Progress::getOperationPercent(ULONG *aOperationPercent) 273 { 341 274 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 342 275 … … 349 282 } 350 283 351 STDMETHODIMP Progress::COMGETTER(OperationWeight)(ULONG *aOperationWeight) 352 { 353 CheckComArgOutPointerValid(aOperationWeight); 354 355 AutoCaller autoCaller(this); 356 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 357 284 HRESULT Progress::getOperationWeight(ULONG *aOperationWeight) 285 { 358 286 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 359 287 … … 363 291 } 364 292 365 STDMETHODIMP Progress::COMSETTER(Timeout)(ULONG aTimeout) 366 { 367 AutoCaller autoCaller(this); 368 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 369 293 HRESULT Progress::setTimeout(ULONG aTimeout) 294 { 370 295 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 371 296 … … 379 304 } 380 305 381 STDMETHODIMP Progress::COMGETTER(Timeout)(ULONG *aTimeout) 382 { 383 CheckComArgOutPointerValid(aTimeout); 384 385 AutoCaller autoCaller(this); 386 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 387 306 HRESULT Progress::getTimeout(ULONG *aTimeout) 307 { 388 308 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 389 309 … … 406 326 * @param pvUser The callback argument. 407 327 */ 408 bool Progress:: setCancelCallback(void (*pfnCallback)(void *), void *pvUser)328 bool Progress::i_setCancelCallback(void (*pfnCallback)(void *), void *pvUser) 409 329 { 410 330 AutoCaller autoCaller(this); … … 413 333 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 414 334 415 checkForAutomaticTimeout();335 i_checkForAutomaticTimeout(); 416 336 if (mCanceled) 417 337 return false; … … 516 436 #endif 517 437 IUnknown *aInitiator, 518 CBSTRaDescription,438 Utf8Str aDescription, 519 439 BOOL aCancelable, 520 440 ULONG cOperations, 521 441 ULONG ulTotalOperationsWeight, 522 CBSTR bstrFirstOperationDescription,442 Utf8Str aFirstOperationDescription, 523 443 ULONG ulFirstOperationWeight, 524 444 OUT_GUID aId /* = NULL */) 525 445 { 526 LogFlowThisFunc(("aDescription=\"%ls\", cOperations=%d, ulTotalOperationsWeight=%d, bstrFirstOperationDescription=\"%ls\", ulFirstOperationWeight=%d\n", 527 aDescription, 446 Utf8Str str = "aDescription=\"%s\", cOperations=%d, ulTotalOperationsWeight=%d, "; 447 LogFlowThisFunc((str.c_str(), 448 aDescription.c_str(), 528 449 cOperations, 529 450 ulTotalOperationsWeight, 530 bstrFirstOperationDescription,451 aFirstOperationDescription.c_str(), 531 452 ulFirstOperationWeight)); 532 453 533 AssertReturn(bstrFirstOperationDescription, E_INVALIDARG);534 454 AssertReturn(ulTotalOperationsWeight >= 1, E_INVALIDARG); 535 455 … … 552 472 #endif 553 473 554 AssertReturn(aDescription, E_INVALIDARG);555 556 474 #if !defined(VBOX_COM_INPROC) 557 475 /* share parent weakly */ … … 597 515 m_ulOperationsCompletedWeight = 0; 598 516 m_ulCurrentOperation = 0; 599 m_ bstrOperationDescription = bstrFirstOperationDescription;517 m_operationDescription = aFirstOperationDescription; 600 518 m_ulCurrentOperationWeight = ulFirstOperationWeight; 601 519 m_ulOperationPercent = 0; … … 630 548 HRESULT Progress::init(BOOL aCancelable, 631 549 ULONG aOperationCount, 632 CBSTRaOperationDescription)633 { 634 LogFlowThisFunc(("aOperationDescription=\"% ls\"\n", aOperationDescription));550 Utf8Str aOperationDescription) 551 { 552 LogFlowThisFunc(("aOperationDescription=\"%s\"\n", aOperationDescription.c_str())); 635 553 636 554 /* Enclose the state transition NotReady->InInit->Ready */ … … 652 570 m_ulOperationsCompletedWeight = 0; 653 571 m_ulCurrentOperation = 0; 654 m_ bstrOperationDescription = aOperationDescription;572 m_operationDescription = aOperationDescription; 655 573 m_ulCurrentOperationWeight = 1; 656 574 m_ulOperationPercent = 0; … … 686 604 if (mWaitersCount > 0) 687 605 { 688 LogFlow(("WARNING: There are still %d threads waiting for '% ls' completion!\n",689 mWaitersCount, mDescription. raw()));606 LogFlow(("WARNING: There are still %d threads waiting for '%s' completion!\n", 607 mWaitersCount, mDescription.c_str())); 690 608 RTSemEventMultiSignal(mCompletedSem); 691 609 } … … 722 640 * calling this method will definitely freeze event processing. 723 641 */ 724 STDMETHODIMP Progress::WaitForCompletion(LONG aTimeout)642 HRESULT Progress::waitForCompletion(LONG aTimeout) 725 643 { 726 644 LogFlowThisFuncEnter(); 727 645 LogFlowThisFunc(("aTimeout=%d\n", aTimeout)); 728 729 AutoCaller autoCaller(this);730 if (FAILED(autoCaller.rc())) return autoCaller.rc();731 646 732 647 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 781 696 * calling this method will definitely freeze event processing. 782 697 */ 783 STDMETHODIMP Progress::WaitForOperationCompletion(ULONG aOperation, LONG aTimeout) 698 HRESULT Progress::waitForOperationCompletion(ULONG aOperation, LONG aTimeout) 699 784 700 { 785 701 LogFlowThisFuncEnter(); 786 702 LogFlowThisFunc(("aOperation=%d, aTimeout=%d\n", aOperation, aTimeout)); 787 788 AutoCaller autoCaller(this);789 if (FAILED(autoCaller.rc())) return autoCaller.rc();790 703 791 704 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 839 752 } 840 753 841 STDMETHODIMP Progress::WaitForAsyncProgressCompletion(IProgress *pProgressAsync)754 HRESULT Progress::waitForAsyncProgressCompletion(const ComPtr<IProgress> &aPProgressAsync) 842 755 { 843 756 LogFlowThisFuncEnter(); 844 845 CheckComArgNotNull(pProgressAsync);846 847 AutoCaller autoCaller(this);848 if (FAILED(autoCaller.rc())) return autoCaller.rc();849 757 850 758 /* Note: we don't lock here, cause we just using public methods. */ … … 858 766 ULONG cOp = 0; 859 767 /* Is the async process cancelable? */ 860 rc = pProgressAsync->COMGETTER(Cancelable)(&fCancelable);768 rc = aPProgressAsync->COMGETTER(Cancelable)(&fCancelable); 861 769 if (FAILED(rc)) return rc; 862 770 /* Loop as long as the sync process isn't completed. */ 863 while (SUCCEEDED( pProgressAsync->COMGETTER(Completed(&fCompleted))))771 while (SUCCEEDED(aPProgressAsync->COMGETTER(Completed(&fCompleted)))) 864 772 { 865 773 /* We can forward any cancel request to the async process only when … … 871 779 if (fCanceled) 872 780 { 873 rc = pProgressAsync->Cancel();781 rc = aPProgressAsync->Cancel(); 874 782 if (FAILED(rc)) return rc; 875 783 } … … 888 796 for (;;) 889 797 { 890 rc = pProgressAsync->COMGETTER(Operation(&curOp));798 rc = aPProgressAsync->COMGETTER(Operation(&curOp)); 891 799 if (FAILED(rc)) return rc; 892 800 if (cOp != curOp) … … 894 802 Bstr bstr; 895 803 ULONG currentWeight; 896 rc = pProgressAsync->COMGETTER(OperationDescription(bstr.asOutParam()));804 rc = aPProgressAsync->COMGETTER(OperationDescription(bstr.asOutParam())); 897 805 if (FAILED(rc)) return rc; 898 rc = pProgressAsync->COMGETTER(OperationWeight(¤tWeight));806 rc = aPProgressAsync->COMGETTER(OperationWeight(¤tWeight)); 899 807 if (FAILED(rc)) return rc; 900 808 rc = SetNextOperation(bstr.raw(), currentWeight); … … 906 814 } 907 815 908 rc = pProgressAsync->COMGETTER(OperationPercent(¤tPercent));816 rc = aPProgressAsync->COMGETTER(OperationPercent(¤tPercent)); 909 817 if (FAILED(rc)) return rc; 910 818 if (currentPercent != prevPercent) … … 919 827 920 828 /* Make sure the loop is not too tight */ 921 rc = pProgressAsync->WaitForCompletion(100);829 rc = aPProgressAsync->WaitForCompletion(100); 922 830 if (FAILED(rc)) return rc; 923 831 } … … 928 836 } 929 837 930 STDMETHODIMP Progress::Cancel() 931 { 932 AutoCaller autoCaller(this); 933 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 934 838 HRESULT Progress::cancel() 839 { 935 840 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 936 841 … … 959 864 * (in range [0, 100]). 960 865 */ 961 STDMETHODIMP Progress::SetCurrentOperationProgress(ULONG aPercent) 962 { 963 AutoCaller autoCaller(this); 964 AssertComRCReturnRC(autoCaller.rc()); 965 866 HRESULT Progress::setCurrentOperationProgress(ULONG aPercent) 867 { 966 868 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 967 869 968 870 AssertMsgReturn(aPercent <= 100, ("%u\n", aPercent), E_INVALIDARG); 969 871 970 checkForAutomaticTimeout();872 i_checkForAutomaticTimeout(); 971 873 if (mCancelable && mCanceled) 972 874 { … … 989 891 * @note The current operation must not be the last one. 990 892 */ 991 STDMETHODIMP Progress::SetNextOperation(IN_BSTR bstrNextOperationDescription, ULONG ulNextOperationsWeight) 992 { 993 AssertReturn(bstrNextOperationDescription, E_INVALIDARG); 994 995 AutoCaller autoCaller(this); 996 AssertComRCReturnRC(autoCaller.rc()); 997 893 HRESULT Progress::setNextOperation(const com::Utf8Str &aNextOperationDescription, ULONG aNextOperationsWeight) 894 895 { 998 896 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 999 897 … … 1006 904 m_ulOperationsCompletedWeight += m_ulCurrentOperationWeight; 1007 905 1008 m_ bstrOperationDescription = bstrNextOperationDescription;1009 m_ulCurrentOperationWeight = ulNextOperationsWeight;906 m_operationDescription = aNextOperationDescription; 907 m_ulCurrentOperationWeight = aNextOperationsWeight; 1010 908 m_ulOperationPercent = 0; 1011 909 1012 Log(("Progress::setNextOperation(%ls): ulNextOperationsWeight = %d; m_ulCurrentOperation is now %d, m_ulOperationsCompletedWeight is now %d\n", 1013 m_bstrOperationDescription.raw(), ulNextOperationsWeight, m_ulCurrentOperation, m_ulOperationsCompletedWeight)); 910 Utf8Str str; 911 str = "Progress::setNextOperation(%s): ulNextOperationsWeight = %d; m_ulCurrentOperation is now %d,"; 912 str += "m_ulOperationsCompletedWeight is now %d\n"; 913 Log((str.c_str(), m_operationDescription.c_str(), aNextOperationsWeight, m_ulCurrentOperation, 914 m_ulOperationsCompletedWeight)); 1014 915 1015 916 /* wake up all waiting threads */ … … 1031 932 * @param aResultCode 1032 933 */ 1033 HRESULT Progress::setResultCode(HRESULT aResultCode) 1034 { 1035 AutoCaller autoCaller(this); 1036 AssertComRCReturnRC(autoCaller.rc()); 1037 934 HRESULT Progress::i_setResultCode(HRESULT aResultCode) 935 { 1038 936 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1039 937 … … 1102 1000 * @param aResultCode Operation result code. 1103 1001 */ 1104 HRESULT Progress:: notifyComplete(HRESULT aResultCode)1002 HRESULT Progress::i_notifyComplete(HRESULT aResultCode) 1105 1003 { 1106 1004 AutoCaller autoCaller(this); … … 1116 1014 aResultCode = E_FAIL; 1117 1015 1118 HRESULT rc = setResultCode(aResultCode);1016 HRESULT rc = i_setResultCode(aResultCode); 1119 1017 1120 1018 mCompleted = TRUE; … … 1142 1040 * Wrapper around Progress:notifyCompleteV. 1143 1041 */ 1144 HRESULT Progress:: notifyComplete(HRESULT aResultCode,1145 const GUID &aIID,1146 const char *pcszComponent,1147 const char *aText,1148 ...)1042 HRESULT Progress::i_notifyComplete(HRESULT aResultCode, 1043 const GUID &aIID, 1044 const char *pcszComponent, 1045 const char *aText, 1046 ...) 1149 1047 { 1150 1048 va_list va; 1151 1049 va_start(va, aText); 1152 HRESULT hrc = notifyCompleteV(aResultCode, aIID, pcszComponent, aText, va);1050 HRESULT hrc = i_notifyCompleteV(aResultCode, aIID, pcszComponent, aText, va); 1153 1051 va_end(va); 1154 1052 return hrc; … … 1168 1066 * @param va List of arguments for the format string. 1169 1067 */ 1170 HRESULT Progress:: notifyCompleteV(HRESULT aResultCode,1171 const GUID &aIID,1172 const char *pcszComponent,1173 const char *aText,1174 va_list va)1068 HRESULT Progress::i_notifyCompleteV(HRESULT aResultCode, 1069 const GUID &aIID, 1070 const char *pcszComponent, 1071 const char *aText, 1072 va_list va) 1175 1073 { 1176 1074 Utf8Str text(aText, va); … … 1227 1125 * invalid state 1228 1126 */ 1229 bool Progress:: notifyPointOfNoReturn(void)1127 bool Progress::i_notifyPointOfNoReturn(void) 1230 1128 { 1231 1129 AutoCaller autoCaller(this); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r50737 r50874 3534 3534 // private methods 3535 3535 ///////////////////////////////////////////////////////////////////////////// 3536 3536 3537 3537 /** 3538 3538 * Suspend the VM before we do any medium or network attachment change. … … 6908 6908 /* The progress object will fetch the current error info */ 6909 6909 if (!pPowerupProgress.isNull()) 6910 pPowerupProgress-> notifyComplete(rc);6910 pPowerupProgress->i_notifyComplete(rc); 6911 6911 6912 6912 /* Save the error info across the IPC below. Can't be done before the … … 9176 9176 rc = pMachine->COMGETTER(FaultTolerancePassword)(bstrPassword.asOutParam()); 9177 9177 } 9178 if (task->mProgress-> setCancelCallback(faultToleranceProgressCancelCallback, pConsole->mpUVM))9178 if (task->mProgress->i_setCancelCallback(faultToleranceProgressCancelCallback, pConsole->mpUVM)) 9179 9179 { 9180 9180 if (SUCCEEDED(rc)) … … 9198 9198 AssertLogRelRC(vrc); 9199 9199 } 9200 task->mProgress-> setCancelCallback(NULL, NULL);9200 task->mProgress->i_setCancelCallback(NULL, NULL); 9201 9201 } 9202 9202 else … … 9316 9316 { 9317 9317 /* Notify the progress object of the success */ 9318 task->mProgress-> notifyComplete(S_OK);9318 task->mProgress->i_notifyComplete(S_OK); 9319 9319 } 9320 9320 else 9321 9321 { 9322 9322 /* The progress object will fetch the current error info */ 9323 task->mProgress-> notifyComplete(rc);9323 task->mProgress->i_notifyComplete(rc); 9324 9324 LogRel(("Power up failed (vrc=%Rrc, rc=%Rhrc (%#08X))\n", vrc, rc, rc)); 9325 9325 } … … 9518 9518 Utf8Str strSavedStateFile(pTask->bstrSavedStateFile); 9519 9519 9520 pTask->mProgress-> setCancelCallback(takesnapshotProgressCancelCallback, ptrVM.rawUVM());9520 pTask->mProgress->i_setCancelCallback(takesnapshotProgressCancelCallback, ptrVM.rawUVM()); 9521 9521 9522 9522 alock.release(); … … 9534 9534 strSavedStateFile.c_str(), vrc); 9535 9535 9536 pTask->mProgress-> setCancelCallback(NULL, NULL);9536 pTask->mProgress->i_setCancelCallback(NULL, NULL); 9537 9537 } 9538 9538 else 9539 9539 LogRel(("Console: skipped saving state as part of online snapshot\n")); 9540 9540 9541 if (!pTask->mProgress-> notifyPointOfNoReturn())9541 if (!pTask->mProgress->i_notifyPointOfNoReturn()) 9542 9542 throw setErrorStatic(E_FAIL, tr("Canceled")); 9543 9543 that->mptrCancelableProgress.setNull(); … … 9638 9638 9639 9639 if (FAILED(rc)) /* Must come before calling setMachineState. */ 9640 pTask->mProgress-> notifyComplete(rc);9640 pTask->mProgress->i_notifyComplete(rc); 9641 9641 9642 9642 /* … … 9669 9669 { 9670 9670 rc = setErrorStatic(VBOX_E_VM_ERROR, tr("Could not resume the machine execution (%Rrc)"), vrc); 9671 pTask->mProgress-> notifyComplete(rc);9671 pTask->mProgress->i_notifyComplete(rc); 9672 9672 if (that->mMachineState == MachineState_Saving) 9673 9673 that->setMachineStateLocally(MachineState_Paused); … … 9746 9746 9747 9747 if (SUCCEEDED(rc)) /* The failure cases are handled above. */ 9748 pTask->mProgress-> notifyComplete(rc);9748 pTask->mProgress->i_notifyComplete(rc); 9749 9749 9750 9750 delete pTask; -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r47532 r50874 712 712 * We're at the point of no return. 713 713 */ 714 if (!pState->mptrProgress-> notifyPointOfNoReturn())714 if (!pState->mptrProgress->i_notifyPointOfNoReturn()) 715 715 { 716 716 teleporterSrcSubmitCommand(pState, "cancel", false /*fWaitForAck*/); … … 784 784 complete things here on failure instead of right before cleanup. */ 785 785 if (FAILED(hrc)) 786 pState->mptrProgress-> notifyComplete(hrc);786 pState->mptrProgress->i_notifyComplete(hrc); 787 787 788 788 /* We can no longer be canceled (success), or it doesn't matter any longer (failure). */ 789 pState->mptrProgress-> setCancelCallback(NULL, NULL);789 pState->mptrProgress->i_setCancelCallback(NULL, NULL); 790 790 791 791 /* … … 819 819 pState->mptrConsole->mVMIsAlreadyPoweringOff = false; 820 820 821 pState->mptrProgress-> notifyComplete(hrc);821 pState->mptrProgress->i_notifyComplete(hrc); 822 822 } 823 823 else … … 991 991 992 992 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(pState)); 993 ptrProgress-> setCancelCallback(teleporterProgressCancelCallback, pvUser);993 ptrProgress->i_setCancelCallback(teleporterProgressCancelCallback, pvUser); 994 994 995 995 int vrc = RTThreadCreate(NULL, Console::teleporterSrcThreadWrapper, (void *)pState, 0 /*cbStack*/, … … 1011 1011 else 1012 1012 { 1013 ptrProgress-> setCancelCallback(NULL, NULL);1013 ptrProgress->i_setCancelCallback(NULL, NULL); 1014 1014 delete pState; 1015 1015 hrc = setError(E_FAIL, tr("RTThreadCreate -> %Rrc"), vrc); … … 1115 1115 1116 1116 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(&theState)); 1117 if (pProgress-> setCancelCallback(teleporterProgressCancelCallback, pvUser))1117 if (pProgress->i_setCancelCallback(teleporterProgressCancelCallback, pvUser)) 1118 1118 { 1119 1119 LogRel(("Teleporter: Waiting for incoming VM...\n")); … … 1122 1122 { 1123 1123 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &theState); 1124 pProgress-> setCancelCallback(NULL, NULL);1124 pProgress->i_setCancelCallback(NULL, NULL); 1125 1125 1126 1126 if (vrc == VERR_TCP_SERVER_STOP) … … 1410 1410 * make it possible to recover from some VMR3Resume failures. 1411 1411 */ 1412 if ( pState->mptrProgress-> notifyPointOfNoReturn()1412 if ( pState->mptrProgress->i_notifyPointOfNoReturn() 1413 1413 && pState->mfLockedMedia) 1414 1414 { -
trunk/src/VBox/Main/src-client/GuestDnDImpl.cpp
r50734 r50874 395 395 m_pvData = NULL; 396 396 } 397 m_cbData = 0; 397 m_cbData = 0; 398 398 m_cbDataCurrent = 0; 399 399 m_cbDataTotal = 0; … … 435 435 if (uState == DragAndDropSvc::DND_PROGRESS_ERROR) 436 436 { 437 hr = m_progress-> notifyComplete(VBOX_E_IPRT_ERROR,438 COM_IIDOF(IGuest),439 m_parent->getComponentName(),440 DnDGuestResponse::errorToString(m_parent, rcOp).c_str());437 hr = m_progress->i_notifyComplete(VBOX_E_IPRT_ERROR, 438 COM_IIDOF(IGuest), 439 m_parent->getComponentName(), 440 DnDGuestResponse::errorToString(m_parent, rcOp).c_str()); 441 441 reset(); 442 442 } … … 455 455 if ( uState == DragAndDropSvc::DND_PROGRESS_COMPLETE 456 456 || uPercentage >= 100) 457 hr = m_progress-> notifyComplete(S_OK);457 hr = m_progress->i_notifyComplete(S_OK); 458 458 } 459 459 } … … 518 518 } 519 519 520 int DnDGuestResponse::writeToFile(const char *pszPath, size_t cbPath, 520 int DnDGuestResponse::writeToFile(const char *pszPath, size_t cbPath, 521 521 void *pvData, size_t cbData, uint32_t fMode) 522 522 { … … 525 525 * keeps those file pointers around, or extend the 526 526 * actual protocol for explicit open calls. 527 * 527 * 528 528 * For now we only keep one file open at a time, so if 529 529 * a client does alternating writes to different files … … 532 532 int rc; 533 533 if ( m_hFile == NIL_RTFILE 534 || m_strFile != pszPath) 534 || m_strFile != pszPath) 535 535 { 536 536 char *pszFile = RTPathJoinA(m_strDropDir.c_str(), pszPath); … … 540 540 /** @todo Respect fMode! */ 541 541 rc = RTFileOpen(&hFile, pszFile, 542 RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE 542 RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE 543 543 | RTFILE_O_WRITE | RTFILE_O_APPEND); 544 544 if (RT_SUCCESS(rc)) 545 545 { 546 LogFlowFunc(("Opening \"%s\" (fMode=0x%x) for writing ...\n", 546 LogFlowFunc(("Opening \"%s\" (fMode=0x%x) for writing ...\n", 547 547 pszFile, fMode)); 548 548 … … 955 955 *pResultAction = d->toMainAction(pResp->defAction()); 956 956 957 LogFlowFunc(("resFormat=%s, resAction=%RU32\n", 957 LogFlowFunc(("resFormat=%s, resAction=%RU32\n", 958 958 pResp->format().c_str(), pResp->defAction())); 959 959 -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r50727 r50874 487 487 if (RT_UNLIKELY(mData.mPID != uPID)) 488 488 { 489 LogFlowFunc(("Stale guest process (PID=%RU32) sent data to a newly started process (pProcesS=%p, PID=%RU32, status=%RU32)\n", 490 uPID, this, mData.mPID, mData.mStatus)); 489 Utf8Str str; 490 str = "Stale guest process (PID=%RU32) sent data to newly started"; 491 str += " process (pProcesS=%p, PID=%RU32, status=%RU32)\n"; 492 LogFlowFunc((str.c_str(), uPID, this, mData.mPID, mData.mStatus)); 491 493 rc = VERR_NOT_FOUND; 492 494 } … … 1378 1380 { 1379 1381 waitResult = ProcessWaitResult_Error; 1380 AssertMsg(RT_FAILURE(mData.mLastError), ("No error rc (%Rrc) set when guest process indicated an error\n", mData.mLastError)); 1382 Utf8Str str; 1383 str = "No error rc (%Rrc) set when guest process indicated an error\n"; 1384 AssertMsg(RT_FAILURE(mData.mLastError), (str.c_str(), mData.mLastError)); 1381 1385 if (pGuestRc) 1382 1386 *pGuestRc = mData.mLastError; /* Return last set error. */ … … 1662 1666 void *pvData, size_t cbData, uint32_t uTimeoutMS, uint32_t *puWritten, int *pGuestRc) 1663 1667 { 1664 LogFlowThisFunc(("uPID=%RU32, uHandle=%RU32, uFlags=%RU32, pvData=%p, cbData=%RU32, uTimeoutMS=%RU32, puWritten=%p, pGuestRc=%p\n", 1665 mData.mPID, uHandle, uFlags, pvData, cbData, uTimeoutMS, puWritten, pGuestRc)); 1668 Utf8Str str; 1669 str = "uPID=%RU32, uHandle=%RU32, uFlags=%RU32, pvData=%p, cbData=%RU32, uTimeoutMS=%RU32, puWritten=%p, pGuestRc=%p\n"; 1670 LogFlowThisFunc((str.c_str(), mData.mPID, uHandle, uFlags, pvData, cbData, uTimeoutMS, puWritten, pGuestRc)); 1666 1671 /* All is optional. There can be 0 byte writes. */ 1667 1672 … … 1877 1882 } 1878 1883 1879 HRESULT GuestProcess::waitForArray(const std::vector<ProcessWaitForFlag_T> &aWaitFor, ULONG aTimeoutMS, ProcessWaitResult_T *aReason)1880 1884 HRESULT GuestProcess::waitForArray(const std::vector<ProcessWaitForFlag_T> &aWaitFor, 1885 ULONG aTimeoutMS, ProcessWaitResult_T *aReason) 1881 1886 { 1882 1887 #ifndef VBOX_WITH_GUEST_CONTROL -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r50771 r50874 2156 2156 if ( mData.mProtocolVersion < 2 2157 2157 && s_gctrlLegacyWarning++ < 3) /** @todo Find a bit nicer text. */ 2158 LogRel((tr("Warning: Guest Additions are older (%ld.%ld) than host capabilities for guest control, please upgrade them. Using protocol version %ld now\n"), 2159 uVBoxMajor, uVBoxMinor, mData.mProtocolVersion)); 2160 2158 { 2159 Utf8Str str; 2160 str = "Warning: Guest Additions are older (%ld.%ld) than host"; 2161 str += " capabilities for guest control, please upgrade them. Using protocol version %ld now\n"; 2162 LogRel((tr(str.c_str()), uVBoxMajor, uVBoxMinor, mData.mProtocolVersion)); 2163 } 2161 2164 return VINF_SUCCESS; 2162 2165 } … … 2413 2416 } 2414 2417 2415 HRESULT GuestSession::copyFrom(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<CopyFileFlag_T> &aFlags, ComPtr<IProgress> &aProgress) 2418 HRESULT GuestSession::copyFrom(const com::Utf8Str &aSource, const com::Utf8Str &aDest, 2419 const std::vector<CopyFileFlag_T> &aFlags, 2420 ComPtr<IProgress> &aProgress) 2416 2421 { 2417 2422 #ifndef VBOX_WITH_GUEST_CONTROL … … 2442 2447 SessionTaskCopyFrom *pTask = new SessionTaskCopyFrom(this /* GuestSession */, 2443 2448 aSource, aDest, fFlags); 2444 int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from guest to \"%s\" on the host"), aSource.c_str(), aDest.c_str()),2445 pTask, pProgress);2449 int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from guest to \"%s\" on the host"), aSource.c_str(), 2450 aDest.c_str()), pTask, pProgress); 2446 2451 if (RT_SUCCESS(rc)) 2447 2452 /* Return progress to the caller. */ … … 2460 2465 } 2461 2466 2462 HRESULT GuestSession::copyTo(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<CopyFileFlag_T> &aFlags, ComPtr<IProgress> &aProgress) 2467 HRESULT GuestSession::copyTo(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<CopyFileFlag_T> &aFlags, 2468 ComPtr<IProgress> &aProgress) 2463 2469 { 2464 2470 #ifndef VBOX_WITH_GUEST_CONTROL … … 2490 2496 aSource, aDest, fFlags); 2491 2497 AssertPtrReturn(pTask, E_OUTOFMEMORY); 2492 int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from host to \"%s\" on the guest"), aSource.c_str(), aDest.c_str()),2493 pTask, pProgress);2498 int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from host to \"%s\" on the guest"), aSource.c_str(), 2499 aDest.c_str()), pTask, pProgress); 2494 2500 if (RT_SUCCESS(rc)) 2495 2501 { … … 2563 2569 } 2564 2570 2565 HRESULT GuestSession::directoryCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, BOOL aSecure, com::Utf8Str &aDirectory) 2571 HRESULT GuestSession::directoryCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, 2572 BOOL aSecure, com::Utf8Str &aDirectory) 2566 2573 { 2567 2574 #ifndef VBOX_WITH_GUEST_CONTROL … … 2635 2642 } 2636 2643 2637 HRESULT GuestSession::directoryOpen(const com::Utf8Str &aPath, const com::Utf8Str &aFilter, const std::vector<DirectoryOpenFlag_T> &aFlags, ComPtr<IGuestDirectory> &aDirectory) 2644 HRESULT GuestSession::directoryOpen(const com::Utf8Str &aPath, const com::Utf8Str &aFilter, 2645 const std::vector<DirectoryOpenFlag_T> &aFlags, ComPtr<IGuestDirectory> &aDirectory) 2638 2646 { 2639 2647 #ifndef VBOX_WITH_GUEST_CONTROL … … 2793 2801 } 2794 2802 2795 HRESULT GuestSession::directoryRemoveRecursive(const com::Utf8Str &aPath, const std::vector<DirectoryRemoveRecFlag_T> &aFlags, ComPtr<IProgress> &aProgress) 2803 HRESULT GuestSession::directoryRemoveRecursive(const com::Utf8Str &aPath, const std::vector<DirectoryRemoveRecFlag_T> &aFlags, 2804 ComPtr<IProgress> &aProgress) 2796 2805 { 2797 2806 #ifndef VBOX_WITH_GUEST_CONTROL … … 2820 2829 * the progress object right now. */ 2821 2830 /** @todo Implement progress reporting on guest directory deletion! */ 2822 hr = pProgress-> notifyComplete(S_OK);2831 hr = pProgress->i_notifyComplete(S_OK); 2823 2832 if (FAILED(hr)) 2824 2833 return hr; … … 2988 2997 } 2989 2998 2990 HRESULT GuestSession::fileCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, BOOL aSecure, ComPtr<IGuestFile> &aFile) 2999 HRESULT GuestSession::fileCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, BOOL aSecure, 3000 ComPtr<IGuestFile> &aFile) 2991 3001 { 2992 3002 #ifndef VBOX_WITH_GUEST_CONTROL … … 3073 3083 } 3074 3084 3075 HRESULT GuestSession::fileOpen(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, ULONG aCreationMode, ComPtr<IGuestFile> &aFile) 3085 HRESULT GuestSession::fileOpen(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, 3086 ULONG aCreationMode, ComPtr<IGuestFile> &aFile) 3076 3087 { 3077 3088 #ifndef VBOX_WITH_GUEST_CONTROL … … 3087 3098 } 3088 3099 3089 HRESULT GuestSession::fileOpenEx(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, const com::Utf8Str &aSharingMode, ULONG aCreationMode, LONG64 aOffset, ComPtr<IGuestFile> &aFile) 3100 HRESULT GuestSession::fileOpenEx(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, 3101 const com::Utf8Str &aSharingMode, ULONG aCreationMode, LONG64 aOffset, 3102 ComPtr<IGuestFile> &aFile) 3090 3103 3091 3104 { … … 3240 3253 } 3241 3254 3242 HRESULT GuestSession::fileRename(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<PathRenameFlag_T> &aFlags) 3255 HRESULT GuestSession::fileRename(const com::Utf8Str &aSource, const com::Utf8Str &aDest, 3256 const std::vector<PathRenameFlag_T> &aFlags) 3243 3257 { 3244 3258 #ifndef VBOX_WITH_GUEST_CONTROL … … 3298 3312 } 3299 3313 3300 HRESULT GuestSession::processCreate(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ComPtr<IGuestProcess> &aGuestProcess) 3314 HRESULT GuestSession::processCreate(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, 3315 const std::vector<com::Utf8Str> &aEnvironment, 3316 const std::vector<ProcessCreateFlag_T> &aFlags, 3317 ULONG aTimeoutMS, ComPtr<IGuestProcess> &aGuestProcess) 3301 3318 { 3302 3319 #ifndef VBOX_WITH_GUEST_CONTROL … … 3307 3324 std::vector<LONG> affinityIgnored; 3308 3325 3309 return processCreateEx(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS, ProcessPriority_Default, affinityIgnored, aGuestProcess); 3310 #endif /* VBOX_WITH_GUEST_CONTROL */ 3311 } 3312 3313 HRESULT GuestSession::processCreateEx(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ProcessPriority_T aPriority, const std::vector<LONG> &aAffinity, ComPtr<IGuestProcess> &aGuestProcess) 3326 return processCreateEx(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS, ProcessPriority_Default, 3327 affinityIgnored, aGuestProcess); 3328 #endif /* VBOX_WITH_GUEST_CONTROL */ 3329 } 3330 3331 HRESULT GuestSession::processCreateEx(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, 3332 const std::vector<com::Utf8Str> &aEnvironment, 3333 const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, 3334 ProcessPriority_T aPriority, const std::vector<LONG> &aAffinity, 3335 ComPtr<IGuestProcess> &aGuestProcess) 3314 3336 { 3315 3337 #ifndef VBOX_WITH_GUEST_CONTROL … … 3450 3472 } 3451 3473 3452 HRESULT GuestSession::symlinkRead(const com::Utf8Str &aSymlink, const std::vector<SymlinkReadFlag_T> &aFlags, com::Utf8Str &aTarget) 3474 HRESULT GuestSession::symlinkRead(const com::Utf8Str &aSymlink, const std::vector<SymlinkReadFlag_T> &aFlags, 3475 com::Utf8Str &aTarget) 3453 3476 { 3454 3477 #ifndef VBOX_WITH_GUEST_CONTROL … … 3527 3550 } 3528 3551 3529 HRESULT GuestSession::waitForArray(const std::vector<GuestSessionWaitForFlag_T> &aWaitFor, ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason) 3552 HRESULT GuestSession::waitForArray(const std::vector<GuestSessionWaitForFlag_T> &aWaitFor, ULONG aTimeoutMS, 3553 GuestSessionWaitResult_T *aReason) 3530 3554 { 3531 3555 #ifndef VBOX_WITH_GUEST_CONTROL -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r50727 r50874 128 128 && !fCompleted) 129 129 { 130 HRESULT hr = mProgress-> notifyComplete(S_OK);130 HRESULT hr = mProgress->i_notifyComplete(S_OK); 131 131 if (FAILED(hr)) 132 132 return VERR_COM_UNEXPECTED; /** @todo Find a better rc. */ … … 151 151 && !fCompleted) 152 152 { 153 HRESULT hr2 = mProgress-> notifyComplete(hr,154 COM_IIDOF(IGuestSession),155 GuestSession::getStaticComponentName(),156 strMsg.c_str());153 HRESULT hr2 = mProgress->i_notifyComplete(hr, 154 COM_IIDOF(IGuestSession), 155 GuestSession::getStaticComponentName(), 156 strMsg.c_str()); 157 157 if (FAILED(hr2)) 158 158 return hr2; -
trunk/src/VBox/Main/src-client/xpcom/module.cpp
r50727 r50874 74 74 NS_DECL_CLASSINFO(MachineDebugger) 75 75 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MachineDebugger, IMachineDebugger) 76 NS_DECL_CLASSINFO(Progress)77 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)78 76 NS_DECL_CLASSINFO(RemoteUSBDevice) 79 77 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(RemoteUSBDevice, IHostUSBDevice, IUSBDevice) -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r50444 r50874 140 140 { ovf::CIMOSType_CIMOS_FreeBSD_64, VBOXOSTYPE_FreeBSD_x64 }, 141 141 { ovf::CIMOSType_CIMOS_MACOS, VBOXOSTYPE_MacOS }, 142 { ovf::CIMOSType_CIMOS_MACOS, VBOXOSTYPE_MacOS_x64 }, 142 { ovf::CIMOSType_CIMOS_MACOS, VBOXOSTYPE_MacOS_x64 }, // there is no CIM 64-bit type for this 143 143 { ovf::CIMOSType_CIMOS_MACOS, VBOXOSTYPE_MacOS106 }, 144 144 { ovf::CIMOSType_CIMOS_MACOS, VBOXOSTYPE_MacOS106_x64 }, … … 189 189 // { ovf::CIMOSType_CIMOS_VMwareESXi = 104, // we can't run ESX in a VM 190 190 { ovf::CIMOSType_CIMOS_Windows7, VBOXOSTYPE_Win7 }, 191 { ovf::CIMOSType_CIMOS_Windows7, VBOXOSTYPE_Win7_x64 }, // there is no CIM 64-bit type for this 191 { ovf::CIMOSType_CIMOS_Windows7, VBOXOSTYPE_Win7_x64 }, // there is no 192 // CIM 64-bit type for this 192 193 { ovf::CIMOSType_CIMOS_CentOS, VBOXOSTYPE_RedHat }, 193 194 { ovf::CIMOSType_CIMOS_CentOS_64, VBOXOSTYPE_RedHat_x64 }, … … 815 816 /** @todo: Maybe too cost-intensive; try to find a lighter way */ 816 817 while ( RTPathExists(tmpName) 817 || mVirtualBox->OpenMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, AccessMode_ReadWrite, FALSE /* fForceNewUuid */, &harddisk) != VBOX_E_OBJECT_NOT_FOUND818 )818 || mVirtualBox->OpenMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, AccessMode_ReadWrite, 819 FALSE /* fForceNewUuid */, &harddisk) != VBOX_E_OBJECT_NOT_FOUND) 819 820 { 820 821 RTStrFree(tmpName); … … 888 889 ++cOperations; // another one for creating the manifest 889 890 890 m->ulWeightForManifestOperation = (ULONG)((double)m->ulTotalDisksMB * .1 / 100); // use .5% of the progress for the manifest 891 m->ulWeightForManifestOperation = (ULONG)((double)m->ulTotalDisksMB * .1 / 100); // use .5% of the 892 // progress for the manifest 891 893 ulTotalOperationsWeight += m->ulWeightForManifestOperation; 892 894 } … … 916 918 if (m->ulTotalDisksMB) 917 919 { 918 m->ulWeightForXmlOperation = (ULONG)((double)m->ulTotalDisksMB * 1 / 100); // use 1% of the progress for OVF file upload (we didn't know the size at this point) 920 m->ulWeightForXmlOperation = (ULONG)((double)m->ulTotalDisksMB * 1 / 100); // use 1% of the progress 921 // for OVF file upload 922 // (we didn't know the 923 // size at this point) 919 924 ulTotalOperationsWeight = m->ulTotalDisksMB + m->ulWeightForXmlOperation; 920 925 } … … 925 930 m->ulWeightForXmlOperation = 1; 926 931 } 927 ULONG ulOVFCreationWeight = (ULONG)((double)ulTotalOperationsWeight * 50.0 / 100.0); /* Use 50% for the creation of the OVF & the disks */ 932 ULONG ulOVFCreationWeight = (ULONG)((double)ulTotalOperationsWeight * 50.0 / 100.0); /* Use 50% for the 933 creation of the OVF 934 & the disks */ 928 935 ulTotalOperationsWeight += ulOVFCreationWeight; 929 936 break; … … 931 938 } 932 939 933 Log(("Setting up progress object: ulTotalMB = %d, cDisks = %d, => cOperations = %d, ulTotalOperationsWeight = %d, m->ulWeightForXmlOperation = %d\n", 934 m->ulTotalDisksMB, m->cDisks, cOperations, ulTotalOperationsWeight, m->ulWeightForXmlOperation)); 940 Utf8Str str; 941 str = "Setting up progress object: ulTotalMB = %d, cDisks = %d, => cOperations = %d,"; 942 str += "ulTotalOperationsWeight = %d, m->ulWeightForXmlOperation = %d\n"; 943 Log((str.c_str(), m->ulTotalDisksMB, m->cDisks, cOperations, ulTotalOperationsWeight, m->ulWeightForXmlOperation)); 935 944 936 945 rc = pProgress->init(mVirtualBox, static_cast<IAppliance*>(this), … … 1172 1181 1173 1182 if (!task->pProgress.isNull()) 1174 task->pProgress-> notifyComplete(taskrc);1183 task->pProgress->i_notifyComplete(taskrc); 1175 1184 1176 1185 LogFlowFuncLeave(); -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r50652 r50874 5662 5662 5663 5663 HRESULT rc = pTask->pMachine->deleteTaskWorker(*pTask); 5664 pTask->pProgress-> notifyComplete(rc);5664 pTask->pProgress->i_notifyComplete(rc); 5665 5665 5666 5666 delete pTask; … … 8394 8394 if (!mData->mSession.mProgress.isNull()) 8395 8395 { 8396 mData->mSession.mProgress-> notifyComplete(rc);8396 mData->mSession.mProgress->i_notifyComplete(rc); 8397 8397 mData->mSession.mProgress.setNull(); 8398 8398 } … … 13122 13122 { 13123 13123 if (aReason == Uninit::Normal) 13124 mData->mSession.mProgress-> notifyComplete(S_OK);13124 mData->mSession.mProgress->i_notifyComplete(S_OK); 13125 13125 else 13126 mData->mSession.mProgress-> notifyComplete(E_FAIL,13127 COM_IIDOF(ISession),13128 getComponentName(),13129 tr("The VM session was aborted"));13126 mData->mSession.mProgress->i_notifyComplete(E_FAIL, 13127 COM_IIDOF(ISession), 13128 getComponentName(), 13129 tr("The VM session was aborted")); 13130 13130 mData->mSession.mProgress.setNull(); 13131 13131 } … … 13312 13312 if (mData->mSession.mProgress) 13313 13313 { 13314 mData->mSession.mProgress-> notifyComplete((HRESULT)iResult);13314 mData->mSession.mProgress->i_notifyComplete((HRESULT)iResult); 13315 13315 mData->mSession.mProgress.setNull(); 13316 13316 } … … 13396 13396 Assert(mConsoleTaskData.mProgress); 13397 13397 if (SUCCEEDED(iResult)) 13398 mConsoleTaskData.mProgress-> notifyComplete(S_OK);13398 mConsoleTaskData.mProgress->i_notifyComplete(S_OK); 13399 13399 else 13400 13400 { 13401 13401 Utf8Str strErrMsg(aErrMsg); 13402 13402 if (strErrMsg.length()) 13403 mConsoleTaskData.mProgress-> notifyComplete(iResult,13404 COM_IIDOF(ISession),13405 getComponentName(),13406 strErrMsg.c_str());13403 mConsoleTaskData.mProgress->i_notifyComplete(iResult, 13404 COM_IIDOF(ISession), 13405 getComponentName(), 13406 strErrMsg.c_str()); 13407 13407 else 13408 mConsoleTaskData.mProgress-> notifyComplete(iResult);13408 mConsoleTaskData.mProgress->i_notifyComplete(iResult); 13409 13409 } 13410 13410 … … 13601 13601 /* finalize the progress, someone might wait if a frontend 13602 13602 * closes the session before powering on the VM. */ 13603 mData->mSession.mProgress-> notifyComplete(E_FAIL,13604 COM_IIDOF(ISession),13605 getComponentName(),13606 tr("The VM session was closed before any attempt to power it on"));13603 mData->mSession.mProgress->i_notifyComplete(E_FAIL, 13604 COM_IIDOF(ISession), 13605 getComponentName(), 13606 tr("The VM session was closed before any attempt to power it on")); 13607 13607 mData->mSession.mProgress.setNull(); 13608 13608 } … … 14644 14644 Assert(mConsoleTaskData.mProgress); 14645 14645 if (SUCCEEDED(aRc)) 14646 mConsoleTaskData.mProgress-> notifyComplete(S_OK);14646 mConsoleTaskData.mProgress->i_notifyComplete(S_OK); 14647 14647 else 14648 14648 { 14649 14649 if (aErrMsg.length()) 14650 mConsoleTaskData.mProgress-> notifyComplete(aRc,14651 COM_IIDOF(ISession),14652 getComponentName(),14653 aErrMsg.c_str());14650 mConsoleTaskData.mProgress->i_notifyComplete(aRc, 14651 COM_IIDOF(ISession), 14652 getComponentName(), 14653 aErrMsg.c_str()); 14654 14654 else 14655 mConsoleTaskData.mProgress-> notifyComplete(aRc);14655 mConsoleTaskData.mProgress->i_notifyComplete(aRc); 14656 14656 } 14657 14657 -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r50355 r50874 62 62 struct MachineCloneVMPrivate 63 63 { 64 MachineCloneVMPrivate(MachineCloneVM *a_q, ComObjPtr<Machine> &a_pSrcMachine, ComObjPtr<Machine> &a_pTrgMachine, CloneMode_T a_mode, const RTCList<CloneOptions_T> &opts) 64 MachineCloneVMPrivate(MachineCloneVM *a_q, ComObjPtr<Machine> &a_pSrcMachine, ComObjPtr<Machine> &a_pTrgMachine, 65 CloneMode_T a_mode, const RTCList<CloneOptions_T> &opts) 65 66 : q_ptr(a_q) 66 67 , p(a_pSrcMachine) … … 90 91 HRESULT rc = pTask->q_ptr->run(); 91 92 92 pTask->pProgress-> notifyComplete(rc);93 pTask->pProgress->i_notifyComplete(rc); 93 94 94 95 pTask->q_ptr->destroy(); … … 104 105 inline HRESULT addSaveState(const ComObjPtr<Machine> &machine, ULONG &uCount, ULONG &uTotalWeight); 105 106 inline HRESULT queryBaseName(const ComPtr<IMedium> &pMedium, Utf8Str &strBaseName) const; 106 HRESULT queryMediasForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 107 HRESULT queryMediasForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 108 HRESULT queryMediasForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 107 HRESULT queryMediasForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, 108 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 109 HRESULT queryMediasForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, 110 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 111 HRESULT queryMediasForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, 112 ULONG &uTotalWeight); 109 113 110 114 /* MachineCloneVM::run helper: */ … … 115 119 void updateSnapshotStorageLists(settings::SnapshotsList &sl, const Bstr &bstrOldId, const Bstr &bstrNewId) const; 116 120 void updateStateFile(settings::SnapshotsList &snl, const Guid &id, const Utf8Str &strFile) const; 117 HRESULT createDifferencingMedium(const ComObjPtr<Machine> &pMachine, const ComObjPtr<Medium> &pParent, const Utf8Str &strSnapshotFolder, RTCList<ComObjPtr<Medium> > &newMedia, ComObjPtr<Medium> *ppDiff) const; 121 HRESULT createDifferencingMedium(const ComObjPtr<Machine> &pMachine, const ComObjPtr<Medium> &pParent, 122 const Utf8Str &strSnapshotFolder, RTCList<ComObjPtr<Medium> > &newMedia, 123 ComObjPtr<Medium> *ppDiff) const; 118 124 static int copyStateFileProgress(unsigned uPercentage, void *pvUser); 119 125 … … 134 140 }; 135 141 136 HRESULT MachineCloneVMPrivate::createMachineList(const ComPtr<ISnapshot> &pSnapshot, RTCList< ComObjPtr<Machine> > &machineList) const 137 { 142 HRESULT MachineCloneVMPrivate::createMachineList(const ComPtr<ISnapshot> &pSnapshot, 143 RTCList< ComObjPtr<Machine> > &machineList) const 144 { 138 145 HRESULT rc = S_OK; 139 146 Bstr name; … … 158 165 } 159 166 160 void MachineCloneVMPrivate::updateProgressStats(MEDIUMTASKCHAIN &mtc, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) const 167 void MachineCloneVMPrivate::updateProgressStats(MEDIUMTASKCHAIN &mtc, bool fAttachLinked, 168 ULONG &uCount, ULONG &uTotalWeight) const 161 169 { 162 170 if (fAttachLinked) … … 205 213 int vrc = RTFileQuerySize(sst.strSaveStateFile.c_str(), &cbSize); 206 214 if (RT_FAILURE(vrc)) 207 return p->setError(VBOX_E_IPRT_ERROR, p->tr("Could not query file size of '%s' (%Rrc)"), sst.strSaveStateFile.c_str(), vrc); 215 return p->setError(VBOX_E_IPRT_ERROR, p->tr("Could not query file size of '%s' (%Rrc)"), 216 sst.strSaveStateFile.c_str(), vrc); 208 217 /* same rule as above: count both the data which needs to 209 218 * be read and written */ … … 228 237 } 229 238 230 HRESULT MachineCloneVMPrivate::queryMediasForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 239 HRESULT MachineCloneVMPrivate::queryMediasForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, 240 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 231 241 { 232 242 /* This mode is pretty straightforward. We didn't need to know about any … … 306 316 } 307 317 308 HRESULT MachineCloneVMPrivate::queryMediasForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 318 HRESULT MachineCloneVMPrivate::queryMediasForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, 319 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 309 320 { 310 321 /* This is basically a three step approach. First select all medias … … 468 479 } 469 480 470 HRESULT MachineCloneVMPrivate::queryMediasForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 481 HRESULT MachineCloneVMPrivate::queryMediasForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, 482 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 471 483 { 472 484 /* In this case we create a exact copy of the original VM. This means just … … 597 609 } 598 610 599 void MachineCloneVMPrivate::updateStorageLists(settings::StorageControllersList &sc, const Bstr &bstrOldId, const Bstr &bstrNewId) const 611 void MachineCloneVMPrivate::updateStorageLists(settings::StorageControllersList &sc, 612 const Bstr &bstrOldId, const Bstr &bstrNewId) const 600 613 { 601 614 settings::StorageControllersList::iterator it3; … … 619 632 } 620 633 621 void MachineCloneVMPrivate::updateSnapshotStorageLists(settings::SnapshotsList &sl, const Bstr &bstrOldId, const Bstr &bstrNewId) const 634 void MachineCloneVMPrivate::updateSnapshotStorageLists(settings::SnapshotsList &sl, const Bstr &bstrOldId, 635 const Bstr &bstrNewId) const 622 636 { 623 637 settings::SnapshotsList::iterator it; … … 644 658 } 645 659 646 HRESULT MachineCloneVMPrivate::createDifferencingMedium(const ComObjPtr<Machine> &pMachine, const ComObjPtr<Medium> &pParent, const Utf8Str &strSnapshotFolder, RTCList<ComObjPtr<Medium> > &newMedia, ComObjPtr<Medium> *ppDiff) const 660 HRESULT MachineCloneVMPrivate::createDifferencingMedium(const ComObjPtr<Machine> &pMachine, const ComObjPtr<Medium> &pParent, 661 const Utf8Str &strSnapshotFolder, RTCList<ComObjPtr<Medium> > &newMedia, 662 ComObjPtr<Medium> *ppDiff) const 647 663 { 648 664 HRESULT rc = S_OK; … … 716 732 ///////////////////////////////////////////////////////////////////////////// 717 733 718 MachineCloneVM::MachineCloneVM(ComObjPtr<Machine> pSrcMachine, ComObjPtr<Machine> pTrgMachine, CloneMode_T mode, const RTCList<CloneOptions_T> &opts) 719 : d_ptr(new MachineCloneVMPrivate(this, pSrcMachine, pTrgMachine, mode, opts)) 734 MachineCloneVM::MachineCloneVM(ComObjPtr<Machine> pSrcMachine, ComObjPtr<Machine> pTrgMachine, CloneMode_T mode, 735 const RTCList<CloneOptions_T> &opts) : 736 d_ptr(new MachineCloneVMPrivate(this, pSrcMachine, pTrgMachine, mode, opts)) 720 737 { 721 738 } … … 881 898 switch (d->mode) 882 899 { 883 case CloneMode_MachineState: d->queryMediasForMachineState(machineList, fAttachLinked, uCount, uTotalWeight); break; 884 case CloneMode_MachineAndChildStates: d->queryMediasForMachineAndChildStates(machineList, fAttachLinked, uCount, uTotalWeight); break; 885 case CloneMode_AllStates: d->queryMediasForAllStates(machineList, fAttachLinked, uCount, uTotalWeight); break; 900 case CloneMode_MachineState: d->queryMediasForMachineState(machineList, fAttachLinked, 901 uCount, uTotalWeight); 902 break; 903 case CloneMode_MachineAndChildStates: d->queryMediasForMachineAndChildStates(machineList, fAttachLinked, 904 uCount, uTotalWeight); 905 break; 906 case CloneMode_AllStates: d->queryMediasForAllStates(machineList, fAttachLinked, uCount, 907 uTotalWeight); 908 break; 886 909 } 887 910 … … 1013 1036 if (FAILED(rc)) throw rc; 1014 1037 /* The absolute name of the snapshot folder. */ 1015 strTrgSnapshotFolder = Utf8StrFmt("%s%c%s", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, trgMCF.machineUserData.strSnapshotFolder.c_str()); 1038 strTrgSnapshotFolder = Utf8StrFmt("%s%c%s", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, 1039 trgMCF.machineUserData.strSnapshotFolder.c_str()); 1016 1040 1017 1041 /* Should we rename the disk names. */ … … 1041 1065 if (FAILED(rc)) throw rc; 1042 1066 1043 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Cloning Disk '%ls' ..."), bstrSrcName.raw()).raw(), mt.uWeight); 1067 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Cloning Disk '%ls' ..."), bstrSrcName.raw()).raw(), 1068 mt.uWeight); 1044 1069 if (FAILED(rc)) throw rc; 1045 1070 … … 1142 1167 * template: "new name-disk1.vdi". */ 1143 1168 if (strSrcTest == strOldVMName) 1144 strNewName = Utf8StrFmt("%s%s", trgMCF.machineUserData.strName.c_str(), RTPathSuffix(Utf8Str(bstrSrcName).c_str())); 1169 strNewName = Utf8StrFmt("%s%s", trgMCF.machineUserData.strName.c_str(), 1170 RTPathSuffix(Utf8Str(bstrSrcName).c_str())); 1145 1171 else if ( strSrcTest.startsWith("{") 1146 1172 && strSrcTest.endsWith("}")) … … 1150 1176 Guid temp_guid(strSrcTest); 1151 1177 if (temp_guid.isValid() && !temp_guid.isZero()) 1152 strNewName = Utf8StrFmt("%s%s", newId.toStringCurly().c_str(), RTPathSuffix(strNewName.c_str())); 1178 strNewName = Utf8StrFmt("%s%s", newId.toStringCurly().c_str(), 1179 RTPathSuffix(strNewName.c_str())); 1153 1180 } 1154 1181 else … … 1322 1349 if (RT_FAILURE(vrc)) 1323 1350 throw p->setError(VBOX_E_IPRT_ERROR, 1324 p->tr("Could not create snapshots folder '%s' (%Rrc)"), strTrgSnapshotFolder.c_str(), vrc); 1351 p->tr("Could not create snapshots folder '%s' (%Rrc)"), 1352 strTrgSnapshotFolder.c_str(), vrc); 1325 1353 } 1326 1354 /* Clone all save state files. */ … … 1328 1356 { 1329 1357 SAVESTATETASK sst = d->llSaveStateFiles.at(i); 1330 const Utf8Str &strTrgSaveState = Utf8StrFmt("%s%c%s", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER, RTPathFilename(sst.strSaveStateFile.c_str())); 1358 const Utf8Str &strTrgSaveState = Utf8StrFmt("%s%c%s", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER, 1359 RTPathFilename(sst.strSaveStateFile.c_str())); 1331 1360 1332 1361 /* Move to next sub-operation. */ 1333 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Copy save state file '%s' ..."), RTPathFilename(sst.strSaveStateFile.c_str())).raw(), sst.uWeight); 1362 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Copy save state file '%s' ..."), 1363 RTPathFilename(sst.strSaveStateFile.c_str())).raw(), sst.uWeight); 1334 1364 if (FAILED(rc)) throw rc; 1335 1365 /* Copy the file only if it was not copied already. */ 1336 1366 if (!newFiles.contains(strTrgSaveState.c_str())) 1337 1367 { 1338 int vrc = RTFileCopyEx(sst.strSaveStateFile.c_str(), strTrgSaveState.c_str(), 0, MachineCloneVMPrivate::copyStateFileProgress, &d->pProgress); 1368 int vrc = RTFileCopyEx(sst.strSaveStateFile.c_str(), strTrgSaveState.c_str(), 0, 1369 MachineCloneVMPrivate::copyStateFileProgress, &d->pProgress); 1339 1370 if (RT_FAILURE(vrc)) 1340 1371 throw p->setError(VBOX_E_IPRT_ERROR, 1341 p->tr("Could not copy state file '%s' to '%s' (%Rrc)"), sst.strSaveStateFile.c_str(), strTrgSaveState.c_str(), vrc); 1372 p->tr("Could not copy state file '%s' to '%s' (%Rrc)"), 1373 sst.strSaveStateFile.c_str(), strTrgSaveState.c_str(), vrc); 1342 1374 newFiles.append(strTrgSaveState); 1343 1375 } … … 1351 1383 1352 1384 { 1353 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Create Machine Clone '%s' ..."), trgMCF.machineUserData.strName.c_str()).raw(), 1); 1385 rc = d->pProgress->SetNextOperation(BstrFmt(p->tr("Create Machine Clone '%s' ..."), 1386 trgMCF.machineUserData.strName.c_str()).raw(), 1); 1354 1387 if (FAILED(rc)) throw rc; 1355 1388 /* After modifying the new machine config, we can copy the stuff -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r50472 r50874 682 682 /* complete the progress if run asynchronously */ 683 683 if (pTask->isAsync()) 684 {685 684 if (!pTask->mProgress.isNull()) 686 pTask->mProgress->notifyComplete(rc); 687 } 685 pTask->mProgress->i_notifyComplete(rc); 688 686 689 687 /* pTask is no longer needed, delete it. */ -
trunk/src/VBox/Main/src-server/ProgressProxyImpl.cpp
r44529 r50874 158 158 HRESULT hrc = S_OK; 159 159 if (!mCompleted) 160 hrc = Progress:: notifyComplete(aResultCode);160 hrc = Progress::i_notifyComplete(aResultCode); 161 161 return hrc; 162 162 } … … 178 178 va_list va; 179 179 va_start(va, aText); 180 hrc = Progress:: notifyCompleteV(aResultCode, aIID, pcszComponent, aText, va);180 hrc = Progress::i_notifyCompleteV(aResultCode, aIID, pcszComponent, aText, va); 181 181 va_end(va); 182 182 } … … 376 376 Utf8Str strText(bstrText); 377 377 LogFlowThisFunc(("Got ErrorInfo(%s); hrcResult=%Rhrc\n", strText.c_str(), hrcResult)); 378 Progress:: notifyComplete((HRESULT)hrcResult,379 Guid(bstrIID).ref(),380 Utf8Str(bstrComponent).c_str(),381 "%s", strText.c_str());378 Progress::i_notifyComplete((HRESULT)hrcResult, 379 Guid(bstrIID).ref(), 380 Utf8Str(bstrComponent).c_str(), 381 "%s", strText.c_str()); 382 382 } 383 383 else 384 384 { 385 385 LogFlowThisFunc(("ErrorInfo failed with hrc=%Rhrc; hrcResult=%Rhrc\n", hrc, hrcResult)); 386 Progress:: notifyComplete((HRESULT)hrcResult,387 COM_IIDOF(IProgress),388 "ProgressProxy",389 tr("No error info"));386 Progress::i_notifyComplete((HRESULT)hrcResult, 387 COM_IIDOF(IProgress), 388 "ProgressProxy", 389 tr("No error info")); 390 390 } 391 391 } … … 467 467 double rdPercent = ((double)uPct / 100 * muOtherProgressWeight + muOtherProgressStartWeight) 468 468 / m_ulTotalOperationsWeight * 100; 469 *aPercent = RT_MIN((ULONG)rdPercent, 99); /* mptrOtherProgress is cleared when its completed, so we can never return 100%. */ 469 *aPercent = RT_MIN((ULONG)rdPercent, 99); /* mptrOtherProgress is cleared when its completed, 470 so we can never return 100%. */ 470 471 } 471 472 } -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r50355 r50874 1422 1422 && mData->mCurrentSnapshot->i_getDepth() >= SETTINGS_SNAPSHOT_DEPTH_MAX) 1423 1423 { 1424 Utf8Str str; 1425 str = "Cannot take another snapshot for machine '%s', because it exceeds the maximum"; 1426 str += "snapshot depth limit. Please delete some earlier snapshot which you no longer need"; 1424 1427 return setError(VBOX_E_INVALID_OBJECT_STATE, 1425 tr( "Cannot take another snapshot for machine '%s', because it exceeds the maximum snapshot depth limit. Please delete some earlier snapshot which you no longer need"),1428 tr(str.c_str()), 1426 1429 mUserData->s.strName.c_str()); 1427 1430 } … … 1731 1734 ++ulTotalWeight; // assume one MB weight for each differencing hard disk to manage 1732 1735 Assert(pAttach->i_getMedium()); 1733 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach->i_getMedium()->i_getName().c_str())); 1736 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, 1737 pAttach->i_getMedium()->i_getName().c_str())); 1734 1738 } 1735 1739 } … … 1800 1804 /* we might have been uninitialized because the session was accidentally 1801 1805 * closed by the client, so don't assert */ 1802 aTask.pProgress-> notifyComplete(E_FAIL,1803 COM_IIDOF(IMachine),1804 getComponentName(),1805 tr("The session has been accidentally closed"));1806 aTask.pProgress->i_notifyComplete(E_FAIL, 1807 COM_IIDOF(IMachine), 1808 getComponentName(), 1809 tr("The session has been accidentally closed")); 1806 1810 1807 1811 LogFlowThisFuncLeave(); … … 2036 2040 2037 2041 /* set the result (this will try to fetch current error info on failure) */ 2038 aTask.pProgress-> notifyComplete(rc);2042 aTask.pProgress->i_notifyComplete(rc); 2039 2043 2040 2044 if (SUCCEEDED(rc)) … … 2110 2114 2111 2115 AutoWriteLock snapshotLock(pSnapshot COMMA_LOCKVAL_SRC_POS); 2116 Utf8Str str; 2112 2117 2113 2118 size_t childrenCount = pSnapshot->i_getChildrenCount(); 2114 2119 if (childrenCount > 1) 2120 { 2121 str = "Snapshot '%s' of the machine '%s' cannot be deleted, because it has %d child snapshots,"; 2122 str += "which is more than the one snapshot allowed for deletion"; 2115 2123 return setError(VBOX_E_INVALID_OBJECT_STATE, 2116 tr( "Snapshot '%s' of the machine '%s' cannot be deleted, because it has %d child snapshots, which is more than the one snapshot allowed for deletion"),2124 tr(str.c_str()), 2117 2125 pSnapshot->i_getName().c_str(), 2118 2126 mUserData->s.strName.c_str(), 2119 2127 childrenCount); 2128 } 2120 2129 2121 2130 if (pSnapshot == mData->mCurrentSnapshot && childrenCount >= 1) 2131 { 2132 str = "Snapshot '%s' of the machine '%s' cannot be deleted, because it is the current"; 2133 str += "snapshot and has one child snapshot"; 2122 2134 return setError(VBOX_E_INVALID_OBJECT_STATE, 2123 tr( "Snapshot '%s' of the machine '%s' cannot be deleted, because it is the current snapshot and has one child snapshot"),2135 tr(str.c_str()), 2124 2136 pSnapshot->i_getName().c_str(), 2125 2137 mUserData->s.strName.c_str()); 2138 } 2126 2139 2127 2140 /* If the snapshot being deleted is the current one, ensure current … … 2340 2353 /* we might have been uninitialized because the session was accidentally 2341 2354 * closed by the client, so don't assert */ 2342 aTask.pProgress-> notifyComplete(E_FAIL,2343 COM_IIDOF(IMachine),2344 getComponentName(),2345 tr("The session has been accidentally closed"));2355 aTask.pProgress->i_notifyComplete(E_FAIL, 2356 COM_IIDOF(IMachine), 2357 getComponentName(), 2358 tr("The session has been accidentally closed")); 2346 2359 LogFlowThisFuncLeave(); 2347 2360 return; … … 2906 2919 2907 2920 // report the result (this will try to fetch current error info on failure) 2908 aTask.pProgress-> notifyComplete(rc);2921 aTask.pProgress->i_notifyComplete(rc); 2909 2922 2910 2923 if (SUCCEEDED(rc)) -
trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp
r49871 r50874 78 78 * @return 79 79 */ 80 HRESULT VFSExplorer::init(VFSType_T aType, Utf8Str aFilePath, Utf8Str aHostname, Utf8Str aUsername, Utf8Str aPassword, VirtualBox *aVirtualBox) 80 HRESULT VFSExplorer::init(VFSType_T aType, Utf8Str aFilePath, Utf8Str aHostname, Utf8Str aUsername, 81 Utf8Str aPassword, VirtualBox *aVirtualBox) 81 82 { 82 83 /* Enclose the state transition NotReady->InInit->Ready */ … … 312 313 if ( name != "." 313 314 && name != "..") 314 fileList.push_back(VFSExplorer::Data::DirEntry(name, i_RTToVFSFileType(entry.Info.Attr.fMode), entry.Info.cbObject, entry.Info.Attr.fMode & (RTFS_UNIX_IRWXU | RTFS_UNIX_IRWXG | RTFS_UNIX_IRWXO))); 315 fileList.push_back(VFSExplorer::Data::DirEntry(name, i_RTToVFSFileType(entry.Info.Attr.fMode), 316 entry.Info.cbObject, 317 entry.Info.Attr.fMode & (RTFS_UNIX_IRWXU | RTFS_UNIX_IRWXG | RTFS_UNIX_IRWXO))); 315 318 } 316 319 } … … 339 342 340 343 if (!aTask->progress.isNull()) 341 aTask->progress-> notifyComplete(rc);344 aTask->progress->i_notifyComplete(rc); 342 345 343 346 LogFlowFunc(("rc=%Rhrc\n", rc)); … … 386 389 387 390 if (!aTask->progress.isNull()) 388 aTask->progress-> notifyComplete(rc);391 aTask->progress->i_notifyComplete(rc); 389 392 390 393 LogFlowFunc(("rc=%Rhrc\n", rc)); … … 428 431 { 429 432 /* Set always read/write permissions of the current logged in user. */ 430 fileList.push_back(VFSExplorer::Data::DirEntry(pBuckets->pszName, VFSFileType_Directory, 0, RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR)); 433 fileList.push_back(VFSExplorer::Data::DirEntry(pBuckets->pszName, VFSFileType_Directory, 434 0, RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR)); 431 435 pBuckets = pBuckets->pNext; 432 436 } … … 445 449 Utf8Str name(pKeys->pszName); 446 450 /* Set always read/write permissions of the current logged in user. */ 447 fileList.push_back(VFSExplorer::Data::DirEntry(pKeys->pszName, VFSFileType_File, pKeys->cbFile, RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR)); 451 fileList.push_back(VFSExplorer::Data::DirEntry(pKeys->pszName, VFSFileType_File, pKeys->cbFile, 452 RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR)); 448 453 pKeys = pKeys->pNext; 449 454 } … … 466 471 467 472 if (!aTask->progress.isNull()) 468 aTask->progress-> notifyComplete(rc);473 aTask->progress->i_notifyComplete(rc); 469 474 470 475 LogFlowFunc(("rc=%Rhrc\n", rc)); … … 520 525 521 526 if (!aTask->progress.isNull()) 522 aTask->progress-> notifyComplete(rc);527 aTask->progress->i_notifyComplete(rc); 523 528 524 529 LogFlowFunc(("rc=%Rhrc\n", rc)); -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r50545 r50874 2560 2560 } 2561 2561 2562 d->progress-> notifyComplete(rc);2562 d->progress->i_notifyComplete(rc); 2563 2563 2564 2564 LogFlowFuncLeave(); -
trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp
r50196 r50874 157 157 } 158 158 159 int NetIfEnableStaticIpConfigV6(VirtualBox * /* vBox */, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength) 159 int NetIfEnableStaticIpConfigV6(VirtualBox * /* vBox */, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, 160 IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength) 160 161 { 161 162 char szAddress[5*8 + 1 + 5 + 1]; … … 205 206 if (RT_FAILURE(rc)) 206 207 { 207 progress-> notifyComplete(E_FAIL,208 COM_IIDOF(IHostNetworkInterface),209 HostNetworkInterface::getStaticComponentName(),210 "Failed to get program path, rc=%Rrc\n", rc);208 progress->i_notifyComplete(E_FAIL, 209 COM_IIDOF(IHostNetworkInterface), 210 HostNetworkInterface::getStaticComponentName(), 211 "Failed to get program path, rc=%Rrc\n", rc); 211 212 return rc; 212 213 } … … 235 236 if (!strncmp(VBOXNETADPCTL_NAME ":", szBuf, sizeof(VBOXNETADPCTL_NAME))) 236 237 { 237 progress-> notifyComplete(E_FAIL,238 COM_IIDOF(IHostNetworkInterface),239 HostNetworkInterface::getStaticComponentName(),240 "%s", szBuf);238 progress->i_notifyComplete(E_FAIL, 239 COM_IIDOF(IHostNetworkInterface), 240 HostNetworkInterface::getStaticComponentName(), 241 "%s", szBuf); 241 242 pclose(fp); 242 243 return E_FAIL; … … 254 255 if (RT_FAILURE(rc)) 255 256 { 256 progress->notifyComplete(E_FAIL, 257 COM_IIDOF(IHostNetworkInterface), 258 HostNetworkInterface::getStaticComponentName(), 259 "Failed to get config info for %s (as reported by '" VBOXNETADPCTL_NAME " add')\n", szBuf); 257 progress->i_notifyComplete(E_FAIL, 258 COM_IIDOF(IHostNetworkInterface), 259 HostNetworkInterface::getStaticComponentName(), 260 "Failed to get config info for %s (as reported by '" 261 VBOXNETADPCTL_NAME " add')\n", szBuf); 260 262 } 261 263 else … … 273 275 if ((rc = pclose(fp)) != 0) 274 276 { 275 progress-> notifyComplete(E_FAIL,276 COM_IIDOF(IHostNetworkInterface),277 HostNetworkInterface::getStaticComponentName(),278 "Failed to execute '" VBOXNETADPCTL_NAME " add' (exit status: %d)", rc);277 progress->i_notifyComplete(E_FAIL, 278 COM_IIDOF(IHostNetworkInterface), 279 HostNetworkInterface::getStaticComponentName(), 280 "Failed to execute '" VBOXNETADPCTL_NAME " add' (exit status: %d)", rc); 279 281 rc = VERR_INTERNAL_ERROR; 280 282 } … … 284 286 /* Failed to add an interface */ 285 287 rc = VERR_PERMISSION_DENIED; 286 progress->notifyComplete(E_FAIL, 287 COM_IIDOF(IHostNetworkInterface), 288 HostNetworkInterface::getStaticComponentName(), 289 "Failed to execute '" VBOXNETADPCTL_NAME " add' (exit status: %d). Check permissions!", rc); 288 progress->i_notifyComplete(E_FAIL, 289 COM_IIDOF(IHostNetworkInterface), 290 HostNetworkInterface::getStaticComponentName(), 291 "Failed to execute '" VBOXNETADPCTL_NAME 292 " add' (exit status: %d). Check permissions!", rc); 290 293 pclose(fp); 291 294 } 292 295 } 293 296 if (RT_SUCCESS(rc)) 294 progress-> notifyComplete(rc);297 progress->i_notifyComplete(rc); 295 298 else 296 299 hrc = E_FAIL; … … 337 340 rc = NetIfAdpCtl(Utf8Str(ifname).c_str(), "remove", NULL, NULL); 338 341 if (RT_FAILURE(rc)) 339 progress-> notifyComplete(E_FAIL,340 COM_IIDOF(IHostNetworkInterface),341 HostNetworkInterface::getStaticComponentName(),342 "Failed to execute '" VBOXNETADPCTL_NAME "' (exit status: %d)", rc);342 progress->i_notifyComplete(E_FAIL, 343 COM_IIDOF(IHostNetworkInterface), 344 HostNetworkInterface::getStaticComponentName(), 345 "Failed to execute '" VBOXNETADPCTL_NAME "' (exit status: %d)", rc); 343 346 else 344 progress-> notifyComplete(S_OK);347 progress->i_notifyComplete(S_OK); 345 348 } 346 349 } 347 350 else 348 351 { 349 progress-> notifyComplete(hr);352 progress->i_notifyComplete(hr); 350 353 rc = VERR_INTERNAL_ERROR; 351 354 } -
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r50369 r50874 114 114 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SnapshotMachine, IMachine) 115 115 116 NS_DECL_CLASSINFO(Progress)117 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)118 119 116 NS_DECL_CLASSINFO(ProgressProxy) 120 117 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ProgressProxy, IProgress)
Note:
See TracChangeset
for help on using the changeset viewer.