Click to Rate and Give Feedback
Windows Driver Kit: Driver Development Tools
Driver Annotations

Driver annotations enhance the ability of PFD to find some very specific types of errors in driver source code. Driver annotations are intended to complement the general-purpose annotations. The driver annotations are defined in Driverspecs.h and begin with the prefix __drv.

Driver annotationUsage
__drv_at(arg, anno_list)
__drv_arg
(arg, anno_list)
__drv_deref
(anno_list)
__drv_fun
(anno_list)
__drv_in
(anno_list)
__drv_in_deref
(anno_list)
__drv_out
(anno_list)
__drv_out_deref
(anno_list)
__drv_ret
(anno_list)
__drv_at(expr, anno_list)
Basic driver annotations

Annotation expressions

__drv_when(cond, anno_list)Conditional annotations
__drv_valueIs(list) Function result annotations
__drv_strictTypeMatch(mode)
__drv_strictType
(typename, mode)
Type annotations
__drv_notPointer
__drv_isObjectPointer
Pointer annotations
__drv_constant
__drv_nonConstant
Constant and nonconstant parameter annotations
__drv_formatString(kind)Format string annotations
__drv_preferredFunction(name, reason)
__drv_reportError
(string)
Diagnostic annotations
__drv_inTry
__drv_notInTry
Annotations for functions in __try statements
__drv_allocatesMem(type)
__drv_freesMem
(type)
__drv_aliasesMem
Memory annotations
__drv_acquiresResource(kind)
__drv_releasesResource
(kind)
__drv_acquiresResourceGlobal
(kind, param)
__drv_releasesResourceGlobal
(kind, param)
__drv_acquiresCriticalRegion
__drv_releasesCriticalRegion
__drv_acquiresCancelSpinLock
__drv_releasesCancelSpinLock
__drv_mustHold(kind)
__drv_neverHold(kind)
__drv_mustHoldGlobal
(kind, param)
__drv_neverHoldGlobal
(kind, param)
__drv_mustHoldCriticalRegion
__drv_neverHoldCriticalRegion
__drv_mustHoldCancelSpinLock
__drv_neverHoldCancelSpinLock
__drv_acquiresExclusiveResource
(kind)
__drv_releasesExclusiveResource
(kind)
__drv_acquiresExclusiveResourceGlobal
(kind, param)
__drv_releasesExclusiveResourceGlobal
(kind, param)
Nonmemory resource annotations
__drv_functionClassFunction class annotations
__drv_floatSaved
__drv_floatRestored


__drv_floatUsed

Floating point annotations
__drv_maxIRQL(value)
__drv_minIRQL
(value)
__drv_setsIRQL
(value)
__drv_requiresIRQL
(value)
__drv_raisesIRQL
(value)
__drv_savesIRQL
__drv_restoresIRQL
__drv_savesIRQLGlobal
(kind, param)
__drv_restoresIRQLGlobal
(kind, param)
__drv_minFunctionIRQL
(value)
__drv_maxFunctionIRQL
(value)
__drv_sameIRQL
__drv_isCancelIRQL
IRQL annotations
__drv_clearDoInitDO_DEVICE_INITIALIZING annotation
__drv_interlockedAnnotations for interlocked operands


Send feedback on this topic
Built on November 19, 2009
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker