Bewerken

Delen via


WdfPdoInitSetEventCallbacks function (wdfpdo.h)

[Applies to KMDF only]

The WdfPdoInitSetEventCallbacks method registers a bus driver's event callback functions.

Syntax

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

Parameters

[in] DeviceInit

A pointer to a WDFDEVICE_INIT structure.

[in] DispatchTable

A pointer to a caller-allocated WDF_PDO_EVENT_CALLBACKS structure.

Return value

None

Remarks

The bus driver must allocate a WDF_PDO_EVENT_CALLBACKS structure and fill in the structure with pointers to the driver's event callback functions.

The driver must call WdfPdoInitSetEventCallbacks before calling WdfDeviceCreate. For more information about calling WdfPdoInitSetEventCallbacks and WdfDeviceCreate, see Creating Device Objects in a Bus Driver.

Examples

The following code example initializes a WDF_PDO_EVENT_CALLBACKS structure and then calls 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
                            );

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Header wdfpdo.h (include Wdf.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL PASSIVE_LEVEL
DDI compliance rules ChildDeviceInitAPI(kmdf), DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), PdoDeviceInitAPI(kmdf)

See also

WDF_PDO_EVENT_CALLBACKS_INIT

WdfPdoInitAllocate