NetworkInterface on Windows XP #328

micheleselea opened this Issue Nov 13, 2013 · 3 comments


None yet

2 participants


I think there's something wrong with function NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
when checking pAddress->Flags, if you are using poco lib compiled for
win vista and later, on a machine with winxp the function
GetAdaptersAddresses does its job but pAddress->Flags it's not
initialized so even if the network information are extracted correctly,
the code:
if (ifIndex == 0) continue;
will bypass all the networks

I think there's another problem when get subnetmask of an Ipv4 on windows xp because getBroadcastAddress can't get the correct prefix

POCO C++ Libraries member
@aleks-f aleks-f added the wontfix label May 10, 2014
POCO C++ Libraries member

After looking at the patch a bit better, it substitutes the runtime problem with a compile-time one. By moving the code out of #ifdef, compilation will fail on OSes not supporting certain struct members.

Bottom line, if you are using the library on an OS earlier than Vista, compile it there as well. Marking this as WONTFIX and closing.

@aleks-f aleks-f closed this May 10, 2014
@aleks-f aleks-f removed the wontfix label May 10, 2014
POCO C++ Libraries member

OK, I managed to improve this somewhat by enabling available features at compile time and checking for them at runtime. However, building on a newer OS version and running on older is a gamble, especially with XP, Vista and earlier versions - it is recommended to go into Platform_WIN32.h and set the right values (minimum target version is, of course, the safest bet). Fix will be in develop shortly.

@aleks-f aleks-f reopened this May 10, 2014
@aleks-f aleks-f changed the title from NetworkInterface to NetworkInterface on Windows XP May 10, 2014
@aleks-f aleks-f added enhancement and removed wontfix labels May 10, 2014
@aleks-f aleks-f added the fixed label May 10, 2014
@aleks-f aleks-f closed this May 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment