网站首页  词典首页

请输入您要查询的函数:

 

术语 queryservicelockstatus
释义 QueryServiceLockStatus
语法:
C++
BOOL WINAPI QueryServiceLockStatus(
__in SC_HANDLE hSCManager,
__out_opt LPQUERY_SERVICE_LOCK_STATUS lpLockStatus,
__in DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded
);
QueryServiceLockStatus功能
[此函数有没有Windows Vista的效果。]
检索锁指定的服务控制管理数据库的状态。
参数
hSCManager [in]
一个句柄,服务控制管理数据库。该OpenSCManager函数返回此处理,必须有SC_MANAGER_QUERY_LOCK_STATUS访问权限。有关更多信息,请参阅服务安全和访问权限。
lpLockStatus [指出,可选]
一个 QUERY_SERVICE_LOCK_STATUS结构,收到了指定的数据库锁定状态的指针返回,加上字符串其成员点。
cbBufSize [in]
缓冲区的大小指向的lpLockStatus参数,以字节为单位。
pcbBytesNeeded [out]
一个变量,它接收所需的返回所有锁定状态信息字节数,如果函数失败指针。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
下面的错误代码可以设置由服务控制管理器。其他的错误代码可以设置的注册表由服务控制管理器调用的函数。
返回codeDescription
ERROR_ACCESS_DENIEDThe处理不具备SC_MANAGER_QUERY_LOCK_STATUS访问权限。
ERROR_INSUFFICIENT_BUFFERThere更锁定状态的信息比在放进lpLockStatus缓冲区。所需的获得各种信息的字节数返回在pcbBytesNeeded参数。没有写入lpLockStatus。
ERROR_INVALID_HANDLEThe指定的句柄无效。
备注
该QueryServiceLockStatus函数返回一个QUERY_SERVICE_LOCK_STATUS结构,指示是否指定的数据库被锁定。如果数据库被锁定,该结构提供的用户拥有该锁和时间的锁已被羁押的时间帐户的名称。
阿进程调用LockServiceDatabase函数来获得一个服务控制管理数据库锁定功能和UnlockServiceDatabase所有权释放锁。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesQueryServiceLockStatusW(Unicode)和QueryServiceLockStatusA(ANSI)的
参见
LockServiceDatabase
OpenSCManager
QUERY_SERVICE_LOCK_STATUS
服务配置
服务函数
UnlockServiceDatabase
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==QueryServiceLockStatus Function
[This function has no effect as of Windows Vista.]
Retrieves the lock status of the specified service control manager database.
Syntax
C++
BOOL WINAPI QueryServiceLockStatus(
__in SC_HANDLE hSCManager,
__out_opt LPQUERY_SERVICE_LOCK_STATUS lpLockStatus,
__in DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded
);
Parameters
hSCManager [in]
A handle to the service control manager database. The OpenSCManager function returns this handle, which must have the SC_MANAGER_QUERY_LOCK_STATUS access right. For more information, see Service Security and Access Rights .
lpLockStatus [out, optional]
A pointer to a QUERY_SERVICE_LOCK_STATUS structure that receives the lock status of the specified database is returned, plus the strings to which its members point.
cbBufSize [in]
The size of the buffer pointed to by the lpLockStatus parameter, in bytes.
pcbBytesNeeded [out]
A pointer to a variable that receives the number of bytes needed to return all the lock status information, if the function fails.
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. Other error codes 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 SC_MANAGER_QUERY_LOCK_STATUS access right.
ERROR_INSUFFICIENT_BUFFERThere is more lock status information than would fit into the lpLockStatus buffer. The number of bytes required to get all the information is returned in the pcbBytesNeeded parameter. Nothing is written to lpLockStatus.
ERROR_INVALID_HANDLEThe specified handle is invalid.

Remarks
The QueryServiceLockStatus function returns a QUERY_SERVICE_LOCK_STATUS structure that indicates whether the specified database is locked. If the database is locked, the structure provides the account name of the user that owns the lock and the length of time that the lock has been held.
A process calls the LockServiceDatabase function to acquire ownership of a service control manager database lock and the UnlockServiceDatabase function to release the lock.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinsvc.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesQueryServiceLockStatusW (Unicode) and QueryServiceLockStatusA (ANSI)
See Also
LockServiceDatabase
OpenSCManager
QUERY_SERVICE_LOCK_STATUS
Service Configuration
Service Functions
UnlockServiceDatabase
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684938(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:25