网站首页  词典首页

请输入您要查询的函数:

 

术语 deleteservice
释义 DeleteService
语法:
C++
BOOL WINAPI DeleteService(
__in SC_HANDLE hService
);
DeleteService函数
标志着从服务控制管理数据库删除指定的服务。
参数
hService [in]
句柄的服务。这种处理是由OpenService或CreateService函数返回,而且必须有正确的删除访问。有关更多信息,请参阅服务安全和访问权限。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
下面的错误代码可能被设置由服务控制管理器。其他人可能会设置的注册表由服务控制管理器调用的函数。
返回codeDescription
ERROR_ACCESS_DENIEDThe处理不具有删除权限的。
ERROR_INVALID_HANDLEThe指定的句柄无效。
ERROR_SERVICE_MARKED_FOR_DELETEThe指定的服务已标记为删除。
备注
该DeleteService函数标志着从服务控制管理数据库删除服务。该数据库项不删除,直到所有打开的句柄服务已关闭的CloseServiceHandle函数调用,服务没有运行。正在运行的服务被停止了与SERVICE_CONTROL_STOP控制代码调用ControlService函数。如果该服务不能被停止,数据库项被删除时,系统重新启动。
服务控制管理器删除,删除注册表中的服务项及其子项的服务。
实例
有关示例,请参阅删除一个服务。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
参见
CloseServiceHandle
ControlService
CreateService
OpenService
服务函数
服务的安装,删除和枚举
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==DeleteService Function
Marks the specified service for deletion from the service control manager database.
Syntax
C++
BOOL WINAPI DeleteService(
__in SC_HANDLE hService
);
Parameters
hService [in]
A handle to the service. This handle is returned by the OpenService or CreateService function, and it must have the DELETE access right. For more information, see Service Security and Access Rights .
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 may be set by the service control manager. Others may be set by the registry functions that are called by the service control manager.
Return codeDescription
ERROR_ACCESS_DENIEDThe handle does not have the DELETE access right.
ERROR_INVALID_HANDLEThe specified handle is invalid.
ERROR_SERVICE_MARKED_FOR_DELETEThe specified service has already been marked for deletion.

Remarks
The DeleteService function marks a service for deletion from the service control manager database. The database entry is not removed until all open handles to the service have been closed by calls to the CloseServiceHandle function, and the service is not running. A running service is stopped by a call to the ControlService function with the SERVICE_CONTROL_STOP control code. If the service cannot be stopped, the database entry is removed when the system is restarted.
The service control manager deletes the service by deleting the service key and its subkeys from the registry.
Examples
For an example, see Deleting a Service .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinsvc.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
See Also
CloseServiceHandle
ControlService
CreateService
OpenService
Service Functions
Service Installation, Removal, and Enumeration
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682562(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 13:16:14