can't delete USB registry items...

From: Daniel Miller (gorlash_at_community.nospam)
Date: 02/22/05


Date: Tue, 22 Feb 2005 14:44:10 -0800

I suspect that this is not quite the correct group for this question.
Unfortunately, it is the only MSDN Managed group which is related to the
DDK, so I'm stuck here; I hope someone from MS will assist me.

My specific issue that I have is this: we have a USB tester which can
operate on 12 USB devices at a time. Typically the user will start with
a raw part which will have vendor/product ID, but no other internal data.
They then perform a low-level format on the part, which assigns a device
serial number and other SCSI data. The problem is this:

Every time a USB device is inserted in a Windows machine, several
registry entries are created... at a minimum, there are:

HLKM:SYSTEM\CurrentControlSet\Enum\USB entries
HLKM:SYSTEM\CurrentControlSet\Enum\USBSTOR entries
HLKM:SYSTEM\CurrentControlSet\Control\DeviceClasses\{deviceClassGUID}
entries

and several others. Each of these is hundreds of bytes in size.

This will create one set of data before the low-level format, and
*another* full set after the format, because the device now is recognized
by its serial number instead of its physical address.

Now, this is all just for ONE device. In a fully-operational production
environment, the user can put 15000 parts/day through the machine.

Just think of what the registry will look like after a week or two of
this, let alone a couple of years... the machine quickly starts slowing
down, and we know that eventually, when the registry gets too bloated,
Windows just stops functioning.

So I need to develop some method of stripping out old registry entries,
once I manage to determine all of the entries that I need to be concerned
about. I tried doing this with the registry management functions,
including either SHDeleteKey or RegDeleteKey, but I have two sets of
problems with this; the first is permissions, the second is that even
after I change the permissions, the delete-key functions still fail,
though I can manually delete the keys using RegEdit.

I've found that reg.exe can even delete these items, at least once I've
changed the permissions for Everyone; is there some way I can either get
source code for reg.exe, or at least find out how it is doing this??

            Dan Miller



Relevant Pages

  • Re: cant delete USB registry items...
    ... I used SHDeleteKey and RegDeleteKey without any problem, ... proper permissions are set for the Enum key. ... >> registry entries are created... ...
    (microsoft.public.development.device.drivers)
  • Re: cant delete USB registry items...
    ... > changed the permissions for Everyone; is there some way I can either get ... > They then perform a low-level format on the part, ... > registry entries are created... ...
    (microsoft.public.development.device.drivers)
  • Re: service pack update 2
    ... I made the two entries as you suggested. ... In the advanced permissions, ... Make the changes to the parent object, and then the object will inherit ... I got the registry backed up, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: cant delete USB registry items...
    ... I used SHDeleteKey on the top-level key, ... > registry entries are created... ... > is that even after I change the permissions, ...
    (microsoft.public.development.device.drivers)
  • Re: Norton Personal Firewall 2003
    ... Most applications do not get rid of all the registry ... entries when you do an uninstall from the control panel applet. ... NPF is trying to make their firewall less ... So i'm using nav on all machines, ...
    (comp.security.firewalls)

Loading