=?UTF-8?Q?R=C3=A9mi=20Bernon=20?=: dnsapi: Add DnsGetCacheDataTable stub.

Alexandre Julliard julliard at winehq.org
Fri Sep 6 16:05:43 CDT 2019


Module: wine
Branch: master
Commit: ec716e9ebdd03051844b1f531a9fe986b2cbb220
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ec716e9ebdd03051844b1f531a9fe986b2cbb220

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Aug 30 14:59:07 2019 +0200

dnsapi: Add DnsGetCacheDataTable stub.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40606
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dnsapi/dnsapi.spec       |  2 +-
 dlls/dnsapi/main.c            | 10 +++++++++
 dlls/dnsapi/tests/Makefile.in |  1 +
 dlls/dnsapi/tests/cache.c     | 49 +++++++++++++++++++++++++++++++++++++++++++
 include/windns.h              | 10 +++++++++
 5 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/dlls/dnsapi/dnsapi.spec b/dlls/dnsapi/dnsapi.spec
index de0ed1d..0d50c56 100644
--- a/dlls/dnsapi/dnsapi.spec
+++ b/dlls/dnsapi/dnsapi.spec
@@ -40,7 +40,7 @@
 @ stub DnsFreeNetworkInformation
 @ stub DnsFreeSearchInformation
 @ stub DnsGetBufferLengthForStringCopy
-@ stub DnsGetCacheDataTable
+@ stdcall DnsGetCacheDataTable(ptr)
 @ stub DnsGetDnsServerList
 @ stub DnsGetDomainName
 @ stub DnsGetHostName_A
diff --git a/dlls/dnsapi/main.c b/dlls/dnsapi/main.c
index 6cb3b49..4ab294c 100644
--- a/dlls/dnsapi/main.c
+++ b/dlls/dnsapi/main.c
@@ -112,6 +112,16 @@ BOOL WINAPI DnsFlushResolverCacheEntry_W( PCWSTR entry )
 }
 
 /******************************************************************************
+ * DnsGetCacheDataTable                    [DNSAPI.@]
+ *
+ */
+BOOL WINAPI DnsGetCacheDataTable( PDNS_CACHE_ENTRY* entry )
+{
+    FIXME( "(%p) stub\n", entry );
+    return FALSE;
+}
+
+/******************************************************************************
  * DnsReleaseContextHandle                [DNSAPI.@]
  *
  */
diff --git a/dlls/dnsapi/tests/Makefile.in b/dlls/dnsapi/tests/Makefile.in
index 20412e8..14c8f30 100644
--- a/dlls/dnsapi/tests/Makefile.in
+++ b/dlls/dnsapi/tests/Makefile.in
@@ -2,5 +2,6 @@ TESTDLL   = dnsapi.dll
 IMPORTS   = dnsapi
 
 C_SRCS = \
+	cache.c \
 	name.c \
 	record.c
diff --git a/dlls/dnsapi/tests/cache.c b/dlls/dnsapi/tests/cache.c
new file mode 100644
index 0000000..cb41b9a
--- /dev/null
+++ b/dlls/dnsapi/tests/cache.c
@@ -0,0 +1,49 @@
+/*
+ * Tests for dns cache functions
+ *
+ * Copyright 2019 Remi Bernon for CodeWeavers
+ *
+ * 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "windns.h"
+
+#include "wine/test.h"
+
+static void test_DnsGetCacheDataTable( void )
+{
+    BOOL ret;
+    PDNS_CACHE_ENTRY entry = NULL;
+
+    ret = DnsGetCacheDataTable( NULL );
+    ok( !ret, "DnsGetCacheDataTable succeeded\n" );
+
+    ret = DnsGetCacheDataTable( &entry );
+    todo_wine
+    ok( ret, "DnsGetCacheDataTable failed\n" );
+    todo_wine
+    ok( entry != NULL, "DnsGetCacheDataTable returned NULL\n" );
+}
+
+START_TEST(cache)
+{
+    test_DnsGetCacheDataTable();
+}
diff --git a/include/windns.h b/include/windns.h
index 9a31fac..26d3716 100644
--- a/include/windns.h
+++ b/include/windns.h
@@ -698,6 +698,15 @@ typedef struct _DNS_QUERY_CANCEL
     char Reserved[32];
 } DNS_QUERY_CANCEL, *PDNS_QUERY_CANCEL;
 
+typedef struct _DNS_CACHE_ENTRY
+{
+    struct _DNS_CACHE_ENTRY* Next;
+    const WCHAR *Name;
+    WORD Type;
+    WORD DataLength;
+    ULONG Flags;
+} DNS_CACHE_ENTRY, *PDNS_CACHE_ENTRY;
+
 DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE);
 DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE);
 #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_)
@@ -735,6 +744,7 @@ DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT);
 #define DnsValidateName WINELIB_NAME_AW(DnsValidateName_)
 BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL);
 BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL);
+BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*);
 
 #ifdef __cplusplus
 }




More information about the wine-cvs mailing list