mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 11:38:39 -05:00 
			
		
		
		
	sys: IRP_MJ_CREATE: oplock support
This commit is contained in:
		| @@ -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); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user