Hi,
We are trying to set some properties for our NIC using a VB application which uses the scripting API provided by WMI. The VB application tries to set the properties in the data blocks defined in our MOF file and writes it to WMI using the
SWbemObject.Put_ method, which should result in a call to the MiniportSetInformation() routine of the NDIS miniport driver for the NIC, with the custom OID corresponding to the data block coming as an input to the routine. But what we are seeing here is
that whenever the SWbemServices.Get method is executed to get an instance for the object corresponding to the data block, the MiniportQueryInformation() is called with the custom OID corresponding to the data block as input. The miniport driver always
returns NDIS_STATUS_SUCCESS for the custom OIDs from the MiniportQueryInformation() routine. Subsequently, after getting the object instance and after changing some properties in the instance, when the SWbemObject.Put_ method is executed to set the
properties on the NIC, I can see in the debugger that the MiniportSetInformation() routine never gets executed and SWbemObject.Put_ always returns an error corresponding to “wbemErrInvalidParameter”. It should be noted that we have tried calling the
SWbemObject.Put_ both without any parameters so that the “flags” parameter takes the default values, and also with the “flags” parameter set to 1, which corresponds to “wbemChangeFlagUpdateOnly”, yielding the same results in both the cases.
I also modified the “Toaster” sample driver available with the Win2k ddk to function as a data provider which uses the same MOF file as our NDIS miniport driver. Here also, we see the same results, i.e. when SWbemServices.Get is called, the
DpWmiQueryDataBlock() routine gets called with the “GuidIndex” parameter corresponding to the queried data block. But, when the the SWbemObject.Put_ method is executed, no IRP comes to the driver and the method call always returns an error corresponding
to “wbemErrInvalidParameter”. Here, it should be noted that all the classes defined in the MOF file corresponding to the data blocks have the “Dynamic” qualifier and in the DpWmiQueryReginfo() routine the “RegFlags” parameter is set to
“WMIREG_FLAG_INSTANCE_PDO” and the “Pdo” parameter is set to the underlying physical device object pointer.
I am wondering if anybody has seen a similar problem while using WMI. I would greatly appreciate it if somebody could throw some light on what I am doing wrong here or is this a flaw in the WMI scripting API provided by Microsoft ?
Thanks,
Neelay
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com