none
Installing drivers for specific devices RRS feed

  • Question

  • Hi,

    I have been tasked with writing the installation/management of a custom driver my team has produced.  My learing curve through this has been quite steep.  Earlier this morning, I finally got my INF file to actually install the driver.  Though, something still isn't right there.  However, that's an entirely different question which I'll probably ask later.

    The question now is, how can I ensure that my driver will only be installed for a specific device on the system?  It would seem that this is determined from the "Models" section of the INF file for the driver.  If the particular model of hardware spelled out there is found on the system, then install this new driver.  At least, it would seem this way because the DIFxAPI functions don't seem to take any method of differentiating hardware.  They simply act upon driver packages.

    I think this would ordinarily be ok but the catch is, because of the nature of this driver, the potential for it to be mistakenly installed to the wrong device is pretty high (this assumes that understanding is correct).  The driver is a customized miniport driver and is applied to SATA HBAs.  My own dev box has 3 HBAs.  I cannot have this driver installed to any device other than a specific, targeted, device.  Is this possible?  How?

    Thanks,

    Andy

    • Moved by Mike Dos Zhang Wednesday, March 28, 2012 2:02 AM Driver dev and deployment question (From:General Windows Desktop Development Issues)
    Tuesday, March 27, 2012 5:29 PM

Answers

  • Andrew Falanga wrote:
    >
    >The question now is, how can I ensure that my driver will only be installed
    >for a specific device on the system?  It would seem that this is determined
    >from the "Models" section of the INF file for the driver.
     
    Well, yes.  That's the whole purpose of an INF.  When the operating system
    finds that a new device has been reported, it gets a "hardware ID" from the
    bus (for example, PCI\VEN_8086&DEV_1234 or USB\VID_1234&PID_5678).  It then
    searches through all of the INFs it knows about, looking for a match on
    that hardware ID.  It then loads that driver.
     
     
    >I think this would ordinarily be ok but the catch is, because of the
    >nature of this driver, the potential for it to be mistakenly installed
    >to the wrong device is pretty high (this assumes that understanding is
    >correct).  The driver is a customized miniport driver and is applied
    >to SATA HBAs.  My own dev box has 3 HBAs.  I cannot have this driver
    >installed to any device other than a specific, targeted, device.  Is
    >this possible?  How?
     
    Your SATA HBA is probably a PCI device, yes?  Then it has a PCI identifier
    that includes its vendor and device ID.  You need to match those in your
    INF file.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Wednesday, March 28, 2012 4:39 AM

All replies

  • Andrew Falanga wrote:
    >
    >The question now is, how can I ensure that my driver will only be installed
    >for a specific device on the system?  It would seem that this is determined
    >from the "Models" section of the INF file for the driver.
     
    Well, yes.  That's the whole purpose of an INF.  When the operating system
    finds that a new device has been reported, it gets a "hardware ID" from the
    bus (for example, PCI\VEN_8086&DEV_1234 or USB\VID_1234&PID_5678).  It then
    searches through all of the INFs it knows about, looking for a match on
    that hardware ID.  It then loads that driver.
     
     
    >I think this would ordinarily be ok but the catch is, because of the
    >nature of this driver, the potential for it to be mistakenly installed
    >to the wrong device is pretty high (this assumes that understanding is
    >correct).  The driver is a customized miniport driver and is applied
    >to SATA HBAs.  My own dev box has 3 HBAs.  I cannot have this driver
    >installed to any device other than a specific, targeted, device.  Is
    >this possible?  How?
     
    Your SATA HBA is probably a PCI device, yes?  Then it has a PCI identifier
    that includes its vendor and device ID.  You need to match those in your
    INF file.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Wednesday, March 28, 2012 4:39 AM
  • Tim,

    Thank you for you reply.  This is quite helpful.  Since posting, I've also learned that I can specify the driver's applicability by using the driver's class code.  In this case, the driver's class code is PCI\CC_010601.  I believe that I can still install the driver for a specific device by using the setup API to match the device to a specific PCI bus number, provided to my manager program.  My plan is to use UpdateDriverForPlugAndPlayDevices() here.

    This seems to have what I need.  The purpose of our driver makes it so that it should be applicable to "all" SATA HBAs that we may encounter.  However, I don't want the driver to install to all HBAs that may be in the system.  Only to a specific one.  I'm hoping that using this approach will negate the alternative which is to find the device, retrieve its Hardware ID and embed that ID in a dynamic INF file unique to each system we install on.  To this end, I have another question, but I believe I shall have to ask a new question rather than ask another one in this thread.

    Thanks,

    Andy

    Thursday, March 29, 2012 3:51 PM