Changeset 94914 in vbox
- Timestamp:
- May 8, 2022 7:18:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r93115 r94914 94 94 95 95 AutoCaller autoCaller(pThis); 96 if ( FAILED(autoCaller.rc()))96 if (autoCaller.isNotOk()) 97 97 return; 98 98 … … 194 194 195 195 AutoCaller autoCaller(this); 196 if ( FAILED(autoCaller.rc())) return autoCaller.rc();196 if (autoCaller.isNotOk()) return autoCaller.rc(); 197 197 198 198 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 211 211 212 212 AutoCaller autoCaller(this); 213 if ( FAILED(autoCaller.rc())) return autoCaller.rc();213 if (autoCaller.isNotOk()) return autoCaller.rc(); 214 214 215 215 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 228 228 229 229 AutoCaller autoCaller(this); 230 if ( FAILED(autoCaller.rc())) return autoCaller.rc();230 if (autoCaller.isNotOk()) return autoCaller.rc(); 231 231 232 232 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 243 243 244 244 AutoCaller autoCaller(this); 245 if ( FAILED(autoCaller.rc())) return autoCaller.rc();245 if (autoCaller.isNotOk()) return autoCaller.rc(); 246 246 247 247 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 273 273 274 274 AutoCaller autoCaller(this); 275 if ( FAILED(autoCaller.rc())) return autoCaller.rc();275 if (autoCaller.isNotOk()) return autoCaller.rc(); 276 276 277 277 /* Default action is ignoring. */ … … 308 308 Assert(m_lstFmtOffered.size()); 309 309 310 HRESULT hr = S_OK;310 HRESULT hrc = S_OK; 311 311 312 312 /* Adjust the coordinates in a multi-monitor setup. */ 313 int rc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);314 if (RT_SUCCESS( rc))313 int vrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 314 if (RT_SUCCESS(vrc)) 315 315 { 316 316 GuestDnDMsg Msg; … … 326 326 Msg.appendUInt32(cbFormats); 327 327 328 rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());329 if (RT_SUCCESS( rc))328 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 329 if (RT_SUCCESS(vrc)) 330 330 { 331 331 if (RT_SUCCESS(m_pState->waitForGuestResponse())) … … 334 334 } 335 335 336 if (RT_FAILURE( rc))337 hr = VBOX_E_IPRT_ERROR;338 339 if (SUCCEEDED(hr ))336 if (RT_FAILURE(vrc)) 337 hrc = VBOX_E_IPRT_ERROR; 338 339 if (SUCCEEDED(hrc)) 340 340 { 341 341 if (aResultAction) … … 343 343 } 344 344 345 LogFlowFunc(("hr =%Rhrc, resAction=%ld\n", hr, resAction));346 return hr ;345 LogFlowFunc(("hrc=%Rhrc, resAction=%ld\n", hrc, resAction)); 346 return hrc; 347 347 #endif /* VBOX_WITH_DRAG_AND_DROP */ 348 348 } … … 361 361 362 362 AutoCaller autoCaller(this); 363 if ( FAILED(autoCaller.rc())) return autoCaller.rc();363 if (autoCaller.isNotOk()) return autoCaller.rc(); 364 364 365 365 /* Default action is ignoring. */ … … 386 386 const uint32_t cbFormats = (uint32_t)strFormats.length() + 1; /* Include terminating zero. */ 387 387 388 HRESULT hr = S_OK;389 390 int rc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);391 if (RT_SUCCESS( rc))388 HRESULT hrc = S_OK; 389 390 int vrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 391 if (RT_SUCCESS(vrc)) 392 392 { 393 393 GuestDnDMsg Msg; … … 403 403 Msg.appendUInt32(cbFormats); 404 404 405 rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());406 if (RT_SUCCESS( rc))405 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 406 if (RT_SUCCESS(vrc)) 407 407 { 408 408 GuestDnDState *pState = GuestDnDInst()->getState(); … … 412 412 } 413 413 414 if (RT_FAILURE( rc))415 hr = VBOX_E_IPRT_ERROR;416 417 if (SUCCEEDED(hr ))414 if (RT_FAILURE(vrc)) 415 hrc = VBOX_E_IPRT_ERROR; 416 417 if (SUCCEEDED(hrc)) 418 418 { 419 419 if (aResultAction) … … 421 421 } 422 422 423 LogFlowFunc(("hr =%Rhrc, *pResultAction=%ld\n", hr, resAction));424 return hr ;423 LogFlowFunc(("hrc=%Rhrc, *pResultAction=%ld\n", hrc, resAction)); 424 return hrc; 425 425 #endif /* VBOX_WITH_DRAG_AND_DROP */ 426 426 } … … 434 434 435 435 AutoCaller autoCaller(this); 436 if ( FAILED(autoCaller.rc())) return autoCaller.rc();437 438 HRESULT hr = S_OK;436 if (autoCaller.isNotOk()) return autoCaller.rc(); 437 438 HRESULT hrc = S_OK; 439 439 440 440 GuestDnDMsg Msg; … … 443 443 Msg.appendUInt32(0); /** @todo ContextID not used yet. */ 444 444 445 int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());446 if (RT_SUCCESS( rc))445 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 446 if (RT_SUCCESS(vrc)) 447 447 { 448 448 GuestDnDState *pState = GuestDnDInst()->getState(); … … 451 451 } 452 452 453 if (RT_FAILURE( rc))454 hr = VBOX_E_IPRT_ERROR;455 456 LogFlowFunc(("hr =%Rhrc\n", hr));457 return hr ;453 if (RT_FAILURE(vrc)) 454 hrc = VBOX_E_IPRT_ERROR; 455 456 LogFlowFunc(("hrc=%Rhrc\n", hrc)); 457 return hrc; 458 458 #endif /* VBOX_WITH_DRAG_AND_DROP */ 459 459 } … … 793 793 * 794 794 ** @todo Support more than one format; add a format<->function handler concept. Later. */ 795 int rc;795 int vrc; 796 796 const bool fHasURIList = std::find(m_lstFmtOffered.begin(), 797 797 m_lstFmtOffered.end(), "text/uri-list") != m_lstFmtOffered.end(); 798 798 if (fHasURIList) 799 799 { 800 rc = i_sendTransferData(pCtx, msTimeout);800 vrc = i_sendTransferData(pCtx, msTimeout); 801 801 } 802 802 else 803 803 { 804 rc = i_sendRawData(pCtx, msTimeout);805 } 806 807 if (RT_FAILURE( rc))808 { 809 LogRel(("DnD: Sending data to guest failed with %Rrc\n", rc));804 vrc = i_sendRawData(pCtx, msTimeout); 805 } 806 807 if (RT_FAILURE(vrc)) 808 { 809 LogRel(("DnD: Sending data to guest failed with %Rrc\n", vrc)); 810 810 sendCancel(); 811 811 } … … 814 814 i_reset(); 815 815 816 LogFlowFuncLeaveRC( rc);817 return rc;816 LogFlowFuncLeaveRC(vrc); 817 return vrc; 818 818 } 819 819 … … 831 831 size_t cbData = pCtx->Meta.cbData; 832 832 833 int rc = VINF_SUCCESS;833 int vrc = VINF_SUCCESS; 834 834 835 835 const size_t cbFmt = pCtx->Meta.strFmt.length() + 1; /* Include terminator. */ … … 873 873 } 874 874 875 rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());876 if (RT_FAILURE( rc))875 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 876 if (RT_FAILURE(vrc)) 877 877 break; 878 878 … … 882 882 } 883 883 884 if (RT_SUCCESS( rc))885 { 886 rc = updateProgress(pCtx, pCtx->pState, (uint32_t)pCtx->Meta.cbData);887 AssertRC( rc);888 } 889 890 LogFlowFuncLeaveRC( rc);891 return rc;884 if (RT_SUCCESS(vrc)) 885 { 886 vrc = updateProgress(pCtx, pCtx->pState, (uint32_t)pCtx->Meta.cbData); 887 AssertRC(vrc); 888 } 889 890 LogFlowFuncLeaveRC(vrc); 891 return vrc; 892 892 } 893 893 … … 924 924 Msg.appendUInt32(0); /** @todo cbChecksum; not used yet. */ 925 925 926 int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());927 928 LogFlowFuncLeaveRC( rc);929 return rc;926 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 927 928 LogFlowFuncLeaveRC(vrc); 929 return vrc; 930 930 } 931 931 … … 980 980 AssertPtrReturn(pcszDstPath, VERR_INVALID_POINTER); 981 981 982 int rc = VINF_SUCCESS;982 int vrc = VINF_SUCCESS; 983 983 984 984 if (!DnDTransferObjectIsOpen(pObj)) … … 986 986 LogRel2(("DnD: Opening host file '%s' for transferring to guest\n", pcszSrcPath)); 987 987 988 rc = DnDTransferObjectOpen(pObj, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fMode */,989 DNDTRANSFEROBJECT_FLAGS_NONE);990 if (RT_FAILURE( rc))991 LogRel(("DnD: Opening host file '%s' failed, rc=%Rrc\n", pcszSrcPath, rc));992 } 993 994 if (RT_FAILURE( rc))995 return rc;988 vrc = DnDTransferObjectOpen(pObj, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fMode */, 989 DNDTRANSFEROBJECT_FLAGS_NONE); 990 if (RT_FAILURE(vrc)) 991 LogRel(("DnD: Opening host file '%s' failed, rc=%Rrc\n", pcszSrcPath, vrc)); 992 } 993 994 if (RT_FAILURE(vrc)) 995 return vrc; 996 996 997 997 bool fSendData = false; 998 if (RT_SUCCESS( rc))998 if (RT_SUCCESS(vrc)) /** @todo r=aeichner Could save an identation level here as there is a error check above already... */ 999 999 { 1000 1000 if (m_pState->m_uProtocolVersion >= 2) … … 1040 1040 } 1041 1041 1042 if ( RT_SUCCESS( rc)1042 if ( RT_SUCCESS(vrc) 1043 1043 && fSendData) 1044 1044 { 1045 rc = i_sendFileData(pCtx, pObj, pMsg);1046 } 1047 1048 if (RT_FAILURE( rc))1049 LogRel(("DnD: Sending host file '%s' to guest failed, rc=%Rrc\n", pcszSrcPath, rc));1050 1051 LogFlowFuncLeaveRC( rc);1052 return rc;1045 vrc = i_sendFileData(pCtx, pObj, pMsg); 1046 } 1047 1048 if (RT_FAILURE(vrc)) 1049 LogRel(("DnD: Sending host file '%s' to guest failed, rc=%Rrc\n", pcszSrcPath, vrc)); 1050 1051 LogFlowFuncLeaveRC(vrc); 1052 return vrc; 1053 1053 } 1054 1054 … … 1099 1099 uint32_t cbRead; 1100 1100 1101 int rc = DnDTransferObjectRead(pObj, pvBuf, cbBuf, &cbRead);1102 if (RT_SUCCESS( rc))1101 int vrc = DnDTransferObjectRead(pObj, pvBuf, cbBuf, &cbRead); 1102 if (RT_SUCCESS(vrc)) 1103 1103 { 1104 1104 LogFlowFunc(("cbBufe=%zu, cbRead=%RU32\n", cbBuf, cbRead)); … … 1123 1123 } 1124 1124 1125 int rc2 = updateProgress(pCtx, pCtx->pState, (uint32_t)cbRead);1126 AssertRC( rc2);1125 int vrc2 = updateProgress(pCtx, pCtx->pState, (uint32_t)cbRead); 1126 AssertRC(vrc2); 1127 1127 1128 1128 /* DnDTransferObjectRead() will return VINF_EOF if reading is complete. */ 1129 if ( rc == VINF_EOF)1130 rc = VINF_SUCCESS;1129 if (vrc == VINF_EOF) 1130 vrc = VINF_SUCCESS; 1131 1131 1132 1132 if (DnDTransferObjectIsComplete(pObj)) /* Done reading? */ … … 1134 1134 } 1135 1135 else 1136 LogRel(("DnD: Reading from host file '%s' failed, rc=%Rrc\n", pcszSrcPath,rc));1137 1138 LogFlowFuncLeaveRC( rc);1139 return rc;1136 LogRel(("DnD: Reading from host file '%s' failed, vrc=%Rrc\n", pcszSrcPath, vrc)); 1137 1138 LogFlowFuncLeaveRC(vrc); 1139 return vrc; 1140 1140 } 1141 1141 … … 1163 1163 LogFlowFunc(("pThis=%p, pList=%p, uMsg=%RU32\n", pThis, pList, uMsg)); 1164 1164 1165 int rc = VINF_SUCCESS;1166 int rcGuest = VINF_SUCCESS; /* Contains error code from guest in case of VERR_GSTDND_GUEST_ERROR. */1167 bool fNotify = false;1165 int vrc = VINF_SUCCESS; 1166 int vrcGuest = VINF_SUCCESS; /* Contains error code from guest in case of VERR_GSTDND_GUEST_ERROR. */ 1167 bool fNotify = false; 1168 1168 1169 1169 switch (uMsg) … … 1174 1174 1175 1175 case GUEST_DND_FN_DISCONNECT: 1176 rc = VERR_CANCELLED;1176 vrc = VERR_CANCELLED; 1177 1177 break; 1178 1178 … … 1188 1188 GuestDnDMsg *pMsg = new GuestDnDMsg(); 1189 1189 1190 rc = pThis->i_sendTransferListObject(pCtx, pList, pMsg);1191 if ( rc == VINF_EOF) /* Transfer complete? */1190 vrc = pThis->i_sendTransferListObject(pCtx, pList, pMsg); 1191 if (vrc == VINF_EOF) /* Transfer complete? */ 1192 1192 { 1193 1193 LogFlowFunc(("Last transfer item processed, bailing out\n")); 1194 1194 } 1195 else if (RT_SUCCESS( rc))1195 else if (RT_SUCCESS(vrc)) 1196 1196 { 1197 rc = pThis->msgQueueAdd(pMsg);1198 if (RT_SUCCESS( rc)) /* Return message type & required parameter count to the guest. */1197 vrc = pThis->msgQueueAdd(pMsg); 1198 if (RT_SUCCESS(vrc)) /* Return message type & required parameter count to the guest. */ 1199 1199 { 1200 1200 LogFlowFunc(("GUEST_DND_FN_GET_NEXT_HOST_MSG -> %RU32 (%RU32 params)\n", pMsg->getType(), pMsg->getCount())); … … 1204 1204 } 1205 1205 1206 if ( RT_FAILURE( rc)1207 || rc == VINF_EOF) /* Transfer complete? */1206 if ( RT_FAILURE(vrc) 1207 || vrc == VINF_EOF) /* Transfer complete? */ 1208 1208 { 1209 1209 delete pMsg; … … 1213 1213 catch(std::bad_alloc & /*e*/) 1214 1214 { 1215 rc = VERR_NO_MEMORY;1215 vrc = VERR_NO_MEMORY; 1216 1216 } 1217 1217 break; … … 1232 1232 } 1233 1233 1234 rc = pCtx->pState->setProgress(100, DND_PROGRESS_ERROR, pCBData->rc,1235 GuestDnDTarget::i_guestErrorToString(pCBData->rc));1236 if (RT_SUCCESS( rc))1234 vrc = pCtx->pState->setProgress(100, DND_PROGRESS_ERROR, pCBData->rc, 1235 GuestDnDTarget::i_guestErrorToString(pCBData->rc)); 1236 if (RT_SUCCESS(vrc)) 1237 1237 { 1238 rc = VERR_GSTDND_GUEST_ERROR;1239 rcGuest = pCBData->rc;1238 vrc = VERR_GSTDND_GUEST_ERROR; 1239 vrcGuest = pCBData->rc; 1240 1240 } 1241 1241 break; … … 1270 1270 pThis->msgQueueClear(); 1271 1271 1272 rc = VERR_INVALID_PARAMETER;1272 vrc = VERR_INVALID_PARAMETER; 1273 1273 } 1274 1274 1275 if (RT_SUCCESS( rc))1275 if (RT_SUCCESS(vrc)) 1276 1276 { 1277 1277 LogFlowFunc(("Returning uMsg=%RU32\n", uMsg)); 1278 rc = HGCM::Message::CopyParms(pCBData->paParms, pCBData->cParms, pMsg->getParms(), pMsg->getCount(),1279 false /* fDeepCopy */);1280 if (RT_SUCCESS( rc))1278 vrc = HGCM::Message::CopyParms(pCBData->paParms, pCBData->cParms, pMsg->getParms(), pMsg->getCount(), 1279 false /* fDeepCopy */); 1280 if (RT_SUCCESS(vrc)) 1281 1281 { 1282 1282 pCBData->cParms = pMsg->getCount(); … … 1284 1284 } 1285 1285 else 1286 LogFlowFunc(("Copying parameters failed with rc=%Rrc\n",rc));1286 LogFlowFunc(("Copying parameters failed with vrc=%Rrc\n", vrc)); 1287 1287 } 1288 1288 } 1289 1289 else 1290 rc = VERR_NO_DATA;1291 1292 LogFlowFunc(("Processing next message ended with rc=%Rrc\n",rc));1290 vrc = VERR_NO_DATA; 1291 1292 LogFlowFunc(("Processing next message ended with vrc=%Rrc\n", vrc)); 1293 1293 break; 1294 1294 } 1295 1295 default: 1296 rc = VERR_NOT_SUPPORTED;1297 break; 1298 } 1299 1300 int rcToGuest = VINF_SUCCESS; /* Status which will be sent back to the guest. */1296 vrc = VERR_NOT_SUPPORTED; 1297 break; 1298 } 1299 1300 int vrcToGuest = VINF_SUCCESS; /* Status which will be sent back to the guest. */ 1301 1301 1302 1302 /* 1303 1303 * Resolve errors. 1304 1304 */ 1305 switch ( rc)1305 switch (vrc) 1306 1306 { 1307 1307 case VINF_SUCCESS: … … 1316 1316 1317 1317 /* The guest expects VERR_NO_DATA if the transfer is complete. */ 1318 rcToGuest = VERR_NO_DATA;1318 vrcToGuest = VERR_NO_DATA; 1319 1319 break; 1320 1320 } … … 1322 1322 case VERR_GSTDND_GUEST_ERROR: 1323 1323 { 1324 LogRel(("DnD: Guest reported error %Rrc, aborting transfer to guest\n", rcGuest));1324 LogRel(("DnD: Guest reported error %Rrc, aborting transfer to guest\n", vrcGuest)); 1325 1325 break; 1326 1326 } … … 1329 1329 { 1330 1330 LogRel2(("DnD: Transfer to guest canceled\n")); 1331 rcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */1331 vrcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */ 1332 1332 break; 1333 1333 } … … 1335 1335 default: 1336 1336 { 1337 LogRel(("DnD: Host error %Rrc occurred, aborting transfer to guest\n", rc));1338 rcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */1339 break; 1340 } 1341 } 1342 1343 if (RT_FAILURE( rc))1337 LogRel(("DnD: Host error %Rrc occurred, aborting transfer to guest\n", vrc)); 1338 vrcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */ 1339 break; 1340 } 1341 } 1342 1343 if (RT_FAILURE(vrc)) 1344 1344 { 1345 1345 /* Unregister this callback. */ 1346 1346 AssertPtr(pCtx->pState); 1347 int rc2 = pCtx->pState->setCallback(uMsg, NULL /* PFNGUESTDNDCALLBACK */);1348 AssertRC( rc2);1347 int vrc2 = pCtx->pState->setCallback(uMsg, NULL /* PFNGUESTDNDCALLBACK */); 1348 AssertRC(vrc2); 1349 1349 1350 1350 /* Let the waiter(s) know. */ … … 1352 1352 } 1353 1353 1354 LogFlowFunc(("fNotify=%RTbool, rc=%Rrc, rcToGuest=%Rrc\n", fNotify, rc,rcToGuest));1354 LogFlowFunc(("fNotify=%RTbool, vrc=%Rrc, vrcToGuest=%Rrc\n", fNotify, vrc, vrcToGuest)); 1355 1355 1356 1356 if (fNotify) 1357 1357 { 1358 int rc2 = pCtx->EventCallback.Notify(rc); /** @todo Also pass guest error back? */1359 AssertRC( rc2);1360 } 1361 1362 LogFlowFuncLeaveRC( rc);1363 return rcToGuest; /* Tell the guest. */1358 int vrc2 = pCtx->EventCallback.Notify(vrc); /** @todo Also pass guest error back? */ 1359 AssertRC(vrc2); 1360 } 1361 1362 LogFlowFuncLeaveRC(vrc); 1363 return vrcToGuest; /* Tell the guest. */ 1364 1364 } 1365 1365 … … 1376 1376 AssertPtr(pCtx->pState); 1377 1377 1378 #define REGISTER_CALLBACK(x) \1379 do { \1380 rc = pCtx->pState->setCallback(x, i_sendTransferDataCallback, pCtx); \1381 if (RT_FAILURE( rc)) \1382 return rc; \1378 #define REGISTER_CALLBACK(x) \ 1379 do { \ 1380 vrc = pCtx->pState->setCallback(x, i_sendTransferDataCallback, pCtx); \ 1381 if (RT_FAILURE(vrc)) \ 1382 return vrc; \ 1383 1383 } while (0) 1384 1384 1385 1385 #define UNREGISTER_CALLBACK(x) \ 1386 1386 do { \ 1387 int rc2 = pCtx->pState->setCallback(x, NULL); \1388 AssertRC( rc2); \1387 int vrc2 = pCtx->pState->setCallback(x, NULL); \ 1388 AssertRC(vrc2); \ 1389 1389 } while (0) 1390 1390 1391 int rc = pCtx->Transfer.init(mData.mcbBlockSize);1392 if (RT_FAILURE( rc))1393 return rc;1394 1395 rc = pCtx->EventCallback.Reset();1396 if (RT_FAILURE( rc))1397 return rc;1391 int vrc = pCtx->Transfer.init(mData.mcbBlockSize); 1392 if (RT_FAILURE(vrc)) 1393 return vrc; 1394 1395 vrc = pCtx->EventCallback.Reset(); 1396 if (RT_FAILURE(vrc)) 1397 return vrc; 1398 1398 1399 1399 /* … … 1416 1416 * Extract transfer list from current meta data. 1417 1417 */ 1418 rc = DnDTransferListAppendPathsFromBuffer(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI,1419 (const char *)pCtx->Meta.pvData, pCtx->Meta.cbData, DND_PATH_SEPARATOR_STR,1420 DNDTRANSFERLIST_FLAGS_RECURSIVE);1421 if (RT_FAILURE( rc))1418 vrc = DnDTransferListAppendPathsFromBuffer(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI, 1419 (const char *)pCtx->Meta.pvData, pCtx->Meta.cbData, DND_PATH_SEPARATOR_STR, 1420 DNDTRANSFERLIST_FLAGS_RECURSIVE); 1421 if (RT_FAILURE(vrc)) 1422 1422 break; 1423 1423 … … 1428 1428 /* cbExtra can be 0, if all files are of 0 bytes size. */ 1429 1429 pCtx->Transfer.cObjToProcess = DnDTransferListObjCount(&pCtx->Transfer.List); 1430 AssertBreakStmt(pCtx->Transfer.cObjToProcess, rc = VERR_INVALID_PARAMETER);1430 AssertBreakStmt(pCtx->Transfer.cObjToProcess, vrc = VERR_INVALID_PARAMETER); 1431 1431 1432 1432 /* Update the meta data to have the current root transfer entries in the right shape. */ … … 1442 1442 size_t cbData; 1443 1443 #ifdef DEBUG 1444 rc = DnDTransferListGetRootsEx(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI, "" /* pcszPathBase */,1445 "\n" /* pcszSeparator */, (char **)&pvData, &cbData);1446 AssertRCReturn( rc,rc);1444 vrc = DnDTransferListGetRootsEx(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI, "" /* pcszPathBase */, 1445 "\n" /* pcszSeparator */, (char **)&pvData, &cbData); 1446 AssertRCReturn(vrc, vrc); 1447 1447 LogFlowFunc(("URI data:\n%s", (char *)pvData)); 1448 1448 RTMemFree(pvData); 1449 1449 cbData = 0; 1450 1450 #endif 1451 rc = DnDTransferListGetRoots(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI,1452 (char **)&pvData, &cbData);1453 AssertRCReturn( rc,rc);1451 vrc = DnDTransferListGetRoots(&pCtx->Transfer.List, DNDTRANSFERLISTFMT_URI, 1452 (char **)&pvData, &cbData); 1453 AssertRCReturn(vrc, vrc); 1454 1454 1455 1455 /* pCtx->Meta now owns the allocated data. */ … … 1475 1475 */ 1476 1476 if (m_pState->m_uProtocolVersion >= 3) 1477 rc = i_sendMetaDataHeader(pCtx);1477 vrc = i_sendMetaDataHeader(pCtx); 1478 1478 1479 1479 /* 1480 1480 * Send the (meta) data body. 1481 1481 */ 1482 if (RT_SUCCESS( rc))1483 rc = i_sendMetaDataBody(pCtx);1484 1485 if (RT_SUCCESS( rc))1486 { 1487 rc = waitForEvent(&pCtx->EventCallback, pCtx->pState, msTimeout);1488 if (RT_SUCCESS( rc))1482 if (RT_SUCCESS(vrc)) 1483 vrc = i_sendMetaDataBody(pCtx); 1484 1485 if (RT_SUCCESS(vrc)) 1486 { 1487 vrc = waitForEvent(&pCtx->EventCallback, pCtx->pState, msTimeout); 1488 if (RT_SUCCESS(vrc)) 1489 1489 pCtx->pState->setProgress(100, DND_PROGRESS_COMPLETE, VINF_SUCCESS); 1490 1490 } … … 1509 1509 #undef UNREGISTER_CALLBACK 1510 1510 1511 if (RT_FAILURE( rc))1512 { 1513 if ( rc == VERR_CANCELLED) /* Transfer was cancelled by the host. */1511 if (RT_FAILURE(vrc)) 1512 { 1513 if (vrc == VERR_CANCELLED) /* Transfer was cancelled by the host. */ 1514 1514 { 1515 1515 /* … … 1518 1518 * host side never must depend on anything from the guest. 1519 1519 */ 1520 int rc2 = sendCancel();1521 AssertRC( rc2);1520 int vrc2 = sendCancel(); 1521 AssertRC(vrc2); 1522 1522 1523 1523 LogRel2(("DnD: Sending transfer data to guest cancelled by user\n")); 1524 1524 1525 rc2 = pCtx->pState->setProgress(100, DND_PROGRESS_CANCELLED, VINF_SUCCESS);1526 AssertRC( rc2);1525 vrc2 = pCtx->pState->setProgress(100, DND_PROGRESS_CANCELLED, VINF_SUCCESS); 1526 AssertRC(vrc2); 1527 1527 1528 1528 /* Cancelling is not an error, just set success here. */ 1529 rc = VINF_SUCCESS;1530 } 1531 else if ( rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */1532 { 1533 LogRel(("DnD: Sending transfer data to guest failed with rc=%Rrc\n",rc));1534 int rc2 = pCtx->pState->setProgress(100, DND_PROGRESS_ERROR,rc,1535 GuestDnDTarget::i_hostErrorToString(rc));1536 AssertRC( rc2);1537 } 1538 } 1539 1540 LogFlowFuncLeaveRC( rc);1541 return rc;1529 vrc = VINF_SUCCESS; 1530 } 1531 else if (vrc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */ 1532 { 1533 LogRel(("DnD: Sending transfer data to guest failed with vrc=%Rrc\n", vrc)); 1534 int vrc2 = pCtx->pState->setProgress(100, DND_PROGRESS_ERROR, vrc, 1535 GuestDnDTarget::i_hostErrorToString(vrc)); 1536 AssertRC(vrc2); 1537 } 1538 } 1539 1540 LogFlowFuncLeaveRC(vrc); 1541 return vrc; 1542 1542 } 1543 1543 … … 1556 1556 AssertPtrReturn(pMsg, VERR_INVALID_POINTER); 1557 1557 1558 int rc = updateProgress(pCtx, pCtx->pState);1559 AssertRCReturn( rc,rc);1558 int vrc = updateProgress(pCtx, pCtx->pState); 1559 AssertRCReturn(vrc, vrc); 1560 1560 1561 1561 PDNDTRANSFEROBJECT pObj = DnDTransferListObjGetFirst(pList); … … 1566 1566 { 1567 1567 case DNDTRANSFEROBJTYPE_DIRECTORY: 1568 rc = i_sendDirectory(pCtx, pObj, pMsg);1568 vrc = i_sendDirectory(pCtx, pObj, pMsg); 1569 1569 break; 1570 1570 1571 1571 case DNDTRANSFEROBJTYPE_FILE: 1572 rc = i_sendFile(pCtx, pObj, pMsg);1572 vrc = i_sendFile(pCtx, pObj, pMsg); 1573 1573 break; 1574 1574 1575 1575 default: 1576 AssertFailedStmt( rc = VERR_NOT_SUPPORTED);1577 break; 1578 } 1579 1580 if ( RT_SUCCESS( rc)1576 AssertFailedStmt(vrc = VERR_NOT_SUPPORTED); 1577 break; 1578 } 1579 1580 if ( RT_SUCCESS(vrc) 1581 1581 && DnDTransferObjectIsComplete(pObj)) 1582 1582 { … … 1590 1590 } 1591 1591 1592 LogFlowFuncLeaveRC( rc);1593 return rc;1592 LogFlowFuncLeaveRC(vrc); 1593 return vrc; 1594 1594 } 1595 1595 … … 1612 1612 return VINF_SUCCESS; 1613 1613 1614 int rc = i_sendMetaDataHeader(pCtx);1615 if (RT_SUCCESS( rc))1616 rc = i_sendMetaDataBody(pCtx);1617 1618 int rc2;1619 if (RT_FAILURE( rc))1620 { 1621 LogRel(("DnD: Sending raw data to guest failed with rc=%Rrc\n",rc));1622 rc2 = pCtx->pState->setProgress(100 /* Percent */, DND_PROGRESS_ERROR,rc,1623 GuestDnDTarget::i_hostErrorToString(rc));1614 int vrc = i_sendMetaDataHeader(pCtx); 1615 if (RT_SUCCESS(vrc)) 1616 vrc = i_sendMetaDataBody(pCtx); 1617 1618 int vrc2; 1619 if (RT_FAILURE(vrc)) 1620 { 1621 LogRel(("DnD: Sending raw data to guest failed with vrc=%Rrc\n", vrc)); 1622 vrc2 = pCtx->pState->setProgress(100 /* Percent */, DND_PROGRESS_ERROR, vrc, 1623 GuestDnDTarget::i_hostErrorToString(vrc)); 1624 1624 } 1625 1625 else 1626 rc2 = pCtx->pState->setProgress(100 /* Percent */, DND_PROGRESS_COMPLETE,rc);1627 AssertRC( rc2);1628 1629 LogFlowFuncLeaveRC( rc);1630 return rc;1626 vrc2 = pCtx->pState->setProgress(100 /* Percent */, DND_PROGRESS_COMPLETE, vrc); 1627 AssertRC(vrc2); 1628 1629 LogFlowFuncLeaveRC(vrc); 1630 return vrc; 1631 1631 } 1632 1632 … … 1646 1646 LogRel2(("DnD: Sending cancelling request to the guest ...\n")); 1647 1647 1648 int rc = GuestDnDBase::sendCancel();1648 int vrc = GuestDnDBase::sendCancel(); 1649 1649 1650 1650 if (aVeto) 1651 1651 *aVeto = FALSE; /** @todo Implement vetoing. */ 1652 1652 1653 HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;1654 1655 LogFlowFunc(("hr =%Rhrc\n", hr));1656 return hr ;1653 HRESULT hrc = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR; 1654 1655 LogFlowFunc(("hrc=%Rhrc\n", hrc)); 1656 return hrc; 1657 1657 #endif /* VBOX_WITH_DRAG_AND_DROP */ 1658 1658 }
Note:
See TracChangeset
for help on using the changeset viewer.