Notatka
Dostęp do tej strony wymaga autoryzacji. Może spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Aby uczestniczyć w kontroli źródła błędów, wtyczka PSHED musi zaimplementować następujące funkcje wywołania zwrotnego:
W poniższym przykładzie kodu pokazano, jak zaimplementować te funkcje wywołania zwrotnego.
//
// The PSHED plug-in's SetErrorSourceInfo callback function
//
NTSTATUS
SetErrorSourceInfo(
IN OUT PVOID PluginContext,
IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
)
{
// Check if the plug-in supports configuring
// the specified error source.
if (...)
{
// Save the new configuration data for the error
// source in nonvolatile storage and apply the
// configuration changes to the error source such
// that they will become effective after the
// system is restarted.
...
// If successful, return success status
if (...)
{
return STATUS_SUCCESS;
}
// Failed to configure the error source
else
{
return STATUS_UNSUCCESSFUL;
}
}
// Not supported by the plug-in
else
{
return STATUS_NOT_SUPPORTED;
}
}
//
// The PSHED plug-in's EnableErrorSource callback function
//
NTSTATUS
EnableErrorSource(
IN OUT PVOID PluginContext,
IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
)
{
// Check if the plug-in supports enabling
// the specified error source.
if (...)
{
// Enable the error source
...
// If successful
if (...)
{
// Return success status
return STATUS_SUCCESS;
}
// Failed to enable the error source
else
{
return STATUS_UNSUCCESSFUL;
}
}
// Not supported by the plug-in
else
{
return STATUS_NOT_SUPPORTED;
}
}
//
// The PSHED plug-in's DisableErrorSource callback function
//
NTSTATUS
DisableErrorSource(
IN OUT PVOID PluginContext,
IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
)
{
// Check if the plug-in supports disabling
// the specified error source.
if (...)
{
// Disable the error source
...
// If successful
if (...)
{
// Return success status
return STATUS_SUCCESS;
}
// Failed to disable the error source
else
{
return STATUS_UNSUCCESSFUL;
}
}
// Not supported by the plug-in
else
{
return STATUS_NOT_SUPPORTED;
}
}
Wtyczka PSHED, która uczestniczy w kontroli źródła błędów, musi określić flagę PshedFAErrorSourceControl podczas rejestrowania się w systemie operacyjnym.