Hi folks,
I implement ASL code to provide wmi to acpi mapping
based on the sample provided by Microsoft at
http://msdn.microsoft.com/en-us/library/cc526310.aspx.
While it works in general I have a strange issue with returning a
variable length array from acpi method to wmi.
In the mof file “Variable” class is defined and GetVariable methods
should return variable value for specified key in variable length array
class Variable
{
[WmiDataId(1), read, write, Description(“Status”)] uint32 Status = 0;
[WmiDataId(2), read, write, Description(“Key”)] uint32 Key = 0;
[WmiDataId(3), read, write, Description(“DataSize” )] uint32 DataLen = 1;
[WmiDataId(4), read, write, Description(“Data”), WmiSizeIs(“DataLen”)] uint8 Data = {0};
};
class VariableService
{
[key, read] string InstanceName;
[read] boolean Active;
[WmiMethodId(1), Implemented] void GetVariable([in]Variable dIn, [out]Variable dOut);
};
The corresponding ASL method copies data to output buffer and returns
Method(WMBC, 3)
{
…
NAME( OBUF, Buffer([12+DLEN]){} )
CreateDWordField( OBUF, 0, OSTA )
CreateDWordField( OBUF, 4, OKEY )
CreateDWordField( OBUF, 8, ODLN )
CreateField( OBUF,96,[DLEN*8],ODAT )
Store( SSTA, OSTA )
Store( SKEY, OKEY )
Store( DLEN, ODLN )
Store( SDAT, ODAT )
return( OBUF )
}
The method works and returns correct data,
but ASL code gets executed 2 times!!! for one wmi request.
It appears that it depends on DLEN.
If DLEN is 0 then the code works as expected, i.e. it is called only once,
but if DLEN is non-zero then the code is called 2 times.
Is that expected behavior of wmi-acpi mapper or may be I did something wrong?