getSortedEndpointPairs method

Pointer<COMObject> getSortedEndpointPairs(
  1. Pointer<COMObject> destinationList,
  2. int sortOptions
)

Implementation

Pointer<COMObject> getSortedEndpointPairs(
  Pointer<COMObject> destinationList,
  int sortOptions,
) {
  final retValuePtr = calloc<COMObject>();

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

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

  return retValuePtr;
}