dnsapi: Return ERROR_MORE_DATA on insufficient buffer.
This was already done correctly in the res_getservers() case. Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6414726f57
commit
734de3bef8
|
@ -414,7 +414,7 @@ DNS_STATUS CDECL resolv_get_serverlist( USHORT family, DNS_ADDR_ARRAY *addrs, DW
|
||||||
if (!addrs || *len < needed)
|
if (!addrs || *len < needed)
|
||||||
{
|
{
|
||||||
*len = needed;
|
*len = needed;
|
||||||
return !addrs ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER;
|
return !addrs ? ERROR_SUCCESS : ERROR_MORE_DATA;
|
||||||
}
|
}
|
||||||
*len = needed;
|
*len = needed;
|
||||||
memset( addrs, 0, needed );
|
memset( addrs, 0, needed );
|
||||||
|
|
|
@ -155,6 +155,10 @@ static void test_DnsQueryConfig( void )
|
||||||
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, NULL, &size );
|
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, NULL, &size );
|
||||||
if (err) continue;
|
if (err) continue;
|
||||||
ipv4 = malloc( size );
|
ipv4 = malloc( size );
|
||||||
|
size--;
|
||||||
|
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, ipv4, &size );
|
||||||
|
ok( err == ERROR_MORE_DATA, "got %d\n", err );
|
||||||
|
size++;
|
||||||
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, ipv4, &size );
|
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, ipv4, &size );
|
||||||
ok( !err, "got %d\n", err );
|
ok( !err, "got %d\n", err );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue