Previous Next

CUV Function Validation Details

Call Usage Verifier (CUV) performs the following validation checks:

INIT
Initialization. The driver must initialize certain data structures, by calling an appropriate standard driver routine, before using the data structures as input to other standard driver routines. The data structures must not have been previously initialized.
CON
Consistency. Data structures must be used consistently. For example, the driver must not use a list head for interlocked operations in one place and for noninterlocked operations elsewhere. Additionally, paired data structures must always be used together. For example, when your driver accesses a list for interlocked operations it must provide pointers to both a list head and a spin lock; whenever the driver accesses the list head, it must use the same spin lock.
NPAGE
Some data structures are checked to ensure that they are located in nonpaged, nonstack-based memory.
VALID
Some data structures are checked to determine if they have a valid type.
CSTACK
The current IRP stack location must be valid. That is, the stack location must not be outside the boundaries of the IRP's I/O stack.
NSTACK
The next IRP stack location must be valid. That is, the stack location must not be outside the boundaries of the IRP's I/O stack.

Not all of these validation checks are performed on all standard driver routines that CUV monitors. The following table lists which checks are performed for each monitored routine.

Function Validations Performed
KeAcquireInStackQueuedSpinLock INIT, CON, NPAGE
KeReleaseInStackQueuedSpinLock INIT, CON, NPAGE
KeAcquireInStackQueuedSpinLockAtDpcLevel INIT, CON, NPAGE
KeReleaseInStackQueuedSpinLockFromDpcLevel INIT, CON, NPAGE
KeInitializeSpinLock INIT, NPAGE
KeAcquireSpinLock INIT, CON, NPAGE
KeReleaseSpinLock INIT, CON, NPAGE
KeAcquireSpinLockAtDpcLevel INIT, CON, NPAGE
KeReleaseSpinLockFromDpcLevel INIT, CON, NPAGE
KeAcquireInterruptSpinLock INIT, CON, NPAGE
KeReleaseInterruptSpinLock INIT, CON, NPAGE
IoConnectInterrupt
(if the optional SpinLock parameter is specified)
INIT, CON, NPAGE
IoConnectInterrupt
(if SpinLock is not specified)
No validations
ExInitializeSListHead INIT
ExQueryDepthSList INIT
ExInterlockedPopEntrySList INIT, CON, NPAGE
ExInterlockedPushEntrySList INIT, CON, NPAGE
ExInterlockedFlushSList INIT, CON, NPAGE
ExInterlockedPushEntryList INIT, CON, NPAGE
ExInterlockedPopEntryList INIT, CON, NPAGE
InitializeListHead INIT
InsertHeadList INIT, CON
InsertTailList INIT, CON
RemoveHeadList INIT, CON
RemoveTailList INIT, CON
IsListEmpty INIT, CON
ExInterlockedInsertHeadList INIT, CON, NPAGE
ExInterlockedInsertTailList INIT, CON, NPAGE
ExInterlockedRemoveHeadList INIT, CON, NPAGE
ExInitializePagedLookasideList INIT, CON, NPAGE
ExDeletePagedLookasideList INIT, CON, NPAGE
ExInitializeNPagedLookasideList INIT, CON, NPAGE
ExDeleteNPagedLookasideList INIT, CON, NPAGE
ExAllocateFromNPagedLookasideList INIT, CON, NPAGE
ExAllocateFromPagedLookasideList INIT, CON, NPAGE
ExFreeToNPagedLookasideList INIT, CON, NPAGE
ExFreeToPagedLookasideList INIT, CON, NPAGE
IoGetCurrentIrpStackLocation VALID, CSTACK
IoGetNextIrpStackLocation VALID, CSTACK
IoMarkIrpPending VALID, CSTACK
IoSetCancelRoutine VALID, CSTACK
IoSetCompletionRoutine VALID, NSTACK
IoSetCompletionRoutineEx VALID, NSTACK
IoSetNextIrpStackLocation VALID, NSTACK
IoCopyCurrentIrpStackLocationToNext VALID, CSTACK, NSTACK
IoSkipCurrentIrpStackLocation VALID, CSTACK