getDomainType method

NLM_DOMAIN_TYPE getDomainType()

Returns the domain type of the network connection.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/netlistmgr/nf-netlistmgr-inetworkconnection-getdomaintype.

Implementation

NLM_DOMAIN_TYPE getDomainType() {
  final pDomainType = adaptiveCalloc<Int32>();
  final hr$ = HRESULT(_GetDomainTypeFn(ptr, pDomainType));
  if (hr$.isError) {
    free(pDomainType);
    throw WindowsException(hr$);
  }
  final result$ = pDomainType.value;
  free(pDomainType);
  return .new(result$);
}