网站首页  词典首页

请输入您要查询的函数:

 

术语 getservicekeyname
释义 GetServiceKeyName
语法:
C++
BOOL WINAPI GetServiceKeyName(
__in SC_HANDLE hSCManager,
__in LPCTSTR lpDisplayName,
__out_opt LPTSTR lpServiceName,
__inout LPDWORD lpcchBuffer
);
GetServiceKeyName功能
检索指定的服务服务名称。
参数
hSCManager [in]
阿处理计算机的服务控制管理数据库,由OpenSCManager返回。
lpDisplayName [in]
该服务显示名称。此字符串有256个字符的最大长度。
lpServiceName [指出,可选]
阿一个缓冲区,它接收服务名称的指针。如果函数失败,这个缓冲区将包含一个空字符串。
这个数组的最大大小是4K字节。要确定所需的大小,指定此参数和lpcchBuffer参数0空。该函数将失败,而且GetLastError将返回ERROR_INSUFFICIENT_BUFFER。该lpcchBuffer参数将获得所需的大小。
lpcchBuffer [ in , out ]
一个变量指定的缓冲区大小的指针指向的lpServiceName参数,在TCHARs。当函数返回时,这个参数包含服务的名称大小TCHARs,不包括空终止字符。
如果缓冲区指向lpServiceName太小,无法包含服务名称,功能存储的数据也没有。当函数返回时,lpcchBuffer包含服务名称的大小,不包括NULL结束。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
有两个名字的服务:服务名称和显示名称。服务名称是该服务的注册表中的项名称。显示名称是一个用户友好的名称,在服务控制面板的应用出现,并与使用net start命令。这两个名字都配有CreateService功能,可以与ChangeServiceConfig功能修改。指定的信息服务是一个与在HKEY_LOCAL_MACHINE下的服务同名的关键存储\\系统\\ CurrentControlSet \\ Services \\服务注册表项。
为了服务名称映射到显示的名称,使用GetServiceDisplayName功能。要映射的显示名称,服务名称,使用GetServiceKeyName功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinsvc.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesGetServiceKeyNameW(Unicode)和GetServiceKeyNameA(ANSI)的
参见
GetServiceDisplayName
OpenSCManager
服务函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetServiceKeyName Function
Retrieves the service name of the specified service.
Syntax
C++
BOOL WINAPI GetServiceKeyName(
__in SC_HANDLE hSCManager,
__in LPCTSTR lpDisplayName,
__out_opt LPTSTR lpServiceName,
__inout LPDWORD lpcchBuffer
);
Parameters
hSCManager [in]
A handle to the computer's service control manager database, as returned by OpenSCManager .
lpDisplayName [in]
The service display name. This string has a maximum length of 256 characters.
lpServiceName [out, optional]
A pointer to a buffer that receives the service name. If the function fails, this buffer will contain an empty string.
The maximum size of this array is 4K bytes. To determine the required size, specify NULL for this parameter and 0 for the lpcchBuffer parameter. The function will fail and GetLastError will return ERROR_INSUFFICIENT_BUFFER. The lpcchBuffer parameter will receive the required size.
lpcchBuffer [in, out]
A pointer to variable that specifies the size of the buffer pointed to by the lpServiceName parameter, in TCHARs. When the function returns, this parameter contains the size of the service name, in TCHARs, excluding the null-terminating character.
If the buffer pointed to by lpServiceName is too small to contain the service name, the function stores no data in it. When the function returns, lpcchBuffer contains the size of the service name, excluding the NULL terminator.
Return Value
If the functions succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
There are two names for a service: the service name and the display name. The service name is the name of the service's key in the registry. The display name is a user-friendly name that appears in the Services control panel application, and is used with the NET START command. Both names are specified with the CreateService function and can be modified with the ChangeServiceConfig function. Information specified for a service is stored in a key with the same name as the service name under the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\ServiceName registry key.
To map the service name to the display name, use the GetServiceDisplayName function. To map the display name to the service name, use the GetServiceKeyName function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinsvc.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesGetServiceKeyNameW (Unicode) and GetServiceKeyNameA (ANSI)
See Also
GetServiceDisplayName
OpenSCManager
Service Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683229(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:17:38