在嵌入式Windows XP中的网络接口设置 [英] Network interface settings in embedded Windows XP

查看:210
本文介绍了在嵌入式Windows XP中的网络接口设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们怎样才能获得网络接口名称给出的设备描述(出现在网络连接,即一个对话框)(即字符串出现在设备属性 - >连接方式:文本框中)<? / p>

我们必须这样做在纯C / C ++语言,或通过一些标准的命令行工具(如Netsh的,IPCONFIG ...),或两者​​的组合。

我们不能使用.NET API,因为部署问题(应用程序必须嵌入式没有.NET框架的XP上运行)。

该SDK API GetIfTable和GetIfEntry看起来很有希望,但我们的系统上的所有MIB_IFROW字段填写正确,除wszName之一,剩下的初始化。


解决方案

我可以通过注册表来做到这一点。
使用GetAdaptersInfo(),它给出了一个IP_ADAPTER_INFO输出,走AdapterName字符串。这应该是适配器GUID。对于(IPv4的至少),在HKLM \\系统\\ CurrentControlSet \\控制\\网络{4D36E972-E325-11CE-BFC1-08002BE10318} \\ {* INSERT GUID HERE *} \\连接,该值的名称的应包含友好的网名。

How can we get the network interface name (i.e. the one that appears in the "Network connections" dialog) given the device description (i.e. the string that appears in the "Device Properties -> Connect using:" textbox)?

We must do it in pure C/C++ language, or through some of the standard command line tools (e.g. netsh, ipconfig...), or a combination of both.

We CAN'T use the .NET API, because of deployment problems (the application must run on an XP embedded without .NET Framework).

The SDK API GetIfTable and GetIfEntry seem promising, but on our system all the MIB_IFROW fields are filled correctly, except the "wszName" one, that remains uninitialized.

解决方案

I was able to do this via the registry. Using GetAdaptersInfo(), which gives an IP_ADAPTER_INFO output, take the AdapterName string. This should be a GUID for the adapter. For (ipv4 at least), under HKLM\SYSTEM\CurrentControlSet\Control\Network{4D36E972-E325-11CE-BFC1-08002BE10318}\{*INSERT GUID HERE*}\Connection, the value Name should contain the "friendly" network name.

这篇关于在嵌入式Windows XP中的网络接口设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆