Changeset 85584 in vbox for trunk/src/VBox
- Timestamp:
- Jul 31, 2020 4:48:59 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r85557 r85584 821 821 return VERR_NO_MEMORY; 822 822 823 DNDDROPPEDFILES droppedFiles;824 RT_ZERO(droppedFiles);825 826 int rc = DnDDroppedFilesInit(&droppedFiles);827 if (RT_SUCCESS(rc))828 rc = DnDDroppedFilesOpenTemp(&droppedFiles, DNDURIDROPPEDFILE_FLAGS_NONE);829 830 if (RT_FAILURE(rc))831 {832 LogRel(("DnD: Initializing dropped files directory failed with %Rrc\n", rc));833 return rc;834 }835 836 823 void *pvData = NULL; 837 824 uint64_t cbData = 0; 838 825 839 rc = vbglR3DnDHGRecvDataLoop(pCtx, &dataHdr, &pvData, &cbData);826 int rc = vbglR3DnDHGRecvDataLoop(pCtx, &dataHdr, &pvData, &cbData); 840 827 if (RT_SUCCESS(rc)) 841 828 { 829 LogRel2(("DnD: Received %RU32 bytes meta data in format '%s'\n", cbData, (char *)dataHdr.pvMetaFmt)); 830 842 831 /** 843 832 * Check if this is an URI event. If so, let VbglR3 do all the actual … … 852 841 if (DnDMIMEHasFileURLs((char *)dataHdr.pvMetaFmt, dataHdr.cbMetaFmt)) /* URI data. */ 853 842 { 854 AssertPtr(pvData); 855 Assert(cbData); 856 857 /* Use the dropped files directory as the root directory for the current transfer. */ 858 rc = DnDTransferListInitEx(&pMeta->u.URI.Transfer, DnDDroppedFilesGetDirAbs(&droppedFiles), 859 DNDTRANSFERLISTFMT_NATIVE); 843 DNDDROPPEDFILES droppedFiles; 844 RT_ZERO(droppedFiles); 845 846 rc = DnDDroppedFilesInit(&droppedFiles); 860 847 if (RT_SUCCESS(rc)) 848 rc = DnDDroppedFilesOpenTemp(&droppedFiles, DNDURIDROPPEDFILE_FLAGS_NONE); 849 850 if (RT_FAILURE(rc)) 861 851 { 862 rc = DnDTransferListAppendRootsFromBuffer(&pMeta->u.URI.Transfer, DNDTRANSFERLISTFMT_URI, (const char *)pvData, cbData, 863 DND_PATH_SEPARATOR, 0 /* fFlags */); 852 LogRel(("DnD: Initializing dropped files directory failed with %Rrc\n", rc)); 853 } 854 else 855 { 856 AssertPtr(pvData); 857 Assert(cbData); 858 859 /* Use the dropped files directory as the root directory for the current transfer. */ 860 rc = DnDTransferListInitEx(&pMeta->u.URI.Transfer, DnDDroppedFilesGetDirAbs(&droppedFiles), 861 DNDTRANSFERLISTFMT_NATIVE); 864 862 if (RT_SUCCESS(rc)) 865 863 { 866 rc = vbglR3DnDHGRecvURIData(pCtx, &dataHdr, &droppedFiles); 864 rc = DnDTransferListAppendRootsFromBuffer(&pMeta->u.URI.Transfer, DNDTRANSFERLISTFMT_URI, (const char *)pvData, cbData, 865 DND_PATH_SEPARATOR, 0 /* fFlags */); 867 866 if (RT_SUCCESS(rc)) 868 867 { 869 pMeta->enmType = VBGLR3GUESTDNDMETADATATYPE_URI_LIST; 868 rc = vbglR3DnDHGRecvURIData(pCtx, &dataHdr, &droppedFiles); 869 if (RT_SUCCESS(rc)) 870 { 871 pMeta->enmType = VBGLR3GUESTDNDMETADATATYPE_URI_LIST; 872 } 870 873 } 871 874 } … … 874 877 else /* Raw data. */ 875 878 { 879 pMeta->u.Raw.cbMeta = cbData; 880 pMeta->u.Raw.pvMeta = pvData; 881 876 882 pMeta->enmType = VBGLR3GUESTDNDMETADATATYPE_RAW; 877 883 } … … 881 887 RTMemFree(dataHdr.pvMetaFmt); 882 888 883 if (RT_SUCCESS(rc)) 884 { 885 886 } 887 else if ( RT_FAILURE(rc) 888 && rc != VERR_CANCELLED) 889 if (RT_FAILURE(rc)) 889 890 { 890 891 if (pvData) 891 892 RTMemFree(pvData); 892 893 893 int rc2 = VbglR3DnDHGSendProgress(pCtx, DND_PROGRESS_ERROR, 100 /* Percent */, rc); 894 if (RT_FAILURE(rc2)) 895 LogFlowFunc(("Unable to send progress error %Rrc to host: %Rrc\n", rc, rc2)); 894 LogRel(("DnD: Receiving meta data failed with %Rrc\n", rc)); 895 896 if (rc != VERR_CANCELLED) 897 { 898 int rc2 = VbglR3DnDHGSendProgress(pCtx, DND_PROGRESS_ERROR, 100 /* Percent */, rc); 899 if (RT_FAILURE(rc2)) 900 LogFlowFunc(("Unable to send progress error %Rrc to host: %Rrc\n", rc, rc2)); 901 } 896 902 } 897 903
Note:
See TracChangeset
for help on using the changeset viewer.