In the attachment you will find a
beta version (There may be some big errors in it so don't rely on it) of the include for the IP Helper API. The lib from the platform SDK (feb'01) is also included.
The IP helper API resides in iphlpapi.dll, which is available in win98+, winNT SP4 and win2k, but the real requirements vary for each function.
This lib includes some very interesting functions to get information about the network adapters and interfaces, some IP and TCP/UDP settings, and more.
I converted the most used structures mentioned in
tcpip.chm (helpfile for the lib, included in the platform sdk) to their asm equivalents and wrote a little test program.
The program displays all network adapters and their settings like IP, gateway, dhcp addresses.
Please test this program on your own PC and see if it works... I get the feeling that there's something wrong with the network adapter type and the dhcp information.
The adapter type (Type member of the IP_ADAPTER_STRUCT, which I named uType in the asm version for obvious reasons) is not very well described in the documentation:
1.
The helpfile tcpip.chm from the platform sdk (feb 2001, latest one I could find on FTP) simply states:
[b]Type[/b]
Specifies the adapter type.
That's it, there's nothing said about the meaning of any value.
2.
searching msdn.microsoft.com I found this:
[b]Type[/b]
Specifies the adapter type. The type is one of the following values.
- IF_OTHER_ADAPTERTYPE
- IF_ETHERNET_ADAPTERTYPE
- IF_TOKEN_RING_ADAPTERTYPE
- IF_FDDI_ADAPTERTYPE
- IF_PPP_ADAPTERTYPE
- IF_LOOPBACK_ADAPTERTYPE
- IF_SLIP_ADAPTERTYPE
These values are defined in the header file IPIfCons.h.
"These values are defined in the header file IPIfCons.h.". Well, they're not. At least not in my version.
I found some constants that looked like these in the form 'ADAPTER_TYPE_*', but there was quite a big list of these and in the above description there aren't that many types.
3.
Searching google for IF_OTHER_ADAPTERTYPE resulted in one link to some visual basic code with Japanese comments

, but at least I could read the whole set of IF_*_ADAPTERTYPE constants. I've added these to the end of my include.
However, on my computer it tells me that I have a SLIP_ADAPTERTYPE adapter, but I'm sure it's an ethernet card so I think these constants are not correct. If anyone has better (correct) results please tell me.
Thomas