Wmi 's ExecuteWmiMethod error

I have implemented wmi interface where query data block and set datablock is working fine (testing by using wbemtest utility).Now i have added a execute method support to my driver.In wbetest utility ,it is showing my method name but when i say execute ,its flaging an error that “Invalid method parameters” even though my function is void fun(void).Can any one please help me to resolve this issue.

thanks,

Anyone who implemented WMI,can you please tell me the steps to test ExecuteWmimethod by using wbemtest or some other utilities.

Thanks,

Try testing with a .vbs script.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Anyone who implemented WMI,can you please tell me the steps to test ExecuteWmimethod by using wbemtest or some other utilities.
>
> Thanks,
>

Use WMITools at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&displaylang=enTo execute the method, you need to correctly populate the input arg for the method. The NdisObjectHeader in the input arg takes the following values,revision = 1, type = 2, size = 32.
Thanks

Date: Tue, 1 Feb 2011 08:29:02 -0500
From: xxxxx@rediffmail.com
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] Wmi 's ExecuteWmiMethod error

Anyone who implemented WMI,can you please tell me the steps to test ExecuteWmimethod by using wbemtest or some other utilities.

Thanks,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

PowerShell is REAL nice for interactively calling WMI. Like for example to
call a driver method:

$obj = gwmi -namespace root\wmi MyBusInformation

“{0:X}” -f $obj.ReadXYZRegister(4).value

Jan

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Krishna Jagadish
Marisa
Sent: Tuesday, February 01, 2011 9:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Wmi 's ExecuteWmiMethod error

Use WMITools at
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6430f853-1120-48
db-8cc5-f2abdc3ed314
http:8db-8cc5-f2abdc3ed314&displaylang=en> &displaylang=en

To execute the method, you need to correctly populate the input arg for the
method. The NdisObjectHeader in the input arg takes the following values,

revision = 1, type = 2, size = 32.

Thanks

> Date: Tue, 1 Feb 2011 08:29:02 -0500
> From: xxxxx@rediffmail.com
> To: xxxxx@lists.osr.com
> Subject: RE:[ntdev] Wmi 's ExecuteWmiMethod error
>
> Anyone who implemented WMI,can you please tell me the steps to test
ExecuteWmimethod by using wbemtest or some other utilities.
>
> Thanks,
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:>

I don’t know how NDIS got onto this thread, but if you *are* populating any NDIS object headers in WMI, I recommend always setting MSNdis_ObjectHeader.Size to 0xFFFF. That way you avoid curious failures when your script is moved to a 64-bit machine.

(Yes, that reveals just how broken it is to have an embedded size field in a WMI block. Don’t worry – NDIS does not actually *trust* that field when validating buffers from usermode; it just inexplicably fails the request if you set Size to an insufficiently large integer.)


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Krishna Jagadish Marisa
Sent: Tuesday, February 01, 2011 9:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Wmi 's ExecuteWmiMethod error

Use WMITools at?http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&displaylang=en
To execute the method, you need to correctly populate the input arg for the method. The NdisObjectHeader in the input arg takes the following values,
revision = 1, type = 2, size = 32.

Thanks

Date: Tue, 1 Feb 2011 08:29:02 -0500
From: xxxxx@rediffmail.com
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] Wmi 's ExecuteWmiMethod error

Anyone who implemented WMI,can you please tell me the steps to test ExecuteWmimethod by using wbemtest or some other utilities.

Thanks,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks for all for your repsonses…
@krishna: as you mentioned , i have installed wmi tools.Btw i am adding wmi interface to storminiport driver.Can you please tell me what tool to use in “wmi tools”…and it will be very helpful if you breif me the steps…

once again thanks for all,

From ‘WMI Tools’, use ‘WMI CIM Studio’. I would suggest you to learn how to
use the WMI CIM Studio (like searching a class, querying a class, executing
a WMI method).

Once you get used with WMI CIM Studio, you can start testing your miniport’s
WMI classes. The storport miniport WMI classes should be available under
“root\WMI” repository.

Regards,
Gokul T V

On Wed, Feb 2, 2011 at 3:48 PM, wrote:

> Thanks for all for your repsonses…
> @krishna: as you mentioned , i have installed wmi tools.Btw i am adding wmi
> interface to storminiport driver.Can you please tell me what tool to use in
> “wmi tools”…and it will be very helpful if you breif me the steps…
>
> once again thanks for all,
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

> Can you please tell me what tool to use in “wmi tools”

WMI code creator:

http://technet.microsoft.com/en-us/magazine/2006.01.utilityspotlight.aspx

http://www.microsoft.com/downloads/en/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en

–pa

On Wed 02 Feb 2011, Jeffrey Tippet wrote:

I don’t know how NDIS got onto this thread, but if you *are* populating any
NDIS object headers in WMI, I recommend always setting
MSNdis_ObjectHeader.Size to 0xFFFF. That way you avoid curious failures when
your script is moved to a 64-bit machine.

(Yes, that reveals just how broken it is to have an embedded size field in a
WMI block. Don’t worry – NDIS does not actually *trust* that field when
validating buffers from usermode; it just inexplicably fails the request if
you set Size to an insufficiently large integer.)

Sensible advice. Do you happen to know why the NDIS WMI methods require
this input parameter ? It seems that it is not a part of the interface
but an artifact of the NDIS driver interface that has leaked out.

AndyM

For a WMI method to succeed, you also need to respond to that GUID in your QueryDataBlock handler. I don’t know if NDIS does that for you.

Thanks for all for your suggestions…Finally, i have used a wmi code creator as mentioned by Pavel and i can successfully test my storminiport driver’s querydatablocks,setdatablocks,execute method and enable/disable event.I felt Wmi code creator is really very simple to use yet robust tool to test WMI.
Pavel,once again thanks for provoiding this tool information.