[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Net\0000]
"DriverDesc"="3Com 3C920 Integrated Fast Ethernet Controller (3C905C-TX
Compatible)"
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Net\0001]
"DriverDesc"="3Com EtherLink 10/100 PCI For Complete PC Management NIC
(3C905C-TX)"
The code snippet below produces the following output...
GetAdaptersInfo: idx = 0x01000002; name = []; desc = [3Com EtherLink PCI];
IP = [169.254.195.205]
GetAdaptersInfo: idx = 0x02000003; name = []; desc = [3Com EtherLink PCI];
IP = [192.168.0.144]
GetInterfaceInfo: idx = 0x02000003; name = [??]
GetInterfaceInfo: idx = 0x01000002; name = [??]
Why is the name field of the GetAdaptersInfo always empty string?
Why is the name field of GetInterfaceInfo always "??" (double question
mark)?
What I'd like is a mapping between the index in the IP Helper calls
(0x01000002, 0x02000003) to the index used in the registry ("0000" and
"0001"). The end result would allow me to use the full description from the
registry with the detailed info from GetAdaptersInfo.
- Scott
Code...
{
// GetAdaptersInfo
//
// The GetAdaptersInfo function retrieves adapter information for
the local computer.
ULONG OutBufLen = 0;
DWORD dwRet = GetAdaptersInfo(NULL, &OutBufLen);
PIP_ADAPTER_INFO pAdapterInfo = (PIP_ADAPTER_INFO) new
BYTE[OutBufLen];
dwRet = GetAdaptersInfo(pAdapterInfo, &OutBufLen);
PIP_ADAPTER_INFO pTmp = pAdapterInfo;
while (pTmp)
{
DWORD idx = pTmp->Index;
CString name = pTmp->AdapterName;
CString desc = pTmp->Description;
CString sIP = pTmp->IpAddressList.IpAddress.String;
TRACE("GetAdaptersInfo: idx = 0x%08X; name = [%s]; desc = [%s];
IP = [%s]\n",
idx, name, desc, sIP);
pTmp = pTmp->Next;
}
}
{
// GetInterfaceInfo
//
// The GetInterfaceInfo function obtains a list of the network
interface adapters on the local system.
ULONG dwOutBufLen = 0;
DWORD dwRet = GetInterfaceInfo(NULL, &dwOutBufLen);
PIP_INTERFACE_INFO pIfTable = (PIP_INTERFACE_INFO) new
BYTE[dwOutBufLen];
dwRet = GetInterfaceInfo(pIfTable, &dwOutBufLen);
for (int i = 0; i < pIfTable->NumAdapters; ++i)
{
PIP_ADAPTER_INDEX_MAP pTmp = pIfTable->Adapter + i;
ULONG idx = pTmp->Index;
CString name = pTmp->Name;
TRACE("GetInterfaceInfo: idx = 0x%08X; name = [%s]\n", idx,
name);
}
}
Andrew
"Scott M" <sma...@visto.com> wrote in message
news:uc817.155502$%i7.103...@news1.rdc1.sfba.home.com...