警告 C28169:分派函式沒有任何 _Dispatch_type_ 批注
當指派給 MajorFunction 數據表的右側沒有 _Dispatch_type_ 批注時,程式代碼分析工具會報告此警告。 如果右側具有從 _Dispatch_type_ 批注中去除的轉換,有時可能會發生警告。 右側應該是具有適當 _Dispatch_type_ 批注之類型DRIVER_DISPATCH類型的函式。
範例
下列函式宣告會引發此警告,如果函式用於 MajorFunction 的分派例程指派中,。
NTSTATUS
DispatchSystemControl (
PDEVICE_OBJECT DeviceObject,
PIRP Irp
);
以相同方式使用的下列函式宣告不會引發這個警告。
// Function: DispatchSystemControl
// This is an example of a fully annotated declaration.
// IRP_MJ_SYSTEM_CONTROL is the type of IRP handled by this function.
// Multiple _Dispatch_type_ lines are acceptable if the function handles more than 1 IRP type.
//
_Dispatch_type_(IRP_MJ_SYSTEM_CONTROL)
DRIVER_DISPATCH DispatchSystemControl;