mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: FspVolumeDelete: perform MmForceSectionClosed on open files
- this removes them from the Mm Standby List
This commit is contained in:
parent
b56379b542
commit
c665812d76
@ -590,7 +590,9 @@ NTSTATUS FspFsvolDeviceCopyContextByNameList(PDEVICE_OBJECT DeviceObject,
|
||||
*PContextCount = 0;
|
||||
|
||||
ContextCount = RtlNumberGenericTableElementsAvl(&FsvolDeviceExtension->ContextByNameTable);
|
||||
Contexts = FspAlloc(sizeof(PVOID) * ContextCount);
|
||||
|
||||
/* if ContextCount == 0 allocate an empty Context list */
|
||||
Contexts = FspAlloc(sizeof(PVOID) * (0 != ContextCount ? ContextCount : 1));
|
||||
if (0 == Contexts)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
|
@ -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(
|
||||
|
@ -171,13 +171,13 @@ exit /b 0
|
||||
|
||||
:standby-memfs-x64-disk
|
||||
M:
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\winfsp-tests-x64.exe"
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\*"
|
||||
if !ERRORLEVEL! neq 0 goto fail
|
||||
exit /b 0
|
||||
|
||||
:standby-memfs-x64-net
|
||||
N:
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\winfsp-tests-x64.exe"
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\*"
|
||||
if !ERRORLEVEL! neq 0 goto fail
|
||||
exit /b 0
|
||||
|
||||
@ -206,13 +206,13 @@ exit /b 0
|
||||
|
||||
:standby-memfs-x86-disk
|
||||
O:
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\winfsp-tests-x86.exe"
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\*"
|
||||
if !ERRORLEVEL! neq 0 goto fail
|
||||
exit /b 0
|
||||
|
||||
:standby-memfs-x86-net
|
||||
P:
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\winfsp-tests-x86.exe"
|
||||
copy "%ProjRoot%\build\VStudio\build\%Configuration%\*"
|
||||
if !ERRORLEVEL! neq 0 goto fail
|
||||
exit /b 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user