Структура QUERY_SERVICE_CONFIG

Type QUERY_SERVICE_CONFIG
    dwServiceType As Long
    dwStartType As Long
    dwErrorControl As Long
    lpBinaryPathName As Long 'String
    lpLoadOrderGroup As Long ' String
    dwTagId As Long
    lpDependencies As Long 'String
    lpServiceStartName As Long 'String
    lpDisplayName As Long  'String
End Type

Структура QUERY_SERVICE_CONFIG используется функцией QueryServiceConfig для возвращения конфигурационной информации об установленной службе

Состав структуры

dwServiceType
Тип службы. Может принимать одно из следующиз значений
SERVICE_FILE_SYSTEM_DRIVERСлужба является драйвером файловой системы
SERVICE_KERNEL_DRIVERСлужба является драйвером устройства
SERVICE_WIN32_OWN_PROCESS As Long = &H10Служба работает как отдельный процесс
SERVICE_WIN32_SHARE_PROCESS As Long = &H20Служба работает вместе с другими сервисами в рамках одного и того же процесса
dwStartType
Когда запускается служба. Может принимать одно из следующих значение
SERVICE_AUTO_STARTСлужба запускается автоматически при загрузке системы
SERVICE_BOOT_STARTСлужба запускается вместе с загрузчиком системы
SERVICE_DEMAND_STARTСлужба запускается, когда процесс вызывает функцию StartService
SERVICE_DISABLEDСлужба не может запуститься
SERVICE_SYSTEM_STARTСлужба запускается с функцией
dwErrorControl
Если возникли ошибки при запуске службы
SERVICE_ERROR_IGNOREThe startup (boot) program logs the error but continues the startup operation
SERVICE_ERROR_NORMALThe startup program logs the error and displays a message box pop-up but continues the startup operation
SERVICE_ERROR_SEVEREThe 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_CRITICALThe 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 ServiceGroupOrder value of the following registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
dwCheckPoint
Это поле должно содержать значение, которое должно периодически увеличиваться при выполнении длительных операций запуска, остановки или продолжения работы после временной остановки. Если выполняются другие операции, в это поле необходимо записать нулевой значение
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 name is the account name in the form of "DomainName\Username", which the service process will be logged on as when it runs. If the account belongs to the built-in domain, ".\Username" can be specified. If this member is NULL, the service is to be logged on as the LocalSystem account. Windows XP: If this member is NT AUTHORITY\LocalService, CreateService uses the LocalService account. If the parameter is NT AUTHORITY\NetworkService, CreateService uses the NetworkService 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.

Используется в

QueryServiceCongig