Changeset 84998 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 29, 2020 4:34:22 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138893
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
r82968 r84998 780 780 && !pObj->IsComplete()) 781 781 { 782 AssertMsgFailed(("Object '%s' not complete yet\n", pObj->Get DestPathAbs().c_str()));782 AssertMsgFailed(("Object '%s' not complete yet\n", pObj->GetPath().c_str())); 783 783 rc = VERR_WRONG_ORDER; 784 784 break; … … 787 787 if (pObj->IsOpen()) /* File already opened? */ 788 788 { 789 AssertMsgFailed(("Current opened object is '%s', close this first\n", pObj->Get DestPathAbs().c_str()));789 AssertMsgFailed(("Current opened object is '%s', close this first\n", pObj->GetPath().c_str())); 790 790 rc = VERR_WRONG_ORDER; 791 791 break; … … 825 825 LogRel2(("DnD: Absolute file path for guest file on the host is now '%s'\n", pszPathAbs)); 826 826 827 /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */ 828 rc = pObj->OpenEx(pszPathAbs, DnDURIObject::View_Target, 829 RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE, 830 (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR); 827 rc = pObj->Init(DnDURIObject::Type_File, pszPathAbs); 831 828 if (RT_SUCCESS(rc)) 832 829 { 833 /* Add for having a proper rollback. */ 834 int rc2 = pCtx->mURI.getDroppedFiles().AddFile(pszPathAbs); 835 AssertRC(rc2); 830 /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */ 831 rc = pObj->Open(RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE, 832 (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR); 833 if (RT_SUCCESS(rc)) 834 { 835 /* Add for having a proper rollback. */ 836 int rc2 = pCtx->mURI.getDroppedFiles().AddFile(pszPathAbs); 837 AssertRC(rc2); 838 } 836 839 } 837 else 840 841 if (RT_FAILURE(rc)) 838 842 LogRel(("DnD: Error opening/creating guest file '%s' on host, rc=%Rrc\n", pszPathAbs, rc)); 839 843 } … … 847 851 /** @todo Unescape path before printing. */ 848 852 LogRel2(("DnD: Transferring guest file '%s' to host (%RU64 bytes, mode 0x%x)\n", 849 pObj->Get DestPathAbs().c_str(), pObj->GetSize(), pObj->GetMode()));853 pObj->GetPath().c_str(), pObj->GetSize(), pObj->GetMode())); 850 854 851 855 /** @todo Set progress object title to current file being transferred? */ … … 853 857 if (pObj->IsComplete()) /* 0-byte file? We're done already. */ 854 858 { 855 /** @todo Sanitize path. */ 856 LogRel2(("DnD: Transferring guest file '%s' (0 bytes) to host complete\n", pObj->GetDestPathAbs().c_str())); 859 LogRel2(("DnD: Transferring guest file '%s' (0 bytes) to host complete\n", pObj->GetPath().c_str())); 857 860 858 861 pCtx->mURI.processObject(*pObj); … … 902 905 if (pObj->IsComplete()) 903 906 { 904 LogFlowFunc(("Warning: Object '%s' already completed\n", pObj->Get DestPathAbs().c_str()));907 LogFlowFunc(("Warning: Object '%s' already completed\n", pObj->GetPath().c_str())); 905 908 rc = VERR_WRONG_ORDER; 906 909 break; … … 909 912 if (!pObj->IsOpen()) /* File opened on host? */ 910 913 { 911 LogFlowFunc(("Warning: Object '%s' not opened\n", pObj->Get DestPathAbs().c_str()));914 LogFlowFunc(("Warning: Object '%s' not opened\n", pObj->GetPath().c_str())); 912 915 rc = VERR_WRONG_ORDER; 913 916 break; … … 921 924 if (cbWritten < cbData) 922 925 { 923 /** @todo What to do when the host's disk is full? */ 924 rc = VERR_DISK_FULL; 926 LogRel(("DnD: Only written %RU32 of %RU32 bytes of guest file '%s' -- disk full?\n", 927 cbWritten, cbData, pObj->GetPath().c_str())); 928 rc = VERR_IO_GEN_FAILURE; /** @todo Find a better rc. */ 925 929 } 926 930 … … 929 933 } 930 934 else 931 LogRel(("DnD: Error writing guest file data for '%s', rc=%Rrc\n", pObj->Get DestPathAbs().c_str(), rc));935 LogRel(("DnD: Error writing guest file data for '%s', rc=%Rrc\n", pObj->GetPath().c_str(), rc)); 932 936 933 937 if (RT_SUCCESS(rc)) … … 936 940 { 937 941 /** @todo Sanitize path. */ 938 LogRel2(("DnD: Transferring guest file '%s' to host complete\n", pObj->Get DestPathAbs().c_str()));942 LogRel2(("DnD: Transferring guest file '%s' to host complete\n", pObj->GetPath().c_str())); 939 943 pCtx->mURI.processObject(*pObj); 940 944 objCtx.reset(); -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r82968 r84998 882 882 AssertPtr(pObj); 883 883 884 RTCString strPath = pObj->Get DestPathAbs();884 RTCString strPath = pObj->GetPath(); 885 885 if (strPath.isEmpty()) 886 886 return VERR_INVALID_PARAMETER; … … 909 909 AssertPtr(pObj); 910 910 911 RTCString strPathSrc = pObj->Get SourcePathAbs();911 RTCString strPathSrc = pObj->GetPath(); 912 912 if (strPathSrc.isEmpty()) 913 913 return VERR_INVALID_PARAMETER; … … 922 922 { 923 923 LogRel2(("DnD: Opening host file '%s' for transferring to guest\n", strPathSrc.c_str())); 924 rc = pObj->OpenEx(strPathSrc, DnDURIObject::View_Source, 925 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 924 rc = pObj->Init(DnDURIObject::Type_File, strPathSrc); 925 if (RT_SUCCESS(rc)) 926 rc = pObj->Open(RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 927 926 928 if (RT_FAILURE(rc)) 927 929 LogRel(("DnD: Opening host file '%s' failed, rc=%Rrc\n", strPathSrc.c_str(), rc)); … … 943 945 pMsg->setType(HOST_DND_HG_SND_FILE_HDR); 944 946 pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */ 945 pMsg->setNextString(pObj->Get DestPathAbs().c_str()); /* pvName */946 pMsg->setNextUInt32((uint32_t)(pObj->Get DestPathAbs().length() + 1)); /* cbName */947 pMsg->setNextUInt32(0); 948 pMsg->setNextUInt32(pObj->GetMode()); 949 pMsg->setNextUInt64(pObj->GetSize()); 947 pMsg->setNextString(pObj->GetPath().c_str()); /* pvName */ 948 pMsg->setNextUInt32((uint32_t)(pObj->GetPath().length() + 1)); /* cbName */ 949 pMsg->setNextUInt32(0); /* uFlags */ 950 pMsg->setNextUInt32(pObj->GetMode()); /* fMode */ 951 pMsg->setNextUInt64(pObj->GetSize()); /* uSize */ 950 952 951 953 LogFlowFunc(("Sending file header ...\n")); 952 LogRel2(("DnD: Transferring host file to guest: %s(%RU64 bytes, mode 0x%x)\n",953 strPathSrc.c_str(), pObj->GetSize(), pObj->GetMode()));954 LogRel2(("DnD: Transferring host file '%s' to guest (%RU64 bytes, mode 0x%x)\n", 955 pObj->GetPath().c_str(), pObj->GetSize(), pObj->GetMode())); 954 956 955 957 /** @todo Set progress object title to current file being transferred? */ … … 1007 1009 if (mDataBase.m_uProtocolVersion <= 1) 1008 1010 { 1009 pMsg->setNextString(pObj->Get DestPathAbs().c_str()); /* pvName */1010 pMsg->setNextUInt32((uint32_t)(pObj->Get DestPathAbs().length() + 1)); /* cbName */1011 pMsg->setNextString(pObj->GetPath().c_str()); /* pvName */ 1012 pMsg->setNextUInt32((uint32_t)(pObj->GetPath().length() + 1)); /* cbName */ 1011 1013 } 1012 1014 else if (mDataBase.m_uProtocolVersion >= 2) … … 1044 1046 if (pObj->IsComplete()) /* Done reading? */ 1045 1047 { 1046 LogRel2(("DnD: Transferring file '%s' to guest complete\n", pObj->Get SourcePathAbs().c_str()));1047 LogFlowFunc(("File '%s' complete\n", pObj->Get SourcePathAbs().c_str()));1048 LogRel2(("DnD: Transferring file '%s' to guest complete\n", pObj->GetPath().c_str())); 1049 LogFlowFunc(("File '%s' complete\n", pObj->GetPath().c_str())); 1048 1050 1049 1051 /* DnDURIObject::Read() returns VINF_EOF when finished reading the entire fire, … … 1054 1056 1055 1057 if (RT_FAILURE(rc)) 1056 LogRel(("DnD: Reading from host file '%s' failed, rc=%Rrc\n", pObj->Get SourcePathAbs().c_str(), rc));1058 LogRel(("DnD: Reading from host file '%s' failed, rc=%Rrc\n", pObj->GetPath().c_str(), rc)); 1057 1059 1058 1060 LogFlowFuncLeaveRC(rc); … … 1449 1451 AssertPtr(pCurObj); 1450 1452 1451 DnDURIObject::Type enmType = pCurObj->GetType(); 1453 const DnDURIObject::Type enmType = pCurObj->GetType(); 1454 1452 1455 LogRel3(("DnD: Processing: srcPath=%s, dstPath=%s, enmType=%RU32, cbSize=%RU32\n", 1453 pCurObj->Get SourcePathAbs().c_str(), pCurObj->GetDestPathAbs().c_str(),1456 pCurObj->GetPath().c_str(), pCurObj->GetPath().c_str(), 1454 1457 enmType, pCurObj->GetSize())); 1455 1458 … … 1465 1468 { 1466 1469 AssertMsgFailed(("enmType=%RU32 is not supported for srcPath=%s, dstPath=%s\n", 1467 enmType, pCurObj->Get SourcePathAbs().c_str(), pCurObj->GetDestPathAbs().c_str()));1470 enmType, pCurObj->GetPath().c_str(), pCurObj->GetPath().c_str())); 1468 1471 rc = VERR_NOT_SUPPORTED; 1469 1472 } … … 1478 1481 if (fRemove) 1479 1482 { 1480 LogFlowFunc(("Removing \"%s\" from list, rc=%Rrc\n", pCurObj->Get SourcePathAbs().c_str(), rc));1483 LogFlowFunc(("Removing \"%s\" from list, rc=%Rrc\n", pCurObj->GetPath().c_str(), rc)); 1481 1484 pCtx->mURI.removeObjCurrent(); 1482 1485 }
Note:
See TracChangeset
for help on using the changeset viewer.