mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: IRP_MJ_CREATE: oplock support
This commit is contained in:
parent
fb70eccc9c
commit
e50c9ff649
@ -1040,10 +1040,15 @@ static NTSTATUS FspFsvolCreateSharingViolationWork(
|
|||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
|
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
|
||||||
|
|
||||||
FspFileNodeAcquireShared(FileNode, Main);
|
FspFileNodeAcquireShared(FileNode, Main);
|
||||||
|
|
||||||
|
Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp,
|
||||||
|
OPLOCK_FLAG_OPLOCK_KEY_CHECK_ONLY, 0, 0, 0);
|
||||||
|
if (!NT_SUCCESS(Result))
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
|
|
||||||
if (FsRtlCurrentBatchOplock(FspFileNodeAddrOfOplock(FileNode)))
|
if (FsRtlCurrentBatchOplock(FspFileNodeAddrOfOplock(FileNode)))
|
||||||
{
|
{
|
||||||
Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp,
|
Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp,
|
||||||
@ -1053,10 +1058,11 @@ static NTSTATUS FspFsvolCreateSharingViolationWork(
|
|||||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, 0);
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, 0);
|
||||||
if (STATUS_SUCCESS == Irp->IoStatus.Status)
|
if (STATUS_SUCCESS == Irp->IoStatus.Status)
|
||||||
OpbatchBreakUnderway = TRUE;
|
OpbatchBreakUnderway = TRUE;
|
||||||
|
|
||||||
|
KeResetEvent(&Event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KeResetEvent(&Event);
|
|
||||||
Result = FspOplockBreakH(FspFileNodeAddrOfOplock(FileNode), Irp, 0,
|
Result = FspOplockBreakH(FspFileNodeAddrOfOplock(FileNode), Irp, 0,
|
||||||
&Event, FspFsvolCreateSharingViolationOplockComplete, 0);
|
&Event, FspFsvolCreateSharingViolationOplockComplete, 0);
|
||||||
if (STATUS_PENDING == Result)
|
if (STATUS_PENDING == Result)
|
||||||
@ -1066,6 +1072,7 @@ static NTSTATUS FspFsvolCreateSharingViolationWork(
|
|||||||
StatusSharingViolation = FALSE;
|
StatusSharingViolation = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit:
|
||||||
FspFileNodeRelease(FileNode, Main);
|
FspFileNodeRelease(FileNode, Main);
|
||||||
|
|
||||||
FspFileNodeClose(FileNode, IrpSp->FileObject, FALSE, TRUE);
|
FspFileNodeClose(FileNode, IrpSp->FileObject, FALSE, TRUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user