deleteAsyncOverloadDefaultOptions method

Future<void> deleteAsyncOverloadDefaultOptions()

Implementation

Future<void> deleteAsyncOverloadDefaultOptions() {
  final retValuePtr = calloc<COMObject>();
  final completer = Completer<void>();

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

  if (FAILED(hr)) {
    free(retValuePtr);
    throw WindowsException(hr);
  }

  final asyncAction = IAsyncAction.fromRawPointer(retValuePtr);
  completeAsyncAction(asyncAction, completer);

  return completer.future;
}