diff --git a/reactos/apps/tests/nameserverlist/makefile b/reactos/apps/tests/nameserverlist/makefile new file mode 100644 index 00000000000..ddba4c7a22d --- /dev/null +++ b/reactos/apps/tests/nameserverlist/makefile @@ -0,0 +1,23 @@ + +PATH_TO_TOP = ../../.. + +TARGET_NORC = yes + +TARGET_TYPE = program + +TARGET_APPTYPE = console + +TARGET_NAME = nameserverlist + +#TARGET_SDKLIBS = iphlpapi.a ws2_32.a kernel32.a +TARGET_SDKLIBS = ws2_32.a kernel32.a ntdll.a + +TARGET_OBJECTS = $(TARGET_NAME).o iphlpapi.o registry.o + +TARGET_CFLAGS = -Wall -Werror -g + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF diff --git a/reactos/apps/tests/nameserverlist/nameserverlist.c b/reactos/apps/tests/nameserverlist/nameserverlist.c new file mode 100644 index 00000000000..9faab029b49 --- /dev/null +++ b/reactos/apps/tests/nameserverlist/nameserverlist.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include + +int main( int argc, char **argv ) { + ULONG OutBufLen = 0; + PFIXED_INFO pFixedInfo; + PIP_ADDR_STRING Addr; + + GetNetworkParams(NULL, &OutBufLen); + pFixedInfo = malloc(OutBufLen); + if (!pFixedInfo) { + printf( "Failed to alloc %d bytes.\n", (int)OutBufLen ); + return 1; + } + + printf( "%d Bytes allocated\n", (int)OutBufLen ); + + GetNetworkParams(pFixedInfo,&OutBufLen); + + for( Addr = &pFixedInfo->DnsServerList; + Addr; + Addr = Addr->Next ) { + printf( "%c%s\n", + Addr == pFixedInfo->CurrentDnsServer ? '*' : ' ', + Addr->IpAddress.String ); + } + + free( pFixedInfo ); + return 0; +}