add_EnumerationCompleted method

int add_EnumerationCompleted(
  1. Pointer<COMObject> handler
)

Implementation

int add_EnumerationCompleted(Pointer<COMObject> handler) {
  final token = calloc<IntPtr>();

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

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

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