Hi,
I am trying to issue WMI events from a miniport driver using scsiwmi APIs. But somehow cannot see event instances being received by the user mode applications.
Here is how I try to achieve this in my driver.
-
Event GUID declaration
SCSIWMIGUIDREGINFO xxxxGuidList =
{
{&ErrorEventGuid, 1, WMIREG_FLAG_INSTANCE_PDO},
{&SmartEventGuid, 1, WMIREG_FLAG_INSTANCE_PDO}
}; -
WMI lib context initialization
xxxxWmiInitialize(
IN Pxxxx_DEVICE_EXTENSION DeviceExtension,
MINIPORT_DRIVER_THREAD mdt
)
{
PSCSI_WMILIB_CONTEXT wmiLibContext;
wmiLibContext = &DeviceExtension->WmiLibContext;
wmiLibContext->GuidList = xxxxGuidList;
wmiLibContext->GuidCount = 2;
wmiLibContext->QueryWmiRegInfo = xxxxQueryWmiRegInfo;
wmiLibContext->QueryWmiDataBlock = xxxxQueryWmiDataBlock;
wmiLibContext->SetWmiDataBlock = NULL;
wmiLibContext->SetWmiDataItem = NULL;
wmiLibContext->ExecuteWmiMethod = NULL;
wmiLibContext->WmiFunctionControl = xxxxFunctionControl;
}
- Firing an event
ScsiPortWmiFireAdapterEvent( DeviceExtension, &SmartEventGuid,
0, sizeof(SMART_Event),
&DeviceExtension->WmiSmartEventData);
In between all these, I have code to handle SRB_FUNCTION_WMI requests and event enable/disable handling code which I think is working fine.
I can browse my registered mof classes - so that registration is also fine.
What else can be wrong?
Here is my mof file snippet.
[WMI, dynamic, provider(“WmiProv”), Locale(“MS\0x409”), guid(“94E0321B-49E8-04DB-FFDF-15AD5A22609C”), Description(“SMART / Health Event Warning”)]
class SMART_Event : WMIEvent
{
[key, read] string InstanceName;
[read] boolean Active;
[read, WmiDataId(1)] uint32 ctrlId;
[read, WmiDataId(2)] uint32 EventType;
[read, WmiDataId(3)] uint8 SmartLogData[512];
};