Ref:WMI issue

Hi,

I have a follwing confusion implementing WMI methods in Miniport driver on Windows 2000.

Whenever I execute GetInfo1 method I get error “Generic Error” from the vb script generated by wmimofck.exe utility. I have seen that my ExecMethod is not getting invoked at all. Only QueryWmiDataBlock entry point is getting called.

But if I execute GetInfo2 method, the ExecMethod entry point is getting invoked and hence the method is succeeding.

I am retuning success for all the above 2 mentioned methods from QueryDataBlock().

My Mof file looks like this:

class METHOD_SAMPLE
{
[key, read] string InstanceName;
[read] boolean Active;
[Implemented, Description(“GetInfo1”): amended, WmiMethodId(1)] void GetInfo([in] uint8 MailBox0, [in] uint8 MailBox1, [out] uint8 Box);

[Implemented, Description(“GetInfo2”): amended, WmiMethodId(2)]
void GetInfo2([in] uint8 MailBox0, [out] uint8 Arg2, [out] uint8 Arg3);
};

and my C code in the miniport driver looks like:
MyQueryWmiDataBlock(
IN PVOID Context,
IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
IN ULONG GuidIndex,
IN ULONG InstanceIndex,
IN ULONG InstanceCount,
IN OUT PULONG InstanceLengthArray,
IN ULONG BufferSize,
OUT PUCHAR Buffer
{

switch(GuidIndex) //instance =1;
{
case Method:
size = sizeof(ULONG);
status = SRB_STATUS_DATA_OVERRUN;
if (BufferSize >= size)
{
DbgPrint(“Buffer size correct\n”);
InstanceLengthArray[0] = size;
status = SRB_STATUS_SUCCESS;
}
else
{
BufferSize = size;
}
}
}
}

MyWmiExecuteMethod(…)
{
DbgPrint(“My ExecMethod\N”); ----------> It is not getting invoked for GetInfo1
}

TIA,
Gurpreet


Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.