get method

void get(
  1. PCWSTR wszName,
  2. int lFlags,
  3. Pointer<VARIANT> pVal,
  4. Pointer<Int32>? pType,
  5. Pointer<Int32>? plFlavor,
)

Retrieves the specified property value, if it exists.

This method can also return system properties.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/wbemcli/nf-wbemcli-iwbemclassobject-get.

Implementation

@pragma('vm:prefer-inline')
void get(
  PCWSTR wszName,
  int lFlags,
  Pointer<VARIANT> pVal,
  Pointer<Int32>? pType,
  Pointer<Int32>? plFlavor,
) {
  final hr$ = HRESULT(
    _GetFn(ptr, wszName, lFlags, pVal, pType ?? nullptr, plFlavor ?? nullptr),
  );
  if (hr$.isError) throw WindowsException(hr$);
}