PshedRegisterPlugin function (ntddk.h)
The PshedRegisterPlugin function registers a PSHED plug-in with the PSHED.
Syntax
NTPSHEDAPI NTSTATUS PshedRegisterPlugin(
[in, out] PWHEA_PSHED_PLUGIN_REGISTRATION_PACKET Packet
);
Parameters
[in, out] Packet
A pointer to an initialized WHEA_PSHED_PLUGIN_REGISTRATION_PACKET structure that describes the PSHED plug-in's registration information.
Return value
PshedRegisterPlugin returns one of the following NTSTATUS codes:
Return code | Description |
---|---|
|
The PSHED plug-in was successfully registered. |
|
The data in the supplied registration packet is invalid. |
Remarks
A PSHED plug-in calls the PshedRegisterPlugin function to register itself with the PSHED. A PSHED plug-in typically calls this function from within either its DriverEntry function or its AddDevice function.
Starting in Windows 10, version 1903 (WDK 10 version 18362), a V2 of the PSHED-Plugin interfaces is available that allows a plugin to be removed and updated on a running system by calling the PshedUnregisterPlugin function. Because they can be unregistered, V2 plugins cannot specify the PshedFADiscovery flag (discovery functional area) in the FunctionalAreaMask member of the WHEA_PSHED_PLUGIN_REGISTRATION_PACKET_V2 structure. For info about registering a plug-in, see Registering a PSHED Plug-In. For a V1 plugin, if you try to unregister, a bugcheck may occur. It is recommended that you use a V2 plugin if possible, which is the current default.
To register a V1 vs a V2 plugin, use the correct struct. WHEA_PSHED_PLUGIN_REGISTRATION_PACKET_V1 for V1 and WHEA_PSHED_PLUGIN_REGISTRATION_PACKET_V2 for V2.
A V2 plugin can still add error sources as described in Using WHEA on Windows 10, or by calling WheaAddErrorSource and WheaRemoveErrorSource.
A plugin may continue to use the discovery functional area by specifying WHEA_PLUGIN_REGISTRATION_PACKET_V1 as the version of its WHEA_PSHED_PLUGIN_REGISTRATION_PACKET_V2 structure.
All callbacks, on both V1 and V2 plugins, are called at a minimum IRQL of DISPATCH_LEVEL.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in Windows Server 2008, Windows Vista SP1, and later versions of Windows. |
Target Platform | Universal |
Header | ntddk.h (include Ntddk.h) |
Library | Pshed.lib |
DLL | Pshed.dll |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm) |