mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 11:38:39 -05:00 
			
		
		
		
	sys: oplock testing: DEBUGTEST_EX
This commit is contained in:
		| @@ -122,8 +122,11 @@ VOID FspDebugLogIrp(const char *func, PIRP Irp, NTSTATUS Result); | |||||||
| #if DBG | #if DBG | ||||||
| #define DEBUGTEST(Percent)              \ | #define DEBUGTEST(Percent)              \ | ||||||
|     (0 == (fsp_debug & fsp_debug_dt) || DebugRandom() <= (Percent) * 0x7fff / 100) |     (0 == (fsp_debug & fsp_debug_dt) || DebugRandom() <= (Percent) * 0x7fff / 100) | ||||||
|  | #define DEBUGTEST_EX(C, Percent, Deflt) \ | ||||||
|  |     ((C) ? DEBUGTEST(Percent) : (Deflt)) | ||||||
| #else | #else | ||||||
| #define DEBUGTEST(Percent)              (TRUE) | #define DEBUGTEST(Percent)              (TRUE) | ||||||
|  | #define DEBUGTEST_EX(C, Percent, Deflt) (Deflt) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* FSP_ENTER/FSP_LEAVE */ | /* FSP_ENTER/FSP_LEAVE */ | ||||||
|   | |||||||
| @@ -1069,7 +1069,8 @@ retry: | |||||||
|          */ |          */ | ||||||
|         Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, |         Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, | ||||||
|             OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); |             OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); | ||||||
|         if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result) |         if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result || | ||||||
|  |             DEBUGTEST_EX(NT_SUCCESS(Result), 10, FALSE)) | ||||||
|         { |         { | ||||||
|             FspFileNodeRelease(FileNode, Full); |             FspFileNodeRelease(FileNode, Full); | ||||||
|             Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp, 0, 0, 0); |             Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp, 0, 0, 0); | ||||||
| @@ -1203,7 +1204,8 @@ retry: | |||||||
|      */ |      */ | ||||||
|     Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, |     Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, | ||||||
|         OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); |         OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); | ||||||
|     if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result) |     if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result || | ||||||
|  |         DEBUGTEST_EX(NT_SUCCESS(Result), 10, FALSE)) | ||||||
|     { |     { | ||||||
|         FspFileNodeRelease(FileNode, Full); |         FspFileNodeRelease(FileNode, Full); | ||||||
|         FspFsvolDeviceFileRenameRelease(FsvolDeviceObject); |         FspFsvolDeviceFileRenameRelease(FsvolDeviceObject); | ||||||
| @@ -1424,7 +1426,8 @@ retry: | |||||||
|          */ |          */ | ||||||
|         Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, |         Result = FspCheckOplockEx(FspFileNodeAddrOfOplock(FileNode), Irp, | ||||||
|             OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); |             OPLOCK_FLAG_COMPLETE_IF_OPLOCKED, 0, 0, 0); | ||||||
|         if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result) |         if (STATUS_OPLOCK_BREAK_IN_PROGRESS == Result || | ||||||
|  |             DEBUGTEST_EX(NT_SUCCESS(Result), 10, FALSE)) | ||||||
|         { |         { | ||||||
|             FspFileNodeRelease(FileNode, Full); |             FspFileNodeRelease(FileNode, Full); | ||||||
|             Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp, 0, 0, 0); |             Result = FspCheckOplock(FspFileNodeAddrOfOplock(FileNode), Irp, 0, 0, 0); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user