Skip to main content

 none
Plug n Play and INF running RRS feed

  • Question

  • So I have a Plug n Play device - a driver.sys and a service.exe. I have an INF installed onto the system before the device has been plugged in, it contains the appropriate device id, and INF script can be seen in a overview at the bottom (probably not useful).

    My question is - what are the steps of the INF load, per device insertion, is there MSDN doc somewhere. I notice the binaries being copied, and service started from the system32 location, on first insertion. But what about device removal, then insertion again. The INF script only seems to runs once, what stops the INF from running again?

    • CopyFiles - to move .sys and service .exe to system32 directory
    • AddService - to start the pnp driver with flags (SPSVCINST_NOCLOBBER_DISPLAYNAME|SPSVCSINST_STARTSERVICE)
    • AddService - to start both the service with flags (SPSVCINST_ASSOCSERVICE)
    • Service_Install: 

    DisplayeName = xxxxxxxxx
    ServiceType    = 0x10
    StartType      = 0x2
    ErrorControl   = 0x1
    LoadOrderGroup = "Base"
    ServiceBinary = xxxxxxxx

    • Driver_Service_Install:

    DisplayName    = xxxxxxxx
    ServiceType    = 0x1
    StartType      = 0x3
    ErrorControl   = 0x1
    ServiceBinary  = xxxxxx
    AddReg         = AAAAA_Reg64

    • AddReg - HKLM, SYSTEM\CurrentControlSet\Services\xxxx, DisplayName, 0x00000000, xxxxxxxxx

    Tuesday, November 12, 2019 3:51 PM

Answers

  • An INF file drives the initial installation of a device driver.  Once the driver is in the system, the various registry settings are already present.  At that point once the IO Manager's plug and play subsystem detects the device, it uses the data already setup.  


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, November 12, 2019 3:57 PM