123#pragma warning(suppress:28104)
142 "Acquired for Object %p & irp %p - count is %d\n",
145 NT_ASSERTMSG(
"ClassAcquireRemoveLock - lock value was negative : ",
148 NT_ASSERTMSG(
"RemoveLock increased to meet LockHighWatermark",
172 if (removeTrackingList !=
NULL) {
179 if (insertedTrackingBlock !=
NULL) {
182 "already tracking Tag %p\n",
Tag));
184 "acquired in file %s on line %d\n",
185 insertedTrackingBlock->
File, insertedTrackingBlock->
Line));
193 "Cannot track Tag %p - currently %d untracked requsts\n",
209 rundownAcquired = ExAcquireRundownProtectionCacheAware(removeLockRundown);
210 if (!rundownAcquired) {
214 "ClassAcquireRemoveLockEx: RemoveLockRundown acquisition failed"
215 "RemoveLockFailAcquire = %d\n",
257#pragma warning(suppress:28103)
276 TracePrint((
TRACE_LEVEL_VERBOSE, TRACE_FLAG_LOCK,
"ClassReleaseRemoveLock: REMOVE_COMPLETE set; this should never happen"));
286 if (removeTrackingList !=
NULL) {
287 searchDataBlock.
Tag =
Tag;
294 "Couldn't find Tag %p in the lock tracking list\n",
Tag));
302 "Couldn't find Tag %p in the lock tracking list - "
303 "may be one of the %d untracked requests still outstanding\n",
317 "Released for Object %p & irp %p - count is %d\n",
322 NT_ASSERTMSG(
"RemoveLock decreased to meet LockLowWatermark",
325 if (lockValue == 0) {
335 "Release for object %p & irp %p caused lock to go to zero\n",
353 while (lockValue != 0) {
359 if (oldValue == lockValue) {
363 lockValue = oldValue;
366 if (lockValue == 0) {
420 if (removeTrackingList !=
NULL)
422 searchDataBlock.
Tag =
Irp;
426 if(foundTrackingBlock !=
NULL) {
429 "Irp %p completed while still holding the remove lock\n",
Irp));
431 "Lock acquired in file %s on line %d\n",
432 foundTrackingBlock->
File, foundTrackingBlock->
Line));
467 else if (tag1 > tag2)
537 ASSERTMSG(
"Removing the device while still holding remove locks",
541 if (removeTrackingList !=
NULL)
#define InterlockedIncrement
#define InterlockedDecrement
#define FREE_POOL(_PoolPtr)
RTL_GENERIC_FREE_ROUTINE RemoveTrackingFreeRoutine
RTL_GENERIC_ALLOCATE_ROUTINE RemoveTrackingAllocateRoutine
RTL_GENERIC_COMPARE_ROUTINE RemoveTrackingCompareRoutine
struct _CLASS_PRIVATE_COMMON_DATA CLASS_PRIVATE_COMMON_DATA
#define CLASS_TAG_LOCK_TRACKING
VOID NTAPI ClassCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ CCHAR PriorityBoost)
struct _REMOVE_TRACKING_BLOCK REMOVE_TRACKING_BLOCK
VOID NTAPI ClassReleaseRemoveLock(_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIRP Tag)
VOID ClasspUninitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
ULONG NTAPI ClassAcquireRemoveLockEx(_In_ PDEVICE_OBJECT DeviceObject, _In_ PVOID Tag, _In_ PCSTR File, _In_ ULONG Line)
struct _REMOVE_TRACKING_BLOCK * PREMOVE_TRACKING_BLOCK
VOID ClasspInitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define KeInitializeSpinLock(sl)
VOID NTAPI RtlInitializeGenericTable(IN PRTL_GENERIC_TABLE Table, IN PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, IN PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_GENERIC_FREE_ROUTINE FreeRoutine, IN PVOID TableContext)
#define InterlockedCompareExchange
#define ASSERTMSG(msg, exp)
#define UNREFERENCED_PARAMETER(P)
#define IoCompleteRequest
#define KeQueryTickCount(CurrentCount)
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
LONG RemoveLockFailAcquire
KSPIN_LOCK RemoveTrackingSpinlock
LONG RemoveTrackingUntrackedCount
PCLASS_PRIVATE_COMMON_DATA PrivateCommonData
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_In_ WDFREQUEST _In_ NTSTATUS _In_ CCHAR PriorityBoost
NTKERNELAPI VOID FASTCALL ExReleaseRundownProtectionCacheAware(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
struct _EX_RUNDOWN_REF_CACHE_AWARE * PEX_RUNDOWN_REF_CACHE_AWARE
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElements(_In_ PRTL_GENERIC_TABLE Table)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
_IRQL_requires_same_ _In_ PVOID _In_ PVOID SecondStruct
_IRQL_requires_same_ _In_ CLONG ByteSize
_IRQL_requires_same_ _In_ PVOID FirstStruct
enum _RTL_GENERIC_COMPARE_RESULTS RTL_GENERIC_COMPARE_RESULTS