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.

804 lines
21 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. #include <dnsapi.h>
  8. BOOL
  9. PrepareRecords(
  10. IN LPWSTR lpDomainName,
  11. OUT PDNS_RECORD * ppCurrentRecord1,
  12. OUT PDNS_RECORD * ppCurrentRecord2,
  13. OUT PDNS_RECORD * ppCurrentRecord3,
  14. OUT PDNS_RECORD * ppNewRecord1,
  15. OUT PDNS_RECORD * ppNewRecord2,
  16. OUT PDNS_RECORD * ppNewRecord3,
  17. OUT PDNS_RECORD * ppNewRecord4 );
  18. _cdecl
  19. main(int argc, char **argv)
  20. {
  21. WCHAR DomainName[] = L"glennc_test.ntdev.microsoft.com";
  22. DWORD Status = NO_ERROR;
  23. PDNS_RECORD pCurrentRecordSet = NULL;
  24. PDNS_RECORD pNewRecordSet = NULL;
  25. PDNS_RECORD pCurrentRecord1 = NULL;
  26. PDNS_RECORD pCurrentRecord2 = NULL;
  27. PDNS_RECORD pCurrentRecord3 = NULL;
  28. PDNS_RECORD pNewRecord1 = NULL;
  29. PDNS_RECORD pNewRecord2 = NULL;
  30. PDNS_RECORD pNewRecord3 = NULL;
  31. PDNS_RECORD pNewRecord4 = NULL;
  32. HANDLE hContext = NULL;
  33. DWORD dwFlags = 0;
  34. Status = DnsAcquireContextHandle( 0, NULL, &hContext );
  35. if ( Status )
  36. {
  37. printf( "DnsAcquireContextHandle call failed.\n" );
  38. return(-1);
  39. }
  40. if ( !PrepareRecords( DomainName,
  41. &pCurrentRecord1,
  42. &pCurrentRecord2,
  43. &pCurrentRecord3,
  44. &pNewRecord1,
  45. &pNewRecord2,
  46. &pNewRecord3,
  47. &pNewRecord4 ) )
  48. {
  49. printf( "PrepareRecords call failed.\n" );
  50. return(-1);
  51. }
  52. //
  53. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  54. //
  55. pCurrentRecordSet = pCurrentRecord1;
  56. pCurrentRecord1->pNext = pCurrentRecord2;
  57. pCurrentRecord2->pNext = pCurrentRecord3;
  58. pCurrentRecord3->pNext = NULL;
  59. //
  60. // Test 1
  61. //
  62. // Current = 1, 2, 3
  63. // New = 1, 2, 3
  64. // Server = 1, 2, 3
  65. //
  66. //
  67. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  68. //
  69. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  70. if ( Status )
  71. {
  72. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  73. Status );
  74. return(-1);
  75. }
  76. system( "pause" );
  77. //
  78. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  79. //
  80. pNewRecordSet = pNewRecord1;
  81. pNewRecord1->pNext = pNewRecord2;
  82. pNewRecord2->pNext = pNewRecord3;
  83. pNewRecord3->pNext = NULL;
  84. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  85. printf( " New = 1, 2, 3\n" );
  86. printf( " Server = 1, 2, 3\n" );
  87. printf( " dwFlags ); ...\n" );
  88. Status = DnsModifyRecordSet( hContext,
  89. pCurrentRecordSet,
  90. pNewRecordSet,
  91. dwFlags,
  92. NULL );
  93. if ( Status )
  94. {
  95. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  96. Status );
  97. return(-1);
  98. }
  99. printf( "DnsModifyRecordSet call succeeded!\n" );
  100. system( "pause" );
  101. //
  102. // Test 2
  103. //
  104. // Current = 1, 2, 3
  105. // New = 1, 2, 3, 4
  106. // Server = 1, 2, 3
  107. //
  108. //
  109. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  110. //
  111. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  112. if ( Status )
  113. {
  114. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  115. Status );
  116. return(-1);
  117. }
  118. system( "pause" );
  119. //
  120. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4 )
  121. //
  122. pNewRecordSet = pNewRecord1;
  123. pNewRecord1->pNext = pNewRecord2;
  124. pNewRecord2->pNext = pNewRecord3;
  125. pNewRecord3->pNext = pNewRecord4;
  126. pNewRecord4->pNext = NULL;
  127. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  128. printf( " New = 1, 2, 3, 4\n" );
  129. printf( " Server = 1, 2, 3\n" );
  130. printf( " dwFlags ); ...\n" );
  131. Status = DnsModifyRecordSet( hContext,
  132. pCurrentRecordSet,
  133. pNewRecordSet,
  134. dwFlags,
  135. NULL );
  136. if ( Status )
  137. {
  138. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  139. Status );
  140. return(-1);
  141. }
  142. printf( "DnsModifyRecordSet call succeeded!\n" );
  143. system( "pause" );
  144. //
  145. // Test 3
  146. //
  147. // Current = 1, 2, 3
  148. // New = 1, 2
  149. // Server = 1, 2, 3
  150. //
  151. //
  152. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  153. //
  154. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  155. if ( Status )
  156. {
  157. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  158. Status );
  159. return(-1);
  160. }
  161. system( "pause" );
  162. //
  163. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2 )
  164. //
  165. pNewRecordSet = pNewRecord1;
  166. pNewRecord1->pNext = pNewRecord2;
  167. pNewRecord2->pNext = NULL;
  168. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  169. printf( " New = 1, 2\n" );
  170. printf( " Server = 1, 2, 3\n" );
  171. printf( " dwFlags ); ...\n" );
  172. Status = DnsModifyRecordSet( hContext,
  173. pCurrentRecordSet,
  174. pNewRecordSet,
  175. dwFlags,
  176. NULL );
  177. if ( Status )
  178. {
  179. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  180. Status );
  181. return(-1);
  182. }
  183. printf( "DnsModifyRecordSet call succeeded!\n" );
  184. system( "pause" );
  185. //
  186. // Test 4
  187. //
  188. // Current = 1, 2, 3
  189. // New = 1, 2, 4
  190. // Server = 1, 2, 3
  191. //
  192. //
  193. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  194. //
  195. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  196. if ( Status )
  197. {
  198. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  199. Status );
  200. return(-1);
  201. }
  202. system( "pause" );
  203. //
  204. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 4.4.4.4 )
  205. //
  206. pNewRecordSet = pNewRecord1;
  207. pNewRecord1->pNext = pNewRecord2;
  208. pNewRecord2->pNext = pNewRecord4;
  209. pNewRecord4->pNext = NULL;
  210. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  211. printf( " New = 1, 2, 4\n" );
  212. printf( " Server = 1, 2, 3\n" );
  213. printf( " dwFlags ); ...\n" );
  214. Status = DnsModifyRecordSet( hContext,
  215. pCurrentRecordSet,
  216. pNewRecordSet,
  217. dwFlags,
  218. NULL );
  219. if ( Status )
  220. {
  221. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  222. Status );
  223. return(-1);
  224. }
  225. printf( "DnsModifyRecordSet call succeeded!\n" );
  226. system( "pause" );
  227. //
  228. // Test 5
  229. //
  230. // Current = 1, 2, 3
  231. // New = 1, 2, 3, 4
  232. // Server = 1, 2
  233. //
  234. //
  235. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  236. //
  237. pCurrentRecordSet = pCurrentRecord1;
  238. pCurrentRecord1->pNext = pCurrentRecord2;
  239. pCurrentRecord2->pNext = NULL;
  240. //
  241. // Preset server to have ( 1.1.1.1, 2.2.2.2 )
  242. //
  243. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  244. if ( Status )
  245. {
  246. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  247. Status );
  248. return(-1);
  249. }
  250. system( "pause" );
  251. //
  252. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  253. //
  254. pCurrentRecord2->pNext = pCurrentRecord3;
  255. pCurrentRecord3->pNext = NULL;
  256. //
  257. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4 )
  258. //
  259. pNewRecordSet = pNewRecord1;
  260. pNewRecord1->pNext = pNewRecord2;
  261. pNewRecord2->pNext = pNewRecord3;
  262. pNewRecord3->pNext = pNewRecord4;
  263. pNewRecord4->pNext = NULL;
  264. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  265. printf( " New = 1, 2, 3, 4\n" );
  266. printf( " Server = 1, 2\n" );
  267. printf( " dwFlags ); ...\n" );
  268. Status = DnsModifyRecordSet( hContext,
  269. pCurrentRecordSet,
  270. pNewRecordSet,
  271. dwFlags,
  272. NULL );
  273. if ( Status )
  274. {
  275. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  276. Status );
  277. return(-1);
  278. }
  279. printf( "DnsModifyRecordSet call succeeded!\n" );
  280. system( "pause" );
  281. //
  282. // Test 6
  283. //
  284. // Current = 1, 2, 3
  285. // New = 1, 2
  286. // Server = 1, 2
  287. //
  288. //
  289. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  290. //
  291. pCurrentRecordSet = pCurrentRecord1;
  292. pCurrentRecord1->pNext = pCurrentRecord2;
  293. pCurrentRecord2->pNext = NULL;
  294. //
  295. // Preset server to have ( 1.1.1.1, 2.2.2.2 )
  296. //
  297. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  298. if ( Status )
  299. {
  300. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  301. Status );
  302. return(-1);
  303. }
  304. system( "pause" );
  305. //
  306. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  307. //
  308. pCurrentRecord2->pNext = pCurrentRecord3;
  309. pCurrentRecord3->pNext = NULL;
  310. //
  311. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2 )
  312. //
  313. pNewRecordSet = pNewRecord1;
  314. pNewRecord1->pNext = pNewRecord2;
  315. pNewRecord2->pNext = NULL;
  316. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  317. printf( " New = 1, 2\n" );
  318. printf( " Server = 1, 2\n" );
  319. printf( " dwFlags ); ...\n" );
  320. Status = DnsModifyRecordSet( hContext,
  321. pCurrentRecordSet,
  322. pNewRecordSet,
  323. dwFlags,
  324. NULL );
  325. if ( Status )
  326. {
  327. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  328. Status );
  329. return(-1);
  330. }
  331. printf( "DnsModifyRecordSet call succeeded!\n" );
  332. system( "pause" );
  333. //
  334. // Test 7
  335. //
  336. // Current = 1, 2, 3
  337. // New = 1, 2, 4
  338. // Server = 1, 2
  339. //
  340. //
  341. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  342. //
  343. pCurrentRecordSet = pCurrentRecord1;
  344. pCurrentRecord1->pNext = pCurrentRecord2;
  345. pCurrentRecord2->pNext = NULL;
  346. //
  347. // Preset server to have ( 1.1.1.1, 2.2.2.2 )
  348. //
  349. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  350. if ( Status )
  351. {
  352. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  353. Status );
  354. return(-1);
  355. }
  356. system( "pause" );
  357. //
  358. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  359. //
  360. pCurrentRecord2->pNext = pCurrentRecord3;
  361. pCurrentRecord3->pNext = NULL;
  362. //
  363. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 4.4.4.4 )
  364. //
  365. pNewRecordSet = pNewRecord1;
  366. pNewRecord1->pNext = pNewRecord2;
  367. pNewRecord2->pNext = pNewRecord4;
  368. pNewRecord4->pNext = NULL;
  369. printf( "DnsModifyRecordSet( Current = 1, 2, 3\n" );
  370. printf( " New = 1, 2, 4\n" );
  371. printf( " Server = 1, 2\n" );
  372. printf( " dwFlags ); ...\n" );
  373. Status = DnsModifyRecordSet( hContext,
  374. pCurrentRecordSet,
  375. pNewRecordSet,
  376. dwFlags,
  377. NULL );
  378. if ( Status )
  379. {
  380. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  381. Status );
  382. return(-1);
  383. }
  384. printf( "DnsModifyRecordSet call succeeded!\n" );
  385. system( "pause" );
  386. //
  387. // Test 8
  388. //
  389. // Current = 1, 2
  390. // New = 1, 2, 3
  391. // Server = 1, 2, 3
  392. //
  393. //
  394. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  395. //
  396. pCurrentRecordSet = pCurrentRecord1;
  397. pCurrentRecord1->pNext = pCurrentRecord2;
  398. pCurrentRecord2->pNext = pCurrentRecord3;
  399. pCurrentRecord3->pNext = NULL;
  400. //
  401. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  402. //
  403. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  404. if ( Status )
  405. {
  406. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  407. Status );
  408. return(-1);
  409. }
  410. system( "pause" );
  411. //
  412. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  413. //
  414. pCurrentRecord2->pNext = NULL;
  415. //
  416. // Set up pNewRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  417. //
  418. pNewRecordSet = pNewRecord1;
  419. pNewRecord1->pNext = pNewRecord2;
  420. pNewRecord2->pNext = pNewRecord3;
  421. pNewRecord3->pNext = NULL;
  422. printf( "DnsModifyRecordSet( Current = 1, 2\n" );
  423. printf( " New = 1, 2, 3\n" );
  424. printf( " Server = 1, 2, 3\n" );
  425. printf( " dwFlags ); ...\n" );
  426. Status = DnsModifyRecordSet( hContext,
  427. pCurrentRecordSet,
  428. pNewRecordSet,
  429. dwFlags,
  430. NULL );
  431. if ( Status )
  432. {
  433. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  434. Status );
  435. return(-1);
  436. }
  437. printf( "DnsModifyRecordSet call succeeded!\n" );
  438. system( "pause" );
  439. //
  440. // Test 9
  441. //
  442. // Current = 1, 2
  443. // New = 1
  444. // Server = 1, 2, 3
  445. //
  446. //
  447. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  448. //
  449. pCurrentRecordSet = pCurrentRecord1;
  450. pCurrentRecord1->pNext = pCurrentRecord2;
  451. pCurrentRecord2->pNext = pCurrentRecord3;
  452. pCurrentRecord3->pNext = NULL;
  453. //
  454. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  455. //
  456. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  457. if ( Status )
  458. {
  459. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  460. Status );
  461. return(-1);
  462. }
  463. system( "pause" );
  464. //
  465. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  466. //
  467. pCurrentRecord2->pNext = NULL;
  468. //
  469. // Set up pNewRecordSet ( 1.1.1.1 )
  470. //
  471. pNewRecordSet = pNewRecord1;
  472. pNewRecord1->pNext = NULL;
  473. printf( "DnsModifyRecordSet( Current = 1, 2\n" );
  474. printf( " New = 1\n" );
  475. printf( " Server = 1, 2, 3\n" );
  476. printf( " dwFlags ); ...\n" );
  477. Status = DnsModifyRecordSet( hContext,
  478. pCurrentRecordSet,
  479. pNewRecordSet,
  480. dwFlags,
  481. NULL );
  482. if ( Status == DNS_ERROR_NOT_UNIQUE )
  483. {
  484. printf( "DnsModifyRecordSet call succeeded!\n" );
  485. }
  486. else
  487. {
  488. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  489. Status );
  490. return(-1);
  491. }
  492. system( "pause" );
  493. //
  494. // Test 10
  495. //
  496. // Current = 1, 2
  497. // New = 1, 3
  498. // Server = 1, 2, 3
  499. //
  500. //
  501. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  502. //
  503. pCurrentRecordSet = pCurrentRecord1;
  504. pCurrentRecord1->pNext = pCurrentRecord2;
  505. pCurrentRecord2->pNext = pCurrentRecord3;
  506. pCurrentRecord3->pNext = NULL;
  507. //
  508. // Preset server to have ( 1.1.1.1, 2.2.2.2, 3.3.3.3 )
  509. //
  510. Status = DnsReplaceRecordSet( hContext, pCurrentRecordSet, dwFlags, NULL );
  511. if ( Status )
  512. {
  513. printf( "DnsReplaceRecordSet call failed with error: 0x%.8X\n",
  514. Status );
  515. return(-1);
  516. }
  517. system( "pause" );
  518. //
  519. // Set up pCurrentRecordSet ( 1.1.1.1, 2.2.2.2 )
  520. //
  521. pCurrentRecord2->pNext = NULL;
  522. //
  523. // Set up pNewRecordSet ( 1.1.1.1, 3.3.3.3 )
  524. //
  525. pNewRecordSet = pNewRecord1;
  526. pNewRecord1->pNext = pNewRecord2;
  527. pNewRecord2->pNext = pNewRecord3;
  528. pNewRecord3->pNext = NULL;
  529. printf( "DnsModifyRecordSet( Current = 1, 2\n" );
  530. printf( " New = 1, 3\n" );
  531. printf( " Server = 1, 2, 3\n" );
  532. printf( " dwFlags ); ...\n" );
  533. Status = DnsModifyRecordSet( hContext,
  534. pCurrentRecordSet,
  535. pNewRecordSet,
  536. dwFlags,
  537. NULL );
  538. if ( Status )
  539. {
  540. printf( "DnsModifyRecordSet call failed with error: 0x%.8X\n",
  541. Status );
  542. return(-1);
  543. }
  544. printf( "DnsModifyRecordSet call succeeded!\n" );
  545. system( "pause" );
  546. DnsReleaseContextHandle( hContext );
  547. return(0);
  548. }
  549. BOOL
  550. PrepareRecords(
  551. IN LPWSTR lpDomainName,
  552. OUT PDNS_RECORD * ppCurrentRecord1,
  553. OUT PDNS_RECORD * ppCurrentRecord2,
  554. OUT PDNS_RECORD * ppCurrentRecord3,
  555. OUT PDNS_RECORD * ppNewRecord1,
  556. OUT PDNS_RECORD * ppNewRecord2,
  557. OUT PDNS_RECORD * ppNewRecord3,
  558. OUT PDNS_RECORD * ppNewRecord4 )
  559. {
  560. *ppCurrentRecord1 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  561. if ( !*ppCurrentRecord1 )
  562. {
  563. return FALSE;
  564. }
  565. *ppCurrentRecord2 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  566. if ( !*ppCurrentRecord2 )
  567. {
  568. return FALSE;
  569. }
  570. *ppCurrentRecord3 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  571. if ( !*ppCurrentRecord3 )
  572. {
  573. return FALSE;
  574. }
  575. *ppNewRecord1 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  576. if ( !*ppNewRecord1 )
  577. {
  578. return FALSE;
  579. }
  580. *ppNewRecord2 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  581. if ( !*ppNewRecord2 )
  582. {
  583. return FALSE;
  584. }
  585. *ppNewRecord3 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  586. if ( !*ppNewRecord3 )
  587. {
  588. return FALSE;
  589. }
  590. *ppNewRecord4 = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
  591. if ( !*ppNewRecord4 )
  592. {
  593. return FALSE;
  594. }
  595. (*ppCurrentRecord1)->pNext = NULL;
  596. (*ppCurrentRecord1)->nameOwner = (DNS_NAME) lpDomainName;
  597. (*ppCurrentRecord1)->wType = DNS_TYPE_A;
  598. (*ppCurrentRecord1)->wDataLength = sizeof( DNS_A_DATA );
  599. // (*ppCurrentRecord1)->wReserved = 0;
  600. // (*ppCurrentRecord1)->Flags.W = 0;
  601. // (*ppCurrentRecord1)->dwTtl = 0;
  602. (*ppCurrentRecord1)->Data.A.ipAddress = (IP_ADDRESS) 0x01010101; // 1.1.1.1
  603. (*ppCurrentRecord2)->pNext = NULL;
  604. (*ppCurrentRecord2)->nameOwner = (DNS_NAME) lpDomainName;
  605. (*ppCurrentRecord2)->wType = DNS_TYPE_A;
  606. (*ppCurrentRecord2)->wDataLength = sizeof( DNS_A_DATA );
  607. // (*ppCurrentRecord2)->wReserved = 0;
  608. // (*ppCurrentRecord2)->Flags.W = 0;
  609. // (*ppCurrentRecord2)->dwTtl = 0;
  610. (*ppCurrentRecord2)->Data.A.ipAddress = (IP_ADDRESS) 0x02020202; // 2.2.2.2
  611. (*ppCurrentRecord3)->pNext = NULL;
  612. (*ppCurrentRecord3)->nameOwner = (DNS_NAME) lpDomainName;
  613. (*ppCurrentRecord3)->wType = DNS_TYPE_A;
  614. (*ppCurrentRecord3)->wDataLength = sizeof( DNS_A_DATA );
  615. // (*ppCurrentRecord3)->wReserved = 0;
  616. // (*ppCurrentRecord3)->Flags.W = 0;
  617. // (*ppCurrentRecord3)->dwTtl = 0;
  618. (*ppCurrentRecord3)->Data.A.ipAddress = (IP_ADDRESS) 0x03030303; // 3.3.3.3
  619. (*ppNewRecord1)->pNext = NULL;
  620. (*ppNewRecord1)->nameOwner = (DNS_NAME) lpDomainName;
  621. (*ppNewRecord1)->wType = DNS_TYPE_A;
  622. (*ppNewRecord1)->wDataLength = sizeof( DNS_A_DATA );
  623. // (*ppNewRecord1)->wReserved = 0;
  624. // (*ppNewRecord1)->Flags.W = 0;
  625. // (*ppNewRecord1)->dwTtl = 0;
  626. (*ppNewRecord1)->Data.A.ipAddress = (IP_ADDRESS) 0x01010101; // 1.1.1.1
  627. (*ppNewRecord2)->pNext = NULL;
  628. (*ppNewRecord2)->nameOwner = (DNS_NAME) lpDomainName;
  629. (*ppNewRecord2)->wType = DNS_TYPE_A;
  630. (*ppNewRecord2)->wDataLength = sizeof( DNS_A_DATA );
  631. // (*ppNewRecord2)->wReserved = 0;
  632. // (*ppNewRecord2)->Flags.W = 0;
  633. // (*ppNewRecord2)->dwTtl = 0;
  634. (*ppNewRecord2)->Data.A.ipAddress = (IP_ADDRESS) 0x02020202; // 2.2.2.2
  635. (*ppNewRecord3)->pNext = NULL;
  636. (*ppNewRecord3)->nameOwner = (DNS_NAME) lpDomainName;
  637. (*ppNewRecord3)->wType = DNS_TYPE_A;
  638. (*ppNewRecord3)->wDataLength = sizeof( DNS_A_DATA );
  639. // (*ppNewRecord3)->wReserved = 0;
  640. // (*ppNewRecord3)->Flags.W = 0;
  641. // (*ppNewRecord3)->dwTtl = 0;
  642. (*ppNewRecord3)->Data.A.ipAddress = (IP_ADDRESS) 0x03030303; // 3.3.3.3
  643. (*ppNewRecord4)->pNext = NULL;
  644. (*ppNewRecord4)->nameOwner = (DNS_NAME) lpDomainName;
  645. (*ppNewRecord4)->wType = DNS_TYPE_A;
  646. (*ppNewRecord4)->wDataLength = sizeof( DNS_A_DATA );
  647. // (*ppNewRecord4)->wReserved = 0;
  648. // (*ppNewRecord4)->Flags.W = 0;
  649. // (*ppNewRecord4)->dwTtl = 0;
  650. (*ppNewRecord4)->Data.A.ipAddress = (IP_ADDRESS) 0x04040404; // 4.4.4.4
  651. return TRUE;
  652. }