参与错误恢复
若要参与错误恢复,PSHED 插件必须实现 AttemptRecovery 回调函数。
下面的代码示例演示如何实现此回调函数。
//
// The PSHED plug-in's AttemptRecovery callback function
//
NTSTATUS
AttemptRecovery(
IN OUT PVOID PluginContext,
IN ULONG BufferLength,
IN PWHEA_ERROR_RECORD ErrorRecord
)
{
// Check if the error condition was not corrected by the
// operating system or by the PSHED.
if (ErrorRecord->Header.Severity != WheaErrSevCorrected)
{
// Attempt to correct the error condition.
...
// If not successful, return failure status
if (...)
{
return STATUS_UNSUCCESSFUL;
}
}
// Perform any additional operations that are required
// to fully recover from the error condition.
...
// If successful, return success status
if (...)
{
return STATUS_SUCCESS;
}
// Failed to fully recover from the error condition
else
{
return STATUS_UNSUCCESSFUL;
}
}
参与错误恢复的 PSHED 插件在向操作系统注册自身时必须指定 PshedFAErrorRecovery 标志。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈