网站首页  词典首页

请输入您要查询的函数:

 

术语 queryserviceconfig2
释义 QueryServiceConfig2
语法:
C++
BOOL WINAPI QueryServiceConfig2(
__in SC_HANDLE hService,
__in DWORD dwInfoLevel,
__out_opt LPBYTE lpBuffer,
__in DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded
);
QueryServiceConfig2功能
检索指定的服务可选配置参数。
参数
hService [in]
句柄的服务。这种处理是由OpenService或CreateService函数返回的,必须有SERVICE_QUERY_CONFIG访问权限。有关更多信息,请参阅服务安全和访问权限。
dwInfoLevel [in]
配置要查询的信息。此参数可以是下列值之一。
ValueMeaning
SERVICE_CONFIG_DELAYED_AUTO_START_INFO
3The lpInfo参数是一个一SERVICE_DELAYED_AUTO_START_INFO结构的指针。
Windows Server 2003和Windows XP/2000操作系统:此值不支持。
SERVICE_CONFIG_DESCRIPTION
1The lpBuffer参数是一个指向SERVICE_DESCRIPTION结构的指针。
SERVICE_CONFIG_FAILURE_ACTIONS
2The lpBuffer参数是一个指向SERVICE_FAILURE_ACTIONS结构的指针。
SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
4The lpInfo参数是一个一SERVICE_FAILURE_ACTIONS_FLAG结构的指针。
Windows Server 2003和Windows XP/2000操作系统:此值不支持。
SERVICE_CONFIG_PREFERRED_NODE
9The lpInfo参数是一个一SERVICE_PREFERRED_NODE_INFO结构的指针。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持。
SERVICE_CONFIG_PRESHUTDOWN_INFO
7The lpInfo参数是一个一SERVICE_PRESHUTDOWN_INFO结构的指针。
Windows Server 2003和Windows XP/2000操作系统:此值不支持。
SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
6The lpInfo参数是一个一SERVICE_REQUIRED_PRIVILEGES_INFO结构的指针。
Windows Server 2003和Windows XP/2000操作系统:此值不支持。
SERVICE_CONFIG_SERVICE_SID_INFO
调取lpInfo参数是一个一SERVICE_SID_INFO结构的指针。
Windows Server 2003和Windows XP/2000操作系统:此值不支持。
SERVICE_CONFIG_TRIGGER_INFO
8The lpInfo参数是一个一SERVICE_TRIGGER_INFO结构的指针。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持。
lpBuffer [指出,可选]
一个缓冲区,接收服务配置信息的指针。这些数据的格式取决于该dwInfoLevel参数的值。
这个数组的最大大小为8K字节。要确定所需的大小,指定此参数和cbBufSize参数0空。函数失败并GetLastError返回ERROR_INSUFFICIENT_BUFFER。在pcbBytesNeeded参数接收所需的大小。
cbBufSize [in]
结构的大小指向的lpBuffer参数,以字节为单位。
pcbBytesNeeded [out]
一个变量,它接收所需的配置信息存储字节数,如果该函数指针与ERROR_INSUFFICIENT_BUFFER失败。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
下面的错误代码可以设置由服务控制管理器。其他可以设置的注册表由服务控制管理器调用的函数。
返回codeDescription
ERROR_ACCESS_DENIEDThe处理不具备SERVICE_QUERY_CONFIG访问权限。
ERROR_INSUFFICIENT_BUFFERThere更适合服务,而不是将到lpBuffer缓冲区的配置信息。所需的获得各种信息的字节数返回在pcbBytesNeeded参数。没有写入lpBuffer。
ERROR_INVALID_HANDLEThe指定的句柄无效。
备注
该QueryServiceConfig2函数返回可选配置信息存储在服务控制管理器指定的服务数据库。您可以通过使用ChangeServiceConfig2函数这个配置信息。
您可以更改和附加的配置信息查询使用ChangeServiceConfig和QueryServiceConfig职能分别。
实例
有关示例,请参阅查询服务的配置。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesQueryServiceConfig2W(Unicode)和QueryServiceConfig2A(ANSI)的
参见
ChangeServiceConfig
ChangeServiceConfig2
CreateService
OpenService
QueryServiceConfig
服务配置
服务函数
SERVICE_DELAYED_AUTO_START_INFO
SERVICE_DESCRIPTION
SERVICE_FAILURE_ACTIONS
SERVICE_FAILURE_ACTIONS_FLAG
SERVICE_PRESHUTDOWN_INFO
SERVICE_REQUIRED_PRIVILEGES_INFO
SERVICE_SID_INFO
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==QueryServiceConfig2 Function
Retrieves the optional configuration parameters of the specified service.
Syntax
C++
BOOL WINAPI QueryServiceConfig2(
__in SC_HANDLE hService,
__in DWORD dwInfoLevel,
__out_opt LPBYTE lpBuffer,
__in DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded
);
Parameters
hService [in]
A handle to the service. This handle is returned by the OpenService or CreateService function and must have the SERVICE_QUERY_CONFIG access right. For more information, see Service Security and Access Rights .
dwInfoLevel [in]
The configuration information to be queried. This parameter can be one of the following values.
ValueMeaning
SERVICE_CONFIG_DELAYED_AUTO_START_INFO
3The lpInfo parameter is a pointer to a SERVICE_DELAYED_AUTO_START_INFO structure.
Windows Server 2003 and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_DESCRIPTION
1The lpBuffer parameter is a pointer to a SERVICE_DESCRIPTION structure.
SERVICE_CONFIG_FAILURE_ACTIONS
2The lpBuffer parameter is a pointer to a SERVICE_FAILURE_ACTIONS structure.
SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
4The lpInfo parameter is a pointer to a SERVICE_FAILURE_ACTIONS_FLAG structure.
Windows Server 2003 and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_PREFERRED_NODE
9The lpInfo parameter is a pointer to a SERVICE_PREFERRED_NODE_INFO structure.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_PRESHUTDOWN_INFO
7The lpInfo parameter is a pointer to a SERVICE_PRESHUTDOWN_INFO structure.
Windows Server 2003 and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
6The lpInfo parameter is a pointer to a SERVICE_REQUIRED_PRIVILEGES_INFO structure.
Windows Server 2003 and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_SERVICE_SID_INFO
5The lpInfo parameter is a pointer to a SERVICE_SID_INFO structure.
Windows Server 2003 and Windows XP/2000: This value is not supported.
SERVICE_CONFIG_TRIGGER_INFO
8The lpInfo parameter is a pointer to a SERVICE_TRIGGER_INFO structure.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported.

lpBuffer [out, optional]
A pointer to the buffer that receives the service configuration information. The format of this data depends on the value of the dwInfoLevel parameter.
The maximum size of this array is 8K bytes. To determine the required size, specify NULL for this parameter and 0 for the cbBufSize parameter. The function fails and GetLastError returns ERROR_INSUFFICIENT_BUFFER. The pcbBytesNeeded parameter receives the needed size.
cbBufSize [in]
The size of the structure pointed to by the lpBuffer parameter, in bytes.
pcbBytesNeeded [out]
A pointer to a variable that receives the number of bytes required to store the configuration information, if the function fails with ERROR_INSUFFICIENT_BUFFER.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The following error codes can be set by the service control manager. Others can be set by the registry functions that are called by the service control manager.
Return codeDescription
ERROR_ACCESS_DENIEDThe handle does not have the SERVICE_QUERY_CONFIG access right.
ERROR_INSUFFICIENT_BUFFERThere is more service configuration information than would fit into the lpBuffer buffer. The number of bytes required to get all the information is returned in the pcbBytesNeeded parameter. Nothing is written to lpBuffer.
ERROR_INVALID_HANDLEThe specified handle is invalid.

Remarks
The QueryServiceConfig2 function returns the optional configuration information stored in the service control manager database for the specified service. You can change this configuration information by using the ChangeServiceConfig2 function.
You can change and query additional configuration information using the ChangeServiceConfig and QueryServiceConfig functions, respectively.
Examples
For an example, see Querying a Service's Configuration .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinsvc.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesQueryServiceConfig2W (Unicode) and QueryServiceConfig2A (ANSI)
See Also
ChangeServiceConfig
ChangeServiceConfig2
CreateService
OpenService
QueryServiceConfig
Service Configuration
Service Functions
SERVICE_DELAYED_AUTO_START_INFO
SERVICE_DESCRIPTION
SERVICE_FAILURE_ACTIONS
SERVICE_FAILURE_ACTIONS_FLAG
SERVICE_PRESHUTDOWN_INFO
SERVICE_REQUIRED_PRIVILEGES_INFO
SERVICE_SID_INFO
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684935(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:26:56