isOfType method

bool isOfType(
  1. StorageItemTypes type
)

Implementation

bool isOfType(StorageItemTypes type) {
  final retValuePtr = calloc<Bool>();

  try {
    final hr =
        ptr.ref.vtable
                .elementAt(15)
                .cast<
                    Pointer<
                        NativeFunction<
                            HRESULT Function(
                                Pointer, Uint32 type, Pointer<Bool>)>>>()
                .value
                .asFunction<int Function(Pointer, int type, Pointer<Bool>)>()(
            ptr.ref.lpVtbl, type.value, retValuePtr);

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

    final retValue = retValuePtr.value;
    return retValue;
  } finally {
    free(retValuePtr);
  }
}