网站首页  词典首页

请输入您要查询的函数:

 

术语 getusernameex
释义 GetUserNameEx
语法:
C++
BOOLEAN WINAPI GetUserNameEx(
__in EXTENDED_NAME_FORMAT NameFormat,
__out LPTSTR lpNameBuffer,
__inout PULONG lpnSize
);
GetUserNameEx功能
检索用户或其他安全主体与调用线程相关的名称。您可以指定返回的名称格式。
若线程模拟客户端,GetUserNameEx返回客户端的名称。
参数
NameFormat [in]
名称的格式。此参数是从EXTENDED_NAME_FORMAT枚举类型值。它不能NameUnknown。如果用户帐户不是在一个域中,只有NameSamCompatible支持。
lpNameBuffer [out]
A到接收缓冲区中指定格式的名称的指针。缓冲区必须包括终止空字符的空间。
lpnSize [ in , out ]
在输入,这个变量指定lpNameBuffer在TCHARs缓冲区的大小。如果函数成功,变量接收到复制到缓冲区TCHARs数目不包括终止空字符。
如果lpNameBuffer太小,函数失败并GetLastError返回ERROR_MORE_DATA。此参数接收所需的缓冲区大小,以Unicode字符(无论是否正在使用的Unicode),包括终止空字符。
如果该参数大于32767更大,函数失败并GetLastError返回ERROR_MORE_DATA。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。可能的值包括以下内容。
返回codeDescription
ERROR_MORE_DATAThe lpNameBuffer缓冲区太小。该lpnSize参数包含所需接受的名称字节数。
ERROR_NO_SUCH_DOMAINThe域控制器不是可用于执行查找
ERROR_NONE_MAPPEDThe用户名不可用指定的格式。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderSecext.h(包括Security.h)
LibrarySecur32.lib
DLLSecur32.dll
Unicode和ANSI namesGetUserNameExW(Unicode)和GetUserNameExA(ANSI)的
参见
EXTENDED_NAME_FORMAT
LookupAccountName
系统信息功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetUserNameEx Function
Retrieves the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name.
If the thread is impersonating a client, GetUserNameEx returns the name of the client.
Syntax
C++
BOOLEAN WINAPI GetUserNameEx(
__in EXTENDED_NAME_FORMAT NameFormat,
__out LPTSTR lpNameBuffer,
__inout PULONG lpnSize
);
Parameters
NameFormat [in]
The format of the name. This parameter is a value from the EXTENDED_NAME_FORMAT enumeration type. It cannot be NameUnknown. If the user account is not in a domain, only NameSamCompatible is supported.
lpNameBuffer [out]
A pointer to a buffer that receives the name in the specified format. The buffer must include space for the terminating null character.
lpnSize [in, out]
On input, this variable specifies the size of the lpNameBuffer buffer, in TCHARs. If the function is successful, the variable receives the number of TCHARs copied to the buffer, not including the terminating null character.
If lpNameBuffer is too small, the function fails and GetLastError returns ERROR_MORE_DATA. This parameter receives the required buffer size, in Unicode characters (whether or not Unicode is being used), including the terminating null character.
If this parameter is greater than 32767, the function fails and GetLastError returns ERROR_MORE_DATA.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError . Possible values include the following.
Return codeDescription
ERROR_MORE_DATAThe lpNameBuffer buffer is too small. The lpnSize parameter contains the number of bytes required to receive the name.
ERROR_NO_SUCH_DOMAINThe domain controller is not available to perform the lookup
ERROR_NONE_MAPPEDThe user name is not available in the specified format.

Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderSecext.h (include Security.h)
LibrarySecur32.lib
DLLSecur32.dll
Unicode and ANSI namesGetUserNameExW (Unicode) and GetUserNameExA (ANSI)
See Also
EXTENDED_NAME_FORMAT
LookupAccountName
System Information Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724435(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:22:27