Completed property

Implementation

Pointer<NativeFunction<AsyncActionCompletedHandler>> get Completed {
  final retValuePtr =
      calloc<Pointer<NativeFunction<AsyncActionCompletedHandler>>>();

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

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

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

Implementation

set Completed(Pointer<NativeFunction<AsyncActionCompletedHandler>> value) {
  final hr =
      ptr.ref.vtable
              .elementAt(6)
              .cast<
                  Pointer<
                      NativeFunction<
                          HRESULT Function(
                              Pointer,
                              Pointer<
                                  NativeFunction<
                                      AsyncActionCompletedHandler>>)>>>()
              .value
              .asFunction<
                  int Function(
                      Pointer,
                      Pointer<
                          NativeFunction<AsyncActionCompletedHandler>>)>()(
          ptr.ref.lpVtbl, value);

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