AFAIK, this behavior is due to limitations in how WMI marshals array output parameters from firmware-provided providers, especially when the provider ultimately bridges to ACPI/BIOS code. The ASL method might execute correctly and return a buffer, the WMI infrastructure is failing while converting that returned buffer into the CIM-compliant array type declared in the MOF. The HRESULT 0x8004100f “Invalid object” is a generic failure that often masks a type-mismatch or marshalling error rather than a logic error in the BIOS method itself.
If you change the MOF definition to use a scalar uint64 instead of a uint8 array, this might resolve the problem because scalar values are marshaled directly and do not require SAFEARRAY construction. The ACPI buffer is implicitly coerced into a 64-bit integer by the provider, which WMI can transport without ambiguity.
In practice, the usual workaround is to return a scalar type such as uint64 or string and pack the data manually, or to return a fixed-size structure encoded as multiple scalar outputs. Another approach would be to return a string containing hex-encoded bytes.
Try the following:
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"),
guid("{B66BC8B8-8DE4-4990-B8C8-F73DFF82FF9A}")]
class OemWMIMethodC
{
[key, read] string InstanceName;
[read] boolean Active;
[WmiMethodId(1), Implemented, read, write]
void OemWMIfunC(
[in] uint64 Data,
[out] uint64 PackedOutput
);
};
Method (OWMC, 1, Serialized)
{
Name (BUF0, Buffer (8) {})
Store (0x1122334455667788, BUF0)
Return (BUF0)
}
$inst = Get-CimInstance -Namespace root\wmi -ClassName OemWMIMethodC
$r = Invoke-CimMethod -InputObject $inst -MethodName OemWMIfunC -Arguments @{ Data = 1 }
[BitConverter]::GetBytes($r.PackedOutput)
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin