deleteAsync method

Pointer<COMObject> deleteAsync(
  1. StorageDeleteOption option
)

Implementation

Pointer<COMObject> deleteAsync(StorageDeleteOption option) {
  final retValuePtr = calloc<COMObject>();

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

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

  return retValuePtr;
}