title: Check if a Windows driver exists for a given Device ID
body: <p>I'm writing a Windows library using C++. This library should be able to check if the device driver of a specific device is installed on the system. So I am searching for a way to check if a driver is installed for a known <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff541237(v=vs.85).aspx" rel="noreferrer">Device ID</a>.</p>
  
  <p>So far, I found this information:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff550917%28v=vs.85%29.aspx" rel="noreferrer">SetupDiBuildDriverInfoList</a> lists available drivers for given devices. However, I have to supply more than just a Device ID.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff551069(v=vs.85).aspx" rel="noreferrer">SetupDiGetClassDevs</a> seems to return exactly what I need for calling SetupDiBuildDriverInfoList, but it still doesn't take a Device ID as input. It may take a GUID of a device setup/interface class, but if I understand it correctly, a vendor-specific driver does not have such a GUID. It can also take a PnP enumerator, which I don't know enough about to tell whether I can use that somehow. Or finally, it may take a <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff541327(v=vs.85).aspx" rel="noreferrer">Device Instance ID</a> - but not a Device ID.</p>
  
  <p>Obviously, I want to check for any device of the same kind, so querying by Device Instance ID is not feasible. So, the question is: How do I check whether the driver for a given Device ID (or any other information that can identify the device; I assume Device ID is the right thing here) is installed, using the API functions I have listed (or any other way)?</p>