getResources method

Gets an enumerator that iterates through the resources defined in the manifest.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/appxpackaging/nf-appxpackaging-iappxmanifestreader-getresources.

Implementation

IAppxManifestResourcesEnumerator? getResources() {
  final resources = adaptiveCalloc<VTablePointer>();
  final hr$ = HRESULT(_GetResourcesFn(ptr, resources));
  if (hr$.isError) {
    free(resources);
    throw WindowsException(hr$);
  }
  final result$ = resources.value;
  free(resources);
  if (result$.isNull) return null;
  return .new(result$);
}