how does Storport miniport driver send WMI event to WMI consumer App?

I register the storport miniport driver as a WMI provider, and initialize the WMI_LIB_CONTEXT, and define the event class and interface in MOF file, when the LUN change or the other SAS error event occur, the driver need to send event to WMI consumer app to notify what happened to HBA. I tried to call ScsiPortWmiFireAdapterEvent or ScsiPortWmiFireLogicalUnitEvent to implement sending event when handling WMI_FUNTION_CONTROL. However, I don’t know how ISR rountine transfer the event data to HwScsiWmiFunctionControl routine for implementing async event notification. in addition, how to inssue that all event from HW are sent to WMI consumer?

I am looking forward to your answer, I will be appreciated.

thanks
Best Regards

Leon Huang

Why are you not using ScsiPortNotification (NotificationType = WMIEvent)?

Igor Sharovar

wrote in message news

> I tried to call ScsiPortWmiFireAdapterEvent or ScsiPortWmiFireLogicalUnitEvent to implement
> sending event when handling WMI_FUNTION_CONTROL. However, I don’t know how ISR rountine
> transfer the event data to HwScsiWmiFunctionControl routine for implementing async event
> notification


Firing event is not normally done in miniport’s HwScsiWmiFunctionControl. The intent of HwScsiWmiFunctionControl is for the system to let the miniport know whether it is necessary or not to collect wmi events or data block that the miniport registered as expensive.

For example, if there is no consumer in the system that subscribe these expensive wmi data block or events, the system will call the miniport’s HwScsiWmiFunctionControl to disable them so that miniport can improve performance by not collecting expensive data or executing book-keeping logic that are no longer necessary, because nobody in the system are interested in these wmi data or events.

Hope it helps.

Tai-Hing

thank you very much for your reply.
I shoud use the ScsiPortNotification (NotificationType = WMIEvent) for notifying WMI event occured.
I know there is a iscsi wmi sample code in WDK, but it is not entire.
anybody, could you show me an entire storport/scsiport miniport driver with WMI implementation?

Thanks
Regards
Leon Huang