mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
sys: oplocks: WIP
This commit is contained in:
parent
8395b22ddc
commit
2d98cda607
@ -514,11 +514,24 @@ NTSTATUS FspNotifyFullReportChange(
|
|||||||
ULONG FilterMatch,
|
ULONG FilterMatch,
|
||||||
ULONG Action,
|
ULONG Action,
|
||||||
PVOID TargetContext);
|
PVOID TargetContext);
|
||||||
NTSTATUS FspOplockFsctrlEx(
|
NTSTATUS FspOplockFsctrlF(
|
||||||
POPLOCK Oplock,
|
POPLOCK Oplock,
|
||||||
PIRP Irp,
|
PIRP Irp,
|
||||||
ULONG OpenCount,
|
ULONG OpenCount,
|
||||||
BOOLEAN Create);
|
BOOLEAN Create);
|
||||||
|
NTSTATUS FspCheckOplock(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
|
||||||
|
NTSTATUS FspCheckOplockEx(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
ULONG Flags,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
|
||||||
#define FspNotifyUninitializeSync(NS)\
|
#define FspNotifyUninitializeSync(NS)\
|
||||||
FsRtlNotifyUninitializeSync(NS)
|
FsRtlNotifyUninitializeSync(NS)
|
||||||
#define FspNotifyCleanupAll(NS, NL)\
|
#define FspNotifyCleanupAll(NS, NL)\
|
||||||
@ -532,9 +545,9 @@ NTSTATUS FspOplockFsctrlEx(
|
|||||||
#define FspNotifyReportChange(NS, NL, FN, FO, NP, F, A)\
|
#define FspNotifyReportChange(NS, NL, FN, FO, NP, F, A)\
|
||||||
FspNotifyFullReportChange(NS, NL, (PSTRING)(FN), FO, 0, (PSTRING)(NP), F, A, 0)
|
FspNotifyFullReportChange(NS, NL, (PSTRING)(FN), FO, 0, (PSTRING)(NP), F, A, 0)
|
||||||
#define FspOplockFsctrlCreate(OL, I, OC)\
|
#define FspOplockFsctrlCreate(OL, I, OC)\
|
||||||
FspOplockFsctrlEx(OL, I, OC, TRUE)
|
FspOplockFsctrlF(OL, I, OC, TRUE)
|
||||||
#define FspOplockFsctrl(OL, I, OC)\
|
#define FspOplockFsctrl(OL, I, OC)\
|
||||||
FspOplockFsctrlEx(OL, I, OC, FALSE)
|
FspOplockFsctrlF(OL, I, OC, FALSE)
|
||||||
|
|
||||||
/* utility: synchronous work queue */
|
/* utility: synchronous work queue */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -67,7 +67,20 @@ NTSTATUS FspNotifyFullReportChange(
|
|||||||
ULONG FilterMatch,
|
ULONG FilterMatch,
|
||||||
ULONG Action,
|
ULONG Action,
|
||||||
PVOID TargetContext);
|
PVOID TargetContext);
|
||||||
NTSTATUS FspOplockFsctrlEx(
|
NTSTATUS FspCheckOplock(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
|
||||||
|
NTSTATUS FspCheckOplockEx(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
ULONG Flags,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
|
||||||
|
NTSTATUS FspOplockFsctrlF(
|
||||||
POPLOCK Oplock,
|
POPLOCK Oplock,
|
||||||
PIRP Irp,
|
PIRP Irp,
|
||||||
ULONG OpenCount,
|
ULONG OpenCount,
|
||||||
@ -109,7 +122,9 @@ NTSTATUS FspIrpHookNext(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context);
|
|||||||
#pragma alloc_text(PAGE, FspNotifyInitializeSync)
|
#pragma alloc_text(PAGE, FspNotifyInitializeSync)
|
||||||
#pragma alloc_text(PAGE, FspNotifyFullChangeDirectory)
|
#pragma alloc_text(PAGE, FspNotifyFullChangeDirectory)
|
||||||
#pragma alloc_text(PAGE, FspNotifyFullReportChange)
|
#pragma alloc_text(PAGE, FspNotifyFullReportChange)
|
||||||
#pragma alloc_text(PAGE, FspOplockFsctrlEx)
|
#pragma alloc_text(PAGE, FspCheckOplock)
|
||||||
|
#pragma alloc_text(PAGE, FspCheckOplockEx)
|
||||||
|
#pragma alloc_text(PAGE, FspOplockFsctrlF)
|
||||||
#pragma alloc_text(PAGE, FspInitializeSynchronousWorkItem)
|
#pragma alloc_text(PAGE, FspInitializeSynchronousWorkItem)
|
||||||
#pragma alloc_text(PAGE, FspExecuteSynchronousWorkItem)
|
#pragma alloc_text(PAGE, FspExecuteSynchronousWorkItem)
|
||||||
#pragma alloc_text(PAGE, FspExecuteSynchronousWorkItemRoutine)
|
#pragma alloc_text(PAGE, FspExecuteSynchronousWorkItemRoutine)
|
||||||
@ -646,7 +661,65 @@ NTSTATUS FspNotifyFullReportChange(
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS FspOplockFsctrlEx(
|
NTSTATUS FspCheckOplock(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
NTSTATUS Result;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Result = FsRtlCheckOplock(
|
||||||
|
Oplock,
|
||||||
|
Irp,
|
||||||
|
Context,
|
||||||
|
CompletionRoutine,
|
||||||
|
PostIrpRoutine);
|
||||||
|
}
|
||||||
|
except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
Result = GetExceptionCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS FspCheckOplockEx(
|
||||||
|
POPLOCK Oplock,
|
||||||
|
PIRP Irp,
|
||||||
|
ULONG Flags,
|
||||||
|
PVOID Context,
|
||||||
|
POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
|
||||||
|
POPLOCK_FS_PREPOST_IRP PostIrpRoutine)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
NTSTATUS Result;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Result = FsRtlCheckOplockEx(
|
||||||
|
Oplock,
|
||||||
|
Irp,
|
||||||
|
Flags,
|
||||||
|
Context,
|
||||||
|
CompletionRoutine,
|
||||||
|
PostIrpRoutine);
|
||||||
|
}
|
||||||
|
except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
Result = GetExceptionCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS FspOplockFsctrlF(
|
||||||
POPLOCK Oplock,
|
POPLOCK Oplock,
|
||||||
PIRP Irp,
|
PIRP Irp,
|
||||||
ULONG OpenCount,
|
ULONG OpenCount,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user