networkItem property

NetworkItem? get networkItem

Implementation

NetworkItem? get networkItem {
  final retValuePtr = calloc<COMObject>();

  final hr = ptr.ref.vtable
          .elementAt(9)
          .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);
  }

  if (retValuePtr.ref.lpVtbl == nullptr) {
    free(retValuePtr);
    return null;
  }

  return NetworkItem.fromRawPointer(retValuePtr);
}