Installing/Registering a Driver
There are two ways to register a driver as a system service. The first (and easiest) is to use the CreateService() API which is documented in MSDN. But basically all this does is create a few values in the Registry on your behalf. The second method is to manually create these values however this step is not recommended. In this tutorial we are using a tool that makes our tasks automated. Note that a driver only needs to be registered once (it can only be registered once) - and can be started and stopped as many times as you like after this. Click the Register Service button to register/install the driver.
Starting a Driver
Once a driver has been registered as a system-service, it can be loaded (and unloaded) using the Service Control Manager (SCM). In this tutorial we will use osrloader by clicking the Start Service button.
You can start a driver programmatically using the StartService() API call, but it is far easier to goto the command-prompt and type:
net start hello
The following output will then be displayed:
The hello service was started successfully.
Nothing else will appear to happen though because drivers don't (and can't) output any data to the console. Note that at this point the driver has been loaded into kernel-space and your DriverEntr() function has been executed.
There are several types of the service start as shown below.
Click the Active Services button to verify that our driver has been loaded and running.
Open registry editor (regedt32) and search the hello word.
Next, click Start > all Programs > Accessories > System Tools > System Information