none
How to create a HID class installer that updates a device instance registry key when a new instance of the HID is installed RRS feed

  • Question

  • As the title states, I'm looking for information on how to create a HID class installer that updates a device instance registry key when a new instance of the HID device is installed by the operating system (i.e. new instance of the device is plugged in).

    Would such an installer be considered a driver?

    And would it have to be WHQL certified (if so is there any way to accomplish the same without a driver)?

    Wednesday, April 23, 2014 3:30 PM

Answers

  • it is not a driver, it is not something you need whql signed. The toaster sample demonstrates a device coinstaller which is functionally the same as a class coinstaller with the only difference being how it is installed and where in the registry

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Miky Dinescu Wednesday, April 23, 2014 6:42 PM
    Wednesday, April 23, 2014 5:45 PM

All replies

  • it is not a driver, it is not something you need whql signed. The toaster sample demonstrates a device coinstaller which is functionally the same as a class coinstaller with the only difference being how it is installed and where in the registry

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Miky Dinescu Wednesday, April 23, 2014 6:42 PM
    Wednesday, April 23, 2014 5:45 PM
  • Doron - once again, thank you for your time. Since the coinstaller is not a driver, what is needed to "register" the coinstaller so Windows knows about it? Based on what I was able to find, the toaster sample includes information about the coinstaller in the .INF file but since I don't have an INF, is there another way to "register" the coinstaller?
    Wednesday, April 23, 2014 6:53 PM
  • A device coinstaller must be specified in an INF file.  Can you be more specific about what you are trying to do?  What registry key are you talking about when you say "updates a device instance registry key"?  Do you really need to do this for all HID devices or only HID devices installed with a certain driver?

    Thursday, April 24, 2014 10:03 PM
  • Jason,

    What I'm trying to do is turn off the "Enhanced Power Management" features for a certain set of HID devices (identified by VID & PID). These devices don't have a custom driver but use the standard HID driver supplied by Windows. The problem is that starting in Windows 8.1 the enhanced power management causes problems with the device.

    According to the Knowledge Base article #2900614 (support.microsoft.com/kb/2900614), to solve the problem Microsoft recommends disabling the Enhanced Power Management feature for the USB device. We have verified that following those steps manually does correct the problem.

    The actual registry key would look something like this:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_vvvv&PID_pppp\InstID\EnhancedPowerManagement=0

    On a different thread (http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/16026844-1fbe-49fd-812e-0778b8c5ce00/how-to-programatically-disable-enhanced-power-management-for-certain-usb-devices-on-windows-81?forum=wdk) (sorry can't post links yet), Doron Holan recommended creating a CoInstaller so that's how I ended up asking this question.

    What I'm still unclear about is how to create a CoInstaller project (that doesn't necessarily come with a driver). I've tried installing the WDK for Windows 8 and looked at the new project types available but I haven't seen one that matches what I'm trying to do.


    Friday, April 25, 2014 2:41 PM
  • I'm not familiar with the project types in the WDK, so I can't answer which you would use for the CoInstaller.  If you use a device co-installer, you have to create an INF that wraps the inbox driver you are currently using, and adds the co-installer.  This INF should only get installed on your devices and the co-installer would only get run on those devices.  If you cannot go the INF route, you should not use a class installer.  You would want a class co-installer.  That would get run on every new device in that class.  You would have to examine each device going through the co-installer and only modify your devices.  You would have to identify which devices are yours, probably based off the hardware IDs or compatible IDs which you can retrieve using the property APIs.  To modify the registry value, do not try to open that registry key yourself.  There is an API to give you a handle to the appropriate registry key referenced in that KB article.  You should use this API to open the DIREG_DEV key.

    Friday, April 25, 2014 4:11 PM
  • Jason,

    The class co-installer seems to be what I need. Thanks for pointing me to the instructions for registering it.

    Is there an example, or more information on how to create such a class co-installer project?  As far as I understand based on my very limited knowledge on this topic a co-installer is a DLL but based on information I was able to locate by searching online it seems the DLL has certain particular requirements that have to be met, beyond the signature of exported functions, such as the way it is built.

    Also, thank for pointing me to the SetupDIOpenDevRegKey API function for opening the registry key.

    Friday, April 25, 2014 4:41 PM