Поделиться через


Services.exe Registry Settings (Windows Embedded CE 6.0)

1/6/2010

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.

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

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 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 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 Services.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 OBEX service to start as a service at boot time, the following registry key should be used.

[HKEY_LOCAL_MACHINE\Services\OBEX]
    "FriendlyName"="OBEX"
    "Dll"="OBEXSrVr.dll"
    "Order"=dword:9
    "Keep"=dword:1
    "Prefix"="OBX"
    "Index"=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 Embedded CE device.

See Also

Reference

xxx_Init (Services.exe)
Services.exe Functions
ActivateService

Concepts

Super Services

Other Resources

Services.exe