diff --git a/src/sys/driver.h b/src/sys/driver.h index 3eebb40d..fd0873d6 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -514,11 +514,13 @@ NTSTATUS FspNotifyFullReportChange( ULONG FilterMatch, ULONG Action, PVOID TargetContext); -NTSTATUS FspOplockFsctrlF( +NTSTATUS FspOplockBreakH( POPLOCK Oplock, PIRP Irp, - ULONG OpenCount, - BOOLEAN Create); + ULONG Flags, + PVOID Context, + POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, + POPLOCK_FS_PREPOST_IRP PostIrpRoutine); NTSTATUS FspCheckOplock( POPLOCK Oplock, PIRP Irp, @@ -532,6 +534,11 @@ NTSTATUS FspCheckOplockEx( PVOID Context, POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, POPLOCK_FS_PREPOST_IRP PostIrpRoutine); +NTSTATUS FspOplockFsctrlF( + POPLOCK Oplock, + PIRP Irp, + ULONG OpenCount, + BOOLEAN Create); #define FspNotifyUninitializeSync(NS)\ FsRtlNotifyUninitializeSync(NS) #define FspNotifyCleanupAll(NS, NL)\ diff --git a/src/sys/util.c b/src/sys/util.c index 20ef03f5..9b474002 100644 --- a/src/sys/util.c +++ b/src/sys/util.c @@ -67,6 +67,13 @@ NTSTATUS FspNotifyFullReportChange( ULONG FilterMatch, ULONG Action, PVOID TargetContext); +NTSTATUS FspOplockBreakH( + POPLOCK Oplock, + PIRP Irp, + ULONG Flags, + PVOID Context, + POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, + POPLOCK_FS_PREPOST_IRP PostIrpRoutine); NTSTATUS FspCheckOplock( POPLOCK Oplock, PIRP Irp, @@ -122,6 +129,7 @@ NTSTATUS FspIrpHookNext(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); #pragma alloc_text(PAGE, FspNotifyInitializeSync) #pragma alloc_text(PAGE, FspNotifyFullChangeDirectory) #pragma alloc_text(PAGE, FspNotifyFullReportChange) +#pragma alloc_text(PAGE, FspOplockBreakH) #pragma alloc_text(PAGE, FspCheckOplock) #pragma alloc_text(PAGE, FspCheckOplockEx) #pragma alloc_text(PAGE, FspOplockFsctrlF) @@ -661,6 +669,36 @@ NTSTATUS FspNotifyFullReportChange( return Result; } +NTSTATUS FspOplockBreakH( + POPLOCK Oplock, + PIRP Irp, + ULONG Flags, + PVOID Context, + POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, + POPLOCK_FS_PREPOST_IRP PostIrpRoutine) +{ + PAGED_CODE(); + + NTSTATUS Result; + + try + { + Result = FspOplockBreakH( + Oplock, + Irp, + Flags, + Context, + CompletionRoutine, + PostIrpRoutine); + } + except (EXCEPTION_EXECUTE_HANDLER) + { + Result = GetExceptionCode(); + } + + return Result; +} + NTSTATUS FspCheckOplock( POPLOCK Oplock, PIRP Irp,