Windows XP:我可以查找通用驱动程序的名称吗?
我继承了 USB 类兼容的音频驱动程序。它在WinXP、Win7等中运行良好。
我发现在意大利XP机器上(我还没有检查其他语言)它无法运行。我们的安装程序(本质上)具有以下功能:
...
SetupDiGetDeviceRegistryProperty( info, &data, SPDRP_DEVICEDESC, &type, (BYTE *)name, sizeof(name) ;
...
if( 0 == wcsicmp(name, "USB Audio Device") ) {
...
// install our driver
}
因此,如果我们有正确的设备(USB\VID_0a73
)并且安装了通用驱动程序(“USB 音频设备”),那么我们就可以继续安装我们的设备。然而,在意大利机器上,通用名称是“USB 扬声器”。我们的比较失败,我们不安装。在我看来,Windows 一定是从注册表中的某个位置提取了该名称。我可能应该从同一个地方拉出来并与它而不是硬连线字符串进行比较。
我确实在以下内容中看到了该名称:
HKLM\Software\Microsoft\Window NT\CurrentVersion\drivers.desc: wdmaud.drv == USB Speakers
- 是否有更好的方法来检测当前安装的驱动程序是否是通用驱动程序?
- 如果我继续使用此字符串进行比较,注册表中是否有某个位置可以找到通用驱动程序的名称?
I've inherited a USB class compliant audio driver. It works fine in WinXP, Win7, etc.
I find that on an Italian XP machine (I haven't yet checked other languages yet) it fails to run. Our installer has (essentially) this:
...
SetupDiGetDeviceRegistryProperty( info, &data, SPDRP_DEVICEDESC, &type, (BYTE *)name, sizeof(name) ;
...
if( 0 == wcsicmp(name, "USB Audio Device") ) {
...
// install our driver
}
So, if we have the right device (USB\VID_0a73
) and if the generic driver ("USB Audio Device") is installed then we go ahead and install ours. However on the Italian machine the generic name is "USB Speakers". Our comparison fails and we don't install. It seems to me that Windows must be pulling that name from somewhere in the registry. I should probably pull from the same place and compare against that instead of a hardwired string.
I do see that name in:
HKLM\Software\Microsoft\Window NT\CurrentVersion\drivers.desc: wdmaud.drv == USB Speakers
- Is there a better way to detect if the currently installed driver is the generic one?
- If I stay with this string compare is there someplace in the registry to find the name of the generic driver?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
SPDRP_SERVICE
,然后从HKLM\SYSTEM\CurrentControlSet\services\\ImagePath
查找驱动程序You could use
SPDRP_SERVICE
then lookup the driver fromHKLM\SYSTEM\CurrentControlSet\services\<service name>\ImagePath