// ntddk.h
PSHED_PI_WRITE_ERROR_RECORD PshedPiWriteErrorRecord;
NTSTATUS PshedPiWriteErrorRecord(
[in, out, optional] PVOID PluginContext,
[in] ULONG Flags,
[in] ULONG RecordLength,
[in] PWHEA_ERROR_RECORD ErrorRecord
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
A PSHED plug-in's WriteErrorRecord callback function writes an error record to the system's persistent data storage.
PluginContext [in, out, optional]A pointer to the context area that was specified in the Context member of the WHEA_PSHED_PLUGIN_REGISTRATION_PACKET structure when the PSHED plug-in called the PshedRegisterPlugin function to register itself with the PSHED.
Flags [in]A bit-wise OR'ed combination of flags that affect the write operation. A possible flag is:
The write operation is a dummy write operation. No data is to be written to the system's persistent data storage.
RecordLength [in]The size, in bytes, of the error record pointed to by the ErrorRecord parameter.
ErrorRecord [in]A pointer to a WHEA_ERROR_RECORD structure that describes the error record that is being written to the system's persistent data storage.
A PSHED plug-in's WriteErrorRecord callback function returns one of the following NTSTATUS codes:
| Return code | Description |
|---|---|
| STATUS_SUCCESS | The error record was successfully written to the system's persistent data storage. |
| STATUS_UNSUCCESSFUL | An error occurred. |
A PSHED plug-in that participates in error record persistence sets the Callbacks.WriteErrorRecord, Callbacks.ReadErrorRecord and Callbacks.ClearErrorRecord members of the WHEA_PSHED_PLUGIN_REGISTRATION_PACKET structure to point to its WriteErrorRecord, ReadErrorRecord, and ClearErrorRecord callback functions when the plug-in calls the PshedRegisterPlugin function to register itself with the PSHED. The PSHED plug-in must also set the PshedFAErrorRecordPersistence flag in the FunctionalAreaMask member of the WHEA_PSHED_PLUGIN_REGISTRATION_PACKET structure.
The Windows kernel calls into the PSHED to write an error record to the system's persistent data storage whenever a fatal or otherwise unrecoverable error condition exists so that the error record is preserved while the system is restarted. If a PSHED plug-in is registered to participate in error record persistence, the PSHED calls the PSHED plug-in's WriteErrorRecord callback function to perform the write operation. The mechanism that is used to write the error record to the system's persistent data storage is platform-specific.
WHEA_PSHED_PLUGIN_REGISTRATION_PACKET