Changeset 43170 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Sep 4, 2012 4:37:40 PM (12 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r42919 r43170 196 196 else 197 197 { 198 ComObjPtr<Progress> pProgress; 199 SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */, 200 Utf8Str(aSource), fFlags); 201 AssertPtrReturn(pTask, VERR_NO_MEMORY); 202 rc = pSession->startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress); 203 if (RT_SUCCESS(rc)) 198 try 204 199 { 205 /* Return progress to the caller. */ 206 hr = pProgress.queryInterfaceTo(aProgress); 200 ComObjPtr<Progress> pProgress; 201 SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */, 202 Utf8Str(aSource), fFlags); 203 rc = pSession->startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress); 204 if (RT_SUCCESS(rc)) 205 { 206 /* Return progress to the caller. */ 207 hr = pProgress.queryInterfaceTo(aProgress); 208 } 209 else 210 hr = setError(VBOX_E_IPRT_ERROR, 211 tr("Starting task for updating Guest Additions on the guest failed: %Rrc"), rc); 207 212 } 208 else 209 hr = setError(VBOX_E_IPRT_ERROR, 210 tr("Starting task for updating Guest Additions on the guest failed: %Rrc"), rc); 213 catch(std::bad_alloc &) 214 { 215 hr = E_OUTOFMEMORY; 216 } 211 217 } 212 218 } -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r43162 r43170 940 940 { 941 941 pCallbackRead = new GuestCtrlCallback(); 942 AssertPtr(pCallbackRead);943 942 } 944 943 catch(std::bad_alloc &) … … 1108 1107 { 1109 1108 pCallbackStart = new GuestCtrlCallback(); 1110 AssertPtr(pCallbackStart);1111 1109 } 1112 1110 catch(std::bad_alloc &) … … 1519 1517 { 1520 1518 pCallbackWrite = new GuestCtrlCallback(); 1521 AssertPtr(pCallbackWrite);1522 1519 } 1523 1520 catch(std::bad_alloc &) … … 1610 1607 alock.acquire(); 1611 1608 1612 AssertPtr(pCallbackWrite);1613 1609 int rc2 = callbackRemove(uContextID); 1614 1610 if (RT_SUCCESS(vrc)) … … 1970 1966 int GuestProcessTool::WaitEx(uint32_t fFlags, GuestProcessStreamBlock *pStreamBlock, int *pGuestRc) 1971 1967 { 1972 LogFlowThisFunc(("pSession=%p, pProcess=%p,fFlags=0x%x, pStreamBlock=%p, pGuestRc=%p\n",1973 pSession, pProcess,fFlags, pStreamBlock, pGuestRc));1968 LogFlowThisFunc(("pSession=%p, fFlags=0x%x, pStreamBlock=%p, pGuestRc=%p\n", 1969 pSession, fFlags, pStreamBlock, pGuestRc)); 1974 1970 1975 1971 AssertPtrReturn(pSession, VERR_INVALID_POINTER); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r43165 r43170 1077 1077 HRESULT hr = S_OK; 1078 1078 1079 ComObjPtr<Progress> pProgress; 1080 SessionTaskCopyFrom *pTask = new SessionTaskCopyFrom(this /* GuestSession */, 1081 Utf8Str(aSource), Utf8Str(aDest), fFlags); 1082 AssertPtrReturn(pTask, VERR_NO_MEMORY); 1083 int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from guest to \"%ls\" on the host"), aSource, aDest), 1084 pTask, pProgress); 1085 if (RT_SUCCESS(rc)) 1086 { 1087 /* Return progress to the caller. */ 1088 hr = pProgress.queryInterfaceTo(aProgress); 1089 } 1090 else 1091 hr = setError(VBOX_E_IPRT_ERROR, 1092 tr("Starting task for copying file \"%ls\" from guest to \"%ls\" on the host failed: %Rrc"), rc); 1079 try 1080 { 1081 ComObjPtr<Progress> pProgress; 1082 SessionTaskCopyFrom *pTask = new SessionTaskCopyFrom(this /* GuestSession */, 1083 Utf8Str(aSource), Utf8Str(aDest), fFlags); 1084 int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from guest to \"%ls\" on the host"), aSource, aDest), 1085 pTask, pProgress); 1086 if (RT_SUCCESS(rc)) 1087 { 1088 /* Return progress to the caller. */ 1089 hr = pProgress.queryInterfaceTo(aProgress); 1090 } 1091 else 1092 hr = setError(VBOX_E_IPRT_ERROR, 1093 tr("Starting task for copying file \"%ls\" from guest to \"%ls\" on the host failed: %Rrc"), rc); 1094 } 1095 catch(std::bad_alloc &) 1096 { 1097 hr = E_OUTOFMEMORY; 1098 } 1099 1093 1100 return hr; 1094 1101 #endif /* VBOX_WITH_GUEST_CONTROL */ … … 1126 1133 HRESULT hr = S_OK; 1127 1134 1128 ComObjPtr<Progress> pProgress; 1129 SessionTaskCopyTo *pTask = new SessionTaskCopyTo(this /* GuestSession */, 1130 Utf8Str(aSource), Utf8Str(aDest), fFlags); 1131 AssertPtrReturn(pTask, VERR_NO_MEMORY); 1132 int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from host to \"%ls\" on the guest"), aSource, aDest), 1133 pTask, pProgress); 1134 if (RT_SUCCESS(rc)) 1135 { 1136 /* Return progress to the caller. */ 1137 hr = pProgress.queryInterfaceTo(aProgress); 1138 } 1139 else 1140 hr = setError(VBOX_E_IPRT_ERROR, 1141 tr("Starting task for copying file \"%ls\" from host to \"%ls\" on the guest failed: %Rrc"), rc); 1142 return hr; 1135 try 1136 { 1137 ComObjPtr<Progress> pProgress; 1138 SessionTaskCopyTo *pTask = new SessionTaskCopyTo(this /* GuestSession */, 1139 Utf8Str(aSource), Utf8Str(aDest), fFlags); 1140 AssertPtrReturn(pTask, VERR_NO_MEMORY); 1141 int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from host to \"%ls\" on the guest"), aSource, aDest), 1142 pTask, pProgress); 1143 if (RT_SUCCESS(rc)) 1144 { 1145 /* Return progress to the caller. */ 1146 hr = pProgress.queryInterfaceTo(aProgress); 1147 } 1148 else 1149 hr = setError(VBOX_E_IPRT_ERROR, 1150 tr("Starting task for copying file \"%ls\" from host to \"%ls\" on the guest failed: %Rrc"), rc); 1151 } 1152 catch(std::bad_alloc &) 1153 { 1154 hr = E_OUTOFMEMORY; 1155 } 1156 1157 return hr; 1143 1158 #endif /* VBOX_WITH_GUEST_CONTROL */ 1144 1159 } -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r43162 r43170 290 290 for (;;) 291 291 { 292 int guestRc;293 292 rc = pProcess->waitFor(ProcessWaitForFlag_StdIn, 294 293 30 * 1000 /* Timeout */, waitRes, &guestRc); … … 550 549 else if (objData.mType != FsObjType_File) /* Only single files are supported at the moment. */ 551 550 { 552 rc = setProgressErrorMsg(VBOX_E_IPRT_ERROR, 553 Utf8StrFmt(GuestSession::tr("Object \"%s\" on the guest is not a file"), mSource.c_str())); 551 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 552 Utf8StrFmt(GuestSession::tr("Object \"%s\" on the guest is not a file"), mSource.c_str())); 553 rc = VERR_GENERAL_FAILURE; /* Fudge. */ 554 554 } 555 555 … … 577 577 578 578 /* Startup process. */ 579 ComObjPtr<GuestProcess> pProcess; int guestRc;579 ComObjPtr<GuestProcess> pProcess; 580 580 rc = pSession->processCreateExInteral(procInfo, pProcess); 581 581 if (RT_SUCCESS(rc)) … … 605 605 uint64_t cbWrittenTotal = 0; 606 606 uint64_t cbToRead = objData.mObjectSize; 607 608 int guestRc;609 607 610 608 for (;;)
Note:
See TracChangeset
for help on using the changeset viewer.