getSize method

Size getSize()

Implementation

Size getSize() {
  final value = calloc<NativeSize>();

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

    if (FAILED(hr)) throwWindowsException(hr);

    return value.toDart();
  } finally {
    free(value);
  }
}