Most services that appear in the HKEY_LOCAL_MACHINE\CurrentControlSet\Services subkey have “Group” keys which are part of a Service Group.
The order of groups in the load ordering group list. This information is stored in the ServiceGroupOrder value in the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
Windows should first load drivers according to the ServiceGroupOrder.
There are also some services that belongs to groups that are not in the ServiceGroupOrder and services that don’t belong to any group (they don’t have registry “Group” keys). Of course, the two kind of services will be loaded after services belonging to groups that are in the ServiceGroupOrder list.
*My question* is that for these two kind of services, who will be loaded first? Or no guaranteed?
Thanks.
That only ordering guarantee is provided by Services and ServiceGroupOrder. That’s the reason they exist. In absence of using the ordering mechanism, there’s no ordering guarantee beyond “those services in no group will be loaded after services that are in a group”… but within the ungrouped services there’s no architectural guarantee.
Peter
OSR
>There are also some services that belongs to groups that are not in the >ServiceGroupOrder
What is a reason to have a group which is not specified in ServiceGroupOrder?
I believe that using groups make sense only to provide particular “priority” in drivers loading.
Igor Sharovar
Hi Peter,
My confusion is that SysInternals LoadOrd tool shows some ungrouped servives before and some after the grouped services(groups that are not in the ServiceGroupOrder). Seems like the order are also not guarannteed. Below is an example. Any suggestions? Thanks.
Group Name
PnP Filter
Network
n/a
PnP Filter
n/a
*n/a means the ungrouped
Looking at LoadOrd’s list again, when listing services in a goup but not in the ServiceGroupOrder and ungrouped services, LoadOrd sorted them by service name, not by group name.
After Boot with “Enable Boot Logging”, the above two kinds of drivers’ load order in C:\Windows\ntbtlog.txt is different with SysInternals LoadOrd, but I also didn’t find any rule on it.
So I think for such two kinds of services, their load orders are not guaranteed. ungrouped service can also be loaded before grouped but not in ServiceGroupOrder one.
Correct me if I am wrong.
Thanks.
Don’t take the output from the “LoadOrd” utility too literally. Who says its even right? It’s just a tool, written by some guy, that reflects the behavior of some specific version(s) of Windows as that guy understood it. The author could misunderstand how Windows works, the code could be wrong, the behavior might be different in different versions of Windows.
Why does this matter, in any case? You want predictable behavior, (and assuming what you’re writing even uses this load ordering and not the PnP discovery mechanism) you put your service in a named group and make sure it appears in ServiceGroupOrder.
Peter
OSR
Thank you Peter,
Actually I have no specific intention for this question. Just curious and want to know some mechanism of the Windows.
Thanks.
-Eric