DDI usage rule set (NDIS)

Use these rules to verify that your driver correctly uses NDIS DDIs correctly.

In this section

TopicDescription

Init_DeRegisterInterrupt

The Init_DeRegisterInterrupt rule specifies that if NdisMRegisterInterruptEx is called at least once during MPInitilize, NdisMDeregisterInterruptEx should be called at least once in MPHaltEx.

Init_NdisAllocateIoWorkItem

The Init_NdisAllocateIoWorkItem rule specifies that if NdisAllocateIoWorkItem is called at least once during MiniportInitializeEx, the NdisFreeIoWorkItem function should:

Init_RegisterInterrupt

The Init_RegisterInterrupt rule specifies that the registration of interrupts, which usually happens during initialization, must be undone if something goes wrong in the initialization process or during the halting of the miniport driver.

If NdisMRegisterInterruptEx is called at least one time during MiniportInitializeEx, the NdisMDeregisterInterruptEx function must be called at least one time in MiniportHaltEx.

Init_RegisterSG

The Init_RegisterSG rule specifies that the registration of the scatter-gather list (SG), which usually happens during initialization, must be undone if something goes wrong in the initialization process or during the halting of the miniport driver.

If NdisMRegisterScatterGatherDma is called at least one time during MiniportInitializeEx, the NdisMDeregisterScatterGatherDma function should be called at least one time in MiniportHaltEx.

NdisFDeregisterFilterDriver

A filter driver must call NdisFDeregisterFilterDriver from its FilterDriverUnload routine.

NdisMDeregisterInterruptEx

After NdisMDeregisterInterruptEx returns control, the miniport driver cannot call the NdisMSynchronizeWithInterruptEx function.

 

JJ126196.wedge(en-us,VS.85).gifTo select the DDI usage rule set

  1. Select your driver project (.vcxProj) in Microsoft Visual Studio. From the Driver menu, click Launch Static Driver Verifier….

  2. Click the Rules tab. Under Rule Sets, select DDIUsage.

    To select the default rule set from a Visual Studio developer command prompt window, specify DDIUsage.sdv with the /check option. For example:

    
    msbuild /t:sdv /p:Inputs="/check:DDIUsage.sdv" mydriver.VcxProj /p:Configuration="Win8 Release" /p:Platform=Win32
    
    

    For more information, see Using Static Driver Verifier to Find Defects in Drivers and Static Driver Verifier commands (MSBuild).

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft