// ntddk.h
NTSTATUS WheaAddErrorSourceDeviceDriver(
PVOID Context,
PWHEA_ERROR_SOURCE_CONFIGURATION_DEVICE_DRIVER Configuration,
ULONG NumberPreallocatedErrorReports
);
View the official Windows Driver Kit DDI referenceNo description available.
A device driver calls WheaAddErrorSourceDeviceDriver to add an error source.
ContextAn optional pointer to a caller-allocated context. WHEA provides the context as a parameter to driver-supplied callback routines. Can be NULL.
ConfigurationPointer to a structure of type WHEA_ERROR_SOURCE_CONFIGURATION_DEVICE_DRIVER that contains a set of driver-supplied callback routines.
NumberPreallocatedErrorReportsA value of type ULONG that specifies the number of records to preallocate. See Remarks for more information.
This function method returns STATUS_SUCCESS if the error source is added. Otherwise it can return one of the following:
To remove an error source, the driver calls WheaRemoveErrorSourceDeviceDriver.
WHEA can preallocate memory for errors that will be reported at high IRQL (i.e. in the context of a device interrupt). For error sources reported at PASSIVE_LEVEL, preallocation is not required but if the device driver reports errors for its error source at DISPATCH_LEVEL or higher, error records must be preallocated.
For more info, see Using WHEA on Windows 10.
WheaRemoveErrorSourceDeviceDriver
WheaCreateHwErrorReportDeviceDriver