2006-05-09 10:47:06 +02:00
|
|
|
/*
|
|
|
|
* DNS support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Hans Leidekker
|
2021-03-30 10:35:28 +02:00
|
|
|
*
|
2006-05-09 10:47:06 +02:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2006-05-09 10:47:06 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "windns.h"
|
2006-05-31 15:46:58 +02:00
|
|
|
#include "nb30.h"
|
2021-08-03 10:20:21 +02:00
|
|
|
#include "ws2def.h"
|
2006-05-09 10:47:06 +02:00
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
#include "wine/debug.h"
|
2006-05-09 10:47:06 +02:00
|
|
|
#include "dnsapi.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dnsapi);
|
|
|
|
|
2006-05-31 15:46:58 +02:00
|
|
|
#define DEFAULT_TTL 1200
|
|
|
|
|
2021-03-30 10:35:27 +02:00
|
|
|
static DNS_STATUS do_query_netbios( PCSTR name, DNS_RECORDA **recp )
|
2006-05-31 15:46:58 +02:00
|
|
|
{
|
|
|
|
NCB ncb;
|
|
|
|
UCHAR ret;
|
|
|
|
DNS_RRSET rrset;
|
|
|
|
FIND_NAME_BUFFER *buffer;
|
|
|
|
FIND_NAME_HEADER *header;
|
|
|
|
DNS_RECORDA *record = NULL;
|
|
|
|
unsigned int i, len;
|
2006-09-13 14:36:49 +02:00
|
|
|
DNS_STATUS status = ERROR_INVALID_NAME;
|
2006-05-31 15:46:58 +02:00
|
|
|
|
|
|
|
len = strlen( name );
|
|
|
|
if (len >= NCBNAMSZ) return DNS_ERROR_RCODE_NAME_ERROR;
|
|
|
|
|
|
|
|
DNS_RRSET_INIT( rrset );
|
|
|
|
|
|
|
|
memset( &ncb, 0, sizeof(ncb) );
|
|
|
|
ncb.ncb_command = NCBFINDNAME;
|
|
|
|
|
|
|
|
memset( ncb.ncb_callname, ' ', sizeof(ncb.ncb_callname) );
|
|
|
|
memcpy( ncb.ncb_callname, name, len );
|
2006-07-10 22:18:50 +02:00
|
|
|
ncb.ncb_callname[NCBNAMSZ - 1] = '\0';
|
2006-05-31 15:46:58 +02:00
|
|
|
|
|
|
|
ret = Netbios( &ncb );
|
|
|
|
if (ret != NRC_GOODRET) return ERROR_INVALID_NAME;
|
|
|
|
|
|
|
|
header = (FIND_NAME_HEADER *)ncb.ncb_buffer;
|
|
|
|
buffer = (FIND_NAME_BUFFER *)((char *)header + sizeof(FIND_NAME_HEADER));
|
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
for (i = 0; i < header->node_count; i++)
|
2006-05-31 15:46:58 +02:00
|
|
|
{
|
2021-11-02 16:59:59 +01:00
|
|
|
record = calloc( 1, sizeof(DNS_RECORDA) );
|
2006-05-31 15:46:58 +02:00
|
|
|
if (!record)
|
|
|
|
{
|
2006-09-13 14:36:49 +02:00
|
|
|
status = ERROR_NOT_ENOUGH_MEMORY;
|
2006-05-31 15:46:58 +02:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-03-30 10:35:27 +02:00
|
|
|
record->pName = strdup_u( name );
|
2006-05-31 15:46:58 +02:00
|
|
|
if (!record->pName)
|
|
|
|
{
|
2006-09-13 14:36:49 +02:00
|
|
|
status = ERROR_NOT_ENOUGH_MEMORY;
|
2006-05-31 15:46:58 +02:00
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
record->wType = DNS_TYPE_A;
|
|
|
|
record->Flags.S.Section = DnsSectionAnswer;
|
|
|
|
record->Flags.S.CharSet = DnsCharSetUtf8;
|
|
|
|
record->dwTtl = DEFAULT_TTL;
|
|
|
|
|
|
|
|
/* FIXME: network byte order? */
|
|
|
|
record->Data.A.IpAddress = *(DWORD *)((char *)buffer[i].destination_addr + 2);
|
|
|
|
|
|
|
|
DNS_RRSET_ADD( rrset, (DNS_RECORD *)record );
|
|
|
|
}
|
|
|
|
}
|
2007-01-01 12:42:44 +01:00
|
|
|
status = ERROR_SUCCESS;
|
2006-05-31 15:46:58 +02:00
|
|
|
|
|
|
|
exit:
|
|
|
|
DNS_RRSET_TERMINATE( rrset );
|
|
|
|
|
2006-09-13 14:36:49 +02:00
|
|
|
if (status != ERROR_SUCCESS)
|
2006-06-17 15:24:32 +02:00
|
|
|
DnsRecordListFree( rrset.pFirstRR, DnsFreeRecordList );
|
2006-05-31 15:46:58 +02:00
|
|
|
else
|
|
|
|
*recp = (DNS_RECORDA *)rrset.pFirstRR;
|
|
|
|
|
2006-09-13 14:36:49 +02:00
|
|
|
return status;
|
2006-05-31 15:46:58 +02:00
|
|
|
}
|
|
|
|
|
2015-10-30 19:22:50 +01:00
|
|
|
static const char *debugstr_query_request(const DNS_QUERY_REQUEST *req)
|
|
|
|
{
|
|
|
|
if (!req)
|
|
|
|
return "(null)";
|
|
|
|
|
|
|
|
return wine_dbg_sprintf("{%d %s %s %x%08x %p %d %p %p}", req->Version,
|
2021-11-02 12:45:10 +01:00
|
|
|
debugstr_w(req->QueryName), debugstr_type(req->QueryType),
|
2015-10-30 19:22:50 +01:00
|
|
|
(UINT32)(req->QueryOptions>>32u), (UINT32)req->QueryOptions, req->pDnsServerList,
|
|
|
|
req->InterfaceIndex, req->pQueryCompletionCallback, req->pQueryContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DnsQueryEx [DNSAPI.@]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST *request, DNS_QUERY_RESULT *result, DNS_QUERY_CANCEL *cancel)
|
|
|
|
{
|
|
|
|
FIXME("(%s %p %p)\n", debugstr_query_request(request), result, cancel);
|
|
|
|
return DNS_ERROR_RCODE_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2006-05-29 12:47:31 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* DnsQuery_A [DNSAPI.@]
|
|
|
|
*
|
|
|
|
*/
|
2007-08-04 03:20:32 +02:00
|
|
|
DNS_STATUS WINAPI DnsQuery_A( PCSTR name, WORD type, DWORD options, PVOID servers,
|
2006-05-29 12:47:31 +02:00
|
|
|
PDNS_RECORDA *result, PVOID *reserved )
|
|
|
|
{
|
|
|
|
WCHAR *nameW;
|
|
|
|
DNS_RECORDW *resultW;
|
|
|
|
DNS_STATUS status;
|
|
|
|
|
2021-11-02 12:45:10 +01:00
|
|
|
TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ),
|
2006-05-29 12:47:31 +02:00
|
|
|
options, servers, result, reserved );
|
|
|
|
|
|
|
|
if (!name || !result)
|
|
|
|
return ERROR_INVALID_PARAMETER;
|
|
|
|
|
2021-03-30 10:35:27 +02:00
|
|
|
nameW = strdup_aw( name );
|
2006-05-29 12:47:31 +02:00
|
|
|
if (!nameW) return ERROR_NOT_ENOUGH_MEMORY;
|
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
status = DnsQuery_W( nameW, type, options, servers, &resultW, reserved );
|
2006-05-29 12:47:31 +02:00
|
|
|
|
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
*result = (DNS_RECORDA *)DnsRecordSetCopyEx(
|
|
|
|
(DNS_RECORD *)resultW, DnsCharSetUnicode, DnsCharSetAnsi );
|
|
|
|
|
|
|
|
if (!*result) status = ERROR_NOT_ENOUGH_MEMORY;
|
|
|
|
DnsRecordListFree( (DNS_RECORD *)resultW, DnsFreeRecordList );
|
|
|
|
}
|
|
|
|
|
2021-11-02 16:59:59 +01:00
|
|
|
free( nameW );
|
2006-05-29 12:47:31 +02:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DnsQuery_UTF8 [DNSAPI.@]
|
|
|
|
*
|
|
|
|
*/
|
2007-08-04 03:20:32 +02:00
|
|
|
DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID servers,
|
2006-05-29 12:47:31 +02:00
|
|
|
PDNS_RECORDA *result, PVOID *reserved )
|
|
|
|
{
|
|
|
|
DNS_STATUS ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED;
|
2021-11-02 12:50:46 +01:00
|
|
|
unsigned char answer[4096];
|
|
|
|
DWORD len = sizeof(answer);
|
2021-11-02 16:54:28 +01:00
|
|
|
struct query_params query_params = { name, type, options, answer, &len };
|
2006-05-29 12:47:31 +02:00
|
|
|
|
2021-11-02 12:45:10 +01:00
|
|
|
TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ),
|
2006-05-29 12:47:31 +02:00
|
|
|
options, servers, result, reserved );
|
|
|
|
|
|
|
|
if (!name || !result)
|
|
|
|
return ERROR_INVALID_PARAMETER;
|
|
|
|
|
2021-11-08 20:54:16 +01:00
|
|
|
if ((ret = RESOLV_CALL( set_serverlist, servers ))) return ret;
|
2006-05-29 12:47:31 +02:00
|
|
|
|
2021-11-02 16:54:28 +01:00
|
|
|
ret = RESOLV_CALL( query, &query_params );
|
2021-11-02 12:50:46 +01:00
|
|
|
if (!ret)
|
|
|
|
{
|
|
|
|
DNS_MESSAGE_BUFFER *buffer = (DNS_MESSAGE_BUFFER *)answer;
|
|
|
|
|
|
|
|
if (len < sizeof(buffer->MessageHead)) return DNS_ERROR_BAD_PACKET;
|
|
|
|
DNS_BYTE_FLIP_HEADER_COUNTS( &buffer->MessageHead );
|
|
|
|
switch (buffer->MessageHead.ResponseCode)
|
|
|
|
{
|
|
|
|
case DNS_RCODE_NOERROR: ret = DnsExtractRecordsFromMessage_UTF8( buffer, len, result ); break;
|
|
|
|
case DNS_RCODE_FORMERR: ret = DNS_ERROR_RCODE_FORMAT_ERROR; break;
|
|
|
|
case DNS_RCODE_SERVFAIL: ret = DNS_ERROR_RCODE_SERVER_FAILURE; break;
|
|
|
|
case DNS_RCODE_NXDOMAIN: ret = DNS_ERROR_RCODE_NAME_ERROR; break;
|
|
|
|
case DNS_RCODE_NOTIMPL: ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED; break;
|
|
|
|
case DNS_RCODE_REFUSED: ret = DNS_ERROR_RCODE_REFUSED; break;
|
|
|
|
case DNS_RCODE_YXDOMAIN: ret = DNS_ERROR_RCODE_YXDOMAIN; break;
|
|
|
|
case DNS_RCODE_YXRRSET: ret = DNS_ERROR_RCODE_YXRRSET; break;
|
|
|
|
case DNS_RCODE_NXRRSET: ret = DNS_ERROR_RCODE_NXRRSET; break;
|
|
|
|
case DNS_RCODE_NOTAUTH: ret = DNS_ERROR_RCODE_NOTAUTH; break;
|
|
|
|
case DNS_RCODE_NOTZONE: ret = DNS_ERROR_RCODE_NOTZONE; break;
|
|
|
|
default: ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED; break;
|
|
|
|
}
|
|
|
|
}
|
2006-05-29 12:47:31 +02:00
|
|
|
|
2006-05-31 15:46:58 +02:00
|
|
|
if (ret == DNS_ERROR_RCODE_NAME_ERROR && type == DNS_TYPE_A &&
|
|
|
|
!(options & DNS_QUERY_NO_NETBT))
|
|
|
|
{
|
|
|
|
TRACE( "dns lookup failed, trying netbios query\n" );
|
2021-03-30 10:35:27 +02:00
|
|
|
ret = do_query_netbios( name, result );
|
2006-05-31 15:46:58 +02:00
|
|
|
}
|
|
|
|
|
2006-05-29 12:47:31 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DnsQuery_W [DNSAPI.@]
|
|
|
|
*
|
|
|
|
*/
|
2007-08-04 03:20:32 +02:00
|
|
|
DNS_STATUS WINAPI DnsQuery_W( PCWSTR name, WORD type, DWORD options, PVOID servers,
|
2006-05-29 12:47:31 +02:00
|
|
|
PDNS_RECORDW *result, PVOID *reserved )
|
|
|
|
{
|
|
|
|
char *nameU;
|
|
|
|
DNS_RECORDA *resultA;
|
|
|
|
DNS_STATUS status;
|
|
|
|
|
2021-11-02 12:45:10 +01:00
|
|
|
TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_w(name), debugstr_type( type ),
|
2006-05-29 12:47:31 +02:00
|
|
|
options, servers, result, reserved );
|
|
|
|
|
|
|
|
if (!name || !result)
|
|
|
|
return ERROR_INVALID_PARAMETER;
|
|
|
|
|
2021-03-30 10:35:27 +02:00
|
|
|
nameU = strdup_wu( name );
|
2006-05-29 12:47:31 +02:00
|
|
|
if (!nameU) return ERROR_NOT_ENOUGH_MEMORY;
|
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
status = DnsQuery_UTF8( nameU, type, options, servers, &resultA, reserved );
|
2006-05-29 12:47:31 +02:00
|
|
|
|
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
*result = (DNS_RECORDW *)DnsRecordSetCopyEx(
|
|
|
|
(DNS_RECORD *)resultA, DnsCharSetUtf8, DnsCharSetUnicode );
|
|
|
|
|
|
|
|
if (!*result) status = ERROR_NOT_ENOUGH_MEMORY;
|
|
|
|
DnsRecordListFree( (DNS_RECORD *)resultA, DnsFreeRecordList );
|
|
|
|
}
|
|
|
|
|
2021-11-02 16:59:59 +01:00
|
|
|
free( nameU );
|
2006-05-29 12:47:31 +02:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
static DNS_STATUS get_hostname_a( COMPUTER_NAME_FORMAT format, PSTR buffer, PDWORD len )
|
2006-05-09 10:47:06 +02:00
|
|
|
{
|
|
|
|
char name[256];
|
2018-07-20 21:45:56 +02:00
|
|
|
DWORD size = ARRAY_SIZE(name);
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
if (!GetComputerNameExA( format, name, &size ))
|
|
|
|
return DNS_ERROR_NAME_DOES_NOT_EXIST;
|
|
|
|
|
|
|
|
if (!buffer || (size = lstrlenA( name ) + 1) > *len)
|
|
|
|
{
|
|
|
|
*len = size;
|
|
|
|
return ERROR_INSUFFICIENT_BUFFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstrcpyA( buffer, name );
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-03-30 10:35:28 +02:00
|
|
|
static DNS_STATUS get_hostname_w( COMPUTER_NAME_FORMAT format, PWSTR buffer, PDWORD len )
|
2006-05-09 10:47:06 +02:00
|
|
|
{
|
|
|
|
WCHAR name[256];
|
2018-07-20 21:45:56 +02:00
|
|
|
DWORD size = ARRAY_SIZE(name);
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
if (!GetComputerNameExW( format, name, &size ))
|
|
|
|
return DNS_ERROR_NAME_DOES_NOT_EXIST;
|
|
|
|
|
|
|
|
if (!buffer || (size = lstrlenW( name ) + 1) > *len)
|
|
|
|
{
|
|
|
|
*len = size;
|
|
|
|
return ERROR_INSUFFICIENT_BUFFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstrcpyW( buffer, name );
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-08-03 10:20:21 +02:00
|
|
|
static DNS_STATUS get_dns_server_list( IP4_ARRAY *out, DWORD *len )
|
|
|
|
{
|
|
|
|
char buf[FIELD_OFFSET(DNS_ADDR_ARRAY, AddrArray[3])];
|
|
|
|
DNS_ADDR_ARRAY *servers = (DNS_ADDR_ARRAY *)buf;
|
|
|
|
DWORD ret, needed, i, num, array_len = sizeof(buf);
|
2021-11-02 16:54:28 +01:00
|
|
|
struct get_serverlist_params params = { AF_INET, servers, &array_len };
|
2021-08-03 10:20:21 +02:00
|
|
|
for (;;)
|
|
|
|
{
|
2021-11-02 16:54:28 +01:00
|
|
|
ret = RESOLV_CALL( get_serverlist, ¶ms );
|
2021-08-03 10:20:21 +02:00
|
|
|
if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) goto err;
|
|
|
|
num = (array_len - FIELD_OFFSET(DNS_ADDR_ARRAY, AddrArray[0])) / sizeof(DNS_ADDR);
|
|
|
|
needed = FIELD_OFFSET(IP4_ARRAY, AddrArray[num]);
|
|
|
|
if (!out || *len < needed)
|
|
|
|
{
|
|
|
|
*len = needed;
|
|
|
|
ret = !out ? ERROR_SUCCESS : ERROR_MORE_DATA;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
if (!ret) break;
|
|
|
|
|
2021-11-02 16:59:59 +01:00
|
|
|
if ((char *)servers != buf) free( servers );
|
|
|
|
servers = malloc( array_len );
|
2021-08-03 10:20:21 +02:00
|
|
|
if (!servers)
|
|
|
|
{
|
|
|
|
ret = ERROR_NOT_ENOUGH_MEMORY;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
out->AddrCount = num;
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
out->AddrArray[i] = ((SOCKADDR_IN *)servers->AddrArray[i].MaxSa)->sin_addr.s_addr;
|
|
|
|
*len = needed;
|
|
|
|
ret = ERROR_SUCCESS;
|
|
|
|
|
|
|
|
err:
|
2021-11-02 16:59:59 +01:00
|
|
|
if ((char *)servers != buf) free( servers );
|
2021-08-03 10:20:21 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-05-09 10:47:06 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* DnsQueryConfig [DNSAPI.@]
|
|
|
|
*
|
|
|
|
*/
|
2007-09-18 00:39:58 +02:00
|
|
|
DNS_STATUS WINAPI DnsQueryConfig( DNS_CONFIG_TYPE config, DWORD flag, PCWSTR adapter,
|
2006-05-09 10:47:06 +02:00
|
|
|
PVOID reserved, PVOID buffer, PDWORD len )
|
|
|
|
{
|
|
|
|
DNS_STATUS ret = ERROR_INVALID_PARAMETER;
|
|
|
|
|
2006-09-30 12:07:06 +02:00
|
|
|
TRACE( "(%d,0x%08x,%s,%p,%p,%p)\n", config, flag, debugstr_w(adapter),
|
2006-05-09 10:47:06 +02:00
|
|
|
reserved, buffer, len );
|
|
|
|
|
|
|
|
if (!len) return ERROR_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
switch (config)
|
|
|
|
{
|
|
|
|
case DnsConfigDnsServerList:
|
2021-08-03 10:20:21 +02:00
|
|
|
return get_dns_server_list( buffer, len );
|
|
|
|
|
2006-05-09 10:47:06 +02:00
|
|
|
case DnsConfigHostName_A:
|
|
|
|
case DnsConfigHostName_UTF8:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_a( ComputerNameDnsHostname, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigFullHostName_A:
|
|
|
|
case DnsConfigFullHostName_UTF8:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_a( ComputerNameDnsFullyQualified, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigPrimaryDomainName_A:
|
|
|
|
case DnsConfigPrimaryDomainName_UTF8:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_a( ComputerNameDnsDomain, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigHostName_W:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_w( ComputerNameDnsHostname, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigFullHostName_W:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_w( ComputerNameDnsFullyQualified, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigPrimaryDomainName_W:
|
2021-03-30 10:35:27 +02:00
|
|
|
return get_hostname_w( ComputerNameDnsDomain, buffer, len );
|
2006-05-09 10:47:06 +02:00
|
|
|
|
|
|
|
case DnsConfigAdapterDomainName_A:
|
|
|
|
case DnsConfigAdapterDomainName_W:
|
|
|
|
case DnsConfigAdapterDomainName_UTF8:
|
|
|
|
case DnsConfigAdapterInfo:
|
|
|
|
case DnsConfigPrimaryHostNameRegistrationEnabled:
|
|
|
|
case DnsConfigAdapterHostNameRegistrationEnabled:
|
|
|
|
case DnsConfigAddressRegistrationMaxCount:
|
|
|
|
FIXME( "unimplemented config type %d\n", config );
|
|
|
|
break;
|
|
|
|
|
2021-08-03 10:20:22 +02:00
|
|
|
case DnsConfigDnsServersUnspec:
|
2021-11-02 16:54:28 +01:00
|
|
|
{
|
|
|
|
struct get_serverlist_params params = { AF_UNSPEC, buffer, len };
|
|
|
|
return RESOLV_CALL( get_serverlist, ¶ms );
|
|
|
|
}
|
2021-08-03 10:20:21 +02:00
|
|
|
case DnsConfigDnsServersIpv4:
|
2021-11-02 16:54:28 +01:00
|
|
|
{
|
|
|
|
struct get_serverlist_params params = { AF_INET, buffer, len };
|
|
|
|
return RESOLV_CALL( get_serverlist, ¶ms );
|
|
|
|
}
|
2021-08-03 10:20:22 +02:00
|
|
|
case DnsConfigDnsServersIpv6:
|
2021-11-02 16:54:28 +01:00
|
|
|
{
|
|
|
|
struct get_serverlist_params params = { AF_INET6, buffer, len };
|
|
|
|
return RESOLV_CALL( get_serverlist, ¶ms );
|
|
|
|
}
|
2021-08-03 10:20:23 +02:00
|
|
|
case DnsConfigSearchList:
|
2021-11-02 16:54:28 +01:00
|
|
|
{
|
|
|
|
struct get_searchlist_params params = { buffer, len };
|
|
|
|
return RESOLV_CALL( get_searchlist, ¶ms );
|
|
|
|
}
|
2006-05-09 10:47:06 +02:00
|
|
|
default:
|
|
|
|
WARN( "unknown config type: %d\n", config );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|