00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef _TRACKIRP_H_
00025
#define _TRACKIRP_H_
00026
00027 #define ASSERTFLAG_TRACKIRPS 0x00000001
00028 #define ASSERTFLAG_MONITOR_ALLOCS 0x00000002
00029 #define ASSERTFLAG_POLICEIRPS 0x00000004
00030 #define ASSERTFLAG_MONITORMAJORS 0x00000008
00031 #define ASSERTFLAG_SURROGATE 0x00000010
00032 #define ASSERTFLAG_SMASH_SRBS 0x00000020
00033 #define ASSERTFLAG_CONSUME_ALWAYS 0x00000040
00034 #define ASSERTFLAG_FORCEPENDING 0x00000080
00035 #define ASSERTFLAG_COMPLETEATDPC 0x00000100
00036 #define ASSERTFLAG_COMPLETEATPASSIVE 0x00000200
00037 #define ASSERTFLAG_DEFERCOMPLETION 0x00000800
00038 #define ASSERTFLAG_ROTATE_STATUS 0x00001000
00039
00040 #define ASSERTMASK_COMPLETESTYLE 0x00000F80
00041 #define ASSERTFLAG_SEEDSTACK 0x00010000
00042
00043
00044
00045
00046
00047
00048
00049 #define HACKHACKS_ENABLED
00050 #define HACKFLAG_FOR_MUP 0x00000001
00051 #define HACKFLAG_FOR_SCSIPORT 0x00000002
00052 #define HACKFLAG_FOR_ACPI 0x00000004
00053 #define HACKFLAG_FOR_BOGUSIRPS 0x00000008
00054
00055 extern ULONG
IovpHackFlags ;
00056 extern ULONG
IovpTrackingFlags ;
00057
00058
00059
00060
00061 #define IRPFLAG_EXAMINE_MASK 0xC0000000
00062 #define IRPFLAG_EXAMINE_NOT_TRACKED 0x80000000
00063 #define IRPFLAG_EXAMINE_TRACKED 0x40000000
00064 #define IRPFLAG_EXAMINE_UNMARKED 0x00000000
00065
00066 #define IRP_DIAG_HAS_SURROGATE 0x02000000
00067 #define IRP_DIAG_IS_SURROGATE 0x01000000
00068
00069
00070 #define TRACKFLAG_ACTIVE 0x00000001
00071 #define TRACKFLAG_SURROGATE 0x00000002
00072 #define TRACKFLAG_HAS_SURROGATE 0x00000004
00073 #define TRACKFLAG_PROTECTEDIRP 0x00000008
00074
00075 #define TRACKFLAG_QUEUED_INTERNALLY 0x00000010
00076 #define TRACKFLAG_BOGUS 0x00000020
00077 #define TRACKFLAG_RELEASED 0x00000040
00078 #define TRACKFLAG_SRB_MUNGED 0x00000080
00079 #define TRACKFLAG_SWAPPED_BACK 0x00000100
00080 #define TRACKFLAG_WATERMARKED 0x00100000
00081 #define TRACKFLAG_IO_ALLOCATED 0x00200000
00082 #define TRACKFLAG_UNWOUND_BADLY 0x00400000
00083 #define TRACKFLAG_PASSED_FAILURE 0x01000000
00084 #define TRACKFLAG_PASSED_AT_BAD_IRQL 0x02000000
00085 #define TRACKFLAG_IN_TRANSIT 0x40000000
00086 #define TRACKFLAG_REMOVED_FROM_TABLE 0x80000000
00087
00088 #define DOE_DESIGNATED_FDO 0x80000000
00089 #define DOE_BOTTOM_OF_FDO_STACK 0x40000000
00090 #define DOE_RAW_FDO 0x20000000
00091 #define DOE_EXAMINED 0x10000000
00092 #define DOE_TRACKED 0x08000000
00093
00094 #define STACKFLAG_NO_HANDLER 0x80000000
00095 #define STACKFLAG_REQUEST_COMPLETED 0x40000000
00096 #define STACKFLAG_CHECK_FOR_REFERENCE 0x20000000
00097 #define STACKFLAG_REACHED_PDO 0x10000000
00098 #define STACKFLAG_FIRST_REQUEST 0x08000000
00099
00100 #define CALLFLAG_COMPLETED 0x80000000
00101 #define CALLFLAG_IS_REMOVE_IRP 0x40000000
00102 #define CALLFLAG_REMOVING_FDO_STACK_DO 0x20000000
00103 #define CALLFLAG_OVERRIDE_STATUS 0x10000000
00104 #define CALLFLAG_TOPMOST_IN_SLOT 0x08000000
00105
00106 #define ALLOCFLAG_PROTECTEDIRP 0x00000001
00107
00108 #define SESSIONFLAG_UNWOUND_INCONSISTANT 0x00000001
00109
00110 #define IRP_SYSTEM_RESTRICTED 0x00000001
00111 #define IRP_BOGUS 0x00000002
00112
00113 #define SL_NOTCOPIED 0x10
00114
00115 #define IRP_ALLOCATION_MONITORED 0x80
00116
00117 #define STARTED_TOP_OF_STACK 1
00118 #define FORWARDED_TO_NEXT_DO 2
00119 #define SKIPPED_A_DO 3
00120 #define STARTED_INSIDE_STACK 4
00121 #define CHANGED_STACKS_AT_BOTTOM 5
00122 #define CHANGED_STACKS_MID_STACK 6
00123
00124 #define IRP_ALLOC_COUNT 5
00125
00126 typedef enum {
00127
00128
DEFERACTION_QUEUE_WORKITEM,
00129
DEFERACTION_QUEUE_PASSIVE_TIMER,
00130
DEFERACTION_QUEUE_DISPATCH_TIMER,
00131
DEFERACTION_NORMAL
00132
00133 }
DEFER_ACTION;
00134
00135
struct _IOFCALLDRIVER_STACKDATA;
00136
struct _IOV_STACK_LOCATION;
00137
struct _IOV_REQUEST_PACKET;
00138
00139 typedef struct _IOFCALLDRIVER_STACKDATA *
PIOFCALLDRIVER_STACKDATA;
00140 typedef struct _IOV_STACK_LOCATION *
PIOV_STACK_LOCATION;
00141 typedef struct _IOV_REQUEST_PACKET *
PIOV_REQUEST_PACKET;
00142 typedef struct _IOV_SESSION_DATA *
PIOV_SESSION_DATA;
00143
00144 typedef struct _IOFCALLDRIVER_STACKDATA {
00145
00146 PIOV_SESSION_DATA IovSessionData;
00147 PIOV_STACK_LOCATION IovStackLocation;
00148 ULONG
Flags;
00149 LIST_ENTRY
SharedLocationList;
00150 NTSTATUS ExpectedStatus;
00151 NTSTATUS NewStatus;
00152 PDEVICE_OBJECT RemovePdo;
00153
00154 }
IOFCALLDRIVER_STACKDATA;
00155
00156 typedef struct _IOV_STACK_LOCATION {
00157
00158 BOOLEAN
InUse;
00159 ULONG
Flags;
00160 PIOV_STACK_LOCATION RequestsFirstStackLocation;
00161 LIST_ENTRY
CallStackData;
00162 PIO_STACK_LOCATION IrpSp;
00163 PVOID
LastDispatch;
00164 LARGE_INTEGER
PerfDispatchStart;
00165 LARGE_INTEGER
PerfStackLocationStart;
00166 PDEVICE_OBJECT ReferencingObject;
00167 LONG
ReferencingCount;
00168 IO_STATUS_BLOCK
InitialStatusBlock;
00169 IO_STATUS_BLOCK
LastStatusBlock;
00170 PETHREAD ThreadDispatchedTo;
00171
00172 }
IOV_STACK_LOCATION;
00173
00174 typedef struct _IOV_SESSION_DATA {
00175
00176 PIOV_REQUEST_PACKET IovRequestPacket;
00177 LONG
SessionRefCount;
00178 LIST_ENTRY
SessionLink;
00179 ULONG
SessionFlags;
00180 ULONG
AssertFlags;
00181
00182 PETHREAD OriginatorThread;
00183 PDEVICE_OBJECT DeviceLastCalled;
00184 ULONG
ForwardMethod;
00185 PIRP BestVisibleIrp;
00186 IOV_STACK_LOCATION StackData[
ANYSIZE_ARRAY];
00187
00188 }
IOV_SESSION_DATA;
00189
00190 typedef struct _IOV_REQUEST_PACKET {
00191
00192 PIRP TrackedIrp;
00193 KSPIN_LOCK
IrpLock;
00194 KIRQL
CallerIrql;
00195 LONG
ReferenceCount;
00196 LONG
PointerCount;
00197 ULONG
Flags;
00198 LIST_ENTRY
HashLink;
00199 LIST_ENTRY
SurrogateLink;
00200 LIST_ENTRY
SessionHead;
00201 PIOV_REQUEST_PACKET HeadPacket;
00202 CCHAR
StackCount;
00203
00204 ULONG
AssertFlags;
00205
00206 PIO_COMPLETION_ROUTINE RealIrpCompletionRoutine;
00207 UCHAR
RealIrpControl;
00208 PVOID
RealIrpContext;
00209 PVOID
AllocatorStack[
IRP_ALLOC_COUNT];
00210
00211
00212
00213
00214 UCHAR
TopStackLocation;
00215
00216 CCHAR
PriorityBoost;
00217 UCHAR
LastLocation;
00218 ULONG
RefTrackingCount;
00219 PVOID
RestoreHandle;
00220
00221 PIOV_SESSION_DATA pIovSessionData;
00222
00223 }
IOV_REQUEST_PACKET;
00224
00225 typedef struct _DEFERRAL_CONTEXT {
00226
00227 PIOV_REQUEST_PACKET IovRequestPacket;
00228 PIO_COMPLETION_ROUTINE OriginalCompletionRoutine;
00229 PVOID
OriginalContext;
00230 PIRP OriginalIrp;
00231 CCHAR
OriginalPriorityBoost;
00232 PDEVICE_OBJECT DeviceObject;
00233 PIO_STACK_LOCATION IrpSpNext;
00234 WORK_QUEUE_ITEM WorkQueueItem;
00235 KDPC DpcItem;
00236 KTIMER DeferralTimer;
00237 DEFER_ACTION DeferAction;
00238
00239 }
DEFERRAL_CONTEXT, *
PDEFERRAL_CONTEXT;
00240
00241 typedef struct _IOFCOMPLETEREQUEST_STACKDATA {
00242
00243 PIOV_SESSION_DATA IovSessionData;
00244 PIOV_REQUEST_PACKET IovRequestPacket;
00245 BOOLEAN
IsRemoveIrp ;
00246 LONG
LocationsAdvanced ;
00247 ULONG
RaisedCount ;
00248 KIRQL
PreviousIrql ;
00249 PVOID
CompletionRoutine ;
00250
00251 }
IOFCOMPLETEREQUEST_STACKDATA, *
PIOFCOMPLETEREQUEST_STACKDATA ;
00252
00253
#ifdef NO_SPECIAL_IRP
00254
00255
#define SPECIALIRP_MARK_NON_TRACKABLE(Irp)
00256
#define SPECIALIRP_IOF_CALL_1(pIrp, DeviceObject, st1)
00257
#define SPECIALIRP_IOF_CALL_2(Irp, DeviceObject, Routine, FinalStatus, st1)
00258
#define SPECIALIRP_IOF_COMPLETE_1(Irp, PriorityBoost, CompletionPacket)
00259
#define SPECIALIRP_IOF_COMPLETE_2(Irp, CompletionPacket)
00260
#define SPECIALIRP_IOF_COMPLETE_3(Irp, Routine, CompletionPacket)
00261
#define SPECIALIRP_IOF_COMPLETE_4(Irp, ReturnedStatus, CompletionPacket)
00262
#define SPECIALIRP_IOF_COMPLETE_5(Irp, CompletionPacket)
00263
#define SPECIALIRP_IOP_COMPLETE_REQUEST(Irp, StackPointer)
00264
#define SPECIALIRP_IO_CANCEL_IRP(Irp, CancelHandled, ReturnValue) DbgBreakPoint() ;
00265
#define SPECIALIRP_IO_FREE_IRP(Irp, FreeHandled) DbgBreakPoint() ;
00266
#define SPECIALIRP_IO_ALLOCATE_IRP_1(StackSize, Quota, pIrp) DbgBreakPoint() ;
00267
#define SPECIALIRP_IO_ALLOCATE_IRP_2(Irp)
00268
#define SPECIALIRP_IO_INITIALIZE_IRP(Irp, PacketSize, StackSize, InitHandled) \
00269
DbgBreakPoint() ;
00270
#define SPECIALIRP_IO_ATTACH_DEVICE_TO_DEVICE_STACK(NewDevice, ExistingDevice)
00271
#define SPECIALIRP_IO_DETACH_DEVICE(TargetDevice)
00272
#define SPECIALIRP_IO_DELETE_DEVICE(TargetDevice)
00273
#define SPECIALIRP_WATERMARK_IRP(Irp, Flags)
00274
00275
#define IOP_DIAG_THROW_CHAFF_AT_STARTED_PDO_STACK(DeviceObject)
00276
00277
#else // NO_SPECIAL_IRP
00278
00279
00280
00281
00282
00283 BOOLEAN
00284
FASTCALL
00285
IovpInitIrpTracking(
00286 IN ULONG Level,
00287 IN ULONG Flags
00288 );
00289
00290
VOID
00291
FASTCALL
00292
IovpCallDriver1(
00293 IN OUT
PIRP *IrpPointer,
00294 IN
PDEVICE_OBJECT DeviceObject,
00295 IN OUT
PIOFCALLDRIVER_STACKDATA IofCallDriverStackData
00296 );
00297
00298
VOID
00299
FASTCALL
00300
IovpCallDriver2(
00301 IN
PIRP Irp,
00302 IN
PDEVICE_OBJECT DeviceObject,
00303 IN PVOID Routine,
00304 IN OUT NTSTATUS *FinalStatus,
00305 IN
PIOFCALLDRIVER_STACKDATA IofCallDriverStackData
00306 );
00307
00308
VOID
00309
FASTCALL
00310
IovpCompleteRequest1(
00311 IN
PIRP Irp,
00312 IN CCHAR PriorityBoost,
00313 IN OUT PIOFCOMPLETEREQUEST_STACKDATA CompletionPacket
00314 );
00315
00316
VOID
00317
FASTCALL
00318
IovpCompleteRequest2(
00319 IN
PIRP Irp,
00320 IN OUT PIOFCOMPLETEREQUEST_STACKDATA CompletionPacket
00321 );
00322
00323
VOID
00324
FASTCALL
00325
IovpCompleteRequest3(
00326 IN
PIRP Irp,
00327 IN PVOID Routine,
00328 IN OUT PIOFCOMPLETEREQUEST_STACKDATA CompletionPacket
00329 );
00330
00331
VOID
00332
FASTCALL
00333
IovpCompleteRequest4(
00334 IN
PIRP Irp,
00335 IN NTSTATUS ReturnedStatus,
00336 IN OUT PIOFCOMPLETEREQUEST_STACKDATA CompletionPacket
00337 );
00338
00339
VOID
00340
FASTCALL
00341
IovpCompleteRequest5(
00342 IN
PIRP Irp,
00343 IN OUT PIOFCOMPLETEREQUEST_STACKDATA CompletionPacket
00344 );
00345
00346
VOID
00347
FASTCALL
00348
IovpCompleteRequestApc(
00349 IN
PIRP Irp,
00350 IN PVOID BestStackOffset
00351 );
00352
00353
VOID
00354
FASTCALL
00355
IovpCancelIrp(
00356 IN
PIRP Irp,
00357 IN OUT PBOOLEAN CancelHandled,
00358 IN OUT PBOOLEAN ReturnValue
00359 );
00360
00361
VOID
00362
FASTCALL
00363
IovpFreeIrp(
00364 IN
PIRP Irp,
00365 IN OUT PBOOLEAN FreeHandled
00366 );
00367
00368
VOID
00369
FASTCALL
00370
IovpAllocateIrp1(
00371 IN CCHAR StackSize,
00372 IN BOOLEAN ChargeQuota,
00373 IN OUT
PIRP *IrpPointer
00374 );
00375
00376
VOID
00377
FASTCALL
00378
IovpAllocateIrp2(
00379 IN
PIRP Irp
00380 );
00381
00382
VOID
00383
FASTCALL
00384
IovpInitializeIrp(
00385 IN OUT
PIRP Irp,
00386 IN USHORT PacketSize,
00387 IN CCHAR StackSize,
00388 IN OUT PBOOLEAN InitializeHandled
00389 );
00390
00391
VOID
00392
IovpExamineIrpStackForwarding(
00393 IN OUT
PIOV_REQUEST_PACKET IovPacket,
00394 IN BOOLEAN IsNewSession,
00395 IN ULONG ForwardMethod,
00396 IN
PDEVICE_OBJECT DeviceObject,
00397 IN
PIRP Irp,
00398 IN OUT
PIO_STACK_LOCATION *IoCurrentStackLocation,
00399 OUT
PIO_STACK_LOCATION *IoLastStackLocation,
00400 OUT ULONG *StackLocationsAdvanced
00401 );
00402
00403
NTSTATUS
00404
IovpSwapSurrogateIrp(
00405 IN
PDEVICE_OBJECT DeviceObject,
00406 IN
PIRP Irp,
00407 IN PVOID Context
00408 );
00409
00410
VOID
00411
FASTCALL
00412
IovpExamineDevObjForwarding(
00413 IN
PDEVICE_OBJECT DeviceBeingCalled,
00414 IN
PDEVICE_OBJECT DeviceLastCalled,
00415 OUT PULONG ForwardingTechnique
00416 );
00417
00418
VOID
00419
FASTCALL
00420
IovpFinalizeIrpSettings(
00421 IN OUT
PIOV_REQUEST_PACKET IrpTrackingData,
00422 IN BOOLEAN SurrogateIrpSwapped
00423 );
00424
00425
PDEVICE_OBJECT
00426
FASTCALL
00427
IovpGetDeviceAttachedTo(
00428 IN
PDEVICE_OBJECT DeviceObject
00429 );
00430
00431
NTSTATUS
00432
IovpInternalCompletionTrap(
00433 IN
PDEVICE_OBJECT DeviceObject,
00434 IN
PIRP Irp,
00435 IN PVOID Context
00436 );
00437
00438
NTSTATUS
00439
IovpInternalDeferredCompletion(
00440 IN
PDEVICE_OBJECT DeviceObject,
00441 IN
PIRP Irp,
00442 IN PVOID Context
00443 );
00444
00445
PDEVICE_OBJECT
00446
FASTCALL
00447
IovpGetLowestDevice(
00448 IN
PDEVICE_OBJECT DeviceObject
00449 );
00450
00451
VOID
00452
FASTCALL
00453
IovpAssertNonLegacyDevice(
00454 IN
PDEVICE_OBJECT DeviceObject,
00455 IN ULONG StackFramesToSkip,
00456 IN PUCHAR FailureTxt
00457 );
00458
00459 BOOLEAN
00460
FASTCALL
00461
IovpIsInFdoStack(
00462 IN
PDEVICE_OBJECT DeviceObject
00463 );
00464
00465 BOOLEAN
00466
FASTCALL
00467
IovpDoAssertIrps(
00468 VOID
00469 );
00470
00471
VOID
00472
FASTCALL
00473
IovpSeedStack(
00474 VOID
00475 );
00476
00477
VOID
00478
FASTCALL
00479
IovpSeedOnePage(
00480 VOID
00481 );
00482
00483
VOID
00484
FASTCALL
00485
IovpSeedTwoPages(
00486 VOID
00487 );
00488
00489
VOID
00490
FASTCALL
00491
IovpSeedThreePages(
00492 VOID
00493 );
00494
00495
VOID
00496
IovpInternalCompleteAfterWait(
00497 IN PVOID Context
00498 );
00499
00500
VOID
00501
IovpInternalCompleteAtDPC(
00502 IN
PKDPC Dpc,
00503 IN PVOID DeferredContext,
00504 IN PVOID SystemArgument1,
00505 IN PVOID SystemArgument2
00506 );
00507
00508
VOID
00509
IovpAttachDeviceToDeviceStack(
00510 IN
PDEVICE_OBJECT NewDevice,
00511 IN
PDEVICE_OBJECT ExistingDevice
00512 );
00513
00514
VOID
00515
IovpDetachDevice(
00516 IN
PDEVICE_OBJECT LowerDevice
00517 );
00518
00519
VOID
00520
IovpDeleteDevice(
00521 IN
PDEVICE_OBJECT Device
00522 );
00523
00524 BOOLEAN
00525
IovpIsInterestingStack(
00526 IN
PDEVICE_OBJECT DeviceObject
00527 );
00528
00529 BOOLEAN
00530
IovpIsInterestingDriver(
00531 IN
PDRIVER_OBJECT DriverObject
00532 );
00533
00534
VOID
00535
IovpReexamineAllStacks(
00536 VOID
00537 );
00538
00539 BOOLEAN
00540
IovpEnumDevObjCallback(
00541 IN PVOID Object,
00542 IN PUNICODE_STRING ObjectName,
00543 IN ULONG HandleCount,
00544 IN ULONG PointerCount,
00545 IN PVOID Context
00546 );
00547
00548 BOOLEAN
00549
IovpAdvanceStackDownwards(
00550 IN
PIOV_STACK_LOCATION StackDataArray,
00551 IN CCHAR CurrentLocation,
00552 IN
PIO_STACK_LOCATION IrpSp,
00553 IN
PIO_STACK_LOCATION IrpLastSp OPTIONAL,
00554 IN ULONG LocationsAdvanced,
00555 IN BOOLEAN IsNewRequest,
00556 IN BOOLEAN MarkAsTaken,
00557 OUT
PIOV_STACK_LOCATION *StackLocationInfo
00558 );
00559
00560 #define SPECIALIRP_MARK_NON_TRACKABLE(Irp) { \
00561
(Irp)->Flags |= IRPFLAG_EXAMINE_NOT_TRACKED; \
00562
}
00563
00564 #define SPECIALIRP_IOF_CALL_1(pIrp, DeviceObject, st1) \
00565
{\
00566
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00567
IovpCallDriver1((pIrp), (DeviceObject), (st1));\
00568
IovpSeedStack() ; \
00569
} else { \
00570
(st1)->IovSessionData = NULL ; \
00571
SPECIALIRP_MARK_NON_TRACKABLE(*pIrp); \
00572
} \
00573
}
00574
00575 #define SPECIALIRP_IOF_CALL_2(Irp, DeviceObject, Routine, FinalStatus, st1) \
00576
{\
00577
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00578
IovpCallDriver2((Irp), (DeviceObject), (Routine), (FinalStatus), (st1));\
00579
} \
00580
}
00581
00582 #define SPECIALIRP_IOF_COMPLETE_1(Irp, PriorityBoost, CompletionPacket) \
00583
{\
00584
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00585
IovpCompleteRequest1((Irp), (PriorityBoost), (CompletionPacket));\
00586
} else { \
00587
(CompletionPacket)->IovSessionData = NULL ; \
00588
} \
00589
}
00590
00591 #define SPECIALIRP_IOF_COMPLETE_2(Irp, CompletionPacket) \
00592
{\
00593
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00594
IovpCompleteRequest2((Irp), (CompletionPacket));\
00595
} \
00596
}
00597
00598 #define SPECIALIRP_IOF_COMPLETE_3(Irp, Routine, CompletionPacket) \
00599
{\
00600
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00601
IovpCompleteRequest3((Irp), (Routine), (CompletionPacket));\
00602
} \
00603
}
00604
00605 #define SPECIALIRP_IOF_COMPLETE_4(Irp, ReturnedStatus, CompletionPacket) \
00606
{\
00607
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00608
IovpCompleteRequest4((Irp), (ReturnedStatus), (CompletionPacket));\
00609
} \
00610
}
00611
00612 #define SPECIALIRP_IOF_COMPLETE_5(Irp, CompletionPacket) \
00613
{\
00614
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00615
IovpCompleteRequest5((Irp), (CompletionPacket));\
00616
} \
00617
}
00618
00619 #define SPECIALIRP_IO_CANCEL_IRP(Irp, CancelHandled, ReturnValue) \
00620
{\
00621
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00622
IovpCancelIrp((Irp), (CancelHandled), (ReturnValue));\
00623
} else { \
00624
*(CancelHandled) = FALSE ; \
00625
} \
00626
}
00627
00628 #define IOP_DIAG_THROW_CHAFF_AT_STARTED_PDO_STACK(DeviceObject) \
00629
{\
00630
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00631
IovpThrowChaffAtStartedPdoStack(DeviceObject);\
00632
}\
00633
}
00634
00635 #define SPECIALIRP_IO_FREE_IRP(Irp, FreeHandled) \
00636
{\
00637
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00638
IovpFreeIrp((Irp), (FreeHandled));\
00639
} else { \
00640
*(FreeHandled) = FALSE ; \
00641
} \
00642
}
00643
00644 #define SPECIALIRP_IO_ALLOCATE_IRP_1(StackSize, Quota, IrpPointer) \
00645
{\
00646
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00647
IovpAllocateIrp1((StackSize), (Quota), (IrpPointer));\
00648
} else { \
00649
*(IrpPointer) = NULL ; \
00650
} \
00651
}
00652
00653 #define SPECIALIRP_IO_ALLOCATE_IRP_2(Irp) \
00654
{\
00655
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00656
IovpAllocateIrp2(Irp);\
00657
}\
00658
}
00659
00660 #define SPECIALIRP_IO_INITIALIZE_IRP(Irp, PacketSize, StackSize, InitHandled) \
00661
{\
00662
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00663
IovpInitializeIrp((Irp), (PacketSize), (StackSize), (InitHandled));\
00664
} else { \
00665
*(InitHandled) = FALSE ; \
00666
}\
00667
}
00668
00669 #define SPECIALIRP_IO_DELETE_DEVICE(Device) \
00670
{\
00671
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00672
IovpDeleteDevice(Device);\
00673
}\
00674
}
00675
00676 #define SPECIALIRP_IO_ATTACH_DEVICE_TO_DEVICE_STACK(NewDevice, ExistingDevice) \
00677
{\
00678
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00679
IovpAttachDeviceToDeviceStack(NewDevice, ExistingDevice);\
00680
}\
00681
}
00682
00683 #define SPECIALIRP_IO_DETACH_DEVICE(TargetDevice) \
00684
{\
00685
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00686
IovpDetachDevice(TargetDevice);\
00687
}\
00688
}
00689
00690 #define SPECIALIRP_WATERMARK_IRP(Irp, Flags) \
00691
{\
00692
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00693
IovpWatermarkIrp(Irp, Flags);\
00694
}\
00695
}
00696
00697 #define SPECIALIRP_IOP_COMPLETE_REQUEST(Irp, StackPointer) \
00698
{\
00699
if (IovpTrackingFlags && IovpDoAssertIrps()) { \
00700
IovpCompleteRequestApc(Irp, StackPointer);\
00701
}\
00702
}
00703
00704
#if DBG
00705
#define TRACKIRP_DBGPRINT(txt,level) \
00706
{ \
00707
if (IovpIrpTrackingSpewLevel>(level)) { \
00708
DbgPrint##txt ; \
00709
}\
00710
}
00711
#else
00712 #define TRACKIRP_DBGPRINT(txt,level)
00713
#endif
00714
00715
#endif // NO_SPECIAL_IRP
00716
00717
#endif // _TRACKIRP_H_
00718