summaryrefslogtreecommitdiff
path: root/librpc/idl/dnsserver.idl
blob: 33fadc60d96e6ea1a0772aa5b5c0abf00fbe24d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
#include "idl_types.h"
/*
  dnsserver interface definition
  for a protocol descrition see [MS-DNSP].pdf
*/

import "misc.idl", "dnsp.idl";

[ uuid("50abc2a4-574d-40b3-9d66-ee4fd5fba076"),
  version(5.0),
  pointer_default(unique),
  helpstring("DNS Server")
] interface dnsserver
{

#define wchar_t uint16
#define BOOLEAN boolean8
#define BOOL boolean32
#define BYTE uint8
#define UCHAR uint8
#define CHAR char
#define PBYTE BYTE*
#define DWORD uint32
#define PDWORD uint32 *

	typedef struct {
		DWORD       StatId;
		WORD        wLength;
		BOOLEAN     fClear;
		UCHAR       fReserved;
	} DNSSRV_STAT_HEADER;


	typedef struct {
		DNSSRV_STAT_HEADER Header;
		BYTE                Buffer[1];
	} DNSSRV_STAT;

	typedef struct {
		DWORD           AddrCount;
		[size_is( AddrCount )] DWORD        AddrArray[];
	} IP4_ARRAY;
#define PIP4_ARRAY IP4_ARRAY*

	typedef struct {
		CHAR MaxSa[32];
		DWORD DnsAddrUserDword[8];
	} DNS_ADDR;

	typedef struct {
		DWORD           MaxCount;
		DWORD           AddrCount;
		DWORD           Tag;
		WORD            Family;
		WORD            WordReserved;
		DWORD           Flags;
		DWORD           MatchFlag;
		DWORD           Reserved1;
		DWORD           Reserved2;
		[size_is( AddrCount )] DNS_ADDR         AddrArray[];
	} DNS_ADDR_ARRAY;
#define PDNS_ADDR_ARRAY DNS_ADDR_ARRAY*

	/* */
	/*   RPC buffer type for returned data */
	/* */
	typedef struct {
		DWORD                       dwLength;
		[size_is(dwLength)] BYTE    Buffer[];
	} DNS_RPC_BUFFER;


	/* */
	/* Server data types */
	/* */
	typedef struct {
		/* version */
		/* basic configuration flags */

		DWORD          dwVersion;
		UCHAR          fBootMethod;
		BOOLEAN        fAdminConfigured;
		BOOLEAN        fAllowUpdate;
		BOOLEAN        fDsAvailable;

		/* */
		/*   pointer section */
		/* */

		[string, charset(UTF8)] char *           pszServerName;

		/*   DS container */

		[string, charset(UTF16)] wchar_t *        pszDsContainer;

		/*   IP interfaces */

		PIP4_ARRAY     aipServerAddrs;
		PIP4_ARRAY     aipListenAddrs;

		/*   forwarders */

		PIP4_ARRAY     aipForwarders;

		/*   future extensions */

		PDWORD         pExtension1;
		PDWORD         pExtension2;
		PDWORD         pExtension3;
		PDWORD         pExtension4;
		PDWORD         pExtension5;

		/* */
		/*   DWORD section */
		/* */

		/*   logging */

		DWORD          dwLogLevel;
		DWORD          dwDebugLevel;
		/*   configuration DWORDs */

		DWORD         dwForwardTimeout;
		DWORD         dwRpcProtocol;
		DWORD         dwNameCheckFlag;
		DWORD         cAddressAnswerLimit;
		DWORD         dwRecursionRetry;
		DWORD         dwRecursionTimeout;
		DWORD         dwMaxCacheTtl;
		DWORD         dwDsPollingInterval;

		/*   aging / scavenging */

		DWORD         dwScavengingInterval;
		DWORD         dwDefaultRefreshInterval;
		DWORD         dwDefaultNoRefreshInterval;

		DWORD         dwReserveArray[10];

		/* */
		/*   BYTE section */
		/* */
		/*   configuration flags */

		BOOLEAN       fAutoReverseZones;
		BOOLEAN       fAutoCacheUpdate;

		/*   recursion control */

		BOOLEAN       fRecurseAfterForwarding;
		BOOLEAN       fForwardDelegations;
		BOOLEAN       fNoRecursion;
		BOOLEAN       fSecureResponses;

		/*   lookup control */

		BOOLEAN       fRoundRobin;
		BOOLEAN       fLocalNetPriority;

		/*   BIND compatibility and mimicking */

		BOOLEAN       fBindSecondaries;
		BOOLEAN       fWriteAuthorityNs;

		/*   Bells and whistles */

		BOOLEAN       fStrictFileParsing;
		BOOLEAN       fLooseWildcarding;

		/*   aging / scavenging */

		BOOLEAN       fDefaultAgingState;
		BOOLEAN       fReserveArray[15];
	}
	DNS_RPC_SERVER_INFO_W2K;

	typedef struct {
		[string, charset(UTF8)] uint8 *extension;
	} DNS_EXTENSION;

	typedef [public] struct {
		DWORD          dwRpcStructureVersion;
		DWORD          dwReserved0;

		/*   basic configuration flags */

		DWORD          dwVersion;
		UCHAR          fBootMethod;
		BOOLEAN        fAdminConfigured;
		BOOLEAN        fAllowUpdate;
		BOOLEAN        fDsAvailable;

		/* */
		/*   pointer section */
		/* */

		[string, charset(UTF8)] char *        pszServerName;

		/*   DS container */

		[string, charset(UTF16)] wchar_t *     pszDsContainer;

		/*   IP interfaces */

		PIP4_ARRAY     aipServerAddrs;
		PIP4_ARRAY     aipListenAddrs;

		/*   forwarders */

		PIP4_ARRAY     aipForwarders;

		/*   logging */

		PIP4_ARRAY aipLogFilter;
		[string, charset(UTF16)] wchar_t *  pwszLogFilePath;

		/*   Server domain/forest */

		[string, charset(UTF8)] char *            pszDomainName;         /*   UTF-8 FQDN */
		[string, charset(UTF8)] char *            pszForestName;         /*   UTF-8 FQDN */

		/*   Built-in directory partitions */

		[string, charset(UTF8)] char *            pszDomainDirectoryPartition;    /*   UTF-8 FQDN */
		[string, charset(UTF8)] char *            pszForestDirectoryPartition;    /*   UTF-8 FQDN */

		/*   future extensions */
		DNS_EXTENSION       pExtensions[6];

		/* */
		/*   DWORD section */
		/* */

		/*   logging */

		DWORD          dwLogLevel;
		DWORD          dwDebugLevel;

		/*   configuration DWORDs */
		DWORD         dwForwardTimeout;
		DWORD         dwRpcProtocol;
		DWORD         dwNameCheckFlag;
		DWORD         cAddressAnswerLimit;
		DWORD         dwRecursionRetry;
		DWORD         dwRecursionTimeout;
		DWORD         dwMaxCacheTtl;
		DWORD         dwDsPollingInterval;
		DWORD         dwLocalNetPriorityNetMask;

		/*   aging and scavenging */

		DWORD         dwScavengingInterval;
		DWORD         dwDefaultRefreshInterval;
		DWORD         dwDefaultNoRefreshInterval;
		DWORD         dwLastScavengeTime;

		/*   more logging */

		DWORD         dwEventLogLevel;
		DWORD         dwLogFileMaxSize;

		/*   Active Directory information */

		DWORD         dwDsForestVersion;
		DWORD         dwDsDomainVersion;
		DWORD         dwDsDsaVersion;

		DWORD         dwReserveArray[ 4 ];

		/* */
		/*   BYTE section */
		/* */
		/*   configuration flags */

		BOOLEAN       fAutoReverseZones;
		BOOLEAN       fAutoCacheUpdate;

		/*   recursion control */

		BOOLEAN       fRecurseAfterForwarding;
		BOOLEAN       fForwardDelegations;
		BOOLEAN       fNoRecursion;
		BOOLEAN       fSecureResponses;

		/*   lookup control */

		BOOLEAN       fRoundRobin;
		BOOLEAN       fLocalNetPriority;

		/*   BIND compatibility and mimicking */

		BOOLEAN       fBindSecondaries;
		BOOLEAN       fWriteAuthorityNs;

		/*   Bells and whistles */

		BOOLEAN       fStrictFileParsing;
		BOOLEAN        fLooseWildcarding;

		/*   aging \ scavenging */

		BOOLEAN        fDefaultAgingState;

		BOOLEAN     fReserveArray[ 15 ];
	}
	DNS_RPC_SERVER_INFO_DOTNET;

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;

		/*   basic configuration flags */

		DWORD                  dwVersion;
		UCHAR                  fBootMethod;
		BOOLEAN                fAdminConfigured;
		BOOLEAN                fAllowUpdate;
		BOOLEAN                fDsAvailable;

		/* */
		/*   pointer section */
		/* */

		[string, charset(UTF8)] char *                     pszServerName;

		/*   DS container */

		[string, charset(UTF16)] wchar_t *                  pszDsContainer;

		/*   IP interfaces */

		PDNS_ADDR_ARRAY        aipServerAddrs;
		PDNS_ADDR_ARRAY        aipListenAddrs;

		/*   forwarders */

		PDNS_ADDR_ARRAY        aipForwarders;

		/*   logging */

		PDNS_ADDR_ARRAY        aipLogFilter;
		[string, charset(UTF16)] wchar_t *              pwszLogFilePath;

		/*   Server domain/forest */

		[string, charset(UTF8)] char *                     pszDomainName;         /*   UTF-8 FQDN */
		[string, charset(UTF8)] char *                     pszForestName;         /*   UTF-8 FQDN */

		/*   Built-in directory partitions */

		[string, charset(UTF8)] char *            pszDomainDirectoryPartition;    /*   UTF-8 FQDN */
		[string, charset(UTF8)] char *            pszForestDirectoryPartition;    /*   UTF-8 FQDN */

		/*   future extensions */
		DNS_EXTENSION       pExtensions[6];

		/* */
		/*   DWORD section */
		/* */

		/*   logging */

		DWORD          dwLogLevel;
		DWORD          dwDebugLevel;

		/*   configuration DWORDs */

		DWORD          dwForwardTimeout;
		DWORD          dwRpcProtocol;
		DWORD          dwNameCheckFlag;
		DWORD          cAddressAnswerLimit;
		DWORD          dwRecursionRetry;
		DWORD          dwRecursionTimeout;
		DWORD          dwMaxCacheTtl;
		DWORD          dwDsPollingInterval;
		DWORD          dwLocalNetPriorityNetMask;

		/*   aging and scavenging */

		DWORD          dwScavengingInterval;
		DWORD          dwDefaultRefreshInterval;
		DWORD          dwDefaultNoRefreshInterval;
		DWORD          dwLastScavengeTime;

		/*   more logging */

		DWORD          dwEventLogLevel;
		DWORD          dwLogFileMaxSize;

		/*   Active Directory information */

		DWORD          dwDsForestVersion;
		DWORD          dwDsDomainVersion;
		DWORD          dwDsDsaVersion;
		BOOLEAN        fReadOnlyDC;

		DWORD          dwReserveArray[ 3 ];

		/* */
		/*   BYTE section */
		/* */
		/*   configuration flags */

		BOOLEAN        fAutoReverseZones;
		BOOLEAN        fAutoCacheUpdate;

		/*   recursion control */

		BOOLEAN        fRecurseAfterForwarding;
		BOOLEAN        fForwardDelegations;
		BOOLEAN        fNoRecursion;
		BOOLEAN        fSecureResponses;
		/*   lookup control */

		BOOLEAN      fRoundRobin;
		BOOLEAN      fLocalNetPriority;

		/*   BIND compatibility and mimicking */

		BOOLEAN      fBindSecondaries;
		BOOLEAN      fWriteAuthorityNs;

		/*   Bells and whistles */

		BOOLEAN      fStrictFileParsing;
		BOOLEAN      fLooseWildcarding;

		/*   aging \ scavenging */

		BOOLEAN      fDefaultAgingState;

		BOOLEAN     fReserveArray[ 15 ];
	}
	DNS_RPC_SERVER_INFO_LONGHORN;
#define DNS_RPC_SERVER_INFO DNS_RPC_SERVER_INFO_LONGHORN

	typedef struct {
		DWORD       fRecurseAfterForwarding;
		DWORD       dwForwardTimeout;
		PIP4_ARRAY aipForwarders;
	}
	DNS_RPC_FORWARDERS_W2K;

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;
		DWORD       fRecurseAfterForwarding;
		DWORD       dwForwardTimeout;
		PIP4_ARRAY aipForwarders;
	}
	DNS_RPC_FORWARDERS_DOTNET;

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;
		DWORD               fRecurseAfterForwarding;
		DWORD               dwForwardTimeout;
		PDNS_ADDR_ARRAY     aipForwarders;
	}
	DNS_RPC_FORWARDERS_LONGHORN;
#define DNS_RPC_FORWARDERS DNS_RPC_FORWARDERS_LONGHORN


	/* */
	/*   Basic zone data */
	/* */

	typedef [bitmap32bit] bitmap {
		RPC_ZONE_PAUSED        = 0x001,
			RPC_ZONE_SHUTDOWN      = 0x002,
			RPC_ZONE_REVERSE       = 0x004,
			RPC_ZONE_AUTOCREATED   = 0x008,
			RPC_ZONE_DSINTEGRATED  = 0x010,
			RPC_ZONE_AGING         = 0x020,
			RPC_ZONE_UPDATE        = 0x0C0, /* two bits */
			RPC_ZONE_READONLY      = 0x100
			} DNS_RPC_ZONE_FLAGS;

	typedef struct {
		[string, charset(UTF16)] uint16 *      pszZoneName;
		DNS_RPC_ZONE_FLAGS      Flags;
		UCHAR                   ZoneType;
		UCHAR                   Version;
	}
	DNS_RPC_ZONE_W2K;
#define PDNS_RPC_ZONE_W2K DNS_RPC_ZONE_W2K*

	typedef struct {
		DWORD                   dwRpcStructureVersion;
		DWORD                   dwReserved0;
		[string, charset(UTF16)] wchar_t *      pszZoneName;
		DNS_RPC_ZONE_FLAGS      Flags;
		UCHAR                   ZoneType;
		UCHAR                   Version;
		DWORD                   dwDpFlags;
		[string, charset(UTF8)] char *         pszDpFqdn;
	}
	DNS_RPC_ZONE_DOTNET;
#define DNS_RPC_ZONE DNS_RPC_ZONE_DOTNET
#define PDNS_RPC_ZONE_DOTNET DNS_RPC_ZONE_DOTNET*


	/* */
	/*   Zone enumeration */
	/* */

	typedef struct {
		[range(0,500000)]       DWORD               dwZoneCount;
		[size_is(dwZoneCount)] PDNS_RPC_ZONE_W2K    ZoneArray[];
	}
	DNS_RPC_ZONE_LIST_W2K;


	typedef struct {
		DWORD                   dwRpcStructureVersion;
		DWORD                   dwReserved0;
		[range(0,500000)]       DWORD                   dwZoneCount;
		[size_is(dwZoneCount)] PDNS_RPC_ZONE_DOTNET     ZoneArray[];
	}
	DNS_RPC_ZONE_LIST_DOTNET;
#define DNS_RPC_ZONE_LIST DNS_RPC_ZONE_LIST_DOTNET


	/* */
	/*   Directory partition enumeration and info */
	/* */

	typedef struct {
		DWORD           dwRpcStructureVersion;
		DWORD           dwReserved0;

		[string, charset(UTF8)] char * pszDpFqdn;
		DWORD           dwFlags;
		DWORD           dwZoneCount;
	}
	DNS_RPC_DP_ENUM;
#define PDNS_RPC_DP_ENUM DNS_RPC_DP_ENUM*

	typedef struct {
		DWORD                   dwRpcStructureVersion;
		DWORD                   dwReserved0;
		[range(0,5000)]         DWORD               dwDpCount;
		[size_is(dwDpCount)]    PDNS_RPC_DP_ENUM    DpArray[];
	}
	DNS_RPC_DP_LIST;


	typedef struct {
		[string, charset(UTF16)] wchar_t *      pszReplicaDn;
	}
	DNS_RPC_DP_REPLICA;
#define PDNS_RPC_DP_REPLICA DNS_RPC_DP_REPLICA*

	typedef struct {
		DWORD           dwRpcStructureVersion;
		DWORD           dwReserved0;

		[string, charset(UTF8)] char *          pszDpFqdn;
		[string, charset(UTF16)] wchar_t *       pszDpDn;
		[string, charset(UTF16)] wchar_t *       pszCrDn;
		DWORD           dwFlags;
		DWORD           dwZoneCount;
		DWORD           dwState;

		DWORD           dwReserved[    3 ];
		DNS_EXTENSION   pwszReserved[ 3 ];
		[range(0,10000)]               DWORD                    dwReplicaCount;
		[size_is(dwReplicaCount)]      PDNS_RPC_DP_REPLICA      ReplicaArray[];
	}
	DNS_RPC_DP_INFO;


	/* */
	/*   Enlist (or create) directory partition */
	/* */

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;
		[string, charset(UTF8)] char * pszDpFqdn;       /*      UTF8 */
		DWORD       dwOperation;
	}
	DNS_RPC_ENLIST_DP;

	/* */
	/*   Zone export */
	/* */

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		[string, charset(UTF8)] char * pszZoneExportFile;
	}
	DNS_RPC_ZONE_EXPORT_INFO;

	/* */
	/*   Zone property data */
	/* */

	typedef struct {
		DWORD       fSecureSecondaries;
		DWORD       fNotifyLevel;
		PIP4_ARRAY aipSecondaries;
		PIP4_ARRAY aipNotify;
	}
	DNS_RPC_ZONE_SECONDARIES_W2K;

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		DWORD         fSecureSecondaries;
		DWORD         fNotifyLevel;
		PIP4_ARRAY    aipSecondaries;
		PIP4_ARRAY    aipNotify;
	}
	DNS_RPC_ZONE_SECONDARIES_DOTNET;

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;

		DWORD                 fSecureSecondaries;
		DWORD                 fNotifyLevel;
		PDNS_ADDR_ARRAY       aipSecondaries;
		PDNS_ADDR_ARRAY       aipNotify;
	}
	DNS_RPC_ZONE_SECONDARIES_LONGHORN;
#define DNS_RPC_ZONE_SECONDARIES DNS_RPC_ZONE_SECONDARIES_LONGHORN

	typedef struct {
		DWORD       fDsIntegrated;
		[string, charset(UTF8)] char * pszFileName;
	}
	DNS_RPC_ZONE_DATABASE_W2K;

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		DWORD       fDsIntegrated;
		[string, charset(UTF8)] char * pszFileName;
	}
	DNS_RPC_ZONE_DATABASE_DOTNET;
#define DNS_RPC_ZONE_DATABASE DNS_RPC_ZONE_DATABASE_DOTNET

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;
		[string, charset(UTF8)] char * pszDestPartition;
	}
	DNS_RPC_ZONE_CHANGE_DP;

	typedef struct {
		[string, charset(UTF8)] char * pszZoneName;
		DWORD       dwZoneType;
		DWORD       fReverse;
		DWORD       fAllowUpdate;
		DWORD       fPaused;
		DWORD       fShutdown;
		DWORD       fAutoCreated;

		/* Database info */
		DWORD       fUseDatabase;
		[string, charset(UTF8)] char * pszDataFile;

		/* Masters */
		PIP4_ARRAY aipMasters;

		/* Secondaries */
		DWORD      fSecureSecondaries;
		DWORD      fNotifyLevel;
		PIP4_ARRAY aipSecondaries;
		PIP4_ARRAY aipNotify;

		/* WINS or NetBIOS lookup */
		DWORD      fUseWins;
		DWORD      fUseNbstat;

		/* Aging */
		DWORD         fAging;
		DWORD         dwNoRefreshInterval;
		DWORD         dwRefreshInterval;
		DWORD         dwAvailForScavengeTime;
		PIP4_ARRAY    aipScavengeServers;

		/* save some space, just in case */
		/* avoid versioning issues if possible */
		DWORD      pvReserved1;
		DWORD      pvReserved2;
		DWORD      pvReserved3;
		DWORD       pvReserved4;
	}
	DNS_RPC_ZONE_INFO_W2K;

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		[string, charset(UTF8)] char * pszZoneName;
		DWORD       dwZoneType;
		DWORD       fReverse;
		DWORD       fAllowUpdate;
		DWORD       fPaused;
		DWORD       fShutdown;
		DWORD       fAutoCreated;

		/* Database info */
		DWORD       fUseDatabase;
		[string, charset(UTF8)] char * pszDataFile;

		/* Masters */
		PIP4_ARRAY aipMasters;

		/* Secondaries */
		DWORD      fSecureSecondaries;
		DWORD      fNotifyLevel;
		PIP4_ARRAY aipSecondaries;
		PIP4_ARRAY aipNotify;

		/* WINS or NetBIOS lookup */
		DWORD      fUseWins;
		DWORD      fUseNbstat;

		/* Aging */
		DWORD         fAging;
		DWORD         dwNoRefreshInterval;
		DWORD         dwRefreshInterval;
		DWORD         dwAvailForScavengeTime;
		PIP4_ARRAY    aipScavengeServers;

		/* Forwarder zones */
		DWORD      dwForwarderTimeout;
		DWORD      fForwarderSlave;

		/* Stub zones */
		PIP4_ARRAY aipLocalMasters;

		/* Directory partition */
		DWORD       dwDpFlags;
		[string, charset(UTF8)] char *      pszDpFqdn;
		[string, charset(UTF16)] wchar_t *   pwszZoneDn;

		/* Xfr time information */
		DWORD      dwLastSuccessfulSoaCheck;
		DWORD      dwLastSuccessfulXfr;

		/* save some space, just in case */
		DWORD      dwReserved1;
		DWORD         dwReserved2;
		DWORD         dwReserved3;
		DWORD         dwReserved4;
		DWORD         dwReserved5;
		[string, charset(UTF8)]   char *       pReserved1;
		[string, charset(UTF8)]   char *       pReserved2;
		[string, charset(UTF8)]   char *       pReserved3;
		[string, charset(UTF8)]   char *       pReserved4;
	}
	DNS_RPC_ZONE_INFO_DOTNET;

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;

		[string, charset(UTF8)] char *                  pszZoneName;
		DWORD                  dwZoneType;
		DWORD                  fReverse;
		DWORD                  fAllowUpdate;
		DWORD                  fPaused;
		DWORD                  fShutdown;
		DWORD                  fAutoCreated;

		/* Database info */
		DWORD                  fUseDatabase;
		[string, charset(UTF8)] char *                  pszDataFile;

		/* Masters */
		PDNS_ADDR_ARRAY        aipMasters;

		/* Secondaries */
		DWORD                  fSecureSecondaries;
		DWORD                  fNotifyLevel;
		PDNS_ADDR_ARRAY        aipSecondaries;
		PDNS_ADDR_ARRAY        aipNotify;

		/* WINS or NetBIOS lookup */
		DWORD              fUseWins;
		DWORD              fUseNbstat;

		/* Aging */
		DWORD                  fAging;
		DWORD                  dwNoRefreshInterval;
		DWORD                  dwRefreshInterval;
		DWORD                  dwAvailForScavengeTime;
		PDNS_ADDR_ARRAY        aipScavengeServers;

		/* Forwarder zones */
		DWORD              dwForwarderTimeout;
		DWORD              fForwarderSlave;

		/* Stub zones */
		PDNS_ADDR_ARRAY        aipLocalMasters;

		/* Directory partition */
		DWORD              dwDpFlags;
		[string, charset(UTF8)] char *              pszDpFqdn;
		[string, charset(UTF16)] wchar_t *             pwszZoneDn;
		/* Xfr time information */
		DWORD              dwLastSuccessfulSoaCheck;
		DWORD              dwLastSuccessfulXfr;

		DWORD                 fQueuedForBackgroundLoad;
		DWORD                 fBackgroundLoadInProgress;
		BOOL                  fReadOnlyZone;

		/* Additional zone transfer information */
		DWORD              dwLastXfrAttempt;
		DWORD              dwLastXfrResult;
	}
	DNS_RPC_ZONE_INFO_LONGHORN;
#define DNS_RPC_ZONE_INFO DNS_RPC_ZONE_INFO_LONGHORN

	/* */
	/*   Zone create data */
	/* */

	typedef struct {
		[string, charset(UTF8)] char *       pszZoneName;
		DWORD       dwZoneType;
		DWORD       fAllowUpdate;
		DWORD       fAging;
		DWORD       dwFlags;

		/*   Database info */

		[string, charset(UTF8)] char *       pszDataFile;
		DWORD       fDsIntegrated;
		DWORD       fLoadExisting;

		/*   Admin name (if auto-create SOA) */

		[string, charset(UTF8)] char *           pszAdmin;

		/*   Masters (if secondary) */

		PIP4_ARRAY   aipMasters;

		/*   Secondaries */

		PIP4_ARRAY   aipSecondaries;
		DWORD        fSecureSecondaries;
		DWORD        fNotifyLevel;

		/*   Reserve some space to avoid versioning issues */

		[string, charset(UTF8)]   char   *       pvReserved1;
		[string, charset(UTF8)]   char   *       pvReserved2;
		[string, charset(UTF8)]   char   *       pvReserved3;
		[string, charset(UTF8)]   char   *       pvReserved4;
		[string, charset(UTF8)]   char   *       pvReserved5;
		[string, charset(UTF8)]   char   *       pvReserved6;
		[string, charset(UTF8)]   char   *       pvReserved7;
		[string, charset(UTF8)]   char   *       pvReserved8;
		DWORD         dwReserved1;
		DWORD         dwReserved2;
		DWORD         dwReserved3;
		DWORD         dwReserved4;
		DWORD         dwReserved5;
		DWORD         dwReserved6;
		DWORD         dwReserved7;
		DWORD         dwReserved8;
	}
	DNS_RPC_ZONE_CREATE_INFO_W2K;

	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		[string, charset(UTF8)] char *       pszZoneName;
		DWORD       dwZoneType;
		DWORD       fAllowUpdate;
		DWORD       fAging;
		DWORD       dwFlags;

		/*   Database info */

		[string, charset(UTF8)] char *       pszDataFile;
		DWORD       fDsIntegrated;
		DWORD       fLoadExisting;

		/*   Admin name (if auto-create SOA) */

		[string, charset(UTF8)] char *            pszAdmin;

		/*   Masters (if secondary) */

		PIP4_ARRAY    aipMasters;

		/*   Secondaries */

		PIP4_ARRAY    aipSecondaries;
		DWORD         fSecureSecondaries;
		DWORD         fNotifyLevel;

		/*   Forwarder zones */

		DWORD         dwTimeout;
		DWORD         fRecurseAfterForwarding;

		/*   Directory partition */

		DWORD       dwDpFlags;      /* specify built-in DP or */
		[string, charset(UTF8)] char *       pszDpFqdn;     /*      UTF8 FQDN of partition */

		DWORD       dwReserved[ 32 ];
	}
	DNS_RPC_ZONE_CREATE_INFO_DOTNET;


	typedef struct {
		DWORD                  dwRpcStructureVersion;
		DWORD                  dwReserved0;

		[string, charset(UTF8)] char *                  pszZoneName;
		DWORD                  dwZoneType;
		DWORD                  fAllowUpdate;
		DWORD                  fAging;
		DWORD                  dwFlags;

		/*   Database info */

		[string, charset(UTF8)] char *                  pszDataFile;
		DWORD                  fDsIntegrated;
		DWORD                  fLoadExisting;

		/*   Admin name (if auto-create SOA) */

		[string, charset(UTF8)] char *                    pszAdmin;

		/*   Masters (if secondary) */

		PDNS_ADDR_ARRAY        aipMasters;

		/*   Secondaries */

		PDNS_ADDR_ARRAY        aipSecondaries;
		DWORD                  fSecureSecondaries;
		DWORD                  fNotifyLevel;

		/*   Forwarder zones */

		DWORD                  dwTimeout;
		DWORD                  fRecurseAfterForwarding;

		/*   Directory partition */

		DWORD                  dwDpFlags;      /* specify built-in DP or */
		[string, charset(UTF8)] char *                  pszDpFqdn;     /*      UTF8 FQDN of partition */

		DWORD               dwReserved[ 32 ];
	}
	DNS_RPC_ZONE_CREATE_INFO_LONGHORN;
#define DNS_RPC_ZONE_CREATE_INFO DNS_RPC_ZONE_CREATE_INFO_LONGHORN

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;

		DWORD                  dwAutoConfigFlags;
		DWORD                  dwReserved1;
		[string, charset(UTF8)] char *                  pszNewDomainName;
	}
	DNS_RPC_AUTOCONFIGURE;

	/* */
	/*   EnumZones2 filter specification */
	/* */
	typedef struct {
		DWORD       dwRpcStructureVersion;
		DWORD       dwReserved0;

		DWORD       dwFilter;
		[string, charset(UTF8)] char *       pszPartitionFqdn;
		[string, charset(UTF8)] char *       pszQueryString;

		DNS_EXTENSION     pszReserved[ 6 ];
	}
	DNS_RPC_ENUM_ZONES_FILTER;

	/* */
	/*   RPC record structure */
	/* */

	typedef struct {
		[value(strlen(str))] uint8 len;
		[charset(UTF8)] uint8 str[len];
	} DNS_RPC_NAME;

	typedef [nodiscriminant,gensize,flag(NDR_NOALIGN)] union {
		[case(DNS_TYPE_PTR)]   DNS_RPC_NAME name;
		[case(DNS_TYPE_NS)]    DNS_RPC_NAME name;
		[case(DNS_TYPE_CNAME)] DNS_RPC_NAME name;
		[case(DNS_TYPE_DNAME)] DNS_RPC_NAME name;
		[case(DNS_TYPE_MB)]    DNS_RPC_NAME name;
		[case(DNS_TYPE_MR)]    DNS_RPC_NAME name;
		[case(DNS_TYPE_MG)]    DNS_RPC_NAME name;
		[case(DNS_TYPE_MD)]    DNS_RPC_NAME name;
		[case(DNS_TYPE_MF)]    DNS_RPC_NAME name;
	} DNS_RPC_DATA;

	typedef struct {
		[value(ndr_size_DNS_RPC_DATA(&data,wType,ndr->flags))] uint16 wDataLength;
		dns_record_type        wType;
		DWORD       dwFlags;
		DWORD       dwSerial;
		DWORD       dwTtlSeconds;
		DWORD       dwTimeStamp;
		DWORD       dwReserved;
		[subcontext(0),subcontext_size(wDataLength),switch_is(wType)] DNS_RPC_DATA data;
	} DNS_RPC_RECORD;

	typedef struct {
		[value(ndr_size_DNS_RPC_DATA(&rec.data,rec.wType,ndr->flags))] uint3264 wContextLength;
		DNS_RPC_RECORD rec;
	} DNS_RPC_RECORD_BUF;


	/* */
	/*   These RPC structures have no version because they are simple */
	/*   are they are explicitly defined by their names. */
	/* */

	typedef struct {
		DWORD       dwParam;
		[string, charset(UTF8)] char *       pszNodeName;
	}
	DNS_RPC_NAME_AND_PARAM;

	typedef struct {
		DWORD               dwRpcStructureVersion;
		DWORD               dwReserved0;

		DWORD                 dwContext;
		DWORD                 dwReserved1;
		[string, charset(UTF8)] char *                 pszContextName;
		PDNS_ADDR_ARRAY       aipValidateAddrs;
	}
	DNS_RPC_IP_VALIDATE;

	/* */
	/*   String array */
	/* */
	typedef struct {
		[range(0,10000)]        DWORD       dwCount;
		[size_is(dwCount),string,charset(UTF8)]      char *       pszStrings[];
	} DNS_RPC_UTF8_STRING_LIST;

	/* */
	/*   Union of RPC types */
	/* */
	typedef [v1_enum] enum {
		DNSSRV_TYPEID_NULL                      = 0,
		DNSSRV_TYPEID_DWORD                     = 1,
		DNSSRV_TYPEID_LPSTR                     = 2,
		DNSSRV_TYPEID_LPWSTR                    = 3,
		DNSSRV_TYPEID_IPARRAY                   = 4,
		DNSSRV_TYPEID_BUFFER                    = 5,
		DNSSRV_TYPEID_SERVER_INFO_W2K           = 6,
		DNSSRV_TYPEID_STATS                     = 7,
		DNSSRV_TYPEID_FORWARDERS_W2K            = 8,
		DNSSRV_TYPEID_ZONE_W2K                  = 9,
		DNSSRV_TYPEID_ZONE_INFO_W2K             = 10,
		DNSSRV_TYPEID_ZONE_SECONDARIES_W2K      = 11,
		DNSSRV_TYPEID_ZONE_DATABASE_W2K         = 12,
		DNSSRV_TYPEID_ZONE_TYPE_RESET_W2K       = 13,
		DNSSRV_TYPEID_ZONE_CREATE_W2K           = 14,
		DNSSRV_TYPEID_NAME_AND_PARAM            = 15,
		DNSSRV_TYPEID_ZONE_LIST_W2K             = 16,
		DNSSRV_TYPEID_ZONE_RENAME               = 17,
		DNSSRV_TYPEID_ZONE_EXPORT               = 18,
		DNSSRV_TYPEID_SERVER_INFO_DOTNET        = 19,
		DNSSRV_TYPEID_FORWARDERS_DOTNET         = 20,
		DNSSRV_TYPEID_ZONE                      = 21,
		DNSSRV_TYPEID_ZONE_INFO_DOTNET          = 22,
		DNSSRV_TYPEID_ZONE_SECONDARIES_DOTNET   = 23,
		DNSSRV_TYPEID_ZONE_DATABASE             = 24,
		DNSSRV_TYPEID_ZONE_TYPE_RESET_DOTNET    = 25,
		DNSSRV_TYPEID_ZONE_CREATE_DOTNET        = 26,
		DNSSRV_TYPEID_ZONE_LIST                 = 27,
		DNSSRV_TYPEID_DP_ENUM                   = 28,
		DNSSRV_TYPEID_DP_INFO                   = 29,
		DNSSRV_TYPEID_DP_LIST                   = 30,
		DNSSRV_TYPEID_ENLIST_DP                 = 31,
		DNSSRV_TYPEID_ZONE_CHANGE_DP            = 32,
		DNSSRV_TYPEID_ENUM_ZONES_FILTER         = 33,
		DNSSRV_TYPEID_ADDRARRAY                 = 34,
		DNSSRV_TYPEID_SERVER_INFO               = 35,
		DNSSRV_TYPEID_ZONE_INFO                 = 36,
		DNSSRV_TYPEID_FORWARDERS                = 37,
		DNSSRV_TYPEID_ZONE_SECONDARIES          = 38,
		DNSSRV_TYPEID_ZONE_TYPE_RESET           = 39,
		DNSSRV_TYPEID_ZONE_CREATE               = 40,
		DNSSRV_TYPEID_IP_VALIDATE               = 41,
		DNSSRV_TYPEID_AUTOCONFIGURE             = 42,
		DNSSRV_TYPEID_UTF8_STRING_LIST          = 43,
		DNSSRV_TYPEID_UNICODE_STRING_LIST       = 44
	} DNS_RPC_TYPEID;


	typedef [switch_type(uint3264)] union {
		[case(DNSSRV_TYPEID_NULL)]      PBYTE       Null;

		[case(DNSSRV_TYPEID_DWORD)]         DWORD        Dword;

		[case(DNSSRV_TYPEID_LPSTR)]         [string, charset(UTF8)] char *        String;

		[case(DNSSRV_TYPEID_LPWSTR)]        [string, charset(UTF16)] wchar_t *     WideString;

		[case(DNSSRV_TYPEID_IPARRAY)]       IP4_ARRAY   *IpArray;

		[case(DNSSRV_TYPEID_BUFFER)]
		DNS_RPC_BUFFER                              *Buffer;

		[case(DNSSRV_TYPEID_SERVER_INFO_W2K)]
		DNS_RPC_SERVER_INFO_W2K                     *ServerInfoW2K;

		[case(DNSSRV_TYPEID_STATS)]
		DNSSRV_STAT                                 *Stats;

		[case(DNSSRV_TYPEID_FORWARDERS_W2K)]
		DNS_RPC_FORWARDERS_W2K                      *ForwardersW2K;

		[case(DNSSRV_TYPEID_ZONE_W2K)]
		DNS_RPC_ZONE_W2K                            *ZoneW2K;

		[case(DNSSRV_TYPEID_ZONE_INFO_W2K)]
		DNS_RPC_ZONE_INFO_W2K                       *ZoneInfoW2K;

		[case(DNSSRV_TYPEID_ZONE_SECONDARIES_W2K)]
		DNS_RPC_ZONE_SECONDARIES_W2K                *SecondariesW2K;

		[case(DNSSRV_TYPEID_ZONE_DATABASE_W2K)]
		DNS_RPC_ZONE_DATABASE_W2K                   *DatabaseW2K;

		[case(DNSSRV_TYPEID_ZONE_CREATE_W2K)]
		DNS_RPC_ZONE_CREATE_INFO_W2K                *ZoneCreateW2K;

		[case(DNSSRV_TYPEID_NAME_AND_PARAM)]
		DNS_RPC_NAME_AND_PARAM                      *NameAndParam;

		[case(DNSSRV_TYPEID_ZONE_LIST_W2K)]
		DNS_RPC_ZONE_LIST_W2K                       *ZoneListW2K;

		[case(DNSSRV_TYPEID_SERVER_INFO_DOTNET)]
		DNS_RPC_SERVER_INFO_DOTNET                  *ServerInfoDotNet;

		[case(DNSSRV_TYPEID_FORWARDERS_DOTNET)]
		DNS_RPC_FORWARDERS_DOTNET                   *ForwardersDotNet;

		[case(DNSSRV_TYPEID_ZONE)]
		DNS_RPC_ZONE                                *Zone;

		[case(DNSSRV_TYPEID_ZONE_INFO_DOTNET)]
		DNS_RPC_ZONE_INFO_DOTNET                    *ZoneInfoDotNet;

		[case(DNSSRV_TYPEID_ZONE_SECONDARIES_DOTNET)]
		DNS_RPC_ZONE_SECONDARIES_DOTNET        *SecondariesDotNet;

		[case(DNSSRV_TYPEID_ZONE_DATABASE)]
		DNS_RPC_ZONE_DATABASE                       *Database;

		[case(DNSSRV_TYPEID_ZONE_CREATE_DOTNET)]
		DNS_RPC_ZONE_CREATE_INFO_DOTNET             *ZoneCreateDotNet;

		[case(DNSSRV_TYPEID_ZONE_LIST)]
		DNS_RPC_ZONE_LIST                           *ZoneList;

		[case(DNSSRV_TYPEID_ZONE_EXPORT)]
		DNS_RPC_ZONE_EXPORT_INFO                    *ZoneExport;

		[case(DNSSRV_TYPEID_DP_INFO)]
		DNS_RPC_DP_INFO                             *DirectoryPartition;

		[case(DNSSRV_TYPEID_DP_ENUM)]
		DNS_RPC_DP_ENUM                             *DirectoryPartitionEnum;

		[case(DNSSRV_TYPEID_DP_LIST)]
		DNS_RPC_DP_LIST                             *DirectoryPartitionList;

		[case(DNSSRV_TYPEID_ENLIST_DP)]
		DNS_RPC_ENLIST_DP                           *EnlistDirectoryPartition;

		[case(DNSSRV_TYPEID_ZONE_CHANGE_DP)]
		DNS_RPC_ZONE_CHANGE_DP                 *ZoneChangeDirectoryPartition;

		[case(DNSSRV_TYPEID_ENUM_ZONES_FILTER)]
		DNS_RPC_ENUM_ZONES_FILTER                   *EnumZonesFilter;

		[case(DNSSRV_TYPEID_ADDRARRAY)]
		DNS_ADDR_ARRAY                              *AddrArray;

		[case(DNSSRV_TYPEID_SERVER_INFO)]
		DNS_RPC_SERVER_INFO                         *ServerInfo;

		[case(DNSSRV_TYPEID_ZONE_CREATE)]
		DNS_RPC_ZONE_CREATE_INFO                    *ZoneCreate;

		[case(DNSSRV_TYPEID_FORWARDERS)]
		DNS_RPC_FORWARDERS                          *Forwarders;

		[case(DNSSRV_TYPEID_ZONE_SECONDARIES)]
		DNS_RPC_ZONE_SECONDARIES                    *Secondaries;

		[case(DNSSRV_TYPEID_IP_VALIDATE)]
		DNS_RPC_IP_VALIDATE                         *IpValidate;

		[case(DNSSRV_TYPEID_ZONE_INFO)]
		DNS_RPC_ZONE_INFO                           *ZoneInfo;

		[case(DNSSRV_TYPEID_AUTOCONFIGURE)]
		DNS_RPC_AUTOCONFIGURE                       *AutoConfigure;

		[case(DNSSRV_TYPEID_UTF8_STRING_LIST)]
		DNS_RPC_UTF8_STRING_LIST                    *Utf8StringList;
	} DNSSRV_RPC_UNION;


	NTSTATUS DnssrvOperation(
		[in,unique,string,charset(UTF16)] uint16        *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8          *pszZone,
		[in]                      DWORD                  dwContext,
		[in,unique,string,charset(UTF8)] uint8          *pszOperation,
		[in]                      DNS_RPC_TYPEID         dwTypeId,
		[in, switch_is(dwTypeId)] DNSSRV_RPC_UNION       pData
	);

	NTSTATUS DnssrvQuery(
		[in,unique,string,charset(UTF16)] uint16       *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8         *pszZone,
		[in,unique,string,charset(UTF8)] uint8         *pszOperation,
		[out]                         DNS_RPC_TYPEID   *pdwTypeId,
		[out, switch_is(*pdwTypeId)]  DNSSRV_RPC_UNION *ppData
        );

	NTSTATUS DnssrvComplexOperation(
		[in,unique,string,charset(UTF16)] uint16       *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8         *pszZone,
		[in,unique,string,charset(UTF8)] uint8         *pszOperation,
		[in]                          DNS_RPC_TYPEID    dwTypeIn,
		[in, switch_is(dwTypeIn)]     DNSSRV_RPC_UNION  pDataIn,
		[out]                         DNS_RPC_TYPEID   *pdwTypeOut,
		[out, switch_is(*pdwTypeOut)] DNSSRV_RPC_UNION *ppDataOut
        );

	NTSTATUS DnssrvEnumRecords(
		[in,unique,string,charset(UTF16)] uint16       *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8         *pszZone,
		[in,unique,string,charset(UTF8)]  uint8        *pszNodeName,
		[in,unique,string,charset(UTF8)]  uint8        *pszStartChild,
		[in]                           dns_record_type          wRecordType,
		[in]                           DWORD                   fSelectFlag,
		[in,unique,string,charset(UTF8)]  uint8        *pszFilterStart,
		[in,unique,string,charset(UTF8)]  uint8        *pszFilterStop,
		[out]                          DWORD           *pdwBufferLength,
		[out, size_is(, *pdwBufferLength)]  PBYTE *     ppBuffer
        );

	NTSTATUS DnssrvUpdateRecord(
		[in,unique,string,charset(UTF16)] uint16     *pwszServerName,
		[in,unique,string,charset(UTF8)]  uint8      *pszZone,
		[in,unique,string,charset(UTF8)]  uint8      *pszNodeName,
		[in, unique]    DNS_RPC_RECORD_BUF           *pAddRecord,
		[in, unique]    DNS_RPC_RECORD_BUF           *DeleteRecord
        );

	NTSTATUS DnssrvOperation2(
		[in]            uint32                     dwClientVersion,
		[in]            uint32                     dwSettingFlags,
		[in,unique,string,charset(UTF16)] uint16  *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8    *pszZone,
		[in]            DWORD                      dwContext,
		[in,unique,string,charset(UTF8)] uint8    *pszOperation,
		[in]            DNS_RPC_TYPEID             dwTypeId,
		[in, switch_is(dwTypeId)] DNSSRV_RPC_UNION pData
	);

	NTSTATUS DnssrvQuery2(
		[in]            uint32                   dwClientVersion,
		[in]            uint32                   dwSettingFlags,
		[in,unique,string,charset(UTF16)] uint16        *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8         *pszZone,
		[in,unique,string,charset(UTF8)] uint8         *pszOperation,
		[out]                         DNS_RPC_TYPEID          *pdwTypeId,
		[out, switch_is(*pdwTypeId)]  DNSSRV_RPC_UNION        *ppData
        );

	NTSTATUS DnssrvComplexOperation2(
		[in]            uint32                          dwClientVersion,
		[in]            uint32                          dwSettingFlags,
		[in,unique,string,charset(UTF16)] uint16       *pwszServerName,
		[in,unique,string,charset(UTF8)] uint8         *pszZone,
		[in,unique,string,charset(UTF8)] uint8         *pszOperation,
		[in]                          DNS_RPC_TYPEID    dwTypeIn,
		[in, switch_is(dwTypeIn)]     DNSSRV_RPC_UNION  pDataIn,
		[out]                         DNS_RPC_TYPEID   *pdwTypeOut,
		[out, switch_is(*pdwTypeOut)] DNSSRV_RPC_UNION *ppDataOut
        );

	typedef struct {
		uint16 wLength;
		uint16 wRecordCount;
		uint32 dwFlags;
		uint32 dwChildCount;
		DNS_RPC_NAME dnsNodeName;
		DNS_RPC_RECORD records[wRecordCount];
	} DNS_RPC_RECORDS;

	NTSTATUS DnssrvEnumRecords2(
		[in]                           DWORD                    dwClientVersion,
		[in]                           DWORD                    dwSettingFlags,
		[in,unique,string,charset(UTF16)] uint16               *pwszServerName,
		[in,unique,string,charset(UTF8)]  uint8                *pszZone,
		[in,unique,string,charset(UTF8)]  uint8                *pszNodeName,
		[in,unique,string,charset(UTF8)]  uint8                *pszStartChild,
		[in]                           dns_record_type          wRecordType,
		[in]                           DWORD                    fSelectFlag,
		[in,unique,string,charset(UTF8)]  uint8                *pszFilterStart,
		[in,unique,string,charset(UTF8)]  uint8                *pszFilterStop,
		[out]                             uint32               *pdwBufferLength,
		[out,unique,subcontext(4),subcontext_size(*pdwBufferLength)] DNS_RPC_RECORDS *pBuffer
        );

	NTSTATUS DnssrvUpdateRecord2(
		[in]            uint32                    dwClientVersion,
		[in]            uint32                    dwSettingFlags,
		[in,unique,string,charset(UTF16)] uint16 *pwszServerName,
		[in,unique,string,charset(UTF8)]  uint8  *pszZone,
		[in,string,charset(UTF8)]         uint8  *pszNodeName,
		[in, unique]    DNS_RPC_RECORD_BUF       *pAddRecord,
		[in, unique]    DNS_RPC_RECORD_BUF       *DeleteRecord
	);
}