Windows:没有ComponentId的界面?

问题描述

大家早上好

对于使用C ++开发的应用程序,我需要获取接口的componentId。特别是WireGuard接口(componentId = wintun,它是与官方WireGuard安装程序一起安装的适配器)。通常我是从注册表项中获得的,

HKEY_LOCAL_MACHINE\SYstem\CurrentControlSet\Control\Class\{4d36e972-<other_numbers>0318}\<NUMBER>

<NUMBER>取决于您有多少个接口,通常是四位数,例如0015或0022 ...

在其中,值应为“ ComponentId”,在OpenVPN中应为“ tap0901”,在WireGuard为“ wintun”。

有时我看到我没有ComponentId。我已经在WireGuard上看到过,但问题更笼统:

我们如何拥有一个没有ComponentId的接口?什么时候会发生?如果我没有componentId,我可以依靠哪个值?

解决方法

我在这里找到了解决方法

build 10049 breaks openvpn

基本上,如果您需要“ ComponentId”键,请同时检查“ MatchingDeviceId”