Huw Davies : dnsapi: Return ERROR_MORE_DATA on insufficient buffer.
Alexandre Julliard
julliard at winehq.org
Mon Aug 9 16:21:42 CDT 2021
Module: wine
Branch: master
Commit: 734de3bef82ff5456b27cca663f9e91e939f0c29
URL: https://source.winehq.org/git/wine.git/?a=commit;h=734de3bef82ff5456b27cca663f9e91e939f0c29
Author: Huw Davies <huw at codeweavers.com>
Date: Mon Aug 9 10:06:25 2021 +0100
dnsapi: Return ERROR_MORE_DATA on insufficient buffer.
This was already done correctly in the res_getservers() case.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dnsapi/libresolv.c | 2 +-
dlls/dnsapi/tests/query.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/dnsapi/libresolv.c b/dlls/dnsapi/libresolv.c
index 7e545cf36fb..864c517333d 100644
--- a/dlls/dnsapi/libresolv.c
+++ b/dlls/dnsapi/libresolv.c
@@ -414,7 +414,7 @@ DNS_STATUS CDECL resolv_get_serverlist( USHORT family, DNS_ADDR_ARRAY *addrs, DW
if (!addrs || *len < needed)
{
*len = needed;
- return !addrs ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER;
+ return !addrs ? ERROR_SUCCESS : ERROR_MORE_DATA;
}
*len = needed;
memset( addrs, 0, needed );
diff --git a/dlls/dnsapi/tests/query.c b/dlls/dnsapi/tests/query.c
index 5fb47d89782..e691822a46a 100644
--- a/dlls/dnsapi/tests/query.c
+++ b/dlls/dnsapi/tests/query.c
@@ -155,6 +155,10 @@ static void test_DnsQueryConfig( void )
err = DnsQueryConfig( DnsConfigDnsServersIpv4, 0, name, NULL, NULL, &size );
if (err) continue;
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 );
ok( !err, "got %d\n", err );
More information about the wine-cvs
mailing list