- Timestamp:
- Jun 29, 2020 4:34:22 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/GuestHost/DragAndDrop.h (modified) (6 diffs)
-
src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp (modified) (4 diffs)
-
src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp (modified) (4 diffs)
-
src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp (modified) (16 diffs)
-
src/VBox/Main/src-client/GuestDnDSourceImpl.cpp (modified) (10 diffs)
-
src/VBox/Main/src-client/GuestDnDTargetImpl.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/DragAndDrop.h
r84983 r84998 130 130 }; 131 131 132 /**133 * Enumeration for specifying an URI object view134 * for representing its data accordingly.135 */136 enum View137 {138 /** Unknown view, do not use. */139 View_Unknown = 0,140 /** Handle data from the source point of view. */141 View_Source,142 /** Handle data from the destination point of view. */143 View_Target,144 /** The usual 32-bit hack. */145 View_Dest_32Bit_Hack = 0x7fffffff146 };147 148 132 #ifdef RT_NEED_NEW_AND_DELETE 149 133 RTMEM_IMPLEMENT_NEW_AND_DELETE(); 150 134 #endif 151 DnDURIObject(void); 152 DnDURIObject(Type type, 153 const RTCString &strSrcPathAbs = "", 154 const RTCString &strDstPathAbs = ""); 135 DnDURIObject(Type enmType = Type_Unknown, const RTCString &strPathAbs = ""); 136 155 137 virtual ~DnDURIObject(void); 156 138 … … 162 144 * @return Absolute source path of the object. 163 145 */ 164 const RTCString &GetSourcePathAbs(void) const { return m_strSrcPathAbs; } 165 166 /** 167 * Returns the given, absolute destination path of the object. 168 * 169 * @return Absolute destination path of the object. 170 */ 171 const RTCString &GetDestPathAbs(void) const { return m_strTgtPathAbs; } 146 const RTCString &GetPath(void) const { return m_strPathAbs; } 172 147 173 148 RTFMODE GetMode(void) const; … … 184 159 Type GetType(void) const { return m_enmType; } 185 160 186 /** 187 * Returns the object's view. 188 * 189 * @return The object's view. 190 */ 191 View GetView(void) const { return m_enmView; } 192 193 public: 161 public: 162 163 int Init(Type enmType, const RTCString &strPathAbs = ""); 194 164 195 165 int SetSize(uint64_t cbSize); … … 200 170 bool IsComplete(void) const; 201 171 bool IsOpen(void) const; 202 int Open(View enmView, uint64_t fOpen, RTFMODE fMode = 0); 203 int OpenEx(const RTCString &strPath, View enmView, uint64_t fOpen = 0, RTFMODE fMode = 0, DNDURIOBJECTFLAGS = DNDURIOBJECT_FLAGS_NONE); 204 int QueryInfo(View enmView); 172 int Open(uint64_t fOpen, RTFMODE fMode = 0, DNDURIOBJECTFLAGS = DNDURIOBJECT_FLAGS_NONE); 173 int QueryInfo(void); 205 174 int Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead); 206 175 void Reset(void); … … 214 183 215 184 void closeInternal(void); 216 int queryInfoInternal( View enmView);185 int queryInfoInternal(void); 217 186 218 187 protected: … … 220 189 /** The object's type. */ 221 190 Type m_enmType; 222 /** The object's view. */ 223 View m_enmView; 224 /** Absolute path (base) for the source. */ 225 RTCString m_strSrcPathAbs; 226 /** Absolute path (base) for the target. */ 227 RTCString m_strTgtPathAbs; 191 /** Absolute path of the object. */ 192 RTCString m_strPathAbs; 228 193 229 194 /** Union containing data depending on the object's type. */ -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r84985 r84998 397 397 * Enter the main loop of retieving files + directories. 398 398 */ 399 DnDURIObject objFile (DnDURIObject::Type_File);399 DnDURIObject objFile; 400 400 401 401 char szPathName[RTPATH_MAX] = { 0 }; … … 497 497 uint32_t fCreationMode = (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR; 498 498 #endif 499 rc = objFile. OpenEx(strPathAbs, DnDURIObject::View_Target, fOpen, fCreationMode);499 rc = objFile.Init(DnDURIObject::Type_File, strPathAbs); 500 500 if (RT_SUCCESS(rc)) 501 501 { 502 rc = pDroppedFiles->AddFile(strPathAbs.c_str());502 rc = objFile.Open(fOpen, fCreationMode); 503 503 if (RT_SUCCESS(rc)) 504 504 { 505 cbFileWritten = 0; 506 objFile.SetSize(cbFileSize); 505 rc = pDroppedFiles->AddFile(strPathAbs.c_str()); 506 if (RT_SUCCESS(rc)) 507 { 508 cbFileWritten = 0; 509 objFile.SetSize(cbFileSize); 510 } 507 511 } 508 512 } … … 1534 1538 AssertReturn(pObj->GetType() == DnDURIObject::Type_Directory, VERR_INVALID_PARAMETER); 1535 1539 1536 RTCString strPath = pObj->Get DestPathAbs();1540 RTCString strPath = pObj->GetPath(); 1537 1541 LogFlowFunc(("strDir=%s (%zu), fMode=0x%x\n", 1538 1542 strPath.c_str(), strPath.length(), pObj->GetMode())); … … 1574 1578 return VERR_NO_MEMORY; 1575 1579 1576 RTCString strPath = pObj->Get DestPathAbs();1580 RTCString strPath = pObj->GetPath(); 1577 1581 1578 1582 LogFlowFunc(("strFile=%s (%zu), cbSize=%RU64, fMode=0x%x\n", strPath.c_str(), strPath.length(), -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r82968 r84998 62 62 pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode)); 63 63 64 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::Type_File, pcszSource , pcszTarget);64 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::Type_File, pcszSource); 65 65 if (pObjFile) 66 66 { 67 67 /** @todo Add a standard fOpen mode for this list. */ 68 rc = pObjFile->Open( DnDURIObject::View_Source,RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);68 rc = pObjFile->Open(RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 69 69 if (RT_SUCCESS(rc)) 70 70 { … … 77 77 pObjFile->Close(); 78 78 } 79 else 79 80 if (RT_FAILURE(rc)) 80 81 delete pObjFile; 81 82 } … … 87 88 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode)); 88 89 89 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Type_Directory, pcszSource , pcszTarget);90 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Type_Directory, pcszSource); 90 91 if (pObjDir) 91 92 { … … 384 385 : pszFileName - pszSrcPath; 385 386 char *pszDstPath = &pszSrcPath[cchDstBase]; 386 m_lstRoot.append(pszDstPath); 387 388 LogFlowFunc(("pszSrcPath=%s, pszFileName=%s, pszRoot=%s\n", 389 pszSrcPath, pszFileName, pszDstPath)); 390 391 rc = appendPathRecursive(pszSrcPath, pszSrcPath, pszSrcPath, cchDstBase, fFlags); 387 rc = DnDPathSanitize(pszDstPath, strlen(pszDstPath)); 388 if (RT_SUCCESS(rc)) 389 { 390 m_lstRoot.append(pszDstPath); 391 392 LogFlowFunc(("pszSrcPath=%s, pszFileName=%s, pszDstPath=%s\n", 393 pszSrcPath, pszFileName, pszDstPath)); 394 395 rc = appendPathRecursive(pszSrcPath, pszSrcPath, pszSrcPath, cchDstBase, fFlags); 396 } 392 397 } 393 398 else -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r82968 r84998 33 33 34 34 35 DnDURIObject::DnDURIObject(void) 36 : m_enmType(Type_Unknown) 37 , m_enmView(View_Unknown) 38 { 39 RT_ZERO(u); 40 } 41 42 DnDURIObject::DnDURIObject(Type enmType, 43 const RTCString &strSrcPathAbs /* = 0 */, 44 const RTCString &strDstPathAbs /* = 0 */) 45 : m_enmType(enmType) 46 , m_enmView(View_Unknown) 47 , m_strSrcPathAbs(strSrcPathAbs) 48 , m_strTgtPathAbs(strDstPathAbs) 49 { 50 RT_ZERO(u); 51 52 switch (m_enmType) 53 { 54 case Type_File: 55 { 56 u.File.hFile = NIL_RTFILE; 57 break; 58 } 59 60 case Type_Directory: 61 { 62 u.Dir.hDir = NIL_RTDIR; 63 break; 64 } 65 66 default: 67 break; 68 } 35 DnDURIObject::DnDURIObject(Type enmType = /* Type_Unknown */, const RTCString &strPathAbs /* = "" */) 36 { 37 int rc2 = Init(enmType, strPathAbs); 38 AssertRC(rc2); 69 39 } 70 40 … … 76 46 /** 77 47 * Closes the object's internal handles (to files / ...). 78 *79 48 */ 80 49 void DnDURIObject::closeInternal(void) … … 168 137 169 138 /** 139 * Initializes the object with an expected object type and file path. 140 * 141 * @returns VBox status code. 142 * @param enmType Type we expect this object to be. 143 * @param strPathAbs Absolute path of file this object represents. Optional. 144 */ 145 int DnDURIObject::Init(Type enmType, const RTCString &strPathAbs /* = */) 146 { 147 AssertReturn(enmType == Type_Unknown, VERR_WRONG_ORDER); 148 149 int rc; 150 151 switch (m_enmType) 152 { 153 case Type_File: 154 { 155 u.File.hFile = NIL_RTFILE; 156 break; 157 } 158 159 case Type_Directory: 160 { 161 u.Dir.hDir = NIL_RTDIR; 162 break; 163 } 164 165 default: 166 break; 167 } 168 169 if (enmType != Type_Unknown) 170 { 171 AssertReturn(m_strPathAbs.isNotEmpty(), VERR_INVALID_PARAMETER); 172 rc = DnDPathSanitize(m_strPathAbs.mutableRaw(), m_strPathAbs.capacity()); 173 if (RT_SUCCESS(rc)) 174 { 175 m_enmType = enmType; 176 m_strPathAbs = strPathAbs; 177 } 178 } 179 else 180 rc = VERR_INVALID_PARAMETER; 181 182 return rc; 183 } 184 185 /** 170 186 * Returns whether the processing of the object is complete or not. 171 187 * For file objects this means that all bytes have been processed. … … 212 228 213 229 /** 214 * (Re-)Opens the object with a specific view, open and file mode.230 * Open the object with a specific file type, and, depending on the type, specifying additional parameters. 215 231 * 216 232 * @return IPRT status code. 217 * @param enmView View to use for opening the object.218 * @param fOpen File open flags to use.219 * @param fMode File mode to use.220 */221 int DnDURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */)222 {223 return OpenEx( enmView == View_Source224 ? m_strSrcPathAbs : m_strTgtPathAbs225 , enmView, fOpen, fMode, DNDURIOBJECT_FLAGS_NONE);226 }227 228 /**229 * Open the object with a specific file type, and, depending on the type, specifying additional parameters.230 *231 * @return IPRT status code.232 * @param strPathAbs Absolute path of the object (file / directory / ...).233 * @param enmView View of the object.234 233 * @param fOpen Open mode to use; only valid for file objects. 235 * @param fMode File mode to use; only valid for file objects.234 * @param fMode File mode to set; only valid for file objects. Depends on fOpen and and can be 0. 236 235 * @param fFlags Additional DnD URI object flags. 237 236 */ 238 int DnDURIObject::OpenEx(const RTCString &strPathAbs, View enmView, 239 uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */, DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */) 240 { 237 int DnDURIObject::Open(uint64_t fOpen, RTFMODE fMode /* = 0 */, 238 DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */) 239 { 240 AssertReturn(fOpen, VERR_INVALID_FLAGS); 241 /* fMode is optional. */ 241 242 AssertReturn(!(fFlags & ~DNDURIOBJECT_FLAGS_VALID_MASK), VERR_INVALID_FLAGS); 242 243 RT_NOREF1(fFlags); … … 244 245 int rc = VINF_SUCCESS; 245 246 246 switch (enmView) 247 { 248 case View_Source: 249 m_strSrcPathAbs = strPathAbs; 250 break; 251 252 case View_Target: 253 m_strTgtPathAbs = strPathAbs; 254 break; 255 256 default: 257 rc = VERR_NOT_IMPLEMENTED; 258 break; 259 } 260 261 if ( RT_SUCCESS(rc) 262 && fOpen) /* Opening mode specified? */ 263 { 264 LogFlowThisFunc(("strPath=%s, enmView=%RU32, fOpen=0x%x, fMode=0x%x, fFlags=0x%x\n", 265 strPathAbs.c_str(), enmView, fOpen, fMode, fFlags)); 247 if (fOpen) /* Opening mode specified? */ 248 { 249 LogFlowThisFunc(("strPath=%s, fOpen=0x%x, fMode=0x%x, fFlags=0x%x\n", 250 m_strPathAbs.c_str(), fOpen, fMode, fFlags)); 266 251 switch (m_enmType) 267 252 { … … 273 258 * it over. 274 259 */ 275 LogFlowThisFunc(("Opening ...\n")); 276 rc = RTFileOpen(&u.File.hFile, strPathAbs.c_str(), fOpen); 260 rc = RTFileOpen(&u.File.hFile, m_strPathAbs.c_str(), fOpen); 277 261 if (RT_SUCCESS(rc)) 278 262 { … … 284 268 else if (fOpen & RTFILE_O_READ) 285 269 { 286 rc = queryInfoInternal( enmView);270 rc = queryInfoInternal(); 287 271 } 288 272 } … … 301 285 case Type_Directory: 302 286 { 303 rc = RTDirOpen(&u.Dir.hDir, strPathAbs.c_str());287 rc = RTDirOpen(&u.Dir.hDir, m_strPathAbs.c_str()); 304 288 if (RT_SUCCESS(rc)) 305 rc = queryInfoInternal( enmView);289 rc = queryInfoInternal(); 306 290 break; 307 291 } … … 313 297 } 314 298 315 if (RT_SUCCESS(rc))316 {317 m_enmView = enmView;318 }319 320 299 LogFlowFuncLeaveRC(rc); 321 300 return rc; … … 326 305 * 327 306 * @return IPRT status code. 328 * @param enmView View to use for querying information. Currently ignored. 329 */ 330 int DnDURIObject::queryInfoInternal(View enmView) 331 { 332 RT_NOREF(enmView); 333 307 */ 308 int DnDURIObject::queryInfoInternal(void) 309 { 334 310 int rc; 335 311 … … 358 334 * 359 335 * @return IPRT status code. 360 * @param enmView View to use for querying information. 361 */ 362 int DnDURIObject::QueryInfo(View enmView) 363 { 364 return queryInfoInternal(enmView); 336 */ 337 int DnDURIObject::QueryInfo(void) 338 { 339 return queryInfoInternal(); 365 340 } 366 341 … … 445 420 /* pcbRead is optional. */ 446 421 447 AssertMsgReturn(m_enmView == View_Source, ("Cannot write to an object which is not in target view\n"),448 VERR_INVALID_STATE);449 450 422 size_t cbRead = 0; 451 423 … … 488 460 } 489 461 490 LogFlowFunc(("Returning strSourcePath=%s, cbRead=%zu, rc=%Rrc\n", m_str SrcPathAbs.c_str(), cbRead, rc));462 LogFlowFunc(("Returning strSourcePath=%s, cbRead=%zu, rc=%Rrc\n", m_strPathAbs.c_str(), cbRead, rc)); 491 463 return rc; 492 464 } … … 501 473 Close(); 502 474 503 m_enmType = Type_Unknown; 504 m_enmView = View_Unknown; 505 m_strSrcPathAbs = ""; 506 m_strTgtPathAbs = ""; 475 m_enmType = Type_Unknown; 476 m_strPathAbs = ""; 507 477 508 478 RT_ZERO(u); … … 541 511 /* pcbWritten is optional. */ 542 512 543 AssertMsgReturn(m_enmView == View_Target, ("Cannot write to an object which is not in target view\n"),544 VERR_INVALID_STATE);545 546 513 size_t cbWritten = 0; 547 514 … … 574 541 } 575 542 576 LogFlowThisFunc(("Returning strSourcePathAbs=%s, cbWritten=%zu, rc=%Rrc\n", m_str SrcPathAbs.c_str(), cbWritten, rc));543 LogFlowThisFunc(("Returning strSourcePathAbs=%s, cbWritten=%zu, rc=%Rrc\n", m_strPathAbs.c_str(), cbWritten, rc)); 577 544 return rc; 578 545 } -
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); /* uFlags */948 pMsg->setNextUInt32(pObj->GetMode()); /* fMode */949 pMsg->setNextUInt64(pObj->GetSize()); /* uSize */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.

