setDisplayStatus method

void setDisplayStatus(
  1. Pointer<COMObject> device,
  2. String status,
  3. DevicePickerDisplayStatusOptions options
)

Implementation

void setDisplayStatus(Pointer<COMObject> device, String status,
    DevicePickerDisplayStatusOptions options) {
  final statusHstring = convertToHString(status);

  final hr = ptr.ref.vtable
          .elementAt(20)
          .cast<
              Pointer<
                  NativeFunction<
                      HRESULT Function(Pointer, Pointer<COMObject> device,
                          IntPtr status, Uint32 options)>>>()
          .value
          .asFunction<
              int Function(Pointer, Pointer<COMObject> device, int status,
                  int options)>()(ptr.ref.lpVtbl,
      device.cast<Pointer<COMObject>>().value, statusHstring, options.value);

  if (FAILED(hr)) throw WindowsException(hr);

  WindowsDeleteString(statusHstring);
}