IP address in windows xp

GetUnicastIpAddressTable etc. work in Windows vista and higher but I need a similar function to get ip addresses of the current system in windows xp. How do I achieve this? Please help.
I thought of moving into the registry but its a bit complicated.

iphlpapi.lib: GetAdaptersInfo

GetAdaptersInfo is user level function. How to achieve the same in kernel driver?

I think GetIpAddrTable is available for XP.

Larry C

On Wed, 23 Mar 2011 11:48:09 -0400 (EDT)
xxxxx@honeywell.com wrote:

I think GetIpAddrTable is available for XP.

But that’s a user-mode function. The IP Helper API was introduced for
drivers in Vista. From what I’ve found so far I think on XP you’d need
to listen to the NDIS or TDI events (assuming you have an NDIS or TDI
driver) and get the IP addresses from those.


Bruce Cran

My mistake, yes the IpHelper functions came in with Vista. I looked at my XP NDIS Intermediate driver for XP and it captures OID_GEN_NETWORK_LAYER_ADDRESSES to get the IP addresses dynamically.

Larry C

Can I get IP address of the system directly from the registry? Please suggest.

>

Can I get IP address of the system directly from the registry? Please
suggest.

Well it’s in there. Just set the ip address to something known and
search for the textual representation of it, eg 1.2.3.4

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\In
terfaces<guid of interface> is probably a good place to start.

This may be undocumented though, so if you ask the question “Should I
get IP address of the system directly from the registry?” you might get
a completely different answer.

On the other hand, someone mentioned a supported way to get the IP
address under newer versions of windows so if you are only supporting
legacy operating systems (eg pre-Vista) it should be very unlikely that
Microsoft will change anything on you.

James

The system has many IP addresses in general. Which one do you want? The
address of a specific interface (adapter, RAS link, etc.) or just any
address?

I believe this was just discussed - IP Helper in usermode.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Thursday, March 24, 2011 5:29 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] IP address in windows xp

Can I get IP address of the system directly from the registry? Please
suggest.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

xxxxx@hotmail.com wrote:

Can I get IP address of the system directly from the registry? Please suggest.

It is dangerous to assume that a computer only has one IP address. One
of the machines in our office has three network cards, some of which
handles several private subnets, plus a VPN. I believe it actually has
6 IP addresses. And you can’t really call one of them the “main” IP
address, because it depends on where the data is going.

So, you need to be a little more specific when you go searching.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.