WdfPdoInitSetEventCallbacks - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfpdo.h

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

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfpdo-wdfpdoinitseteventcallbacks)

WdfPdoInitSetEventCallbacks function

Description

[Applies to KMDF only]

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

Parameters

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DispatchTable [in]

A pointer to a caller-allocated WDF_PDO_EVENT_CALLBACKS structure.

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

See also

WDF_PDO_EVENT_CALLBACKS_INIT

WdfPdoInitAllocate