QUERY_SERVICE_CONFIG
The QUERY_SERVICE_CONFIG structure is used by the QueryServiceConfig function to return configuration information about an installed service.
typedef struct _QUERY_SERVICE_CONFIG {
DWORD dwServiceType;
DWORD dwStartType;
DWORD dwErrorControl;
LPTSTR lpBinaryPathName;
LPTSTR lpLoadOrderGroup;
DWORD dwTagId;
LPTSTR lpDependencies;
LPTSTR lpServiceStartName;
LPTSTR lpDisplayName; } QUERY_SERVICE_CONFIG,
*LPQUERY_SERVICE_CONFIG;
Members
-
dwServiceType
-
Type of service. This member can be one of the following values.
Value Meaning SERVICE_FILE_SYSTEM_DRIVER
0x00000002File system driver service. SERVICE_KERNEL_DRIVER
0x00000001Driver service. SERVICE_WIN32_OWN_PROCESS
0x00000010Service that runs in its own process. SERVICE_WIN32_SHARE_PROCESS
0x00000020Service that shares a process with other services. If the value is SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, the following type may also be specified.
Value Meaning SERVICE_INTERACTIVE_PROCESS
0x00000100The service can interact with the desktop. For more information, see Interactive Services.
dwStartType
-
When to start the service. This member can be one of the following values.
Value Meaning SERVICE_AUTO_START
0x00000002A service started automatically by the service control manager during system startup. SERVICE_BOOT_START
0x00000000A device driver started by the system loader. This value is valid only for driver services. SERVICE_DEMAND_START
0x00000003A service started by the service control manager when a process calls the StartService function. SERVICE_DISABLED
0x00000004A service that cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED. SERVICE_SYSTEM_START
0x00000001A device driver started by the IoInitSystem function. This value is valid only for driver services.
dwErrorControl
-
Severity of the error, and action taken, if this service fails to start. This member can be one of the following values.
Value Meaning SERVICE_ERROR_IGNORE
0x00000000The startup (boot) program logs the error but continues the startup operation. SERVICE_ERROR_NORMAL
0x00000001The startup program logs the error and displays a message box pop-up but continues the startup operation. SERVICE_ERROR_SEVERE
0x00000002The startup program logs the error. If the last-known good configuration is being started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration. SERVICE_ERROR_CRITICAL
0x00000003The startup program logs the error, if possible. If the last-known good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration.
lpBinaryPathName
-
Pointer to a null-terminated string that contains the fully qualified path to the service binary file.
The path can also include arguments for an auto-start service. These arguments are passed to the service entry point (typically the main function).
lpLoadOrderGroup
-
Pointer to a null-terminated string that names the load ordering group to which this service belongs. If the member is NULL or an empty string, the service does not belong to a load ordering group.
The startup program uses load ordering groups to load groups of services in a specified order with respect to the other groups. The list of load ordering groups is contained in the following registry value:
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/ServiceGroupOrder
dwTagId
-
Unique tag value for this service in the group specified by the
lpLoadOrderGroup parameter. A value of zero indicates that the service has not been assigned a tag. You can use a tag for ordering service startup within a load order group by specifying a tag order vector in the registry located at:
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/GroupOrderList
Tags are only evaluated for SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER type services that have SERVICE_BOOT_START or SERVICE_SYSTEM_START start types.
lpDependencies
- Pointer to an array of null-separated names of services or load ordering groups that must start before this service. The array is doubly null-terminated. If the pointer is NULL or if it points to an empty string, the service has no dependencies. If a group name is specified, it must be prefixed by the SC_GROUP_IDENTIFIER (defined in Winsvc.h) character to differentiate it from a service name, because services and service groups share the same name space. Dependency on a service means that this service can only run if the service it depends on is running. Dependency on a group means that this service can run if at least one member of the group is running after an attempt to start all members of the group. lpServiceStartName
-
Pointer to a null-terminated string. If the service type is SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, this is the name of the account that the service process will be logged on as when it runs. This name can be of the form DomainName/Username". If the account belongs to the built-in domain, the name can be of the form "./Username". The name can also be "LocalSystem" if the process is running under the LocalSystem account.
If the service type is SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER, this name is the driver object name (that is, /FileSystem/Rdr or /Driver/Xns) which the input and output (I/O) system uses to load the device driver. If this member is NULL, the driver is to be run with a default object name created by the I/O system, based on the service name.
lpDisplayName
- Pointer to a null-terminated string that specifies the display name to be used by service control programs to identify the service. This string has a maximum length of 256 characters. The name is case-preserved in the service control manager. Display name comparisons are always case-insensitive.
Remarks
The configuration information for a service is initially specified when the service is created by a call to the CreateService function. The information can be modified by calling the ChangeServiceConfig function.
Requirements
Client | Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation. |
---|---|
Server | Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server. |
Header | Declared in Winsvc.h; include Windows.h. |
Unicode | Implemented as QUERY_SERVICE_CONFIGW (Unicode) and QUERY_SERVICE_CONFIGA (ANSI). |