简体   繁体   中英

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

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  
  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM