Changeset 97764 in vbox for trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
- Timestamp:
- Dec 8, 2022 3:47:13 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r97748 r97764 401 401 * 402 402 * @returns IPRT status code. 403 * @retval VERR_CANCELLED if the transfer was cancelled by the host. 403 404 * @param pCtx DnD context to use. 404 405 * @param pDataHdr DnD data header to use. Needed for accounting. … … 657 658 if (RT_FAILURE(rc)) 658 659 { 659 LogRel(("DnD: Receiving URI data failed with %Rrc\n", rc)); 660 if (rc == VERR_CANCELLED) 661 LogRel2(("DnD: Receiving URI data was cancelled by the host\n")); 662 else 663 LogRel(("DnD: Receiving URI data failed with %Rrc\n", rc)); 660 664 661 665 DnDTransferObjectDestroy(&objCur); … … 864 868 * Main function for receiving the actual DnD data from the host. 865 869 * 866 * @returns IPRT status code. 870 * @returns VBox status code. 871 * @retval VERR_CANCELLED if cancelled by the host. 867 872 * @param pCtx DnD context to use. 868 873 * @param pMeta Where to store the actual meta data received from the host. … … 885 890 void *pvData = NULL; 886 891 uint64_t cbData = 0; 887 888 892 int rc = vbglR3DnDHGRecvDataLoop(pCtx, &dataHdr, &pvData, &cbData); 889 893 if (RT_SUCCESS(rc)) … … 944 948 pMeta->enmType = VBGLR3GUESTDNDMETADATATYPE_RAW; 945 949 } 950 951 if (pvData) 952 RTMemFree(pvData); 946 953 } 947 954 … … 951 958 if (RT_FAILURE(rc)) 952 959 { 953 if (pvData)954 RTMemFree(pvData);955 956 960 if (rc != VERR_CANCELLED) 957 961 { … … 1198 1202 * protocol actually is working. 1199 1203 * 1200 * @returns IPRTstatus code.1204 * @returns VBox status code. 1201 1205 * @param pCtx DnD context to work with. 1202 1206 * @param ppEvent Next DnD event received on success; needs to be free'd by the client calling … … 1324 1328 rc = vbglR3DnDHGRecvCancel(pCtx); 1325 1329 if (RT_SUCCESS(rc)) 1326 pEvent->enmType = VBGLR3DNDEVENTTYPE_HG_CANCEL;1330 rc = VERR_CANCELLED; /* Will emit a cancel event below. */ 1327 1331 break; 1328 1332 } … … 1356 1360 if (RT_FAILURE(rc)) 1357 1361 { 1358 VbglR3DnDEventFree(pEvent); 1359 LogRel(("DnD: Handling message %s (%#x) failed with %Rrc\n", DnDHostMsgToStr(uMsg), uMsg, rc)); 1360 } 1361 else 1362 /* Current operation cancelled? Set / overwrite event type and tell the caller. */ 1363 if (rc == VERR_CANCELLED) 1364 { 1365 pEvent->enmType = VBGLR3DNDEVENTTYPE_CANCEL; 1366 rc = VINF_SUCCESS; /* Deliver the event to the caller. */ 1367 } 1368 else 1369 { 1370 VbglR3DnDEventFree(pEvent); 1371 LogRel(("DnD: Handling message %s (%#x) failed with %Rrc\n", DnDHostMsgToStr(uMsg), uMsg, rc)); 1372 } 1373 } 1374 1375 if (RT_SUCCESS(rc)) 1362 1376 *ppEvent = pEvent; 1363 1377 1378 LogFlowFuncLeaveRC(rc); 1364 1379 return rc; 1365 1380 }
Note:
See TracChangeset
for help on using the changeset viewer.