术语 | queryservicestatus |
释义 | QueryServiceStatus 语法: C++ BOOL WINAPI QueryServiceStatus( __in SC_HANDLE hService, __out LPSERVICE_STATUS lpServiceStatus ); QueryServiceStatus函数 检索指定服务的当前状态。 此功能已被取代的QueryServiceStatusEx功能。 QueryServiceStatusEx返回相同的信息QueryServiceStatus的回报,该进程的识别符和服务的其他信息。 参数 hService [in] 句柄的服务。这种处理是由OpenService或CreateService函数返回的,它必须有SERVICE_QUERY_STATUS访问权限。有关更多信息,请参阅服务安全和访问权限。 lpServiceStatus [out] 一个 SERVICE_STATUS结构,收到状态信息的指针。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 下面的错误代码可以设置由服务控制管理器。其他的错误代码可以设置的注册表由服务控制管理器调用的函数。 返回codeDescription ERROR_ACCESS_DENIEDThe处理不具备SERVICE_QUERY_STATUS访问权限。 ERROR_INVALID_HANDLEThe句柄无效。 备注 该QueryServiceStatus函数返回最新的服务状态信息报告给服务控制管理器。如果该服务只是改变了它的地位,它可能没有更新服务控制管理器还。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinsvc.h(头文件:winuser.h) LibraryAdvapi32.lib DLLAdvapi32.dll 参见 ControlService CreateService OpenService QueryServiceStatusEx 服务函数 服务启动 SetServiceStatus SERVICE_STATUS 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==QueryServiceStatus Function Retrieves the current status of the specified service. This function has been superseded by the QueryServiceStatusEx function. QueryServiceStatusEx returns the same information QueryServiceStatus returns, with the addition of the process identifier and additional information for the service. Syntax C++ BOOL WINAPI QueryServiceStatus( __in SC_HANDLE hService, __out LPSERVICE_STATUS lpServiceStatus ); Parameters hService [in] A handle to the service. This handle is returned by the OpenService or the CreateService function, and it must have the SERVICE_QUERY_STATUS access right. For more information, see Service Security and Access Rights . lpServiceStatus [out] A pointer to a SERVICE_STATUS structure that receives the status information. 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 SERVICE_QUERY_STATUS access right. ERROR_INVALID_HANDLEThe handle is invalid. Remarks The QueryServiceStatus function returns the most recent service status information reported to the service control manager. If the service just changed its status, it may not have updated the service control manager yet. Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinsvc.h (include Windows.h) LibraryAdvapi32.lib DLLAdvapi32.dll See Also ControlService CreateService OpenService QueryServiceStatusEx Service Functions Service Startup SetServiceStatus SERVICE_STATUS Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms684939(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。