- Remove driver from Registry
- Posted by kvartan@gmail.com on October 31st, 2007
Hi all,
I am working on an inf file that uses a Virtual COM Port to
communicate with my machine. Currently, I am trying to remove the
driver, but uninstalling is not working. Every time I uninstall and
connect the device, it automatically locates the driver and installs
it.
I know/think that there is something to do with the registry files,
but I am not sure where to start looking. I know the VID and PID of
the product, but I don't know where it is installed?
Can anyone tell me how to look, and where to look for those files? In
addition, is there somewhere else that I should be looking into?
My goal is, when I connect the device, I want it to look like it is
the very first time I have attached it to the machine.
Thanks in advance.
- Posted by Don Burn on October 31st, 2007
Is the requirement for removal for testing or for production. If it is for
production you are out of luck, if you just want to do it for testing there
are techniques, but they can potentially cause problems.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
<kvartan@gmail.com> wrote in message
news:1193848321.595831.157170@e9g2000prf.googlegro ups.com...
- Posted by kvartan@gmail.com on November 2nd, 2007
On Oct 31, 4:09 pm, "Don Burn" <b...@stopspam.windrvr.com> wrote:
Thanks Don for your reply. Actually, this is for testing purposes
only and not for production.
- Posted by Don Burn on November 2nd, 2007
<kvartan@gmail.com> wrote in message
Here is my stock answer:
Removing all traces of a driver from a system
When testing a device install developers want to cleanup the system so
they can try reinstalling the device, unfortunately this is something
Microsoft hasn't provided an easy way to do. The steps needed are:
1. Delete the files copied by the INF from the system.
2. Delete the INF and corresponding PNF files for the device, from the
inf directory off of the system root. Note, this file is named OEM*.INF and
OEM*.PNF if your driver is not signed. Searching the OEM*.INF files for
your device identifier will determine the OEM* name of your inf file.
3. If your device has a unique class, delete the registry entry in
HLKM\System\CurrentControlSet\Control\Class corresponding to the device
class you created for device. Note the key is named for the GUID of the
class.
4. If your device has a CoInstaller, delete the registry entry in
HLKM\System\CurrentControlSet\Control\CoDeviceInst allers corresponding to
the device class you created for device. Note the key is named for the GUID
of the class.
5. Delete the registry entries in HLKM\System\CurrentControlSet\Enum
corresponding to the device you specified in the inf file. For PCI devices
this is under the PCI key, for legacy devices this is under the Root key.
Note: if you specify more than one device in the inf, you will have an entry
for each device type the system has seen. DELETING THIS KEY REQUIRES
CHANGING ITS SECURITY FIRST.
6. Delete the registry entry in
HLKM\System\CurrentControlSet\Services corresponding to the driver you
specified in the inf file. Note this is the standard cleanup one would have
done in the pre-PNP days.
7. Reboot the system, now that was easy and intuitive wasn't it.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
- Posted by kvartan@gmail.com on November 2nd, 2007
On Nov 2, 9:38 am, "Don Burn" <b...@stopspam.windrvr.com> wrote:
Thank you very much for the detailed reply. I am going to try it out
and see if I can make it work.
Thanks again.
Vartan
- Posted by chris.aseltine@gmail.com on November 2nd, 2007
On Nov 2, 11:38 am, "Don Burn" <b...@stopspam.windrvr.com> wrote:
This is terrible advice. Not only is CCS\Enum read-only on Vista, but
you're side stepping the device removal process and orphaning any
other side effects from the device installation process.
Example: installing a modem or COM port touches ComDB. By following
your steps, the person's list of allocated COM ports would steadily
increase...
- Posted by Don Burn on November 2nd, 2007
This is why I only said for test, since the number of side effects is huge.
Also, note the OP has never said Vista, I agree that is more painful, of
course unless you are developing a driver for Vista only you are crazy to
start with Vista.
The has worked relatively safely for systems from Windows 2000 thru Windows
2003, and has been repeater many times including by Microsoft support (I
know they asked me permission to duplicate my original posting). It is for
testing, that is why I did not just throw it out at the beginning.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
<chris.aseltine@gmail.com> wrote in message
news:1194032154.423406.214900@50g2000hsm.googlegro ups.com...
- Posted by Maxim S. Shatskih on November 2nd, 2007
For the devices without the unique class, you missed the step of deleting
their PLUGPLAY_REGKEY_DRIVER at
HLKM\System\CurrentControlSet\Control\Class\{Class GUID}\%04d, scan all
integer-named keys and find the one which matches your device.
The Enum subkey is PLUGPLAY_REGKEY_DEVICE.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:eJfRH7WHIHA.1212@TK2MSFTNGP05.phx.gbl...
- Posted by kvartan@gmail.com on November 3rd, 2007
On Nov 2, 1:56 pm, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:
Everyone - thank you very much for all your suggestions and help. As
a matter of fact, I am trying to support operating systems 2000-
Vista. However, my question targeted XP (I apologize for not
mentioning that in my post, but I felt like keeping it OS-free
question).
Nevertheless, Chris' & Don's suggestions both did the trick,
regardless of what harm could've come out of it. So far, the machine
I used is still working and hasn't shown any problems.
My next question is (and I might post it as a new post), when I
connect my device I go through the installation process and that is
fine. As I mentioned before, I am working on a Virtual COM port, so I
attach my device through USB and it appears under Ports and assigns it
a COM port number. Is there a way to make that driver common for all
similar devices? Meaning, if I connect the device using a different
USB port, I have to go through the installation again. As a matter of
fact, I need to do that every time I connect to a different USB port.
What I am looking for is a way to install it only once, and each time
I connect to a different USB port, it would recognize it and
automatically install the device for me.
Much thanks.
- Posted by chris.aseltine@gmail.com on November 3rd, 2007
On Nov 2, 7:29 pm, kvar...@gmail.com wrote:
Implement a USB serial number on your device.
- Posted by Maxim S. Shatskih on November 4th, 2007
Then you must support the unique IDs in your hardware. The software-only
solution for this is hardly feasible.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com