getResultObject method
Attempts to retrieve an object from a previous semisynchronous call to
IWbemServices.getObject or IWbemServices.execMethod.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/wbemcli/nf-wbemcli-iwbemcallresult-getresultobject.
Implementation
IWbemClassObject? getResultObject(int lTimeout) {
final ppResultObject = adaptiveCalloc<VTablePointer>();
final hr$ = HRESULT(_GetResultObjectFn(ptr, lTimeout, ppResultObject));
if (hr$.isError) {
free(ppResultObject);
throw WindowsException(hr$);
}
final result$ = ppResultObject.value;
free(ppResultObject);
if (result$.isNull) return null;
return .new(result$);
}