Partager via


Services.exe Registry Settings (Windows CE 5.0)

Send Feedback

Upon startup, Services.exe enumerates through all registry subkeys located under the HKEY_LOCAL_MACHINE\Services registry key in the protected registry, 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 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 services.exe. If this value is set to non-zero, command-line parsing is enabled. After this registry value has been set, no restarting is required for services.exe or any services. Services.exe refers to this registry value for every command-line operation. For more information about the command line options, see Using Services.exe from the Command Line.
Note   If AllowCmdLine is set to 0, even a trust application will fail to call CreateProcess on Services.exe with command-line options.

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

Value : type Description
Context : REG_DWORD Initial value passed into the initialization routine.
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 call to xxx_Init (Services.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 trusted process.
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 Services.exe will load each service. The service with the lowest order is loaded first.
Prefix : REG_SZ Prefix of the DLL.

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 (Services.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 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 device.

See Also

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

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.