Changeset 85004 in vbox for trunk/src/VBox/GuestHost/DragAndDrop
- Timestamp:
- Jun 30, 2020 10:38:52 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r85002 r85004 51 51 LogFlowThisFuncEnter(); 52 52 53 switch (m_enmType) 54 { 55 case Type_File: 56 { 57 RTFileClose(u.File.hFile); 58 u.File.hFile = NIL_RTFILE; 59 RT_ZERO(u.File.objInfo); 60 break; 61 } 62 63 case Type_Directory: 64 { 65 RTDirClose(u.Dir.hDir); 66 u.Dir.hDir = NIL_RTDIR; 67 RT_ZERO(u.Dir.objInfo); 68 break; 69 } 70 71 default: 72 break; 73 } 53 int rc; 54 55 switch (m_enmType) 56 { 57 case Type_File: 58 { 59 LogRel2(("DnD: Closing file '%s'\n", m_strPathAbs.c_str())); 60 61 rc = RTFileClose(u.File.hFile); 62 if (RT_SUCCESS(rc)) 63 { 64 u.File.hFile = NIL_RTFILE; 65 RT_ZERO(u.File.objInfo); 66 } 67 else 68 LogRel(("DnD: Closing file '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 69 break; 70 } 71 72 case Type_Directory: 73 { 74 LogRel2(("DnD: Closing directory '%s'\n", m_strPathAbs.c_str())); 75 76 rc = RTDirClose(u.Dir.hDir); 77 if (RT_SUCCESS(rc)) 78 { 79 u.Dir.hDir = NIL_RTDIR; 80 RT_ZERO(u.Dir.objInfo); 81 } 82 else 83 LogRel(("DnD: Closing directory '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 84 break; 85 } 86 87 default: 88 break; 89 } 90 91 /** @todo Return rc. */ 74 92 } 75 93 … … 176 194 m_strPathAbs = strPathAbs; 177 195 } 196 else 197 LogRel2(("DnD: Absolute file path for guest file on the host is now '%s'\n", m_strPathAbs.c_str())); 178 198 } 179 199 else … … 253 273 case Type_File: 254 274 { 275 LogRel2(("DnD: Opening file '%s'\n", m_strPathAbs.c_str())); 276 255 277 /* 256 278 * Open files on the source with RTFILE_O_DENY_WRITE to prevent races … … 265 287 { 266 288 rc = RTFileSetMode(u.File.hFile, fMode); 289 if (RT_FAILURE(rc)) 290 LogRel(("DnD: Setting mode %#x for file '%s' failed with %Rrc\n", fMode, m_strPathAbs.c_str(), rc)); 267 291 } 268 292 else if (fOpen & RTFILE_O_READ) … … 271 295 } 272 296 } 297 else 298 LogRel(("DnD: Opening file '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 273 299 274 300 if (RT_SUCCESS(rc)) … … 285 311 case Type_Directory: 286 312 { 313 LogRel2(("DnD: Opening directory '%s'\n", m_strPathAbs.c_str())); 314 287 315 rc = RTDirOpen(&u.Dir.hDir, m_strPathAbs.c_str()); 288 316 if (RT_SUCCESS(rc)) 317 { 289 318 rc = queryInfoInternal(); 319 } 320 else 321 LogRel(("DnD: Opening directory '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 290 322 break; 291 323 } … … 326 358 break; 327 359 } 360 361 if (RT_FAILURE(rc)) 362 LogRel(("DnD: Querying information for '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 328 363 329 364 return rc; … … 440 475 } 441 476 } 477 else 478 LogRel(("DnD: Reading from file '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 442 479 break; 443 480 } … … 520 557 rc = RTFileWrite(u.File.hFile, pvBuf, cbBuf, &cbWritten); 521 558 if (RT_SUCCESS(rc)) 559 { 522 560 u.File.cbProcessed += cbWritten; 561 } 562 else 563 LogRel(("DnD: Writing to file '%s' failed with %Rrc\n", m_strPathAbs.c_str(), rc)); 523 564 break; 524 565 }
Note:
See TracChangeset
for help on using the changeset viewer.