SafeArrayAddRef function oleaut32

void SafeArrayAddRef(
  1. Pointer<SAFEARRAY> psa,
  2. Pointer<Pointer<NativeType>> ppDataToRelease
)

Increases the pinning reference count of the descriptor for the specified safe array by one, and may increase the pinning reference count of the data for the specified safe array by one if that data was dynamically allocated, as determined by the descriptor of the safe array.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearrayaddref.

Implementation

@pragma('vm:prefer-inline')
void SafeArrayAddRef(Pointer<SAFEARRAY> psa, Pointer<Pointer> ppDataToRelease) {
  final hr$ = HRESULT(_SafeArrayAddRef(psa, ppDataToRelease));
  if (hr$.isError) throw WindowsException(hr$);
}