Delay service loading in the boot process

Hi,
I have a problem regarding how to control when a service is loaded during the boot process.

The problem is that I have some code for a miniport filterdriver. The driver works fine, but I really need
it to be loaded later in the boot process than it is today. I looked at the two .inf files, namely
NomadicVPNFilter.inf and NomadicVPNFilterMP.inf. In NomadicVPNFilterMP.inf I found (among other things)
the following:

[NomadicVPNFilterMP.AddService]
DisplayName = %NomadicVPNFilterMP_Desc%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 3 ;SERVICE_DEMAND_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\nomadicvpnfilter.sys
LoadOrderGroup = PNP_TDI
AddReg = NomadicVPNFilterMP.AddService.AddReg

When I look in the registry I find these values. In addition I read on a Microsoft page that it was possible to
delay the loading of a service by making it dependent of another service, so I tried to add the following line
to make the filter driver load after NetBIOS:

DependOnService = NetBIOS

But this did not work - I never got an entry in the registry called “DependOnService”.
Then I tried to change the “StartType” value from 3 to 2 to see if that change in the .inf-file would take
effect in the registry. But even if I re-installed the service with the new value, the “Start” entry in the
registry still had the value 3.

Does anyone know how to fix this? Is there any other places than in the .inf-files I should look?

In advance, thank you very much for your help.

Best regards,
Kjetil Pedersen

Try “Dependencies” instead of “DependOnService” in the INF file.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

“Kjetil Pedersen” <kjetil.pedersen> wrote in message
news:xxxxx@ntdev…
Hi,
I have a problem regarding how to control when a service is loaded during
the boot process.

The problem is that I have some code for a miniport filterdriver. The driver
works fine, but I really need
it to be loaded later in the boot process than it is today. I looked at the
two .inf files, namely
NomadicVPNFilter.inf and NomadicVPNFilterMP.inf. In NomadicVPNFilterMP.inf I
found (among other things)
the following:

[NomadicVPNFilterMP.AddService]
DisplayName = %NomadicVPNFilterMP_Desc%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 3 ;SERVICE_DEMAND_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\nomadicvpnfilter.sys
LoadOrderGroup = PNP_TDI
AddReg = NomadicVPNFilterMP.AddService.AddReg

When I look in the registry I find these values. In addition I read on a
Microsoft page that it was possible to
delay the loading of a service by making it dependent of another service, so
I tried to add the following line
to make the filter driver load after NetBIOS:

DependOnService = NetBIOS

But this did not work - I never got an entry in the registry called
“DependOnService”.
Then I tried to change the “StartType” value from 3 to 2 to see if that
change in the .inf-file would take
effect in the registry. But even if I re-installed the service with the new
value, the “Start” entry in the
registry still had the value 3.

Does anyone know how to fix this? Is there any other places than in the
.inf-files I should look?

In advance, thank you very much for your help.

Best regards,
Kjetil Pedersen</kjetil.pedersen>

On Tue, 2004-08-03 at 10:07, Kjetil Pedersen wrote:

When I look in the registry I find these values. In addition I read on a Microsoft page that it was possible to
delay the loading of a service by making it dependent of another service

This depends on how the service is loaded. All NDIS miniport drivers
are Start=3, including the miniport edge of IM drivers. In this case,
since the system isn’t loading the driver at all, it won’t matter.

But this did not work - I never got an entry in the registry called “DependOnService”.
Then I tried to change the “StartType” value from 3 to 2 to see if that change in the .inf-file would take
effect in the registry. But even if I re-installed the service with the new value, the “Start” entry in the
registry still had the value 3.

Those are both (probably) due to either the network class installer’s
internal checks or the device manager itself. All NDIS miniport drivers
get installed with a Start of 3, because NDIS starts them.

Does anyone know how to fix this? Is there any other places than in the .inf-files I should look?

Depends on the specific kind of driver. If it’s an NDIS IM driver, you
could do something very ugly and hackish like using a coinstaller to
re-set Start to 4 (disabled), and then having other code that loads “at
the right time” change it to 3 and start it.

But, as usual, there’s a more important question: what are you trying
to do here? Why do you care about changing when NDIS loads you? It’s
usually very good at figuring out when to load its drivers.

-sd