Expand Minimize

WdfPdoInitSetEventCallbacks method

[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

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DispatchTable [in]

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

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, DriverCreate, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI

See also

WDF_PDO_EVENT_CALLBACKS_INIT
WdfPdoInitAllocate

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.