Re: Getting IPv6 address for local interface

Tech-Archive recommends: Fix windows errors by optimizing your registry



Is there a specific reason why you don't use the IP helper API to retrieve
the IPv6 addresses?

Have a nice day
GV


--
Gianluca Varenni, Windows DDK MVP

CACE Technologies
http://www.cacetech.com



"devkats" <devkats@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B21E66FD-9DC8-4A99-B036-AA1E66E6FDEE@xxxxxxxxxxxxxxxx
I am getting a local interface IP address using following code:

IPAddrEntry *ipaddrentry;
TCP_REQUEST_QUERY_INFORMATION_EX req;

req.ID.toi_entity.tei_entity = GENERIC_ENTITY;
req.ID.toi_entity.tei_instance = 0;
req.ID.toi_class = INFO_CLASS_GENERIC;
req.ID.toi_type = INFO_TYPE_PROVIDER;
req.ID.toi_id = IP_MIB_ADDRTABLE_ENTRY_ID;



if( !DeviceIoControl( TCPDriverHandle, // Handle to TCP driver
IOCTL_TCP_QUERY_INFORMATION_EX, // Cmd code
&req, // Pointer to input buffer
sizeof(req), // Size of ipt buffer
ipaddrentry, // Ptr to output buffer
bufferLen, // Size of output buffer
&arrayLen, // Actual size of array
NULL ) )

This code only fetches the IPv4 address. I am looking for a way to
determine:

Whether IPv6 is enabled
If so then get the IPv6 address in the similar way.


.