IsOfType method

bool IsOfType(
  1. int type
)

Implementation

bool IsOfType(int 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, retValuePtr);

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

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