getStringValue method

BSTR getStringValue(
  1. BSTR valueName
)

Throws a WindowsException on failure.

Implementation

BSTR getStringValue(BSTR valueName) {
  final value = adaptiveCalloc<Pointer<Utf16>>();
  final hr$ = HRESULT(_GetStringValueFn(ptr, valueName, value));
  if (hr$.isError) {
    free(value);
    throw WindowsException(hr$);
  }
  final result$ = value.value;
  free(value);
  return BSTR(result$);
}