INT EnumHostAliases( |
|
LPCTSTR lpszHostName, |
|
|
LPTSTR *lpszHostAlias, |
|
|
INT nMaxAliases |
|
); |
The EnumHostAliases method returns a list of aliases for
the specified host name or IP address.
Parameters
- lpszHostName
- Pointer to the string that contains the hostname to be
resolved. If a fully qualified domain name is not provided, the
default local domain will be used. This value may also be an IP
address.
- lpszHostAlias
- Pointer to an array of string pointers which specify one or
more host aliases. If the application needs to store these values,
a local copy should be made because they are invalidated when
another host name is resolved.
- nMaxAliases
- The maximum number of aliases in the array. This parameter must
have a value of at least one, or an error will be returned.
Return Value
If the method succeeds, the return value is the number of host
aliases. If the method fails, the return value is DNS_ERROR. To get
extended error information, call GetLastError.
Remarks
The application must never attempt to modify the host aliases or
delete any of the values. This method uses an internal
data structure to store the host information and only one copy of this
structure is allocated per thread. The application must copy any
information it needs before issuing any other function calls.
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csdnsv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
GetHostAddress,
GetHostName
|