Funzione WdfPdoInitSetEventCallbacks (wdfpdo.h)

[Si applica solo a KMDF]

Il metodo WdfPdoInitSetEventCallbacks registra le funzioni di callback di un driver del bus.

Sintassi

void WdfPdoInitSetEventCallbacks(
  [in] PWDFDEVICE_INIT          DeviceInit,
  [in] PWDF_PDO_EVENT_CALLBACKS DispatchTable
);

Parametri

[in] DeviceInit

Puntatore a una struttura WDFDEVICE_INIT .

[in] DispatchTable

Puntatore a una struttura di WDF_PDO_EVENT_CALLBACKS allocata dal chiamante.

Valore restituito

nessuno

Osservazioni

Il conducente del bus deve allocare una struttura WDF_PDO_EVENT_CALLBACKS e compilare la struttura con puntatori alle funzioni di callback degli eventi del driver.

Il driver deve chiamare WdfPdoInitSetEventCallbacks prima di chiamare WdfDeviceCreate. Per altre informazioni sulla chiamata a WdfPdoInitSetEventCallbacks e WdfDeviceCreate, vedere Creazione di oggetti dispositivo in un driver del bus.

Esempio

L'esempio di codice seguente inizializza una struttura WDF_PDO_EVENT_CALLBACKS e quindi chiama WdfPdoInitSetEventCallbacks.

PWDFDEVICE_INIT  pDeviceInit = NULL;
WDF_PDO_EVENT_CALLBACKS  pdoCallbacks;

pDeviceInit = WdfPdoInitAllocate(Device);
WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks);
pdoCallbacks.EvtDeviceResourceRequirementsQuery = Bus_Pdo_EvtDeviceResourceRequirementsQuery;
WdfPdoInitSetEventCallbacks(
                            pDeviceInit,
                            &pdoCallbacks
                            );

Requisiti

Requisito Valore
Piattaforma di destinazione Universale
Versione KMDF minima 1,0
Intestazione wdfpdo.h (include Wdf.h)
Libreria Wdf01000.sys (vedere Controllo delle versioni della libreria framework).
IRQL PASSIVE_LEVEL
Regole di conformità DDI ChildDeviceInitAPI(kmdf), DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), PdoDeviceInitAPI(kmdf)

Vedi anche

WDF_PDO_EVENT_CALLBACKS_INIT

WdfPdoInitAllocate