Changeset 84148 in vbox
- Timestamp:
- May 5, 2020 3:54:35 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r84147 r84148 98 98 if (RT_SUCCESS(rc)) 99 99 { 100 RTStrFree(pFile->pszName); 101 100 102 /* Remove file entry in any case. */ 101 103 RTListNodeRemove(&pFile->Node); … … 312 314 if (szFile[0]) 313 315 { 314 RTStrCopy(pFile->szName, sizeof(pFile->szName), szFile); 315 316 pFile->pszName = RTStrDup(szFile); 317 if (!pFile->pszName) 318 rc = VERR_NO_MEMORY; 316 319 /** @todo 317 320 * Implement szSharing! 318 321 */ 319 322 uint64_t fFlags; 320 rc = RTFileModeToFlagsEx(szAccess, szDisposition, NULL /* pszSharing, not used yet */, &fFlags); 321 VGSvcVerbose(4, "[File %s] Opening with fFlags=%#RX64 -> rc=%Rrc\n", pFile->szName, fFlags, rc); 323 if (RT_SUCCESS(rc)) 324 { 325 rc = RTFileModeToFlagsEx(szAccess, szDisposition, NULL /* pszSharing, not used yet */, &fFlags); 326 VGSvcVerbose(4, "[File %s] Opening with fFlags=%#RX64 -> rc=%Rrc\n", pFile->pszName, fFlags, rc); 327 } 328 322 329 if (RT_SUCCESS(rc)) 323 330 { … … 327 334 if (fFlags & RTFILE_O_READ) 328 335 fFlags &= ~RTFILE_O_TRUNCATE; 329 rc = RTFileOpen(&pFile->hFile, pFile-> szName, fFlags);336 rc = RTFileOpen(&pFile->hFile, pFile->pszName, fFlags); 330 337 if (RT_SUCCESS(rc)) 331 338 { … … 352 359 pFile->fOpen = fFlags; 353 360 RTListAppend(&pSession->lstFiles, &pFile->Node); 354 VGSvcVerbose(2, "[File %s] Opened (ID=%RU32)\n", pFile-> szName, pFile->uHandle);361 VGSvcVerbose(2, "[File %s] Opened (ID=%RU32)\n", pFile->pszName, pFile->uHandle); 355 362 } 356 363 else 357 VGSvcError("[File %s] Seeking to offset %RU64 failed: rc=%Rrc\n", pFile-> szName, offOpen, rc);364 VGSvcError("[File %s] Seeking to offset %RU64 failed: rc=%Rrc\n", pFile->pszName, offOpen, rc); 358 365 } 359 366 else 360 367 { 361 VGSvcError("[File %s] Unsupported mode %#x\n", pFile-> szName, objInfo.Attr.fMode);368 VGSvcError("[File %s] Unsupported mode %#x\n", pFile->pszName, objInfo.Attr.fMode); 362 369 rc = VERR_NOT_SUPPORTED; 363 370 } 364 371 } 365 372 else 366 VGSvcError("[File %s] Getting mode failed with rc=%Rrc\n", pFile-> szName, rc);373 VGSvcError("[File %s] Getting mode failed with rc=%Rrc\n", pFile->pszName, rc); 367 374 } 368 375 else 369 VGSvcError("[File %s] Opening failed with rc=%Rrc\n", pFile-> szName, rc);376 VGSvcError("[File %s] Opening failed with rc=%Rrc\n", pFile->pszName, rc); 370 377 } 371 378 } … … 379 386 if (RT_FAILURE(rc)) 380 387 { 388 RTStrFree(pFile->pszName); 381 389 if (pFile->hFile != NIL_RTFILE) 382 390 RTFileClose(pFile->hFile); … … 425 433 if (pFile) 426 434 { 427 VGSvcVerbose(2, "[File %s] Closing (handle=%RU32)\n", pFile ? pFile-> szName : "<Not found>", uHandle);435 VGSvcVerbose(2, "[File %s] Closing (handle=%RU32)\n", pFile ? pFile->pszName : "<Not found>", uHandle); 428 436 rc = vgsvcGstCtrlSessionFileFree(pFile); 429 437 } … … 484 492 rc = RTFileRead(pFile->hFile, *ppvScratchBuf, RT_MIN(cbToRead, *pcbScratchBuf), &cbRead); 485 493 offNew = (int64_t)RTFileTell(pFile->hFile); 486 VGSvcVerbose(5, "[File %s] Read %zu/%RU32 bytes, rc=%Rrc, offNew=%RI64\n", pFile-> szName, cbRead, cbToRead, rc, offNew);494 VGSvcVerbose(5, "[File %s] Read %zu/%RU32 bytes, rc=%Rrc, offNew=%RI64\n", pFile->pszName, cbRead, cbToRead, rc, offNew); 487 495 } 488 496 else … … 553 561 else 554 562 offNew = (int64_t)RTFileTell(pFile->hFile); 555 VGSvcVerbose(5, "[File %s] Read %zu bytes @ %RU64, rc=%Rrc, offNew=%RI64\n", pFile-> szName, cbRead, offReadAt, rc, offNew);563 VGSvcVerbose(5, "[File %s] Read %zu bytes @ %RU64, rc=%Rrc, offNew=%RI64\n", pFile->pszName, cbRead, offReadAt, rc, offNew); 556 564 } 557 565 else … … 613 621 offNew = (int64_t)RTFileTell(pFile->hFile); 614 622 VGSvcVerbose(5, "[File %s] Writing %p LB %RU32 => %Rrc, cbWritten=%zu, offNew=%RI64\n", 615 pFile-> szName, *ppvScratchBuf, RT_MIN(cbToWrite, *pcbScratchBuf), rc, cbWritten, offNew);623 pFile->pszName, *ppvScratchBuf, RT_MIN(cbToWrite, *pcbScratchBuf), rc, cbWritten, offNew); 616 624 } 617 625 else … … 685 693 offNew = (int64_t)RTFileTell(pFile->hFile); 686 694 VGSvcVerbose(5, "[File %s] Writing %p LB %RU32 @ %RU64 => %Rrc, cbWritten=%zu, offNew=%RI64\n", 687 pFile-> szName, *ppvScratchBuf, RT_MIN(cbToWrite, *pcbScratchBuf), offWriteAt, rc, cbWritten, offNew);695 pFile->pszName, *ppvScratchBuf, RT_MIN(cbToWrite, *pcbScratchBuf), offWriteAt, rc, cbWritten, offNew); 688 696 } 689 697 else … … 752 760 rc = RTFileSeek(pFile->hFile, (int64_t)offSeek, s_abMethods[uSeekMethod], &offActual); 753 761 VGSvcVerbose(5, "[File %s]: Seeking to offSeek=%RI64, uSeekMethodIPRT=%u, rc=%Rrc\n", 754 pFile-> szName, offSeek, s_abMethods[uSeekMethod], rc);762 pFile->pszName, offSeek, s_abMethods[uSeekMethod], rc); 755 763 } 756 764 else … … 806 814 { 807 815 offCurrent = RTFileTell(pFile->hFile); 808 VGSvcVerbose(5, "[File %s]: Telling offCurrent=%RU64\n", pFile-> szName, offCurrent);816 VGSvcVerbose(5, "[File %s]: Telling offCurrent=%RU64\n", pFile->pszName, offCurrent); 809 817 } 810 818 else … … 854 862 { 855 863 rc = RTFileSetSize(pFile->hFile, cbNew); 856 VGSvcVerbose(5, "[File %s]: Changing size to %RU64 (%#RX64), rc=%Rrc\n", pFile-> szName, cbNew, cbNew, rc);864 VGSvcVerbose(5, "[File %s]: Changing size to %RU64 (%#RX64), rc=%Rrc\n", pFile->pszName, cbNew, cbNew, rc); 857 865 } 858 866 else … … 2045 2053 if (RT_FAILURE(rc2)) 2046 2054 { 2047 VGSvcError("Unable to close file '%s'; rc=%Rrc\n", pFile-> szName, rc2);2055 VGSvcError("Unable to close file '%s'; rc=%Rrc\n", pFile->pszName, rc2); 2048 2056 if (RT_SUCCESS(rc)) 2049 2057 rc = rc2;
Note:
See TracChangeset
for help on using the changeset viewer.

