sys: FspFsvolCreateSharingViolationWork

This commit is contained in:
Bill Zissimopoulos 2016-11-10 18:14:17 -08:00
parent e50c9ff649
commit f05ebd9d20

View File

@ -1063,13 +1063,16 @@ static NTSTATUS FspFsvolCreateSharingViolationWork(
}
}
Result = FspOplockBreakH(FspFileNodeAddrOfOplock(FileNode), Irp, 0,
&Event, FspFsvolCreateSharingViolationOplockComplete, 0);
if (STATUS_PENDING == Result)
if (!FlagOn(IrpSp->Parameters.Create.Options, FILE_COMPLETE_IF_OPLOCKED))
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, 0);
if (STATUS_SUCCESS == Irp->IoStatus.Status)
StatusSharingViolation = FALSE;
Result = FspOplockBreakH(FspFileNodeAddrOfOplock(FileNode), Irp, 0,
&Event, FspFsvolCreateSharingViolationOplockComplete, 0);
if (STATUS_PENDING == Result)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, 0);
if (STATUS_SUCCESS == Irp->IoStatus.Status)
StatusSharingViolation = FALSE;
}
}
exit:
@ -1081,13 +1084,14 @@ exit:
if (StatusSharingViolation)
{
Response->IoStatus.Status = (UINT32)STATUS_SHARING_VIOLATION;
Response->IoStatus.Information = OpbatchBreakUnderway ? FILE_OPBATCH_BREAK_UNDERWAY : 0;
Irp->IoStatus.Information = OpbatchBreakUnderway ? FILE_OPBATCH_BREAK_UNDERWAY : 0;
return STATUS_SHARING_VIOLATION;
}
else
{
FspIopRetryCompleteIrp(Irp, Response, &Result);
return Result;
}
FspIopRetryCompleteIrp(Irp, Response, &Result);
return Result;
}
static VOID FspFsvolCreateSharingViolationOplockComplete(