icemanpro
V2EX  ›  问与答

windows 下 “ethernet_32769” 这样的网卡名称是如何获取的?

  •  
  •   icemanpro · Aug 24, 2020 · 1712 views
    This topic created in 2158 days ago, the information mentioned may be changed or developed.
    2 replies    2020-08-25 23:31:31 +08:00
    icemanpro
        1
    icemanpro  
    OP
       Aug 25, 2020   ❤️ 1
    用 GetAdaptersAddresses 获取到 AdapterAddresses,将 AdapterAddresses->Luid 用 ConvertInterfaceLuidToNameW 转换。

    WCHAR buf[IF_MAX_STRING_SIZE + 1];
    ConvertInterfaceLuidToNameW(&AdapterAddresses->Luid, buf, sizeof(buf)/sizeof(buf[0]));
    DGideas
        2
    DGideas  
       Aug 25, 2020
    感谢分享
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1173 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 18:07 · PVG 02:07 · LAX 11:07 · JFK 14:07
    ♥ Do have faith in what you're doing.