WdfFdoInitSetEventCallbacks - NtDoc

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

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

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdffdo-wdffdoinitseteventcallbacks)

WdfFdoInitSetEventCallbacks function

Description

[Applies to KMDF only]

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

Parameters

DeviceInit [in]

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

FdoEventCallbacks [in]

A pointer to a driver-allocated WDF_FDO_EVENT_CALLBACKS structure.

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

See also

WDF_FDO_EVENT_CALLBACKS_INIT