QueryServiceConfig2
来源:互联网 发布:周冬雨怎么瘦腿的知乎 编辑:程序博客网 时间:2024/06/10 22:14
QueryServiceConfig2
The QueryServiceConfig2 function retrieves the optional configuration parameters of the specified service.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684935(v=vs.85).aspx
<pre style="padding: 5px; margin-top: 0px; margin-bottom: 0px; overflow: auto; word-wrap: normal; font-family: Consolas, Courier, monospace !important; font-size: 14px; line-height: 20px; ">BOOL WINAPI <strong>QueryServiceConfig2</strong>( _In_ SC_HANDLE <strong>hService</strong>, _In_ DWORD <strong>dwInfoLevel</strong>, _Out_opt_ LPBYTE <strong>lpBuffer</strong>, _In_ DWORD <strong>cbBufSize</strong>, _Out_ LPDWORD <strong>pcbBytesNeeded</strong>);
Parameters
- hService
- [in] 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] Configuration information to be queried. This parameter can be one of the following values.
Value Meaning SERVICE_CONFIG_DESCRIPTION
1The lpBuffer parameter is a pointer to aSERVICE_DESCRIPTION structure.SERVICE_CONFIG_FAILURE_ACTIONS
2The lpBuffer parameter is a pointer to aSERVICE_FAILURE_ACTIONS structure. - lpBuffer
- [out] 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 will fail and GetLastError will return ERROR_INSUFFICIENT_BUFFER. The pcbBytesNeeded parameter will receive the required size.
- cbBufSize
- [in] Size of the structure pointed to by the lpBuffer parameter, in bytes.
- pcbBytesNeeded
- [out] Pointer to a variable that receives the number of bytes needed to store the configuration information, if the function fails with ERROR_INSUFFICIENT_BUFFER.
Return Values
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.
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 theChangeServiceConfig2 function.
You can change and query additional configuration information using the ChangeServiceConfig andQueryServiceConfig functions, respectively.
Example Code
For an example, see Querying a Service's Configuration.
Requirements
Declared in Winsvc.h; include Windows.h.
Link to Advapi32.lib.
Implemented as QueryServiceConfig2W (Unicode) and QueryServiceConfig2A (ANSI).
- QueryServiceConfig2
- QueryServiceConfig2
- Android SDK自带draw9patch工具详细教程
- 32位和64位系统区别及int字节数
- Python脚本批量删除特定后缀名的文件
- JS网页高度设置
- python偏函数partial
- QueryServiceConfig2
- Python模块之pexpect
- java设计模式-单例设计模式
- 使用ANT打包Android应用
- Spring设值注入和构造注入的比较
- 算法练习--打印Cantor 数表
- SDUTOJ 2678 5-1 继承与派生
- cocos2d刚体会被穿透
- socket中send和recv函数的阻塞理解