Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Network adapter info on Win98SE

0 views
Skip to first unread message

Scott M

unread,
Jul 5, 2001, 9:08:42 PM7/5/01
to
The registry has rather nice descriptions of my two NICs...

[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);
}
}

Argus

unread,
Jul 18, 2001, 11:48:39 AM7/18/01
to
Hi,
I have been trying these routines as well. MS does not appear to
support the adapter name on Win98. If you take a look at the WinIpCfg you
will problably find that the only information that they are displaying in
there is from AdapterInfor.Description. Sorry I could not be of more help.
In Win2K the adapter name is GUID that you have to use the MPR routines to
change into the real connection name.

Andrew

"Scott M" <sma...@visto.com> wrote in message
news:uc817.155502$%i7.103...@news1.rdc1.sfba.home.com...

0 new messages