The result depends on whether your code calls
UpdateDriverForPlugAndPlayDevices or InstallRootEnumeratedDriver. Since you
uninstalled the devnode from the registry, your code didn't find the device
and ended up root-enumerating the driver - which is wrong. You should never
root-enumerate a pnp device.
If you run your app without uninstalling the device, it will find the device
and call UpdateDriverForPlugAndPlayDevices. You should completely remove the
InstallRootEnumeratedDriver code.
I sincerely regret putting the install sample in the Windows 2000 DDK. The
intention was to show people how to install the driver for legacy or
software only WDM drivers. Because of the poor choice of sample name, I see
people misusing it for installing PNP drivers.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx