title: GetAddrInfoW to get only the global ipv6 address
body: <p>I need only my global IPv6 address and not local link address. I have set ai_flags to AI_ADDRCONFIG as mentioned in <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738519(v=vs.85).aspx" rel="nofollow">msdn</a>. But GetAddrInfoW returns both global and local link addresses. Is there any way i can find out from <code>ADDRINFOW</code> result structure the type of address?</p>
  
  <pre><code> std::wstring whostname = L"hostname";
      ADDRINFOW hints;
          memset(&amp;hints, 0, sizeof(ADDRINFOW));
          hints.ai_family = AF_UNSPEC;      // IPv4 and IPv6
          hints.ai_socktype = SOCK_STREAM;  // TCP only, no UDP
          hints.ai_protocol = IPPROTO_TCP;
          hints.ai_flags = AI_ADDRCONFIG; // Get only global IPv6 address
  
      ADDRINFOW *list = NULL;
      result = GetAddrInfoW(
          whostname.c_str(), 
          NULL,             
          &amp;hints,
          &amp;list
          );
  </code></pre>