> My current workaround is to delay a little and wait until the driver
service appears in the registry.
Maybe CMP_WaitNoPendingInstallEvents() would be of use in this case?
Is there any possible issue with this approach (deleting the devnodes)?
I was under the impression that DIFxAPP does that itself when removing a
driver package if necessary if it does not find another driver suitable for
the DevNode (and it cannot install a ‘null’ driver on it as it does in
Vista). Is this not happening automatically?
Basically I would like to have a completely CLEAN uninstall
Yeah, that would be nice if DIFxAPP would have implemented additional help
for such a thing. My experience (or inexperience with DIFxAPP?) has led me
to solutions that are ‘explicit’ in the cleanup behavior just as you are
doing. Basically, all the steps you mention (remove devices, remove driver
package, remove services, remove files).
I think the tricky part has always been that with PnP devices there is no
direct way to know if a driver service is no longer required. From a
practical stand-point, of course, uninstallers *can* (and do) make
assumptions about this and might do an aggressive cleanup of the services
and driver files and even the device class (if private).
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@staikos.name
Sent: Friday, October 23, 2009 2:51 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Leftovers from DriverPackageUninstall
Hi all,
I am directly using the DIFxAPI functions and did some further experimenting
which got me wondering. Basically I would like to have a completely CLEAN
uninstall, that is (if possible) *nothing* left behind.
Moreover I need to be able to demonstrate this by setting up a “tight” loop
of install-uninstall (with or without devices attached) that can run for a
day. The tests described below are performed on Vistax86 Checked Build.
Currently my “problem” seems to be that sometimes, when installing with
attached devices, DriverPackageInstall returns (successfully) but actually
the drivers have not yet been installed (or completed installing). The
driver service is NOT there yet and of course the driver has not loaded.
Clearly it would not be a good idea to launch an uninstall while the
installation has not been completely finished.
I can only imagine that the PnP manager launches the device installation in
the “background”, after the driver package is installed and runs it
asynchronously.
My current workaround is to delay a little and wait until the driver service
appears in the registry.
Don’t know if there’s a better way, but this seems to do the trick.
If there’s a better way to do this, please share.
I am also having a 2nd question.
As I said I want a clean uninstall and this includes wiping out the
devnodes.
This means essentially doing the equivalent DEVCON FINDALL =MYCLASS (to
locate present and phantom devices) and then doing the equivalent of DEVCON
REMOVE instanceid for each device, and only then calling
DriverPackageUninstall, deleting the driver service and the setup class
registry key (which now contains no subkeys).
Is there any possible issue with this approach (deleting the devnodes)?
I have run it in a loop with windbg attached and there seems to be no issue
or any warning message from the checked build. But then I am not sure I
would get any message even if something was wrong; maybe I have to enable
some named kernel provider and somehow find its TMF files… The
setupapi.dev.log however looks good.
Thanks in advance,
Dimitris
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer