mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-03 09:22:57 -05:00
sys: FspVolumeDelete: perform MmForceSectionClosed on open files
- this removes them from the Mm Standby List
This commit is contained in:
@ -282,9 +282,30 @@ VOID FspVolumeDelete(
|
||||
{
|
||||
// !PAGED_CODE();
|
||||
|
||||
PDEVICE_OBJECT FsvolDeviceObject = IrpSp->FileObject->FsContext2;
|
||||
FSP_FILE_NODE **FileNodes;
|
||||
ULONG FileNodeCount, Index;
|
||||
NTSTATUS Result;
|
||||
|
||||
FspDeviceReference(FsvolDeviceObject);
|
||||
|
||||
FspDeviceGlobalLock();
|
||||
FspVolumeDeleteNoLock(FsctlDeviceObject, Irp, IrpSp);
|
||||
FspDeviceGlobalUnlock();
|
||||
|
||||
/*
|
||||
* Call MmForceSectionClosed on open files to ensure that Mm removes them from Standby List.
|
||||
*/
|
||||
Result = FspFileNodeCopyList(FsvolDeviceObject, &FileNodes, &FileNodeCount);
|
||||
if (NT_SUCCESS(Result))
|
||||
{
|
||||
for (Index = FileNodeCount - 1; FileNodeCount > Index; Index--)
|
||||
MmForceSectionClosed(&FileNodes[Index]->NonPaged->SectionObjectPointers, TRUE);
|
||||
|
||||
FspFileNodeDeleteList(FileNodes, FileNodeCount);
|
||||
}
|
||||
|
||||
FspDeviceDereference(FsvolDeviceObject);
|
||||
}
|
||||
|
||||
static VOID FspVolumeDeleteNoLock(
|
||||
|
Reference in New Issue
Block a user