网站首页  词典首页

请输入您要查询的函数:

 

术语 closeservicehandle
释义 CloseServiceHandle
语法:
C++
BOOL WINAPI CloseServiceHandle(
__in SC_HANDLE hSCObject
);
CloseServiceHandle函数
关闭的句柄服务控制管理或服务对象。
参数
hSCObject [in]
一个句柄,服务控制管理对象或服务对象关闭。处理服务控制管理器对象返回的OpenSCManager功能,并处理对服务对象要么是由OpenService或CreateService函数返回。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
下面的错误代码可以设置由服务控制管理器。其它错误代码,可以设置注册表由服务控制管理器调用的函数。
返回codeDescription
ERROR_INVALID_HANDLEThe指定的句柄无效。
备注
该CloseServiceHandle函数不破坏服务控制管理器对象提到的句柄。服务控制管理器对象不能被破坏。一个服务对象可以通过调用销毁DeleteService函数。
实例
有关示例,请参阅删除一个服务。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
参见
CreateService
DeleteService
OpenSCManager
OpenService
供应链管理拉手
服务函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==CloseServiceHandle Function
Closes a handle to a service control manager or service object.
Syntax
C++
BOOL WINAPI CloseServiceHandle(
__in SC_HANDLE hSCObject
);
Parameters
hSCObject [in]
A handle to the service control manager object or the service object to close. Handles to service control manager objects are returned by the OpenSCManager function, and handles to service objects are returned by either the OpenService or CreateService function.
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 code can be set by the service control manager. Other error codes can be set by registry functions that are called by the service control manager.
Return codeDescription
ERROR_INVALID_HANDLEThe specified handle is invalid.

Remarks
The CloseServiceHandle function does not destroy the service control manager object referred to by the handle. A service control manager object cannot be destroyed. A service object can be destroyed by calling the DeleteService function.
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
CreateService
DeleteService
OpenSCManager
OpenService
SCM Handles
Service Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682028(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:24:12