网站首页  词典首页

请输入您要查询的函数:

 

术语 dnshostnametocomputername
释义 DnsHostnameToComputerName
语法:
C++
BOOL WINAPI DnsHostnameToComputerName(
__in LPCTSTR Hostname,
__out LPTSTR ComputerName,
__inout LPDWORD nSize
);
DnsHostnameToComputerName功能
转换一个DNS式主机名的NetBIOS式计算机的名称。
参数
主机 [in]
DNS名称。如果DNS名称不是一个有效的,翻译的名称,功能失败。有关更多信息,请参见计算机名称。
计算机名[out]
阿一个缓冲区,它接收计算机的名称的指针。缓冲区的大小应该足够大,以遏制MAX_COMPUTERNAME_LENGTH + 1个字符。
nSize [ in , out ]
在输入,指定缓冲区的大小TCHARs。在输出,收到了复制到目标缓冲区TCHARs数目不包括终止空字符。
如果缓冲区太小,函数失败,GetLastError返回ERROR_MORE_DATA,并nSize获得所需的缓冲区大小,不包括终止空字符。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。可能的值包括以下内容。
返回codeDescription
ERROR_MORE_DATAThe计算机名缓冲区太小。该nSize参数包含所需接受的名称字节数。
备注
这个函数的名称文本映射。该公约限制了计算机的名称是共同的名称的一个子集。 (具体来说,在最左边的标签DNS名称被截断为15个字节的OEM字符。)因此,不要使用该函数将DNS域名到NetBIOS域名。没有域名文本映射。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0500或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesDnsHostnameToComputerNameW(Unicode)和DnsHostnameToComputerNameA(ANSI)的
参见
GetComputerNameEx
SetComputerNameEx
系统信息功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==DnsHostnameToComputerName Function
Converts a DNS-style host name to a NetBIOS-style computer name.
Syntax
C++
BOOL WINAPI DnsHostnameToComputerName(
__in LPCTSTR Hostname,
__out LPTSTR ComputerName,
__inout LPDWORD nSize
);
Parameters
Hostname [in]
The DNS name. If the DNS name is not a valid, translatable name, the function fails. For more information, see Computer Names .
ComputerName [out]
A pointer to a buffer that receives the computer name. The buffer size should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1 characters.
nSize [in, out]
On input, specifies the size of the buffer, in TCHARs. On output, receives the number of TCHARs copied to the destination buffer, not including the terminating null character.
If the buffer is too small, the function fails, GetLastError returns ERROR_MORE_DATA, and nSize receives the required buffer size, not including the terminating null character.
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 ComputerName buffer is too small. The nSize parameter contains the number of bytes required to receive the name.

Remarks
This function performs a textual mapping of the name. This convention limits the names of computers to be the common subset of the names. (Specifically, the leftmost label of the DNS name is truncated to 15-bytes of OEM characters.) Therefore, do not use this function to convert a DNS domain name to a NetBIOS domain name. There is no textual mapping for domain names.
To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesDnsHostnameToComputerNameW (Unicode) and DnsHostnameToComputerNameA (ANSI)
See Also
GetComputerNameEx
SetComputerNameEx
System Information Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724244(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:23:05