The second method is to manually create these values in the following registry location:
- HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<driver name>
|DisplayName||Name of your driver for service list||my_driver|
|ImagePath||Full NT-style path to the driver|
(or just the filename if it lives in system32\drivers).
|Start||How the driver can be started. For testing the recommended value is Demand (3), which indicates that the driver can only be started manually.
The other start values - Boot (0), System (1) and Auto (2) instruct Windows to load the driver at various points during the system startup.
The last value - Disabled (4) - prevents the driver from loading at all.
|Type||The type of service. Basic kernel drivers must have a value of "1" here.||1|
Starting a Driver
Once a driver has been registered as a system-service, it can be loaded (and unloaded) using the Service Control Manager.
StartService API call.
net start my_driver
ControlService API call.
net stop my_driver