Driver registry parameters

Hi,
This might something very obvious but I can't seem to figure this out.
I know it's possible to add registry parameters for a driver, this path is passed as argument to driver's DriverEntry. This path is

HKEY_LOCAL_MACHINE\SYSTEM\ControlSetXXX\Services\DRIVERNAME

However, I don't know how to access this path in my .inf file. Try as I might all my keys appear in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\001\Parameters

This is how I try to add the keys

[DRIVERNAME.NT]
...
AddReg=DRIVERNAME.AddReg

[DRIVERNAME.AddReg]
...
HKR,Parameters,MyKey,0x00010001,0x2 

The addreg needs to be specified in your service install section.
See: INF AddReg Directive - Windows drivers | Microsoft Learn

1 Like

Thank you for the tip. This worked:

[DRIVERNAME_SA.NT.Services]
AddService=DRIVERNAME,0x00000002,DRIVERNAME_Service_Inst

[DRIVERNAME_Service_Inst]
DisplayName=%DRIVERNAME.SvcDesc%
ServiceType=1
StartType=3
...
AddReg = DRIVERNAME_Service_Inst.AddReg

[DRIVERNAME_Service_Inst.AddReg]
HKR,Parameters,MyValue,0x00010001,0x2