Hi Xavi,
_Przemek, thank you very much for answering me directly_
It's is possible. Just like many other things which still do not exists in MS-Windows and we will have to wait next 10 years until MS discover them and add some support for it in WinSOCK.X.Y.Z which will work correctly in version X.Y.Z + N. There is only one question: Why we should add such things? The fact that sth is possible on some platforms does not mean that it has to be implemented.
[...]
Why you added HB_SOCKET_IFINFO_GATEWAY? What programs do you plan to write which will need such information? How do you know that which gateway belongs to each IP address? It's possible that aliases uses different gateways (at least in normal systems). I do not see any code which tries to bind gateway addresses with IP addresses so HB_SOCKET_IFINFO_GATEWAY contains correct information only when the same gateway is used by all aliases.
I did it to make something new, not important in itself.
MS-Windows does not have interface names as other hosts. AFAIR windows ports of some *nix tools like ifconfing used IP address as interface name so I decided to use the same. You added code which replace this IP addres with "localhost" string for LOOPBACK interfaces. Why?
AFAIK in Windows the adapter name is one GUID exept localhost.
Do you know that it's possible to have more then one LOOPBACK interface with different addresses?
Yes and with the appropriate GUID adapter name.
[...] hb_arrayGetC() returns address to dynamically allocated memory block which should be freed by hb_itemFreeC(). Now this code causes memory leak. Is iphlpapi.dll loaded by application at startup and keep alive for whole application running time?
THANK YOU!!! for test and respond. Yes, I've a pretty hb_out.log report compiling with HB_FM_STATISTICS. Remember what means a draft code. :) You can see the interest of people about it because your sample PRG code and my sample no presents nothing in Windows.
If not then storing pointer to GetAdaptersInfo() in static variable seems to be a little bit risk because such address may change.
I think that this may also happen with the system dlls. Remember my post about this .- http://lists.harbour-project.org/pipermail/harbour/2010-February/032151.html
BTW in which Windows version GetAdaptersInfo() was added? This code does not detect aliases. It has to be redesigned to eliminate them.
Well, what do you suggest? Best regards, Xavi _______________________________________________ Harbour mailing list (attachment size limit: 40KB) [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
