getAt method
IPortableDeviceValuesCollection::GetAt method - The GetAt method retrieves an item from the collection by a zero-based index.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/wpd_sdk/iportabledevicevaluescollection-getat.
Implementation
IPortableDeviceValues? getAt(int dwIndex) {
final ppValues = adaptiveCalloc<VTablePointer>();
final hr$ = HRESULT(_GetAtFn(ptr, dwIndex, ppValues));
if (hr$.isError) {
free(ppValues);
throw WindowsException(hr$);
}
final result$ = ppValues.value;
free(ppValues);
if (result$.isNull) return null;
return IPortableDeviceValues(result$);
}