EvtWmiInstanceExecuteMethod OutBufferSize problem



Hello,

I wrote a driver which supports a WMI ExecuteMethod. I wrote a Vbscript
program
to test the method but the OutBufferSize in the EvtWmiInstanceExecuteMethod
is aways 5 which is not big enough for the return data. The method takes
inputs and returns parameters including and array of data.

Why is the OutBufferSize always 5 ? Is there away to tell the Swbemobject
what size I
want the Output buffer to be ? Usually the input buffer is the output buffer
from the
EvtWmiInstanceExecuteMethod point of view but I don't know how SWBemojbect
come up with a OutBuffersSize of 5. What am I doing wrong ?

vbscript and mof below

thanks in advance

--- vbscript

On Error Resume Next
Dim Locator
Dim Service
Dim Collection
Dim InstancePaths()
Dim InstanceCount
Dim CurrentInstanceIndex

Set S = CreateObject("WbemScripting.SWbemNamedValueSet")
Set Locator = CreateObject("WbemScripting.SWbemLocator")
Set Service = Locator.ConnectServer(, "root\wmi")
Service.Security_.ImpersonationLevel=3
Set Collection = Service.InstancesOf ("Microsoft_IPMI")

InstanceCount = 0
Err.Clear
for each Instance in Collection
if Err.Number = 0 Then
InstanceCount = InstanceCount + 1
ReDim Preserve InstancePaths(InstanceCount)
Set ObjectPath = Instance.Path_
InstancePaths(InstanceCount) = ObjectPath.Path
'MsgBox Instance.Path_
Else
MsgBox Err.Description
End If
next 'Instance


Err.Clear
if InstanceCount = 0 Then
MsgBox "No instances available for this class"
Else
CurrentInstanceIndex = 1
Set Instance = Service.Get(InstancePaths(InstanceCount ))
Call RequestResponse
End if



Sub RequestResponse

' Obtain an InParameters object specific to
' the IpmiInterface.RequestResponse method.

Set objInParam = Instance.Methods_("RequestResponse").inParameters

'Wscript.Echo objInParam.Properties_.Count
'Wscript.Echo objInParam.Properties_.item("RequestData").CIMType
'Wscript.Echo objInParam.Properties_.item("RequestData").Name


' Add the input parameters.
' ipmi get device id
objInParam.Properties_.item("NetworkFunction") = 6
objInParam.Properties_.item("Lun") = 0
objInParam.Properties_.item("ResponderAddress") = 32
objInParam.Properties_.item("Command") = 1
objInParam.Properties_.item("RequestDataSize") = 0
objInParam.Properties_.item("RequestData") = Array


' Call RequestResponse
Set objOutParams = Instance.ExecMethod_("RequestResponse", objInParam)
Wscript.Echo objOutParams.ReturnValue
If Error = 0 Then
Wscript.Echo "RequestResponse.Ccode =" _
& objOutParams.CompletionCode
Else
Wscript.Echo "RequestResponse error "
End If
End Sub






--- mof sniplet of method RequestResponse

[Implemented, WmiMethodId(1), Description ("" ) : amended ]
void RequestResponse(

[in,
Description("Network Function for this IPMI request.")
: amended
] uint8 NetworkFunction,

[in,
Description("Logical Unit number to send IPMI request
to") : amended
] uint8 Lun,

[in,
Description("Responder address to send IPMI request
to") : amended
] uint8 ResponderAddress,

[in,
Description("IPMI request command") : amended
] uint8 Command,

[in,
Description("Bytes for IPMI request data") : amended
] uint32 RequestDataSize,

[in,
WmiSizeIs("RequestDataSize"),
Description("IPMI request data") : amended
] uint8 RequestData[],

[out,
Description("Completion code for status of request
response") : amended,
ValueMap { "0","192","193","194","195",
"196","197","198","199","200",
"201","202","203","204","205",
"206","207","208","209","210",
"211","212","213","255",
"1..126","128..190",".." },
Values { "Command Completed Normally",
"Node Busy",
"Invalid Command",
"Command invalid for given LUN",
"Timeout while processing command",
"Out of space",
"Reservation Canceled or Invalid Reservation ID",
"Request data truncated",
"Request data length invalid",
"Request data field length limit exceeded",
"Parameter out of range",
"Cannot return number of requested data bytes",
"Requested Sensor, data, or record not present",
"Invalid data field in Request",
"Command illegal for specified sensor or record type",
"Command response could not be provided",
"Cannot execute duplicated request",
"Command response could not be provided. SDR
Repository in update mode",
"Command response could not be provided. Device in
firmware update mode",
"Command response could not be provided. BMC
initialization or initialization agent in progress",
"Destination unavailable",
"Cannot execute command. Insufficient privilege level",
"Cannot execute command. Command, or request
parameter(s), not supported in present state",
"Unspecified error",
"Device specific (OEM) completion codes",
"Standard command-specific codes",
"reserved" }
] uint8 CompletionCode,

[out,
Description("Bytes for IPMI response data. Completion
code is present in response data size.") : amended
] uint32 ResponseDataSize,

[out,
WmiSizeIs("ResponseDataSize"),
Description("IPMI response data. Completion code is
present in response data.") : amended
] uint8 ResponseData[]
);

--------------------------------




.



Relevant Pages

  • RE: EvtWmiInstanceExecuteMethod OutBufferSize problem
    ... Dim InstanceCount ... Description("Network Function for this IPMI request.") ... Description("IPMI request command"): amended ... "Command response could not be provided", ...
    (microsoft.public.development.device.drivers)
  • Re: Alternatives to Application.DoEvents?
    ... Thanks Charles. ... > Send command to remote serial device on main thread. ... The main thread is blocked until a response is received or there ... Each application request may ...
    (microsoft.public.dotnet.languages.vb)
  • Do I want an ACK in my high-level protocol when using TCP?
    ... command can take anywhere from a few seconds to 10 minutes. ... I create two TCP connections between the applications; a request ... connection and a response connection. ...
    (comp.unix.programmer)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... allow the page to tell ASP.Net "don't send a response yet until I tell ... this request is "leaked" and will never ... It is when the callback executes with both the async function call ... The thread executing code literally calls into Function1, execute code, ...
    (microsoft.public.inetserver.iis)
  • [PATCH] ide-cd: fix some codestyle and most of the checkpatch.pl issues
    ... Generic packet command support and error handling routines. ... -/* Returns 0 if the request should be continued. ... HANDLER is the routine ...
    (Linux-Kernel)