mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:15:58 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
28
modules/rostests/tests/dnsquery/dnsquery.c
Normal file
28
modules/rostests/tests/dnsquery/dnsquery.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <winerror.h>
|
||||
#include <windns.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
PDNS_RECORD QueryReply, AddrResponse;
|
||||
DWORD Addr;
|
||||
|
||||
assert (DnsQuery ("www.reactos.com", DNS_TYPE_A, DNS_QUERY_STANDARD,
|
||||
NULL, &QueryReply, NULL) == ERROR_SUCCESS);
|
||||
AddrResponse = QueryReply;
|
||||
while( AddrResponse ) {
|
||||
if( AddrResponse->wType == DNS_TYPE_A ) {
|
||||
Addr = ntohl( AddrResponse->Data.A.IpAddress );
|
||||
printf( "www.reactos.com == %d.%d.%d.%d\n",
|
||||
(int)(Addr >> 24) & 0xff,
|
||||
(int)(Addr >> 16) & 0xff,
|
||||
(int)(Addr >> 8) & 0xff,
|
||||
(int)Addr & 0xff );
|
||||
}
|
||||
AddrResponse = AddrResponse->pNext;
|
||||
}
|
||||
DnsRecordListFree( QueryReply, DnsFreeRecordList );
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue