Index: apitests/CMakeLists.txt =================================================================== --- apitests/CMakeLists.txt (revision 71259) +++ apitests/CMakeLists.txt (working copy) @@ -7,6 +7,7 @@ add_subdirectory(com) add_subdirectory(crt) add_subdirectory(dciman32) +add_subdirectory(dnsapi) add_subdirectory(gdi32) add_subdirectory(gditools) add_subdirectory(iphlpapi) Index: apitests/dnsapi/CMakeLists.txt =================================================================== --- apitests/dnsapi/CMakeLists.txt (revision 0) +++ apitests/dnsapi/CMakeLists.txt (working copy) @@ -0,0 +1,10 @@ + +list(APPEND SOURCE + DnsQueryA.c + testlist.c) + +add_executable(dnsapi_apitest ${SOURCE}) +target_link_libraries(dnsapi_apitest wine ${PSEH_LIB}) +set_module_type(dnsapi_apitest win32cui) +add_importlibs(dnsapi_apitest ws2_32 dnsapi msvcrt kernel32 ntdll) +add_cd_file(TARGET dnsapi_apitest DESTINATION reactos/bin FOR all) Index: apitests/dnsapi/DnsQueryA.c =================================================================== --- apitests/dnsapi/DnsQueryA.c (revision 0) +++ apitests/dnsapi/DnsQueryA.c (working copy) @@ -0,0 +1,50 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for DnsQuery_A + * PROGRAMMER: Victor Martinez Calvo + */ + + + +#include +#include +#include +#include +#include + + +void TestHostName () +{ + + DNS_STATUS dns_status = {0}; + char host_name[255]; + PDNS_RECORD dp = 0; + + gethostname(host_name, sizeof(host_name)); + dns_status = DnsQuery_A(host_name, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == 0,"DnsQuery_A failed with error %d", dns_status); + + + +} + +START_TEST(DnsQueryA) +{ + + WSADATA wsaData; + int iResult; + + + // Initialize Winsock + iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); + + ok(iResult == 0, "WSAStartup failed: %d\n", iResult); + if (iResult != 0) return; + + //TestHostName + TestHostName(); + + return; + +} \ No newline at end of file Index: apitests/dnsapi/testlist.c =================================================================== --- apitests/dnsapi/testlist.c (revision 0) +++ apitests/dnsapi/testlist.c (working copy) @@ -0,0 +1,13 @@ +#define __ROS_LONG64__ + +#define STANDALONE +#include + +extern void func_DnsQueryA(void); + +const struct test winetest_testlist[] = +{ + { "DnsQueryA", func_DnsQueryA }, + { 0, 0 } +}; +