_WHEA_ERROR_SOURCE_INITIALIZE_DEVICE_DRIVER callback function (ntddk.h)

The WHEA_ERROR_SOURCE_INITIALIZE_DEVICE_DRIVER callback function initializes a driver's error source hardware and software state.

Syntax

_WHEA_ERROR_SOURCE_INITIALIZE_DEVICE_DRIVER WheaErrorSourceInitializeDeviceDriver;

NTSTATUS WheaErrorSourceInitializeDeviceDriver(
  PVOID Context,
  ULONG ErrorSourceId
)
{...}

Parameters

Context

A pointer to the context that the driver supplied when it called WheaAddErrorSourceDeviceDriver.

ErrorSourceId

A ULONG value that uniquely identifies this driver as an error source.

Return value

This function method returns STATUS_SUCCESS or an appropriate error code.

Remarks

A driver should store the error source identifier it receives as input to this callback function for later communication with WHEA. For example, if the driver detects an error condition, it calls WheaReportHwErrorDeviceDriver, providing the error data and the driver's ErrorSourceId, to report the error to WHEA. When a driver is stopped (for example to be updated), it calls WheaRemoveErrorSourceDeviceDriver to unregister its error source identifier.

Register your implementation of this callback function by setting the appropriate member of WHEA_ERROR_SOURCE_CONFIGURATION_DEVICE_DRIVER and then calling WheaAddErrorSourceDeviceDriver.

For more info, see Using WHEA on Windows 10.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1903
Header ntddk.h (include Ntddk.h)

See also

WHEA_ERROR_SOURCE_UNINITIALIZE_DEVICE_DRIVER