title: GetAdapterIndex() return wrong index
body: <p>I want to get adapter index by its name, after couple days of searching I found <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365909%28v=vs.85%29.aspx" rel="nofollow">GetAdapterIndex()</a> function:</p>
  
  <pre><code>#include &lt;winsock2.h&gt;
  #include &lt;iphlpapi.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #pragma comment(lib, "IPHLPAPI.lib")
  
  #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) 
  #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
  
  int main()
  {
      DWORD res;
      DWORD rs;
      ULONG IfIndex;
      LPWSTR AdapterName;
      int i = 0;
      res = GetAdapterIndex(L"AMD PCNET Family PCI Ethernet Adapter - Packet Scheduler Miniport", &amp;IfIndex);
      if(res == NO_ERROR)
          printf("Adapter Index: %ld\n", IfIndex);
  
      res = GetNumberOfInterfaces(&amp;rs);
      if(res == NO_ERROR)
          printf("Number of Adapters: %ld\n", rs);
  return 0;
  }
  </code></pre>
  
  <p><strong>First:</strong> it doesn't return an index for the specific adapter name I chose.
  <strong>Second:</strong> It returns that I have two adapters, even I have just only one.</p>