Share via


Servicesd.exe Registry Settings (Compact 2013)

3/26/2014

Upon startup, servicesd.exe enumerates all registry subkeys located under the HKEY_LOCAL_MACHINE\Services registry key in the protected registry, where each subkey represents a service. Servicesd.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 under the HKEY_LOCAL_MACHINE\Services key.

Value : type

Description

AllowCmdLine : REG_DWORD

Default value is set to 0. Allows the command-line parser to be turned off. If this value is set to 0, command-line parsing is disabled in servicesd.exe. If this value is set to a non-zero value, command-line parsing is enabled. After this registry value has been set, restarting is not required for servicesd.exe or any other services. Servicesd.exe refers to this registry value for every command-line operation.

The following table shows the named values for each service, defined under the HKEY_LOCAL_MACHINE\Services\<Service Name> subkey.

Value : type

Description

Context : REG_DWORD

Warning   Do not set this value, or the service will fail to load.

Description : REG_SZ

Description of display service.

DisplayName : REG_SZ

Display service name.

Dll : REG_SZ

Dynamic-link library (DLL) file to be loaded.

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_UNLOAD (0x00000001): Unload service after the call to xxx_Init (Servicesd.exe) returns.
  • DEVFLAGS_LOADLIBRARY (0x00000002): Use the LoadLibrary function to load the service DLL.
  • DEVFLAGS_NOLOAD (0x00000004): Do not load the service.
  • DEVFLAGS_TRUSTEDCALLERONLY (0x00010000): This service only can be called by a privileged process.
  • DEVFLAGS_NOUNLOAD(0x00000020): Do not allow the service to be unloaded.

Index : REG_SZ

Service index.

Keep : REG_DWORD

If Keep = 0, the DLL will be unloaded immediately after initialization.

Order : REG_DWORD

Order in which servicesd.exe will load each service. The service with the lowest order is loaded first.

Prefix : REG_SZ

Prefix of the DLL.

ServiceContext : REG_DWORD

Initial value passed into the initialization routine.

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
    "ServiceContext"=dword:1
    "DisplayName"="Telnet Server"
    "Description"="Services incoming telnet requests"
    "Flags"="dword:0

The servicesd.exe super server will then call xxx_Init (Servicesd.exe) 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, the service will be automatically unloaded. After each service has been loaded, servicesd.exe checks if any sockets should be bound to the super services accept thread.

The DisplayName and Description registry values are not processed by servicesd.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 Embedded Compact powered device.

See Also

Reference

Servicesd.exe Reference
xxx_Init (Servicesd.exe)
Servicesd.exe Functions
ActivateService

Other Resources

Servicesd.exe