mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: FspIopCompleteCanceledIrp: wrap IRP completion in FsRtlEnterFileSystem/FsRtlExitFileSystem
This commit is contained in:
parent
8ef10e5992
commit
bde93d020b
@ -219,12 +219,21 @@ VOID FspIopCompleteCanceledIrp(PIRP Irp)
|
|||||||
|
|
||||||
DEBUGLOGIRP(Irp, STATUS_CANCELLED);
|
DEBUGLOGIRP(Irp, STATUS_CANCELLED);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An IRP cancel may happen at any time including when APC's are still enabled.
|
||||||
|
* For this reason we execute FsRtlEnterFileSystem/FsRtlExitFileSystem here.
|
||||||
|
* This will protect ERESOURCE operations during Request finalizations.
|
||||||
|
*/
|
||||||
|
FsRtlEnterFileSystem();
|
||||||
|
|
||||||
PIRP TopLevelIrp = IoGetTopLevelIrp();
|
PIRP TopLevelIrp = IoGetTopLevelIrp();
|
||||||
IoSetTopLevelIrp(Irp);
|
IoSetTopLevelIrp(Irp);
|
||||||
|
|
||||||
FspIopCompleteIrpEx(Irp, STATUS_CANCELLED, TRUE);
|
FspIopCompleteIrpEx(Irp, STATUS_CANCELLED, TRUE);
|
||||||
|
|
||||||
IoSetTopLevelIrp(TopLevelIrp);
|
IoSetTopLevelIrp(TopLevelIrp);
|
||||||
|
|
||||||
|
FsRtlExitFileSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FspIopRetryPrepareIrp(PIRP Irp, NTSTATUS *PResult)
|
BOOLEAN FspIopRetryPrepareIrp(PIRP Irp, NTSTATUS *PResult)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user