[PATCH] iphlpapi: Implement if_nametoindex.

Hans Leidekker hans at codeweavers.com
Wed May 24 07:26:31 CDT 2017


On Wed, 2017-05-24 at 14:17 +0200, Stefan Dösinger wrote:
> > Am 24.05.2017 um 13:37 schrieb Bruno Jesus <00cpxxx at gmail.com>:
> > 
> > Hi, this seems to be the ASCII version of GetAdapterIndex, can't you
> > call getInterfaceIndexByName and avoid the new #include?
> > 
> I’m not sure what you mean by "ASCII version“. getInterfaceIndexByName
> also accepts a const char * rather than a WCHAR *. It seems to be the
> non-Microsoft version of getInterfaceIndexByName though.
> 
> 
> getInterfaceIndexByName is just a wrapper around if_nametoindex. If I
> wrap IPHLP_if_nametoindex to getInterfaceByName I’d simply undo all
> the work getInterfaceByName does (or well, the part where it returns
> ERROR_INVALID_DATA instead of 0. I’m not sure if avoiding the #include
> is worth that. I’ll send a version that does that in a bit, you can
> then sign off on the one you prefer :-)

Why not call ConvertInterfaceNameToLuidA and then ConvertInterfaceLuidToIndex?






More information about the wine-devel mailing list