Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

661 lines
18 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #define SDK_DNS_RECORD 1
  8. #include <dnsapi.h>
  9. #include "..\..\dnslib\dnslib.h"
  10. VOID
  11. PrintRecord (
  12. IN PDNS_RECORD pDnsRecord );
  13. VOID
  14. PrintARecord (
  15. IN PDNS_RECORD pDnsRecord );
  16. VOID
  17. PrintSOARecord (
  18. IN PDNS_RECORD pDnsRecord );
  19. VOID
  20. PrintPTRRecord (
  21. IN PDNS_RECORD pDnsRecord );
  22. VOID
  23. PrintMINFORecord (
  24. IN PDNS_RECORD pDnsRecord );
  25. VOID
  26. PrintMXRecord (
  27. IN PDNS_RECORD pDnsRecord );
  28. VOID
  29. PrintHINFORecord (
  30. IN PDNS_RECORD pDnsRecord );
  31. VOID
  32. PrintNULLRecord (
  33. IN PDNS_RECORD pDnsRecord );
  34. VOID
  35. PrintWKSRecord (
  36. IN PDNS_RECORD pDnsRecord );
  37. VOID
  38. PrintAAAARecord (
  39. IN PDNS_RECORD pDnsRecord );
  40. VOID
  41. PrintSRVRecord (
  42. IN PDNS_RECORD pDnsRecord );
  43. VOID
  44. PrintATMARecord (
  45. IN PDNS_RECORD pDnsRecord );
  46. VOID
  47. PrintWINSRecord (
  48. IN PDNS_RECORD pDnsRecord );
  49. VOID
  50. PrintWINSRRecord (
  51. IN PDNS_RECORD pDnsRecord );
  52. VOID
  53. PrintDNSFlags (
  54. IN DNSREC_FLAGS Flags );
  55. VOID
  56. PrintIpAddress (
  57. IN DWORD dwIpAddress )
  58. {
  59. printf( " %d.%d.%d.%d\n",
  60. ((BYTE *) &dwIpAddress)[0],
  61. ((BYTE *) &dwIpAddress)[1],
  62. ((BYTE *) &dwIpAddress)[2],
  63. ((BYTE *) &dwIpAddress)[3] );
  64. }
  65. _cdecl
  66. main(int argc, char **argv)
  67. {
  68. DWORD Status = NO_ERROR;
  69. PDNS_RECORD pDNSRecord = NULL;
  70. PDNS_RECORD pTempDNSRecord = NULL;
  71. WCHAR usName[1000];
  72. PDNS_ADDRESS_INFO pAddressInfo;
  73. DWORD dwCount;
  74. WORD wType;
  75. LONG cch;
  76. BYTE Part1, Part2, Part3, Part4;
  77. LPSTR lpTemp = NULL, lpAddress = NULL;
  78. IP_ADDRESS Address;
  79. BYTE Buffer[1000];
  80. PIP_ARRAY pipArray = NULL;
  81. DWORD dwFlags = 0; // DNS_QUERY_BYPASS_CACHE;
  82. PDNS_MSG_BUF pMsg = NULL;
  83. if ( argc > 4 ||
  84. argc < 3 )
  85. {
  86. printf( "\nUsage: dnsqry <DNS Name> <Type> [DNS Server IP]\n" );
  87. printf( "\nWhere:\n" );
  88. printf( " DNS Name - Server_X.dbsd-test.microsoft.com\n" );
  89. printf( " Type - 1 | A, 2 | ns, 12 | Ptr, 33 | SRV, ...\n" );
  90. printf( " Server IP - 157.55.80.152 \n" );
  91. return(-1);
  92. }
  93. cch = MultiByteToWideChar(
  94. CP_ACP,
  95. 0L,
  96. argv[1],
  97. -1,
  98. usName,
  99. 1000
  100. );
  101. if (!cch) {
  102. Status = GetLastError();
  103. return (Status);
  104. }
  105. if ( Dns_NameCompare_A( "A", argv[2] ) )
  106. wType = DNS_TYPE_A;
  107. else if ( Dns_NameCompare_A( "NS", argv[2] ) )
  108. wType = DNS_TYPE_NS;
  109. else if ( Dns_NameCompare_A( "MD", argv[2] ) )
  110. wType = DNS_TYPE_MD;
  111. else if ( Dns_NameCompare_A( "MF", argv[2] ) )
  112. wType = DNS_TYPE_MF;
  113. else if ( Dns_NameCompare_A( "CNAME", argv[2] ) )
  114. wType = DNS_TYPE_CNAME;
  115. else if ( Dns_NameCompare_A( "SOA", argv[2] ) )
  116. wType = DNS_TYPE_SOA;
  117. else if ( Dns_NameCompare_A( "MB", argv[2] ) )
  118. wType = DNS_TYPE_MB;
  119. else if ( Dns_NameCompare_A( "MG", argv[2] ) )
  120. wType = DNS_TYPE_MG;
  121. else if ( Dns_NameCompare_A( "MR", argv[2] ) )
  122. wType = DNS_TYPE_MR;
  123. else if ( Dns_NameCompare_A( "NULL", argv[2] ) )
  124. wType = DNS_TYPE_NULL;
  125. else if ( Dns_NameCompare_A( "WKS", argv[2] ) )
  126. wType = DNS_TYPE_WKS;
  127. else if ( Dns_NameCompare_A( "PTR", argv[2] ) )
  128. wType = DNS_TYPE_PTR;
  129. else if ( Dns_NameCompare_A( "HINFO", argv[2] ) )
  130. wType = DNS_TYPE_HINFO;
  131. else if ( Dns_NameCompare_A( "MINFO", argv[2] ) )
  132. wType = DNS_TYPE_MINFO;
  133. else if ( Dns_NameCompare_A( "MX", argv[2] ) )
  134. wType = DNS_TYPE_MX;
  135. else if ( Dns_NameCompare_A( "TEXT", argv[2] ) )
  136. wType = DNS_TYPE_TEXT;
  137. else if ( Dns_NameCompare_A( "RP", argv[2] ) )
  138. wType = DNS_TYPE_RP;
  139. else if ( Dns_NameCompare_A( "AFSDB", argv[2] ) )
  140. wType = DNS_TYPE_AFSDB;
  141. else if ( Dns_NameCompare_A( "X25", argv[2] ) )
  142. wType = DNS_TYPE_X25;
  143. else if ( Dns_NameCompare_A( "ISDN", argv[2] ) )
  144. wType = DNS_TYPE_ISDN;
  145. else if ( Dns_NameCompare_A( "RT", argv[2] ) )
  146. wType = DNS_TYPE_RT;
  147. else if ( Dns_NameCompare_A( "NSAP", argv[2] ) )
  148. wType = DNS_TYPE_NSAP;
  149. else if ( Dns_NameCompare_A( "NSAPPTR", argv[2] ) )
  150. wType = DNS_TYPE_NSAPPTR;
  151. else if ( Dns_NameCompare_A( "SIG", argv[2] ) )
  152. wType = DNS_TYPE_SIG;
  153. else if ( Dns_NameCompare_A( "KEY", argv[2] ) )
  154. wType = DNS_TYPE_KEY;
  155. else if ( Dns_NameCompare_A( "PX", argv[2] ) )
  156. wType = DNS_TYPE_PX;
  157. else if ( Dns_NameCompare_A( "GPOS", argv[2] ) )
  158. wType = DNS_TYPE_GPOS;
  159. else if ( Dns_NameCompare_A( "AAAA", argv[2] ) )
  160. wType = DNS_TYPE_AAAA;
  161. else if ( Dns_NameCompare_A( "LOC", argv[2] ) )
  162. wType = DNS_TYPE_LOC;
  163. else if ( Dns_NameCompare_A( "NXT", argv[2] ) )
  164. wType = DNS_TYPE_NXT;
  165. else if ( Dns_NameCompare_A( "SRV", argv[2] ) )
  166. wType = DNS_TYPE_SRV;
  167. else if ( Dns_NameCompare_A( "ATMA", argv[2] ) )
  168. wType = DNS_TYPE_ATMA;
  169. else if ( Dns_NameCompare_A( "TKEY", argv[2] ) )
  170. wType = DNS_TYPE_TKEY;
  171. else if ( Dns_NameCompare_A( "TSIG", argv[2] ) )
  172. wType = DNS_TYPE_TSIG;
  173. else if ( Dns_NameCompare_A( "IXFR", argv[2] ) )
  174. wType = DNS_TYPE_IXFR;
  175. else if ( Dns_NameCompare_A( "AXFR", argv[2] ) )
  176. wType = DNS_TYPE_AXFR;
  177. else if ( Dns_NameCompare_A( "MAILB", argv[2] ) )
  178. wType = DNS_TYPE_MAILB;
  179. else if ( Dns_NameCompare_A( "MAILA", argv[2] ) )
  180. wType = DNS_TYPE_MAILA;
  181. else if ( Dns_NameCompare_A( "WINS", argv[2] ) )
  182. wType = DNS_TYPE_WINS;
  183. else if ( Dns_NameCompare_A( "ALL", argv[2] ) )
  184. wType = DNS_TYPE_ALL;
  185. else if ( Dns_NameCompare_A( "ANY", argv[2] ) )
  186. wType = DNS_TYPE_ANY;
  187. else
  188. wType = (WORD) atoi( argv[2] );
  189. if ( argc > 3 )
  190. {
  191. lpAddress = argv[3];
  192. lpTemp = strtok( lpAddress, "." );
  193. Part1 = (BYTE) atoi( lpTemp );
  194. lpTemp = strtok( NULL, "." );
  195. Part2 = (BYTE) atoi( lpTemp );
  196. lpTemp = strtok( NULL, "." );
  197. Part3 = (BYTE) atoi( lpTemp );
  198. lpTemp = strtok( NULL, "." );
  199. Part4 = (BYTE) atoi( lpTemp );
  200. ((BYTE *) &Address)[0] = Part1;
  201. ((BYTE *) &Address)[1] = Part2;
  202. ((BYTE *) &Address)[2] = Part3;
  203. ((BYTE *) &Address)[3] = Part4;
  204. pipArray = (PIP_ARRAY) Buffer;
  205. pipArray->cAddrCount = 1;
  206. pipArray->aipAddrs[0] = Address;
  207. dwFlags |= DNS_QUERY_BYPASS_CACHE;
  208. printf( "\nDnsQuery( %S, %d, %d.%d.%d.%d ) ...\n\n",
  209. usName,
  210. wType,
  211. Part1,
  212. Part2,
  213. Part3,
  214. Part4 );
  215. }
  216. else
  217. printf( "\nDnsQuery( %S, %d, ... ) ...\n\n",
  218. usName,
  219. wType );
  220. Status = DnsQuery_W( usName,
  221. wType,
  222. dwFlags,
  223. pipArray,
  224. &pDNSRecord,
  225. NULL ); // &pMsg );
  226. if ( Status )
  227. {
  228. printf( "Dns_Query call failed with error: 0x%.8X\n", Status );
  229. }
  230. else
  231. {
  232. // WORD wMsgLen = pMsg->MessageLength;
  233. printf( "Query found record(s) ...\n\n" );
  234. #if 0
  235. DnsFreeRRSet( pDNSRecord, TRUE );
  236. pDNSRecord = NULL;
  237. printf( "Extracting record(s) from message buffer ...\n\n" );
  238. Status = DnsExtractRecordsFromMessage_W( (PDNS_MESSAGE_BUFFER)
  239. &pMsg->MessageHead,
  240. wMsgLen,
  241. &pDNSRecord );
  242. if ( Status )
  243. {
  244. printf( "DnsExtractRecordsFromMessage_UTF8 call failed with error: 0x%.8X\n", Status );
  245. pDNSRecord = NULL;
  246. }
  247. #endif
  248. pTempDNSRecord = pDNSRecord;
  249. while ( pTempDNSRecord )
  250. {
  251. printf( " Record:\n" );
  252. printf( " -------------------------------------\n" );
  253. printf( " Name : %S\n", pTempDNSRecord->pName );
  254. printf( " Type : %d\n", pTempDNSRecord->wType );
  255. printf( " Data Length : %d\n", pTempDNSRecord->wDataLength );
  256. printf( " Ttl (mins) : %d\n", pTempDNSRecord->dwTtl/60 );
  257. printf( " Flags : 0x%X", pTempDNSRecord->Flags.DW );
  258. PrintDNSFlags( pTempDNSRecord->Flags.S );
  259. printf( "\n" );
  260. PrintRecord( pTempDNSRecord );
  261. pTempDNSRecord = pTempDNSRecord->pNext;
  262. }
  263. #if 0
  264. DnsCacheRecordSet_W( pDNSRecord->nameOwner,
  265. pDNSRecord->wType,
  266. 0,
  267. pDNSRecord );
  268. #endif
  269. DnsFreeRRSet( pDNSRecord, TRUE );
  270. }
  271. return(0);
  272. }
  273. VOID
  274. PrintRecord (
  275. IN PDNS_RECORD pDnsRecord )
  276. {
  277. switch( pDnsRecord->wType )
  278. {
  279. case DNS_TYPE_A :
  280. PrintARecord( pDnsRecord );
  281. break;
  282. case DNS_TYPE_SOA :
  283. PrintSOARecord( pDnsRecord );
  284. break;
  285. case DNS_TYPE_PTR :
  286. case DNS_TYPE_NS :
  287. case DNS_TYPE_CNAME :
  288. case DNS_TYPE_MB :
  289. case DNS_TYPE_MD :
  290. case DNS_TYPE_MF :
  291. case DNS_TYPE_MG :
  292. case DNS_TYPE_MR :
  293. PrintPTRRecord( pDnsRecord );
  294. break;
  295. case DNS_TYPE_MINFO :
  296. case DNS_TYPE_RP :
  297. PrintMINFORecord( pDnsRecord );
  298. break;
  299. case DNS_TYPE_MX :
  300. case DNS_TYPE_AFSDB :
  301. case DNS_TYPE_RT :
  302. PrintMXRecord( pDnsRecord );
  303. break;
  304. case DNS_TYPE_HINFO :
  305. case DNS_TYPE_ISDN :
  306. case DNS_TYPE_TEXT :
  307. case DNS_TYPE_X25 :
  308. PrintHINFORecord( pDnsRecord );
  309. break;
  310. case DNS_TYPE_NULL :
  311. PrintNULLRecord( pDnsRecord );
  312. break;
  313. case DNS_TYPE_WKS :
  314. PrintWKSRecord( pDnsRecord );
  315. break;
  316. case DNS_TYPE_AAAA :
  317. PrintAAAARecord( pDnsRecord );
  318. break;
  319. case DNS_TYPE_SRV :
  320. PrintSRVRecord( pDnsRecord );
  321. break;
  322. case DNS_TYPE_ATMA :
  323. PrintATMARecord( pDnsRecord );
  324. break;
  325. case DNS_TYPE_WINS :
  326. PrintWINSRecord( pDnsRecord );
  327. break;
  328. case DNS_TYPE_NBSTAT :
  329. PrintWINSRRecord( pDnsRecord );
  330. break;
  331. default :
  332. printf( "Don't know how to print record type %d\n", pDnsRecord->wType );
  333. }
  334. }
  335. VOID
  336. PrintARecord (
  337. IN PDNS_RECORD pDnsRecord )
  338. {
  339. printf( " A record :\n" );
  340. printf( " ipAddress = %d.%d.%d.%d\n",
  341. ((BYTE *) &pDnsRecord->Data.A.ipAddress)[0],
  342. ((BYTE *) &pDnsRecord->Data.A.ipAddress)[1],
  343. ((BYTE *) &pDnsRecord->Data.A.ipAddress)[2],
  344. ((BYTE *) &pDnsRecord->Data.A.ipAddress)[3] );
  345. printf( "\n" );
  346. }
  347. VOID
  348. PrintSOARecord (
  349. IN PDNS_RECORD pDnsRecord )
  350. {
  351. printf( " SOA record :\n" );
  352. printf( " pNamePrimaryServer = %S\n",
  353. pDnsRecord->Data.SOA.pNamePrimaryServer );
  354. printf( " pNameAdministrator = %S\n",
  355. pDnsRecord->Data.SOA.pNameAdministrator );
  356. printf( " dwSerialNo = %d\n",
  357. pDnsRecord->Data.SOA.dwSerialNo );
  358. printf( " dwRefresh = %d\n",
  359. pDnsRecord->Data.SOA.dwRefresh );
  360. printf( " dwRetry = %d\n",
  361. pDnsRecord->Data.SOA.dwRetry );
  362. printf( " dwExpire = %d\n",
  363. pDnsRecord->Data.SOA.dwExpire );
  364. printf( " dwDefaultTtl = %d\n",
  365. pDnsRecord->Data.SOA.dwDefaultTtl );
  366. printf( "\n" );
  367. }
  368. VOID
  369. PrintPTRRecord (
  370. IN PDNS_RECORD pDnsRecord )
  371. {
  372. printf( " PTR, NS, CNAME, MB, MD, MF, MG, MR record :\n" );
  373. printf( " pNameHost = %S\n",
  374. pDnsRecord->Data.PTR.pNameHost );
  375. printf( "\n" );
  376. }
  377. VOID
  378. PrintMINFORecord (
  379. IN PDNS_RECORD pDnsRecord )
  380. {
  381. printf( " MINFO, RP record :\n" );
  382. printf( " pNameMailbox = %S\n",
  383. pDnsRecord->Data.MINFO.pNameMailbox );
  384. printf( " pNameErrorsMailbox = %S\n",
  385. pDnsRecord->Data.MINFO.pNameErrorsMailbox );
  386. printf( "\n" );
  387. }
  388. VOID
  389. PrintMXRecord (
  390. IN PDNS_RECORD pDnsRecord )
  391. {
  392. printf( " MX, AFSDB, RT record :\n" );
  393. printf( " pNameExchange = %S\n",
  394. pDnsRecord->Data.MX.pNameExchange );
  395. printf( " wPreference = %d\n",
  396. pDnsRecord->Data.MX.wPreference );
  397. printf( " Pad = %d\n",
  398. pDnsRecord->Data.MX.Pad );
  399. printf( "\n" );
  400. }
  401. VOID
  402. PrintHINFORecord (
  403. IN PDNS_RECORD pDnsRecord )
  404. {
  405. DWORD iter;
  406. printf( " HINFO, ISDN, TEXT, X25 record :\n" );
  407. printf( " dwStringCount = %d\n",
  408. pDnsRecord->Data.HINFO.dwStringCount );
  409. for ( iter = 0; iter < pDnsRecord->Data.HINFO.dwStringCount; iter ++ )
  410. {
  411. printf( " pStringArray[%d] = %S\n",
  412. iter,
  413. pDnsRecord->Data.HINFO.pStringArray[iter] );
  414. }
  415. printf( "\n" );
  416. }
  417. VOID
  418. PrintNULLRecord (
  419. IN PDNS_RECORD pDnsRecord )
  420. {
  421. printf( " NULL record :\n" );
  422. printf( "\n" );
  423. }
  424. VOID
  425. PrintWKSRecord (
  426. IN PDNS_RECORD pDnsRecord )
  427. {
  428. printf( " WKS record :\n" );
  429. printf( " ipAddress = %d.%d.%d.%d\n",
  430. ((BYTE *) &pDnsRecord->Data.WKS.ipAddress)[0],
  431. ((BYTE *) &pDnsRecord->Data.WKS.ipAddress)[1],
  432. ((BYTE *) &pDnsRecord->Data.WKS.ipAddress)[2],
  433. ((BYTE *) &pDnsRecord->Data.WKS.ipAddress)[3] );
  434. printf( " chProtocol = %d\n",
  435. pDnsRecord->Data.WKS.chProtocol );
  436. printf( " bBitMask = %s\n",
  437. pDnsRecord->Data.WKS.bBitMask );
  438. printf( "\n" );
  439. }
  440. VOID
  441. PrintAAAARecord (
  442. IN PDNS_RECORD pDnsRecord )
  443. {
  444. printf( " AAAA record :\n" );
  445. printf( " ipAddress = %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n",
  446. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[0],
  447. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[1],
  448. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[2],
  449. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[3],
  450. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[4],
  451. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[5],
  452. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[6],
  453. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[7],
  454. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[8],
  455. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[9],
  456. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[10],
  457. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[11],
  458. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[12],
  459. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[13],
  460. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[14],
  461. ((BYTE *) &pDnsRecord->Data.AAAA.ipv6Address)[15] );
  462. printf( "\n" );
  463. }
  464. VOID
  465. PrintSRVRecord (
  466. IN PDNS_RECORD pDnsRecord )
  467. {
  468. printf( " SRV record :\n" );
  469. printf( " pNameTarget = %S\n",
  470. pDnsRecord->Data.SRV.pNameTarget );
  471. printf( " wPriority = %d\n",
  472. pDnsRecord->Data.SRV.wPriority );
  473. printf( " wWeight = %d\n",
  474. pDnsRecord->Data.SRV.wWeight );
  475. printf( " wPort = %d\n",
  476. pDnsRecord->Data.SRV.wPort );
  477. printf( " Pad = %d\n",
  478. pDnsRecord->Data.SRV.Pad );
  479. printf( "\n" );
  480. }
  481. VOID
  482. PrintATMARecord (
  483. IN PDNS_RECORD pDnsRecord )
  484. {
  485. printf( " ATMA record :\n" );
  486. printf( " Address Type = %d\n",
  487. pDnsRecord->Data.ATMA.AddressType );
  488. if ( pDnsRecord->Data.ATMA.Address &&
  489. pDnsRecord->Data.ATMA.AddressType == DNS_ATM_TYPE_E164 )
  490. {
  491. printf( " Address = %s\n",
  492. pDnsRecord->Data.ATMA.Address );
  493. }
  494. else
  495. {
  496. DWORD iter;
  497. printf( " Address =\n\t" );
  498. for ( iter = 0; iter < pDnsRecord->wDataLength; iter++ )
  499. {
  500. printf( "%02x", (UCHAR) pDnsRecord->Data.ATMA.Address[iter] );
  501. }
  502. printf( "\n" );
  503. }
  504. printf( "\n" );
  505. }
  506. VOID
  507. PrintWINSRecord (
  508. IN PDNS_RECORD pDnsRecord )
  509. {
  510. DWORD iter;
  511. printf( " WINS record :\n" );
  512. printf( " dwMappingFlag = %d\n",
  513. pDnsRecord->Data.WINS.dwMappingFlag );
  514. printf( " dwLookupTimeout = %d\n",
  515. pDnsRecord->Data.WINS.dwLookupTimeout );
  516. printf( " dwCacheTimeout = %d\n",
  517. pDnsRecord->Data.WINS.dwCacheTimeout );
  518. printf( " cWinsServerCount = %d\n",
  519. pDnsRecord->Data.WINS.cWinsServerCount );
  520. printf( " aipWinsServers =" );
  521. for ( iter = 0; iter < pDnsRecord->Data.WINS.cWinsServerCount; iter++ )
  522. {
  523. PrintIpAddress( pDnsRecord->Data.WINS.aipWinsServers[iter] );
  524. printf( " " );
  525. }
  526. printf( "\n\n" );
  527. }
  528. VOID
  529. PrintWINSRRecord (
  530. IN PDNS_RECORD pDnsRecord )
  531. {
  532. printf( " NBSTAT record :\n" );
  533. printf( " dwMappingFlag = %d\n",
  534. pDnsRecord->Data.WINSR.dwMappingFlag );
  535. printf( " dwLookupTimeout = %d\n",
  536. pDnsRecord->Data.WINSR.dwLookupTimeout );
  537. printf( " dwCacheTimeout = %d\n",
  538. pDnsRecord->Data.WINSR.dwCacheTimeout );
  539. printf( " pNameResultDomain = %S\n",
  540. pDnsRecord->Data.WINSR.pNameResultDomain );
  541. printf( "\n" );
  542. }
  543. VOID
  544. PrintDNSFlags (
  545. IN DNSREC_FLAGS Flags )
  546. {
  547. if ( Flags.Section == DNSREC_ANSWER )
  548. {
  549. printf( " Answer" );
  550. }
  551. if ( Flags.Section == DNSREC_AUTHORITY )
  552. {
  553. printf( " Authority" );
  554. }
  555. if ( Flags.Section == DNSREC_ADDITIONAL )
  556. {
  557. printf( " Additional" );
  558. }
  559. printf( "\n" );
  560. }