ReactOS 0.4.15-dev-7834-g00c4b3d
nameserverlist.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <winsock2.h>
#include <iphlpapi.h>
Include dependency graph for nameserverlist.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Definition at line 6 of file nameserverlist.c.

6 {
7 ULONG OutBufLen = 0;
8 PFIXED_INFO pFixedInfo;
10
11 GetNetworkParams(NULL, &OutBufLen);
12 pFixedInfo = malloc(OutBufLen);
13 if (!pFixedInfo) {
14 printf( "Failed to alloc %d bytes.\n", (int)OutBufLen );
15 return 1;
16 }
17
18 printf( "%d Bytes allocated\n", (int)OutBufLen );
19
20 GetNetworkParams(pFixedInfo,&OutBufLen);
21
22 for( Addr = &pFixedInfo->DnsServerList;
23 Addr;
24 Addr = Addr->Next ) {
25 printf( "%c%s\n",
26 Addr == pFixedInfo->CurrentDnsServer ? '*' : ' ',
27 Addr->IpAddress.String );
28 }
29
30 free( pFixedInfo );
31 return 0;
32}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define printf
Definition: freeldr.h:93
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
PIP_ADDR_STRING CurrentDnsServer
Definition: iptypes.h:83
IP_ADDR_STRING DnsServerList
Definition: iptypes.h:84
char String[4 *4]
Definition: iptypes.h:42
struct _IP_ADDR_STRING * Next
Definition: iptypes.h:46
IP_ADDRESS_STRING IpAddress
Definition: iptypes.h:47
uint32_t ULONG
Definition: typedefs.h:59