开发者

Windows XP: can I look up the name of a generic driver?

开发者 https://www.devze.com 2023-03-01 23:21 出处:网络
I\'ve inherited a USB class compliant audio driver.It works fine in WinXP, Win7, etc. I find that on an Italian开发者_JS百科 XP machine (I haven\'t yet checked other languages yet) it fails to run.Ou

I've inherited a USB class compliant audio driver. It works fine in WinXP, Win7, etc.

I find that on an Italian开发者_JS百科 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  
  1. Is there a better way to detect if the currently installed driver is the generic one?
  2. If I stay with this string compare is there someplace in the registry to find the name of the generic driver?


You could use SPDRP_SERVICE then lookup the driver from HKLM\SYSTEM\CurrentControlSet\services\<service name>\ImagePath

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号