网站首页  词典首页

请输入您要查询的函数:

 

术语 changeserviceconfig2
释义 ChangeServiceConfig2
语法:
C++
BOOL WINAPI ChangeServiceConfig2(
__in SC_HANDLE hService,
__in DWORD dwInfoLevel,
__in_opt LPVOID lpInfo
);
ChangeServiceConfig2功能
改变了服务的可选配置参数。
参数
hService [in]
句柄的服务。这种处理是由OpenService或CreateService函数返回的,必须有SERVICE_CHANGE_CONFIG访问权限。有关更多信息,请参阅服务安全和访问权限。
如果服务控制器处理SC_ACTION_RESTART行动,hService必须有SERVICE_START访问权限。
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 lpInfo参数是一个一SERVICE_DESCRIPTION结构的指针。
SERVICE_CONFIG_FAILURE_ACTIONS
2The lpInfo参数是一个一SERVICE_FAILURE_ACTIONS结构的指针。
如果服务控制器处理SC_ACTION_REBOOT行动,调用方必须有SE_SHUTDOWN_NAME特权。有关更多信息,请运行特权。
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:此值不支持,直到Windows服务器2008 R2。
lpInfo [中,可选]
阿新的价值指针设置的配置信息。这些数据的格式取决于该dwInfoLevel参数的值。如果此值为NULL,信息保持不变。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该ChangeServiceConfig2功能改变为在服务控制管理数据库中指定的服务可选配置信息。您可以通过使用QueryServiceConfig2函数当前的可选配置信息。
您不能设置为一个服务价值的SERVICE_CONFIG_FAILURE_ACTIONS共用服务控制管理器的进程。这包括所有服务,其可执行图像是“Services.exe中”。
您可以更改和附加的配置信息查询使用ChangeServiceConfig和QueryServiceConfig职能分别。
如果服务被配置为重新启动后,完成了一个错误,服务控制管理器队列行动,重新启动后,会出现在指定的时间延迟。重新排队行动不能被取消。如果该服务是手动重新启动之前停止,然后重新启动行动排队时,将重新启动该服务时意外经过的时间延迟。该服务必须明确禁用,以防止重新启动它。
实例
有关示例,请参阅更改一个服务的配置。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesChangeServiceConfig2W(Unicode)和ChangeServiceConfig2A(ANSI)的
参见
ChangeServiceConfig
CreateService
OpenService
QueryServiceConfig
QueryServiceConfig2
服务配置
服务函数
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日
==英文原文==ChangeServiceConfig2 Function
Changes the optional configuration parameters of a service.
Syntax
C++
BOOL WINAPI ChangeServiceConfig2(
__in SC_HANDLE hService,
__in DWORD dwInfoLevel,
__in_opt LPVOID lpInfo
);
Parameters
hService [in]
A handle to the service. This handle is returned by the OpenService or CreateService function and must have the SERVICE_CHANGE_CONFIG access right. For more information, see Service Security and Access Rights .
If the service controller handles the SC_ACTION_RESTART action, hService must have the SERVICE_START access right.
dwInfoLevel [in]
The configuration information to be changed. 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 lpInfo parameter is a pointer to a SERVICE_DESCRIPTION structure.
SERVICE_CONFIG_FAILURE_ACTIONS
2The lpInfo parameter is a pointer to a SERVICE_FAILURE_ACTIONS structure.
If the service controller handles the SC_ACTION_REBOOT action, the caller must have the SE_SHUTDOWN_NAME privilege . For more information, see Running with Special Privileges .
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 until Windows Server 2008 R2.

lpInfo [in, optional]
A pointer to the new value to be set for the configuration information. The format of this data depends on the value of the dwInfoLevel parameter. If this value is NULL, the information remains unchanged.
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 .
Remarks
The ChangeServiceConfig2 function changes the optional configuration information for the specified service in the service control manager database. You can obtain the current optional configuration information by using the QueryServiceConfig2 function.
You cannot set the SERVICE_CONFIG_FAILURE_ACTIONS value for a service that shares the service control manager's process. This includes all services whose executable image is "Services.exe".
You can change and query additional configuration information using the ChangeServiceConfig and QueryServiceConfig functions, respectively.
If a service is configured to restart after it finishes with an error, the service control manager queues the restart action to occur after the specified time delay. A queued restart action cannot be canceled. If the service is manually restarted and then stopped before the queued restart action occurs, the service will restart unexpectedly when the time delay elapses. The service must be explicitly disabled to prevent it from restarting.
Examples
For an example, see Changing 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 namesChangeServiceConfig2W (Unicode) and ChangeServiceConfig2A (ANSI)
See Also
ChangeServiceConfig
CreateService
OpenService
QueryServiceConfig
QueryServiceConfig2
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/ms681988(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:32:16