Static Driver Verifier NDIS Function Declarations
To enable SDV to verify your NDIS driver, you must declare each callback function, by using a callback function role type. The callback function role types are defined in the Ndis.h header file and are included when you build your driver with that header file.
You must declare the driver's callback functions before you declare the callback function definitions. The following code example shows the function role type declaration for the MiniportInitializeEx callback function. This callback function must be declared by using the MINIPORT_INITIALIZE role type. In this example, the callback function is called myMiniportInitializeEx.
#include <ndis.h>
MINIPORT_INITIALIZE myMiniportInitializeEx
If a callback function has a function prototype declaration, you must replace the function prototype with the function role type declaration. For more information about the function role type declarations, see the Using Function Role Type Declarations topic.
The following table shows the callback function role types and the NDIS callback functions that they are associated with.
Required Function Declarations
NDIS miniport driver callback function | Role type name |
---|---|
MINIPORT_ADD_DEVICE |
|
MINIPORT_CANCEL_DIRECT_OID_REQUEST |
|
MINIPORT_CANCEL_OID_REQUEST |
|
MINIPORT_CANCEL_SEND |
|
MINIPORT_CHECK_FOR_HANG |
|
MINIPORT_DEVICE_PNP_EVENT_NOTIFY |
|
MINIPORT_DIRECT_OID_REQUEST |
|
MINIPORT_DISABLE_INTERRUPT |
|
MINIPORT_DISABLE_MESSAGE_INTERRUPT |
|
MINIPORT_UNLOAD |
|
MINIPORT_ENABLE_INTERRUPT |
|
MINIPORT_ENABLE_MESSAGE_INTERRUPT |
|
MINIPORT_FILTER_RESOURCE_REQUIREMENTS |
|
MINIPORT_HALT |
|
MINIPORT_INITIALIZE |
|
MINIPORT_ISR |
|
MINIPORT_INTERRUPT_DPC |
|
MINIPORT_MESSAGE_INTERRUPT |
|
MINIPORT_MESSAGE_INTERRUPT_DPC |
|
MINIPORT_OID_REQUEST |
|
MINIPORT_PAUSE |
|
MINIPORT_PROCESS_SG_LIST |
|
MINIPORT_REMOVE_DEVICE |
|
MINIPORT_RESET |
|
MINIPORT_RESTART |
|
MINIPORT_RETURN_NET_BUFFER_LISTS |
|
MINIPORT_SEND_NET_BUFFER_LISTS |
|
MINIPORT_SET_OPTIONS |
|
MINIPORT_ALLOCATE_SHARED_MEM_COMPLETE |
|
MINIPORT_SHUTDOWN |
|
MINIPORT_START_DEVICE |
|
MINIPORT_SYNCHRONIZE_INTERRUPT |
|
MINIPORT_SYNCHRONIZE_MESSAGE_INTERRUPT |
NDIS other callback function | Role type name |
---|---|
NDIS_IO_WORKITEM_ROUTINE Routine Routine is the callback routine that is specified in the second parameter to the NdisQueueIoWorkItem function. |
NDIS_IO_WORKITEM_FUNCTION |
NDIS_TIMER_FUNCTION |
Recommended Function Declarations
The following function role types are not currently used in SDV rules for NDIS drivers; however, they are likely to be used the future. These function role types are fully supported in Windows 7 and we recommended that you use their specific function role types to declare these callbacks.
NDIS filter driver callback function | Role type name |
---|---|
FILTER_ATTACH |
|
FILTER_CANCEL_DIRECT_OID_REQUEST |
|
FILTER_CANCEL_SEND_NET_BUFFER_LISTS |
|
FILTER_CANCEL_OID_REQUEST |
|
FILTER_DETACH |
|
FILTER_DEVICE_PNP_EVENT_NOTIFY |
|
FILTER_DIRECT_OID_REQUEST |
|
FILTER_DIRECT_OID_REQUEST_COMPLETE |
|
DRIVER_UNLOAD |
|
FILTER_NET_PNP_EVENT |
|
FILTER_OID_REQUEST |
|
FILTER_OID_REQUEST_COMPLETE |
|
FILTER_PAUSE |
|
FILTER_RECEIVE_NET_BUFFER_LISTS |
|
FILTER_RESTART |
|
FILTER_RETURN_NET_BUFFER_LISTS |
|
FILTER_SEND_NET_BUFFER_LISTS |
|
FILTER_SEND_NET_BUFFER_LISTS_COMPLETE |
|
FILTER_SET_MODULE_OPTIONS |
|
FILTER_SET_OPTIONS |
|
FILTER_STATUS |
CoNDIS miniport driver callback function | Role type name |
---|---|
MINIPORT_CO_ACTIVATE_VC |
|
MINIPORT_CO_CREATE_VC |
|
MINIPORT_CO_DEACTIVATE_VC |
|
MINIPORT_CO_DELETE_VC |
|
MINIPORT_CO_OID_REQUEST |
|
MINIPORT_CO_SEND_NET_BUFFER_LISTS |
NDIS protocol driver callback function | Role type name |
---|---|
PROTOCOL_BIND_ADAPTER_EX |
|
PROTOCOL_CLOSE_ADAPTER_COMPLETE_EX |
|
PROTOCOL_DIRECT_OID_REQUEST_COMPLETE |
|
PROTOCOL_NET_PNP_EVENT |
|
PROTOCOL_OID_REQUEST_COMPLETE |
|
PROTOCOL_OPEN_ADAPTER_COMPLETE_EX |
|
PROTOCOL_RECEIVE_NET_BUFFER_LISTS |
|
PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE |
|
PROTOCOL_SET_OPTIONS |
|
PROTOCOL_STATUS_EX |
|
PROTOCOL_UNBIND_ADAPTER_EX |
|
PROTOCOL_UNINSTALL |
NDIS protocol CL callback function | Role type name |
---|---|
PROTOCOL_CL_ADD_PARTY_COMPLETE |
|
PROTOCOL_CL_CALL_CONNECTED |
|
PROTOCOL_CL_CLOSE_AF_COMPLETE |
|
PROTOCOL_CL_CLOSE_CALL_COMPLETE |
|
PROTOCOL_CL_DEREGISTER_SAP_COMPLETE |
|
PROTOCOL_CL_DROP_PARTY_COMPLETE |
|
PROTOCOL_CL_INCOMING_CALL |
|
PROTOCOL_CL_INCOMING_CALL_QOS_CHANGE |
|
PROTOCOL_CL_INCOMING_CLOSE_CALL |
|
PROTOCOL_CL_INCOMING_DROP_PARTY |
|
PROTOCOL_CL_MAKE_CALL_COMPLETE |
|
PROTOCOL_CL_MODIFY_CALL_QOS_COMPLETE |
|
PROTOCOL_CL_NOTIFY_CLOSE_AF |
|
PROTOCOL_CL_OPEN_AF_COMPLETE |
|
PROTOCOL_CL_OPEN_AF_COMPLETE_EX |
|
PROTOCOL_CL_REGISTER_SAP_COMPLETE |
CoNDIS CM callback function | Role type name |
---|---|
PROTOCOL_CM_ACTIVATE_VC_COMPLETE |
|
PROTOCOL_CM_ADD_PARTY |
|
PROTOCOL_CM_CLOSE_AF |
|
PROTOCOL_CM_CLOSE_CALL |
|
PROTOCOL_CM_DEACTIVATE_VC_COMPLETE |
|
PROTOCOL_CM_DEREGISTER_SAP |
|
PROTOCOL_CM_DROP_PARTY |
|
PROTOCOL_CM_INCOMING_CALL_COMPLETE |
|
PROTOCOL_CM_MAKE_CALL |
|
PROTOCOL_CM_MODIFY_QOS_CALL |
|
PROTOCOL_CM_NOTIFY_CLOSE_AF_COMPLETE |
|
PROTOCOL_CM_OPEN_AF |
|
PROTOCOL_CM_REG_SAP |
CoNDIS CO callback function | Role type name |
---|---|
PROTCOL_CO_AF_REGISTER_NOTIFY |
|
PROTOCOL_CO_CREATE_VC |
|
PROTOCOL_CO_DELETE_VC |
|
PROTOCOL_CO_OID_REQUEST |
|
PROTOCOL_CO_OID_REQUEST_COMPLETE |
|
PROTOCOL_CO_RECEIVE_NET_BUFFER_LISTS |
|
PROTOCOL_CO_SEND_NET_BUFFER_LISTS_COMPLETE |
|
PROTOCOL_CO_STATUS_EX |