警告 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;