Share via


Services.exe Registry Settings

Upon startup, Services.exe enumerates through all registry subkeys located under the HKEY_LOCAL_MACHINE\Services registry key, where each subkey represents a service. Services.exe then uses the information located in the subkeys to initialize each service, one at a time, and in the order specified in the registry.

The following table shows the named values.

Value : type Description
Order : REG_DWORD Order in which Services.exe will load each service. The service with the lowest order is loaded first.
Dll : REG_SZ Dynamic-link library (DLL) file to be loaded.
Keep : REG_DWORD If Keep = 0, the DLL will be unloaded immediately after initialization.
Prefix : REG_SZ Prefix of the DLL.
Index : REG_SZ Service index.
DisplayName : REG_SZ Display service name.
Description : REG_SZ Description of display service.
Context : REG_DWORD Initial value passed into the initialization routine.
Flags : REG_DWORD Specifies a set of flags used to modify the behavior of the ActivateService function. The following list shows the valid flags:
  • DEVFLAGS_NONE (0x00000000) No flags defined.
  • DEVLFAGS_NOLOAD (0x00000001) Unload service after call to xxx_Init returns.
  • DEVFLAGS_LOADLIBRARY (0x00000002) Use the LoadLibrary function to load the service DLL.
  • DEVFLAGS_NOLOAD (0x00000008) Do not load the service.

For example, for the Telnet server to start as a service at boot time, the following registry key should be used.

[HKEY_LOCAL_MACHINE\Services\TELNETD]
    "Dll"="TELNETD.DLL"
    "Order"=dword:8
    "Keep"=dword:1
    "Prefix"="TEL"
    "Index"=dword:0
    "Context"=dword:1
    "DisplayName"="Telnet Server"
    "Description"="Services incoming telnet requests"
    "Flags"="dword:0

The Services.exe super server will then call xxx_Init exported from the service .dll file, where xxx is the prefix specified in the registry entry. Upon completion of this task, the super server passes the DWORD value located in the Context registry entry as the only argument to xxx_Init. The service initialization will be complete if xxx_Init returns a non-zero value. If xxx_Init returns a value of zero then the service will automatically be unloaded. After each service has been loaded, Services.exe checks to see if any sockets should be bound to the super services accept thread.

The DisplayName and Description registry values are not currently processed by Services.exe. They are listed in the preceding table as a convention for anyone wanting to write a user interface (UI) to display services running on a Windows CE .NET device.

See Also

Services.exe | Super Services | xxx_Init | Services.exe Functions | ActivateService

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.