靜態驅動程式驗證器 NDIS 函式宣告
若要讓 SDV 能夠驗證您的 NDIS 驅動程式,您必須使用回呼函式角色類型來宣告每個回呼函式。 回呼函式角色類型會定義于 Ndis.h 標頭檔中,並在您使用該標頭檔建置驅動程式時包含。
您必須先宣告驅動程式的回呼函式,才能宣告回呼函式定義。 下列程式碼範例顯示 MiniportInitializeEx 回呼函式的函式角色類型宣告。 這個回呼函式必須使用MINIPORT_INITIALIZE角色類型來宣告。 在此範例中,回呼函式稱為 myMiniportInitializeEx。
#include <ndis.h>
MINIPORT_INITIALIZE myMiniportInitializeEx
如果回呼函式具有函式原型宣告,您必須將函式原型取代為函式角色類型宣告。 如需函式角色類型宣告的詳細資訊,請參閱 使用函式角色類型宣告 主題。
下表顯示其相關聯的回呼函式角色類型和 NDIS 回呼函式。
必要的函式宣告
NDIS 迷你埠驅動程式回呼函式 | 角色類型名稱 |
---|---|
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 其他回呼函式 | 角色類型名稱 |
---|---|
NDIS_IO_WORKITEM_ROUTINE 常規 常式 是在 NdisQueueIoWorkItem 函式的第二個參數中指定的回呼常式。 |
NDIS_IO_WORKITEM_FUNCTION |
NDIS_TIMER_FUNCTION |
建議的函式宣告
下列函式角色類型目前未用於 NDIS 驅動程式的 SDV 規則中;不過,未來可能會使用它們。 Windows 7 中完全支援這些函式角色類型,建議您使用其特定函式角色類型來宣告這些回呼。
NDIS 篩選驅動程式回呼函式 | 角色類型名稱 |
---|---|
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_CO_ACTI加值稅E_VC |
|
MINIPORT_CO_CREATE_VC |
|
MINIPORT_CO_DEACTI加值稅E_VC |
|
MINIPORT_CO_DELETE_VC |
|
MINIPORT_CO_OID_REQUEST |
|
MINIPORT_CO_SEND_NET_BUFFER_LISTS |
NDIS 通訊協定驅動程式回呼函式 | 角色類型名稱 |
---|---|
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 通訊協定 CL 回呼函式 | 角色類型名稱 |
---|---|
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 回呼函式 | 角色類型名稱 |
---|---|
PROTOCOL_CM_ACTI加值稅E_VC_COMPLETE |
|
PROTOCOL_CM_ADD_PARTY |
|
PROTOCOL_CM_CLOSE_AF |
|
PROTOCOL_CM_CLOSE_CALL |
|
PROTOCOL_CM_DEACTI加值稅E_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 回呼函式 | 角色類型名稱 |
---|---|
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 |