title: Change installed device driver
body: <p>I am trying to change the installed driver for a device using SetupAPI. The driver is already present on the PC, just not currently selected.</p>
  
  <p>More specifically, I am trying undo the installation of a third-party driver for a USB composite device, and install the default windows driver instead.</p>
  
  <p>I already got it <em>almost</em> working like this: First, find the device using</p>
  
  <pre><code>SetupDiGetClassDevs
  SetupDiEnumDeviceInfo
  SetupDiGetDeviceInstanceId
  </code></pre>
  
  <p>to find the device.</p>
  
  <p>Next, find the default USB composite device driver I want to install using</p>
  
  <pre><code>SetupDiBuildDriverInfoList
  SetupDiEnumDriverInfo
  SetupDiGetDriverInfoDetail
  </code></pre>
  
  <p>Once I found the driver, I call</p>
  
  <pre><code>SetupDiSetSelectedDriver
  SetupDiInstallDevice
  </code></pre>
  
  <p>This actually does switch the driver back, as can be observed in device manager. </p>
  
  <p>However, the third party driver put the device into its own group/category, and this change is <em>not</em> undone when using my approach.</p>
  
  <p>Manually selecting the standard USB composite device driver in the device manager <em>does</em> restore the device category back to USB Controllers, which is why I think my driver installation process is incomplete. What might I be missing?</p>