#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
|
VOID NTAPI | IoInitializeRemoveLockEx (IN PIO_REMOVE_LOCK RemoveLock, IN ULONG AllocateTag, IN ULONG MaxLockedMinutes, IN ULONG HighWatermark, IN ULONG RemlockSize) |
|
NTSTATUS NTAPI | IoAcquireRemoveLockEx (IN PIO_REMOVE_LOCK RemoveLock, IN OPTIONAL PVOID Tag, IN LPCSTR File, IN ULONG Line, IN ULONG RemlockSize) |
|
VOID NTAPI | IoReleaseRemoveLockEx (IN PIO_REMOVE_LOCK RemoveLock, IN PVOID Tag, IN ULONG RemlockSize) |
|
VOID NTAPI | IoReleaseRemoveLockAndWaitEx (IN PIO_REMOVE_LOCK RemoveLock, IN PVOID Tag, IN ULONG RemlockSize) |
|
◆ NDEBUG
◆ IO_REMOVE_LOCK_TRACKING_BLOCK
◆ IoAcquireRemoveLockEx()
Definition at line 80 of file remlock.c.
85{
90
92
93
96 if (!
Lock->Common.Removed)
97 {
98
100 {
101 ASSERT(
Lock->Dbg.HighWatermark == 0 || LockValue <= Lock->
Dbg.HighWatermark);
102
103
105 if (!TrackingBlock)
106 {
107
109 }
110 else
111 {
112
118
119
121 TrackingBlock->
Next =
Lock->Dbg.Blocks;
122 Lock->Dbg.Blocks = TrackingBlock;
124 }
125 }
126 }
127 else
128 {
129
131 {
132
134 }
135
136
138 }
139
140
142}
#define InterlockedIncrement
#define InterlockedDecrement
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
struct _EXTENDED_IO_REMOVE_LOCK * PEXTENDED_IO_REMOVE_LOCK
#define STATUS_DELETE_PENDING
#define KeQueryTickCount(CurrentCount)
PIO_REMOVE_LOCK_TRACKING_BLOCK Next
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_In_opt_ PVOID _In_ PCSTR _In_ ULONG _In_ ULONG RemlockSize
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
◆ IoInitializeRemoveLockEx()
Definition at line 33 of file remlock.c.
38{
41
43
45
46
48 {
49 return;
50 }
51
53 {
54
56
57 Lock->Dbg.Signature =
'COLR';
62 Lock->Dbg.LowMemoryCount = 0;
64
66
68 Lock->Common.IoCount = 1;
72 }
73}
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeInitializeSpinLock(sl)
ULONG NTAPI KeQueryTimeIncrement(VOID)
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
struct _IO_REMOVE_LOCK_COMMON_BLOCK IO_REMOVE_LOCK_COMMON_BLOCK
◆ IoReleaseRemoveLockAndWaitEx()
Definition at line 243 of file remlock.c.
246{
251
253
254
258
259
261 {
262
268 }
269
270
272 {
273
275
276
277 TrackingBlock =
Lock->Dbg.Blocks;
278
279 if (TrackingBlock->
Tag !=
Tag)
280 {
281 DPRINT(
"Last tracking block tag invalid! Expected: %p, having: %p\n",
Tag, TrackingBlock->
Tag);
283 }
284
285
287 }
288}
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define ExFreePoolWithTag(_P, _T)
◆ IoReleaseRemoveLockEx()
Definition at line 149 of file remlock.c.
152{
160
162
163
165 {
166
168
169
171
172
174 TrackingBlock =
Lock->Dbg.Blocks;
175 TrackingBlockLink = &(
Lock->Dbg.Blocks);
176 while (TrackingBlock !=
NULL)
177 {
178
179 if (
Lock->Dbg.MaxLockedTicks &&
181 {
182 DPRINT(
"Lock %#08lx (with tag %#08lx) was supposed to be held at max %I64d ticks but lasted longer\n",
183 Lock, TrackingBlock->
Tag,
Lock->Dbg.MaxLockedTicks);
184 DPRINT(
"Lock was acquired in file %s at line %lu\n", TrackingBlock->
File, TrackingBlock->
Line);
186 }
187
188
189 if ((TagFound ==
FALSE) && (TrackingBlock->
Tag ==
Tag))
190 {
191
193 *TrackingBlockLink = TrackingBlock->
Next;
195 TrackingBlock = *TrackingBlockLink;
196 }
197 else
198 {
199
200 TrackingBlockLink = &(TrackingBlock->
Next);
201 TrackingBlock = TrackingBlock->
Next;
202 }
203 }
204
205
207
208
209 if (TagFound ==
FALSE)
210 {
211
212
213
215 {
216
218 DPRINT(
"Failed finding block for tag: %#08lx\n",
Tag);
220 }
221 }
222 }
223
224
227
228 if (!LockValue)
229 {
230
232
233
235 }
236}