Windows device database does not seem to scale well.

Discussion in 'Windows Vista Drivers' started by Elliot Leonard, Jul 27, 2004.

  1. Our company has developed some USB sensors. Each sensor has a unique serial number that is reported to the host computer during USB enumeration. It is apparent that Windows remembers the serial number of each device that has ever been plugged into the machine, because Windows behaves differently the first time a given device with a specific serial number is plugged in than on subsequent plug ins of that specific device. We can also see the devices in the Windows database by using the SetupDiGetClassDevs() and SetupDiEnumDeviceInfo() functions to walk thru the device list.

    Our sensors are HID USB devices and we use the default HID drivers from Microsoft to communicate with them. The first time a specific device is plugged into the system, Windows takes awhile adding the device to its database before it is visible to applications. Because we are using the standard HID device driver, the user is not subjected to the Found New Hardware Wizard, but it still can take quite awhile before the device is available to applications(> 2 minutes).

    Usually we can live with a delay the first time a device is plugged in, but it is causing a real problem in our Production department. The Production department has to calibrate each sensor, so a single Windows computer can have several thousand sensors plugged into it over a period of time. Apparently, as the Windows device database has gotten bigger and bigger, the time it takes Windows to add a new sensor to the device database has lengthened, so now Production is slowing down noticeably on calibration.

    We tried to prune the device database by walking thru it with SetupDiGetClassDevs() and then calling SetupDiRemoveDevice() for the devices that correspond to our sensors. This seems to help, but I am not convinced that the Production machines are completely back up to speed. Is there a documented way to clean up the device database?

    We may have to format the hard drives and reinstall Windows, but surely there must be a better way to deal with this problem.
     
    Elliot Leonard, Jul 27, 2004
    #1
    1. Advertisements

  2. There have been several discussions about this and they can be found in the
    archives here or ntdev. Using a Ghost image to restore the machine at the
    end of the day will keep the growth from extending beyond that day.
    Microsoft's design is for Windows to remember all devices that have ever
    been on that machine. Can be a real pain for your needs.

    serial number that is reported to the host computer during USB enumeration.
    It is apparent that Windows remembers the serial number of each device that
    has ever been plugged into the machine, because Windows behaves differently
    the first time a given device with a specific serial number is plugged in
    than on subsequent plug ins of that specific device. We can also see the
    devices in the Windows database by using the SetupDiGetClassDevs() and
    SetupDiEnumDeviceInfo() functions to walk thru the device list.
    Microsoft to communicate with them. The first time a specific device is
    plugged into the system, Windows takes awhile adding the device to its
    database before it is visible to applications. Because we are using the
    standard HID device driver, the user is not subjected to the Found New
    Hardware Wizard, but it still can take quite awhile before the device is
    available to applications(> 2 minutes).
    but it is causing a real problem in our Production department. The
    Production department has to calibrate each sensor, so a single Windows
    computer can have several thousand sensors plugged into it over a period of
    time. Apparently, as the Windows device database has gotten bigger and
    bigger, the time it takes Windows to add a new sensor to the device database
    has lengthened, so now Production is slowing down noticeably on calibration.
    SetupDiGetClassDevs() and then calling SetupDiRemoveDevice() for the devices
    that correspond to our sensors. This seems to help, but I am not convinced
    that the Production machines are completely back up to speed. Is there a
    documented way to clean up the device database?
    there must be a better way to deal with this problem.
     
    David J. Craig, Jul 27, 2004
    #2
    1. Advertisements

  3. Elliot Leonard

    Pavel A. Guest

    Are you talking about build-up of instances due to USB "serial numbers"?
    Without serial numbers, if you connect them to same USB port, new instances won't be created and detection should not take much
    time. There is a registry hack that disables serial number for specific hw id.
    --PA

    during USB enumeration. It is apparent that Windows remembers the serial number of each device that has ever been plugged into
    the machine, because Windows behaves differently the first time a given device with a specific serial number is plugged in than
    on subsequent plug ins of that specific device. We can also see the devices in the Windows database by using the
    SetupDiGetClassDevs() and SetupDiEnumDeviceInfo() functions to walk thru the device list.
    specific device is plugged into the system, Windows takes awhile adding the device to its database before it is visible to
    applications. Because we are using the standard HID device driver, the user is not subjected to the Found New Hardware Wizard,
    but it still can take quite awhile before the device is available to applications(> 2 minutes).
    department. The Production department has to calibrate each sensor, so a single Windows computer can have several thousand
    sensors plugged into it over a period of time. Apparently, as the Windows device database has gotten bigger and bigger, the time
    it takes Windows to add a new sensor to the device database has lengthened, so now Production is slowing down noticeably on
    calibration.
    the devices that correspond to our sensors. This seems to help, but I am not convinced that the Production machines are
    completely back up to speed. Is there a documented way to clean up the device database?
     
    Pavel A., Jul 28, 2004
    #3
  4. In HKLM\SYSTEM\CurrentControlSet\Control\UsbFlags registry key, add a value:

    IgnoreHWSerNumXXXXYYYY=01 (one byte value), where XXXX is hex vendor ID,
    and YYYY is hex device ID. Important to have the value as binary, single
    byte.


    serial number that is reported to the host computer during USB enumeration.
    It is apparent that Windows remembers the serial number of each device that
    has ever been plugged into the machine, because Windows behaves differently
    the first time a given device with a specific serial number is plugged in
    than on subsequent plug ins of that specific device. We can also see the
    devices in the Windows database by using the SetupDiGetClassDevs() and
    SetupDiEnumDeviceInfo() functions to walk thru the device list.
    Microsoft to communicate with them. The first time a specific device is
    plugged into the system, Windows takes awhile adding the device to its
    database before it is visible to applications. Because we are using the
    standard HID device driver, the user is not subjected to the Found New
    Hardware Wizard, but it still can take quite awhile before the device is
    available to applications(> 2 minutes).
    but it is causing a real problem in our Production department. The
    Production department has to calibrate each sensor, so a single Windows
    computer can have several thousand sensors plugged into it over a period of
    time. Apparently, as the Windows device database has gotten bigger and
    bigger, the time it takes Windows to add a new sensor to the device database
    has lengthened, so now Production is slowing down noticeably on calibration.
    SetupDiGetClassDevs() and then calling SetupDiRemoveDevice() for the devices
    that correspond to our sensors. This seems to help, but I am not convinced
    that the Production machines are completely back up to speed. Is there a
    documented way to clean up the device database?
    there must be a better way to deal with this problem.
     
    Alexander Grigoriev, Jul 28, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.