C28169

avviso C28169: la funzione dispatch non include annotazioni _Dispatch_type_

Lo strumento Analisi codice segnala questo avviso quando il lato destro di un'assegnazione alla tabella MajorFunction non ha annotazioni (valide) _Dispatch_type_. L'avviso può talvolta verificarsi se il lato destro ha un cast che rimuove l'annotazione _Dispatch_type_ . Il lato destro deve essere una funzione di tipo DRIVER_DISPATCH tipo con le annotazioni _Dispatch_type_ appropriate.

Per altre informazioni, vedere Using Function Role Type Declarations.

Esempio

La dichiarazione di funzione seguente genera questo avviso, se la funzione viene usata in un'assegnazione di routine dispatch per un elemento MajorFunction.

NTSTATUS
DispatchSystemControl (
    PDEVICE_OBJECT  DeviceObject,
    PIRP            Irp
    );

La dichiarazione di funzione seguente, usata nello stesso modo, non genera questo avviso.

// 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;