QUERY_SERVICE_CONFIG

博客介绍了QUERY_SERVICE_CONFIG结构,该结构用于QueryServiceConfig函数返回已安装服务的配置信息。服务配置信息在通过CreateService函数创建服务时初始指定,也可通过ChangeServiceConfig函数修改。

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.
ValueMeaning
SERVICE_FILE_SYSTEM_DRIVER
0x00000002
File system driver service.
SERVICE_KERNEL_DRIVER
0x00000001
Driver service.
SERVICE_WIN32_OWN_PROCESS
0x00000010
Service that runs in its own process.
SERVICE_WIN32_SHARE_PROCESS
0x00000020
Service 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.

ValueMeaning
SERVICE_INTERACTIVE_PROCESS
0x00000100
The 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.
ValueMeaning
SERVICE_AUTO_START
0x00000002
A service started automatically by the service control manager during system startup.
SERVICE_BOOT_START
0x00000000
A device driver started by the system loader. This value is valid only for driver services.
SERVICE_DEMAND_START
0x00000003
A service started by the service control manager when a process calls the StartService function.
SERVICE_DISABLED
0x00000004
A service that cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED.
SERVICE_SYSTEM_START
0x00000001
A 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.
ValueMeaning
SERVICE_ERROR_IGNORE
0x00000000
The startup (boot) program logs the error but continues the startup operation.
SERVICE_ERROR_NORMAL
0x00000001
The startup program logs the error and displays a message box pop-up but continues the startup operation.
SERVICE_ERROR_SEVERE
0x00000002
The 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
0x00000003
The 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
ClientRequires Windows XP, Windows 2000 Professional, or Windows NT Workstation.
ServerRequires 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).

<think>嗯,用户询问的是QNX系统中qdss_service服务的指南和问题解决方法。用户最近的问题集中在QNX系统开发中的libc、dma和qdss_service服务,看起来ta应该在进行底层系统开发或驱动开发工作。根据引用内容,qdss_service服务应该是高通的专有组件,用来处理芯片级调试跟踪(QTID)。用户没有提供具体的错误现象,所以需要先说明基本功能和使用环境。考虑从这几个角度回答:首先解释qdss_service的基本功能(结合引用3中的调试数据采集逻辑),然后说明配置步骤(需要特别强调权限配置,因为引用1提到过secpol权限控制);接着分析常见问题(服务未启动/权限问题/配置错误等),最后补充调试方法(参考引用2中audio_service的调试流程)。用户可能是遇到了qdss_service无法收集数据的问题,但ta没有明确说明。因此需要在回答中埋入一些排查线索:比如建议先检查服务状态,再看secpol权限,最后用dumper工具验证QTID模块配置是否正确。如果用户后续反馈具体错误现象,可以进一步分析core文件(类似引用2的audio_service崩溃分析流程)。注意到引用3里提到写入vmm设备节点的示例,说明用户可能需要qdss_service和虚拟化相关的监控能力?这个可以补充在应用场景部分。</think> ### QNX `qdss_service` 使用指南与错误解决 `qdss_service` 是QNX中用于管理**Qualcomm Trace and System Diagnostics (QTID)** 的核心服务,主要用于芯片级调试跟踪(如CPU/总线性能分析)。以下是关键使用步骤和常见问题解决方案: --- #### **一、核心功能与依赖** 1. **作用** - 控制高速调试端口(如CoreSight ETM)的数据捕获 - 生成`qdss*.bin`跟踪文件(路径:`/dev/qdss/*`)[^1][^2] - 依赖芯片调试模块(需BSP启用QTID支持) 2. **依赖配置** ```bash # 检查服务状态 slay -i qdss_service # 停止服务(需root) qdss_service & # 手动启动 # 验证功能 cat /dev/qdss/trace # 检查输出是否非空 ``` --- #### **二、典型使用流程 ```mermaid graph LR A[启动qdss_service] --> B[配置跟踪参数] B --> C[启用目标设备] C --> D[捕获数据到文件] D --> E[解析qdss.bin] ``` 1. **参数配置** 通过写入设备节点控制: ```c int fd = open("/dev/qdss/config", O_WRONLY); write(fd, "ETM_ENABLE=1,OUTPUT_FILE=/data/qdss_trace.bin", 45); close(fd); ``` 2. **数据捕获** ```bash # 触发跟踪(示例) echo "START_CAPTURE" > /dev/qdss/control # 停止后解析文件 qdss_parser -i /data/qdss_trace.bin ``` --- #### **三、常见错误及解决** | **错误现象** | **原因** | **解决方案** | |-------------------|--------------------------|--------------------------------| | `qdss_service`无法启动 | 内核未启用QTID支持 | 确认BSP包含`CONFIG_QTI_DEBUG=true` [^1] | | `/dev/qdss/*`设备不存在 | 服务未加载或权限错误 | 检查`PATH=/sbin:/bin:/usr/sbin:/usr/bin qdss_service -v` | | 捕获文件为空 | 跟踪源未激活 | 验证ETM配置:<br>`echo "ETM_STATUS" > /dev/qdss/query` | | 解析器报`Invalid header` | 文件损坏或版本不兼容 | 更新`qdss_parser`工具版本 | --- #### **四、调试技巧** 1. **日志分析** ```bash slog2info -w | grep qdss_service # 查看服务日志[^1] ``` 2. **GDB调试** (参考引用[2]方法,获取`qdss_service`可执行文件和core文件) ```bash qnx-gdb qdss_service qdss_service.core (gdb) bt full # 检查堆栈 ``` --- #### **五、权限与安全** - **必选权限**: - `PROCMGR_AID_QDSS`(服务进程) - `PROCMGR_AID_DEVICE`(访问`/dev/qdss`) - **配置示例**: ```bash # 在secpol.allow中添加 allow { uid:qdss_service; allow:/dev/qdss/* rw; allow:resmgr_ctrl; # 资源管理器控制 } ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值