Changeset 78380 in vbox for trunk/src/VBox
- Timestamp:
- May 4, 2019 1:56:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp
r78366 r78380 458 458 } 459 459 460 /** 461 * Create/open a file, directory, ++. 462 * 463 * The RDBSS library will do a table lookup on the path passed in by the user 464 * and therefore share FCBs for objects with the same path. 465 * 466 * The FCB needs to be locked exclusively upon successful return, however it 467 * seems like it's not always locked when we get here (only older RDBSS library 468 * versions?), so we have to check this before returning. 469 * 470 */ 460 471 NTSTATUS VBoxMRxCreate(IN OUT PRX_CONTEXT RxContext) 461 472 { … … 541 552 RxContext->Create.ReturnedCreateInformation = CreateAction; 542 553 554 /* 555 * Make sure we've got the FCB locked exclusivly before updating it and returning. 556 * (bird: not entirely sure if this is needed for the W10 RDBSS, but cannot hurt.) 557 */ 558 if (!RxIsFcbAcquiredExclusive(capFcb)) 559 RxAcquireExclusiveFcbResourceInMRx(capFcb); 560 561 543 562 /* Initialize the FCB if this is the first open. 544 563 Note! The RxFinishFcbInitialization call expects node types as the 2nd parameter, but is for … … 553 572 Data.LastWriteTime.QuadPart = RTTimeSpecGetNtTime(&Info.ModificationTime); 554 573 Data.ChangeTime.QuadPart = RTTimeSpecGetNtTime(&Info.ChangeTime); 555 Data.AllocationSize.QuadPart = Info.cbAllocated; 574 Data.AllocationSize.QuadPart = Info.cbAllocated; /** @todo test sparse files. CcSetFileSizes is documented to not want allocation size smaller than EOF offset. */ 556 575 Data.EndOfFile.QuadPart = Info.cbObject; 557 576 Data.FileAttributes = VBoxToNTFileAttributes(Info.Attr.fMode); … … 571 590 RxFinishFcbInitialization(capFcb, (RX_FILE_TYPE)RDBSS_NTC_STORAGE_TYPE_FILE, &InitPacket); 572 591 } 573 /*574 * See if the size has changed and update the FCB if it has.575 */576 else577 {578 /** @todo Need to check RDBSS stack for locking semantics before updating579 * anything. */580 }581 592 582 593 SrvOpen->BufferingFlags = 0; … … 600 611 pVBoxFobx->pSrvCall = RxContext->Create.pSrvCall; 601 612 pVBoxFobx->Info = Info; 613 614 /* 615 * See if the size has changed and update the FCB if it has. 616 */ 617 if ( capFcb->OpenCount > 0 618 && capFcb->Header.FileSize.QuadPart != Info.cbObject) 619 { 620 PFILE_OBJECT pFileObj = RxContext->CurrentIrpSp->FileObject; 621 Assert(pFileObj); 622 if (pFileObj) 623 vbsfNtUpdateFcbSize(pFileObj, capFcb, pVBoxFobx, Info.cbObject, capFcb->Header.FileSize.QuadPart, Info.cbAllocated); 624 } 625 626 /* 627 * Do logging. 628 */ 602 629 Log(("VBOXSF: MRxCreate: Info: BirthTime %RI64\n", RTTimeSpecGetNano(&pVBoxFobx->Info.BirthTime))); 603 630 Log(("VBOXSF: MRxCreate: Info: ChangeTime %RI64\n", RTTimeSpecGetNano(&pVBoxFobx->Info.ChangeTime))); … … 609 636 Log(("VBOXSF: MRxCreate: Info: cbObject %#RX64\n", pVBoxFobx->Info.cbObject)); 610 637 Log(("VBOXSF: MRxCreate: Info: cbAllocated %#RX64\n", pVBoxFobx->Info.cbAllocated)); 611 }612 613 if (!RxIsFcbAcquiredExclusive(capFcb))614 {615 RxAcquireExclusiveFcbResourceInMRx(capFcb);616 638 } 617 639
Note:
See TracChangeset
for help on using the changeset viewer.