NetworkInterface (windows): IP_ADAPTER_IPV4_ENABLED #146

Closed
lbakman opened this Issue Apr 8, 2013 · 1 comment

Projects

None yet

2 participants

@lbakman
Contributor
lbakman commented Apr 8, 2013

Check for IP_ADAPTER_IPv4_ENABLED in line 1011:

if defined (IP_ADAPTER_IPV4_ENABLED)

    if (pAddress->Flags & IP_ADAPTER_IPV4_ENABLED) ifIndex = pAddress->IfIndex;

else

It may be appropriate to check for (_WIN32_WINNT >= 0x0600) as well as the flag is only available on Vista and later.

The above check will break if the code is built on Vista and later but run on a Windows versions earlier than that.

@aleks-f aleks-f was assigned Apr 8, 2013
Owner
aleks-f commented Apr 23, 2013

Not according to http://msdn.microsoft.com/en-us/library/windows/desktop/aa366058(v=vs.85).aspx

IfIndex
Type: DWORD
The index of the IPv4 interface with which these addresses are associated. On Windows Server 2003 and
Windows XP, this member is zero if IPv4 is not available on the interface.

EDIT: ah, I see, you are referring to IP_ADAPTER_IPV4_ENABLED

@aleks-f aleks-f added a commit that referenced this issue Apr 23, 2013
@aleks-f aleks-f GH #146: NetworkInterface (windows): IP_ADAPTER_IPV4_ENABLED
- GH #146: NetworkInterface (windows): IP_ADAPTER_IPV4_ENABLED
- added Windows 8 _WIN32_WINNT macro
- removed __cplusplus version check for C++11 (not reliable)
111c2cc
@aleks-f aleks-f closed this Apr 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment