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 odnajdywanie źródła błędów, wtyczka PSHED musi zaimplementować funkcję wywołania zwrotnego GetAllErrorSources . Wtyczka PSHED, która uczestniczy w odnajdywania źródła błędów, może również zaimplementować opcjonalną funkcję wywołania zwrotnego GetErrorSourceInfo .
W poniższym przykładzie kodu pokazano, jak zaimplementować te funkcje wywołania zwrotnego.
//
// The PSHED plug-in's GetAllErrorSources callback function
//
NTSTATUS
GetAllErrorSources(
IN OUT PVOID PluginContext,
IN OUT PULONG Count,
IN OUT PWHEA_ERROR_SOURCE_DESCRIPTOR *ErrorSources,
IN OUT PULONG Length
)
{
// Check if there is enough space remaining in the buffer
// that contains the array of error source descriptors to
// include any additional error sources to be reported by
// the PSHED plug-in.
if (...)
{
// Update the list of error sources by modifying the
// existing error sources in the list and adding any
// additional error sources to the list.
...
// If the number of error sources in the list has changed
// update the count that is returned back to the kernel.
*Count = ...;
// If successful, return success status
if (...)
{
return STATUS_SUCCESS;
}
// Failed to update the list of error sources
else
{
return STATUS_UNSUCCESSFUL;
}
}
// Insufficient space in the buffer.
else
{
// Set the length the necessary buffer size
*Length = ...;
return STATUS_BUFFER_TOO_SMALL;
}
}
//
// The PSHED plug-in's GetErrorSourceInfo callback function
//
NTSTATUS
GetErrorSourceInfo(
IN OUT PVOID PluginContext,
IN OUT PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
)
{
// Modify the information contained in the
// error source descriptor as appropriate.
...
// If successful, return success status
if (...)
{
return STATUS_SUCCESS;
}
// Failed to update the error source information
else
{
return STATUS_UNSUCCESSFUL;
}
}
Wtyczka PSHED, która uczestniczy w odnajdaniu źródła błędów, musi określić flagę PshedFADiscovery podczas rejestrowania się w systemie operacyjnym.