getInt16 method

int getInt16()

Implementation

int getInt16() {
  final retValuePtr = calloc<Int16>();

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

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

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