WdfFdoInitSetEventCallbacks function (wdffdo.h)

[Applies to KMDF only]

The WdfFdoInitSetEventCallbacks method registers a framework-based function driver's event callback functions, for a specified device.

Syntax

void WdfFdoInitSetEventCallbacks(
  [in] PWDFDEVICE_INIT          DeviceInit,
  [in] PWDF_FDO_EVENT_CALLBACKS FdoEventCallbacks
);

Parameters

[in] DeviceInit

A pointer to a WDFDEVICE_INIT structure that the driver obtained from its EvtDriverDeviceAdd callback function.

[in] FdoEventCallbacks

A pointer to a driver-allocated WDF_FDO_EVENT_CALLBACKS structure.

Return value

None

Remarks

Before calling WdfFdoInitSetEventCallbacks, the driver must allocate a WDF_FDO_EVENT_CALLBACKS structure and fill in the structure with pointers to the driver's event callback functions.

The driver must call WdfFdoInitSetEventCallbacks before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

For more information about the WdfFdoInitSetEventCallbacks method, see Creating Device Objects in a Function Driver.

Examples

The following code example initializes a WDF_FDO_EVENT_CALLBACKS structure and then calls WdfFdoInitSetEventCallbacks.

WDF_FDO_EVENT_CALLBACKS fdoCallbacks;

WDF_FDO_EVENT_CALLBACKS_INIT(&fdoCallbacks);
fdoCallbacks.EvtDeviceFilterAddResourceRequirements = MyEvtDeviceFilterAddResourceRequirements;
fdoCallbacks.EvtDeviceFilterRemoveResourceRequirements = MyEvtDeviceFilterRemoveResourceRequirements;
fdoCallbacks.EvtDeviceRemoveAddedResources = MyEvtDeviceRemoveAddedResources;

WdfFdoInitSetEventCallbacks(
                            DeviceInit,
                            &fdoCallbacks
                            );

Requirements

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

See also

WDF_FDO_EVENT_CALLBACKS_INIT