getCategory method

NLM_NETWORK_CATEGORY getCategory()

Returns the category of a network.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/netlistmgr/nf-netlistmgr-inetwork-getcategory.

Implementation

NLM_NETWORK_CATEGORY getCategory() {
  final pCategory = adaptiveCalloc<Int32>();
  final hr$ = HRESULT(_GetCategoryFn(ptr, pCategory));
  if (hr$.isError) {
    free(pCategory);
    throw WindowsException(hr$);
  }
  final result$ = pCategory.value;
  free(pCategory);
  return .new(result$);
}