1 /* parser auto-generated by pidl */
4 #include "librpc/gen_ndr/ndr_netlogon.h"
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 #include "librpc/gen_ndr/ndr_samr.h"
8 #include "librpc/gen_ndr/ndr_security.h"
9 static enum ndr_err_code
ndr_push_netr_UasInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UasInfo
*r
)
11 if (ndr_flags
& NDR_SCALARS
) {
12 NDR_CHECK(ndr_push_align(ndr
, 4));
13 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->account_name
));
14 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->priv
));
15 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->auth_flags
));
16 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_count
));
17 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->bad_pw_count
));
18 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->last_logon
));
19 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->last_logoff
));
20 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->logoff_time
));
21 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->kickoff_time
));
22 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->password_age
));
23 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->pw_can_change
));
24 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->pw_must_change
));
25 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->computer
));
26 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
27 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->script_path
));
28 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown
));
30 if (ndr_flags
& NDR_BUFFERS
) {
31 if (r
->account_name
) {
32 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
33 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
34 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
35 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->account_name
, ndr_charset_length(r
->account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
38 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer
, CH_UTF16
)));
39 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
40 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer
, CH_UTF16
)));
41 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->computer
, ndr_charset_length(r
->computer
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
44 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
45 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
46 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
47 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
50 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->script_path
, CH_UTF16
)));
51 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
52 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->script_path
, CH_UTF16
)));
53 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->script_path
, ndr_charset_length(r
->script_path
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
56 return NDR_ERR_SUCCESS
;
59 static enum ndr_err_code
ndr_pull_netr_UasInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UasInfo
*r
)
61 uint32_t _ptr_account_name
;
62 TALLOC_CTX
*_mem_save_account_name_0
;
63 uint32_t _ptr_computer
;
64 TALLOC_CTX
*_mem_save_computer_0
;
66 TALLOC_CTX
*_mem_save_domain_0
;
67 uint32_t _ptr_script_path
;
68 TALLOC_CTX
*_mem_save_script_path_0
;
69 if (ndr_flags
& NDR_SCALARS
) {
70 NDR_CHECK(ndr_pull_align(ndr
, 4));
71 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account_name
));
72 if (_ptr_account_name
) {
73 NDR_PULL_ALLOC(ndr
, r
->account_name
);
75 r
->account_name
= NULL
;
77 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->priv
));
78 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->auth_flags
));
79 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_count
));
80 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->bad_pw_count
));
81 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->last_logon
));
82 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->last_logoff
));
83 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->logoff_time
));
84 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->kickoff_time
));
85 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->password_age
));
86 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->pw_can_change
));
87 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->pw_must_change
));
88 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer
));
90 NDR_PULL_ALLOC(ndr
, r
->computer
);
94 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
96 NDR_PULL_ALLOC(ndr
, r
->domain
);
100 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_script_path
));
101 if (_ptr_script_path
) {
102 NDR_PULL_ALLOC(ndr
, r
->script_path
);
104 r
->script_path
= NULL
;
106 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
));
108 if (ndr_flags
& NDR_BUFFERS
) {
109 if (r
->account_name
) {
110 _mem_save_account_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
111 NDR_PULL_SET_MEM_CTX(ndr
, r
->account_name
, 0);
112 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->account_name
));
113 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->account_name
));
114 if (ndr_get_array_length(ndr
, &r
->account_name
) > ndr_get_array_size(ndr
, &r
->account_name
)) {
115 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->account_name
), ndr_get_array_length(ndr
, &r
->account_name
));
117 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t)));
118 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->account_name
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t), CH_UTF16
));
119 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_name_0
, 0);
122 _mem_save_computer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
123 NDR_PULL_SET_MEM_CTX(ndr
, r
->computer
, 0);
124 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->computer
));
125 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->computer
));
126 if (ndr_get_array_length(ndr
, &r
->computer
) > ndr_get_array_size(ndr
, &r
->computer
)) {
127 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->computer
), ndr_get_array_length(ndr
, &r
->computer
));
129 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->computer
), sizeof(uint16_t)));
130 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->computer
, ndr_get_array_length(ndr
, &r
->computer
), sizeof(uint16_t), CH_UTF16
));
131 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_0
, 0);
134 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
135 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
136 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
137 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
138 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
139 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->domain
), ndr_get_array_length(ndr
, &r
->domain
));
141 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
142 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
143 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
145 if (r
->script_path
) {
146 _mem_save_script_path_0
= NDR_PULL_GET_MEM_CTX(ndr
);
147 NDR_PULL_SET_MEM_CTX(ndr
, r
->script_path
, 0);
148 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->script_path
));
149 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->script_path
));
150 if (ndr_get_array_length(ndr
, &r
->script_path
) > ndr_get_array_size(ndr
, &r
->script_path
)) {
151 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->script_path
), ndr_get_array_length(ndr
, &r
->script_path
));
153 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->script_path
), sizeof(uint16_t)));
154 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->script_path
, ndr_get_array_length(ndr
, &r
->script_path
), sizeof(uint16_t), CH_UTF16
));
155 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_script_path_0
, 0);
158 return NDR_ERR_SUCCESS
;
161 _PUBLIC_
void ndr_print_netr_UasInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_UasInfo
*r
)
163 ndr_print_struct(ndr
, name
, "netr_UasInfo");
165 ndr_print_ptr(ndr
, "account_name", r
->account_name
);
167 if (r
->account_name
) {
168 ndr_print_string(ndr
, "account_name", r
->account_name
);
171 ndr_print_uint32(ndr
, "priv", r
->priv
);
172 ndr_print_uint32(ndr
, "auth_flags", r
->auth_flags
);
173 ndr_print_uint32(ndr
, "logon_count", r
->logon_count
);
174 ndr_print_uint32(ndr
, "bad_pw_count", r
->bad_pw_count
);
175 ndr_print_time_t(ndr
, "last_logon", r
->last_logon
);
176 ndr_print_time_t(ndr
, "last_logoff", r
->last_logoff
);
177 ndr_print_time_t(ndr
, "logoff_time", r
->logoff_time
);
178 ndr_print_time_t(ndr
, "kickoff_time", r
->kickoff_time
);
179 ndr_print_uint32(ndr
, "password_age", r
->password_age
);
180 ndr_print_time_t(ndr
, "pw_can_change", r
->pw_can_change
);
181 ndr_print_time_t(ndr
, "pw_must_change", r
->pw_must_change
);
182 ndr_print_ptr(ndr
, "computer", r
->computer
);
185 ndr_print_string(ndr
, "computer", r
->computer
);
188 ndr_print_ptr(ndr
, "domain", r
->domain
);
191 ndr_print_string(ndr
, "domain", r
->domain
);
194 ndr_print_ptr(ndr
, "script_path", r
->script_path
);
196 if (r
->script_path
) {
197 ndr_print_string(ndr
, "script_path", r
->script_path
);
200 ndr_print_uint32(ndr
, "unknown", r
->unknown
);
204 static enum ndr_err_code
ndr_push_netr_UasLogoffInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UasLogoffInfo
*r
)
206 if (ndr_flags
& NDR_SCALARS
) {
207 NDR_CHECK(ndr_push_align(ndr
, 4));
208 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->duration
));
209 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
211 if (ndr_flags
& NDR_BUFFERS
) {
213 return NDR_ERR_SUCCESS
;
216 static enum ndr_err_code
ndr_pull_netr_UasLogoffInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UasLogoffInfo
*r
)
218 if (ndr_flags
& NDR_SCALARS
) {
219 NDR_CHECK(ndr_pull_align(ndr
, 4));
220 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->duration
));
221 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
223 if (ndr_flags
& NDR_BUFFERS
) {
225 return NDR_ERR_SUCCESS
;
228 _PUBLIC_
void ndr_print_netr_UasLogoffInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_UasLogoffInfo
*r
)
230 ndr_print_struct(ndr
, name
, "netr_UasLogoffInfo");
232 ndr_print_uint32(ndr
, "duration", r
->duration
);
233 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
237 static enum ndr_err_code
ndr_push_netr_AcctLockStr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_AcctLockStr
*r
)
239 uint32_t cntr_bindata_1
;
240 if (ndr_flags
& NDR_SCALARS
) {
241 NDR_CHECK(ndr_push_align(ndr
, 4));
242 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->size
));
243 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
244 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->bindata
));
246 if (ndr_flags
& NDR_BUFFERS
) {
248 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
/ 2));
249 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
250 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
/ 2));
251 for (cntr_bindata_1
= 0; cntr_bindata_1
< r
->length
/ 2; cntr_bindata_1
++) {
252 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->bindata
[cntr_bindata_1
]));
256 return NDR_ERR_SUCCESS
;
259 static enum ndr_err_code
ndr_pull_netr_AcctLockStr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_AcctLockStr
*r
)
261 uint32_t _ptr_bindata
;
262 uint32_t cntr_bindata_1
;
263 TALLOC_CTX
*_mem_save_bindata_0
;
264 TALLOC_CTX
*_mem_save_bindata_1
;
265 if (ndr_flags
& NDR_SCALARS
) {
266 NDR_CHECK(ndr_pull_align(ndr
, 4));
267 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
268 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
269 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_bindata
));
271 NDR_PULL_ALLOC(ndr
, r
->bindata
);
276 if (ndr_flags
& NDR_BUFFERS
) {
278 _mem_save_bindata_0
= NDR_PULL_GET_MEM_CTX(ndr
);
279 NDR_PULL_SET_MEM_CTX(ndr
, r
->bindata
, 0);
280 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->bindata
));
281 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->bindata
));
282 if (ndr_get_array_length(ndr
, &r
->bindata
) > ndr_get_array_size(ndr
, &r
->bindata
)) {
283 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->bindata
), ndr_get_array_length(ndr
, &r
->bindata
));
285 NDR_PULL_ALLOC_N(ndr
, r
->bindata
, ndr_get_array_size(ndr
, &r
->bindata
));
286 _mem_save_bindata_1
= NDR_PULL_GET_MEM_CTX(ndr
);
287 NDR_PULL_SET_MEM_CTX(ndr
, r
->bindata
, 0);
288 for (cntr_bindata_1
= 0; cntr_bindata_1
< r
->length
/ 2; cntr_bindata_1
++) {
289 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->bindata
[cntr_bindata_1
]));
291 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_bindata_1
, 0);
292 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_bindata_0
, 0);
295 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->bindata
, r
->size
/ 2));
298 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->bindata
, r
->length
/ 2));
301 return NDR_ERR_SUCCESS
;
304 _PUBLIC_
void ndr_print_netr_AcctLockStr(struct ndr_print
*ndr
, const char *name
, const struct netr_AcctLockStr
*r
)
306 uint32_t cntr_bindata_1
;
307 ndr_print_struct(ndr
, name
, "netr_AcctLockStr");
309 ndr_print_uint16(ndr
, "size", r
->size
);
310 ndr_print_uint16(ndr
, "length", r
->length
);
311 ndr_print_ptr(ndr
, "bindata", r
->bindata
);
314 ndr
->print(ndr
, "%s: ARRAY(%d)", "bindata", r
->length
/ 2);
316 for (cntr_bindata_1
=0;cntr_bindata_1
<r
->length
/ 2;cntr_bindata_1
++) {
318 asprintf(&idx_1
, "[%d]", cntr_bindata_1
);
320 ndr_print_uint16(ndr
, "bindata", r
->bindata
[cntr_bindata_1
]);
330 static enum ndr_err_code
ndr_push_netr_IdentityInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_IdentityInfo
*r
)
332 if (ndr_flags
& NDR_SCALARS
) {
333 NDR_CHECK(ndr_push_align(ndr
, 4));
334 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
335 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->parameter_control
));
336 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_id_low
));
337 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_id_high
));
338 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
339 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->workstation
));
341 if (ndr_flags
& NDR_BUFFERS
) {
342 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
343 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
344 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstation
));
346 return NDR_ERR_SUCCESS
;
349 static enum ndr_err_code
ndr_pull_netr_IdentityInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_IdentityInfo
*r
)
351 if (ndr_flags
& NDR_SCALARS
) {
352 NDR_CHECK(ndr_pull_align(ndr
, 4));
353 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
354 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->parameter_control
));
355 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_id_low
));
356 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_id_high
));
357 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
358 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->workstation
));
360 if (ndr_flags
& NDR_BUFFERS
) {
361 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
362 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
363 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstation
));
365 return NDR_ERR_SUCCESS
;
368 _PUBLIC_
void ndr_print_netr_IdentityInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_IdentityInfo
*r
)
370 ndr_print_struct(ndr
, name
, "netr_IdentityInfo");
372 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
373 ndr_print_uint32(ndr
, "parameter_control", r
->parameter_control
);
374 ndr_print_uint32(ndr
, "logon_id_low", r
->logon_id_low
);
375 ndr_print_uint32(ndr
, "logon_id_high", r
->logon_id_high
);
376 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
377 ndr_print_lsa_String(ndr
, "workstation", &r
->workstation
);
381 static enum ndr_err_code
ndr_push_netr_PasswordInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PasswordInfo
*r
)
383 if (ndr_flags
& NDR_SCALARS
) {
384 NDR_CHECK(ndr_push_align(ndr
, 4));
385 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
386 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
387 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
389 if (ndr_flags
& NDR_BUFFERS
) {
390 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
391 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
392 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
394 return NDR_ERR_SUCCESS
;
397 static enum ndr_err_code
ndr_pull_netr_PasswordInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PasswordInfo
*r
)
399 if (ndr_flags
& NDR_SCALARS
) {
400 NDR_CHECK(ndr_pull_align(ndr
, 4));
401 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
402 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
403 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
405 if (ndr_flags
& NDR_BUFFERS
) {
406 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
407 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
408 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
410 return NDR_ERR_SUCCESS
;
413 _PUBLIC_
void ndr_print_netr_PasswordInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_PasswordInfo
*r
)
415 ndr_print_struct(ndr
, name
, "netr_PasswordInfo");
417 ndr_print_netr_IdentityInfo(ndr
, "identity_info", &r
->identity_info
);
418 ndr_print_samr_Password(ndr
, "lmpassword", &r
->lmpassword
);
419 ndr_print_samr_Password(ndr
, "ntpassword", &r
->ntpassword
);
423 static enum ndr_err_code
ndr_push_netr_ChallengeResponse(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_ChallengeResponse
*r
)
426 uint32_t _flags_save_STRUCT
= ndr
->flags
;
427 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
428 if (ndr_flags
& NDR_SCALARS
) {
429 NDR_CHECK(ndr_push_align(ndr
, 4));
430 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
431 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
432 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
434 if (ndr_flags
& NDR_BUFFERS
) {
436 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
437 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
438 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
439 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
442 ndr
->flags
= _flags_save_STRUCT
;
444 return NDR_ERR_SUCCESS
;
447 static enum ndr_err_code
ndr_pull_netr_ChallengeResponse(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_ChallengeResponse
*r
)
450 TALLOC_CTX
*_mem_save_data_0
;
452 uint32_t _flags_save_STRUCT
= ndr
->flags
;
453 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
454 if (ndr_flags
& NDR_SCALARS
) {
455 NDR_CHECK(ndr_pull_align(ndr
, 4));
456 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
457 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
458 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
460 NDR_PULL_ALLOC(ndr
, r
->data
);
465 if (ndr_flags
& NDR_BUFFERS
) {
467 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
468 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
469 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
470 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->data
));
471 if (ndr_get_array_length(ndr
, &r
->data
) > ndr_get_array_size(ndr
, &r
->data
)) {
472 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->data
), ndr_get_array_length(ndr
, &r
->data
));
474 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
475 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_length(ndr
, &r
->data
)));
476 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
479 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
482 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->data
, r
->length
));
485 ndr
->flags
= _flags_save_STRUCT
;
487 return NDR_ERR_SUCCESS
;
490 _PUBLIC_
void ndr_print_netr_ChallengeResponse(struct ndr_print
*ndr
, const char *name
, const struct netr_ChallengeResponse
*r
)
492 ndr_print_struct(ndr
, name
, "netr_ChallengeResponse");
494 uint32_t _flags_save_STRUCT
= ndr
->flags
;
495 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
497 ndr_print_uint16(ndr
, "length", r
->length
);
498 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->length
:r
->size
);
499 ndr_print_ptr(ndr
, "data", r
->data
);
502 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
506 ndr
->flags
= _flags_save_STRUCT
;
510 static enum ndr_err_code
ndr_push_netr_NetworkInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_NetworkInfo
*r
)
513 uint32_t _flags_save_STRUCT
= ndr
->flags
;
514 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
515 if (ndr_flags
& NDR_SCALARS
) {
516 NDR_CHECK(ndr_push_align(ndr
, 4));
517 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
518 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->challenge
, 8));
519 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->nt
));
520 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->lm
));
522 if (ndr_flags
& NDR_BUFFERS
) {
523 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
524 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->nt
));
525 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->lm
));
527 ndr
->flags
= _flags_save_STRUCT
;
529 return NDR_ERR_SUCCESS
;
532 static enum ndr_err_code
ndr_pull_netr_NetworkInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NetworkInfo
*r
)
535 uint32_t _flags_save_STRUCT
= ndr
->flags
;
536 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
537 if (ndr_flags
& NDR_SCALARS
) {
538 NDR_CHECK(ndr_pull_align(ndr
, 4));
539 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
540 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->challenge
, 8));
541 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->nt
));
542 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->lm
));
544 if (ndr_flags
& NDR_BUFFERS
) {
545 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
546 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->nt
));
547 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->lm
));
549 ndr
->flags
= _flags_save_STRUCT
;
551 return NDR_ERR_SUCCESS
;
554 _PUBLIC_
void ndr_print_netr_NetworkInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_NetworkInfo
*r
)
556 ndr_print_struct(ndr
, name
, "netr_NetworkInfo");
558 uint32_t _flags_save_STRUCT
= ndr
->flags
;
559 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
561 ndr_print_netr_IdentityInfo(ndr
, "identity_info", &r
->identity_info
);
562 ndr_print_array_uint8(ndr
, "challenge", r
->challenge
, 8);
563 ndr_print_netr_ChallengeResponse(ndr
, "nt", &r
->nt
);
564 ndr_print_netr_ChallengeResponse(ndr
, "lm", &r
->lm
);
566 ndr
->flags
= _flags_save_STRUCT
;
570 _PUBLIC_
enum ndr_err_code
ndr_push_netr_LogonLevel(struct ndr_push
*ndr
, int ndr_flags
, const union netr_LogonLevel
*r
)
572 if (ndr_flags
& NDR_SCALARS
) {
573 int level
= ndr_push_get_switch_value(ndr
, r
);
574 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, level
));
577 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
581 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->network
));
585 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
589 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
593 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->network
));
597 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
600 if (ndr_flags
& NDR_BUFFERS
) {
601 int level
= ndr_push_get_switch_value(ndr
, r
);
605 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
611 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
617 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
623 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
629 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
634 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
637 return NDR_ERR_SUCCESS
;
640 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_LogonLevel(struct ndr_pull
*ndr
, int ndr_flags
, union netr_LogonLevel
*r
)
644 TALLOC_CTX
*_mem_save_password_0
;
645 TALLOC_CTX
*_mem_save_network_0
;
646 level
= ndr_pull_get_switch_value(ndr
, r
);
647 if (ndr_flags
& NDR_SCALARS
) {
648 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
649 if (_level
!= level
) {
650 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
654 uint32_t _ptr_password
;
655 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
657 NDR_PULL_ALLOC(ndr
, r
->password
);
664 uint32_t _ptr_network
;
665 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_network
));
667 NDR_PULL_ALLOC(ndr
, r
->network
);
674 uint32_t _ptr_password
;
675 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
677 NDR_PULL_ALLOC(ndr
, r
->password
);
684 uint32_t _ptr_password
;
685 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
687 NDR_PULL_ALLOC(ndr
, r
->password
);
694 uint32_t _ptr_network
;
695 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_network
));
697 NDR_PULL_ALLOC(ndr
, r
->network
);
704 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
707 if (ndr_flags
& NDR_BUFFERS
) {
711 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
712 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
713 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
714 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
720 _mem_save_network_0
= NDR_PULL_GET_MEM_CTX(ndr
);
721 NDR_PULL_SET_MEM_CTX(ndr
, r
->network
, 0);
722 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
723 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_network_0
, 0);
729 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
730 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
731 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
732 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
738 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
739 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
740 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
741 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
747 _mem_save_network_0
= NDR_PULL_GET_MEM_CTX(ndr
);
748 NDR_PULL_SET_MEM_CTX(ndr
, r
->network
, 0);
749 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
750 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_network_0
, 0);
755 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
758 return NDR_ERR_SUCCESS
;
761 _PUBLIC_
void ndr_print_netr_LogonLevel(struct ndr_print
*ndr
, const char *name
, const union netr_LogonLevel
*r
)
764 level
= ndr_print_get_switch_value(ndr
, r
);
765 ndr_print_union(ndr
, name
, level
, "netr_LogonLevel");
768 ndr_print_ptr(ndr
, "password", r
->password
);
771 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
777 ndr_print_ptr(ndr
, "network", r
->network
);
780 ndr_print_netr_NetworkInfo(ndr
, "network", r
->network
);
786 ndr_print_ptr(ndr
, "password", r
->password
);
789 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
795 ndr_print_ptr(ndr
, "password", r
->password
);
798 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
804 ndr_print_ptr(ndr
, "network", r
->network
);
807 ndr_print_netr_NetworkInfo(ndr
, "network", r
->network
);
813 ndr_print_bad_level(ndr
, name
, level
);
817 _PUBLIC_
enum ndr_err_code
ndr_push_netr_GroupMembership(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_GroupMembership
*r
)
819 if (ndr_flags
& NDR_SCALARS
) {
820 NDR_CHECK(ndr_push_align(ndr
, 4));
821 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
822 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attributes
));
824 if (ndr_flags
& NDR_BUFFERS
) {
826 return NDR_ERR_SUCCESS
;
829 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_GroupMembership(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_GroupMembership
*r
)
831 if (ndr_flags
& NDR_SCALARS
) {
832 NDR_CHECK(ndr_pull_align(ndr
, 4));
833 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
834 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attributes
));
836 if (ndr_flags
& NDR_BUFFERS
) {
838 return NDR_ERR_SUCCESS
;
841 _PUBLIC_
void ndr_print_netr_GroupMembership(struct ndr_print
*ndr
, const char *name
, const struct netr_GroupMembership
*r
)
843 ndr_print_struct(ndr
, name
, "netr_GroupMembership");
845 ndr_print_uint32(ndr
, "rid", r
->rid
);
846 ndr_print_uint32(ndr
, "attributes", r
->attributes
);
850 _PUBLIC_
enum ndr_err_code
ndr_push_netr_UserSessionKey(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UserSessionKey
*r
)
853 uint32_t _flags_save_STRUCT
= ndr
->flags
;
854 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
855 if (ndr_flags
& NDR_SCALARS
) {
856 NDR_CHECK(ndr_push_align(ndr
, 1));
857 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 16));
859 if (ndr_flags
& NDR_BUFFERS
) {
861 ndr
->flags
= _flags_save_STRUCT
;
863 return NDR_ERR_SUCCESS
;
866 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_UserSessionKey(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UserSessionKey
*r
)
869 uint32_t _flags_save_STRUCT
= ndr
->flags
;
870 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
871 if (ndr_flags
& NDR_SCALARS
) {
872 NDR_CHECK(ndr_pull_align(ndr
, 1));
873 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 16));
875 if (ndr_flags
& NDR_BUFFERS
) {
877 ndr
->flags
= _flags_save_STRUCT
;
879 return NDR_ERR_SUCCESS
;
882 _PUBLIC_
void ndr_print_netr_UserSessionKey(struct ndr_print
*ndr
, const char *name
, const struct netr_UserSessionKey
*r
)
884 ndr_print_struct(ndr
, name
, "netr_UserSessionKey");
886 uint32_t _flags_save_STRUCT
= ndr
->flags
;
887 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
889 ndr_print_array_uint8(ndr
, "key", r
->key
, 16);
891 ndr
->flags
= _flags_save_STRUCT
;
895 _PUBLIC_
enum ndr_err_code
ndr_push_netr_LMSessionKey(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_LMSessionKey
*r
)
898 uint32_t _flags_save_STRUCT
= ndr
->flags
;
899 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
900 if (ndr_flags
& NDR_SCALARS
) {
901 NDR_CHECK(ndr_push_align(ndr
, 1));
902 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 8));
904 if (ndr_flags
& NDR_BUFFERS
) {
906 ndr
->flags
= _flags_save_STRUCT
;
908 return NDR_ERR_SUCCESS
;
911 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_LMSessionKey(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_LMSessionKey
*r
)
914 uint32_t _flags_save_STRUCT
= ndr
->flags
;
915 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
916 if (ndr_flags
& NDR_SCALARS
) {
917 NDR_CHECK(ndr_pull_align(ndr
, 1));
918 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 8));
920 if (ndr_flags
& NDR_BUFFERS
) {
922 ndr
->flags
= _flags_save_STRUCT
;
924 return NDR_ERR_SUCCESS
;
927 _PUBLIC_
void ndr_print_netr_LMSessionKey(struct ndr_print
*ndr
, const char *name
, const struct netr_LMSessionKey
*r
)
929 ndr_print_struct(ndr
, name
, "netr_LMSessionKey");
931 uint32_t _flags_save_STRUCT
= ndr
->flags
;
932 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
934 ndr_print_array_uint8(ndr
, "key", r
->key
, 8);
936 ndr
->flags
= _flags_save_STRUCT
;
940 _PUBLIC_
enum ndr_err_code
ndr_push_netr_UserFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
942 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
943 return NDR_ERR_SUCCESS
;
946 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_UserFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
949 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
951 return NDR_ERR_SUCCESS
;
954 _PUBLIC_
void ndr_print_netr_UserFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
956 ndr_print_uint32(ndr
, name
, r
);
958 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST
, r
);
959 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION
, r
);
960 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT
, r
);
961 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD
, r
);
962 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS
, r
);
963 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY
, r
);
964 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT
, r
);
965 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED
, r
);
966 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS
, r
);
967 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED
, r
);
971 static enum ndr_err_code
ndr_push_netr_SamBaseInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamBaseInfo
*r
)
973 uint32_t cntr_unknown_0
;
974 if (ndr_flags
& NDR_SCALARS
) {
975 NDR_CHECK(ndr_push_align(ndr
, 4));
976 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logon
));
977 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logoff
));
978 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->acct_expiry
));
979 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_password_change
));
980 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->allow_password_change
));
981 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->force_password_change
));
982 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
983 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
984 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
985 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
986 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
987 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
988 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
989 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->bad_password_count
));
990 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
991 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->primary_gid
));
992 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr
, NDR_SCALARS
, &r
->groups
));
993 NDR_CHECK(ndr_push_netr_UserFlags(ndr
, NDR_SCALARS
, r
->user_flags
));
994 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->key
));
995 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->logon_server
));
996 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->domain
));
997 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain_sid
));
998 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr
, NDR_SCALARS
, &r
->LMSessKey
));
999 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->acct_flags
));
1000 for (cntr_unknown_0
= 0; cntr_unknown_0
< 7; cntr_unknown_0
++) {
1001 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown
[cntr_unknown_0
]));
1004 if (ndr_flags
& NDR_BUFFERS
) {
1005 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
1006 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
1007 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
1008 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
1009 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
1010 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
1011 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr
, NDR_BUFFERS
, &r
->groups
));
1012 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1013 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->domain
));
1014 if (r
->domain_sid
) {
1015 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain_sid
));
1018 return NDR_ERR_SUCCESS
;
1021 static enum ndr_err_code
ndr_pull_netr_SamBaseInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamBaseInfo
*r
)
1023 uint32_t _ptr_domain_sid
;
1024 TALLOC_CTX
*_mem_save_domain_sid_0
;
1025 uint32_t cntr_unknown_0
;
1026 if (ndr_flags
& NDR_SCALARS
) {
1027 NDR_CHECK(ndr_pull_align(ndr
, 4));
1028 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logon
));
1029 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logoff
));
1030 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->acct_expiry
));
1031 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_password_change
));
1032 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->allow_password_change
));
1033 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->force_password_change
));
1034 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
1035 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
1036 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
1037 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
1038 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
1039 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
1040 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
1041 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->bad_password_count
));
1042 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
1043 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->primary_gid
));
1044 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr
, NDR_SCALARS
, &r
->groups
));
1045 NDR_CHECK(ndr_pull_netr_UserFlags(ndr
, NDR_SCALARS
, &r
->user_flags
));
1046 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->key
));
1047 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->logon_server
));
1048 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->domain
));
1049 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_sid
));
1050 if (_ptr_domain_sid
) {
1051 NDR_PULL_ALLOC(ndr
, r
->domain_sid
);
1053 r
->domain_sid
= NULL
;
1055 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr
, NDR_SCALARS
, &r
->LMSessKey
));
1056 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->acct_flags
));
1057 for (cntr_unknown_0
= 0; cntr_unknown_0
< 7; cntr_unknown_0
++) {
1058 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
[cntr_unknown_0
]));
1061 if (ndr_flags
& NDR_BUFFERS
) {
1062 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
1063 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
1064 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
1065 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
1066 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
1067 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
1068 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr
, NDR_BUFFERS
, &r
->groups
));
1069 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1070 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->domain
));
1071 if (r
->domain_sid
) {
1072 _mem_save_domain_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1073 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain_sid
, 0);
1074 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain_sid
));
1075 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_sid_0
, 0);
1078 return NDR_ERR_SUCCESS
;
1081 _PUBLIC_
void ndr_print_netr_SamBaseInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_SamBaseInfo
*r
)
1083 uint32_t cntr_unknown_0
;
1084 ndr_print_struct(ndr
, name
, "netr_SamBaseInfo");
1086 ndr_print_NTTIME(ndr
, "last_logon", r
->last_logon
);
1087 ndr_print_NTTIME(ndr
, "last_logoff", r
->last_logoff
);
1088 ndr_print_NTTIME(ndr
, "acct_expiry", r
->acct_expiry
);
1089 ndr_print_NTTIME(ndr
, "last_password_change", r
->last_password_change
);
1090 ndr_print_NTTIME(ndr
, "allow_password_change", r
->allow_password_change
);
1091 ndr_print_NTTIME(ndr
, "force_password_change", r
->force_password_change
);
1092 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
1093 ndr_print_lsa_String(ndr
, "full_name", &r
->full_name
);
1094 ndr_print_lsa_String(ndr
, "logon_script", &r
->logon_script
);
1095 ndr_print_lsa_String(ndr
, "profile_path", &r
->profile_path
);
1096 ndr_print_lsa_String(ndr
, "home_directory", &r
->home_directory
);
1097 ndr_print_lsa_String(ndr
, "home_drive", &r
->home_drive
);
1098 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
1099 ndr_print_uint16(ndr
, "bad_password_count", r
->bad_password_count
);
1100 ndr_print_uint32(ndr
, "rid", r
->rid
);
1101 ndr_print_uint32(ndr
, "primary_gid", r
->primary_gid
);
1102 ndr_print_samr_RidWithAttributeArray(ndr
, "groups", &r
->groups
);
1103 ndr_print_netr_UserFlags(ndr
, "user_flags", r
->user_flags
);
1104 ndr_print_netr_UserSessionKey(ndr
, "key", &r
->key
);
1105 ndr_print_lsa_StringLarge(ndr
, "logon_server", &r
->logon_server
);
1106 ndr_print_lsa_StringLarge(ndr
, "domain", &r
->domain
);
1107 ndr_print_ptr(ndr
, "domain_sid", r
->domain_sid
);
1109 if (r
->domain_sid
) {
1110 ndr_print_dom_sid2(ndr
, "domain_sid", r
->domain_sid
);
1113 ndr_print_netr_LMSessionKey(ndr
, "LMSessKey", &r
->LMSessKey
);
1114 ndr_print_samr_AcctFlags(ndr
, "acct_flags", r
->acct_flags
);
1115 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown", 7);
1117 for (cntr_unknown_0
=0;cntr_unknown_0
<7;cntr_unknown_0
++) {
1119 asprintf(&idx_0
, "[%d]", cntr_unknown_0
);
1121 ndr_print_uint32(ndr
, "unknown", r
->unknown
[cntr_unknown_0
]);
1129 static enum ndr_err_code
ndr_push_netr_SamInfo2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo2
*r
)
1131 if (ndr_flags
& NDR_SCALARS
) {
1132 NDR_CHECK(ndr_push_align(ndr
, 4));
1133 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1135 if (ndr_flags
& NDR_BUFFERS
) {
1136 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1138 return NDR_ERR_SUCCESS
;
1141 static enum ndr_err_code
ndr_pull_netr_SamInfo2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo2
*r
)
1143 if (ndr_flags
& NDR_SCALARS
) {
1144 NDR_CHECK(ndr_pull_align(ndr
, 4));
1145 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1147 if (ndr_flags
& NDR_BUFFERS
) {
1148 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1150 return NDR_ERR_SUCCESS
;
1153 _PUBLIC_
void ndr_print_netr_SamInfo2(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo2
*r
)
1155 ndr_print_struct(ndr
, name
, "netr_SamInfo2");
1157 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1161 static enum ndr_err_code
ndr_push_netr_SidAttr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SidAttr
*r
)
1163 if (ndr_flags
& NDR_SCALARS
) {
1164 NDR_CHECK(ndr_push_align(ndr
, 4));
1165 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
1166 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attribute
));
1168 if (ndr_flags
& NDR_BUFFERS
) {
1170 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
1173 return NDR_ERR_SUCCESS
;
1176 static enum ndr_err_code
ndr_pull_netr_SidAttr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SidAttr
*r
)
1179 TALLOC_CTX
*_mem_save_sid_0
;
1180 if (ndr_flags
& NDR_SCALARS
) {
1181 NDR_CHECK(ndr_pull_align(ndr
, 4));
1182 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
1184 NDR_PULL_ALLOC(ndr
, r
->sid
);
1188 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attribute
));
1190 if (ndr_flags
& NDR_BUFFERS
) {
1192 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1193 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
1194 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
1195 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
1198 return NDR_ERR_SUCCESS
;
1201 _PUBLIC_
void ndr_print_netr_SidAttr(struct ndr_print
*ndr
, const char *name
, const struct netr_SidAttr
*r
)
1203 ndr_print_struct(ndr
, name
, "netr_SidAttr");
1205 ndr_print_ptr(ndr
, "sid", r
->sid
);
1208 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
1211 ndr_print_uint32(ndr
, "attribute", r
->attribute
);
1215 _PUBLIC_
enum ndr_err_code
ndr_push_netr_SamInfo3(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo3
*r
)
1217 uint32_t cntr_sids_1
;
1218 if (ndr_flags
& NDR_SCALARS
) {
1219 NDR_CHECK(ndr_push_align(ndr
, 4));
1220 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1221 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1222 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sids
));
1224 if (ndr_flags
& NDR_BUFFERS
) {
1225 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1227 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1228 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1229 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1231 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1232 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1236 return NDR_ERR_SUCCESS
;
1239 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_SamInfo3(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo3
*r
)
1242 uint32_t cntr_sids_1
;
1243 TALLOC_CTX
*_mem_save_sids_0
;
1244 TALLOC_CTX
*_mem_save_sids_1
;
1245 if (ndr_flags
& NDR_SCALARS
) {
1246 NDR_CHECK(ndr_pull_align(ndr
, 4));
1247 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1248 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sidcount
));
1249 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sids
));
1251 NDR_PULL_ALLOC(ndr
, r
->sids
);
1256 if (ndr_flags
& NDR_BUFFERS
) {
1257 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1259 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1260 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1261 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sids
));
1262 NDR_PULL_ALLOC_N(ndr
, r
->sids
, ndr_get_array_size(ndr
, &r
->sids
));
1263 _mem_save_sids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
1264 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1265 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1266 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1268 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1269 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1271 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_1
, 0);
1272 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
1275 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sids
, r
->sidcount
));
1278 return NDR_ERR_SUCCESS
;
1281 _PUBLIC_
void ndr_print_netr_SamInfo3(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo3
*r
)
1283 uint32_t cntr_sids_1
;
1284 ndr_print_struct(ndr
, name
, "netr_SamInfo3");
1286 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1287 ndr_print_uint32(ndr
, "sidcount", r
->sidcount
);
1288 ndr_print_ptr(ndr
, "sids", r
->sids
);
1291 ndr
->print(ndr
, "%s: ARRAY(%d)", "sids", r
->sidcount
);
1293 for (cntr_sids_1
=0;cntr_sids_1
<r
->sidcount
;cntr_sids_1
++) {
1295 asprintf(&idx_1
, "[%d]", cntr_sids_1
);
1297 ndr_print_netr_SidAttr(ndr
, "sids", &r
->sids
[cntr_sids_1
]);
1307 static enum ndr_err_code
ndr_push_netr_SamInfo6(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo6
*r
)
1309 uint32_t cntr_sids_1
;
1310 uint32_t cntr_unknown4_0
;
1311 if (ndr_flags
& NDR_SCALARS
) {
1312 NDR_CHECK(ndr_push_align(ndr
, 4));
1313 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1314 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1315 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sids
));
1316 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
1317 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->principle
));
1318 for (cntr_unknown4_0
= 0; cntr_unknown4_0
< 20; cntr_unknown4_0
++) {
1319 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
[cntr_unknown4_0
]));
1322 if (ndr_flags
& NDR_BUFFERS
) {
1323 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1325 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1326 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1327 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1329 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1330 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1333 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
1334 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->principle
));
1336 return NDR_ERR_SUCCESS
;
1339 static enum ndr_err_code
ndr_pull_netr_SamInfo6(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo6
*r
)
1342 uint32_t cntr_sids_1
;
1343 TALLOC_CTX
*_mem_save_sids_0
;
1344 TALLOC_CTX
*_mem_save_sids_1
;
1345 uint32_t cntr_unknown4_0
;
1346 if (ndr_flags
& NDR_SCALARS
) {
1347 NDR_CHECK(ndr_pull_align(ndr
, 4));
1348 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1349 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sidcount
));
1350 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sids
));
1352 NDR_PULL_ALLOC(ndr
, r
->sids
);
1356 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
1357 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->principle
));
1358 for (cntr_unknown4_0
= 0; cntr_unknown4_0
< 20; cntr_unknown4_0
++) {
1359 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
[cntr_unknown4_0
]));
1362 if (ndr_flags
& NDR_BUFFERS
) {
1363 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1365 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1366 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1367 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sids
));
1368 NDR_PULL_ALLOC_N(ndr
, r
->sids
, ndr_get_array_size(ndr
, &r
->sids
));
1369 _mem_save_sids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
1370 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1371 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1372 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1374 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1375 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1377 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_1
, 0);
1378 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
1380 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
1381 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->principle
));
1383 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sids
, r
->sidcount
));
1386 return NDR_ERR_SUCCESS
;
1389 _PUBLIC_
void ndr_print_netr_SamInfo6(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo6
*r
)
1391 uint32_t cntr_sids_1
;
1392 uint32_t cntr_unknown4_0
;
1393 ndr_print_struct(ndr
, name
, "netr_SamInfo6");
1395 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1396 ndr_print_uint32(ndr
, "sidcount", r
->sidcount
);
1397 ndr_print_ptr(ndr
, "sids", r
->sids
);
1400 ndr
->print(ndr
, "%s: ARRAY(%d)", "sids", r
->sidcount
);
1402 for (cntr_sids_1
=0;cntr_sids_1
<r
->sidcount
;cntr_sids_1
++) {
1404 asprintf(&idx_1
, "[%d]", cntr_sids_1
);
1406 ndr_print_netr_SidAttr(ndr
, "sids", &r
->sids
[cntr_sids_1
]);
1413 ndr_print_lsa_String(ndr
, "forest", &r
->forest
);
1414 ndr_print_lsa_String(ndr
, "principle", &r
->principle
);
1415 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown4", 20);
1417 for (cntr_unknown4_0
=0;cntr_unknown4_0
<20;cntr_unknown4_0
++) {
1419 asprintf(&idx_0
, "[%d]", cntr_unknown4_0
);
1421 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
[cntr_unknown4_0
]);
1429 static enum ndr_err_code
ndr_push_netr_PacInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PacInfo
*r
)
1431 uint32_t cntr_expansionroom_0
;
1432 if (ndr_flags
& NDR_SCALARS
) {
1433 NDR_CHECK(ndr_push_align(ndr
, 4));
1434 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pac_size
));
1435 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->pac
));
1436 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_domain
));
1437 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_server
));
1438 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->principal_name
));
1439 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->auth_size
));
1440 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->auth
));
1441 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->user_session_key
));
1442 for (cntr_expansionroom_0
= 0; cntr_expansionroom_0
< 10; cntr_expansionroom_0
++) {
1443 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->expansionroom
[cntr_expansionroom_0
]));
1445 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1446 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1447 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1448 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1450 if (ndr_flags
& NDR_BUFFERS
) {
1452 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pac_size
));
1453 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->pac
, r
->pac_size
));
1455 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_domain
));
1456 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1457 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->principal_name
));
1459 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->auth_size
));
1460 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->auth
, r
->auth_size
));
1462 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1463 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1464 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1465 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1467 return NDR_ERR_SUCCESS
;
1470 static enum ndr_err_code
ndr_pull_netr_PacInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PacInfo
*r
)
1473 TALLOC_CTX
*_mem_save_pac_0
;
1475 TALLOC_CTX
*_mem_save_auth_0
;
1476 uint32_t cntr_expansionroom_0
;
1477 if (ndr_flags
& NDR_SCALARS
) {
1478 NDR_CHECK(ndr_pull_align(ndr
, 4));
1479 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pac_size
));
1480 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_pac
));
1482 NDR_PULL_ALLOC(ndr
, r
->pac
);
1486 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_domain
));
1487 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_server
));
1488 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->principal_name
));
1489 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->auth_size
));
1490 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_auth
));
1492 NDR_PULL_ALLOC(ndr
, r
->auth
);
1496 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->user_session_key
));
1497 for (cntr_expansionroom_0
= 0; cntr_expansionroom_0
< 10; cntr_expansionroom_0
++) {
1498 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->expansionroom
[cntr_expansionroom_0
]));
1500 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1501 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1502 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1503 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1505 if (ndr_flags
& NDR_BUFFERS
) {
1507 _mem_save_pac_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1508 NDR_PULL_SET_MEM_CTX(ndr
, r
->pac
, 0);
1509 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->pac
));
1510 NDR_PULL_ALLOC_N(ndr
, r
->pac
, ndr_get_array_size(ndr
, &r
->pac
));
1511 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->pac
, ndr_get_array_size(ndr
, &r
->pac
)));
1512 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_pac_0
, 0);
1514 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_domain
));
1515 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1516 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->principal_name
));
1518 _mem_save_auth_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1519 NDR_PULL_SET_MEM_CTX(ndr
, r
->auth
, 0);
1520 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->auth
));
1521 NDR_PULL_ALLOC_N(ndr
, r
->auth
, ndr_get_array_size(ndr
, &r
->auth
));
1522 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->auth
, ndr_get_array_size(ndr
, &r
->auth
)));
1523 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_auth_0
, 0);
1525 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1526 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1527 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1528 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1530 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->pac
, r
->pac_size
));
1533 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->auth
, r
->auth_size
));
1536 return NDR_ERR_SUCCESS
;
1539 _PUBLIC_
void ndr_print_netr_PacInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_PacInfo
*r
)
1541 uint32_t cntr_expansionroom_0
;
1542 ndr_print_struct(ndr
, name
, "netr_PacInfo");
1544 ndr_print_uint32(ndr
, "pac_size", r
->pac_size
);
1545 ndr_print_ptr(ndr
, "pac", r
->pac
);
1548 ndr_print_array_uint8(ndr
, "pac", r
->pac
, r
->pac_size
);
1551 ndr_print_lsa_String(ndr
, "logon_domain", &r
->logon_domain
);
1552 ndr_print_lsa_String(ndr
, "logon_server", &r
->logon_server
);
1553 ndr_print_lsa_String(ndr
, "principal_name", &r
->principal_name
);
1554 ndr_print_uint32(ndr
, "auth_size", r
->auth_size
);
1555 ndr_print_ptr(ndr
, "auth", r
->auth
);
1558 ndr_print_array_uint8(ndr
, "auth", r
->auth
, r
->auth_size
);
1561 ndr_print_netr_UserSessionKey(ndr
, "user_session_key", &r
->user_session_key
);
1562 ndr
->print(ndr
, "%s: ARRAY(%d)", "expansionroom", 10);
1564 for (cntr_expansionroom_0
=0;cntr_expansionroom_0
<10;cntr_expansionroom_0
++) {
1566 asprintf(&idx_0
, "[%d]", cntr_expansionroom_0
);
1568 ndr_print_uint32(ndr
, "expansionroom", r
->expansionroom
[cntr_expansionroom_0
]);
1573 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
1574 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
1575 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
1576 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
1580 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Validation(struct ndr_push
*ndr
, int ndr_flags
, const union netr_Validation
*r
)
1582 if (ndr_flags
& NDR_SCALARS
) {
1583 int level
= ndr_push_get_switch_value(ndr
, r
);
1584 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, level
));
1587 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam2
));
1591 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam3
));
1595 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->pac
));
1599 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->pac
));
1603 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam6
));
1607 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1610 if (ndr_flags
& NDR_BUFFERS
) {
1611 int level
= ndr_push_get_switch_value(ndr
, r
);
1615 NDR_CHECK(ndr_push_netr_SamInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam2
));
1621 NDR_CHECK(ndr_push_netr_SamInfo3(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam3
));
1627 NDR_CHECK(ndr_push_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1633 NDR_CHECK(ndr_push_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1639 NDR_CHECK(ndr_push_netr_SamInfo6(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam6
));
1644 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1647 return NDR_ERR_SUCCESS
;
1650 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Validation(struct ndr_pull
*ndr
, int ndr_flags
, union netr_Validation
*r
)
1654 TALLOC_CTX
*_mem_save_sam2_0
;
1655 TALLOC_CTX
*_mem_save_sam3_0
;
1656 TALLOC_CTX
*_mem_save_pac_0
;
1657 TALLOC_CTX
*_mem_save_sam6_0
;
1658 level
= ndr_pull_get_switch_value(ndr
, r
);
1659 if (ndr_flags
& NDR_SCALARS
) {
1660 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
1661 if (_level
!= level
) {
1662 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
1667 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam2
));
1669 NDR_PULL_ALLOC(ndr
, r
->sam2
);
1677 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam3
));
1679 NDR_PULL_ALLOC(ndr
, r
->sam3
);
1687 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_pac
));
1689 NDR_PULL_ALLOC(ndr
, r
->pac
);
1697 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_pac
));
1699 NDR_PULL_ALLOC(ndr
, r
->pac
);
1707 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam6
));
1709 NDR_PULL_ALLOC(ndr
, r
->sam6
);
1716 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1719 if (ndr_flags
& NDR_BUFFERS
) {
1723 _mem_save_sam2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1724 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam2
, 0);
1725 NDR_CHECK(ndr_pull_netr_SamInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam2
));
1726 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam2_0
, 0);
1732 _mem_save_sam3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1733 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam3
, 0);
1734 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam3
));
1735 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam3_0
, 0);
1741 _mem_save_pac_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1742 NDR_PULL_SET_MEM_CTX(ndr
, r
->pac
, 0);
1743 NDR_CHECK(ndr_pull_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1744 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_pac_0
, 0);
1750 _mem_save_pac_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1751 NDR_PULL_SET_MEM_CTX(ndr
, r
->pac
, 0);
1752 NDR_CHECK(ndr_pull_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1753 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_pac_0
, 0);
1759 _mem_save_sam6_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1760 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam6
, 0);
1761 NDR_CHECK(ndr_pull_netr_SamInfo6(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam6
));
1762 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam6_0
, 0);
1767 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1770 return NDR_ERR_SUCCESS
;
1773 _PUBLIC_
void ndr_print_netr_Validation(struct ndr_print
*ndr
, const char *name
, const union netr_Validation
*r
)
1776 level
= ndr_print_get_switch_value(ndr
, r
);
1777 ndr_print_union(ndr
, name
, level
, "netr_Validation");
1780 ndr_print_ptr(ndr
, "sam2", r
->sam2
);
1783 ndr_print_netr_SamInfo2(ndr
, "sam2", r
->sam2
);
1789 ndr_print_ptr(ndr
, "sam3", r
->sam3
);
1792 ndr_print_netr_SamInfo3(ndr
, "sam3", r
->sam3
);
1798 ndr_print_ptr(ndr
, "pac", r
->pac
);
1801 ndr_print_netr_PacInfo(ndr
, "pac", r
->pac
);
1807 ndr_print_ptr(ndr
, "pac", r
->pac
);
1810 ndr_print_netr_PacInfo(ndr
, "pac", r
->pac
);
1816 ndr_print_ptr(ndr
, "sam6", r
->sam6
);
1819 ndr_print_netr_SamInfo6(ndr
, "sam6", r
->sam6
);
1825 ndr_print_bad_level(ndr
, name
, level
);
1829 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Credential(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Credential
*r
)
1832 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1833 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1834 if (ndr_flags
& NDR_SCALARS
) {
1835 NDR_CHECK(ndr_push_align(ndr
, 1));
1836 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 8));
1838 if (ndr_flags
& NDR_BUFFERS
) {
1840 ndr
->flags
= _flags_save_STRUCT
;
1842 return NDR_ERR_SUCCESS
;
1845 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Credential(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Credential
*r
)
1848 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1849 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1850 if (ndr_flags
& NDR_SCALARS
) {
1851 NDR_CHECK(ndr_pull_align(ndr
, 1));
1852 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 8));
1854 if (ndr_flags
& NDR_BUFFERS
) {
1856 ndr
->flags
= _flags_save_STRUCT
;
1858 return NDR_ERR_SUCCESS
;
1861 _PUBLIC_
void ndr_print_netr_Credential(struct ndr_print
*ndr
, const char *name
, const struct netr_Credential
*r
)
1863 ndr_print_struct(ndr
, name
, "netr_Credential");
1865 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1866 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1868 ndr_print_array_uint8(ndr
, "data", r
->data
, 8);
1870 ndr
->flags
= _flags_save_STRUCT
;
1874 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Authenticator(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Authenticator
*r
)
1876 if (ndr_flags
& NDR_SCALARS
) {
1877 NDR_CHECK(ndr_push_align(ndr
, 4));
1878 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, &r
->cred
));
1879 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->timestamp
));
1881 if (ndr_flags
& NDR_BUFFERS
) {
1883 return NDR_ERR_SUCCESS
;
1886 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Authenticator(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Authenticator
*r
)
1888 if (ndr_flags
& NDR_SCALARS
) {
1889 NDR_CHECK(ndr_pull_align(ndr
, 4));
1890 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, &r
->cred
));
1891 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->timestamp
));
1893 if (ndr_flags
& NDR_BUFFERS
) {
1895 return NDR_ERR_SUCCESS
;
1898 _PUBLIC_
void ndr_print_netr_Authenticator(struct ndr_print
*ndr
, const char *name
, const struct netr_Authenticator
*r
)
1900 ndr_print_struct(ndr
, name
, "netr_Authenticator");
1902 ndr_print_netr_Credential(ndr
, "cred", &r
->cred
);
1903 ndr_print_time_t(ndr
, "timestamp", r
->timestamp
);
1907 static enum ndr_err_code
ndr_push_netr_DELTA_DELETE_USER(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DELETE_USER
*r
)
1909 if (ndr_flags
& NDR_SCALARS
) {
1910 NDR_CHECK(ndr_push_align(ndr
, 4));
1911 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->account_name
));
1912 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1913 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1914 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1915 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1916 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
1917 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
1918 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
1919 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
1921 if (ndr_flags
& NDR_BUFFERS
) {
1922 if (r
->account_name
) {
1923 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
1924 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
1925 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
1926 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->account_name
, ndr_charset_length(r
->account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
1928 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1929 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1930 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1931 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1933 return NDR_ERR_SUCCESS
;
1936 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_USER
*r
)
1938 uint32_t _ptr_account_name
;
1939 TALLOC_CTX
*_mem_save_account_name_0
;
1940 if (ndr_flags
& NDR_SCALARS
) {
1941 NDR_CHECK(ndr_pull_align(ndr
, 4));
1942 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account_name
));
1943 if (_ptr_account_name
) {
1944 NDR_PULL_ALLOC(ndr
, r
->account_name
);
1946 r
->account_name
= NULL
;
1948 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1949 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1950 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1951 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1952 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
1953 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
1954 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
1955 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
1957 if (ndr_flags
& NDR_BUFFERS
) {
1958 if (r
->account_name
) {
1959 _mem_save_account_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1960 NDR_PULL_SET_MEM_CTX(ndr
, r
->account_name
, 0);
1961 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->account_name
));
1962 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->account_name
));
1963 if (ndr_get_array_length(ndr
, &r
->account_name
) > ndr_get_array_size(ndr
, &r
->account_name
)) {
1964 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->account_name
), ndr_get_array_length(ndr
, &r
->account_name
));
1966 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t)));
1967 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->account_name
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t), CH_UTF16
));
1968 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_name_0
, 0);
1970 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1971 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1972 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1973 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1975 return NDR_ERR_SUCCESS
;
1978 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_USER
*r
)
1980 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_USER");
1982 ndr_print_ptr(ndr
, "account_name", r
->account_name
);
1984 if (r
->account_name
) {
1985 ndr_print_string(ndr
, "account_name", r
->account_name
);
1988 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
1989 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
1990 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
1991 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
1992 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
1993 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
1994 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
1995 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
1999 static enum ndr_err_code
ndr_push_netr_USER_KEY16(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEY16
*r
)
2001 if (ndr_flags
& NDR_SCALARS
) {
2002 NDR_CHECK(ndr_push_align(ndr
, 4));
2003 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
2004 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
2005 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
2006 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->pwd
));
2008 if (ndr_flags
& NDR_BUFFERS
) {
2009 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_BUFFERS
, &r
->pwd
));
2011 return NDR_ERR_SUCCESS
;
2014 static enum ndr_err_code
ndr_pull_netr_USER_KEY16(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEY16
*r
)
2016 if (ndr_flags
& NDR_SCALARS
) {
2017 NDR_CHECK(ndr_pull_align(ndr
, 4));
2018 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
2019 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
2020 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
2021 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->pwd
));
2023 if (ndr_flags
& NDR_BUFFERS
) {
2024 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_BUFFERS
, &r
->pwd
));
2026 return NDR_ERR_SUCCESS
;
2029 _PUBLIC_
void ndr_print_netr_USER_KEY16(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEY16
*r
)
2031 ndr_print_struct(ndr
, name
, "netr_USER_KEY16");
2033 ndr_print_uint16(ndr
, "length", r
->length
);
2034 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->length
:r
->size
);
2035 ndr_print_uint32(ndr
, "flags", r
->flags
);
2036 ndr_print_samr_Password(ndr
, "pwd", &r
->pwd
);
2040 static enum ndr_err_code
ndr_push_netr_PasswordHistory(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PasswordHistory
*r
)
2042 if (ndr_flags
& NDR_SCALARS
) {
2043 NDR_CHECK(ndr_push_align(ndr
, 4));
2044 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->nt_length
));
2045 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->nt_length
));
2046 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->nt_flags
));
2047 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->lm_length
));
2048 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->lm_length
));
2049 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->lm_flags
));
2050 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->nt_history
, r
->nt_length
));
2051 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->lm_history
, r
->lm_length
));
2053 if (ndr_flags
& NDR_BUFFERS
) {
2055 return NDR_ERR_SUCCESS
;
2058 static enum ndr_err_code
ndr_pull_netr_PasswordHistory(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PasswordHistory
*r
)
2060 if (ndr_flags
& NDR_SCALARS
) {
2061 NDR_CHECK(ndr_pull_align(ndr
, 4));
2062 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->nt_length
));
2063 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->nt_size
));
2064 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->nt_flags
));
2065 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->lm_length
));
2066 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->lm_size
));
2067 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->lm_flags
));
2068 NDR_PULL_ALLOC_N(ndr
, r
->nt_history
, r
->nt_length
);
2069 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->nt_history
, r
->nt_length
));
2070 NDR_PULL_ALLOC_N(ndr
, r
->lm_history
, r
->lm_length
);
2071 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->lm_history
, r
->lm_length
));
2073 if (ndr_flags
& NDR_BUFFERS
) {
2075 return NDR_ERR_SUCCESS
;
2078 _PUBLIC_
void ndr_print_netr_PasswordHistory(struct ndr_print
*ndr
, const char *name
, const struct netr_PasswordHistory
*r
)
2080 ndr_print_struct(ndr
, name
, "netr_PasswordHistory");
2082 ndr_print_uint16(ndr
, "nt_length", r
->nt_length
);
2083 ndr_print_uint16(ndr
, "nt_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->nt_length
:r
->nt_size
);
2084 ndr_print_uint32(ndr
, "nt_flags", r
->nt_flags
);
2085 ndr_print_uint16(ndr
, "lm_length", r
->lm_length
);
2086 ndr_print_uint16(ndr
, "lm_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->lm_length
:r
->lm_size
);
2087 ndr_print_uint32(ndr
, "lm_flags", r
->lm_flags
);
2088 ndr_print_array_uint8(ndr
, "nt_history", r
->nt_history
, r
->nt_length
);
2089 ndr_print_array_uint8(ndr
, "lm_history", r
->lm_history
, r
->lm_length
);
2093 static enum ndr_err_code
ndr_push_netr_USER_KEYS2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEYS2
*r
)
2095 if (ndr_flags
& NDR_SCALARS
) {
2096 NDR_CHECK(ndr_push_align(ndr
, 4));
2097 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2098 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2099 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr
, NDR_SCALARS
, &r
->history
));
2101 if (ndr_flags
& NDR_BUFFERS
) {
2102 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
2103 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
2105 return NDR_ERR_SUCCESS
;
2108 static enum ndr_err_code
ndr_pull_netr_USER_KEYS2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEYS2
*r
)
2110 if (ndr_flags
& NDR_SCALARS
) {
2111 NDR_CHECK(ndr_pull_align(ndr
, 4));
2112 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2113 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2114 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr
, NDR_SCALARS
, &r
->history
));
2116 if (ndr_flags
& NDR_BUFFERS
) {
2117 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
2118 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
2120 return NDR_ERR_SUCCESS
;
2123 _PUBLIC_
void ndr_print_netr_USER_KEYS2(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEYS2
*r
)
2125 ndr_print_struct(ndr
, name
, "netr_USER_KEYS2");
2127 ndr_print_netr_USER_KEY16(ndr
, "lmpassword", &r
->lmpassword
);
2128 ndr_print_netr_USER_KEY16(ndr
, "ntpassword", &r
->ntpassword
);
2129 ndr_print_netr_PasswordHistory(ndr
, "history", &r
->history
);
2133 static enum ndr_err_code
ndr_push_netr_USER_KEY_UNION(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEY_UNION
*r
)
2135 if (ndr_flags
& NDR_SCALARS
) {
2136 NDR_CHECK(ndr_push_align(ndr
, 4));
2137 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr
, NDR_SCALARS
, &r
->keys2
));
2139 if (ndr_flags
& NDR_BUFFERS
) {
2140 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr
, NDR_BUFFERS
, &r
->keys2
));
2142 return NDR_ERR_SUCCESS
;
2145 static enum ndr_err_code
ndr_pull_netr_USER_KEY_UNION(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEY_UNION
*r
)
2147 if (ndr_flags
& NDR_SCALARS
) {
2148 NDR_CHECK(ndr_pull_align(ndr
, 4));
2149 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr
, NDR_SCALARS
, &r
->keys2
));
2151 if (ndr_flags
& NDR_BUFFERS
) {
2152 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr
, NDR_BUFFERS
, &r
->keys2
));
2154 return NDR_ERR_SUCCESS
;
2157 _PUBLIC_
void ndr_print_netr_USER_KEY_UNION(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEY_UNION
*r
)
2159 ndr_print_struct(ndr
, name
, "netr_USER_KEY_UNION");
2161 ndr_print_netr_USER_KEYS2(ndr
, "keys2", &r
->keys2
);
2165 _PUBLIC_
enum ndr_err_code
ndr_push_netr_USER_KEYS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEYS
*r
)
2167 if (ndr_flags
& NDR_SCALARS
) {
2168 NDR_CHECK(ndr_push_align(ndr
, 4));
2169 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->version
));
2170 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr
, NDR_SCALARS
, &r
->keys
));
2172 if (ndr_flags
& NDR_BUFFERS
) {
2173 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr
, NDR_BUFFERS
, &r
->keys
));
2175 return NDR_ERR_SUCCESS
;
2178 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_USER_KEYS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEYS
*r
)
2180 if (ndr_flags
& NDR_SCALARS
) {
2181 NDR_CHECK(ndr_pull_align(ndr
, 4));
2182 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->version
));
2183 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr
, NDR_SCALARS
, &r
->keys
));
2185 if (ndr_flags
& NDR_BUFFERS
) {
2186 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr
, NDR_BUFFERS
, &r
->keys
));
2188 return NDR_ERR_SUCCESS
;
2191 _PUBLIC_
void ndr_print_netr_USER_KEYS(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEYS
*r
)
2193 ndr_print_struct(ndr
, name
, "netr_USER_KEYS");
2195 ndr_print_uint32(ndr
, "version", r
->version
);
2196 ndr_print_netr_USER_KEY_UNION(ndr
, "keys", &r
->keys
);
2200 static enum ndr_err_code
ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_PRIVATE_INFO
*r
)
2202 if (ndr_flags
& NDR_SCALARS
) {
2203 NDR_CHECK(ndr_push_align(ndr
, 4));
2204 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->SensitiveDataFlag
));
2205 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->DataLength
));
2207 uint32_t _flags_save_uint8
= ndr
->flags
;
2208 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2209 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->SensitiveData
));
2210 ndr
->flags
= _flags_save_uint8
;
2213 if (ndr_flags
& NDR_BUFFERS
) {
2215 uint32_t _flags_save_uint8
= ndr
->flags
;
2216 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2217 if (r
->SensitiveData
) {
2218 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->DataLength
));
2219 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->SensitiveData
, r
->DataLength
));
2221 ndr
->flags
= _flags_save_uint8
;
2224 return NDR_ERR_SUCCESS
;
2227 static enum ndr_err_code
ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_PRIVATE_INFO
*r
)
2229 uint32_t _ptr_SensitiveData
;
2230 TALLOC_CTX
*_mem_save_SensitiveData_0
;
2231 if (ndr_flags
& NDR_SCALARS
) {
2232 NDR_CHECK(ndr_pull_align(ndr
, 4));
2233 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->SensitiveDataFlag
));
2234 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->DataLength
));
2236 uint32_t _flags_save_uint8
= ndr
->flags
;
2237 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2238 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_SensitiveData
));
2239 if (_ptr_SensitiveData
) {
2240 NDR_PULL_ALLOC(ndr
, r
->SensitiveData
);
2242 r
->SensitiveData
= NULL
;
2244 ndr
->flags
= _flags_save_uint8
;
2247 if (ndr_flags
& NDR_BUFFERS
) {
2249 uint32_t _flags_save_uint8
= ndr
->flags
;
2250 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2251 if (r
->SensitiveData
) {
2252 _mem_save_SensitiveData_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2253 NDR_PULL_SET_MEM_CTX(ndr
, r
->SensitiveData
, 0);
2254 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->SensitiveData
));
2255 NDR_PULL_ALLOC_N(ndr
, r
->SensitiveData
, ndr_get_array_size(ndr
, &r
->SensitiveData
));
2256 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->SensitiveData
, ndr_get_array_size(ndr
, &r
->SensitiveData
)));
2257 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_SensitiveData_0
, 0);
2259 ndr
->flags
= _flags_save_uint8
;
2261 if (r
->SensitiveData
) {
2262 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->SensitiveData
, r
->DataLength
));
2265 return NDR_ERR_SUCCESS
;
2268 _PUBLIC_
void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_PRIVATE_INFO
*r
)
2270 ndr_print_struct(ndr
, name
, "netr_USER_PRIVATE_INFO");
2272 ndr_print_uint8(ndr
, "SensitiveDataFlag", r
->SensitiveDataFlag
);
2273 ndr_print_uint32(ndr
, "DataLength", r
->DataLength
);
2274 ndr_print_ptr(ndr
, "SensitiveData", r
->SensitiveData
);
2276 if (r
->SensitiveData
) {
2277 ndr_print_array_uint8(ndr
, "SensitiveData", r
->SensitiveData
, r
->DataLength
);
2283 static enum ndr_err_code
ndr_push_netr_DELTA_USER(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_USER
*r
)
2285 if (ndr_flags
& NDR_SCALARS
) {
2286 NDR_CHECK(ndr_push_align(ndr
, 4));
2287 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
2288 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
2289 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
2290 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->primary_gid
));
2291 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
2292 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
2293 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
2294 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2295 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->workstations
));
2296 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logon
));
2297 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logoff
));
2298 NDR_CHECK(ndr_push_samr_LogonHours(ndr
, NDR_SCALARS
, &r
->logon_hours
));
2299 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->bad_password_count
));
2300 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
2301 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_password_change
));
2302 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->acct_expiry
));
2303 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->acct_flags
));
2304 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2305 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2306 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->nt_password_present
));
2307 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->lm_password_present
));
2308 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->password_expired
));
2309 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2310 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->parameters
));
2311 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->country_code
));
2312 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->code_page
));
2313 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr
, NDR_SCALARS
, &r
->user_private_info
));
2314 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2315 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2316 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
2317 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2318 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2319 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2320 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2321 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2322 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2323 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2325 if (ndr_flags
& NDR_BUFFERS
) {
2326 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
2327 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
2328 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
2329 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
2330 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
2331 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2332 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstations
));
2333 NDR_CHECK(ndr_push_samr_LogonHours(ndr
, NDR_BUFFERS
, &r
->logon_hours
));
2334 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
2335 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
2336 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2337 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->parameters
));
2338 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr
, NDR_BUFFERS
, &r
->user_private_info
));
2339 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2340 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
2341 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2342 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2343 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2345 return NDR_ERR_SUCCESS
;
2348 static enum ndr_err_code
ndr_pull_netr_DELTA_USER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_USER
*r
)
2350 if (ndr_flags
& NDR_SCALARS
) {
2351 NDR_CHECK(ndr_pull_align(ndr
, 4));
2352 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
2353 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
2354 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
2355 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->primary_gid
));
2356 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
2357 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
2358 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
2359 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2360 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->workstations
));
2361 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logon
));
2362 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logoff
));
2363 NDR_CHECK(ndr_pull_samr_LogonHours(ndr
, NDR_SCALARS
, &r
->logon_hours
));
2364 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->bad_password_count
));
2365 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
2366 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_password_change
));
2367 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->acct_expiry
));
2368 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->acct_flags
));
2369 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2370 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2371 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->nt_password_present
));
2372 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->lm_password_present
));
2373 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->password_expired
));
2374 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2375 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->parameters
));
2376 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->country_code
));
2377 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->code_page
));
2378 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr
, NDR_SCALARS
, &r
->user_private_info
));
2379 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2380 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2381 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
2382 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2383 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2384 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2385 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2386 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2387 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2388 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2390 if (ndr_flags
& NDR_BUFFERS
) {
2391 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
2392 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
2393 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
2394 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
2395 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
2396 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2397 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstations
));
2398 NDR_CHECK(ndr_pull_samr_LogonHours(ndr
, NDR_BUFFERS
, &r
->logon_hours
));
2399 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_BUFFERS
, &r
->lmpassword
));
2400 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_BUFFERS
, &r
->ntpassword
));
2401 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2402 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->parameters
));
2403 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr
, NDR_BUFFERS
, &r
->user_private_info
));
2404 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2405 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
2406 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2407 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2408 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2410 return NDR_ERR_SUCCESS
;
2413 _PUBLIC_
void ndr_print_netr_DELTA_USER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_USER
*r
)
2415 ndr_print_struct(ndr
, name
, "netr_DELTA_USER");
2417 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
2418 ndr_print_lsa_String(ndr
, "full_name", &r
->full_name
);
2419 ndr_print_uint32(ndr
, "rid", r
->rid
);
2420 ndr_print_uint32(ndr
, "primary_gid", r
->primary_gid
);
2421 ndr_print_lsa_String(ndr
, "home_directory", &r
->home_directory
);
2422 ndr_print_lsa_String(ndr
, "home_drive", &r
->home_drive
);
2423 ndr_print_lsa_String(ndr
, "logon_script", &r
->logon_script
);
2424 ndr_print_lsa_String(ndr
, "description", &r
->description
);
2425 ndr_print_lsa_String(ndr
, "workstations", &r
->workstations
);
2426 ndr_print_NTTIME(ndr
, "last_logon", r
->last_logon
);
2427 ndr_print_NTTIME(ndr
, "last_logoff", r
->last_logoff
);
2428 ndr_print_samr_LogonHours(ndr
, "logon_hours", &r
->logon_hours
);
2429 ndr_print_uint16(ndr
, "bad_password_count", r
->bad_password_count
);
2430 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
2431 ndr_print_NTTIME(ndr
, "last_password_change", r
->last_password_change
);
2432 ndr_print_NTTIME(ndr
, "acct_expiry", r
->acct_expiry
);
2433 ndr_print_samr_AcctFlags(ndr
, "acct_flags", r
->acct_flags
);
2434 ndr_print_samr_Password(ndr
, "lmpassword", &r
->lmpassword
);
2435 ndr_print_samr_Password(ndr
, "ntpassword", &r
->ntpassword
);
2436 ndr_print_uint8(ndr
, "nt_password_present", r
->nt_password_present
);
2437 ndr_print_uint8(ndr
, "lm_password_present", r
->lm_password_present
);
2438 ndr_print_uint8(ndr
, "password_expired", r
->password_expired
);
2439 ndr_print_lsa_String(ndr
, "comment", &r
->comment
);
2440 ndr_print_lsa_String(ndr
, "parameters", &r
->parameters
);
2441 ndr_print_uint16(ndr
, "country_code", r
->country_code
);
2442 ndr_print_uint16(ndr
, "code_page", r
->code_page
);
2443 ndr_print_netr_USER_PRIVATE_INFO(ndr
, "user_private_info", &r
->user_private_info
);
2444 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2445 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2446 ndr_print_lsa_String(ndr
, "profile_path", &r
->profile_path
);
2447 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2448 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2449 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2450 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2451 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2452 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2453 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2457 static enum ndr_err_code
ndr_push_netr_DELTA_DOMAIN(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DOMAIN
*r
)
2459 if (ndr_flags
& NDR_SCALARS
) {
2460 NDR_CHECK(ndr_push_align(ndr
, 4));
2461 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
2462 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2463 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->force_logoff_time
));
2464 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->min_password_length
));
2465 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->password_history_length
));
2466 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->max_password_age
));
2467 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->min_password_age
));
2468 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->sequence_num
));
2469 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->domain_create_time
));
2470 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2471 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2472 NDR_CHECK(ndr_push_netr_AcctLockStr(ndr
, NDR_SCALARS
, &r
->account_lockout
));
2473 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2474 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2475 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2476 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_to_chgpass
));
2477 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2478 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2479 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2481 if (ndr_flags
& NDR_BUFFERS
) {
2482 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
2483 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2484 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2485 NDR_CHECK(ndr_push_netr_AcctLockStr(ndr
, NDR_BUFFERS
, &r
->account_lockout
));
2486 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2487 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2488 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2490 return NDR_ERR_SUCCESS
;
2493 static enum ndr_err_code
ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DOMAIN
*r
)
2495 if (ndr_flags
& NDR_SCALARS
) {
2496 NDR_CHECK(ndr_pull_align(ndr
, 4));
2497 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
2498 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2499 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->force_logoff_time
));
2500 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->min_password_length
));
2501 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->password_history_length
));
2502 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->max_password_age
));
2503 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->min_password_age
));
2504 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->sequence_num
));
2505 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->domain_create_time
));
2506 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2507 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2508 NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr
, NDR_SCALARS
, &r
->account_lockout
));
2509 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2510 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2511 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2512 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_to_chgpass
));
2513 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2514 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2515 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2517 if (ndr_flags
& NDR_BUFFERS
) {
2518 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
2519 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2520 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2521 NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr
, NDR_BUFFERS
, &r
->account_lockout
));
2522 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2523 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2524 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2526 return NDR_ERR_SUCCESS
;
2529 _PUBLIC_
void ndr_print_netr_DELTA_DOMAIN(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DOMAIN
*r
)
2531 ndr_print_struct(ndr
, name
, "netr_DELTA_DOMAIN");
2533 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
2534 ndr_print_lsa_String(ndr
, "comment", &r
->comment
);
2535 ndr_print_dlong(ndr
, "force_logoff_time", r
->force_logoff_time
);
2536 ndr_print_uint16(ndr
, "min_password_length", r
->min_password_length
);
2537 ndr_print_uint16(ndr
, "password_history_length", r
->password_history_length
);
2538 ndr_print_dlong(ndr
, "max_password_age", r
->max_password_age
);
2539 ndr_print_dlong(ndr
, "min_password_age", r
->min_password_age
);
2540 ndr_print_udlong(ndr
, "sequence_num", r
->sequence_num
);
2541 ndr_print_NTTIME(ndr
, "domain_create_time", r
->domain_create_time
);
2542 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2543 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2544 ndr_print_netr_AcctLockStr(ndr
, "account_lockout", &r
->account_lockout
);
2545 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2546 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2547 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2548 ndr_print_uint32(ndr
, "logon_to_chgpass", r
->logon_to_chgpass
);
2549 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2550 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2551 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2555 static enum ndr_err_code
ndr_push_netr_DELTA_GROUP(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_GROUP
*r
)
2557 if (ndr_flags
& NDR_SCALARS
) {
2558 NDR_CHECK(ndr_push_align(ndr
, 4));
2559 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->group_name
));
2560 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
2561 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attributes
));
2562 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2563 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2564 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2565 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2566 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2567 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2568 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2569 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2570 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2571 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2572 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2574 if (ndr_flags
& NDR_BUFFERS
) {
2575 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->group_name
));
2576 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2577 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2578 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2579 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2580 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2581 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2583 return NDR_ERR_SUCCESS
;
2586 static enum ndr_err_code
ndr_pull_netr_DELTA_GROUP(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_GROUP
*r
)
2588 if (ndr_flags
& NDR_SCALARS
) {
2589 NDR_CHECK(ndr_pull_align(ndr
, 4));
2590 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->group_name
));
2591 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
2592 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attributes
));
2593 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2594 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2595 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2596 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2597 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2598 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2599 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2600 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2601 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2602 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2603 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2605 if (ndr_flags
& NDR_BUFFERS
) {
2606 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->group_name
));
2607 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2608 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2609 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2610 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2611 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2612 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2614 return NDR_ERR_SUCCESS
;
2617 _PUBLIC_
void ndr_print_netr_DELTA_GROUP(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_GROUP
*r
)
2619 ndr_print_struct(ndr
, name
, "netr_DELTA_GROUP");
2621 ndr_print_lsa_String(ndr
, "group_name", &r
->group_name
);
2622 ndr_print_uint32(ndr
, "rid", r
->rid
);
2623 ndr_print_uint32(ndr
, "attributes", r
->attributes
);
2624 ndr_print_lsa_String(ndr
, "description", &r
->description
);
2625 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2626 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2627 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
2628 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2629 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2630 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2631 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2632 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2633 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2634 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2638 static enum ndr_err_code
ndr_push_netr_DELTA_RENAME(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_RENAME
*r
)
2640 if (ndr_flags
& NDR_SCALARS
) {
2641 NDR_CHECK(ndr_push_align(ndr
, 4));
2642 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->OldName
));
2643 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->NewName
));
2644 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2645 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2646 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2647 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2648 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2649 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2650 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2651 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2653 if (ndr_flags
& NDR_BUFFERS
) {
2654 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->OldName
));
2655 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->NewName
));
2656 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2657 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2658 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2659 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2661 return NDR_ERR_SUCCESS
;
2664 static enum ndr_err_code
ndr_pull_netr_DELTA_RENAME(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_RENAME
*r
)
2666 if (ndr_flags
& NDR_SCALARS
) {
2667 NDR_CHECK(ndr_pull_align(ndr
, 4));
2668 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->OldName
));
2669 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->NewName
));
2670 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2671 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2672 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2673 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2674 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2675 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2676 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2677 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2679 if (ndr_flags
& NDR_BUFFERS
) {
2680 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->OldName
));
2681 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->NewName
));
2682 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2683 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2684 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2685 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2687 return NDR_ERR_SUCCESS
;
2690 _PUBLIC_
void ndr_print_netr_DELTA_RENAME(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_RENAME
*r
)
2692 ndr_print_struct(ndr
, name
, "netr_DELTA_RENAME");
2694 ndr_print_lsa_String(ndr
, "OldName", &r
->OldName
);
2695 ndr_print_lsa_String(ndr
, "NewName", &r
->NewName
);
2696 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
2697 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2698 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2699 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2700 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2701 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2702 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2703 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2707 static enum ndr_err_code
ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_GROUP_MEMBER
*r
)
2709 uint32_t cntr_rids_1
;
2710 uint32_t cntr_attribs_1
;
2711 if (ndr_flags
& NDR_SCALARS
) {
2712 NDR_CHECK(ndr_push_align(ndr
, 4));
2713 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rids
));
2714 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->attribs
));
2715 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2716 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
2717 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
2718 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
2719 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
2721 if (ndr_flags
& NDR_BUFFERS
) {
2723 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2724 for (cntr_rids_1
= 0; cntr_rids_1
< r
->num_rids
; cntr_rids_1
++) {
2725 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rids
[cntr_rids_1
]));
2729 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2730 for (cntr_attribs_1
= 0; cntr_attribs_1
< r
->num_rids
; cntr_attribs_1
++) {
2731 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attribs
[cntr_attribs_1
]));
2735 return NDR_ERR_SUCCESS
;
2738 static enum ndr_err_code
ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_GROUP_MEMBER
*r
)
2741 uint32_t cntr_rids_1
;
2742 TALLOC_CTX
*_mem_save_rids_0
;
2743 TALLOC_CTX
*_mem_save_rids_1
;
2744 uint32_t _ptr_attribs
;
2745 uint32_t cntr_attribs_1
;
2746 TALLOC_CTX
*_mem_save_attribs_0
;
2747 TALLOC_CTX
*_mem_save_attribs_1
;
2748 if (ndr_flags
& NDR_SCALARS
) {
2749 NDR_CHECK(ndr_pull_align(ndr
, 4));
2750 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rids
));
2752 NDR_PULL_ALLOC(ndr
, r
->rids
);
2756 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_attribs
));
2758 NDR_PULL_ALLOC(ndr
, r
->attribs
);
2762 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_rids
));
2763 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
2764 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
2765 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
2766 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
2768 if (ndr_flags
& NDR_BUFFERS
) {
2770 _mem_save_rids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2771 NDR_PULL_SET_MEM_CTX(ndr
, r
->rids
, 0);
2772 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->rids
));
2773 NDR_PULL_ALLOC_N(ndr
, r
->rids
, ndr_get_array_size(ndr
, &r
->rids
));
2774 _mem_save_rids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
2775 NDR_PULL_SET_MEM_CTX(ndr
, r
->rids
, 0);
2776 for (cntr_rids_1
= 0; cntr_rids_1
< r
->num_rids
; cntr_rids_1
++) {
2777 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rids
[cntr_rids_1
]));
2779 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rids_1
, 0);
2780 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rids_0
, 0);
2783 _mem_save_attribs_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2784 NDR_PULL_SET_MEM_CTX(ndr
, r
->attribs
, 0);
2785 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->attribs
));
2786 NDR_PULL_ALLOC_N(ndr
, r
->attribs
, ndr_get_array_size(ndr
, &r
->attribs
));
2787 _mem_save_attribs_1
= NDR_PULL_GET_MEM_CTX(ndr
);
2788 NDR_PULL_SET_MEM_CTX(ndr
, r
->attribs
, 0);
2789 for (cntr_attribs_1
= 0; cntr_attribs_1
< r
->num_rids
; cntr_attribs_1
++) {
2790 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attribs
[cntr_attribs_1
]));
2792 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_attribs_1
, 0);
2793 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_attribs_0
, 0);
2796 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->rids
, r
->num_rids
));
2799 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->attribs
, r
->num_rids
));
2802 return NDR_ERR_SUCCESS
;
2805 _PUBLIC_
void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_GROUP_MEMBER
*r
)
2807 uint32_t cntr_rids_1
;
2808 uint32_t cntr_attribs_1
;
2809 ndr_print_struct(ndr
, name
, "netr_DELTA_GROUP_MEMBER");
2811 ndr_print_ptr(ndr
, "rids", r
->rids
);
2814 ndr
->print(ndr
, "%s: ARRAY(%d)", "rids", r
->num_rids
);
2816 for (cntr_rids_1
=0;cntr_rids_1
<r
->num_rids
;cntr_rids_1
++) {
2818 asprintf(&idx_1
, "[%d]", cntr_rids_1
);
2820 ndr_print_uint32(ndr
, "rids", r
->rids
[cntr_rids_1
]);
2827 ndr_print_ptr(ndr
, "attribs", r
->attribs
);
2830 ndr
->print(ndr
, "%s: ARRAY(%d)", "attribs", r
->num_rids
);
2832 for (cntr_attribs_1
=0;cntr_attribs_1
<r
->num_rids
;cntr_attribs_1
++) {
2834 asprintf(&idx_1
, "[%d]", cntr_attribs_1
);
2836 ndr_print_uint32(ndr
, "attribs", r
->attribs
[cntr_attribs_1
]);
2843 ndr_print_uint32(ndr
, "num_rids", r
->num_rids
);
2844 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
2845 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
2846 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
2847 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
2851 static enum ndr_err_code
ndr_push_netr_DELTA_ALIAS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ALIAS
*r
)
2853 if (ndr_flags
& NDR_SCALARS
) {
2854 NDR_CHECK(ndr_push_align(ndr
, 4));
2855 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->alias_name
));
2856 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
2857 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2858 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2859 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2860 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2861 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2862 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2863 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2864 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2865 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2866 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2868 if (ndr_flags
& NDR_BUFFERS
) {
2869 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->alias_name
));
2870 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2871 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2872 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2873 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2874 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2876 return NDR_ERR_SUCCESS
;
2879 static enum ndr_err_code
ndr_pull_netr_DELTA_ALIAS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ALIAS
*r
)
2881 if (ndr_flags
& NDR_SCALARS
) {
2882 NDR_CHECK(ndr_pull_align(ndr
, 4));
2883 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->alias_name
));
2884 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
2885 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2886 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2887 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2888 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2889 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2890 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2891 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2892 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2893 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2894 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2896 if (ndr_flags
& NDR_BUFFERS
) {
2897 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->alias_name
));
2898 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2899 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2900 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2901 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2902 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2904 return NDR_ERR_SUCCESS
;
2907 _PUBLIC_
void ndr_print_netr_DELTA_ALIAS(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ALIAS
*r
)
2909 ndr_print_struct(ndr
, name
, "netr_DELTA_ALIAS");
2911 ndr_print_lsa_String(ndr
, "alias_name", &r
->alias_name
);
2912 ndr_print_uint32(ndr
, "rid", r
->rid
);
2913 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2914 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2915 ndr_print_lsa_String(ndr
, "description", &r
->description
);
2916 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2917 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2918 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2919 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2920 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2921 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2922 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2926 static enum ndr_err_code
ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ALIAS_MEMBER
*r
)
2928 if (ndr_flags
& NDR_SCALARS
) {
2929 NDR_CHECK(ndr_push_align(ndr
, 4));
2930 NDR_CHECK(ndr_push_lsa_SidArray(ndr
, NDR_SCALARS
, &r
->sids
));
2931 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
2932 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
2933 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
2934 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
2936 if (ndr_flags
& NDR_BUFFERS
) {
2937 NDR_CHECK(ndr_push_lsa_SidArray(ndr
, NDR_BUFFERS
, &r
->sids
));
2939 return NDR_ERR_SUCCESS
;
2942 static enum ndr_err_code
ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ALIAS_MEMBER
*r
)
2944 if (ndr_flags
& NDR_SCALARS
) {
2945 NDR_CHECK(ndr_pull_align(ndr
, 4));
2946 NDR_CHECK(ndr_pull_lsa_SidArray(ndr
, NDR_SCALARS
, &r
->sids
));
2947 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
2948 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
2949 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
2950 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
2952 if (ndr_flags
& NDR_BUFFERS
) {
2953 NDR_CHECK(ndr_pull_lsa_SidArray(ndr
, NDR_BUFFERS
, &r
->sids
));
2955 return NDR_ERR_SUCCESS
;
2958 _PUBLIC_
void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ALIAS_MEMBER
*r
)
2960 ndr_print_struct(ndr
, name
, "netr_DELTA_ALIAS_MEMBER");
2962 ndr_print_lsa_SidArray(ndr
, "sids", &r
->sids
);
2963 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
2964 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
2965 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
2966 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
2970 static enum ndr_err_code
ndr_push_netr_QUOTA_LIMITS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_QUOTA_LIMITS
*r
)
2972 if (ndr_flags
& NDR_SCALARS
) {
2973 NDR_CHECK(ndr_push_align(ndr
, 4));
2974 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pagedpoollimit
));
2975 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->nonpagedpoollimit
));
2976 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->minimumworkingsetsize
));
2977 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maximumworkingsetsize
));
2978 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pagefilelimit
));
2979 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->timelimit
));
2981 if (ndr_flags
& NDR_BUFFERS
) {
2983 return NDR_ERR_SUCCESS
;
2986 static enum ndr_err_code
ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_QUOTA_LIMITS
*r
)
2988 if (ndr_flags
& NDR_SCALARS
) {
2989 NDR_CHECK(ndr_pull_align(ndr
, 4));
2990 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pagedpoollimit
));
2991 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->nonpagedpoollimit
));
2992 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->minimumworkingsetsize
));
2993 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maximumworkingsetsize
));
2994 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pagefilelimit
));
2995 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->timelimit
));
2997 if (ndr_flags
& NDR_BUFFERS
) {
2999 return NDR_ERR_SUCCESS
;
3002 _PUBLIC_
void ndr_print_netr_QUOTA_LIMITS(struct ndr_print
*ndr
, const char *name
, const struct netr_QUOTA_LIMITS
*r
)
3004 ndr_print_struct(ndr
, name
, "netr_QUOTA_LIMITS");
3006 ndr_print_uint32(ndr
, "pagedpoollimit", r
->pagedpoollimit
);
3007 ndr_print_uint32(ndr
, "nonpagedpoollimit", r
->nonpagedpoollimit
);
3008 ndr_print_uint32(ndr
, "minimumworkingsetsize", r
->minimumworkingsetsize
);
3009 ndr_print_uint32(ndr
, "maximumworkingsetsize", r
->maximumworkingsetsize
);
3010 ndr_print_uint32(ndr
, "pagefilelimit", r
->pagefilelimit
);
3011 ndr_print_NTTIME(ndr
, "timelimit", r
->timelimit
);
3015 static enum ndr_err_code
ndr_push_netr_DELTA_POLICY(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_POLICY
*r
)
3017 uint32_t cntr_eventauditoptions_1
;
3018 if (ndr_flags
& NDR_SCALARS
) {
3019 NDR_CHECK(ndr_push_align(ndr
, 4));
3020 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlogsize
));
3021 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->auditretentionperiod
));
3022 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->auditingmode
));
3023 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxauditeventcount
));
3024 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->eventauditoptions
));
3025 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->primary_domain_name
));
3026 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
3027 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quota_limits
));
3028 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->sequence_num
));
3029 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->db_create_time
));
3030 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3031 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3032 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3033 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3034 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3035 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3036 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3037 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3038 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3039 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3041 if (ndr_flags
& NDR_BUFFERS
) {
3042 if (r
->eventauditoptions
) {
3043 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxauditeventcount
+ 1));
3044 for (cntr_eventauditoptions_1
= 0; cntr_eventauditoptions_1
< r
->maxauditeventcount
+ 1; cntr_eventauditoptions_1
++) {
3045 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->eventauditoptions
[cntr_eventauditoptions_1
]));
3048 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->primary_domain_name
));
3050 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
3052 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3053 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3054 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3055 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3056 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3058 return NDR_ERR_SUCCESS
;
3061 static enum ndr_err_code
ndr_pull_netr_DELTA_POLICY(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_POLICY
*r
)
3063 uint32_t _ptr_eventauditoptions
;
3064 uint32_t cntr_eventauditoptions_1
;
3065 TALLOC_CTX
*_mem_save_eventauditoptions_0
;
3066 TALLOC_CTX
*_mem_save_eventauditoptions_1
;
3068 TALLOC_CTX
*_mem_save_sid_0
;
3069 if (ndr_flags
& NDR_SCALARS
) {
3070 NDR_CHECK(ndr_pull_align(ndr
, 4));
3071 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxlogsize
));
3072 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->auditretentionperiod
));
3073 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->auditingmode
));
3074 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxauditeventcount
));
3075 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_eventauditoptions
));
3076 if (_ptr_eventauditoptions
) {
3077 NDR_PULL_ALLOC(ndr
, r
->eventauditoptions
);
3079 r
->eventauditoptions
= NULL
;
3081 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->primary_domain_name
));
3082 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
3084 NDR_PULL_ALLOC(ndr
, r
->sid
);
3088 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quota_limits
));
3089 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->sequence_num
));
3090 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->db_create_time
));
3091 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3092 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3093 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3094 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3095 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3096 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3097 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3098 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3099 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3100 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3102 if (ndr_flags
& NDR_BUFFERS
) {
3103 if (r
->eventauditoptions
) {
3104 _mem_save_eventauditoptions_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3105 NDR_PULL_SET_MEM_CTX(ndr
, r
->eventauditoptions
, 0);
3106 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->eventauditoptions
));
3107 NDR_PULL_ALLOC_N(ndr
, r
->eventauditoptions
, ndr_get_array_size(ndr
, &r
->eventauditoptions
));
3108 _mem_save_eventauditoptions_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3109 NDR_PULL_SET_MEM_CTX(ndr
, r
->eventauditoptions
, 0);
3110 for (cntr_eventauditoptions_1
= 0; cntr_eventauditoptions_1
< r
->maxauditeventcount
+ 1; cntr_eventauditoptions_1
++) {
3111 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->eventauditoptions
[cntr_eventauditoptions_1
]));
3113 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eventauditoptions_1
, 0);
3114 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eventauditoptions_0
, 0);
3116 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->primary_domain_name
));
3118 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3119 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
3120 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
3121 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
3123 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3124 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3125 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3126 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3127 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3128 if (r
->eventauditoptions
) {
3129 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->eventauditoptions
, r
->maxauditeventcount
+ 1));
3132 return NDR_ERR_SUCCESS
;
3135 _PUBLIC_
void ndr_print_netr_DELTA_POLICY(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_POLICY
*r
)
3137 uint32_t cntr_eventauditoptions_1
;
3138 ndr_print_struct(ndr
, name
, "netr_DELTA_POLICY");
3140 ndr_print_uint32(ndr
, "maxlogsize", r
->maxlogsize
);
3141 ndr_print_NTTIME(ndr
, "auditretentionperiod", r
->auditretentionperiod
);
3142 ndr_print_uint8(ndr
, "auditingmode", r
->auditingmode
);
3143 ndr_print_uint32(ndr
, "maxauditeventcount", r
->maxauditeventcount
);
3144 ndr_print_ptr(ndr
, "eventauditoptions", r
->eventauditoptions
);
3146 if (r
->eventauditoptions
) {
3147 ndr
->print(ndr
, "%s: ARRAY(%d)", "eventauditoptions", r
->maxauditeventcount
+ 1);
3149 for (cntr_eventauditoptions_1
=0;cntr_eventauditoptions_1
<r
->maxauditeventcount
+ 1;cntr_eventauditoptions_1
++) {
3151 asprintf(&idx_1
, "[%d]", cntr_eventauditoptions_1
);
3153 ndr_print_uint32(ndr
, "eventauditoptions", r
->eventauditoptions
[cntr_eventauditoptions_1
]);
3160 ndr_print_lsa_String(ndr
, "primary_domain_name", &r
->primary_domain_name
);
3161 ndr_print_ptr(ndr
, "sid", r
->sid
);
3164 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
3167 ndr_print_netr_QUOTA_LIMITS(ndr
, "quota_limits", &r
->quota_limits
);
3168 ndr_print_udlong(ndr
, "sequence_num", r
->sequence_num
);
3169 ndr_print_NTTIME(ndr
, "db_create_time", r
->db_create_time
);
3170 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3171 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3172 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3173 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3174 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3175 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3176 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3177 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3178 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3179 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3183 static enum ndr_err_code
ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_TRUSTED_DOMAIN
*r
)
3185 uint32_t cntr_controller_names_1
;
3186 if (ndr_flags
& NDR_SCALARS
) {
3187 NDR_CHECK(ndr_push_align(ndr
, 4));
3188 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
3189 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_controllers
));
3190 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->controller_names
));
3191 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3192 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3193 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3194 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3195 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3196 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3197 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->posix_offset
));
3198 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3199 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3200 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3202 if (ndr_flags
& NDR_BUFFERS
) {
3203 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
3204 if (r
->controller_names
) {
3205 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_controllers
));
3206 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3207 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->controller_names
[cntr_controller_names_1
]));
3209 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3210 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->controller_names
[cntr_controller_names_1
]));
3213 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3214 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3215 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3216 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3217 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3219 return NDR_ERR_SUCCESS
;
3222 static enum ndr_err_code
ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_TRUSTED_DOMAIN
*r
)
3224 uint32_t _ptr_controller_names
;
3225 uint32_t cntr_controller_names_1
;
3226 TALLOC_CTX
*_mem_save_controller_names_0
;
3227 TALLOC_CTX
*_mem_save_controller_names_1
;
3228 if (ndr_flags
& NDR_SCALARS
) {
3229 NDR_CHECK(ndr_pull_align(ndr
, 4));
3230 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
3231 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_controllers
));
3232 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_controller_names
));
3233 if (_ptr_controller_names
) {
3234 NDR_PULL_ALLOC(ndr
, r
->controller_names
);
3236 r
->controller_names
= NULL
;
3238 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3239 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3240 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3241 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3242 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3243 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3244 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->posix_offset
));
3245 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3246 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3247 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3249 if (ndr_flags
& NDR_BUFFERS
) {
3250 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
3251 if (r
->controller_names
) {
3252 _mem_save_controller_names_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3253 NDR_PULL_SET_MEM_CTX(ndr
, r
->controller_names
, 0);
3254 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->controller_names
));
3255 NDR_PULL_ALLOC_N(ndr
, r
->controller_names
, ndr_get_array_size(ndr
, &r
->controller_names
));
3256 _mem_save_controller_names_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3257 NDR_PULL_SET_MEM_CTX(ndr
, r
->controller_names
, 0);
3258 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3259 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->controller_names
[cntr_controller_names_1
]));
3261 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3262 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->controller_names
[cntr_controller_names_1
]));
3264 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_controller_names_1
, 0);
3265 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_controller_names_0
, 0);
3267 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3268 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3269 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3270 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3271 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3272 if (r
->controller_names
) {
3273 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->controller_names
, r
->num_controllers
));
3276 return NDR_ERR_SUCCESS
;
3279 _PUBLIC_
void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_TRUSTED_DOMAIN
*r
)
3281 uint32_t cntr_controller_names_1
;
3282 ndr_print_struct(ndr
, name
, "netr_DELTA_TRUSTED_DOMAIN");
3284 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
3285 ndr_print_uint32(ndr
, "num_controllers", r
->num_controllers
);
3286 ndr_print_ptr(ndr
, "controller_names", r
->controller_names
);
3288 if (r
->controller_names
) {
3289 ndr
->print(ndr
, "%s: ARRAY(%d)", "controller_names", r
->num_controllers
);
3291 for (cntr_controller_names_1
=0;cntr_controller_names_1
<r
->num_controllers
;cntr_controller_names_1
++) {
3293 asprintf(&idx_1
, "[%d]", cntr_controller_names_1
);
3295 ndr_print_lsa_String(ndr
, "controller_names", &r
->controller_names
[cntr_controller_names_1
]);
3302 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3303 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3304 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3305 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3306 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3307 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3308 ndr_print_uint32(ndr
, "posix_offset", r
->posix_offset
);
3309 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3310 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3311 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3315 static enum ndr_err_code
ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DELETE_TRUST
*r
)
3317 if (ndr_flags
& NDR_SCALARS
) {
3318 NDR_CHECK(ndr_push_align(ndr
, 2));
3319 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3321 if (ndr_flags
& NDR_BUFFERS
) {
3323 return NDR_ERR_SUCCESS
;
3326 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_TRUST
*r
)
3328 if (ndr_flags
& NDR_SCALARS
) {
3329 NDR_CHECK(ndr_pull_align(ndr
, 2));
3330 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3332 if (ndr_flags
& NDR_BUFFERS
) {
3334 return NDR_ERR_SUCCESS
;
3337 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_TRUST
*r
)
3339 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_TRUST");
3341 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3345 static enum ndr_err_code
ndr_push_netr_DELTA_ACCOUNT(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ACCOUNT
*r
)
3347 uint32_t cntr_privilege_attrib_1
;
3348 uint32_t cntr_privilege_name_1
;
3349 if (ndr_flags
& NDR_SCALARS
) {
3350 NDR_CHECK(ndr_push_align(ndr
, 4));
3351 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3352 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_control
));
3353 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->privilege_attrib
));
3354 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->privilege_name
));
3355 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quotalimits
));
3356 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->system_flags
));
3357 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3358 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3359 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3360 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3361 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3362 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3363 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3364 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3365 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3366 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3368 if (ndr_flags
& NDR_BUFFERS
) {
3369 if (r
->privilege_attrib
) {
3370 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3371 for (cntr_privilege_attrib_1
= 0; cntr_privilege_attrib_1
< r
->privilege_entries
; cntr_privilege_attrib_1
++) {
3372 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_attrib
[cntr_privilege_attrib_1
]));
3375 if (r
->privilege_name
) {
3376 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3377 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3378 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3380 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3381 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3384 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3385 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3386 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3387 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3388 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3390 return NDR_ERR_SUCCESS
;
3393 static enum ndr_err_code
ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ACCOUNT
*r
)
3395 uint32_t _ptr_privilege_attrib
;
3396 uint32_t cntr_privilege_attrib_1
;
3397 TALLOC_CTX
*_mem_save_privilege_attrib_0
;
3398 TALLOC_CTX
*_mem_save_privilege_attrib_1
;
3399 uint32_t _ptr_privilege_name
;
3400 uint32_t cntr_privilege_name_1
;
3401 TALLOC_CTX
*_mem_save_privilege_name_0
;
3402 TALLOC_CTX
*_mem_save_privilege_name_1
;
3403 if (ndr_flags
& NDR_SCALARS
) {
3404 NDR_CHECK(ndr_pull_align(ndr
, 4));
3405 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_entries
));
3406 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_control
));
3407 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_privilege_attrib
));
3408 if (_ptr_privilege_attrib
) {
3409 NDR_PULL_ALLOC(ndr
, r
->privilege_attrib
);
3411 r
->privilege_attrib
= NULL
;
3413 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_privilege_name
));
3414 if (_ptr_privilege_name
) {
3415 NDR_PULL_ALLOC(ndr
, r
->privilege_name
);
3417 r
->privilege_name
= NULL
;
3419 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quotalimits
));
3420 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->system_flags
));
3421 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3422 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3423 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3424 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3425 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3426 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3427 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3428 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3429 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3430 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3432 if (ndr_flags
& NDR_BUFFERS
) {
3433 if (r
->privilege_attrib
) {
3434 _mem_save_privilege_attrib_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3435 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_attrib
, 0);
3436 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->privilege_attrib
));
3437 NDR_PULL_ALLOC_N(ndr
, r
->privilege_attrib
, ndr_get_array_size(ndr
, &r
->privilege_attrib
));
3438 _mem_save_privilege_attrib_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3439 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_attrib
, 0);
3440 for (cntr_privilege_attrib_1
= 0; cntr_privilege_attrib_1
< r
->privilege_entries
; cntr_privilege_attrib_1
++) {
3441 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_attrib
[cntr_privilege_attrib_1
]));
3443 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_attrib_1
, 0);
3444 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_attrib_0
, 0);
3446 if (r
->privilege_name
) {
3447 _mem_save_privilege_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3448 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_name
, 0);
3449 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->privilege_name
));
3450 NDR_PULL_ALLOC_N(ndr
, r
->privilege_name
, ndr_get_array_size(ndr
, &r
->privilege_name
));
3451 _mem_save_privilege_name_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3452 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_name
, 0);
3453 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3454 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3456 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3457 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3459 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_name_1
, 0);
3460 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_name_0
, 0);
3462 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3463 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3464 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3465 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3466 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3467 if (r
->privilege_attrib
) {
3468 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->privilege_attrib
, r
->privilege_entries
));
3470 if (r
->privilege_name
) {
3471 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->privilege_name
, r
->privilege_entries
));
3474 return NDR_ERR_SUCCESS
;
3477 _PUBLIC_
void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ACCOUNT
*r
)
3479 uint32_t cntr_privilege_attrib_1
;
3480 uint32_t cntr_privilege_name_1
;
3481 ndr_print_struct(ndr
, name
, "netr_DELTA_ACCOUNT");
3483 ndr_print_uint32(ndr
, "privilege_entries", r
->privilege_entries
);
3484 ndr_print_uint32(ndr
, "privilege_control", r
->privilege_control
);
3485 ndr_print_ptr(ndr
, "privilege_attrib", r
->privilege_attrib
);
3487 if (r
->privilege_attrib
) {
3488 ndr
->print(ndr
, "%s: ARRAY(%d)", "privilege_attrib", r
->privilege_entries
);
3490 for (cntr_privilege_attrib_1
=0;cntr_privilege_attrib_1
<r
->privilege_entries
;cntr_privilege_attrib_1
++) {
3492 asprintf(&idx_1
, "[%d]", cntr_privilege_attrib_1
);
3494 ndr_print_uint32(ndr
, "privilege_attrib", r
->privilege_attrib
[cntr_privilege_attrib_1
]);
3501 ndr_print_ptr(ndr
, "privilege_name", r
->privilege_name
);
3503 if (r
->privilege_name
) {
3504 ndr
->print(ndr
, "%s: ARRAY(%d)", "privilege_name", r
->privilege_entries
);
3506 for (cntr_privilege_name_1
=0;cntr_privilege_name_1
<r
->privilege_entries
;cntr_privilege_name_1
++) {
3508 asprintf(&idx_1
, "[%d]", cntr_privilege_name_1
);
3510 ndr_print_lsa_String(ndr
, "privilege_name", &r
->privilege_name
[cntr_privilege_name_1
]);
3517 ndr_print_netr_QUOTA_LIMITS(ndr
, "quotalimits", &r
->quotalimits
);
3518 ndr_print_uint32(ndr
, "system_flags", r
->system_flags
);
3519 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3520 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3521 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3522 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3523 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3524 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3525 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3526 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3527 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3528 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3532 static enum ndr_err_code
ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DELETE_ACCOUNT
*r
)
3534 if (ndr_flags
& NDR_SCALARS
) {
3535 NDR_CHECK(ndr_push_align(ndr
, 2));
3536 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3538 if (ndr_flags
& NDR_BUFFERS
) {
3540 return NDR_ERR_SUCCESS
;
3543 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_ACCOUNT
*r
)
3545 if (ndr_flags
& NDR_SCALARS
) {
3546 NDR_CHECK(ndr_pull_align(ndr
, 2));
3547 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3549 if (ndr_flags
& NDR_BUFFERS
) {
3551 return NDR_ERR_SUCCESS
;
3554 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_ACCOUNT
*r
)
3556 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_ACCOUNT");
3558 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3562 static enum ndr_err_code
ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DELETE_SECRET
*r
)
3564 if (ndr_flags
& NDR_SCALARS
) {
3565 NDR_CHECK(ndr_push_align(ndr
, 2));
3566 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3568 if (ndr_flags
& NDR_BUFFERS
) {
3570 return NDR_ERR_SUCCESS
;
3573 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_SECRET
*r
)
3575 if (ndr_flags
& NDR_SCALARS
) {
3576 NDR_CHECK(ndr_pull_align(ndr
, 2));
3577 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3579 if (ndr_flags
& NDR_BUFFERS
) {
3581 return NDR_ERR_SUCCESS
;
3584 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_SECRET
*r
)
3586 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_SECRET");
3588 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3592 static enum ndr_err_code
ndr_push_netr_CIPHER_VALUE(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_CIPHER_VALUE
*r
)
3594 if (ndr_flags
& NDR_SCALARS
) {
3595 NDR_CHECK(ndr_push_align(ndr
, 4));
3596 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->len
));
3597 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlen
));
3598 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->cipher_data
));
3600 if (ndr_flags
& NDR_BUFFERS
) {
3601 if (r
->cipher_data
) {
3602 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlen
));
3603 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
3604 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->len
));
3605 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->cipher_data
, r
->len
));
3608 return NDR_ERR_SUCCESS
;
3611 static enum ndr_err_code
ndr_pull_netr_CIPHER_VALUE(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_CIPHER_VALUE
*r
)
3613 uint32_t _ptr_cipher_data
;
3614 TALLOC_CTX
*_mem_save_cipher_data_0
;
3615 if (ndr_flags
& NDR_SCALARS
) {
3616 NDR_CHECK(ndr_pull_align(ndr
, 4));
3617 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->len
));
3618 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxlen
));
3619 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_cipher_data
));
3620 if (_ptr_cipher_data
) {
3621 NDR_PULL_ALLOC(ndr
, r
->cipher_data
);
3623 r
->cipher_data
= NULL
;
3626 if (ndr_flags
& NDR_BUFFERS
) {
3627 if (r
->cipher_data
) {
3628 _mem_save_cipher_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3629 NDR_PULL_SET_MEM_CTX(ndr
, r
->cipher_data
, 0);
3630 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->cipher_data
));
3631 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->cipher_data
));
3632 if (ndr_get_array_length(ndr
, &r
->cipher_data
) > ndr_get_array_size(ndr
, &r
->cipher_data
)) {
3633 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->cipher_data
), ndr_get_array_length(ndr
, &r
->cipher_data
));
3635 NDR_PULL_ALLOC_N(ndr
, r
->cipher_data
, ndr_get_array_size(ndr
, &r
->cipher_data
));
3636 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->cipher_data
, ndr_get_array_length(ndr
, &r
->cipher_data
)));
3637 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_cipher_data_0
, 0);
3639 if (r
->cipher_data
) {
3640 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->cipher_data
, r
->maxlen
));
3642 if (r
->cipher_data
) {
3643 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->cipher_data
, r
->len
));
3646 return NDR_ERR_SUCCESS
;
3649 _PUBLIC_
void ndr_print_netr_CIPHER_VALUE(struct ndr_print
*ndr
, const char *name
, const struct netr_CIPHER_VALUE
*r
)
3651 ndr_print_struct(ndr
, name
, "netr_CIPHER_VALUE");
3653 ndr_print_uint32(ndr
, "len", r
->len
);
3654 ndr_print_uint32(ndr
, "maxlen", r
->maxlen
);
3655 ndr_print_ptr(ndr
, "cipher_data", r
->cipher_data
);
3657 if (r
->cipher_data
) {
3658 ndr_print_array_uint8(ndr
, "cipher_data", r
->cipher_data
, r
->len
);
3664 static enum ndr_err_code
ndr_push_netr_DELTA_SECRET(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_SECRET
*r
)
3666 if (ndr_flags
& NDR_SCALARS
) {
3667 NDR_CHECK(ndr_push_align(ndr
, 4));
3668 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->current_cipher
));
3669 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->current_cipher_set_time
));
3670 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->old_cipher
));
3671 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->old_cipher_set_time
));
3672 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3673 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3674 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3675 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3676 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3677 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3678 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3679 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3680 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3681 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3683 if (ndr_flags
& NDR_BUFFERS
) {
3684 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->current_cipher
));
3685 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->old_cipher
));
3686 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3687 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3688 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3689 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3690 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3692 return NDR_ERR_SUCCESS
;
3695 static enum ndr_err_code
ndr_pull_netr_DELTA_SECRET(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_SECRET
*r
)
3697 if (ndr_flags
& NDR_SCALARS
) {
3698 NDR_CHECK(ndr_pull_align(ndr
, 4));
3699 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->current_cipher
));
3700 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->current_cipher_set_time
));
3701 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->old_cipher
));
3702 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->old_cipher_set_time
));
3703 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3704 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3705 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3706 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3707 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3708 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3709 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3710 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3711 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3712 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3714 if (ndr_flags
& NDR_BUFFERS
) {
3715 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->current_cipher
));
3716 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->old_cipher
));
3717 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3718 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3719 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3720 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3721 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3723 return NDR_ERR_SUCCESS
;
3726 _PUBLIC_
void ndr_print_netr_DELTA_SECRET(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_SECRET
*r
)
3728 ndr_print_struct(ndr
, name
, "netr_DELTA_SECRET");
3730 ndr_print_netr_CIPHER_VALUE(ndr
, "current_cipher", &r
->current_cipher
);
3731 ndr_print_NTTIME(ndr
, "current_cipher_set_time", r
->current_cipher_set_time
);
3732 ndr_print_netr_CIPHER_VALUE(ndr
, "old_cipher", &r
->old_cipher
);
3733 ndr_print_NTTIME(ndr
, "old_cipher_set_time", r
->old_cipher_set_time
);
3734 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3735 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3736 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3737 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3738 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3739 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3740 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3741 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3742 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3743 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3747 static enum ndr_err_code
ndr_push_netr_DeltaEnum(struct ndr_push
*ndr
, int ndr_flags
, enum netr_DeltaEnum r
)
3749 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
));
3750 return NDR_ERR_SUCCESS
;
3753 static enum ndr_err_code
ndr_pull_netr_DeltaEnum(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_DeltaEnum
*r
)
3756 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &v
));
3758 return NDR_ERR_SUCCESS
;
3761 _PUBLIC_
void ndr_print_netr_DeltaEnum(struct ndr_print
*ndr
, const char *name
, enum netr_DeltaEnum r
)
3763 const char *val
= NULL
;
3766 case NETR_DELTA_DOMAIN
: val
= "NETR_DELTA_DOMAIN"; break;
3767 case NETR_DELTA_GROUP
: val
= "NETR_DELTA_GROUP"; break;
3768 case NETR_DELTA_DELETE_GROUP
: val
= "NETR_DELTA_DELETE_GROUP"; break;
3769 case NETR_DELTA_RENAME_GROUP
: val
= "NETR_DELTA_RENAME_GROUP"; break;
3770 case NETR_DELTA_USER
: val
= "NETR_DELTA_USER"; break;
3771 case NETR_DELTA_DELETE_USER
: val
= "NETR_DELTA_DELETE_USER"; break;
3772 case NETR_DELTA_RENAME_USER
: val
= "NETR_DELTA_RENAME_USER"; break;
3773 case NETR_DELTA_GROUP_MEMBER
: val
= "NETR_DELTA_GROUP_MEMBER"; break;
3774 case NETR_DELTA_ALIAS
: val
= "NETR_DELTA_ALIAS"; break;
3775 case NETR_DELTA_DELETE_ALIAS
: val
= "NETR_DELTA_DELETE_ALIAS"; break;
3776 case NETR_DELTA_RENAME_ALIAS
: val
= "NETR_DELTA_RENAME_ALIAS"; break;
3777 case NETR_DELTA_ALIAS_MEMBER
: val
= "NETR_DELTA_ALIAS_MEMBER"; break;
3778 case NETR_DELTA_POLICY
: val
= "NETR_DELTA_POLICY"; break;
3779 case NETR_DELTA_TRUSTED_DOMAIN
: val
= "NETR_DELTA_TRUSTED_DOMAIN"; break;
3780 case NETR_DELTA_DELETE_TRUST
: val
= "NETR_DELTA_DELETE_TRUST"; break;
3781 case NETR_DELTA_ACCOUNT
: val
= "NETR_DELTA_ACCOUNT"; break;
3782 case NETR_DELTA_DELETE_ACCOUNT
: val
= "NETR_DELTA_DELETE_ACCOUNT"; break;
3783 case NETR_DELTA_SECRET
: val
= "NETR_DELTA_SECRET"; break;
3784 case NETR_DELTA_DELETE_SECRET
: val
= "NETR_DELTA_DELETE_SECRET"; break;
3785 case NETR_DELTA_DELETE_GROUP2
: val
= "NETR_DELTA_DELETE_GROUP2"; break;
3786 case NETR_DELTA_DELETE_USER2
: val
= "NETR_DELTA_DELETE_USER2"; break;
3787 case NETR_DELTA_MODIFY_COUNT
: val
= "NETR_DELTA_MODIFY_COUNT"; break;
3789 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
3792 static enum ndr_err_code
ndr_push_netr_DELTA_UNION(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DELTA_UNION
*r
)
3794 if (ndr_flags
& NDR_SCALARS
) {
3795 int level
= ndr_push_get_switch_value(ndr
, r
);
3796 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, level
));
3798 case NETR_DELTA_DOMAIN
:
3799 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
3802 case NETR_DELTA_GROUP
:
3803 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->group
));
3806 case NETR_DELTA_DELETE_GROUP
:
3809 case NETR_DELTA_RENAME_GROUP
:
3810 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_group
));
3813 case NETR_DELTA_USER
:
3814 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->user
));
3817 case NETR_DELTA_DELETE_USER
:
3820 case NETR_DELTA_RENAME_USER
:
3821 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_user
));
3824 case NETR_DELTA_GROUP_MEMBER
:
3825 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->group_member
));
3828 case NETR_DELTA_ALIAS
:
3829 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->alias
));
3832 case NETR_DELTA_DELETE_ALIAS
:
3835 case NETR_DELTA_RENAME_ALIAS
:
3836 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_alias
));
3839 case NETR_DELTA_ALIAS_MEMBER
:
3840 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->alias_member
));
3843 case NETR_DELTA_POLICY
:
3844 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->policy
));
3847 case NETR_DELTA_TRUSTED_DOMAIN
:
3848 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusted_domain
));
3851 case NETR_DELTA_DELETE_TRUST
:
3852 NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr
, NDR_SCALARS
, &r
->delete_trust
));
3855 case NETR_DELTA_ACCOUNT
:
3856 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->account
));
3859 case NETR_DELTA_DELETE_ACCOUNT
:
3860 NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr
, NDR_SCALARS
, &r
->delete_account
));
3863 case NETR_DELTA_SECRET
:
3864 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->secret
));
3867 case NETR_DELTA_DELETE_SECRET
:
3868 NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr
, NDR_SCALARS
, &r
->delete_secret
));
3871 case NETR_DELTA_DELETE_GROUP2
:
3872 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delete_group
));
3875 case NETR_DELTA_DELETE_USER2
:
3876 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delete_user
));
3879 case NETR_DELTA_MODIFY_COUNT
:
3880 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->modified_count
));
3884 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
3887 if (ndr_flags
& NDR_BUFFERS
) {
3888 int level
= ndr_push_get_switch_value(ndr
, r
);
3890 case NETR_DELTA_DOMAIN
:
3892 NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain
));
3896 case NETR_DELTA_GROUP
:
3898 NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group
));
3902 case NETR_DELTA_DELETE_GROUP
:
3905 case NETR_DELTA_RENAME_GROUP
:
3906 if (r
->rename_group
) {
3907 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_group
));
3911 case NETR_DELTA_USER
:
3913 NDR_CHECK(ndr_push_netr_DELTA_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->user
));
3917 case NETR_DELTA_DELETE_USER
:
3920 case NETR_DELTA_RENAME_USER
:
3921 if (r
->rename_user
) {
3922 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_user
));
3926 case NETR_DELTA_GROUP_MEMBER
:
3927 if (r
->group_member
) {
3928 NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group_member
));
3932 case NETR_DELTA_ALIAS
:
3934 NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias
));
3938 case NETR_DELTA_DELETE_ALIAS
:
3941 case NETR_DELTA_RENAME_ALIAS
:
3942 if (r
->rename_alias
) {
3943 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_alias
));
3947 case NETR_DELTA_ALIAS_MEMBER
:
3948 if (r
->alias_member
) {
3949 NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias_member
));
3953 case NETR_DELTA_POLICY
:
3955 NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->policy
));
3959 case NETR_DELTA_TRUSTED_DOMAIN
:
3960 if (r
->trusted_domain
) {
3961 NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->trusted_domain
));
3965 case NETR_DELTA_DELETE_TRUST
:
3968 case NETR_DELTA_ACCOUNT
:
3970 NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->account
));
3974 case NETR_DELTA_DELETE_ACCOUNT
:
3977 case NETR_DELTA_SECRET
:
3979 NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->secret
));
3983 case NETR_DELTA_DELETE_SECRET
:
3986 case NETR_DELTA_DELETE_GROUP2
:
3987 if (r
->delete_group
) {
3988 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_group
));
3992 case NETR_DELTA_DELETE_USER2
:
3993 if (r
->delete_user
) {
3994 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_user
));
3998 case NETR_DELTA_MODIFY_COUNT
:
3999 if (r
->modified_count
) {
4000 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->modified_count
));
4005 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4008 return NDR_ERR_SUCCESS
;
4011 static enum ndr_err_code
ndr_pull_netr_DELTA_UNION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DELTA_UNION
*r
)
4015 TALLOC_CTX
*_mem_save_domain_0
;
4016 TALLOC_CTX
*_mem_save_group_0
;
4017 TALLOC_CTX
*_mem_save_rename_group_0
;
4018 TALLOC_CTX
*_mem_save_user_0
;
4019 TALLOC_CTX
*_mem_save_rename_user_0
;
4020 TALLOC_CTX
*_mem_save_group_member_0
;
4021 TALLOC_CTX
*_mem_save_alias_0
;
4022 TALLOC_CTX
*_mem_save_rename_alias_0
;
4023 TALLOC_CTX
*_mem_save_alias_member_0
;
4024 TALLOC_CTX
*_mem_save_policy_0
;
4025 TALLOC_CTX
*_mem_save_trusted_domain_0
;
4026 TALLOC_CTX
*_mem_save_account_0
;
4027 TALLOC_CTX
*_mem_save_secret_0
;
4028 TALLOC_CTX
*_mem_save_delete_group_0
;
4029 TALLOC_CTX
*_mem_save_delete_user_0
;
4030 TALLOC_CTX
*_mem_save_modified_count_0
;
4031 level
= ndr_pull_get_switch_value(ndr
, r
);
4032 if (ndr_flags
& NDR_SCALARS
) {
4033 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
4034 if (_level
!= level
) {
4035 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
4038 case NETR_DELTA_DOMAIN
: {
4039 uint32_t _ptr_domain
;
4040 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
4042 NDR_PULL_ALLOC(ndr
, r
->domain
);
4048 case NETR_DELTA_GROUP
: {
4049 uint32_t _ptr_group
;
4050 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group
));
4052 NDR_PULL_ALLOC(ndr
, r
->group
);
4058 case NETR_DELTA_DELETE_GROUP
: {
4061 case NETR_DELTA_RENAME_GROUP
: {
4062 uint32_t _ptr_rename_group
;
4063 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_group
));
4064 if (_ptr_rename_group
) {
4065 NDR_PULL_ALLOC(ndr
, r
->rename_group
);
4067 r
->rename_group
= NULL
;
4071 case NETR_DELTA_USER
: {
4073 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_user
));
4075 NDR_PULL_ALLOC(ndr
, r
->user
);
4081 case NETR_DELTA_DELETE_USER
: {
4084 case NETR_DELTA_RENAME_USER
: {
4085 uint32_t _ptr_rename_user
;
4086 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_user
));
4087 if (_ptr_rename_user
) {
4088 NDR_PULL_ALLOC(ndr
, r
->rename_user
);
4090 r
->rename_user
= NULL
;
4094 case NETR_DELTA_GROUP_MEMBER
: {
4095 uint32_t _ptr_group_member
;
4096 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group_member
));
4097 if (_ptr_group_member
) {
4098 NDR_PULL_ALLOC(ndr
, r
->group_member
);
4100 r
->group_member
= NULL
;
4104 case NETR_DELTA_ALIAS
: {
4105 uint32_t _ptr_alias
;
4106 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_alias
));
4108 NDR_PULL_ALLOC(ndr
, r
->alias
);
4114 case NETR_DELTA_DELETE_ALIAS
: {
4117 case NETR_DELTA_RENAME_ALIAS
: {
4118 uint32_t _ptr_rename_alias
;
4119 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_alias
));
4120 if (_ptr_rename_alias
) {
4121 NDR_PULL_ALLOC(ndr
, r
->rename_alias
);
4123 r
->rename_alias
= NULL
;
4127 case NETR_DELTA_ALIAS_MEMBER
: {
4128 uint32_t _ptr_alias_member
;
4129 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_alias_member
));
4130 if (_ptr_alias_member
) {
4131 NDR_PULL_ALLOC(ndr
, r
->alias_member
);
4133 r
->alias_member
= NULL
;
4137 case NETR_DELTA_POLICY
: {
4138 uint32_t _ptr_policy
;
4139 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_policy
));
4141 NDR_PULL_ALLOC(ndr
, r
->policy
);
4147 case NETR_DELTA_TRUSTED_DOMAIN
: {
4148 uint32_t _ptr_trusted_domain
;
4149 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_domain
));
4150 if (_ptr_trusted_domain
) {
4151 NDR_PULL_ALLOC(ndr
, r
->trusted_domain
);
4153 r
->trusted_domain
= NULL
;
4157 case NETR_DELTA_DELETE_TRUST
: {
4158 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr
, NDR_SCALARS
, &r
->delete_trust
));
4161 case NETR_DELTA_ACCOUNT
: {
4162 uint32_t _ptr_account
;
4163 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account
));
4165 NDR_PULL_ALLOC(ndr
, r
->account
);
4171 case NETR_DELTA_DELETE_ACCOUNT
: {
4172 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr
, NDR_SCALARS
, &r
->delete_account
));
4175 case NETR_DELTA_SECRET
: {
4176 uint32_t _ptr_secret
;
4177 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_secret
));
4179 NDR_PULL_ALLOC(ndr
, r
->secret
);
4185 case NETR_DELTA_DELETE_SECRET
: {
4186 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr
, NDR_SCALARS
, &r
->delete_secret
));
4189 case NETR_DELTA_DELETE_GROUP2
: {
4190 uint32_t _ptr_delete_group
;
4191 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delete_group
));
4192 if (_ptr_delete_group
) {
4193 NDR_PULL_ALLOC(ndr
, r
->delete_group
);
4195 r
->delete_group
= NULL
;
4199 case NETR_DELTA_DELETE_USER2
: {
4200 uint32_t _ptr_delete_user
;
4201 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delete_user
));
4202 if (_ptr_delete_user
) {
4203 NDR_PULL_ALLOC(ndr
, r
->delete_user
);
4205 r
->delete_user
= NULL
;
4209 case NETR_DELTA_MODIFY_COUNT
: {
4210 uint32_t _ptr_modified_count
;
4211 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_modified_count
));
4212 if (_ptr_modified_count
) {
4213 NDR_PULL_ALLOC(ndr
, r
->modified_count
);
4215 r
->modified_count
= NULL
;
4220 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4223 if (ndr_flags
& NDR_BUFFERS
) {
4225 case NETR_DELTA_DOMAIN
:
4227 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4228 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
4229 NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain
));
4230 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
4234 case NETR_DELTA_GROUP
:
4236 _mem_save_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4237 NDR_PULL_SET_MEM_CTX(ndr
, r
->group
, 0);
4238 NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group
));
4239 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_0
, 0);
4243 case NETR_DELTA_DELETE_GROUP
:
4246 case NETR_DELTA_RENAME_GROUP
:
4247 if (r
->rename_group
) {
4248 _mem_save_rename_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4249 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_group
, 0);
4250 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_group
));
4251 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_group_0
, 0);
4255 case NETR_DELTA_USER
:
4257 _mem_save_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4258 NDR_PULL_SET_MEM_CTX(ndr
, r
->user
, 0);
4259 NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->user
));
4260 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_user_0
, 0);
4264 case NETR_DELTA_DELETE_USER
:
4267 case NETR_DELTA_RENAME_USER
:
4268 if (r
->rename_user
) {
4269 _mem_save_rename_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4270 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_user
, 0);
4271 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_user
));
4272 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_user_0
, 0);
4276 case NETR_DELTA_GROUP_MEMBER
:
4277 if (r
->group_member
) {
4278 _mem_save_group_member_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4279 NDR_PULL_SET_MEM_CTX(ndr
, r
->group_member
, 0);
4280 NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group_member
));
4281 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_member_0
, 0);
4285 case NETR_DELTA_ALIAS
:
4287 _mem_save_alias_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4288 NDR_PULL_SET_MEM_CTX(ndr
, r
->alias
, 0);
4289 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias
));
4290 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_alias_0
, 0);
4294 case NETR_DELTA_DELETE_ALIAS
:
4297 case NETR_DELTA_RENAME_ALIAS
:
4298 if (r
->rename_alias
) {
4299 _mem_save_rename_alias_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4300 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_alias
, 0);
4301 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_alias
));
4302 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_alias_0
, 0);
4306 case NETR_DELTA_ALIAS_MEMBER
:
4307 if (r
->alias_member
) {
4308 _mem_save_alias_member_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4309 NDR_PULL_SET_MEM_CTX(ndr
, r
->alias_member
, 0);
4310 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias_member
));
4311 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_alias_member_0
, 0);
4315 case NETR_DELTA_POLICY
:
4317 _mem_save_policy_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4318 NDR_PULL_SET_MEM_CTX(ndr
, r
->policy
, 0);
4319 NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->policy
));
4320 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_policy_0
, 0);
4324 case NETR_DELTA_TRUSTED_DOMAIN
:
4325 if (r
->trusted_domain
) {
4326 _mem_save_trusted_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4327 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusted_domain
, 0);
4328 NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->trusted_domain
));
4329 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domain_0
, 0);
4333 case NETR_DELTA_DELETE_TRUST
:
4336 case NETR_DELTA_ACCOUNT
:
4338 _mem_save_account_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4339 NDR_PULL_SET_MEM_CTX(ndr
, r
->account
, 0);
4340 NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->account
));
4341 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_0
, 0);
4345 case NETR_DELTA_DELETE_ACCOUNT
:
4348 case NETR_DELTA_SECRET
:
4350 _mem_save_secret_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4351 NDR_PULL_SET_MEM_CTX(ndr
, r
->secret
, 0);
4352 NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->secret
));
4353 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_secret_0
, 0);
4357 case NETR_DELTA_DELETE_SECRET
:
4360 case NETR_DELTA_DELETE_GROUP2
:
4361 if (r
->delete_group
) {
4362 _mem_save_delete_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4363 NDR_PULL_SET_MEM_CTX(ndr
, r
->delete_group
, 0);
4364 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_group
));
4365 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delete_group_0
, 0);
4369 case NETR_DELTA_DELETE_USER2
:
4370 if (r
->delete_user
) {
4371 _mem_save_delete_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4372 NDR_PULL_SET_MEM_CTX(ndr
, r
->delete_user
, 0);
4373 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_user
));
4374 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delete_user_0
, 0);
4378 case NETR_DELTA_MODIFY_COUNT
:
4379 if (r
->modified_count
) {
4380 _mem_save_modified_count_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4381 NDR_PULL_SET_MEM_CTX(ndr
, r
->modified_count
, 0);
4382 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->modified_count
));
4383 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_modified_count_0
, 0);
4388 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4391 return NDR_ERR_SUCCESS
;
4394 _PUBLIC_
void ndr_print_netr_DELTA_UNION(struct ndr_print
*ndr
, const char *name
, const union netr_DELTA_UNION
*r
)
4397 level
= ndr_print_get_switch_value(ndr
, r
);
4398 ndr_print_union(ndr
, name
, level
, "netr_DELTA_UNION");
4400 case NETR_DELTA_DOMAIN
:
4401 ndr_print_ptr(ndr
, "domain", r
->domain
);
4404 ndr_print_netr_DELTA_DOMAIN(ndr
, "domain", r
->domain
);
4409 case NETR_DELTA_GROUP
:
4410 ndr_print_ptr(ndr
, "group", r
->group
);
4413 ndr_print_netr_DELTA_GROUP(ndr
, "group", r
->group
);
4418 case NETR_DELTA_DELETE_GROUP
:
4421 case NETR_DELTA_RENAME_GROUP
:
4422 ndr_print_ptr(ndr
, "rename_group", r
->rename_group
);
4424 if (r
->rename_group
) {
4425 ndr_print_netr_DELTA_RENAME(ndr
, "rename_group", r
->rename_group
);
4430 case NETR_DELTA_USER
:
4431 ndr_print_ptr(ndr
, "user", r
->user
);
4434 ndr_print_netr_DELTA_USER(ndr
, "user", r
->user
);
4439 case NETR_DELTA_DELETE_USER
:
4442 case NETR_DELTA_RENAME_USER
:
4443 ndr_print_ptr(ndr
, "rename_user", r
->rename_user
);
4445 if (r
->rename_user
) {
4446 ndr_print_netr_DELTA_RENAME(ndr
, "rename_user", r
->rename_user
);
4451 case NETR_DELTA_GROUP_MEMBER
:
4452 ndr_print_ptr(ndr
, "group_member", r
->group_member
);
4454 if (r
->group_member
) {
4455 ndr_print_netr_DELTA_GROUP_MEMBER(ndr
, "group_member", r
->group_member
);
4460 case NETR_DELTA_ALIAS
:
4461 ndr_print_ptr(ndr
, "alias", r
->alias
);
4464 ndr_print_netr_DELTA_ALIAS(ndr
, "alias", r
->alias
);
4469 case NETR_DELTA_DELETE_ALIAS
:
4472 case NETR_DELTA_RENAME_ALIAS
:
4473 ndr_print_ptr(ndr
, "rename_alias", r
->rename_alias
);
4475 if (r
->rename_alias
) {
4476 ndr_print_netr_DELTA_RENAME(ndr
, "rename_alias", r
->rename_alias
);
4481 case NETR_DELTA_ALIAS_MEMBER
:
4482 ndr_print_ptr(ndr
, "alias_member", r
->alias_member
);
4484 if (r
->alias_member
) {
4485 ndr_print_netr_DELTA_ALIAS_MEMBER(ndr
, "alias_member", r
->alias_member
);
4490 case NETR_DELTA_POLICY
:
4491 ndr_print_ptr(ndr
, "policy", r
->policy
);
4494 ndr_print_netr_DELTA_POLICY(ndr
, "policy", r
->policy
);
4499 case NETR_DELTA_TRUSTED_DOMAIN
:
4500 ndr_print_ptr(ndr
, "trusted_domain", r
->trusted_domain
);
4502 if (r
->trusted_domain
) {
4503 ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr
, "trusted_domain", r
->trusted_domain
);
4508 case NETR_DELTA_DELETE_TRUST
:
4509 ndr_print_netr_DELTA_DELETE_TRUST(ndr
, "delete_trust", &r
->delete_trust
);
4512 case NETR_DELTA_ACCOUNT
:
4513 ndr_print_ptr(ndr
, "account", r
->account
);
4516 ndr_print_netr_DELTA_ACCOUNT(ndr
, "account", r
->account
);
4521 case NETR_DELTA_DELETE_ACCOUNT
:
4522 ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr
, "delete_account", &r
->delete_account
);
4525 case NETR_DELTA_SECRET
:
4526 ndr_print_ptr(ndr
, "secret", r
->secret
);
4529 ndr_print_netr_DELTA_SECRET(ndr
, "secret", r
->secret
);
4534 case NETR_DELTA_DELETE_SECRET
:
4535 ndr_print_netr_DELTA_DELETE_SECRET(ndr
, "delete_secret", &r
->delete_secret
);
4538 case NETR_DELTA_DELETE_GROUP2
:
4539 ndr_print_ptr(ndr
, "delete_group", r
->delete_group
);
4541 if (r
->delete_group
) {
4542 ndr_print_netr_DELTA_DELETE_USER(ndr
, "delete_group", r
->delete_group
);
4547 case NETR_DELTA_DELETE_USER2
:
4548 ndr_print_ptr(ndr
, "delete_user", r
->delete_user
);
4550 if (r
->delete_user
) {
4551 ndr_print_netr_DELTA_DELETE_USER(ndr
, "delete_user", r
->delete_user
);
4556 case NETR_DELTA_MODIFY_COUNT
:
4557 ndr_print_ptr(ndr
, "modified_count", r
->modified_count
);
4559 if (r
->modified_count
) {
4560 ndr_print_udlong(ndr
, "modified_count", *r
->modified_count
);
4566 ndr_print_bad_level(ndr
, name
, level
);
4570 static enum ndr_err_code
ndr_push_netr_DELTA_ID_UNION(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DELTA_ID_UNION
*r
)
4572 if (ndr_flags
& NDR_SCALARS
) {
4573 int level
= ndr_push_get_switch_value(ndr
, r
);
4574 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, level
));
4576 case NETR_DELTA_DOMAIN
:
4577 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4580 case NETR_DELTA_GROUP
:
4581 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4584 case NETR_DELTA_DELETE_GROUP
:
4585 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4588 case NETR_DELTA_RENAME_GROUP
:
4589 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4592 case NETR_DELTA_USER
:
4593 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4596 case NETR_DELTA_DELETE_USER
:
4597 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4600 case NETR_DELTA_RENAME_USER
:
4601 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4604 case NETR_DELTA_GROUP_MEMBER
:
4605 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4608 case NETR_DELTA_ALIAS
:
4609 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4612 case NETR_DELTA_DELETE_ALIAS
:
4613 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4616 case NETR_DELTA_RENAME_ALIAS
:
4617 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4620 case NETR_DELTA_ALIAS_MEMBER
:
4621 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4624 case NETR_DELTA_POLICY
:
4625 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4628 case NETR_DELTA_TRUSTED_DOMAIN
:
4629 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4632 case NETR_DELTA_DELETE_TRUST
:
4633 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4636 case NETR_DELTA_ACCOUNT
:
4637 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4640 case NETR_DELTA_DELETE_ACCOUNT
:
4641 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4644 case NETR_DELTA_SECRET
:
4645 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->name
));
4648 case NETR_DELTA_DELETE_SECRET
:
4649 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->name
));
4652 case NETR_DELTA_DELETE_GROUP2
:
4653 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4656 case NETR_DELTA_DELETE_USER2
:
4657 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4660 case NETR_DELTA_MODIFY_COUNT
:
4664 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4667 if (ndr_flags
& NDR_BUFFERS
) {
4668 int level
= ndr_push_get_switch_value(ndr
, r
);
4670 case NETR_DELTA_DOMAIN
:
4673 case NETR_DELTA_GROUP
:
4676 case NETR_DELTA_DELETE_GROUP
:
4679 case NETR_DELTA_RENAME_GROUP
:
4682 case NETR_DELTA_USER
:
4685 case NETR_DELTA_DELETE_USER
:
4688 case NETR_DELTA_RENAME_USER
:
4691 case NETR_DELTA_GROUP_MEMBER
:
4694 case NETR_DELTA_ALIAS
:
4697 case NETR_DELTA_DELETE_ALIAS
:
4700 case NETR_DELTA_RENAME_ALIAS
:
4703 case NETR_DELTA_ALIAS_MEMBER
:
4706 case NETR_DELTA_POLICY
:
4708 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4712 case NETR_DELTA_TRUSTED_DOMAIN
:
4714 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4718 case NETR_DELTA_DELETE_TRUST
:
4720 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4724 case NETR_DELTA_ACCOUNT
:
4726 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4730 case NETR_DELTA_DELETE_ACCOUNT
:
4732 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4736 case NETR_DELTA_SECRET
:
4738 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4739 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
4740 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4741 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->name
, ndr_charset_length(r
->name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
4745 case NETR_DELTA_DELETE_SECRET
:
4747 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4748 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
4749 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4750 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->name
, ndr_charset_length(r
->name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
4754 case NETR_DELTA_DELETE_GROUP2
:
4757 case NETR_DELTA_DELETE_USER2
:
4760 case NETR_DELTA_MODIFY_COUNT
:
4764 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4767 return NDR_ERR_SUCCESS
;
4770 static enum ndr_err_code
ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DELTA_ID_UNION
*r
)
4774 TALLOC_CTX
*_mem_save_sid_0
;
4775 TALLOC_CTX
*_mem_save_name_0
;
4776 level
= ndr_pull_get_switch_value(ndr
, r
);
4777 if (ndr_flags
& NDR_SCALARS
) {
4778 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
4779 if (_level
!= level
) {
4780 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
4783 case NETR_DELTA_DOMAIN
: {
4784 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4787 case NETR_DELTA_GROUP
: {
4788 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4791 case NETR_DELTA_DELETE_GROUP
: {
4792 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4795 case NETR_DELTA_RENAME_GROUP
: {
4796 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4799 case NETR_DELTA_USER
: {
4800 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4803 case NETR_DELTA_DELETE_USER
: {
4804 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4807 case NETR_DELTA_RENAME_USER
: {
4808 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4811 case NETR_DELTA_GROUP_MEMBER
: {
4812 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4815 case NETR_DELTA_ALIAS
: {
4816 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4819 case NETR_DELTA_DELETE_ALIAS
: {
4820 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4823 case NETR_DELTA_RENAME_ALIAS
: {
4824 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4827 case NETR_DELTA_ALIAS_MEMBER
: {
4828 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4831 case NETR_DELTA_POLICY
: {
4833 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
4835 NDR_PULL_ALLOC(ndr
, r
->sid
);
4841 case NETR_DELTA_TRUSTED_DOMAIN
: {
4843 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
4845 NDR_PULL_ALLOC(ndr
, r
->sid
);
4851 case NETR_DELTA_DELETE_TRUST
: {
4853 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
4855 NDR_PULL_ALLOC(ndr
, r
->sid
);
4861 case NETR_DELTA_ACCOUNT
: {
4863 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
4865 NDR_PULL_ALLOC(ndr
, r
->sid
);
4871 case NETR_DELTA_DELETE_ACCOUNT
: {
4873 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
4875 NDR_PULL_ALLOC(ndr
, r
->sid
);
4881 case NETR_DELTA_SECRET
: {
4883 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_name
));
4885 NDR_PULL_ALLOC(ndr
, r
->name
);
4891 case NETR_DELTA_DELETE_SECRET
: {
4893 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_name
));
4895 NDR_PULL_ALLOC(ndr
, r
->name
);
4901 case NETR_DELTA_DELETE_GROUP2
: {
4902 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4905 case NETR_DELTA_DELETE_USER2
: {
4906 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4909 case NETR_DELTA_MODIFY_COUNT
: {
4913 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4916 if (ndr_flags
& NDR_BUFFERS
) {
4918 case NETR_DELTA_DOMAIN
:
4921 case NETR_DELTA_GROUP
:
4924 case NETR_DELTA_DELETE_GROUP
:
4927 case NETR_DELTA_RENAME_GROUP
:
4930 case NETR_DELTA_USER
:
4933 case NETR_DELTA_DELETE_USER
:
4936 case NETR_DELTA_RENAME_USER
:
4939 case NETR_DELTA_GROUP_MEMBER
:
4942 case NETR_DELTA_ALIAS
:
4945 case NETR_DELTA_DELETE_ALIAS
:
4948 case NETR_DELTA_RENAME_ALIAS
:
4951 case NETR_DELTA_ALIAS_MEMBER
:
4954 case NETR_DELTA_POLICY
:
4956 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4957 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
4958 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4959 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
4963 case NETR_DELTA_TRUSTED_DOMAIN
:
4965 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4966 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
4967 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4968 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
4972 case NETR_DELTA_DELETE_TRUST
:
4974 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4975 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
4976 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4977 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
4981 case NETR_DELTA_ACCOUNT
:
4983 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4984 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
4985 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4986 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
4990 case NETR_DELTA_DELETE_ACCOUNT
:
4992 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4993 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
4994 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4995 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
4999 case NETR_DELTA_SECRET
:
5001 _mem_save_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5002 NDR_PULL_SET_MEM_CTX(ndr
, r
->name
, 0);
5003 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->name
));
5004 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->name
));
5005 if (ndr_get_array_length(ndr
, &r
->name
) > ndr_get_array_size(ndr
, &r
->name
)) {
5006 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->name
), ndr_get_array_length(ndr
, &r
->name
));
5008 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t)));
5009 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->name
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t), CH_UTF16
));
5010 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_name_0
, 0);
5014 case NETR_DELTA_DELETE_SECRET
:
5016 _mem_save_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5017 NDR_PULL_SET_MEM_CTX(ndr
, r
->name
, 0);
5018 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->name
));
5019 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->name
));
5020 if (ndr_get_array_length(ndr
, &r
->name
) > ndr_get_array_size(ndr
, &r
->name
)) {
5021 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->name
), ndr_get_array_length(ndr
, &r
->name
));
5023 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t)));
5024 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->name
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t), CH_UTF16
));
5025 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_name_0
, 0);
5029 case NETR_DELTA_DELETE_GROUP2
:
5032 case NETR_DELTA_DELETE_USER2
:
5035 case NETR_DELTA_MODIFY_COUNT
:
5039 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5042 return NDR_ERR_SUCCESS
;
5045 _PUBLIC_
void ndr_print_netr_DELTA_ID_UNION(struct ndr_print
*ndr
, const char *name
, const union netr_DELTA_ID_UNION
*r
)
5048 level
= ndr_print_get_switch_value(ndr
, r
);
5049 ndr_print_union(ndr
, name
, level
, "netr_DELTA_ID_UNION");
5051 case NETR_DELTA_DOMAIN
:
5052 ndr_print_uint32(ndr
, "rid", r
->rid
);
5055 case NETR_DELTA_GROUP
:
5056 ndr_print_uint32(ndr
, "rid", r
->rid
);
5059 case NETR_DELTA_DELETE_GROUP
:
5060 ndr_print_uint32(ndr
, "rid", r
->rid
);
5063 case NETR_DELTA_RENAME_GROUP
:
5064 ndr_print_uint32(ndr
, "rid", r
->rid
);
5067 case NETR_DELTA_USER
:
5068 ndr_print_uint32(ndr
, "rid", r
->rid
);
5071 case NETR_DELTA_DELETE_USER
:
5072 ndr_print_uint32(ndr
, "rid", r
->rid
);
5075 case NETR_DELTA_RENAME_USER
:
5076 ndr_print_uint32(ndr
, "rid", r
->rid
);
5079 case NETR_DELTA_GROUP_MEMBER
:
5080 ndr_print_uint32(ndr
, "rid", r
->rid
);
5083 case NETR_DELTA_ALIAS
:
5084 ndr_print_uint32(ndr
, "rid", r
->rid
);
5087 case NETR_DELTA_DELETE_ALIAS
:
5088 ndr_print_uint32(ndr
, "rid", r
->rid
);
5091 case NETR_DELTA_RENAME_ALIAS
:
5092 ndr_print_uint32(ndr
, "rid", r
->rid
);
5095 case NETR_DELTA_ALIAS_MEMBER
:
5096 ndr_print_uint32(ndr
, "rid", r
->rid
);
5099 case NETR_DELTA_POLICY
:
5100 ndr_print_ptr(ndr
, "sid", r
->sid
);
5103 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5108 case NETR_DELTA_TRUSTED_DOMAIN
:
5109 ndr_print_ptr(ndr
, "sid", r
->sid
);
5112 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5117 case NETR_DELTA_DELETE_TRUST
:
5118 ndr_print_ptr(ndr
, "sid", r
->sid
);
5121 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5126 case NETR_DELTA_ACCOUNT
:
5127 ndr_print_ptr(ndr
, "sid", r
->sid
);
5130 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5135 case NETR_DELTA_DELETE_ACCOUNT
:
5136 ndr_print_ptr(ndr
, "sid", r
->sid
);
5139 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5144 case NETR_DELTA_SECRET
:
5145 ndr_print_ptr(ndr
, "name", r
->name
);
5148 ndr_print_string(ndr
, "name", r
->name
);
5153 case NETR_DELTA_DELETE_SECRET
:
5154 ndr_print_ptr(ndr
, "name", r
->name
);
5157 ndr_print_string(ndr
, "name", r
->name
);
5162 case NETR_DELTA_DELETE_GROUP2
:
5163 ndr_print_uint32(ndr
, "rid", r
->rid
);
5166 case NETR_DELTA_DELETE_USER2
:
5167 ndr_print_uint32(ndr
, "rid", r
->rid
);
5170 case NETR_DELTA_MODIFY_COUNT
:
5174 ndr_print_bad_level(ndr
, name
, level
);
5178 static enum ndr_err_code
ndr_push_netr_DELTA_ENUM(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ENUM
*r
)
5180 if (ndr_flags
& NDR_SCALARS
) {
5181 NDR_CHECK(ndr_push_align(ndr
, 4));
5182 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, r
->delta_type
));
5183 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
));
5184 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr
, NDR_SCALARS
, &r
->delta_id_union
));
5185 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
));
5186 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr
, NDR_SCALARS
, &r
->delta_union
));
5188 if (ndr_flags
& NDR_BUFFERS
) {
5189 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr
, NDR_BUFFERS
, &r
->delta_id_union
));
5190 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr
, NDR_BUFFERS
, &r
->delta_union
));
5192 return NDR_ERR_SUCCESS
;
5195 static enum ndr_err_code
ndr_pull_netr_DELTA_ENUM(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ENUM
*r
)
5197 if (ndr_flags
& NDR_SCALARS
) {
5198 NDR_CHECK(ndr_pull_align(ndr
, 4));
5199 NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr
, NDR_SCALARS
, &r
->delta_type
));
5200 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
));
5201 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr
, NDR_SCALARS
, &r
->delta_id_union
));
5202 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
));
5203 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr
, NDR_SCALARS
, &r
->delta_union
));
5205 if (ndr_flags
& NDR_BUFFERS
) {
5206 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr
, NDR_BUFFERS
, &r
->delta_id_union
));
5207 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr
, NDR_BUFFERS
, &r
->delta_union
));
5209 return NDR_ERR_SUCCESS
;
5212 _PUBLIC_
void ndr_print_netr_DELTA_ENUM(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ENUM
*r
)
5214 ndr_print_struct(ndr
, name
, "netr_DELTA_ENUM");
5216 ndr_print_netr_DeltaEnum(ndr
, "delta_type", r
->delta_type
);
5217 ndr_print_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
);
5218 ndr_print_netr_DELTA_ID_UNION(ndr
, "delta_id_union", &r
->delta_id_union
);
5219 ndr_print_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
);
5220 ndr_print_netr_DELTA_UNION(ndr
, "delta_union", &r
->delta_union
);
5224 static enum ndr_err_code
ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ENUM_ARRAY
*r
)
5226 uint32_t cntr_delta_enum_1
;
5227 if (ndr_flags
& NDR_SCALARS
) {
5228 NDR_CHECK(ndr_push_align(ndr
, 4));
5229 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_deltas
));
5230 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delta_enum
));
5232 if (ndr_flags
& NDR_BUFFERS
) {
5233 if (r
->delta_enum
) {
5234 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_deltas
));
5235 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5236 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr
, NDR_SCALARS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5238 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5239 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr
, NDR_BUFFERS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5243 return NDR_ERR_SUCCESS
;
5246 static enum ndr_err_code
ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ENUM_ARRAY
*r
)
5248 uint32_t _ptr_delta_enum
;
5249 uint32_t cntr_delta_enum_1
;
5250 TALLOC_CTX
*_mem_save_delta_enum_0
;
5251 TALLOC_CTX
*_mem_save_delta_enum_1
;
5252 if (ndr_flags
& NDR_SCALARS
) {
5253 NDR_CHECK(ndr_pull_align(ndr
, 4));
5254 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_deltas
));
5255 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum
));
5256 if (_ptr_delta_enum
) {
5257 NDR_PULL_ALLOC(ndr
, r
->delta_enum
);
5259 r
->delta_enum
= NULL
;
5262 if (ndr_flags
& NDR_BUFFERS
) {
5263 if (r
->delta_enum
) {
5264 _mem_save_delta_enum_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5265 NDR_PULL_SET_MEM_CTX(ndr
, r
->delta_enum
, 0);
5266 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->delta_enum
));
5267 NDR_PULL_ALLOC_N(ndr
, r
->delta_enum
, ndr_get_array_size(ndr
, &r
->delta_enum
));
5268 _mem_save_delta_enum_1
= NDR_PULL_GET_MEM_CTX(ndr
);
5269 NDR_PULL_SET_MEM_CTX(ndr
, r
->delta_enum
, 0);
5270 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5271 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr
, NDR_SCALARS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5273 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5274 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr
, NDR_BUFFERS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5276 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_1
, 0);
5277 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_0
, 0);
5279 if (r
->delta_enum
) {
5280 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->delta_enum
, r
->num_deltas
));
5283 return NDR_ERR_SUCCESS
;
5286 _PUBLIC_
void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ENUM_ARRAY
*r
)
5288 uint32_t cntr_delta_enum_1
;
5289 ndr_print_struct(ndr
, name
, "netr_DELTA_ENUM_ARRAY");
5291 ndr_print_uint32(ndr
, "num_deltas", r
->num_deltas
);
5292 ndr_print_ptr(ndr
, "delta_enum", r
->delta_enum
);
5294 if (r
->delta_enum
) {
5295 ndr
->print(ndr
, "%s: ARRAY(%d)", "delta_enum", r
->num_deltas
);
5297 for (cntr_delta_enum_1
=0;cntr_delta_enum_1
<r
->num_deltas
;cntr_delta_enum_1
++) {
5299 asprintf(&idx_1
, "[%d]", cntr_delta_enum_1
);
5301 ndr_print_netr_DELTA_ENUM(ndr
, "delta_enum", &r
->delta_enum
[cntr_delta_enum_1
]);
5311 static enum ndr_err_code
ndr_push_netr_UAS_INFO_0(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UAS_INFO_0
*r
)
5314 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5315 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5316 if (ndr_flags
& NDR_SCALARS
) {
5317 NDR_CHECK(ndr_push_align(ndr
, 4));
5318 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->computer_name
, 16));
5319 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->timecreated
));
5320 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->serial_number
));
5322 if (ndr_flags
& NDR_BUFFERS
) {
5324 ndr
->flags
= _flags_save_STRUCT
;
5326 return NDR_ERR_SUCCESS
;
5329 static enum ndr_err_code
ndr_pull_netr_UAS_INFO_0(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UAS_INFO_0
*r
)
5332 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5333 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5334 if (ndr_flags
& NDR_SCALARS
) {
5335 NDR_CHECK(ndr_pull_align(ndr
, 4));
5336 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->computer_name
, 16));
5337 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->timecreated
));
5338 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->serial_number
));
5340 if (ndr_flags
& NDR_BUFFERS
) {
5342 ndr
->flags
= _flags_save_STRUCT
;
5344 return NDR_ERR_SUCCESS
;
5347 _PUBLIC_
void ndr_print_netr_UAS_INFO_0(struct ndr_print
*ndr
, const char *name
, const struct netr_UAS_INFO_0
*r
)
5349 ndr_print_struct(ndr
, name
, "netr_UAS_INFO_0");
5351 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5352 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5354 ndr_print_array_uint8(ndr
, "computer_name", r
->computer_name
, 16);
5355 ndr_print_uint32(ndr
, "timecreated", r
->timecreated
);
5356 ndr_print_uint32(ndr
, "serial_number", r
->serial_number
);
5358 ndr
->flags
= _flags_save_STRUCT
;
5362 static enum ndr_err_code
ndr_push_netr_AccountBuffer(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_AccountBuffer
*r
)
5364 if (ndr_flags
& NDR_SCALARS
) {
5365 NDR_CHECK(ndr_push_align(ndr
, 4));
5367 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
5368 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
5369 NDR_CHECK(ndr_push_DATA_BLOB(ndr
, NDR_SCALARS
, r
->blob
));
5370 ndr
->flags
= _flags_save_DATA_BLOB
;
5373 if (ndr_flags
& NDR_BUFFERS
) {
5375 return NDR_ERR_SUCCESS
;
5378 static enum ndr_err_code
ndr_pull_netr_AccountBuffer(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_AccountBuffer
*r
)
5380 if (ndr_flags
& NDR_SCALARS
) {
5381 NDR_CHECK(ndr_pull_align(ndr
, 4));
5383 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
5384 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
5385 NDR_CHECK(ndr_pull_DATA_BLOB(ndr
, NDR_SCALARS
, &r
->blob
));
5386 ndr
->flags
= _flags_save_DATA_BLOB
;
5389 if (ndr_flags
& NDR_BUFFERS
) {
5391 return NDR_ERR_SUCCESS
;
5394 _PUBLIC_
void ndr_print_netr_AccountBuffer(struct ndr_print
*ndr
, const char *name
, const struct netr_AccountBuffer
*r
)
5396 ndr_print_struct(ndr
, name
, "netr_AccountBuffer");
5398 ndr_print_DATA_BLOB(ndr
, "blob", r
->blob
);
5402 static enum ndr_err_code
ndr_push_netr_NETLOGON_INFO_1(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_NETLOGON_INFO_1
*r
)
5404 if (ndr_flags
& NDR_SCALARS
) {
5405 NDR_CHECK(ndr_push_align(ndr
, 4));
5406 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
5407 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pdc_connection_status
));
5409 if (ndr_flags
& NDR_BUFFERS
) {
5411 return NDR_ERR_SUCCESS
;
5414 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_1
*r
)
5416 if (ndr_flags
& NDR_SCALARS
) {
5417 NDR_CHECK(ndr_pull_align(ndr
, 4));
5418 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
5419 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pdc_connection_status
));
5421 if (ndr_flags
& NDR_BUFFERS
) {
5423 return NDR_ERR_SUCCESS
;
5426 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_1
*r
)
5428 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_1");
5430 ndr_print_uint32(ndr
, "flags", r
->flags
);
5431 ndr_print_uint32(ndr
, "pdc_connection_status", r
->pdc_connection_status
);
5435 static enum ndr_err_code
ndr_push_netr_NETLOGON_INFO_2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_NETLOGON_INFO_2
*r
)
5437 if (ndr_flags
& NDR_SCALARS
) {
5438 NDR_CHECK(ndr_push_align(ndr
, 4));
5439 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
5440 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pdc_connection_status
));
5441 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5442 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5443 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5444 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->trusted_dc_name
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
5445 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->tc_connection_status
));
5447 if (ndr_flags
& NDR_BUFFERS
) {
5449 return NDR_ERR_SUCCESS
;
5452 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_2
*r
)
5454 if (ndr_flags
& NDR_SCALARS
) {
5455 NDR_CHECK(ndr_pull_align(ndr
, 4));
5456 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
5457 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pdc_connection_status
));
5458 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusted_dc_name
));
5459 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->trusted_dc_name
));
5460 if (ndr_get_array_length(ndr
, &r
->trusted_dc_name
) > ndr_get_array_size(ndr
, &r
->trusted_dc_name
)) {
5461 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->trusted_dc_name
), ndr_get_array_length(ndr
, &r
->trusted_dc_name
));
5463 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->trusted_dc_name
), sizeof(uint16_t)));
5464 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->trusted_dc_name
, ndr_get_array_length(ndr
, &r
->trusted_dc_name
), sizeof(uint16_t), CH_UTF16
));
5465 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->tc_connection_status
));
5467 if (ndr_flags
& NDR_BUFFERS
) {
5469 return NDR_ERR_SUCCESS
;
5472 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_2
*r
)
5474 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_2");
5476 ndr_print_uint32(ndr
, "flags", r
->flags
);
5477 ndr_print_uint32(ndr
, "pdc_connection_status", r
->pdc_connection_status
);
5478 ndr_print_string(ndr
, "trusted_dc_name", r
->trusted_dc_name
);
5479 ndr_print_uint32(ndr
, "tc_connection_status", r
->tc_connection_status
);
5483 static enum ndr_err_code
ndr_push_netr_NETLOGON_INFO_3(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_NETLOGON_INFO_3
*r
)
5485 if (ndr_flags
& NDR_SCALARS
) {
5486 NDR_CHECK(ndr_push_align(ndr
, 4));
5487 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
5488 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_attempts
));
5489 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
5490 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
5491 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
5492 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
5493 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
5495 if (ndr_flags
& NDR_BUFFERS
) {
5497 return NDR_ERR_SUCCESS
;
5500 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_3
*r
)
5502 if (ndr_flags
& NDR_SCALARS
) {
5503 NDR_CHECK(ndr_pull_align(ndr
, 4));
5504 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
5505 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_attempts
));
5506 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
5507 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
5508 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
5509 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
5510 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
5512 if (ndr_flags
& NDR_BUFFERS
) {
5514 return NDR_ERR_SUCCESS
;
5517 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_3
*r
)
5519 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_3");
5521 ndr_print_uint32(ndr
, "flags", r
->flags
);
5522 ndr_print_uint32(ndr
, "logon_attempts", r
->logon_attempts
);
5523 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
5524 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
5525 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
5526 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
5527 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
5531 static enum ndr_err_code
ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push
*ndr
, int ndr_flags
, const union netr_CONTROL_QUERY_INFORMATION
*r
)
5533 if (ndr_flags
& NDR_SCALARS
) {
5534 int level
= ndr_push_get_switch_value(ndr
, r
);
5535 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
5538 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info1
));
5542 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info2
));
5546 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info3
));
5550 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5553 if (ndr_flags
& NDR_BUFFERS
) {
5554 int level
= ndr_push_get_switch_value(ndr
, r
);
5558 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr
, NDR_SCALARS
, r
->info1
));
5564 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr
, NDR_SCALARS
, r
->info2
));
5570 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr
, NDR_SCALARS
, r
->info3
));
5575 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5578 return NDR_ERR_SUCCESS
;
5581 static enum ndr_err_code
ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_CONTROL_QUERY_INFORMATION
*r
)
5585 TALLOC_CTX
*_mem_save_info1_0
;
5586 TALLOC_CTX
*_mem_save_info2_0
;
5587 TALLOC_CTX
*_mem_save_info3_0
;
5588 level
= ndr_pull_get_switch_value(ndr
, r
);
5589 if (ndr_flags
& NDR_SCALARS
) {
5590 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
5591 if (_level
!= level
) {
5592 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
5596 uint32_t _ptr_info1
;
5597 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info1
));
5599 NDR_PULL_ALLOC(ndr
, r
->info1
);
5606 uint32_t _ptr_info2
;
5607 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info2
));
5609 NDR_PULL_ALLOC(ndr
, r
->info2
);
5616 uint32_t _ptr_info3
;
5617 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info3
));
5619 NDR_PULL_ALLOC(ndr
, r
->info3
);
5626 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5629 if (ndr_flags
& NDR_BUFFERS
) {
5633 _mem_save_info1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5634 NDR_PULL_SET_MEM_CTX(ndr
, r
->info1
, 0);
5635 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr
, NDR_SCALARS
, r
->info1
));
5636 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info1_0
, 0);
5642 _mem_save_info2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5643 NDR_PULL_SET_MEM_CTX(ndr
, r
->info2
, 0);
5644 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr
, NDR_SCALARS
, r
->info2
));
5645 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info2_0
, 0);
5651 _mem_save_info3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5652 NDR_PULL_SET_MEM_CTX(ndr
, r
->info3
, 0);
5653 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr
, NDR_SCALARS
, r
->info3
));
5654 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info3_0
, 0);
5659 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5662 return NDR_ERR_SUCCESS
;
5665 _PUBLIC_
void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print
*ndr
, const char *name
, const union netr_CONTROL_QUERY_INFORMATION
*r
)
5668 level
= ndr_print_get_switch_value(ndr
, r
);
5669 ndr_print_union(ndr
, name
, level
, "netr_CONTROL_QUERY_INFORMATION");
5672 ndr_print_ptr(ndr
, "info1", r
->info1
);
5675 ndr_print_netr_NETLOGON_INFO_1(ndr
, "info1", r
->info1
);
5681 ndr_print_ptr(ndr
, "info2", r
->info2
);
5684 ndr_print_netr_NETLOGON_INFO_2(ndr
, "info2", r
->info2
);
5690 ndr_print_ptr(ndr
, "info3", r
->info3
);
5693 ndr_print_netr_NETLOGON_INFO_3(ndr
, "info3", r
->info3
);
5699 ndr_print_bad_level(ndr
, name
, level
);
5703 static enum ndr_err_code
ndr_push_netr_LogonControlCode(struct ndr_push
*ndr
, int ndr_flags
, enum netr_LogonControlCode r
)
5705 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
5706 return NDR_ERR_SUCCESS
;
5709 static enum ndr_err_code
ndr_pull_netr_LogonControlCode(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_LogonControlCode
*r
)
5712 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
5714 return NDR_ERR_SUCCESS
;
5717 _PUBLIC_
void ndr_print_netr_LogonControlCode(struct ndr_print
*ndr
, const char *name
, enum netr_LogonControlCode r
)
5719 const char *val
= NULL
;
5722 case NETLOGON_CONTROL_REDISCOVER
: val
= "NETLOGON_CONTROL_REDISCOVER"; break;
5723 case NETLOGON_CONTROL_TC_QUERY
: val
= "NETLOGON_CONTROL_TC_QUERY"; break;
5724 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
: val
= "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break;
5725 case NETLOGON_CONTROL_SET_DBFLAG
: val
= "NETLOGON_CONTROL_SET_DBFLAG"; break;
5727 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
5730 static enum ndr_err_code
ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push
*ndr
, int ndr_flags
, const union netr_CONTROL_DATA_INFORMATION
*r
)
5732 if (ndr_flags
& NDR_SCALARS
) {
5733 int level
= ndr_push_get_switch_value(ndr
, r
);
5734 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
5736 case NETLOGON_CONTROL_REDISCOVER
:
5737 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
5740 case NETLOGON_CONTROL_TC_QUERY
:
5741 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
5744 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
5745 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
5748 case NETLOGON_CONTROL_SET_DBFLAG
:
5749 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->debug_level
));
5753 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5756 if (ndr_flags
& NDR_BUFFERS
) {
5757 int level
= ndr_push_get_switch_value(ndr
, r
);
5759 case NETLOGON_CONTROL_REDISCOVER
:
5761 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5762 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5763 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5764 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
5768 case NETLOGON_CONTROL_TC_QUERY
:
5770 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5771 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5772 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5773 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
5777 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
5779 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5780 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5781 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
5782 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
5786 case NETLOGON_CONTROL_SET_DBFLAG
:
5790 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5793 return NDR_ERR_SUCCESS
;
5796 static enum ndr_err_code
ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_CONTROL_DATA_INFORMATION
*r
)
5800 TALLOC_CTX
*_mem_save_domain_0
;
5801 level
= ndr_pull_get_switch_value(ndr
, r
);
5802 if (ndr_flags
& NDR_SCALARS
) {
5803 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
5804 if (_level
!= level
) {
5805 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
5808 case NETLOGON_CONTROL_REDISCOVER
: {
5809 uint32_t _ptr_domain
;
5810 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
5812 NDR_PULL_ALLOC(ndr
, r
->domain
);
5818 case NETLOGON_CONTROL_TC_QUERY
: {
5819 uint32_t _ptr_domain
;
5820 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
5822 NDR_PULL_ALLOC(ndr
, r
->domain
);
5828 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
: {
5829 uint32_t _ptr_domain
;
5830 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
5832 NDR_PULL_ALLOC(ndr
, r
->domain
);
5838 case NETLOGON_CONTROL_SET_DBFLAG
: {
5839 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->debug_level
));
5843 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5846 if (ndr_flags
& NDR_BUFFERS
) {
5848 case NETLOGON_CONTROL_REDISCOVER
:
5850 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5851 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
5852 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
5853 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
5854 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
5855 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->domain
), ndr_get_array_length(ndr
, &r
->domain
));
5857 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
5858 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
5859 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
5863 case NETLOGON_CONTROL_TC_QUERY
:
5865 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5866 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
5867 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
5868 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
5869 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
5870 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->domain
), ndr_get_array_length(ndr
, &r
->domain
));
5872 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
5873 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
5874 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
5878 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
5880 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5881 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
5882 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
5883 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
5884 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
5885 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->domain
), ndr_get_array_length(ndr
, &r
->domain
));
5887 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
5888 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
5889 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
5893 case NETLOGON_CONTROL_SET_DBFLAG
:
5897 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5900 return NDR_ERR_SUCCESS
;
5903 _PUBLIC_
void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print
*ndr
, const char *name
, const union netr_CONTROL_DATA_INFORMATION
*r
)
5906 level
= ndr_print_get_switch_value(ndr
, r
);
5907 ndr_print_union(ndr
, name
, level
, "netr_CONTROL_DATA_INFORMATION");
5909 case NETLOGON_CONTROL_REDISCOVER
:
5910 ndr_print_ptr(ndr
, "domain", r
->domain
);
5913 ndr_print_string(ndr
, "domain", r
->domain
);
5918 case NETLOGON_CONTROL_TC_QUERY
:
5919 ndr_print_ptr(ndr
, "domain", r
->domain
);
5922 ndr_print_string(ndr
, "domain", r
->domain
);
5927 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
5928 ndr_print_ptr(ndr
, "domain", r
->domain
);
5931 ndr_print_string(ndr
, "domain", r
->domain
);
5936 case NETLOGON_CONTROL_SET_DBFLAG
:
5937 ndr_print_uint32(ndr
, "debug_level", r
->debug_level
);
5941 ndr_print_bad_level(ndr
, name
, level
);
5945 static enum ndr_err_code
ndr_push_netr_Blob(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Blob
*r
)
5947 if (ndr_flags
& NDR_SCALARS
) {
5948 NDR_CHECK(ndr_push_align(ndr
, 4));
5949 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
5950 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
5952 if (ndr_flags
& NDR_BUFFERS
) {
5954 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
5955 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
5958 return NDR_ERR_SUCCESS
;
5961 static enum ndr_err_code
ndr_pull_netr_Blob(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Blob
*r
)
5964 TALLOC_CTX
*_mem_save_data_0
;
5965 if (ndr_flags
& NDR_SCALARS
) {
5966 NDR_CHECK(ndr_pull_align(ndr
, 4));
5967 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
5968 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
5970 NDR_PULL_ALLOC(ndr
, r
->data
);
5975 if (ndr_flags
& NDR_BUFFERS
) {
5977 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5978 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
5979 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
5980 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
5981 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_size(ndr
, &r
->data
)));
5982 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
5985 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
5988 return NDR_ERR_SUCCESS
;
5991 _PUBLIC_
void ndr_print_netr_Blob(struct ndr_print
*ndr
, const char *name
, const struct netr_Blob
*r
)
5993 ndr_print_struct(ndr
, name
, "netr_Blob");
5995 ndr_print_uint32(ndr
, "length", r
->length
);
5996 ndr_print_ptr(ndr
, "data", r
->data
);
5999 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
6005 static enum ndr_err_code
ndr_push_netr_DsRGetDCName_flags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
6007 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6008 return NDR_ERR_SUCCESS
;
6011 static enum ndr_err_code
ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
6014 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6016 return NDR_ERR_SUCCESS
;
6019 _PUBLIC_
void ndr_print_netr_DsRGetDCName_flags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
6021 ndr_print_uint32(ndr
, name
, r
);
6023 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY
, r
);
6024 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED
, r
);
6025 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED
, r
);
6026 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED
, r
);
6027 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED
, r
);
6028 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY
, r
);
6029 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED
, r
);
6030 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED
, r
);
6031 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED
, r
);
6032 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED
, r
);
6033 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED
, r
);
6034 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF
, r
);
6035 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED
, r
);
6036 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME
, r
);
6037 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME
, r
);
6038 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME
, r
);
6039 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME
, r
);
6043 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push
*ndr
, int ndr_flags
, enum netr_DsRGetDCNameInfo_AddressType r
)
6045 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6046 return NDR_ERR_SUCCESS
;
6049 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_DsRGetDCNameInfo_AddressType
*r
)
6052 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6054 return NDR_ERR_SUCCESS
;
6057 _PUBLIC_
void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print
*ndr
, const char *name
, enum netr_DsRGetDCNameInfo_AddressType r
)
6059 const char *val
= NULL
;
6062 case DS_ADDRESS_TYPE_INET
: val
= "DS_ADDRESS_TYPE_INET"; break;
6063 case DS_ADDRESS_TYPE_NETBIOS
: val
= "DS_ADDRESS_TYPE_NETBIOS"; break;
6065 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
6068 static enum ndr_err_code
ndr_push_netr_DsR_DcFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
6070 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6071 return NDR_ERR_SUCCESS
;
6074 static enum ndr_err_code
ndr_pull_netr_DsR_DcFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
6077 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6079 return NDR_ERR_SUCCESS
;
6082 _PUBLIC_
void ndr_print_netr_DsR_DcFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
6084 ndr_print_uint32(ndr
, name
, r
);
6086 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC
, r
);
6087 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC
, r
);
6088 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP
, r
);
6089 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS
, r
);
6090 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC
, r
);
6091 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV
, r
);
6092 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST
, r
);
6093 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE
, r
);
6094 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV
, r
);
6095 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC
, r
);
6096 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER
, r
);
6097 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN
, r
);
6098 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST
, r
);
6102 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRGetDCNameInfo
*r
)
6104 if (ndr_flags
& NDR_SCALARS
) {
6105 NDR_CHECK(ndr_push_align(ndr
, 4));
6106 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_unc
));
6107 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_address
));
6108 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr
, NDR_SCALARS
, r
->dc_address_type
));
6109 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->domain_guid
));
6110 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain_name
));
6111 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->forest_name
));
6112 NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr
, NDR_SCALARS
, r
->dc_flags
));
6113 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_site_name
));
6114 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->client_site_name
));
6116 if (ndr_flags
& NDR_BUFFERS
) {
6118 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_unc
, CH_UTF16
)));
6119 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6120 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_unc
, CH_UTF16
)));
6121 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dc_unc
, ndr_charset_length(r
->dc_unc
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6123 if (r
->dc_address
) {
6124 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_address
, CH_UTF16
)));
6125 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6126 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_address
, CH_UTF16
)));
6127 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dc_address
, ndr_charset_length(r
->dc_address
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6129 NDR_CHECK(ndr_push_GUID(ndr
, NDR_BUFFERS
, &r
->domain_guid
));
6130 if (r
->domain_name
) {
6131 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain_name
, CH_UTF16
)));
6132 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6133 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain_name
, CH_UTF16
)));
6134 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain_name
, ndr_charset_length(r
->domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6136 if (r
->forest_name
) {
6137 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->forest_name
, CH_UTF16
)));
6138 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6139 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->forest_name
, CH_UTF16
)));
6140 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->forest_name
, ndr_charset_length(r
->forest_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6142 if (r
->dc_site_name
) {
6143 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_site_name
, CH_UTF16
)));
6144 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6145 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_site_name
, CH_UTF16
)));
6146 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dc_site_name
, ndr_charset_length(r
->dc_site_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6148 if (r
->client_site_name
) {
6149 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->client_site_name
, CH_UTF16
)));
6150 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6151 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->client_site_name
, CH_UTF16
)));
6152 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->client_site_name
, ndr_charset_length(r
->client_site_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6155 return NDR_ERR_SUCCESS
;
6158 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRGetDCNameInfo
*r
)
6160 uint32_t _ptr_dc_unc
;
6161 TALLOC_CTX
*_mem_save_dc_unc_0
;
6162 uint32_t _ptr_dc_address
;
6163 TALLOC_CTX
*_mem_save_dc_address_0
;
6164 uint32_t _ptr_domain_name
;
6165 TALLOC_CTX
*_mem_save_domain_name_0
;
6166 uint32_t _ptr_forest_name
;
6167 TALLOC_CTX
*_mem_save_forest_name_0
;
6168 uint32_t _ptr_dc_site_name
;
6169 TALLOC_CTX
*_mem_save_dc_site_name_0
;
6170 uint32_t _ptr_client_site_name
;
6171 TALLOC_CTX
*_mem_save_client_site_name_0
;
6172 if (ndr_flags
& NDR_SCALARS
) {
6173 NDR_CHECK(ndr_pull_align(ndr
, 4));
6174 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_unc
));
6176 NDR_PULL_ALLOC(ndr
, r
->dc_unc
);
6180 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_address
));
6181 if (_ptr_dc_address
) {
6182 NDR_PULL_ALLOC(ndr
, r
->dc_address
);
6184 r
->dc_address
= NULL
;
6186 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr
, NDR_SCALARS
, &r
->dc_address_type
));
6187 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->domain_guid
));
6188 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
6189 if (_ptr_domain_name
) {
6190 NDR_PULL_ALLOC(ndr
, r
->domain_name
);
6192 r
->domain_name
= NULL
;
6194 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_forest_name
));
6195 if (_ptr_forest_name
) {
6196 NDR_PULL_ALLOC(ndr
, r
->forest_name
);
6198 r
->forest_name
= NULL
;
6200 NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr
, NDR_SCALARS
, &r
->dc_flags
));
6201 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_site_name
));
6202 if (_ptr_dc_site_name
) {
6203 NDR_PULL_ALLOC(ndr
, r
->dc_site_name
);
6205 r
->dc_site_name
= NULL
;
6207 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_client_site_name
));
6208 if (_ptr_client_site_name
) {
6209 NDR_PULL_ALLOC(ndr
, r
->client_site_name
);
6211 r
->client_site_name
= NULL
;
6214 if (ndr_flags
& NDR_BUFFERS
) {
6216 _mem_save_dc_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6217 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_unc
, 0);
6218 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_unc
));
6219 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_unc
));
6220 if (ndr_get_array_length(ndr
, &r
->dc_unc
) > ndr_get_array_size(ndr
, &r
->dc_unc
)) {
6221 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->dc_unc
), ndr_get_array_length(ndr
, &r
->dc_unc
));
6223 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_unc
), sizeof(uint16_t)));
6224 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dc_unc
, ndr_get_array_length(ndr
, &r
->dc_unc
), sizeof(uint16_t), CH_UTF16
));
6225 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_unc_0
, 0);
6227 if (r
->dc_address
) {
6228 _mem_save_dc_address_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6229 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_address
, 0);
6230 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_address
));
6231 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_address
));
6232 if (ndr_get_array_length(ndr
, &r
->dc_address
) > ndr_get_array_size(ndr
, &r
->dc_address
)) {
6233 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->dc_address
), ndr_get_array_length(ndr
, &r
->dc_address
));
6235 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_address
), sizeof(uint16_t)));
6236 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dc_address
, ndr_get_array_length(ndr
, &r
->dc_address
), sizeof(uint16_t), CH_UTF16
));
6237 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_address_0
, 0);
6239 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_BUFFERS
, &r
->domain_guid
));
6240 if (r
->domain_name
) {
6241 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6242 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain_name
, 0);
6243 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain_name
));
6244 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain_name
));
6245 if (ndr_get_array_length(ndr
, &r
->domain_name
) > ndr_get_array_size(ndr
, &r
->domain_name
)) {
6246 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->domain_name
), ndr_get_array_length(ndr
, &r
->domain_name
));
6248 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain_name
), sizeof(uint16_t)));
6249 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain_name
, ndr_get_array_length(ndr
, &r
->domain_name
), sizeof(uint16_t), CH_UTF16
));
6250 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
6252 if (r
->forest_name
) {
6253 _mem_save_forest_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6254 NDR_PULL_SET_MEM_CTX(ndr
, r
->forest_name
, 0);
6255 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->forest_name
));
6256 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->forest_name
));
6257 if (ndr_get_array_length(ndr
, &r
->forest_name
) > ndr_get_array_size(ndr
, &r
->forest_name
)) {
6258 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->forest_name
), ndr_get_array_length(ndr
, &r
->forest_name
));
6260 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->forest_name
), sizeof(uint16_t)));
6261 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->forest_name
, ndr_get_array_length(ndr
, &r
->forest_name
), sizeof(uint16_t), CH_UTF16
));
6262 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_name_0
, 0);
6264 if (r
->dc_site_name
) {
6265 _mem_save_dc_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6266 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_site_name
, 0);
6267 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_site_name
));
6268 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_site_name
));
6269 if (ndr_get_array_length(ndr
, &r
->dc_site_name
) > ndr_get_array_size(ndr
, &r
->dc_site_name
)) {
6270 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->dc_site_name
), ndr_get_array_length(ndr
, &r
->dc_site_name
));
6272 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_site_name
), sizeof(uint16_t)));
6273 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dc_site_name
, ndr_get_array_length(ndr
, &r
->dc_site_name
), sizeof(uint16_t), CH_UTF16
));
6274 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_site_name_0
, 0);
6276 if (r
->client_site_name
) {
6277 _mem_save_client_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6278 NDR_PULL_SET_MEM_CTX(ndr
, r
->client_site_name
, 0);
6279 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->client_site_name
));
6280 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->client_site_name
));
6281 if (ndr_get_array_length(ndr
, &r
->client_site_name
) > ndr_get_array_size(ndr
, &r
->client_site_name
)) {
6282 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->client_site_name
), ndr_get_array_length(ndr
, &r
->client_site_name
));
6284 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->client_site_name
), sizeof(uint16_t)));
6285 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->client_site_name
, ndr_get_array_length(ndr
, &r
->client_site_name
), sizeof(uint16_t), CH_UTF16
));
6286 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_client_site_name_0
, 0);
6289 return NDR_ERR_SUCCESS
;
6292 _PUBLIC_
void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRGetDCNameInfo
*r
)
6294 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameInfo");
6296 ndr_print_ptr(ndr
, "dc_unc", r
->dc_unc
);
6299 ndr_print_string(ndr
, "dc_unc", r
->dc_unc
);
6302 ndr_print_ptr(ndr
, "dc_address", r
->dc_address
);
6304 if (r
->dc_address
) {
6305 ndr_print_string(ndr
, "dc_address", r
->dc_address
);
6308 ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr
, "dc_address_type", r
->dc_address_type
);
6309 ndr_print_GUID(ndr
, "domain_guid", &r
->domain_guid
);
6310 ndr_print_ptr(ndr
, "domain_name", r
->domain_name
);
6312 if (r
->domain_name
) {
6313 ndr_print_string(ndr
, "domain_name", r
->domain_name
);
6316 ndr_print_ptr(ndr
, "forest_name", r
->forest_name
);
6318 if (r
->forest_name
) {
6319 ndr_print_string(ndr
, "forest_name", r
->forest_name
);
6322 ndr_print_netr_DsR_DcFlags(ndr
, "dc_flags", r
->dc_flags
);
6323 ndr_print_ptr(ndr
, "dc_site_name", r
->dc_site_name
);
6325 if (r
->dc_site_name
) {
6326 ndr_print_string(ndr
, "dc_site_name", r
->dc_site_name
);
6329 ndr_print_ptr(ndr
, "client_site_name", r
->client_site_name
);
6331 if (r
->client_site_name
) {
6332 ndr_print_string(ndr
, "client_site_name", r
->client_site_name
);
6338 static enum ndr_err_code
ndr_push_netr_BinaryString(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_BinaryString
*r
)
6340 uint32_t cntr_data_1
;
6342 uint32_t _flags_save_STRUCT
= ndr
->flags
;
6343 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
6344 if (ndr_flags
& NDR_SCALARS
) {
6345 NDR_CHECK(ndr_push_align(ndr
, 4));
6346 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
6347 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->size
));
6348 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
6350 if (ndr_flags
& NDR_BUFFERS
) {
6352 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
/ 2));
6353 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6354 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
/ 2));
6355 for (cntr_data_1
= 0; cntr_data_1
< r
->length
/ 2; cntr_data_1
++) {
6356 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->data
[cntr_data_1
]));
6360 ndr
->flags
= _flags_save_STRUCT
;
6362 return NDR_ERR_SUCCESS
;
6365 static enum ndr_err_code
ndr_pull_netr_BinaryString(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_BinaryString
*r
)
6368 uint32_t cntr_data_1
;
6369 TALLOC_CTX
*_mem_save_data_0
;
6370 TALLOC_CTX
*_mem_save_data_1
;
6372 uint32_t _flags_save_STRUCT
= ndr
->flags
;
6373 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
6374 if (ndr_flags
& NDR_SCALARS
) {
6375 NDR_CHECK(ndr_pull_align(ndr
, 4));
6376 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
6377 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
6378 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
6380 NDR_PULL_ALLOC(ndr
, r
->data
);
6385 if (ndr_flags
& NDR_BUFFERS
) {
6387 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6388 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
6389 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
6390 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->data
));
6391 if (ndr_get_array_length(ndr
, &r
->data
) > ndr_get_array_size(ndr
, &r
->data
)) {
6392 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->data
), ndr_get_array_length(ndr
, &r
->data
));
6394 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
6395 _mem_save_data_1
= NDR_PULL_GET_MEM_CTX(ndr
);
6396 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
6397 for (cntr_data_1
= 0; cntr_data_1
< r
->length
/ 2; cntr_data_1
++) {
6398 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->data
[cntr_data_1
]));
6400 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_1
, 0);
6401 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
6404 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->size
/ 2));
6407 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->data
, r
->length
/ 2));
6410 ndr
->flags
= _flags_save_STRUCT
;
6412 return NDR_ERR_SUCCESS
;
6415 _PUBLIC_
void ndr_print_netr_BinaryString(struct ndr_print
*ndr
, const char *name
, const struct netr_BinaryString
*r
)
6417 uint32_t cntr_data_1
;
6418 ndr_print_struct(ndr
, name
, "netr_BinaryString");
6420 uint32_t _flags_save_STRUCT
= ndr
->flags
;
6421 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
6423 ndr_print_uint16(ndr
, "length", r
->length
);
6424 ndr_print_uint16(ndr
, "size", r
->size
);
6425 ndr_print_ptr(ndr
, "data", r
->data
);
6428 ndr
->print(ndr
, "%s: ARRAY(%d)", "data", r
->length
/ 2);
6430 for (cntr_data_1
=0;cntr_data_1
<r
->length
/ 2;cntr_data_1
++) {
6432 asprintf(&idx_1
, "[%d]", cntr_data_1
);
6434 ndr_print_uint16(ndr
, "data", r
->data
[cntr_data_1
]);
6442 ndr
->flags
= _flags_save_STRUCT
;
6446 static enum ndr_err_code
ndr_push_netr_DomainQuery1(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainQuery1
*r
)
6448 uint32_t cntr_unknown7_0
;
6449 if (ndr_flags
& NDR_SCALARS
) {
6450 NDR_CHECK(ndr_push_align(ndr
, 4));
6451 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_SCALARS
, &r
->blob
));
6452 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->workstation_domain
));
6453 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->workstation_site
));
6454 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown1
));
6455 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown2
));
6456 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown3
));
6457 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown4
));
6458 NDR_CHECK(ndr_push_netr_BinaryString(ndr
, NDR_SCALARS
, &r
->blob2
));
6459 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->product
));
6460 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown5
));
6461 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown6
));
6462 for (cntr_unknown7_0
= 0; cntr_unknown7_0
< 4; cntr_unknown7_0
++) {
6463 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
[cntr_unknown7_0
]));
6466 if (ndr_flags
& NDR_BUFFERS
) {
6467 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_BUFFERS
, &r
->blob
));
6468 if (r
->workstation_domain
) {
6469 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
)));
6470 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6471 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
)));
6472 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->workstation_domain
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6474 if (r
->workstation_site
) {
6475 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_site
, CH_UTF16
)));
6476 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6477 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_site
, CH_UTF16
)));
6478 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->workstation_site
, ndr_charset_length(r
->workstation_site
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6481 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown1
, CH_UTF16
)));
6482 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6483 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown1
, CH_UTF16
)));
6484 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown1
, ndr_charset_length(r
->unknown1
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6487 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown2
, CH_UTF16
)));
6488 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6489 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown2
, CH_UTF16
)));
6490 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown2
, ndr_charset_length(r
->unknown2
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6493 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown3
, CH_UTF16
)));
6494 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6495 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown3
, CH_UTF16
)));
6496 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown3
, ndr_charset_length(r
->unknown3
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6499 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown4
, CH_UTF16
)));
6500 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6501 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown4
, CH_UTF16
)));
6502 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown4
, ndr_charset_length(r
->unknown4
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6504 NDR_CHECK(ndr_push_netr_BinaryString(ndr
, NDR_BUFFERS
, &r
->blob2
));
6505 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->product
));
6506 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown5
));
6507 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown6
));
6509 return NDR_ERR_SUCCESS
;
6512 static enum ndr_err_code
ndr_pull_netr_DomainQuery1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainQuery1
*r
)
6514 uint32_t _ptr_workstation_domain
;
6515 TALLOC_CTX
*_mem_save_workstation_domain_0
;
6516 uint32_t _ptr_workstation_site
;
6517 TALLOC_CTX
*_mem_save_workstation_site_0
;
6518 uint32_t _ptr_unknown1
;
6519 TALLOC_CTX
*_mem_save_unknown1_0
;
6520 uint32_t _ptr_unknown2
;
6521 TALLOC_CTX
*_mem_save_unknown2_0
;
6522 uint32_t _ptr_unknown3
;
6523 TALLOC_CTX
*_mem_save_unknown3_0
;
6524 uint32_t _ptr_unknown4
;
6525 TALLOC_CTX
*_mem_save_unknown4_0
;
6526 uint32_t cntr_unknown7_0
;
6527 if (ndr_flags
& NDR_SCALARS
) {
6528 NDR_CHECK(ndr_pull_align(ndr
, 4));
6529 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_SCALARS
, &r
->blob
));
6530 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_workstation_domain
));
6531 if (_ptr_workstation_domain
) {
6532 NDR_PULL_ALLOC(ndr
, r
->workstation_domain
);
6534 r
->workstation_domain
= NULL
;
6536 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_workstation_site
));
6537 if (_ptr_workstation_site
) {
6538 NDR_PULL_ALLOC(ndr
, r
->workstation_site
);
6540 r
->workstation_site
= NULL
;
6542 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown1
));
6543 if (_ptr_unknown1
) {
6544 NDR_PULL_ALLOC(ndr
, r
->unknown1
);
6548 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown2
));
6549 if (_ptr_unknown2
) {
6550 NDR_PULL_ALLOC(ndr
, r
->unknown2
);
6554 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown3
));
6555 if (_ptr_unknown3
) {
6556 NDR_PULL_ALLOC(ndr
, r
->unknown3
);
6560 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown4
));
6561 if (_ptr_unknown4
) {
6562 NDR_PULL_ALLOC(ndr
, r
->unknown4
);
6566 NDR_CHECK(ndr_pull_netr_BinaryString(ndr
, NDR_SCALARS
, &r
->blob2
));
6567 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->product
));
6568 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown5
));
6569 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown6
));
6570 for (cntr_unknown7_0
= 0; cntr_unknown7_0
< 4; cntr_unknown7_0
++) {
6571 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
[cntr_unknown7_0
]));
6574 if (ndr_flags
& NDR_BUFFERS
) {
6575 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_BUFFERS
, &r
->blob
));
6576 if (r
->workstation_domain
) {
6577 _mem_save_workstation_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6578 NDR_PULL_SET_MEM_CTX(ndr
, r
->workstation_domain
, 0);
6579 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->workstation_domain
));
6580 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->workstation_domain
));
6581 if (ndr_get_array_length(ndr
, &r
->workstation_domain
) > ndr_get_array_size(ndr
, &r
->workstation_domain
)) {
6582 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->workstation_domain
), ndr_get_array_length(ndr
, &r
->workstation_domain
));
6584 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->workstation_domain
), sizeof(uint16_t)));
6585 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->workstation_domain
, ndr_get_array_length(ndr
, &r
->workstation_domain
), sizeof(uint16_t), CH_UTF16
));
6586 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_workstation_domain_0
, 0);
6588 if (r
->workstation_site
) {
6589 _mem_save_workstation_site_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6590 NDR_PULL_SET_MEM_CTX(ndr
, r
->workstation_site
, 0);
6591 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->workstation_site
));
6592 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->workstation_site
));
6593 if (ndr_get_array_length(ndr
, &r
->workstation_site
) > ndr_get_array_size(ndr
, &r
->workstation_site
)) {
6594 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->workstation_site
), ndr_get_array_length(ndr
, &r
->workstation_site
));
6596 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->workstation_site
), sizeof(uint16_t)));
6597 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->workstation_site
, ndr_get_array_length(ndr
, &r
->workstation_site
), sizeof(uint16_t), CH_UTF16
));
6598 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_workstation_site_0
, 0);
6601 _mem_save_unknown1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6602 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown1
, 0);
6603 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown1
));
6604 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown1
));
6605 if (ndr_get_array_length(ndr
, &r
->unknown1
) > ndr_get_array_size(ndr
, &r
->unknown1
)) {
6606 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown1
), ndr_get_array_length(ndr
, &r
->unknown1
));
6608 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown1
), sizeof(uint16_t)));
6609 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown1
, ndr_get_array_length(ndr
, &r
->unknown1
), sizeof(uint16_t), CH_UTF16
));
6610 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown1_0
, 0);
6613 _mem_save_unknown2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6614 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown2
, 0);
6615 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown2
));
6616 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown2
));
6617 if (ndr_get_array_length(ndr
, &r
->unknown2
) > ndr_get_array_size(ndr
, &r
->unknown2
)) {
6618 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown2
), ndr_get_array_length(ndr
, &r
->unknown2
));
6620 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown2
), sizeof(uint16_t)));
6621 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown2
, ndr_get_array_length(ndr
, &r
->unknown2
), sizeof(uint16_t), CH_UTF16
));
6622 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown2_0
, 0);
6625 _mem_save_unknown3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6626 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown3
, 0);
6627 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown3
));
6628 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown3
));
6629 if (ndr_get_array_length(ndr
, &r
->unknown3
) > ndr_get_array_size(ndr
, &r
->unknown3
)) {
6630 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown3
), ndr_get_array_length(ndr
, &r
->unknown3
));
6632 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown3
), sizeof(uint16_t)));
6633 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown3
, ndr_get_array_length(ndr
, &r
->unknown3
), sizeof(uint16_t), CH_UTF16
));
6634 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown3_0
, 0);
6637 _mem_save_unknown4_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6638 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown4
, 0);
6639 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown4
));
6640 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown4
));
6641 if (ndr_get_array_length(ndr
, &r
->unknown4
) > ndr_get_array_size(ndr
, &r
->unknown4
)) {
6642 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown4
), ndr_get_array_length(ndr
, &r
->unknown4
));
6644 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown4
), sizeof(uint16_t)));
6645 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown4
, ndr_get_array_length(ndr
, &r
->unknown4
), sizeof(uint16_t), CH_UTF16
));
6646 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown4_0
, 0);
6648 NDR_CHECK(ndr_pull_netr_BinaryString(ndr
, NDR_BUFFERS
, &r
->blob2
));
6649 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->product
));
6650 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown5
));
6651 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown6
));
6653 return NDR_ERR_SUCCESS
;
6656 _PUBLIC_
void ndr_print_netr_DomainQuery1(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainQuery1
*r
)
6658 uint32_t cntr_unknown7_0
;
6659 ndr_print_struct(ndr
, name
, "netr_DomainQuery1");
6661 ndr_print_netr_Blob(ndr
, "blob", &r
->blob
);
6662 ndr_print_ptr(ndr
, "workstation_domain", r
->workstation_domain
);
6664 if (r
->workstation_domain
) {
6665 ndr_print_string(ndr
, "workstation_domain", r
->workstation_domain
);
6668 ndr_print_ptr(ndr
, "workstation_site", r
->workstation_site
);
6670 if (r
->workstation_site
) {
6671 ndr_print_string(ndr
, "workstation_site", r
->workstation_site
);
6674 ndr_print_ptr(ndr
, "unknown1", r
->unknown1
);
6677 ndr_print_string(ndr
, "unknown1", r
->unknown1
);
6680 ndr_print_ptr(ndr
, "unknown2", r
->unknown2
);
6683 ndr_print_string(ndr
, "unknown2", r
->unknown2
);
6686 ndr_print_ptr(ndr
, "unknown3", r
->unknown3
);
6689 ndr_print_string(ndr
, "unknown3", r
->unknown3
);
6692 ndr_print_ptr(ndr
, "unknown4", r
->unknown4
);
6695 ndr_print_string(ndr
, "unknown4", r
->unknown4
);
6698 ndr_print_netr_BinaryString(ndr
, "blob2", &r
->blob2
);
6699 ndr_print_lsa_String(ndr
, "product", &r
->product
);
6700 ndr_print_lsa_String(ndr
, "unknown5", &r
->unknown5
);
6701 ndr_print_lsa_String(ndr
, "unknown6", &r
->unknown6
);
6702 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown7", 4);
6704 for (cntr_unknown7_0
=0;cntr_unknown7_0
<4;cntr_unknown7_0
++) {
6706 asprintf(&idx_0
, "[%d]", cntr_unknown7_0
);
6708 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
[cntr_unknown7_0
]);
6716 static enum ndr_err_code
ndr_push_netr_DomainQuery(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DomainQuery
*r
)
6718 if (ndr_flags
& NDR_SCALARS
) {
6719 int level
= ndr_push_get_switch_value(ndr
, r
);
6720 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
6723 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->query1
));
6727 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->query1
));
6731 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6734 if (ndr_flags
& NDR_BUFFERS
) {
6735 int level
= ndr_push_get_switch_value(ndr
, r
);
6739 NDR_CHECK(ndr_push_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
6745 NDR_CHECK(ndr_push_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
6750 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6753 return NDR_ERR_SUCCESS
;
6756 static enum ndr_err_code
ndr_pull_netr_DomainQuery(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DomainQuery
*r
)
6760 TALLOC_CTX
*_mem_save_query1_0
;
6761 level
= ndr_pull_get_switch_value(ndr
, r
);
6762 if (ndr_flags
& NDR_SCALARS
) {
6763 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
6764 if (_level
!= level
) {
6765 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
6769 uint32_t _ptr_query1
;
6770 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_query1
));
6772 NDR_PULL_ALLOC(ndr
, r
->query1
);
6779 uint32_t _ptr_query1
;
6780 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_query1
));
6782 NDR_PULL_ALLOC(ndr
, r
->query1
);
6789 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6792 if (ndr_flags
& NDR_BUFFERS
) {
6796 _mem_save_query1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6797 NDR_PULL_SET_MEM_CTX(ndr
, r
->query1
, 0);
6798 NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
6799 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query1_0
, 0);
6805 _mem_save_query1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6806 NDR_PULL_SET_MEM_CTX(ndr
, r
->query1
, 0);
6807 NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
6808 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query1_0
, 0);
6813 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6816 return NDR_ERR_SUCCESS
;
6819 _PUBLIC_
void ndr_print_netr_DomainQuery(struct ndr_print
*ndr
, const char *name
, const union netr_DomainQuery
*r
)
6822 level
= ndr_print_get_switch_value(ndr
, r
);
6823 ndr_print_union(ndr
, name
, level
, "netr_DomainQuery");
6826 ndr_print_ptr(ndr
, "query1", r
->query1
);
6829 ndr_print_netr_DomainQuery1(ndr
, "query1", r
->query1
);
6835 ndr_print_ptr(ndr
, "query1", r
->query1
);
6838 ndr_print_netr_DomainQuery1(ndr
, "query1", r
->query1
);
6844 ndr_print_bad_level(ndr
, name
, level
);
6848 static enum ndr_err_code
ndr_push_netr_DomainTrustInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrustInfo
*r
)
6850 uint32_t cntr_unknown1_0
;
6851 uint32_t cntr_unknown_0
;
6852 if (ndr_flags
& NDR_SCALARS
) {
6853 NDR_CHECK(ndr_push_align(ndr
, 4));
6854 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domainname
));
6855 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->fulldomainname
));
6856 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
6857 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
6858 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
6859 for (cntr_unknown1_0
= 0; cntr_unknown1_0
< 4; cntr_unknown1_0
++) {
6860 NDR_CHECK(ndr_push_netr_BinaryString(ndr
, NDR_SCALARS
, &r
->unknown1
[cntr_unknown1_0
]));
6862 for (cntr_unknown_0
= 0; cntr_unknown_0
< 4; cntr_unknown_0
++) {
6863 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown
[cntr_unknown_0
]));
6866 if (ndr_flags
& NDR_BUFFERS
) {
6867 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domainname
));
6868 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->fulldomainname
));
6869 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
6870 NDR_CHECK(ndr_push_GUID(ndr
, NDR_BUFFERS
, &r
->guid
));
6872 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
6874 for (cntr_unknown1_0
= 0; cntr_unknown1_0
< 4; cntr_unknown1_0
++) {
6875 NDR_CHECK(ndr_push_netr_BinaryString(ndr
, NDR_BUFFERS
, &r
->unknown1
[cntr_unknown1_0
]));
6878 return NDR_ERR_SUCCESS
;
6881 static enum ndr_err_code
ndr_pull_netr_DomainTrustInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrustInfo
*r
)
6884 TALLOC_CTX
*_mem_save_sid_0
;
6885 uint32_t cntr_unknown1_0
;
6886 uint32_t cntr_unknown_0
;
6887 if (ndr_flags
& NDR_SCALARS
) {
6888 NDR_CHECK(ndr_pull_align(ndr
, 4));
6889 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domainname
));
6890 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->fulldomainname
));
6891 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
6892 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
6893 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
6895 NDR_PULL_ALLOC(ndr
, r
->sid
);
6899 for (cntr_unknown1_0
= 0; cntr_unknown1_0
< 4; cntr_unknown1_0
++) {
6900 NDR_CHECK(ndr_pull_netr_BinaryString(ndr
, NDR_SCALARS
, &r
->unknown1
[cntr_unknown1_0
]));
6902 for (cntr_unknown_0
= 0; cntr_unknown_0
< 4; cntr_unknown_0
++) {
6903 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
[cntr_unknown_0
]));
6906 if (ndr_flags
& NDR_BUFFERS
) {
6907 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domainname
));
6908 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->fulldomainname
));
6909 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
6910 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_BUFFERS
, &r
->guid
));
6912 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6913 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
6914 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
6915 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
6917 for (cntr_unknown1_0
= 0; cntr_unknown1_0
< 4; cntr_unknown1_0
++) {
6918 NDR_CHECK(ndr_pull_netr_BinaryString(ndr
, NDR_BUFFERS
, &r
->unknown1
[cntr_unknown1_0
]));
6921 return NDR_ERR_SUCCESS
;
6924 _PUBLIC_
void ndr_print_netr_DomainTrustInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrustInfo
*r
)
6926 uint32_t cntr_unknown1_0
;
6927 uint32_t cntr_unknown_0
;
6928 ndr_print_struct(ndr
, name
, "netr_DomainTrustInfo");
6930 ndr_print_lsa_String(ndr
, "domainname", &r
->domainname
);
6931 ndr_print_lsa_String(ndr
, "fulldomainname", &r
->fulldomainname
);
6932 ndr_print_lsa_String(ndr
, "forest", &r
->forest
);
6933 ndr_print_GUID(ndr
, "guid", &r
->guid
);
6934 ndr_print_ptr(ndr
, "sid", r
->sid
);
6937 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
6940 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown1", 4);
6942 for (cntr_unknown1_0
=0;cntr_unknown1_0
<4;cntr_unknown1_0
++) {
6944 asprintf(&idx_0
, "[%d]", cntr_unknown1_0
);
6946 ndr_print_netr_BinaryString(ndr
, "unknown1", &r
->unknown1
[cntr_unknown1_0
]);
6951 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown", 4);
6953 for (cntr_unknown_0
=0;cntr_unknown_0
<4;cntr_unknown_0
++) {
6955 asprintf(&idx_0
, "[%d]", cntr_unknown_0
);
6957 ndr_print_uint32(ndr
, "unknown", r
->unknown
[cntr_unknown_0
]);
6965 static enum ndr_err_code
ndr_push_netr_DomainInfo1(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainInfo1
*r
)
6967 uint32_t cntr_trusts_1
;
6968 uint32_t cntr_unknown_0
;
6969 if (ndr_flags
& NDR_SCALARS
) {
6970 NDR_CHECK(ndr_push_align(ndr
, 4));
6971 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->domaininfo
));
6972 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_trusts
));
6973 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusts
));
6974 for (cntr_unknown_0
= 0; cntr_unknown_0
< 14; cntr_unknown_0
++) {
6975 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown
[cntr_unknown_0
]));
6978 if (ndr_flags
& NDR_BUFFERS
) {
6979 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->domaininfo
));
6981 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_trusts
));
6982 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
6983 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->trusts
[cntr_trusts_1
]));
6985 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
6986 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->trusts
[cntr_trusts_1
]));
6990 return NDR_ERR_SUCCESS
;
6993 static enum ndr_err_code
ndr_pull_netr_DomainInfo1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainInfo1
*r
)
6995 uint32_t _ptr_trusts
;
6996 uint32_t cntr_trusts_1
;
6997 TALLOC_CTX
*_mem_save_trusts_0
;
6998 TALLOC_CTX
*_mem_save_trusts_1
;
6999 uint32_t cntr_unknown_0
;
7000 if (ndr_flags
& NDR_SCALARS
) {
7001 NDR_CHECK(ndr_pull_align(ndr
, 4));
7002 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->domaininfo
));
7003 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_trusts
));
7004 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusts
));
7006 NDR_PULL_ALLOC(ndr
, r
->trusts
);
7010 for (cntr_unknown_0
= 0; cntr_unknown_0
< 14; cntr_unknown_0
++) {
7011 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
[cntr_unknown_0
]));
7014 if (ndr_flags
& NDR_BUFFERS
) {
7015 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->domaininfo
));
7017 _mem_save_trusts_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7018 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusts
, 0);
7019 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusts
));
7020 NDR_PULL_ALLOC_N(ndr
, r
->trusts
, ndr_get_array_size(ndr
, &r
->trusts
));
7021 _mem_save_trusts_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7022 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusts
, 0);
7023 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7024 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->trusts
[cntr_trusts_1
]));
7026 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7027 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->trusts
[cntr_trusts_1
]));
7029 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_1
, 0);
7030 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_0
, 0);
7033 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->trusts
, r
->num_trusts
));
7036 return NDR_ERR_SUCCESS
;
7039 _PUBLIC_
void ndr_print_netr_DomainInfo1(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainInfo1
*r
)
7041 uint32_t cntr_trusts_1
;
7042 uint32_t cntr_unknown_0
;
7043 ndr_print_struct(ndr
, name
, "netr_DomainInfo1");
7045 ndr_print_netr_DomainTrustInfo(ndr
, "domaininfo", &r
->domaininfo
);
7046 ndr_print_uint32(ndr
, "num_trusts", r
->num_trusts
);
7047 ndr_print_ptr(ndr
, "trusts", r
->trusts
);
7050 ndr
->print(ndr
, "%s: ARRAY(%d)", "trusts", r
->num_trusts
);
7052 for (cntr_trusts_1
=0;cntr_trusts_1
<r
->num_trusts
;cntr_trusts_1
++) {
7054 asprintf(&idx_1
, "[%d]", cntr_trusts_1
);
7056 ndr_print_netr_DomainTrustInfo(ndr
, "trusts", &r
->trusts
[cntr_trusts_1
]);
7063 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown", 14);
7065 for (cntr_unknown_0
=0;cntr_unknown_0
<14;cntr_unknown_0
++) {
7067 asprintf(&idx_0
, "[%d]", cntr_unknown_0
);
7069 ndr_print_uint32(ndr
, "unknown", r
->unknown
[cntr_unknown_0
]);
7077 static enum ndr_err_code
ndr_push_netr_DomainInfo(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DomainInfo
*r
)
7079 if (ndr_flags
& NDR_SCALARS
) {
7080 int level
= ndr_push_get_switch_value(ndr
, r
);
7081 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
7084 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info1
));
7088 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info1
));
7092 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7095 if (ndr_flags
& NDR_BUFFERS
) {
7096 int level
= ndr_push_get_switch_value(ndr
, r
);
7100 NDR_CHECK(ndr_push_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
7106 NDR_CHECK(ndr_push_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
7111 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7114 return NDR_ERR_SUCCESS
;
7117 static enum ndr_err_code
ndr_pull_netr_DomainInfo(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DomainInfo
*r
)
7121 TALLOC_CTX
*_mem_save_info1_0
;
7122 level
= ndr_pull_get_switch_value(ndr
, r
);
7123 if (ndr_flags
& NDR_SCALARS
) {
7124 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
7125 if (_level
!= level
) {
7126 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
7130 uint32_t _ptr_info1
;
7131 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info1
));
7133 NDR_PULL_ALLOC(ndr
, r
->info1
);
7140 uint32_t _ptr_info1
;
7141 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info1
));
7143 NDR_PULL_ALLOC(ndr
, r
->info1
);
7150 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7153 if (ndr_flags
& NDR_BUFFERS
) {
7157 _mem_save_info1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7158 NDR_PULL_SET_MEM_CTX(ndr
, r
->info1
, 0);
7159 NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
7160 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info1_0
, 0);
7166 _mem_save_info1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7167 NDR_PULL_SET_MEM_CTX(ndr
, r
->info1
, 0);
7168 NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
7169 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info1_0
, 0);
7174 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7177 return NDR_ERR_SUCCESS
;
7180 _PUBLIC_
void ndr_print_netr_DomainInfo(struct ndr_print
*ndr
, const char *name
, const union netr_DomainInfo
*r
)
7183 level
= ndr_print_get_switch_value(ndr
, r
);
7184 ndr_print_union(ndr
, name
, level
, "netr_DomainInfo");
7187 ndr_print_ptr(ndr
, "info1", r
->info1
);
7190 ndr_print_netr_DomainInfo1(ndr
, "info1", r
->info1
);
7196 ndr_print_ptr(ndr
, "info1", r
->info1
);
7199 ndr_print_netr_DomainInfo1(ndr
, "info1", r
->info1
);
7205 ndr_print_bad_level(ndr
, name
, level
);
7209 static enum ndr_err_code
ndr_push_netr_CryptPassword(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_CryptPassword
*r
)
7212 uint32_t _flags_save_STRUCT
= ndr
->flags
;
7213 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
7214 if (ndr_flags
& NDR_SCALARS
) {
7215 NDR_CHECK(ndr_push_align(ndr
, 4));
7216 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 512));
7217 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
7219 if (ndr_flags
& NDR_BUFFERS
) {
7221 ndr
->flags
= _flags_save_STRUCT
;
7223 return NDR_ERR_SUCCESS
;
7226 static enum ndr_err_code
ndr_pull_netr_CryptPassword(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_CryptPassword
*r
)
7229 uint32_t _flags_save_STRUCT
= ndr
->flags
;
7230 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
7231 if (ndr_flags
& NDR_SCALARS
) {
7232 NDR_CHECK(ndr_pull_align(ndr
, 4));
7233 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 512));
7234 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
7236 if (ndr_flags
& NDR_BUFFERS
) {
7238 ndr
->flags
= _flags_save_STRUCT
;
7240 return NDR_ERR_SUCCESS
;
7243 _PUBLIC_
void ndr_print_netr_CryptPassword(struct ndr_print
*ndr
, const char *name
, const struct netr_CryptPassword
*r
)
7245 ndr_print_struct(ndr
, name
, "netr_CryptPassword");
7247 uint32_t _flags_save_STRUCT
= ndr
->flags
;
7248 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
7250 ndr_print_array_uint8(ndr
, "data", r
->data
, 512);
7251 ndr_print_uint32(ndr
, "length", r
->length
);
7253 ndr
->flags
= _flags_save_STRUCT
;
7257 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddressToSitenamesWCtr
*r
)
7259 uint32_t cntr_sitename_1
;
7260 if (ndr_flags
& NDR_SCALARS
) {
7261 NDR_CHECK(ndr_push_align(ndr
, 4));
7262 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7263 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sitename
));
7265 if (ndr_flags
& NDR_BUFFERS
) {
7267 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7268 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7269 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
7271 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7272 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
7276 return NDR_ERR_SUCCESS
;
7279 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddressToSitenamesWCtr
*r
)
7281 uint32_t _ptr_sitename
;
7282 uint32_t cntr_sitename_1
;
7283 TALLOC_CTX
*_mem_save_sitename_0
;
7284 TALLOC_CTX
*_mem_save_sitename_1
;
7285 if (ndr_flags
& NDR_SCALARS
) {
7286 NDR_CHECK(ndr_pull_align(ndr
, 4));
7287 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
7288 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sitename
));
7289 if (_ptr_sitename
) {
7290 NDR_PULL_ALLOC(ndr
, r
->sitename
);
7295 if (ndr_flags
& NDR_BUFFERS
) {
7297 _mem_save_sitename_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7298 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
7299 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sitename
));
7300 NDR_PULL_ALLOC_N(ndr
, r
->sitename
, ndr_get_array_size(ndr
, &r
->sitename
));
7301 _mem_save_sitename_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7302 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
7303 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7304 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
7306 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7307 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
7309 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_1
, 0);
7310 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_0
, 0);
7313 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sitename
, r
->count
));
7316 return NDR_ERR_SUCCESS
;
7319 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddressToSitenamesWCtr
*r
)
7321 uint32_t cntr_sitename_1
;
7322 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesWCtr");
7324 ndr_print_uint32(ndr
, "count", r
->count
);
7325 ndr_print_ptr(ndr
, "sitename", r
->sitename
);
7328 ndr
->print(ndr
, "%s: ARRAY(%d)", "sitename", r
->count
);
7330 for (cntr_sitename_1
=0;cntr_sitename_1
<r
->count
;cntr_sitename_1
++) {
7332 asprintf(&idx_1
, "[%d]", cntr_sitename_1
);
7334 ndr_print_lsa_String(ndr
, "sitename", &r
->sitename
[cntr_sitename_1
]);
7344 static enum ndr_err_code
ndr_push_netr_DsRAddress(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddress
*r
)
7346 if (ndr_flags
& NDR_SCALARS
) {
7347 NDR_CHECK(ndr_push_align(ndr
, 4));
7348 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->buffer
));
7349 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
));
7351 if (ndr_flags
& NDR_BUFFERS
) {
7353 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
));
7354 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->buffer
, r
->size
));
7357 return NDR_ERR_SUCCESS
;
7360 static enum ndr_err_code
ndr_pull_netr_DsRAddress(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddress
*r
)
7362 uint32_t _ptr_buffer
;
7363 TALLOC_CTX
*_mem_save_buffer_0
;
7364 if (ndr_flags
& NDR_SCALARS
) {
7365 NDR_CHECK(ndr_pull_align(ndr
, 4));
7366 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_buffer
));
7368 NDR_PULL_ALLOC(ndr
, r
->buffer
);
7372 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->size
));
7374 if (ndr_flags
& NDR_BUFFERS
) {
7376 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7377 NDR_PULL_SET_MEM_CTX(ndr
, r
->buffer
, 0);
7378 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->buffer
));
7379 NDR_PULL_ALLOC_N(ndr
, r
->buffer
, ndr_get_array_size(ndr
, &r
->buffer
));
7380 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->buffer
, ndr_get_array_size(ndr
, &r
->buffer
)));
7381 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, 0);
7384 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->buffer
, r
->size
));
7387 return NDR_ERR_SUCCESS
;
7390 _PUBLIC_
void ndr_print_netr_DsRAddress(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddress
*r
)
7392 ndr_print_struct(ndr
, name
, "netr_DsRAddress");
7394 ndr_print_ptr(ndr
, "buffer", r
->buffer
);
7397 ndr_print_array_uint8(ndr
, "buffer", r
->buffer
, r
->size
);
7400 ndr_print_uint32(ndr
, "size", r
->size
);
7404 static enum ndr_err_code
ndr_push_netr_TrustFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
7406 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
7407 return NDR_ERR_SUCCESS
;
7410 static enum ndr_err_code
ndr_pull_netr_TrustFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
7413 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
7415 return NDR_ERR_SUCCESS
;
7418 _PUBLIC_
void ndr_print_netr_TrustFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
7420 ndr_print_uint32(ndr
, name
, r
);
7422 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST
, r
);
7423 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND
, r
);
7424 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT
, r
);
7425 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY
, r
);
7426 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE
, r
);
7427 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND
, r
);
7431 static enum ndr_err_code
ndr_push_netr_TrustType(struct ndr_push
*ndr
, int ndr_flags
, enum netr_TrustType r
)
7433 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
7434 return NDR_ERR_SUCCESS
;
7437 static enum ndr_err_code
ndr_pull_netr_TrustType(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_TrustType
*r
)
7440 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
7442 return NDR_ERR_SUCCESS
;
7445 _PUBLIC_
void ndr_print_netr_TrustType(struct ndr_print
*ndr
, const char *name
, enum netr_TrustType r
)
7447 const char *val
= NULL
;
7450 case NETR_TRUST_TYPE_DOWNLEVEL
: val
= "NETR_TRUST_TYPE_DOWNLEVEL"; break;
7451 case NETR_TRUST_TYPE_UPLEVEL
: val
= "NETR_TRUST_TYPE_UPLEVEL"; break;
7452 case NETR_TRUST_TYPE_MIT
: val
= "NETR_TRUST_TYPE_MIT"; break;
7453 case NETR_TRUST_TYPE_DCE
: val
= "NETR_TRUST_TYPE_DCE"; break;
7455 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
7458 static enum ndr_err_code
ndr_push_netr_TrustAttributes(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
7460 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
7461 return NDR_ERR_SUCCESS
;
7464 static enum ndr_err_code
ndr_pull_netr_TrustAttributes(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
7467 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
7469 return NDR_ERR_SUCCESS
;
7472 _PUBLIC_
void ndr_print_netr_TrustAttributes(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
7474 ndr_print_uint32(ndr
, name
, r
);
7476 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE
, r
);
7477 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY
, r
);
7478 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
, r
);
7479 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
, r
);
7480 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
, r
);
7481 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST
, r
);
7482 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
, r
);
7486 static enum ndr_err_code
ndr_push_netr_DomainTrust(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrust
*r
)
7488 if (ndr_flags
& NDR_SCALARS
) {
7489 NDR_CHECK(ndr_push_align(ndr
, 4));
7490 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->netbios_name
));
7491 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dns_name
));
7492 NDR_CHECK(ndr_push_netr_TrustFlags(ndr
, NDR_SCALARS
, r
->trust_flags
));
7493 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->parent_index
));
7494 NDR_CHECK(ndr_push_netr_TrustType(ndr
, NDR_SCALARS
, r
->trust_type
));
7495 NDR_CHECK(ndr_push_netr_TrustAttributes(ndr
, NDR_SCALARS
, r
->trust_attributes
));
7496 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
7497 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
7499 if (ndr_flags
& NDR_BUFFERS
) {
7500 if (r
->netbios_name
) {
7501 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->netbios_name
, CH_UTF16
)));
7502 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7503 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->netbios_name
, CH_UTF16
)));
7504 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->netbios_name
, ndr_charset_length(r
->netbios_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7507 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dns_name
, CH_UTF16
)));
7508 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7509 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dns_name
, CH_UTF16
)));
7510 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dns_name
, ndr_charset_length(r
->dns_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7513 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
7515 NDR_CHECK(ndr_push_GUID(ndr
, NDR_BUFFERS
, &r
->guid
));
7517 return NDR_ERR_SUCCESS
;
7520 static enum ndr_err_code
ndr_pull_netr_DomainTrust(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrust
*r
)
7522 uint32_t _ptr_netbios_name
;
7523 TALLOC_CTX
*_mem_save_netbios_name_0
;
7524 uint32_t _ptr_dns_name
;
7525 TALLOC_CTX
*_mem_save_dns_name_0
;
7527 TALLOC_CTX
*_mem_save_sid_0
;
7528 if (ndr_flags
& NDR_SCALARS
) {
7529 NDR_CHECK(ndr_pull_align(ndr
, 4));
7530 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_netbios_name
));
7531 if (_ptr_netbios_name
) {
7532 NDR_PULL_ALLOC(ndr
, r
->netbios_name
);
7534 r
->netbios_name
= NULL
;
7536 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dns_name
));
7537 if (_ptr_dns_name
) {
7538 NDR_PULL_ALLOC(ndr
, r
->dns_name
);
7542 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr
, NDR_SCALARS
, &r
->trust_flags
));
7543 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->parent_index
));
7544 NDR_CHECK(ndr_pull_netr_TrustType(ndr
, NDR_SCALARS
, &r
->trust_type
));
7545 NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr
, NDR_SCALARS
, &r
->trust_attributes
));
7546 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
7548 NDR_PULL_ALLOC(ndr
, r
->sid
);
7552 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
7554 if (ndr_flags
& NDR_BUFFERS
) {
7555 if (r
->netbios_name
) {
7556 _mem_save_netbios_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7557 NDR_PULL_SET_MEM_CTX(ndr
, r
->netbios_name
, 0);
7558 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->netbios_name
));
7559 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->netbios_name
));
7560 if (ndr_get_array_length(ndr
, &r
->netbios_name
) > ndr_get_array_size(ndr
, &r
->netbios_name
)) {
7561 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->netbios_name
), ndr_get_array_length(ndr
, &r
->netbios_name
));
7563 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->netbios_name
), sizeof(uint16_t)));
7564 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->netbios_name
, ndr_get_array_length(ndr
, &r
->netbios_name
), sizeof(uint16_t), CH_UTF16
));
7565 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_netbios_name_0
, 0);
7568 _mem_save_dns_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7569 NDR_PULL_SET_MEM_CTX(ndr
, r
->dns_name
, 0);
7570 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dns_name
));
7571 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dns_name
));
7572 if (ndr_get_array_length(ndr
, &r
->dns_name
) > ndr_get_array_size(ndr
, &r
->dns_name
)) {
7573 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->dns_name
), ndr_get_array_length(ndr
, &r
->dns_name
));
7575 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dns_name
), sizeof(uint16_t)));
7576 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dns_name
, ndr_get_array_length(ndr
, &r
->dns_name
), sizeof(uint16_t), CH_UTF16
));
7577 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dns_name_0
, 0);
7580 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7581 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
7582 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
7583 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
7585 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_BUFFERS
, &r
->guid
));
7587 return NDR_ERR_SUCCESS
;
7590 _PUBLIC_
void ndr_print_netr_DomainTrust(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrust
*r
)
7592 ndr_print_struct(ndr
, name
, "netr_DomainTrust");
7594 ndr_print_ptr(ndr
, "netbios_name", r
->netbios_name
);
7596 if (r
->netbios_name
) {
7597 ndr_print_string(ndr
, "netbios_name", r
->netbios_name
);
7600 ndr_print_ptr(ndr
, "dns_name", r
->dns_name
);
7603 ndr_print_string(ndr
, "dns_name", r
->dns_name
);
7606 ndr_print_netr_TrustFlags(ndr
, "trust_flags", r
->trust_flags
);
7607 ndr_print_uint32(ndr
, "parent_index", r
->parent_index
);
7608 ndr_print_netr_TrustType(ndr
, "trust_type", r
->trust_type
);
7609 ndr_print_netr_TrustAttributes(ndr
, "trust_attributes", r
->trust_attributes
);
7610 ndr_print_ptr(ndr
, "sid", r
->sid
);
7613 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
7616 ndr_print_GUID(ndr
, "guid", &r
->guid
);
7620 static enum ndr_err_code
ndr_push_netr_DomainTrustList(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrustList
*r
)
7622 uint32_t cntr_array_1
;
7623 if (ndr_flags
& NDR_SCALARS
) {
7624 NDR_CHECK(ndr_push_align(ndr
, 4));
7625 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7626 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->array
));
7628 if (ndr_flags
& NDR_BUFFERS
) {
7630 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7631 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
7632 NDR_CHECK(ndr_push_netr_DomainTrust(ndr
, NDR_SCALARS
, &r
->array
[cntr_array_1
]));
7634 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
7635 NDR_CHECK(ndr_push_netr_DomainTrust(ndr
, NDR_BUFFERS
, &r
->array
[cntr_array_1
]));
7639 return NDR_ERR_SUCCESS
;
7642 static enum ndr_err_code
ndr_pull_netr_DomainTrustList(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrustList
*r
)
7644 uint32_t _ptr_array
;
7645 uint32_t cntr_array_1
;
7646 TALLOC_CTX
*_mem_save_array_0
;
7647 TALLOC_CTX
*_mem_save_array_1
;
7648 if (ndr_flags
& NDR_SCALARS
) {
7649 NDR_CHECK(ndr_pull_align(ndr
, 4));
7650 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
7651 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_array
));
7653 NDR_PULL_ALLOC(ndr
, r
->array
);
7658 if (ndr_flags
& NDR_BUFFERS
) {
7660 _mem_save_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7661 NDR_PULL_SET_MEM_CTX(ndr
, r
->array
, 0);
7662 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->array
));
7663 NDR_PULL_ALLOC_N(ndr
, r
->array
, ndr_get_array_size(ndr
, &r
->array
));
7664 _mem_save_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7665 NDR_PULL_SET_MEM_CTX(ndr
, r
->array
, 0);
7666 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
7667 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr
, NDR_SCALARS
, &r
->array
[cntr_array_1
]));
7669 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
7670 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr
, NDR_BUFFERS
, &r
->array
[cntr_array_1
]));
7672 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_array_1
, 0);
7673 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_array_0
, 0);
7676 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->array
, r
->count
));
7679 return NDR_ERR_SUCCESS
;
7682 _PUBLIC_
void ndr_print_netr_DomainTrustList(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrustList
*r
)
7684 uint32_t cntr_array_1
;
7685 ndr_print_struct(ndr
, name
, "netr_DomainTrustList");
7687 ndr_print_uint32(ndr
, "count", r
->count
);
7688 ndr_print_ptr(ndr
, "array", r
->array
);
7691 ndr
->print(ndr
, "%s: ARRAY(%d)", "array", r
->count
);
7693 for (cntr_array_1
=0;cntr_array_1
<r
->count
;cntr_array_1
++) {
7695 asprintf(&idx_1
, "[%d]", cntr_array_1
);
7697 ndr_print_netr_DomainTrust(ndr
, "array", &r
->array
[cntr_array_1
]);
7707 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddressToSitenamesExWCtr
*r
)
7709 uint32_t cntr_sitename_1
;
7710 uint32_t cntr_subnetname_1
;
7711 if (ndr_flags
& NDR_SCALARS
) {
7712 NDR_CHECK(ndr_push_align(ndr
, 4));
7713 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7714 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sitename
));
7715 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->subnetname
));
7717 if (ndr_flags
& NDR_BUFFERS
) {
7719 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7720 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7721 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
7723 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7724 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
7727 if (r
->subnetname
) {
7728 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
7729 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
7730 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->subnetname
[cntr_subnetname_1
]));
7732 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
7733 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->subnetname
[cntr_subnetname_1
]));
7737 return NDR_ERR_SUCCESS
;
7740 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddressToSitenamesExWCtr
*r
)
7742 uint32_t _ptr_sitename
;
7743 uint32_t cntr_sitename_1
;
7744 TALLOC_CTX
*_mem_save_sitename_0
;
7745 TALLOC_CTX
*_mem_save_sitename_1
;
7746 uint32_t _ptr_subnetname
;
7747 uint32_t cntr_subnetname_1
;
7748 TALLOC_CTX
*_mem_save_subnetname_0
;
7749 TALLOC_CTX
*_mem_save_subnetname_1
;
7750 if (ndr_flags
& NDR_SCALARS
) {
7751 NDR_CHECK(ndr_pull_align(ndr
, 4));
7752 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
7753 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sitename
));
7754 if (_ptr_sitename
) {
7755 NDR_PULL_ALLOC(ndr
, r
->sitename
);
7759 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_subnetname
));
7760 if (_ptr_subnetname
) {
7761 NDR_PULL_ALLOC(ndr
, r
->subnetname
);
7763 r
->subnetname
= NULL
;
7766 if (ndr_flags
& NDR_BUFFERS
) {
7768 _mem_save_sitename_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7769 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
7770 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sitename
));
7771 NDR_PULL_ALLOC_N(ndr
, r
->sitename
, ndr_get_array_size(ndr
, &r
->sitename
));
7772 _mem_save_sitename_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7773 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
7774 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7775 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
7777 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
7778 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
7780 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_1
, 0);
7781 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_0
, 0);
7783 if (r
->subnetname
) {
7784 _mem_save_subnetname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7785 NDR_PULL_SET_MEM_CTX(ndr
, r
->subnetname
, 0);
7786 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->subnetname
));
7787 NDR_PULL_ALLOC_N(ndr
, r
->subnetname
, ndr_get_array_size(ndr
, &r
->subnetname
));
7788 _mem_save_subnetname_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7789 NDR_PULL_SET_MEM_CTX(ndr
, r
->subnetname
, 0);
7790 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
7791 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->subnetname
[cntr_subnetname_1
]));
7793 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
7794 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->subnetname
[cntr_subnetname_1
]));
7796 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_subnetname_1
, 0);
7797 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_subnetname_0
, 0);
7800 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sitename
, r
->count
));
7802 if (r
->subnetname
) {
7803 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->subnetname
, r
->count
));
7806 return NDR_ERR_SUCCESS
;
7809 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddressToSitenamesExWCtr
*r
)
7811 uint32_t cntr_sitename_1
;
7812 uint32_t cntr_subnetname_1
;
7813 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesExWCtr");
7815 ndr_print_uint32(ndr
, "count", r
->count
);
7816 ndr_print_ptr(ndr
, "sitename", r
->sitename
);
7819 ndr
->print(ndr
, "%s: ARRAY(%d)", "sitename", r
->count
);
7821 for (cntr_sitename_1
=0;cntr_sitename_1
<r
->count
;cntr_sitename_1
++) {
7823 asprintf(&idx_1
, "[%d]", cntr_sitename_1
);
7825 ndr_print_lsa_String(ndr
, "sitename", &r
->sitename
[cntr_sitename_1
]);
7832 ndr_print_ptr(ndr
, "subnetname", r
->subnetname
);
7834 if (r
->subnetname
) {
7835 ndr
->print(ndr
, "%s: ARRAY(%d)", "subnetname", r
->count
);
7837 for (cntr_subnetname_1
=0;cntr_subnetname_1
<r
->count
;cntr_subnetname_1
++) {
7839 asprintf(&idx_1
, "[%d]", cntr_subnetname_1
);
7841 ndr_print_lsa_String(ndr
, "subnetname", &r
->subnetname
[cntr_subnetname_1
]);
7851 static enum ndr_err_code
ndr_push_DcSitesCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct DcSitesCtr
*r
)
7853 uint32_t cntr_sites_1
;
7854 if (ndr_flags
& NDR_SCALARS
) {
7855 NDR_CHECK(ndr_push_align(ndr
, 4));
7856 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_sites
));
7857 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sites
));
7859 if (ndr_flags
& NDR_BUFFERS
) {
7861 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_sites
));
7862 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
7863 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sites
[cntr_sites_1
]));
7865 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
7866 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sites
[cntr_sites_1
]));
7870 return NDR_ERR_SUCCESS
;
7873 static enum ndr_err_code
ndr_pull_DcSitesCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct DcSitesCtr
*r
)
7875 uint32_t _ptr_sites
;
7876 uint32_t cntr_sites_1
;
7877 TALLOC_CTX
*_mem_save_sites_0
;
7878 TALLOC_CTX
*_mem_save_sites_1
;
7879 if (ndr_flags
& NDR_SCALARS
) {
7880 NDR_CHECK(ndr_pull_align(ndr
, 4));
7881 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_sites
));
7882 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sites
));
7884 NDR_PULL_ALLOC(ndr
, r
->sites
);
7889 if (ndr_flags
& NDR_BUFFERS
) {
7891 _mem_save_sites_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7892 NDR_PULL_SET_MEM_CTX(ndr
, r
->sites
, 0);
7893 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sites
));
7894 NDR_PULL_ALLOC_N(ndr
, r
->sites
, ndr_get_array_size(ndr
, &r
->sites
));
7895 _mem_save_sites_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7896 NDR_PULL_SET_MEM_CTX(ndr
, r
->sites
, 0);
7897 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
7898 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sites
[cntr_sites_1
]));
7900 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
7901 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sites
[cntr_sites_1
]));
7903 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sites_1
, 0);
7904 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sites_0
, 0);
7907 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sites
, r
->num_sites
));
7910 return NDR_ERR_SUCCESS
;
7913 _PUBLIC_
void ndr_print_DcSitesCtr(struct ndr_print
*ndr
, const char *name
, const struct DcSitesCtr
*r
)
7915 uint32_t cntr_sites_1
;
7916 ndr_print_struct(ndr
, name
, "DcSitesCtr");
7918 ndr_print_uint32(ndr
, "num_sites", r
->num_sites
);
7919 ndr_print_ptr(ndr
, "sites", r
->sites
);
7922 ndr
->print(ndr
, "%s: ARRAY(%d)", "sites", r
->num_sites
);
7924 for (cntr_sites_1
=0;cntr_sites_1
<r
->num_sites
;cntr_sites_1
++) {
7926 asprintf(&idx_1
, "[%d]", cntr_sites_1
);
7928 ndr_print_lsa_String(ndr
, "sites", &r
->sites
[cntr_sites_1
]);
7938 static enum ndr_err_code
ndr_push_netr_LogonUasLogon(struct ndr_push
*ndr
, int flags
, const struct netr_LogonUasLogon
*r
)
7940 if (flags
& NDR_IN
) {
7941 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
7942 if (r
->in
.server_name
) {
7943 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
7944 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7945 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
7946 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7948 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
7949 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7950 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
7951 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7952 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
7953 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7954 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
7955 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.workstation
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7957 if (flags
& NDR_OUT
) {
7958 if (r
->out
.info
== NULL
) {
7959 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
7961 NDR_CHECK(ndr_push_netr_UasInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
7962 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
7964 return NDR_ERR_SUCCESS
;
7967 static enum ndr_err_code
ndr_pull_netr_LogonUasLogon(struct ndr_pull
*ndr
, int flags
, struct netr_LogonUasLogon
*r
)
7969 uint32_t _ptr_server_name
;
7970 TALLOC_CTX
*_mem_save_server_name_0
;
7971 TALLOC_CTX
*_mem_save_info_0
;
7972 if (flags
& NDR_IN
) {
7973 ZERO_STRUCT(r
->out
);
7975 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
7976 if (_ptr_server_name
) {
7977 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
7979 r
->in
.server_name
= NULL
;
7981 if (r
->in
.server_name
) {
7982 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7983 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
7984 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
7985 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
7986 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
7987 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
7989 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
7990 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
7991 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
7993 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
7994 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
7995 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
7996 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
7998 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
7999 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
8000 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.workstation
));
8001 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.workstation
));
8002 if (ndr_get_array_length(ndr
, &r
->in
.workstation
) > ndr_get_array_size(ndr
, &r
->in
.workstation
)) {
8003 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.workstation
), ndr_get_array_length(ndr
, &r
->in
.workstation
));
8005 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t)));
8006 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.workstation
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t), CH_UTF16
));
8007 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
8008 ZERO_STRUCTP(r
->out
.info
);
8010 if (flags
& NDR_OUT
) {
8011 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8012 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
8014 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8015 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
8016 NDR_CHECK(ndr_pull_netr_UasInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
8017 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
8018 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
8020 return NDR_ERR_SUCCESS
;
8023 _PUBLIC_
void ndr_print_netr_LogonUasLogon(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonUasLogon
*r
)
8025 ndr_print_struct(ndr
, name
, "netr_LogonUasLogon");
8027 if (flags
& NDR_SET_VALUES
) {
8028 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8030 if (flags
& NDR_IN
) {
8031 ndr_print_struct(ndr
, "in", "netr_LogonUasLogon");
8033 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8035 if (r
->in
.server_name
) {
8036 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8039 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
8040 ndr_print_string(ndr
, "workstation", r
->in
.workstation
);
8043 if (flags
& NDR_OUT
) {
8044 ndr_print_struct(ndr
, "out", "netr_LogonUasLogon");
8046 ndr_print_ptr(ndr
, "info", r
->out
.info
);
8048 ndr_print_netr_UasInfo(ndr
, "info", r
->out
.info
);
8050 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
8056 static enum ndr_err_code
ndr_push_netr_LogonUasLogoff(struct ndr_push
*ndr
, int flags
, const struct netr_LogonUasLogoff
*r
)
8058 if (flags
& NDR_IN
) {
8059 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8060 if (r
->in
.server_name
) {
8061 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8062 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8063 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8064 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8066 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8067 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8068 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8069 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8070 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
8071 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8072 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
8073 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.workstation
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8075 if (flags
& NDR_OUT
) {
8076 if (r
->out
.info
== NULL
) {
8077 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8079 NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr
, NDR_SCALARS
, r
->out
.info
));
8080 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
8082 return NDR_ERR_SUCCESS
;
8085 static enum ndr_err_code
ndr_pull_netr_LogonUasLogoff(struct ndr_pull
*ndr
, int flags
, struct netr_LogonUasLogoff
*r
)
8087 uint32_t _ptr_server_name
;
8088 TALLOC_CTX
*_mem_save_server_name_0
;
8089 TALLOC_CTX
*_mem_save_info_0
;
8090 if (flags
& NDR_IN
) {
8091 ZERO_STRUCT(r
->out
);
8093 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8094 if (_ptr_server_name
) {
8095 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8097 r
->in
.server_name
= NULL
;
8099 if (r
->in
.server_name
) {
8100 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8101 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8102 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8103 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8104 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8105 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8107 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8108 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8109 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8111 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
8112 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
8113 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
8114 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
8116 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
8117 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
8118 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.workstation
));
8119 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.workstation
));
8120 if (ndr_get_array_length(ndr
, &r
->in
.workstation
) > ndr_get_array_size(ndr
, &r
->in
.workstation
)) {
8121 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.workstation
), ndr_get_array_length(ndr
, &r
->in
.workstation
));
8123 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t)));
8124 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.workstation
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t), CH_UTF16
));
8125 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
8126 ZERO_STRUCTP(r
->out
.info
);
8128 if (flags
& NDR_OUT
) {
8129 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8130 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
8132 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8133 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
8134 NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr
, NDR_SCALARS
, r
->out
.info
));
8135 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
8136 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
8138 return NDR_ERR_SUCCESS
;
8141 _PUBLIC_
void ndr_print_netr_LogonUasLogoff(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonUasLogoff
*r
)
8143 ndr_print_struct(ndr
, name
, "netr_LogonUasLogoff");
8145 if (flags
& NDR_SET_VALUES
) {
8146 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8148 if (flags
& NDR_IN
) {
8149 ndr_print_struct(ndr
, "in", "netr_LogonUasLogoff");
8151 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8153 if (r
->in
.server_name
) {
8154 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8157 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
8158 ndr_print_string(ndr
, "workstation", r
->in
.workstation
);
8161 if (flags
& NDR_OUT
) {
8162 ndr_print_struct(ndr
, "out", "netr_LogonUasLogoff");
8164 ndr_print_ptr(ndr
, "info", r
->out
.info
);
8166 ndr_print_netr_UasLogoffInfo(ndr
, "info", r
->out
.info
);
8168 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
8174 static enum ndr_err_code
ndr_push_netr_LogonSamLogon(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogon
*r
)
8176 if (flags
& NDR_IN
) {
8177 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8178 if (r
->in
.server_name
) {
8179 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8180 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8181 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8182 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8184 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
8185 if (r
->in
.computer_name
) {
8186 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8187 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8188 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8189 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8191 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
8192 if (r
->in
.credential
) {
8193 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
8195 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
8196 if (r
->in
.return_authenticator
) {
8197 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
8199 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
8200 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
8201 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
8202 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
8204 if (flags
& NDR_OUT
) {
8205 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
8206 if (r
->out
.return_authenticator
) {
8207 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8209 if (r
->out
.validation
== NULL
) {
8210 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8212 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
8213 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
8214 if (r
->out
.authoritative
== NULL
) {
8215 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8217 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
8218 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
8220 return NDR_ERR_SUCCESS
;
8223 static enum ndr_err_code
ndr_pull_netr_LogonSamLogon(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogon
*r
)
8225 uint32_t _ptr_server_name
;
8226 uint32_t _ptr_computer_name
;
8227 uint32_t _ptr_credential
;
8228 uint32_t _ptr_return_authenticator
;
8229 TALLOC_CTX
*_mem_save_server_name_0
;
8230 TALLOC_CTX
*_mem_save_computer_name_0
;
8231 TALLOC_CTX
*_mem_save_credential_0
;
8232 TALLOC_CTX
*_mem_save_return_authenticator_0
;
8233 TALLOC_CTX
*_mem_save_validation_0
;
8234 TALLOC_CTX
*_mem_save_authoritative_0
;
8235 if (flags
& NDR_IN
) {
8236 ZERO_STRUCT(r
->out
);
8238 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8239 if (_ptr_server_name
) {
8240 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8242 r
->in
.server_name
= NULL
;
8244 if (r
->in
.server_name
) {
8245 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8246 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8247 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8248 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8249 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8250 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8252 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8253 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8254 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8256 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
8257 if (_ptr_computer_name
) {
8258 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
8260 r
->in
.computer_name
= NULL
;
8262 if (r
->in
.computer_name
) {
8263 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8264 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
8265 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
8266 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
8267 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
8268 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
8270 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
8271 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
8272 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
8274 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
8275 if (_ptr_credential
) {
8276 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
8278 r
->in
.credential
= NULL
;
8280 if (r
->in
.credential
) {
8281 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8282 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
8283 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
8284 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
8286 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
8287 if (_ptr_return_authenticator
) {
8288 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
8290 r
->in
.return_authenticator
= NULL
;
8292 if (r
->in
.return_authenticator
) {
8293 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8294 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
8295 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
8296 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
8298 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
8299 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
8300 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
8301 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
8302 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
8303 ZERO_STRUCTP(r
->out
.validation
);
8304 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
8305 ZERO_STRUCTP(r
->out
.authoritative
);
8307 if (flags
& NDR_OUT
) {
8308 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
8309 if (_ptr_return_authenticator
) {
8310 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
8312 r
->out
.return_authenticator
= NULL
;
8314 if (r
->out
.return_authenticator
) {
8315 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8316 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
8317 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8318 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
8320 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8321 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
8323 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8324 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
8325 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
8326 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
8327 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
8328 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8329 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
8331 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8332 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
8333 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
8334 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
8335 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
8337 return NDR_ERR_SUCCESS
;
8340 _PUBLIC_
void ndr_print_netr_LogonSamLogon(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogon
*r
)
8342 ndr_print_struct(ndr
, name
, "netr_LogonSamLogon");
8344 if (flags
& NDR_SET_VALUES
) {
8345 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8347 if (flags
& NDR_IN
) {
8348 ndr_print_struct(ndr
, "in", "netr_LogonSamLogon");
8350 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8352 if (r
->in
.server_name
) {
8353 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8356 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
8358 if (r
->in
.computer_name
) {
8359 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
8362 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
8364 if (r
->in
.credential
) {
8365 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
8368 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
8370 if (r
->in
.return_authenticator
) {
8371 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
8374 ndr_print_uint16(ndr
, "logon_level", r
->in
.logon_level
);
8375 ndr_print_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
);
8376 ndr_print_netr_LogonLevel(ndr
, "logon", &r
->in
.logon
);
8377 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
8380 if (flags
& NDR_OUT
) {
8381 ndr_print_struct(ndr
, "out", "netr_LogonSamLogon");
8383 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8385 if (r
->out
.return_authenticator
) {
8386 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8389 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
8391 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
8392 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
8394 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
8396 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
8398 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
8404 static enum ndr_err_code
ndr_push_netr_LogonSamLogoff(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogoff
*r
)
8406 if (flags
& NDR_IN
) {
8407 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8408 if (r
->in
.server_name
) {
8409 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8410 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8411 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8412 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8414 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
8415 if (r
->in
.computer_name
) {
8416 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8417 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8418 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8419 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8421 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
8422 if (r
->in
.credential
) {
8423 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
8425 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
8426 if (r
->in
.return_authenticator
) {
8427 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
8429 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
8430 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
8431 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
8433 if (flags
& NDR_OUT
) {
8434 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
8435 if (r
->out
.return_authenticator
) {
8436 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8438 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
8440 return NDR_ERR_SUCCESS
;
8443 static enum ndr_err_code
ndr_pull_netr_LogonSamLogoff(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogoff
*r
)
8445 uint32_t _ptr_server_name
;
8446 uint32_t _ptr_computer_name
;
8447 uint32_t _ptr_credential
;
8448 uint32_t _ptr_return_authenticator
;
8449 TALLOC_CTX
*_mem_save_server_name_0
;
8450 TALLOC_CTX
*_mem_save_computer_name_0
;
8451 TALLOC_CTX
*_mem_save_credential_0
;
8452 TALLOC_CTX
*_mem_save_return_authenticator_0
;
8453 if (flags
& NDR_IN
) {
8454 ZERO_STRUCT(r
->out
);
8456 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8457 if (_ptr_server_name
) {
8458 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8460 r
->in
.server_name
= NULL
;
8462 if (r
->in
.server_name
) {
8463 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8464 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8465 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8466 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8467 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8468 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8470 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8471 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8472 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8474 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
8475 if (_ptr_computer_name
) {
8476 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
8478 r
->in
.computer_name
= NULL
;
8480 if (r
->in
.computer_name
) {
8481 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8482 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
8483 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
8484 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
8485 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
8486 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
8488 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
8489 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
8490 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
8492 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
8493 if (_ptr_credential
) {
8494 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
8496 r
->in
.credential
= NULL
;
8498 if (r
->in
.credential
) {
8499 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8500 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
8501 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
8502 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
8504 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
8505 if (_ptr_return_authenticator
) {
8506 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
8508 r
->in
.return_authenticator
= NULL
;
8510 if (r
->in
.return_authenticator
) {
8511 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8512 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
8513 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
8514 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
8516 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
8517 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
8518 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
8520 if (flags
& NDR_OUT
) {
8521 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
8522 if (_ptr_return_authenticator
) {
8523 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
8525 r
->out
.return_authenticator
= NULL
;
8527 if (r
->out
.return_authenticator
) {
8528 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8529 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
8530 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8531 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
8533 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
8535 return NDR_ERR_SUCCESS
;
8538 _PUBLIC_
void ndr_print_netr_LogonSamLogoff(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogoff
*r
)
8540 ndr_print_struct(ndr
, name
, "netr_LogonSamLogoff");
8542 if (flags
& NDR_SET_VALUES
) {
8543 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8545 if (flags
& NDR_IN
) {
8546 ndr_print_struct(ndr
, "in", "netr_LogonSamLogoff");
8548 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8550 if (r
->in
.server_name
) {
8551 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8554 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
8556 if (r
->in
.computer_name
) {
8557 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
8560 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
8562 if (r
->in
.credential
) {
8563 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
8566 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
8568 if (r
->in
.return_authenticator
) {
8569 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
8572 ndr_print_uint16(ndr
, "logon_level", r
->in
.logon_level
);
8573 ndr_print_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
);
8574 ndr_print_netr_LogonLevel(ndr
, "logon", &r
->in
.logon
);
8577 if (flags
& NDR_OUT
) {
8578 ndr_print_struct(ndr
, "out", "netr_LogonSamLogoff");
8580 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8582 if (r
->out
.return_authenticator
) {
8583 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8586 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
8592 static enum ndr_err_code
ndr_push_netr_ServerReqChallenge(struct ndr_push
*ndr
, int flags
, const struct netr_ServerReqChallenge
*r
)
8594 if (flags
& NDR_IN
) {
8595 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8596 if (r
->in
.server_name
) {
8597 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8598 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8599 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8600 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8602 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8603 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8604 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8605 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8606 if (r
->in
.credentials
== NULL
) {
8607 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8609 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
8611 if (flags
& NDR_OUT
) {
8612 if (r
->out
.credentials
== NULL
) {
8613 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8615 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
8616 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
8618 return NDR_ERR_SUCCESS
;
8621 static enum ndr_err_code
ndr_pull_netr_ServerReqChallenge(struct ndr_pull
*ndr
, int flags
, struct netr_ServerReqChallenge
*r
)
8623 uint32_t _ptr_server_name
;
8624 TALLOC_CTX
*_mem_save_server_name_0
;
8625 TALLOC_CTX
*_mem_save_credentials_0
;
8626 if (flags
& NDR_IN
) {
8627 ZERO_STRUCT(r
->out
);
8629 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8630 if (_ptr_server_name
) {
8631 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8633 r
->in
.server_name
= NULL
;
8635 if (r
->in
.server_name
) {
8636 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8637 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8638 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8639 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8640 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8641 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8643 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8644 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8645 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8647 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
8648 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
8649 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
8650 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
8652 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
8653 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
8654 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8655 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
8657 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8658 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
8659 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
8660 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
8661 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
8662 *r
->out
.credentials
= *r
->in
.credentials
;
8664 if (flags
& NDR_OUT
) {
8665 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8666 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
8668 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8669 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
8670 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
8671 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
8672 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
8674 return NDR_ERR_SUCCESS
;
8677 _PUBLIC_
void ndr_print_netr_ServerReqChallenge(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerReqChallenge
*r
)
8679 ndr_print_struct(ndr
, name
, "netr_ServerReqChallenge");
8681 if (flags
& NDR_SET_VALUES
) {
8682 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8684 if (flags
& NDR_IN
) {
8685 ndr_print_struct(ndr
, "in", "netr_ServerReqChallenge");
8687 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8689 if (r
->in
.server_name
) {
8690 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8693 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
8694 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
8696 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
8700 if (flags
& NDR_OUT
) {
8701 ndr_print_struct(ndr
, "out", "netr_ServerReqChallenge");
8703 ndr_print_ptr(ndr
, "credentials", r
->out
.credentials
);
8705 ndr_print_netr_Credential(ndr
, "credentials", r
->out
.credentials
);
8707 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
8713 static enum ndr_err_code
ndr_push_netr_ServerAuthenticate(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate
*r
)
8715 if (flags
& NDR_IN
) {
8716 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8717 if (r
->in
.server_name
) {
8718 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8719 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8720 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8721 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8723 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8724 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8725 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8726 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8727 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
8728 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8729 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8730 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8731 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8732 if (r
->in
.credentials
== NULL
) {
8733 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8735 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
8737 if (flags
& NDR_OUT
) {
8738 if (r
->out
.credentials
== NULL
) {
8739 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8741 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
8742 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
8744 return NDR_ERR_SUCCESS
;
8747 static enum ndr_err_code
ndr_pull_netr_ServerAuthenticate(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate
*r
)
8749 uint32_t _ptr_server_name
;
8750 TALLOC_CTX
*_mem_save_server_name_0
;
8751 TALLOC_CTX
*_mem_save_credentials_0
;
8752 if (flags
& NDR_IN
) {
8753 ZERO_STRUCT(r
->out
);
8755 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8756 if (_ptr_server_name
) {
8757 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8759 r
->in
.server_name
= NULL
;
8761 if (r
->in
.server_name
) {
8762 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8763 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8764 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8765 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8766 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8767 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8769 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8770 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8771 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8773 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
8774 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
8775 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
8776 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
8778 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
8779 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
8780 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
8781 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
8782 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
8783 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
8784 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
8786 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
8787 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
8788 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8789 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
8791 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8792 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
8793 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
8794 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
8795 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
8796 *r
->out
.credentials
= *r
->in
.credentials
;
8798 if (flags
& NDR_OUT
) {
8799 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8800 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
8802 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8803 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
8804 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
8805 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
8806 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
8808 return NDR_ERR_SUCCESS
;
8811 _PUBLIC_
void ndr_print_netr_ServerAuthenticate(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate
*r
)
8813 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate");
8815 if (flags
& NDR_SET_VALUES
) {
8816 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8818 if (flags
& NDR_IN
) {
8819 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate");
8821 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8823 if (r
->in
.server_name
) {
8824 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8827 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
8828 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
8829 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
8830 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
8832 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
8836 if (flags
& NDR_OUT
) {
8837 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate");
8839 ndr_print_ptr(ndr
, "credentials", r
->out
.credentials
);
8841 ndr_print_netr_Credential(ndr
, "credentials", r
->out
.credentials
);
8843 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
8849 static enum ndr_err_code
ndr_push_netr_ServerPasswordSet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordSet
*r
)
8851 if (flags
& NDR_IN
) {
8852 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
8853 if (r
->in
.server_name
) {
8854 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8855 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8856 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
8857 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8859 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8860 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8861 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
8862 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8863 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
8864 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8865 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8866 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
8867 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8868 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
8869 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.new_password
));
8871 if (flags
& NDR_OUT
) {
8872 if (r
->out
.return_authenticator
== NULL
) {
8873 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8875 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8876 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
8878 return NDR_ERR_SUCCESS
;
8881 static enum ndr_err_code
ndr_pull_netr_ServerPasswordSet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordSet
*r
)
8883 uint32_t _ptr_server_name
;
8884 TALLOC_CTX
*_mem_save_server_name_0
;
8885 TALLOC_CTX
*_mem_save_return_authenticator_0
;
8886 if (flags
& NDR_IN
) {
8887 ZERO_STRUCT(r
->out
);
8889 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
8890 if (_ptr_server_name
) {
8891 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
8893 r
->in
.server_name
= NULL
;
8895 if (r
->in
.server_name
) {
8896 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8897 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
8898 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
8899 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
8900 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
8901 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
8903 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
8904 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
8905 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
8907 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
8908 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
8909 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
8910 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
8912 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
8913 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
8914 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
8915 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
8916 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
8917 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
8918 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
8920 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
8921 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
8922 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
8923 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.new_password
));
8924 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
8925 ZERO_STRUCTP(r
->out
.return_authenticator
);
8927 if (flags
& NDR_OUT
) {
8928 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
8929 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
8931 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8932 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
8933 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
8934 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
8935 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
8937 return NDR_ERR_SUCCESS
;
8940 _PUBLIC_
void ndr_print_netr_ServerPasswordSet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordSet
*r
)
8942 ndr_print_struct(ndr
, name
, "netr_ServerPasswordSet");
8944 if (flags
& NDR_SET_VALUES
) {
8945 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
8947 if (flags
& NDR_IN
) {
8948 ndr_print_struct(ndr
, "in", "netr_ServerPasswordSet");
8950 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
8952 if (r
->in
.server_name
) {
8953 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
8956 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
8957 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
8958 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
8959 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
8960 ndr_print_samr_Password(ndr
, "new_password", &r
->in
.new_password
);
8963 if (flags
& NDR_OUT
) {
8964 ndr_print_struct(ndr
, "out", "netr_ServerPasswordSet");
8966 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8968 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
8970 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
8976 static enum ndr_err_code
ndr_push_netr_DatabaseDeltas(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseDeltas
*r
)
8978 if (flags
& NDR_IN
) {
8979 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
8980 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8981 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
8982 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8983 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
8984 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8985 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
8986 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8987 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
8988 if (r
->in
.return_authenticator
== NULL
) {
8989 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8991 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
8992 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
8993 if (r
->in
.sequence_num
== NULL
) {
8994 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
8996 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->in
.sequence_num
));
8997 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
8999 if (flags
& NDR_OUT
) {
9000 if (r
->out
.return_authenticator
== NULL
) {
9001 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9003 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9004 if (r
->out
.sequence_num
== NULL
) {
9005 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9007 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->out
.sequence_num
));
9008 if (r
->out
.delta_enum_array
== NULL
) {
9009 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9011 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
9012 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9014 return NDR_ERR_SUCCESS
;
9017 static enum ndr_err_code
ndr_pull_netr_DatabaseDeltas(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseDeltas
*r
)
9019 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9020 TALLOC_CTX
*_mem_save_sequence_num_0
;
9021 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
9022 if (flags
& NDR_IN
) {
9023 ZERO_STRUCT(r
->out
);
9025 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9026 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9027 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9028 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9030 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9031 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9032 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
9033 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
9034 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
9035 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
9037 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
9038 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
9039 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9040 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9041 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9043 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9044 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9045 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9046 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9047 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
9048 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9049 NDR_PULL_ALLOC(ndr
, r
->in
.sequence_num
);
9051 _mem_save_sequence_num_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9052 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sequence_num
, LIBNDR_FLAG_REF_ALLOC
);
9053 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->in
.sequence_num
));
9054 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sequence_num_0
, LIBNDR_FLAG_REF_ALLOC
);
9055 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
9056 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9057 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
9058 NDR_PULL_ALLOC(ndr
, r
->out
.sequence_num
);
9059 *r
->out
.sequence_num
= *r
->in
.sequence_num
;
9060 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
9061 ZERO_STRUCTP(r
->out
.delta_enum_array
);
9063 if (flags
& NDR_OUT
) {
9064 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9065 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9067 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9068 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9069 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9070 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9071 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9072 NDR_PULL_ALLOC(ndr
, r
->out
.sequence_num
);
9074 _mem_save_sequence_num_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9075 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sequence_num
, LIBNDR_FLAG_REF_ALLOC
);
9076 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->out
.sequence_num
));
9077 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sequence_num_0
, LIBNDR_FLAG_REF_ALLOC
);
9078 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9079 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
9081 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9082 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
9083 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
9084 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
9085 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9087 return NDR_ERR_SUCCESS
;
9090 _PUBLIC_
void ndr_print_netr_DatabaseDeltas(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseDeltas
*r
)
9092 ndr_print_struct(ndr
, name
, "netr_DatabaseDeltas");
9094 if (flags
& NDR_SET_VALUES
) {
9095 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9097 if (flags
& NDR_IN
) {
9098 ndr_print_struct(ndr
, "in", "netr_DatabaseDeltas");
9100 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9101 ndr_print_string(ndr
, "computername", r
->in
.computername
);
9102 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
9103 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9105 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9107 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
9108 ndr_print_ptr(ndr
, "sequence_num", r
->in
.sequence_num
);
9110 ndr_print_udlong(ndr
, "sequence_num", *r
->in
.sequence_num
);
9112 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
9115 if (flags
& NDR_OUT
) {
9116 ndr_print_struct(ndr
, "out", "netr_DatabaseDeltas");
9118 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9120 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9122 ndr_print_ptr(ndr
, "sequence_num", r
->out
.sequence_num
);
9124 ndr_print_udlong(ndr
, "sequence_num", *r
->out
.sequence_num
);
9126 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
9128 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
9130 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9136 static enum ndr_err_code
ndr_push_netr_DatabaseSync(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseSync
*r
)
9138 if (flags
& NDR_IN
) {
9139 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9140 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9141 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9142 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9143 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9144 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9145 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9146 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9147 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9148 if (r
->in
.return_authenticator
== NULL
) {
9149 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9151 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9152 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
9153 if (r
->in
.sync_context
== NULL
) {
9154 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9156 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.sync_context
));
9157 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
9159 if (flags
& NDR_OUT
) {
9160 if (r
->out
.return_authenticator
== NULL
) {
9161 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9163 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9164 if (r
->out
.sync_context
== NULL
) {
9165 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9167 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.sync_context
));
9168 if (r
->out
.delta_enum_array
== NULL
) {
9169 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9171 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
9172 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9174 return NDR_ERR_SUCCESS
;
9177 static enum ndr_err_code
ndr_pull_netr_DatabaseSync(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseSync
*r
)
9179 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9180 TALLOC_CTX
*_mem_save_sync_context_0
;
9181 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
9182 if (flags
& NDR_IN
) {
9183 ZERO_STRUCT(r
->out
);
9185 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9186 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9187 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9188 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9190 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9191 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9192 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
9193 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
9194 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
9195 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
9197 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
9198 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
9199 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9200 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9201 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9203 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9204 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9205 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9206 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9207 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
9208 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9209 NDR_PULL_ALLOC(ndr
, r
->in
.sync_context
);
9211 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9212 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
9213 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.sync_context
));
9214 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
9215 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
9216 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9217 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
9218 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
9219 *r
->out
.sync_context
= *r
->in
.sync_context
;
9220 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
9221 ZERO_STRUCTP(r
->out
.delta_enum_array
);
9223 if (flags
& NDR_OUT
) {
9224 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9225 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9227 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9228 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9229 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9230 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9231 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9232 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
9234 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9235 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
9236 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.sync_context
));
9237 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
9238 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9239 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
9241 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9242 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
9243 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
9244 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
9245 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9247 return NDR_ERR_SUCCESS
;
9250 _PUBLIC_
void ndr_print_netr_DatabaseSync(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseSync
*r
)
9252 ndr_print_struct(ndr
, name
, "netr_DatabaseSync");
9254 if (flags
& NDR_SET_VALUES
) {
9255 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9257 if (flags
& NDR_IN
) {
9258 ndr_print_struct(ndr
, "in", "netr_DatabaseSync");
9260 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9261 ndr_print_string(ndr
, "computername", r
->in
.computername
);
9262 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
9263 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9265 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9267 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
9268 ndr_print_ptr(ndr
, "sync_context", r
->in
.sync_context
);
9270 ndr_print_uint32(ndr
, "sync_context", *r
->in
.sync_context
);
9272 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
9275 if (flags
& NDR_OUT
) {
9276 ndr_print_struct(ndr
, "out", "netr_DatabaseSync");
9278 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9280 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9282 ndr_print_ptr(ndr
, "sync_context", r
->out
.sync_context
);
9284 ndr_print_uint32(ndr
, "sync_context", *r
->out
.sync_context
);
9286 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
9288 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
9290 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9296 static enum ndr_err_code
ndr_push_netr_AccountDeltas(struct ndr_push
*ndr
, int flags
, const struct netr_AccountDeltas
*r
)
9298 if (flags
& NDR_IN
) {
9299 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
9300 if (r
->in
.logon_server
) {
9301 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9302 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9303 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9304 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9306 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9307 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9308 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9309 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9310 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9311 if (r
->in
.return_authenticator
== NULL
) {
9312 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9314 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9315 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, &r
->in
.uas
));
9316 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
9317 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
9318 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.buffersize
));
9320 if (flags
& NDR_OUT
) {
9321 if (r
->out
.return_authenticator
== NULL
) {
9322 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9324 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9325 if (r
->out
.buffer
== NULL
) {
9326 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9329 struct ndr_push
*_ndr_buffer
;
9330 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
9331 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
9332 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
9334 if (r
->out
.count_returned
== NULL
) {
9335 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9337 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.count_returned
));
9338 if (r
->out
.total_entries
== NULL
) {
9339 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9341 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.total_entries
));
9342 if (r
->out
.recordid
== NULL
) {
9343 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9345 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
9346 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9348 return NDR_ERR_SUCCESS
;
9351 static enum ndr_err_code
ndr_pull_netr_AccountDeltas(struct ndr_pull
*ndr
, int flags
, struct netr_AccountDeltas
*r
)
9353 uint32_t _ptr_logon_server
;
9354 TALLOC_CTX
*_mem_save_logon_server_0
;
9355 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9356 TALLOC_CTX
*_mem_save_buffer_0
;
9357 TALLOC_CTX
*_mem_save_count_returned_0
;
9358 TALLOC_CTX
*_mem_save_total_entries_0
;
9359 TALLOC_CTX
*_mem_save_recordid_0
;
9360 if (flags
& NDR_IN
) {
9361 ZERO_STRUCT(r
->out
);
9363 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
9364 if (_ptr_logon_server
) {
9365 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
9367 r
->in
.logon_server
= NULL
;
9369 if (r
->in
.logon_server
) {
9370 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9371 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
9372 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9373 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9374 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9375 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9377 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9378 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9379 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
9381 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
9382 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
9383 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
9384 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
9386 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
9387 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
9388 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9389 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9390 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9392 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9393 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9394 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9395 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9396 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, &r
->in
.uas
));
9397 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
9398 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
9399 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.buffersize
));
9400 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9401 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
9402 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
9403 ZERO_STRUCTP(r
->out
.buffer
);
9404 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
9405 ZERO_STRUCTP(r
->out
.count_returned
);
9406 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
9407 ZERO_STRUCTP(r
->out
.total_entries
);
9408 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
9409 ZERO_STRUCTP(r
->out
.recordid
);
9411 if (flags
& NDR_OUT
) {
9412 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9413 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9415 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9416 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9417 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9418 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9419 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9420 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
9422 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9423 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.buffer
, LIBNDR_FLAG_REF_ALLOC
);
9425 struct ndr_pull
*_ndr_buffer
;
9426 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
9427 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
9428 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
9430 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, LIBNDR_FLAG_REF_ALLOC
);
9431 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9432 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
9434 _mem_save_count_returned_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9435 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.count_returned
, LIBNDR_FLAG_REF_ALLOC
);
9436 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.count_returned
));
9437 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_count_returned_0
, LIBNDR_FLAG_REF_ALLOC
);
9438 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9439 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
9441 _mem_save_total_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9442 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.total_entries
, LIBNDR_FLAG_REF_ALLOC
);
9443 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.total_entries
));
9444 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_total_entries_0
, LIBNDR_FLAG_REF_ALLOC
);
9445 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9446 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
9448 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9449 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
9450 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
9451 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
9452 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9454 return NDR_ERR_SUCCESS
;
9457 _PUBLIC_
void ndr_print_netr_AccountDeltas(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_AccountDeltas
*r
)
9459 ndr_print_struct(ndr
, name
, "netr_AccountDeltas");
9461 if (flags
& NDR_SET_VALUES
) {
9462 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9464 if (flags
& NDR_IN
) {
9465 ndr_print_struct(ndr
, "in", "netr_AccountDeltas");
9467 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
9469 if (r
->in
.logon_server
) {
9470 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9473 ndr_print_string(ndr
, "computername", r
->in
.computername
);
9474 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
9475 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9477 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9479 ndr_print_netr_UAS_INFO_0(ndr
, "uas", &r
->in
.uas
);
9480 ndr_print_uint32(ndr
, "count", r
->in
.count
);
9481 ndr_print_uint32(ndr
, "level", r
->in
.level
);
9482 ndr_print_uint32(ndr
, "buffersize", r
->in
.buffersize
);
9485 if (flags
& NDR_OUT
) {
9486 ndr_print_struct(ndr
, "out", "netr_AccountDeltas");
9488 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9490 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9492 ndr_print_ptr(ndr
, "buffer", r
->out
.buffer
);
9494 ndr_print_netr_AccountBuffer(ndr
, "buffer", r
->out
.buffer
);
9496 ndr_print_ptr(ndr
, "count_returned", r
->out
.count_returned
);
9498 ndr_print_uint32(ndr
, "count_returned", *r
->out
.count_returned
);
9500 ndr_print_ptr(ndr
, "total_entries", r
->out
.total_entries
);
9502 ndr_print_uint32(ndr
, "total_entries", *r
->out
.total_entries
);
9504 ndr_print_ptr(ndr
, "recordid", r
->out
.recordid
);
9506 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->out
.recordid
);
9508 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9514 static enum ndr_err_code
ndr_push_netr_AccountSync(struct ndr_push
*ndr
, int flags
, const struct netr_AccountSync
*r
)
9516 if (flags
& NDR_IN
) {
9517 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
9518 if (r
->in
.logon_server
) {
9519 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9520 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9521 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9522 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9524 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9525 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9526 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
9527 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9528 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9529 if (r
->in
.return_authenticator
== NULL
) {
9530 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9532 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9533 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.reference
));
9534 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
9535 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.buffersize
));
9536 if (r
->in
.recordid
== NULL
) {
9537 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9539 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->in
.recordid
));
9541 if (flags
& NDR_OUT
) {
9542 if (r
->out
.return_authenticator
== NULL
) {
9543 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9545 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9546 if (r
->out
.buffer
== NULL
) {
9547 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9550 struct ndr_push
*_ndr_buffer
;
9551 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
9552 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
9553 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
9555 if (r
->out
.count_returned
== NULL
) {
9556 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9558 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.count_returned
));
9559 if (r
->out
.total_entries
== NULL
) {
9560 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9562 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.total_entries
));
9563 if (r
->out
.next_reference
== NULL
) {
9564 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9566 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.next_reference
));
9567 if (r
->out
.recordid
== NULL
) {
9568 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9570 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
9571 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9573 return NDR_ERR_SUCCESS
;
9576 static enum ndr_err_code
ndr_pull_netr_AccountSync(struct ndr_pull
*ndr
, int flags
, struct netr_AccountSync
*r
)
9578 uint32_t _ptr_logon_server
;
9579 TALLOC_CTX
*_mem_save_logon_server_0
;
9580 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9581 TALLOC_CTX
*_mem_save_buffer_0
;
9582 TALLOC_CTX
*_mem_save_count_returned_0
;
9583 TALLOC_CTX
*_mem_save_total_entries_0
;
9584 TALLOC_CTX
*_mem_save_next_reference_0
;
9585 TALLOC_CTX
*_mem_save_recordid_0
;
9586 if (flags
& NDR_IN
) {
9587 ZERO_STRUCT(r
->out
);
9589 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
9590 if (_ptr_logon_server
) {
9591 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
9593 r
->in
.logon_server
= NULL
;
9595 if (r
->in
.logon_server
) {
9596 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9597 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
9598 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9599 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9600 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9601 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9603 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9604 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9605 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
9607 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
9608 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
9609 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
9610 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
9612 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
9613 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
9614 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
9615 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9616 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9618 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9619 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9620 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9621 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9622 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.reference
));
9623 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
9624 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.buffersize
));
9625 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9626 NDR_PULL_ALLOC(ndr
, r
->in
.recordid
);
9628 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9629 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
9630 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->in
.recordid
));
9631 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
9632 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9633 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
9634 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
9635 ZERO_STRUCTP(r
->out
.buffer
);
9636 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
9637 ZERO_STRUCTP(r
->out
.count_returned
);
9638 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
9639 ZERO_STRUCTP(r
->out
.total_entries
);
9640 NDR_PULL_ALLOC(ndr
, r
->out
.next_reference
);
9641 ZERO_STRUCTP(r
->out
.next_reference
);
9642 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
9643 *r
->out
.recordid
= *r
->in
.recordid
;
9645 if (flags
& NDR_OUT
) {
9646 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9647 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9649 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9650 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
9651 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9652 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
9653 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9654 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
9656 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9657 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.buffer
, LIBNDR_FLAG_REF_ALLOC
);
9659 struct ndr_pull
*_ndr_buffer
;
9660 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
9661 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
9662 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
9664 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, LIBNDR_FLAG_REF_ALLOC
);
9665 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9666 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
9668 _mem_save_count_returned_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9669 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.count_returned
, LIBNDR_FLAG_REF_ALLOC
);
9670 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.count_returned
));
9671 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_count_returned_0
, LIBNDR_FLAG_REF_ALLOC
);
9672 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9673 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
9675 _mem_save_total_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9676 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.total_entries
, LIBNDR_FLAG_REF_ALLOC
);
9677 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.total_entries
));
9678 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_total_entries_0
, LIBNDR_FLAG_REF_ALLOC
);
9679 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9680 NDR_PULL_ALLOC(ndr
, r
->out
.next_reference
);
9682 _mem_save_next_reference_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9683 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.next_reference
, LIBNDR_FLAG_REF_ALLOC
);
9684 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.next_reference
));
9685 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_next_reference_0
, LIBNDR_FLAG_REF_ALLOC
);
9686 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9687 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
9689 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9690 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
9691 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
9692 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
9693 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9695 return NDR_ERR_SUCCESS
;
9698 _PUBLIC_
void ndr_print_netr_AccountSync(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_AccountSync
*r
)
9700 ndr_print_struct(ndr
, name
, "netr_AccountSync");
9702 if (flags
& NDR_SET_VALUES
) {
9703 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9705 if (flags
& NDR_IN
) {
9706 ndr_print_struct(ndr
, "in", "netr_AccountSync");
9708 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
9710 if (r
->in
.logon_server
) {
9711 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9714 ndr_print_string(ndr
, "computername", r
->in
.computername
);
9715 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
9716 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9718 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9720 ndr_print_uint32(ndr
, "reference", r
->in
.reference
);
9721 ndr_print_uint32(ndr
, "level", r
->in
.level
);
9722 ndr_print_uint32(ndr
, "buffersize", r
->in
.buffersize
);
9723 ndr_print_ptr(ndr
, "recordid", r
->in
.recordid
);
9725 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->in
.recordid
);
9729 if (flags
& NDR_OUT
) {
9730 ndr_print_struct(ndr
, "out", "netr_AccountSync");
9732 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9734 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9736 ndr_print_ptr(ndr
, "buffer", r
->out
.buffer
);
9738 ndr_print_netr_AccountBuffer(ndr
, "buffer", r
->out
.buffer
);
9740 ndr_print_ptr(ndr
, "count_returned", r
->out
.count_returned
);
9742 ndr_print_uint32(ndr
, "count_returned", *r
->out
.count_returned
);
9744 ndr_print_ptr(ndr
, "total_entries", r
->out
.total_entries
);
9746 ndr_print_uint32(ndr
, "total_entries", *r
->out
.total_entries
);
9748 ndr_print_ptr(ndr
, "next_reference", r
->out
.next_reference
);
9750 ndr_print_uint32(ndr
, "next_reference", *r
->out
.next_reference
);
9752 ndr_print_ptr(ndr
, "recordid", r
->out
.recordid
);
9754 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->out
.recordid
);
9756 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9762 static enum ndr_err_code
ndr_push_netr_GetDcName(struct ndr_push
*ndr
, int flags
, const struct netr_GetDcName
*r
)
9764 if (flags
& NDR_IN
) {
9765 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9766 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9767 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9768 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9769 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domainname
));
9770 if (r
->in
.domainname
) {
9771 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
9772 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9773 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
9774 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domainname
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9777 if (flags
& NDR_OUT
) {
9778 if (r
->out
.dcname
== NULL
) {
9779 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9781 if (*r
->out
.dcname
== NULL
) {
9782 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9784 NDR_CHECK(ndr_push_ref_ptr(ndr
));
9785 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
9786 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9787 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
9788 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.dcname
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9789 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9791 return NDR_ERR_SUCCESS
;
9794 static enum ndr_err_code
ndr_pull_netr_GetDcName(struct ndr_pull
*ndr
, int flags
, struct netr_GetDcName
*r
)
9796 uint32_t _ptr_domainname
;
9797 uint32_t _ptr_dcname
;
9798 TALLOC_CTX
*_mem_save_domainname_0
;
9799 TALLOC_CTX
*_mem_save_dcname_0
;
9800 if (flags
& NDR_IN
) {
9801 ZERO_STRUCT(r
->out
);
9803 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9804 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9805 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9806 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9808 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9809 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9810 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domainname
));
9811 if (_ptr_domainname
) {
9812 NDR_PULL_ALLOC(ndr
, r
->in
.domainname
);
9814 r
->in
.domainname
= NULL
;
9816 if (r
->in
.domainname
) {
9817 _mem_save_domainname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9818 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domainname
, 0);
9819 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domainname
));
9820 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domainname
));
9821 if (ndr_get_array_length(ndr
, &r
->in
.domainname
) > ndr_get_array_size(ndr
, &r
->in
.domainname
)) {
9822 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.domainname
), ndr_get_array_length(ndr
, &r
->in
.domainname
));
9824 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t)));
9825 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domainname
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t), CH_UTF16
));
9826 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domainname_0
, 0);
9828 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
9829 ZERO_STRUCTP(r
->out
.dcname
);
9831 if (flags
& NDR_OUT
) {
9832 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9833 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
9835 _mem_save_dcname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9836 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dcname
, LIBNDR_FLAG_REF_ALLOC
);
9837 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_dcname
));
9838 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.dcname
));
9839 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.dcname
));
9840 if (ndr_get_array_length(ndr
, r
->out
.dcname
) > ndr_get_array_size(ndr
, r
->out
.dcname
)) {
9841 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, r
->out
.dcname
), ndr_get_array_length(ndr
, r
->out
.dcname
));
9843 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t)));
9844 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.dcname
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t), CH_UTF16
));
9845 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_0
, LIBNDR_FLAG_REF_ALLOC
);
9846 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9848 return NDR_ERR_SUCCESS
;
9851 _PUBLIC_
void ndr_print_netr_GetDcName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetDcName
*r
)
9853 ndr_print_struct(ndr
, name
, "netr_GetDcName");
9855 if (flags
& NDR_SET_VALUES
) {
9856 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9858 if (flags
& NDR_IN
) {
9859 ndr_print_struct(ndr
, "in", "netr_GetDcName");
9861 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9862 ndr_print_ptr(ndr
, "domainname", r
->in
.domainname
);
9864 if (r
->in
.domainname
) {
9865 ndr_print_string(ndr
, "domainname", r
->in
.domainname
);
9870 if (flags
& NDR_OUT
) {
9871 ndr_print_struct(ndr
, "out", "netr_GetDcName");
9873 ndr_print_ptr(ndr
, "dcname", r
->out
.dcname
);
9875 ndr_print_ptr(ndr
, "dcname", *r
->out
.dcname
);
9877 ndr_print_string(ndr
, "dcname", *r
->out
.dcname
);
9880 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9886 static enum ndr_err_code
ndr_push_netr_LogonControl(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl
*r
)
9888 if (flags
& NDR_IN
) {
9889 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
9890 if (r
->in
.logon_server
) {
9891 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9892 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9893 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9894 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9896 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr
, NDR_SCALARS
, r
->in
.function_code
));
9897 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
9899 if (flags
& NDR_OUT
) {
9900 if (r
->out
.info
== NULL
) {
9901 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9903 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
9904 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
9905 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
9907 return NDR_ERR_SUCCESS
;
9910 static enum ndr_err_code
ndr_pull_netr_LogonControl(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl
*r
)
9912 uint32_t _ptr_logon_server
;
9913 TALLOC_CTX
*_mem_save_logon_server_0
;
9914 TALLOC_CTX
*_mem_save_info_0
;
9915 if (flags
& NDR_IN
) {
9916 ZERO_STRUCT(r
->out
);
9918 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
9919 if (_ptr_logon_server
) {
9920 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
9922 r
->in
.logon_server
= NULL
;
9924 if (r
->in
.logon_server
) {
9925 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9926 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
9927 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
9928 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
9929 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
9930 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
9932 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
9933 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
9934 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
9936 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
9937 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
9938 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9939 ZERO_STRUCTP(r
->out
.info
);
9941 if (flags
& NDR_OUT
) {
9942 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9943 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9945 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9946 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
9947 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
9948 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
9949 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
9950 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
9952 return NDR_ERR_SUCCESS
;
9955 _PUBLIC_
void ndr_print_netr_LogonControl(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl
*r
)
9957 ndr_print_struct(ndr
, name
, "netr_LogonControl");
9959 if (flags
& NDR_SET_VALUES
) {
9960 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9962 if (flags
& NDR_IN
) {
9963 ndr_print_struct(ndr
, "in", "netr_LogonControl");
9965 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
9967 if (r
->in
.logon_server
) {
9968 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
9971 ndr_print_netr_LogonControlCode(ndr
, "function_code", r
->in
.function_code
);
9972 ndr_print_uint32(ndr
, "level", r
->in
.level
);
9975 if (flags
& NDR_OUT
) {
9976 ndr_print_struct(ndr
, "out", "netr_LogonControl");
9978 ndr_print_ptr(ndr
, "info", r
->out
.info
);
9980 ndr_print_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
);
9981 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "info", r
->out
.info
);
9983 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
9989 static enum ndr_err_code
ndr_push_netr_GetAnyDCName(struct ndr_push
*ndr
, int flags
, const struct netr_GetAnyDCName
*r
)
9991 if (flags
& NDR_IN
) {
9992 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
9993 if (r
->in
.logon_server
) {
9994 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9995 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9996 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
9997 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9999 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domainname
));
10000 if (r
->in
.domainname
) {
10001 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
10002 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10003 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
10004 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domainname
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10007 if (flags
& NDR_OUT
) {
10008 if (r
->out
.dcname
== NULL
) {
10009 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10011 if (*r
->out
.dcname
== NULL
) {
10012 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10014 NDR_CHECK(ndr_push_ref_ptr(ndr
));
10015 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
10016 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10017 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
10018 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.dcname
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10019 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10021 return NDR_ERR_SUCCESS
;
10024 static enum ndr_err_code
ndr_pull_netr_GetAnyDCName(struct ndr_pull
*ndr
, int flags
, struct netr_GetAnyDCName
*r
)
10026 uint32_t _ptr_logon_server
;
10027 uint32_t _ptr_domainname
;
10028 uint32_t _ptr_dcname
;
10029 TALLOC_CTX
*_mem_save_logon_server_0
;
10030 TALLOC_CTX
*_mem_save_domainname_0
;
10031 TALLOC_CTX
*_mem_save_dcname_0
;
10032 if (flags
& NDR_IN
) {
10033 ZERO_STRUCT(r
->out
);
10035 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
10036 if (_ptr_logon_server
) {
10037 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
10039 r
->in
.logon_server
= NULL
;
10041 if (r
->in
.logon_server
) {
10042 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10043 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
10044 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10045 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10046 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10047 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
10049 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10050 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
10051 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
10053 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domainname
));
10054 if (_ptr_domainname
) {
10055 NDR_PULL_ALLOC(ndr
, r
->in
.domainname
);
10057 r
->in
.domainname
= NULL
;
10059 if (r
->in
.domainname
) {
10060 _mem_save_domainname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10061 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domainname
, 0);
10062 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domainname
));
10063 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domainname
));
10064 if (ndr_get_array_length(ndr
, &r
->in
.domainname
) > ndr_get_array_size(ndr
, &r
->in
.domainname
)) {
10065 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.domainname
), ndr_get_array_length(ndr
, &r
->in
.domainname
));
10067 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t)));
10068 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domainname
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t), CH_UTF16
));
10069 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domainname_0
, 0);
10071 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
10072 ZERO_STRUCTP(r
->out
.dcname
);
10074 if (flags
& NDR_OUT
) {
10075 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10076 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
10078 _mem_save_dcname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10079 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dcname
, LIBNDR_FLAG_REF_ALLOC
);
10080 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_dcname
));
10081 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.dcname
));
10082 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.dcname
));
10083 if (ndr_get_array_length(ndr
, r
->out
.dcname
) > ndr_get_array_size(ndr
, r
->out
.dcname
)) {
10084 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, r
->out
.dcname
), ndr_get_array_length(ndr
, r
->out
.dcname
));
10086 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t)));
10087 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.dcname
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t), CH_UTF16
));
10088 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_0
, LIBNDR_FLAG_REF_ALLOC
);
10089 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
10091 return NDR_ERR_SUCCESS
;
10094 _PUBLIC_
void ndr_print_netr_GetAnyDCName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetAnyDCName
*r
)
10096 ndr_print_struct(ndr
, name
, "netr_GetAnyDCName");
10098 if (flags
& NDR_SET_VALUES
) {
10099 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10101 if (flags
& NDR_IN
) {
10102 ndr_print_struct(ndr
, "in", "netr_GetAnyDCName");
10104 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
10106 if (r
->in
.logon_server
) {
10107 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10110 ndr_print_ptr(ndr
, "domainname", r
->in
.domainname
);
10112 if (r
->in
.domainname
) {
10113 ndr_print_string(ndr
, "domainname", r
->in
.domainname
);
10118 if (flags
& NDR_OUT
) {
10119 ndr_print_struct(ndr
, "out", "netr_GetAnyDCName");
10121 ndr_print_ptr(ndr
, "dcname", r
->out
.dcname
);
10123 ndr_print_ptr(ndr
, "dcname", *r
->out
.dcname
);
10125 ndr_print_string(ndr
, "dcname", *r
->out
.dcname
);
10128 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
10134 static enum ndr_err_code
ndr_push_netr_LogonControl2(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl2
*r
)
10136 if (flags
& NDR_IN
) {
10137 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
10138 if (r
->in
.logon_server
) {
10139 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10140 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10141 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10142 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10144 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.function_code
));
10145 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
10146 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
));
10147 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.data
));
10149 if (flags
& NDR_OUT
) {
10150 if (r
->out
.query
== NULL
) {
10151 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10153 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
10154 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
10155 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10157 return NDR_ERR_SUCCESS
;
10160 static enum ndr_err_code
ndr_pull_netr_LogonControl2(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl2
*r
)
10162 uint32_t _ptr_logon_server
;
10163 TALLOC_CTX
*_mem_save_logon_server_0
;
10164 TALLOC_CTX
*_mem_save_query_0
;
10165 if (flags
& NDR_IN
) {
10166 ZERO_STRUCT(r
->out
);
10168 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
10169 if (_ptr_logon_server
) {
10170 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
10172 r
->in
.logon_server
= NULL
;
10174 if (r
->in
.logon_server
) {
10175 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10176 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
10177 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10178 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10179 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10180 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
10182 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10183 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
10184 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
10186 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
10187 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
10188 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
));
10189 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.data
));
10190 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
10191 ZERO_STRUCTP(r
->out
.query
);
10193 if (flags
& NDR_OUT
) {
10194 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10195 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
10197 _mem_save_query_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10198 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.query
, LIBNDR_FLAG_REF_ALLOC
);
10199 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
10200 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
10201 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query_0
, LIBNDR_FLAG_REF_ALLOC
);
10202 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
10204 return NDR_ERR_SUCCESS
;
10207 _PUBLIC_
void ndr_print_netr_LogonControl2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl2
*r
)
10209 ndr_print_struct(ndr
, name
, "netr_LogonControl2");
10211 if (flags
& NDR_SET_VALUES
) {
10212 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10214 if (flags
& NDR_IN
) {
10215 ndr_print_struct(ndr
, "in", "netr_LogonControl2");
10217 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
10219 if (r
->in
.logon_server
) {
10220 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10223 ndr_print_uint32(ndr
, "function_code", r
->in
.function_code
);
10224 ndr_print_uint32(ndr
, "level", r
->in
.level
);
10225 ndr_print_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
);
10226 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr
, "data", &r
->in
.data
);
10229 if (flags
& NDR_OUT
) {
10230 ndr_print_struct(ndr
, "out", "netr_LogonControl2");
10232 ndr_print_ptr(ndr
, "query", r
->out
.query
);
10234 ndr_print_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
);
10235 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "query", r
->out
.query
);
10237 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
10243 static enum ndr_err_code
ndr_push_netr_ServerAuthenticate2(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate2
*r
)
10245 if (flags
& NDR_IN
) {
10246 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
10247 if (r
->in
.server_name
) {
10248 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
10249 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10250 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
10251 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10253 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
10254 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10255 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
10256 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10257 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
10258 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
10259 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10260 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
10261 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10262 if (r
->in
.credentials
== NULL
) {
10263 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10265 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
10266 if (r
->in
.negotiate_flags
== NULL
) {
10267 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10269 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.negotiate_flags
));
10271 if (flags
& NDR_OUT
) {
10272 if (r
->out
.credentials
== NULL
) {
10273 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10275 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
10276 if (r
->out
.negotiate_flags
== NULL
) {
10277 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10279 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.negotiate_flags
));
10280 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10282 return NDR_ERR_SUCCESS
;
10285 static enum ndr_err_code
ndr_pull_netr_ServerAuthenticate2(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate2
*r
)
10287 uint32_t _ptr_server_name
;
10288 TALLOC_CTX
*_mem_save_server_name_0
;
10289 TALLOC_CTX
*_mem_save_credentials_0
;
10290 TALLOC_CTX
*_mem_save_negotiate_flags_0
;
10291 if (flags
& NDR_IN
) {
10292 ZERO_STRUCT(r
->out
);
10294 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
10295 if (_ptr_server_name
) {
10296 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
10298 r
->in
.server_name
= NULL
;
10300 if (r
->in
.server_name
) {
10301 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10302 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
10303 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
10304 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
10305 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
10306 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
10308 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
10309 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
10310 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
10312 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
10313 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
10314 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
10315 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
10317 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
10318 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
10319 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
10320 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
10321 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
10322 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
10323 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
10325 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
10326 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
10327 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10328 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
10330 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10331 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
10332 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
10333 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
10334 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10335 NDR_PULL_ALLOC(ndr
, r
->in
.negotiate_flags
);
10337 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10338 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
10339 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.negotiate_flags
));
10340 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
10341 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
10342 *r
->out
.credentials
= *r
->in
.credentials
;
10343 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
10344 *r
->out
.negotiate_flags
= *r
->in
.negotiate_flags
;
10346 if (flags
& NDR_OUT
) {
10347 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10348 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
10350 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10351 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
10352 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
10353 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
10354 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10355 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
10357 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10358 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
10359 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.negotiate_flags
));
10360 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
10361 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10363 return NDR_ERR_SUCCESS
;
10366 _PUBLIC_
void ndr_print_netr_ServerAuthenticate2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate2
*r
)
10368 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate2");
10370 if (flags
& NDR_SET_VALUES
) {
10371 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10373 if (flags
& NDR_IN
) {
10374 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate2");
10376 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
10378 if (r
->in
.server_name
) {
10379 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
10382 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
10383 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
10384 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
10385 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
10387 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
10389 ndr_print_ptr(ndr
, "negotiate_flags", r
->in
.negotiate_flags
);
10391 ndr_print_uint32(ndr
, "negotiate_flags", *r
->in
.negotiate_flags
);
10395 if (flags
& NDR_OUT
) {
10396 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate2");
10398 ndr_print_ptr(ndr
, "credentials", r
->out
.credentials
);
10400 ndr_print_netr_Credential(ndr
, "credentials", r
->out
.credentials
);
10402 ndr_print_ptr(ndr
, "negotiate_flags", r
->out
.negotiate_flags
);
10404 ndr_print_uint32(ndr
, "negotiate_flags", *r
->out
.negotiate_flags
);
10406 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10412 static enum ndr_err_code
ndr_push_netr_DatabaseSync2(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseSync2
*r
)
10414 if (flags
& NDR_IN
) {
10415 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10416 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10417 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10418 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10419 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10420 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10421 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10422 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10423 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10424 if (r
->in
.return_authenticator
== NULL
) {
10425 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10427 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10428 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
10429 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.restart_state
));
10430 if (r
->in
.sync_context
== NULL
) {
10431 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10433 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.sync_context
));
10434 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
10436 if (flags
& NDR_OUT
) {
10437 if (r
->out
.return_authenticator
== NULL
) {
10438 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10440 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10441 if (r
->out
.sync_context
== NULL
) {
10442 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10444 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.sync_context
));
10445 if (r
->out
.delta_enum_array
== NULL
) {
10446 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10448 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
10449 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10451 return NDR_ERR_SUCCESS
;
10454 static enum ndr_err_code
ndr_pull_netr_DatabaseSync2(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseSync2
*r
)
10456 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10457 TALLOC_CTX
*_mem_save_sync_context_0
;
10458 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
10459 if (flags
& NDR_IN
) {
10460 ZERO_STRUCT(r
->out
);
10462 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10463 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10464 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10465 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
10467 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10468 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
10469 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10470 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10471 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10472 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
10474 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10475 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10476 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10477 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10478 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10480 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10481 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10482 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10483 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10484 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
10485 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.restart_state
));
10486 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10487 NDR_PULL_ALLOC(ndr
, r
->in
.sync_context
);
10489 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10490 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
10491 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.sync_context
));
10492 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
10493 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
10494 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10495 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10496 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
10497 *r
->out
.sync_context
= *r
->in
.sync_context
;
10498 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10499 ZERO_STRUCTP(r
->out
.delta_enum_array
);
10501 if (flags
& NDR_OUT
) {
10502 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10503 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10505 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10506 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10507 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10508 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10509 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10510 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
10512 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10513 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
10514 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.sync_context
));
10515 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
10516 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10517 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10519 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10520 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
10521 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
10522 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
10523 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10525 return NDR_ERR_SUCCESS
;
10528 _PUBLIC_
void ndr_print_netr_DatabaseSync2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseSync2
*r
)
10530 ndr_print_struct(ndr
, name
, "netr_DatabaseSync2");
10532 if (flags
& NDR_SET_VALUES
) {
10533 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10535 if (flags
& NDR_IN
) {
10536 ndr_print_struct(ndr
, "in", "netr_DatabaseSync2");
10538 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10539 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10540 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
10541 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10543 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10545 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
10546 ndr_print_uint16(ndr
, "restart_state", r
->in
.restart_state
);
10547 ndr_print_ptr(ndr
, "sync_context", r
->in
.sync_context
);
10549 ndr_print_uint32(ndr
, "sync_context", *r
->in
.sync_context
);
10551 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
10554 if (flags
& NDR_OUT
) {
10555 ndr_print_struct(ndr
, "out", "netr_DatabaseSync2");
10557 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10559 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10561 ndr_print_ptr(ndr
, "sync_context", r
->out
.sync_context
);
10563 ndr_print_uint32(ndr
, "sync_context", *r
->out
.sync_context
);
10565 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10567 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10569 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10575 static enum ndr_err_code
ndr_push_netr_DatabaseRedo(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseRedo
*r
)
10577 if (flags
& NDR_IN
) {
10578 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10579 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10580 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10581 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10582 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10583 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10584 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10585 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10586 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10587 if (r
->in
.return_authenticator
== NULL
) {
10588 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10590 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10591 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.change_log_entry
));
10592 if (r
->in
.change_log_entry
) {
10593 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.change_log_entry_size
));
10594 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->in
.change_log_entry
, r
->in
.change_log_entry_size
));
10596 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.change_log_entry_size
));
10598 if (flags
& NDR_OUT
) {
10599 if (r
->out
.return_authenticator
== NULL
) {
10600 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10602 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10603 if (r
->out
.delta_enum_array
== NULL
) {
10604 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10606 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
10607 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10609 return NDR_ERR_SUCCESS
;
10612 static enum ndr_err_code
ndr_pull_netr_DatabaseRedo(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseRedo
*r
)
10614 uint32_t _ptr_change_log_entry
;
10615 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10616 TALLOC_CTX
*_mem_save_change_log_entry_0
;
10617 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
10618 if (flags
& NDR_IN
) {
10619 ZERO_STRUCT(r
->out
);
10621 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10622 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10623 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10624 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
10626 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10627 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
10628 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10629 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10630 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10631 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computername
), ndr_get_array_length(ndr
, &r
->in
.computername
));
10633 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10634 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10635 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10636 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10637 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10639 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10640 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10641 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10642 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10643 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_change_log_entry
));
10644 if (_ptr_change_log_entry
) {
10645 NDR_PULL_ALLOC(ndr
, r
->in
.change_log_entry
);
10647 r
->in
.change_log_entry
= NULL
;
10649 if (r
->in
.change_log_entry
) {
10650 _mem_save_change_log_entry_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10651 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.change_log_entry
, 0);
10652 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.change_log_entry
));
10653 NDR_PULL_ALLOC_N(ndr
, r
->in
.change_log_entry
, ndr_get_array_size(ndr
, &r
->in
.change_log_entry
));
10654 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->in
.change_log_entry
, ndr_get_array_size(ndr
, &r
->in
.change_log_entry
)));
10655 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_change_log_entry_0
, 0);
10657 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.change_log_entry_size
));
10658 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10659 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10660 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10661 ZERO_STRUCTP(r
->out
.delta_enum_array
);
10662 if (r
->in
.change_log_entry
) {
10663 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->in
.change_log_entry
, r
->in
.change_log_entry_size
));
10666 if (flags
& NDR_OUT
) {
10667 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10668 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10670 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10671 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10672 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10673 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10674 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10675 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10677 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10678 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
10679 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.delta_enum_array
));
10680 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
10681 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10683 return NDR_ERR_SUCCESS
;
10686 _PUBLIC_
void ndr_print_netr_DatabaseRedo(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseRedo
*r
)
10688 ndr_print_struct(ndr
, name
, "netr_DatabaseRedo");
10690 if (flags
& NDR_SET_VALUES
) {
10691 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10693 if (flags
& NDR_IN
) {
10694 ndr_print_struct(ndr
, "in", "netr_DatabaseRedo");
10696 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10697 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10698 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
10699 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10701 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10703 ndr_print_ptr(ndr
, "change_log_entry", r
->in
.change_log_entry
);
10705 if (r
->in
.change_log_entry
) {
10706 ndr_print_array_uint8(ndr
, "change_log_entry", r
->in
.change_log_entry
, r
->in
.change_log_entry_size
);
10709 ndr_print_uint32(ndr
, "change_log_entry_size", r
->in
.change_log_entry_size
);
10712 if (flags
& NDR_OUT
) {
10713 ndr_print_struct(ndr
, "out", "netr_DatabaseRedo");
10715 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10717 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10719 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10721 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10723 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10729 static enum ndr_err_code
ndr_push_netr_LogonControl2Ex(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl2Ex
*r
)
10731 if (flags
& NDR_IN
) {
10732 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
10733 if (r
->in
.logon_server
) {
10734 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10735 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10736 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10737 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.logon_server
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10739 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.function_code
));
10740 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
10741 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
));
10742 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.data
));
10744 if (flags
& NDR_OUT
) {
10745 if (r
->out
.query
== NULL
) {
10746 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10748 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
10749 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
10750 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10752 return NDR_ERR_SUCCESS
;
10755 static enum ndr_err_code
ndr_pull_netr_LogonControl2Ex(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl2Ex
*r
)
10757 uint32_t _ptr_logon_server
;
10758 TALLOC_CTX
*_mem_save_logon_server_0
;
10759 TALLOC_CTX
*_mem_save_query_0
;
10760 if (flags
& NDR_IN
) {
10761 ZERO_STRUCT(r
->out
);
10763 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
10764 if (_ptr_logon_server
) {
10765 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
10767 r
->in
.logon_server
= NULL
;
10769 if (r
->in
.logon_server
) {
10770 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10771 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
10772 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10773 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10774 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10775 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.logon_server
), ndr_get_array_length(ndr
, &r
->in
.logon_server
));
10777 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10778 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.logon_server
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t), CH_UTF16
));
10779 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
10781 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
10782 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
10783 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
));
10784 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.data
));
10785 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
10786 ZERO_STRUCTP(r
->out
.query
);
10788 if (flags
& NDR_OUT
) {
10789 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10790 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
10792 _mem_save_query_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10793 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.query
, LIBNDR_FLAG_REF_ALLOC
);
10794 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
10795 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
10796 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query_0
, LIBNDR_FLAG_REF_ALLOC
);
10797 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
10799 return NDR_ERR_SUCCESS
;
10802 _PUBLIC_
void ndr_print_netr_LogonControl2Ex(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl2Ex
*r
)
10804 ndr_print_struct(ndr
, name
, "netr_LogonControl2Ex");
10806 if (flags
& NDR_SET_VALUES
) {
10807 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10809 if (flags
& NDR_IN
) {
10810 ndr_print_struct(ndr
, "in", "netr_LogonControl2Ex");
10812 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
10814 if (r
->in
.logon_server
) {
10815 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10818 ndr_print_uint32(ndr
, "function_code", r
->in
.function_code
);
10819 ndr_print_uint32(ndr
, "level", r
->in
.level
);
10820 ndr_print_set_switch_value(ndr
, &r
->in
.data
, r
->in
.function_code
);
10821 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr
, "data", &r
->in
.data
);
10824 if (flags
& NDR_OUT
) {
10825 ndr_print_struct(ndr
, "out", "netr_LogonControl2Ex");
10827 ndr_print_ptr(ndr
, "query", r
->out
.query
);
10829 ndr_print_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
);
10830 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "query", r
->out
.query
);
10832 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
10838 static enum ndr_err_code
ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push
*ndr
, int flags
, const struct netr_NetrEnumerateTrustedDomains
*r
)
10840 if (flags
& NDR_IN
) {
10841 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
10842 if (r
->in
.server_name
) {
10843 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
10844 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10845 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
10846 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10849 if (flags
& NDR_OUT
) {
10850 if (r
->out
.trusted_domains_blob
== NULL
) {
10851 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10853 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusted_domains_blob
));
10854 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10856 return NDR_ERR_SUCCESS
;
10859 static enum ndr_err_code
ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull
*ndr
, int flags
, struct netr_NetrEnumerateTrustedDomains
*r
)
10861 uint32_t _ptr_server_name
;
10862 TALLOC_CTX
*_mem_save_server_name_0
;
10863 TALLOC_CTX
*_mem_save_trusted_domains_blob_0
;
10864 if (flags
& NDR_IN
) {
10865 ZERO_STRUCT(r
->out
);
10867 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
10868 if (_ptr_server_name
) {
10869 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
10871 r
->in
.server_name
= NULL
;
10873 if (r
->in
.server_name
) {
10874 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10875 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
10876 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
10877 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
10878 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
10879 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
10881 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
10882 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
10883 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
10885 NDR_PULL_ALLOC(ndr
, r
->out
.trusted_domains_blob
);
10886 ZERO_STRUCTP(r
->out
.trusted_domains_blob
);
10888 if (flags
& NDR_OUT
) {
10889 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10890 NDR_PULL_ALLOC(ndr
, r
->out
.trusted_domains_blob
);
10892 _mem_save_trusted_domains_blob_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10893 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.trusted_domains_blob
, LIBNDR_FLAG_REF_ALLOC
);
10894 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusted_domains_blob
));
10895 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domains_blob_0
, LIBNDR_FLAG_REF_ALLOC
);
10896 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
10898 return NDR_ERR_SUCCESS
;
10901 _PUBLIC_
void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NetrEnumerateTrustedDomains
*r
)
10903 ndr_print_struct(ndr
, name
, "netr_NetrEnumerateTrustedDomains");
10905 if (flags
& NDR_SET_VALUES
) {
10906 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10908 if (flags
& NDR_IN
) {
10909 ndr_print_struct(ndr
, "in", "netr_NetrEnumerateTrustedDomains");
10911 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
10913 if (r
->in
.server_name
) {
10914 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
10919 if (flags
& NDR_OUT
) {
10920 ndr_print_struct(ndr
, "out", "netr_NetrEnumerateTrustedDomains");
10922 ndr_print_ptr(ndr
, "trusted_domains_blob", r
->out
.trusted_domains_blob
);
10924 ndr_print_netr_Blob(ndr
, "trusted_domains_blob", r
->out
.trusted_domains_blob
);
10926 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
10932 static enum ndr_err_code
ndr_push_netr_DsRGetDCName(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCName
*r
)
10934 if (flags
& NDR_IN
) {
10935 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
10936 if (r
->in
.server_unc
) {
10937 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
10938 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10939 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
10940 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_unc
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10942 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
10943 if (r
->in
.domain_name
) {
10944 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
10945 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10946 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
10947 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domain_name
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10949 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
10950 if (r
->in
.domain_guid
) {
10951 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
10953 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_guid
));
10954 if (r
->in
.site_guid
) {
10955 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.site_guid
));
10957 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
10959 if (flags
& NDR_OUT
) {
10960 if (r
->out
.info
== NULL
) {
10961 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10963 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
10964 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10966 return NDR_ERR_SUCCESS
;
10969 static enum ndr_err_code
ndr_pull_netr_DsRGetDCName(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCName
*r
)
10971 uint32_t _ptr_server_unc
;
10972 uint32_t _ptr_domain_name
;
10973 uint32_t _ptr_domain_guid
;
10974 uint32_t _ptr_site_guid
;
10975 TALLOC_CTX
*_mem_save_server_unc_0
;
10976 TALLOC_CTX
*_mem_save_domain_name_0
;
10977 TALLOC_CTX
*_mem_save_domain_guid_0
;
10978 TALLOC_CTX
*_mem_save_site_guid_0
;
10979 TALLOC_CTX
*_mem_save_info_0
;
10980 if (flags
& NDR_IN
) {
10981 ZERO_STRUCT(r
->out
);
10983 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
10984 if (_ptr_server_unc
) {
10985 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
10987 r
->in
.server_unc
= NULL
;
10989 if (r
->in
.server_unc
) {
10990 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10991 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
10992 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
10993 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
10994 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
10995 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_unc
), ndr_get_array_length(ndr
, &r
->in
.server_unc
));
10997 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
10998 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_unc
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t), CH_UTF16
));
10999 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
11001 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
11002 if (_ptr_domain_name
) {
11003 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
11005 r
->in
.domain_name
= NULL
;
11007 if (r
->in
.domain_name
) {
11008 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11009 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
11010 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
11011 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
11012 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
11013 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.domain_name
), ndr_get_array_length(ndr
, &r
->in
.domain_name
));
11015 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
11016 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domain_name
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t), CH_UTF16
));
11017 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
11019 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
11020 if (_ptr_domain_guid
) {
11021 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
11023 r
->in
.domain_guid
= NULL
;
11025 if (r
->in
.domain_guid
) {
11026 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11027 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
11028 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
11029 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
11031 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_guid
));
11032 if (_ptr_site_guid
) {
11033 NDR_PULL_ALLOC(ndr
, r
->in
.site_guid
);
11035 r
->in
.site_guid
= NULL
;
11037 if (r
->in
.site_guid
) {
11038 _mem_save_site_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11039 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_guid
, 0);
11040 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.site_guid
));
11041 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_guid_0
, 0);
11043 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
11044 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11045 ZERO_STRUCTP(r
->out
.info
);
11047 if (flags
& NDR_OUT
) {
11048 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11049 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11051 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11052 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
11053 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11054 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
11055 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11057 return NDR_ERR_SUCCESS
;
11060 _PUBLIC_
void ndr_print_netr_DsRGetDCName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCName
*r
)
11062 ndr_print_struct(ndr
, name
, "netr_DsRGetDCName");
11064 if (flags
& NDR_SET_VALUES
) {
11065 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11067 if (flags
& NDR_IN
) {
11068 ndr_print_struct(ndr
, "in", "netr_DsRGetDCName");
11070 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
11072 if (r
->in
.server_unc
) {
11073 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
11076 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
11078 if (r
->in
.domain_name
) {
11079 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
11082 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
11084 if (r
->in
.domain_guid
) {
11085 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
11088 ndr_print_ptr(ndr
, "site_guid", r
->in
.site_guid
);
11090 if (r
->in
.site_guid
) {
11091 ndr_print_GUID(ndr
, "site_guid", r
->in
.site_guid
);
11094 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
11097 if (flags
& NDR_OUT
) {
11098 ndr_print_struct(ndr
, "out", "netr_DsRGetDCName");
11100 ndr_print_ptr(ndr
, "info", r
->out
.info
);
11102 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", r
->out
.info
);
11104 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11110 static enum ndr_err_code
ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONDUMMYROUTINE1
*r
)
11112 if (flags
& NDR_IN
) {
11114 if (flags
& NDR_OUT
) {
11115 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11117 return NDR_ERR_SUCCESS
;
11120 static enum ndr_err_code
ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONDUMMYROUTINE1
*r
)
11122 if (flags
& NDR_IN
) {
11124 if (flags
& NDR_OUT
) {
11125 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11127 return NDR_ERR_SUCCESS
;
11130 _PUBLIC_
void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONDUMMYROUTINE1
*r
)
11132 ndr_print_struct(ndr
, name
, "netr_NETRLOGONDUMMYROUTINE1");
11134 if (flags
& NDR_SET_VALUES
) {
11135 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11137 if (flags
& NDR_IN
) {
11138 ndr_print_struct(ndr
, "in", "netr_NETRLOGONDUMMYROUTINE1");
11142 if (flags
& NDR_OUT
) {
11143 ndr_print_struct(ndr
, "out", "netr_NETRLOGONDUMMYROUTINE1");
11145 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11151 static enum ndr_err_code
ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONSETSERVICEBITS
*r
)
11153 if (flags
& NDR_IN
) {
11155 if (flags
& NDR_OUT
) {
11156 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11158 return NDR_ERR_SUCCESS
;
11161 static enum ndr_err_code
ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONSETSERVICEBITS
*r
)
11163 if (flags
& NDR_IN
) {
11165 if (flags
& NDR_OUT
) {
11166 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11168 return NDR_ERR_SUCCESS
;
11171 _PUBLIC_
void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONSETSERVICEBITS
*r
)
11173 ndr_print_struct(ndr
, name
, "netr_NETRLOGONSETSERVICEBITS");
11175 if (flags
& NDR_SET_VALUES
) {
11176 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11178 if (flags
& NDR_IN
) {
11179 ndr_print_struct(ndr
, "in", "netr_NETRLOGONSETSERVICEBITS");
11183 if (flags
& NDR_OUT
) {
11184 ndr_print_struct(ndr
, "out", "netr_NETRLOGONSETSERVICEBITS");
11186 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11192 static enum ndr_err_code
ndr_push_netr_NETRLOGONGETTRUSTRID(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONGETTRUSTRID
*r
)
11194 if (flags
& NDR_IN
) {
11196 if (flags
& NDR_OUT
) {
11197 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11199 return NDR_ERR_SUCCESS
;
11202 static enum ndr_err_code
ndr_pull_netr_NETRLOGONGETTRUSTRID(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONGETTRUSTRID
*r
)
11204 if (flags
& NDR_IN
) {
11206 if (flags
& NDR_OUT
) {
11207 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11209 return NDR_ERR_SUCCESS
;
11212 _PUBLIC_
void ndr_print_netr_NETRLOGONGETTRUSTRID(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONGETTRUSTRID
*r
)
11214 ndr_print_struct(ndr
, name
, "netr_NETRLOGONGETTRUSTRID");
11216 if (flags
& NDR_SET_VALUES
) {
11217 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11219 if (flags
& NDR_IN
) {
11220 ndr_print_struct(ndr
, "in", "netr_NETRLOGONGETTRUSTRID");
11224 if (flags
& NDR_OUT
) {
11225 ndr_print_struct(ndr
, "out", "netr_NETRLOGONGETTRUSTRID");
11227 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11233 static enum ndr_err_code
ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
11235 if (flags
& NDR_IN
) {
11237 if (flags
& NDR_OUT
) {
11238 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11240 return NDR_ERR_SUCCESS
;
11243 static enum ndr_err_code
ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
11245 if (flags
& NDR_IN
) {
11247 if (flags
& NDR_OUT
) {
11248 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11250 return NDR_ERR_SUCCESS
;
11253 _PUBLIC_
void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
11255 ndr_print_struct(ndr
, name
, "netr_NETRLOGONCOMPUTESERVERDIGEST");
11257 if (flags
& NDR_SET_VALUES
) {
11258 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11260 if (flags
& NDR_IN
) {
11261 ndr_print_struct(ndr
, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST");
11265 if (flags
& NDR_OUT
) {
11266 ndr_print_struct(ndr
, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST");
11268 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11274 static enum ndr_err_code
ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
11276 if (flags
& NDR_IN
) {
11278 if (flags
& NDR_OUT
) {
11279 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11281 return NDR_ERR_SUCCESS
;
11284 static enum ndr_err_code
ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
11286 if (flags
& NDR_IN
) {
11288 if (flags
& NDR_OUT
) {
11289 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11291 return NDR_ERR_SUCCESS
;
11294 _PUBLIC_
void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
11296 ndr_print_struct(ndr
, name
, "netr_NETRLOGONCOMPUTECLIENTDIGEST");
11298 if (flags
& NDR_SET_VALUES
) {
11299 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11301 if (flags
& NDR_IN
) {
11302 ndr_print_struct(ndr
, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
11306 if (flags
& NDR_OUT
) {
11307 ndr_print_struct(ndr
, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
11309 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11315 static enum ndr_err_code
ndr_push_netr_ServerAuthenticate3(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate3
*r
)
11317 if (flags
& NDR_IN
) {
11318 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
11319 if (r
->in
.server_name
) {
11320 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11321 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11322 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11323 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11325 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11326 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11327 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11328 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11329 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
11330 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11331 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11332 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11333 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11334 if (r
->in
.credentials
== NULL
) {
11335 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11337 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
11338 if (r
->in
.negotiate_flags
== NULL
) {
11339 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11341 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.negotiate_flags
));
11343 if (flags
& NDR_OUT
) {
11344 if (r
->out
.credentials
== NULL
) {
11345 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11347 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
11348 if (r
->out
.negotiate_flags
== NULL
) {
11349 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11351 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.negotiate_flags
));
11352 if (r
->out
.rid
== NULL
) {
11353 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11355 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.rid
));
11356 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11358 return NDR_ERR_SUCCESS
;
11361 static enum ndr_err_code
ndr_pull_netr_ServerAuthenticate3(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate3
*r
)
11363 uint32_t _ptr_server_name
;
11364 TALLOC_CTX
*_mem_save_server_name_0
;
11365 TALLOC_CTX
*_mem_save_credentials_0
;
11366 TALLOC_CTX
*_mem_save_negotiate_flags_0
;
11367 TALLOC_CTX
*_mem_save_rid_0
;
11368 if (flags
& NDR_IN
) {
11369 ZERO_STRUCT(r
->out
);
11371 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
11372 if (_ptr_server_name
) {
11373 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
11375 r
->in
.server_name
= NULL
;
11377 if (r
->in
.server_name
) {
11378 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11379 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
11380 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
11381 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
11382 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
11383 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
11385 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
11386 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
11387 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
11389 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
11390 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
11391 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
11392 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
11394 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
11395 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
11396 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
11397 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
11398 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
11399 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
11400 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
11402 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
11403 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
11404 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11405 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
11407 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11408 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
11409 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
11410 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
11411 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11412 NDR_PULL_ALLOC(ndr
, r
->in
.negotiate_flags
);
11414 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11415 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
11416 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.negotiate_flags
));
11417 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
11418 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
11419 *r
->out
.credentials
= *r
->in
.credentials
;
11420 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
11421 *r
->out
.negotiate_flags
= *r
->in
.negotiate_flags
;
11422 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
11423 ZERO_STRUCTP(r
->out
.rid
);
11425 if (flags
& NDR_OUT
) {
11426 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11427 NDR_PULL_ALLOC(ndr
, r
->out
.credentials
);
11429 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11430 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
11431 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.credentials
));
11432 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
11433 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11434 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
11436 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11437 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
11438 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.negotiate_flags
));
11439 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
11440 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11441 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
11443 _mem_save_rid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11444 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.rid
, LIBNDR_FLAG_REF_ALLOC
);
11445 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.rid
));
11446 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rid_0
, LIBNDR_FLAG_REF_ALLOC
);
11447 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
11449 return NDR_ERR_SUCCESS
;
11452 _PUBLIC_
void ndr_print_netr_ServerAuthenticate3(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate3
*r
)
11454 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate3");
11456 if (flags
& NDR_SET_VALUES
) {
11457 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11459 if (flags
& NDR_IN
) {
11460 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate3");
11462 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
11464 if (r
->in
.server_name
) {
11465 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
11468 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
11469 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
11470 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
11471 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
11473 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
11475 ndr_print_ptr(ndr
, "negotiate_flags", r
->in
.negotiate_flags
);
11477 ndr_print_uint32(ndr
, "negotiate_flags", *r
->in
.negotiate_flags
);
11481 if (flags
& NDR_OUT
) {
11482 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate3");
11484 ndr_print_ptr(ndr
, "credentials", r
->out
.credentials
);
11486 ndr_print_netr_Credential(ndr
, "credentials", r
->out
.credentials
);
11488 ndr_print_ptr(ndr
, "negotiate_flags", r
->out
.negotiate_flags
);
11490 ndr_print_uint32(ndr
, "negotiate_flags", *r
->out
.negotiate_flags
);
11492 ndr_print_ptr(ndr
, "rid", r
->out
.rid
);
11494 ndr_print_uint32(ndr
, "rid", *r
->out
.rid
);
11496 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
11502 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameEx(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCNameEx
*r
)
11504 if (flags
& NDR_IN
) {
11505 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
11506 if (r
->in
.server_unc
) {
11507 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
11508 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11509 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
11510 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_unc
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11512 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
11513 if (r
->in
.domain_name
) {
11514 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
11515 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11516 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
11517 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domain_name
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11519 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
11520 if (r
->in
.domain_guid
) {
11521 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
11523 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_name
));
11524 if (r
->in
.site_name
) {
11525 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
11526 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11527 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
11528 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.site_name
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11530 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
11532 if (flags
& NDR_OUT
) {
11533 if (r
->out
.info
== NULL
) {
11534 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11536 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11537 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11539 return NDR_ERR_SUCCESS
;
11542 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCNameEx
*r
)
11544 uint32_t _ptr_server_unc
;
11545 uint32_t _ptr_domain_name
;
11546 uint32_t _ptr_domain_guid
;
11547 uint32_t _ptr_site_name
;
11548 TALLOC_CTX
*_mem_save_server_unc_0
;
11549 TALLOC_CTX
*_mem_save_domain_name_0
;
11550 TALLOC_CTX
*_mem_save_domain_guid_0
;
11551 TALLOC_CTX
*_mem_save_site_name_0
;
11552 TALLOC_CTX
*_mem_save_info_0
;
11553 if (flags
& NDR_IN
) {
11554 ZERO_STRUCT(r
->out
);
11556 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
11557 if (_ptr_server_unc
) {
11558 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
11560 r
->in
.server_unc
= NULL
;
11562 if (r
->in
.server_unc
) {
11563 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11564 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
11565 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
11566 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
11567 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
11568 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_unc
), ndr_get_array_length(ndr
, &r
->in
.server_unc
));
11570 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
11571 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_unc
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t), CH_UTF16
));
11572 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
11574 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
11575 if (_ptr_domain_name
) {
11576 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
11578 r
->in
.domain_name
= NULL
;
11580 if (r
->in
.domain_name
) {
11581 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11582 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
11583 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
11584 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
11585 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
11586 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.domain_name
), ndr_get_array_length(ndr
, &r
->in
.domain_name
));
11588 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
11589 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domain_name
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t), CH_UTF16
));
11590 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
11592 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
11593 if (_ptr_domain_guid
) {
11594 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
11596 r
->in
.domain_guid
= NULL
;
11598 if (r
->in
.domain_guid
) {
11599 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11600 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
11601 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
11602 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
11604 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_name
));
11605 if (_ptr_site_name
) {
11606 NDR_PULL_ALLOC(ndr
, r
->in
.site_name
);
11608 r
->in
.site_name
= NULL
;
11610 if (r
->in
.site_name
) {
11611 _mem_save_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11612 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_name
, 0);
11613 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.site_name
));
11614 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.site_name
));
11615 if (ndr_get_array_length(ndr
, &r
->in
.site_name
) > ndr_get_array_size(ndr
, &r
->in
.site_name
)) {
11616 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.site_name
), ndr_get_array_length(ndr
, &r
->in
.site_name
));
11618 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t)));
11619 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.site_name
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t), CH_UTF16
));
11620 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_name_0
, 0);
11622 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
11623 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11624 ZERO_STRUCTP(r
->out
.info
);
11626 if (flags
& NDR_OUT
) {
11627 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11628 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11630 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11631 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
11632 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11633 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
11634 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11636 return NDR_ERR_SUCCESS
;
11639 _PUBLIC_
void ndr_print_netr_DsRGetDCNameEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCNameEx
*r
)
11641 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameEx");
11643 if (flags
& NDR_SET_VALUES
) {
11644 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11646 if (flags
& NDR_IN
) {
11647 ndr_print_struct(ndr
, "in", "netr_DsRGetDCNameEx");
11649 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
11651 if (r
->in
.server_unc
) {
11652 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
11655 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
11657 if (r
->in
.domain_name
) {
11658 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
11661 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
11663 if (r
->in
.domain_guid
) {
11664 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
11667 ndr_print_ptr(ndr
, "site_name", r
->in
.site_name
);
11669 if (r
->in
.site_name
) {
11670 ndr_print_string(ndr
, "site_name", r
->in
.site_name
);
11673 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
11676 if (flags
& NDR_OUT
) {
11677 ndr_print_struct(ndr
, "out", "netr_DsRGetDCNameEx");
11679 ndr_print_ptr(ndr
, "info", r
->out
.info
);
11681 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", r
->out
.info
);
11683 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11689 static enum ndr_err_code
ndr_push_netr_DsRGetSiteName(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetSiteName
*r
)
11691 if (flags
& NDR_IN
) {
11692 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
11693 if (r
->in
.computer_name
) {
11694 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11695 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11696 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11697 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11700 if (flags
& NDR_OUT
) {
11701 if (r
->out
.site
== NULL
) {
11702 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11704 if (*r
->out
.site
== NULL
) {
11705 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11707 NDR_CHECK(ndr_push_ref_ptr(ndr
));
11708 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.site
, CH_UTF16
)));
11709 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11710 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.site
, CH_UTF16
)));
11711 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.site
, ndr_charset_length(*r
->out
.site
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11712 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11714 return NDR_ERR_SUCCESS
;
11717 static enum ndr_err_code
ndr_pull_netr_DsRGetSiteName(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetSiteName
*r
)
11719 uint32_t _ptr_computer_name
;
11720 uint32_t _ptr_site
;
11721 TALLOC_CTX
*_mem_save_computer_name_0
;
11722 TALLOC_CTX
*_mem_save_site_0
;
11723 if (flags
& NDR_IN
) {
11724 ZERO_STRUCT(r
->out
);
11726 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
11727 if (_ptr_computer_name
) {
11728 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
11730 r
->in
.computer_name
= NULL
;
11732 if (r
->in
.computer_name
) {
11733 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11734 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
11735 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
11736 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
11737 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
11738 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
11740 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
11741 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
11742 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
11744 NDR_PULL_ALLOC(ndr
, r
->out
.site
);
11745 ZERO_STRUCTP(r
->out
.site
);
11747 if (flags
& NDR_OUT
) {
11748 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11749 NDR_PULL_ALLOC(ndr
, r
->out
.site
);
11751 _mem_save_site_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11752 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.site
, LIBNDR_FLAG_REF_ALLOC
);
11753 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_site
));
11754 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.site
));
11755 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.site
));
11756 if (ndr_get_array_length(ndr
, r
->out
.site
) > ndr_get_array_size(ndr
, r
->out
.site
)) {
11757 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, r
->out
.site
), ndr_get_array_length(ndr
, r
->out
.site
));
11759 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.site
), sizeof(uint16_t)));
11760 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.site
, ndr_get_array_length(ndr
, r
->out
.site
), sizeof(uint16_t), CH_UTF16
));
11761 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_0
, LIBNDR_FLAG_REF_ALLOC
);
11762 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11764 return NDR_ERR_SUCCESS
;
11767 _PUBLIC_
void ndr_print_netr_DsRGetSiteName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetSiteName
*r
)
11769 ndr_print_struct(ndr
, name
, "netr_DsRGetSiteName");
11771 if (flags
& NDR_SET_VALUES
) {
11772 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11774 if (flags
& NDR_IN
) {
11775 ndr_print_struct(ndr
, "in", "netr_DsRGetSiteName");
11777 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
11779 if (r
->in
.computer_name
) {
11780 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
11785 if (flags
& NDR_OUT
) {
11786 ndr_print_struct(ndr
, "out", "netr_DsRGetSiteName");
11788 ndr_print_ptr(ndr
, "site", r
->out
.site
);
11790 ndr_print_ptr(ndr
, "site", *r
->out
.site
);
11792 ndr_print_string(ndr
, "site", *r
->out
.site
);
11795 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11801 static enum ndr_err_code
ndr_push_netr_LogonGetDomainInfo(struct ndr_push
*ndr
, int flags
, const struct netr_LogonGetDomainInfo
*r
)
11803 if (flags
& NDR_IN
) {
11804 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11805 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11806 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11807 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11808 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
11809 if (r
->in
.computer_name
) {
11810 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11811 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11812 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11813 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11815 if (r
->in
.credential
== NULL
) {
11816 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11818 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11819 if (r
->in
.return_authenticator
== NULL
) {
11820 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11822 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11823 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
11824 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
));
11825 NDR_CHECK(ndr_push_netr_DomainQuery(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.query
));
11827 if (flags
& NDR_OUT
) {
11828 if (r
->out
.return_authenticator
== NULL
) {
11829 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11831 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11832 if (r
->out
.info
== NULL
) {
11833 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11835 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
11836 NDR_CHECK(ndr_push_netr_DomainInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11837 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11839 return NDR_ERR_SUCCESS
;
11842 static enum ndr_err_code
ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull
*ndr
, int flags
, struct netr_LogonGetDomainInfo
*r
)
11844 uint32_t _ptr_computer_name
;
11845 TALLOC_CTX
*_mem_save_computer_name_0
;
11846 TALLOC_CTX
*_mem_save_credential_0
;
11847 TALLOC_CTX
*_mem_save_return_authenticator_0
;
11848 TALLOC_CTX
*_mem_save_info_0
;
11849 if (flags
& NDR_IN
) {
11850 ZERO_STRUCT(r
->out
);
11852 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
11853 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
11854 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
11855 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
11857 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
11858 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
11859 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
11860 if (_ptr_computer_name
) {
11861 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
11863 r
->in
.computer_name
= NULL
;
11865 if (r
->in
.computer_name
) {
11866 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11867 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
11868 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
11869 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
11870 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
11871 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
11873 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
11874 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
11875 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
11877 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11878 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
11880 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11881 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
11882 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11883 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
11884 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11885 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
11887 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11888 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11889 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11890 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11891 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
11892 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
));
11893 NDR_CHECK(ndr_pull_netr_DomainQuery(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.query
));
11894 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11895 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
11896 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11897 ZERO_STRUCTP(r
->out
.info
);
11899 if (flags
& NDR_OUT
) {
11900 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11901 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11903 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11904 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11905 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11906 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11907 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11908 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11910 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11911 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
11912 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
11913 NDR_CHECK(ndr_pull_netr_DomainInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11914 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
11915 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
11917 return NDR_ERR_SUCCESS
;
11920 _PUBLIC_
void ndr_print_netr_LogonGetDomainInfo(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonGetDomainInfo
*r
)
11922 ndr_print_struct(ndr
, name
, "netr_LogonGetDomainInfo");
11924 if (flags
& NDR_SET_VALUES
) {
11925 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11927 if (flags
& NDR_IN
) {
11928 ndr_print_struct(ndr
, "in", "netr_LogonGetDomainInfo");
11930 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
11931 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
11933 if (r
->in
.computer_name
) {
11934 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
11937 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
11939 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
11941 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11943 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11945 ndr_print_uint32(ndr
, "level", r
->in
.level
);
11946 ndr_print_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
);
11947 ndr_print_netr_DomainQuery(ndr
, "query", &r
->in
.query
);
11950 if (flags
& NDR_OUT
) {
11951 ndr_print_struct(ndr
, "out", "netr_LogonGetDomainInfo");
11953 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
11955 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
11957 ndr_print_ptr(ndr
, "info", r
->out
.info
);
11959 ndr_print_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
);
11960 ndr_print_netr_DomainInfo(ndr
, "info", r
->out
.info
);
11962 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
11968 static enum ndr_err_code
ndr_push_netr_ServerPasswordSet2(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordSet2
*r
)
11970 if (flags
& NDR_IN
) {
11971 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
11972 if (r
->in
.server_name
) {
11973 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11974 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11975 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11976 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11978 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11979 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11980 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11981 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11982 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
11983 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11984 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11985 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11986 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11987 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
11988 NDR_CHECK(ndr_push_netr_CryptPassword(ndr
, NDR_SCALARS
, &r
->in
.new_password
));
11990 if (flags
& NDR_OUT
) {
11991 if (r
->out
.return_authenticator
== NULL
) {
11992 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11994 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11995 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11997 return NDR_ERR_SUCCESS
;
12000 static enum ndr_err_code
ndr_pull_netr_ServerPasswordSet2(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordSet2
*r
)
12002 uint32_t _ptr_server_name
;
12003 TALLOC_CTX
*_mem_save_server_name_0
;
12004 TALLOC_CTX
*_mem_save_return_authenticator_0
;
12005 if (flags
& NDR_IN
) {
12006 ZERO_STRUCT(r
->out
);
12008 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12009 if (_ptr_server_name
) {
12010 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12012 r
->in
.server_name
= NULL
;
12014 if (r
->in
.server_name
) {
12015 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12016 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12017 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12018 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12019 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12020 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
12022 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12023 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
12024 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12026 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
12027 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
12028 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
12029 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
12031 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
12032 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
12033 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
12034 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
12035 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
12036 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
12037 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
12039 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
12040 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
12041 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
12042 NDR_CHECK(ndr_pull_netr_CryptPassword(ndr
, NDR_SCALARS
, &r
->in
.new_password
));
12043 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12044 ZERO_STRUCTP(r
->out
.return_authenticator
);
12046 if (flags
& NDR_OUT
) {
12047 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12048 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12050 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12051 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
12052 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
12053 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
12054 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
12056 return NDR_ERR_SUCCESS
;
12059 _PUBLIC_
void ndr_print_netr_ServerPasswordSet2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordSet2
*r
)
12061 ndr_print_struct(ndr
, name
, "netr_ServerPasswordSet2");
12063 if (flags
& NDR_SET_VALUES
) {
12064 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12066 if (flags
& NDR_IN
) {
12067 ndr_print_struct(ndr
, "in", "netr_ServerPasswordSet2");
12069 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12071 if (r
->in
.server_name
) {
12072 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12075 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
12076 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
12077 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
12078 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
12079 ndr_print_netr_CryptPassword(ndr
, "new_password", &r
->in
.new_password
);
12082 if (flags
& NDR_OUT
) {
12083 ndr_print_struct(ndr
, "out", "netr_ServerPasswordSet2");
12085 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12087 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12089 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
12095 static enum ndr_err_code
ndr_push_netr_ServerPasswordGet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordGet
*r
)
12097 if (flags
& NDR_IN
) {
12098 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12099 if (r
->in
.server_name
) {
12100 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12101 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12102 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12103 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12105 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
12106 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12107 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
12108 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12109 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
12110 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12111 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12112 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12113 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12114 if (r
->in
.credential
== NULL
) {
12115 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12117 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
12119 if (flags
& NDR_OUT
) {
12120 if (r
->out
.return_authenticator
== NULL
) {
12121 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12123 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
12124 if (r
->out
.password
== NULL
) {
12125 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12127 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password
));
12128 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12130 return NDR_ERR_SUCCESS
;
12133 static enum ndr_err_code
ndr_pull_netr_ServerPasswordGet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordGet
*r
)
12135 uint32_t _ptr_server_name
;
12136 TALLOC_CTX
*_mem_save_server_name_0
;
12137 TALLOC_CTX
*_mem_save_credential_0
;
12138 TALLOC_CTX
*_mem_save_return_authenticator_0
;
12139 TALLOC_CTX
*_mem_save_password_0
;
12140 if (flags
& NDR_IN
) {
12141 ZERO_STRUCT(r
->out
);
12143 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12144 if (_ptr_server_name
) {
12145 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12147 r
->in
.server_name
= NULL
;
12149 if (r
->in
.server_name
) {
12150 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12151 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12152 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12153 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12154 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12155 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
12157 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12158 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
12159 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12161 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
12162 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
12163 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
12164 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
12166 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
12167 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
12168 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
12169 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
12170 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
12171 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
12172 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
12174 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
12175 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
12176 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12177 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
12179 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12180 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
12181 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
12182 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
12183 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12184 ZERO_STRUCTP(r
->out
.return_authenticator
);
12185 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
12186 ZERO_STRUCTP(r
->out
.password
);
12188 if (flags
& NDR_OUT
) {
12189 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12190 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12192 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12193 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
12194 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
12195 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
12196 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12197 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
12199 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12200 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password
, LIBNDR_FLAG_REF_ALLOC
);
12201 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password
));
12202 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, LIBNDR_FLAG_REF_ALLOC
);
12203 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12205 return NDR_ERR_SUCCESS
;
12208 _PUBLIC_
void ndr_print_netr_ServerPasswordGet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordGet
*r
)
12210 ndr_print_struct(ndr
, name
, "netr_ServerPasswordGet");
12212 if (flags
& NDR_SET_VALUES
) {
12213 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12215 if (flags
& NDR_IN
) {
12216 ndr_print_struct(ndr
, "in", "netr_ServerPasswordGet");
12218 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12220 if (r
->in
.server_name
) {
12221 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12224 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
12225 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
12226 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
12227 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
12229 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
12233 if (flags
& NDR_OUT
) {
12234 ndr_print_struct(ndr
, "out", "netr_ServerPasswordGet");
12236 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12238 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12240 ndr_print_ptr(ndr
, "password", r
->out
.password
);
12242 ndr_print_samr_Password(ndr
, "password", r
->out
.password
);
12244 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12250 static enum ndr_err_code
ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONSENDTOSAM
*r
)
12252 if (flags
& NDR_IN
) {
12254 if (flags
& NDR_OUT
) {
12255 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12257 return NDR_ERR_SUCCESS
;
12260 static enum ndr_err_code
ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONSENDTOSAM
*r
)
12262 if (flags
& NDR_IN
) {
12264 if (flags
& NDR_OUT
) {
12265 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12267 return NDR_ERR_SUCCESS
;
12270 _PUBLIC_
void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONSENDTOSAM
*r
)
12272 ndr_print_struct(ndr
, name
, "netr_NETRLOGONSENDTOSAM");
12274 if (flags
& NDR_SET_VALUES
) {
12275 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12277 if (flags
& NDR_IN
) {
12278 ndr_print_struct(ndr
, "in", "netr_NETRLOGONSENDTOSAM");
12282 if (flags
& NDR_OUT
) {
12283 ndr_print_struct(ndr
, "out", "netr_NETRLOGONSENDTOSAM");
12285 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12291 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push
*ndr
, int flags
, const struct netr_DsRAddressToSitenamesW
*r
)
12293 uint32_t cntr_addresses_1
;
12294 if (flags
& NDR_IN
) {
12295 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12296 if (r
->in
.server_name
) {
12297 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12298 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12299 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12300 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12302 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
12303 if (r
->in
.addresses
== NULL
) {
12304 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12306 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
12307 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12308 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
12310 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12311 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
12314 if (flags
& NDR_OUT
) {
12315 if (r
->out
.ctr
== NULL
) {
12316 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12318 if (*r
->out
.ctr
== NULL
) {
12319 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12321 NDR_CHECK(ndr_push_ref_ptr(ndr
));
12322 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
12323 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12325 return NDR_ERR_SUCCESS
;
12328 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull
*ndr
, int flags
, struct netr_DsRAddressToSitenamesW
*r
)
12330 uint32_t _ptr_server_name
;
12331 uint32_t cntr_addresses_1
;
12333 TALLOC_CTX
*_mem_save_server_name_0
;
12334 TALLOC_CTX
*_mem_save_addresses_1
;
12335 TALLOC_CTX
*_mem_save_ctr_0
;
12336 TALLOC_CTX
*_mem_save_ctr_1
;
12337 if (flags
& NDR_IN
) {
12338 ZERO_STRUCT(r
->out
);
12340 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12341 if (_ptr_server_name
) {
12342 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12344 r
->in
.server_name
= NULL
;
12346 if (r
->in
.server_name
) {
12347 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12348 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12349 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12350 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12351 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12352 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
12354 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12355 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
12356 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12358 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
12359 if (r
->in
.count
< 0 || r
->in
.count
> 32000) {
12360 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
12362 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.addresses
));
12363 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12364 NDR_PULL_ALLOC_N(ndr
, r
->in
.addresses
, ndr_get_array_size(ndr
, &r
->in
.addresses
));
12366 _mem_save_addresses_1
= NDR_PULL_GET_MEM_CTX(ndr
);
12367 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.addresses
, 0);
12368 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12369 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
12371 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12372 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
12374 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_addresses_1
, 0);
12375 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
12376 ZERO_STRUCTP(r
->out
.ctr
);
12377 if (r
->in
.addresses
) {
12378 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->in
.addresses
, r
->in
.count
));
12381 if (flags
& NDR_OUT
) {
12382 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12383 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
12385 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12386 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
12387 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_ctr
));
12388 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12389 NDR_PULL_ALLOC(ndr
, *r
->out
.ctr
);
12391 _mem_save_ctr_1
= NDR_PULL_GET_MEM_CTX(ndr
);
12392 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
12393 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
12394 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_1
, LIBNDR_FLAG_REF_ALLOC
);
12395 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
12396 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12398 return NDR_ERR_SUCCESS
;
12401 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRAddressToSitenamesW
*r
)
12403 uint32_t cntr_addresses_1
;
12404 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesW");
12406 if (flags
& NDR_SET_VALUES
) {
12407 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12409 if (flags
& NDR_IN
) {
12410 ndr_print_struct(ndr
, "in", "netr_DsRAddressToSitenamesW");
12412 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12414 if (r
->in
.server_name
) {
12415 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12418 ndr_print_uint32(ndr
, "count", r
->in
.count
);
12419 ndr_print_ptr(ndr
, "addresses", r
->in
.addresses
);
12421 ndr
->print(ndr
, "%s: ARRAY(%d)", "addresses", r
->in
.count
);
12423 for (cntr_addresses_1
=0;cntr_addresses_1
<r
->in
.count
;cntr_addresses_1
++) {
12425 asprintf(&idx_1
, "[%d]", cntr_addresses_1
);
12427 ndr_print_netr_DsRAddress(ndr
, "addresses", &r
->in
.addresses
[cntr_addresses_1
]);
12435 if (flags
& NDR_OUT
) {
12436 ndr_print_struct(ndr
, "out", "netr_DsRAddressToSitenamesW");
12438 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
12440 ndr_print_ptr(ndr
, "ctr", *r
->out
.ctr
);
12442 ndr_print_netr_DsRAddressToSitenamesWCtr(ndr
, "ctr", *r
->out
.ctr
);
12445 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12451 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameEx2(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCNameEx2
*r
)
12453 if (flags
& NDR_IN
) {
12454 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
12455 if (r
->in
.server_unc
) {
12456 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
12457 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12458 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
12459 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_unc
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12461 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.client_account
));
12462 if (r
->in
.client_account
) {
12463 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.client_account
, CH_UTF16
)));
12464 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12465 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.client_account
, CH_UTF16
)));
12466 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.client_account
, ndr_charset_length(r
->in
.client_account
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12468 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->in
.mask
));
12469 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
12470 if (r
->in
.domain_name
) {
12471 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12472 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12473 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12474 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domain_name
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12476 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
12477 if (r
->in
.domain_guid
) {
12478 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
12480 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_name
));
12481 if (r
->in
.site_name
) {
12482 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
12483 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12484 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
12485 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.site_name
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12487 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
12489 if (flags
& NDR_OUT
) {
12490 if (r
->out
.info
== NULL
) {
12491 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12493 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
12494 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12496 return NDR_ERR_SUCCESS
;
12499 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCNameEx2
*r
)
12501 uint32_t _ptr_server_unc
;
12502 uint32_t _ptr_client_account
;
12503 uint32_t _ptr_domain_name
;
12504 uint32_t _ptr_domain_guid
;
12505 uint32_t _ptr_site_name
;
12506 TALLOC_CTX
*_mem_save_server_unc_0
;
12507 TALLOC_CTX
*_mem_save_client_account_0
;
12508 TALLOC_CTX
*_mem_save_domain_name_0
;
12509 TALLOC_CTX
*_mem_save_domain_guid_0
;
12510 TALLOC_CTX
*_mem_save_site_name_0
;
12511 TALLOC_CTX
*_mem_save_info_0
;
12512 if (flags
& NDR_IN
) {
12513 ZERO_STRUCT(r
->out
);
12515 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
12516 if (_ptr_server_unc
) {
12517 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
12519 r
->in
.server_unc
= NULL
;
12521 if (r
->in
.server_unc
) {
12522 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12523 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
12524 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
12525 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
12526 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
12527 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_unc
), ndr_get_array_length(ndr
, &r
->in
.server_unc
));
12529 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
12530 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_unc
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t), CH_UTF16
));
12531 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
12533 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_client_account
));
12534 if (_ptr_client_account
) {
12535 NDR_PULL_ALLOC(ndr
, r
->in
.client_account
);
12537 r
->in
.client_account
= NULL
;
12539 if (r
->in
.client_account
) {
12540 _mem_save_client_account_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12541 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.client_account
, 0);
12542 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.client_account
));
12543 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.client_account
));
12544 if (ndr_get_array_length(ndr
, &r
->in
.client_account
) > ndr_get_array_size(ndr
, &r
->in
.client_account
)) {
12545 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.client_account
), ndr_get_array_length(ndr
, &r
->in
.client_account
));
12547 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.client_account
), sizeof(uint16_t)));
12548 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.client_account
, ndr_get_array_length(ndr
, &r
->in
.client_account
), sizeof(uint16_t), CH_UTF16
));
12549 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_client_account_0
, 0);
12551 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->in
.mask
));
12552 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
12553 if (_ptr_domain_name
) {
12554 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
12556 r
->in
.domain_name
= NULL
;
12558 if (r
->in
.domain_name
) {
12559 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12560 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
12561 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
12562 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
12563 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
12564 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.domain_name
), ndr_get_array_length(ndr
, &r
->in
.domain_name
));
12566 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
12567 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domain_name
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t), CH_UTF16
));
12568 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
12570 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
12571 if (_ptr_domain_guid
) {
12572 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
12574 r
->in
.domain_guid
= NULL
;
12576 if (r
->in
.domain_guid
) {
12577 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12578 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
12579 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.domain_guid
));
12580 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
12582 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_name
));
12583 if (_ptr_site_name
) {
12584 NDR_PULL_ALLOC(ndr
, r
->in
.site_name
);
12586 r
->in
.site_name
= NULL
;
12588 if (r
->in
.site_name
) {
12589 _mem_save_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12590 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_name
, 0);
12591 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.site_name
));
12592 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.site_name
));
12593 if (ndr_get_array_length(ndr
, &r
->in
.site_name
) > ndr_get_array_size(ndr
, &r
->in
.site_name
)) {
12594 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.site_name
), ndr_get_array_length(ndr
, &r
->in
.site_name
));
12596 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t)));
12597 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.site_name
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t), CH_UTF16
));
12598 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_name_0
, 0);
12600 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
12601 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
12602 ZERO_STRUCTP(r
->out
.info
);
12604 if (flags
& NDR_OUT
) {
12605 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12606 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
12608 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12609 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
12610 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
12611 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
12612 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12614 return NDR_ERR_SUCCESS
;
12617 _PUBLIC_
void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCNameEx2
*r
)
12619 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameEx2");
12621 if (flags
& NDR_SET_VALUES
) {
12622 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12624 if (flags
& NDR_IN
) {
12625 ndr_print_struct(ndr
, "in", "netr_DsRGetDCNameEx2");
12627 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
12629 if (r
->in
.server_unc
) {
12630 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
12633 ndr_print_ptr(ndr
, "client_account", r
->in
.client_account
);
12635 if (r
->in
.client_account
) {
12636 ndr_print_string(ndr
, "client_account", r
->in
.client_account
);
12639 ndr_print_samr_AcctFlags(ndr
, "mask", r
->in
.mask
);
12640 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
12642 if (r
->in
.domain_name
) {
12643 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
12646 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
12648 if (r
->in
.domain_guid
) {
12649 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
12652 ndr_print_ptr(ndr
, "site_name", r
->in
.site_name
);
12654 if (r
->in
.site_name
) {
12655 ndr_print_string(ndr
, "site_name", r
->in
.site_name
);
12658 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
12661 if (flags
& NDR_OUT
) {
12662 ndr_print_struct(ndr
, "out", "netr_DsRGetDCNameEx2");
12664 ndr_print_ptr(ndr
, "info", r
->out
.info
);
12666 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", r
->out
.info
);
12668 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12674 static enum ndr_err_code
ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
12676 if (flags
& NDR_IN
) {
12678 if (flags
& NDR_OUT
) {
12679 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12681 return NDR_ERR_SUCCESS
;
12684 static enum ndr_err_code
ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
12686 if (flags
& NDR_IN
) {
12688 if (flags
& NDR_OUT
) {
12689 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12691 return NDR_ERR_SUCCESS
;
12694 _PUBLIC_
void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
12696 ndr_print_struct(ndr
, name
, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
12698 if (flags
& NDR_SET_VALUES
) {
12699 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12701 if (flags
& NDR_IN
) {
12702 ndr_print_struct(ndr
, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
12706 if (flags
& NDR_OUT
) {
12707 ndr_print_struct(ndr
, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
12709 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12715 static enum ndr_err_code
ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push
*ndr
, int flags
, const struct netr_NetrEnumerateTrustedDomainsEx
*r
)
12717 if (flags
& NDR_IN
) {
12718 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12719 if (r
->in
.server_name
) {
12720 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12721 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12722 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12723 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12726 if (flags
& NDR_OUT
) {
12727 if (r
->out
.dom_trust_list
== NULL
) {
12728 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12730 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.dom_trust_list
));
12731 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12733 return NDR_ERR_SUCCESS
;
12736 static enum ndr_err_code
ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull
*ndr
, int flags
, struct netr_NetrEnumerateTrustedDomainsEx
*r
)
12738 uint32_t _ptr_server_name
;
12739 TALLOC_CTX
*_mem_save_server_name_0
;
12740 TALLOC_CTX
*_mem_save_dom_trust_list_0
;
12741 if (flags
& NDR_IN
) {
12742 ZERO_STRUCT(r
->out
);
12744 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12745 if (_ptr_server_name
) {
12746 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12748 r
->in
.server_name
= NULL
;
12750 if (r
->in
.server_name
) {
12751 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12752 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12753 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12754 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12755 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12756 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
12758 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12759 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
12760 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12762 NDR_PULL_ALLOC(ndr
, r
->out
.dom_trust_list
);
12763 ZERO_STRUCTP(r
->out
.dom_trust_list
);
12765 if (flags
& NDR_OUT
) {
12766 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12767 NDR_PULL_ALLOC(ndr
, r
->out
.dom_trust_list
);
12769 _mem_save_dom_trust_list_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12770 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dom_trust_list
, LIBNDR_FLAG_REF_ALLOC
);
12771 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.dom_trust_list
));
12772 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dom_trust_list_0
, LIBNDR_FLAG_REF_ALLOC
);
12773 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12775 return NDR_ERR_SUCCESS
;
12778 _PUBLIC_
void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NetrEnumerateTrustedDomainsEx
*r
)
12780 ndr_print_struct(ndr
, name
, "netr_NetrEnumerateTrustedDomainsEx");
12782 if (flags
& NDR_SET_VALUES
) {
12783 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12785 if (flags
& NDR_IN
) {
12786 ndr_print_struct(ndr
, "in", "netr_NetrEnumerateTrustedDomainsEx");
12788 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12790 if (r
->in
.server_name
) {
12791 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12796 if (flags
& NDR_OUT
) {
12797 ndr_print_struct(ndr
, "out", "netr_NetrEnumerateTrustedDomainsEx");
12799 ndr_print_ptr(ndr
, "dom_trust_list", r
->out
.dom_trust_list
);
12801 ndr_print_netr_DomainTrustList(ndr
, "dom_trust_list", r
->out
.dom_trust_list
);
12803 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12809 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push
*ndr
, int flags
, const struct netr_DsRAddressToSitenamesExW
*r
)
12811 uint32_t cntr_addresses_1
;
12812 if (flags
& NDR_IN
) {
12813 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12814 if (r
->in
.server_name
) {
12815 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12816 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12817 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12818 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12820 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
12821 if (r
->in
.addresses
== NULL
) {
12822 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12824 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
12825 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12826 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
12828 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12829 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
12832 if (flags
& NDR_OUT
) {
12833 if (r
->out
.ctr
== NULL
) {
12834 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12836 if (*r
->out
.ctr
== NULL
) {
12837 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12839 NDR_CHECK(ndr_push_ref_ptr(ndr
));
12840 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
12841 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12843 return NDR_ERR_SUCCESS
;
12846 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull
*ndr
, int flags
, struct netr_DsRAddressToSitenamesExW
*r
)
12848 uint32_t _ptr_server_name
;
12849 uint32_t cntr_addresses_1
;
12851 TALLOC_CTX
*_mem_save_server_name_0
;
12852 TALLOC_CTX
*_mem_save_addresses_1
;
12853 TALLOC_CTX
*_mem_save_ctr_0
;
12854 TALLOC_CTX
*_mem_save_ctr_1
;
12855 if (flags
& NDR_IN
) {
12856 ZERO_STRUCT(r
->out
);
12858 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12859 if (_ptr_server_name
) {
12860 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12862 r
->in
.server_name
= NULL
;
12864 if (r
->in
.server_name
) {
12865 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12866 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12867 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12868 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12869 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12870 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
12872 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12873 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
12874 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12876 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
12877 if (r
->in
.count
< 0 || r
->in
.count
> 32000) {
12878 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
12880 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.addresses
));
12881 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12882 NDR_PULL_ALLOC_N(ndr
, r
->in
.addresses
, ndr_get_array_size(ndr
, &r
->in
.addresses
));
12884 _mem_save_addresses_1
= NDR_PULL_GET_MEM_CTX(ndr
);
12885 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.addresses
, 0);
12886 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12887 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
12889 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
12890 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
12892 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_addresses_1
, 0);
12893 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
12894 ZERO_STRUCTP(r
->out
.ctr
);
12895 if (r
->in
.addresses
) {
12896 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->in
.addresses
, r
->in
.count
));
12899 if (flags
& NDR_OUT
) {
12900 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12901 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
12903 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12904 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
12905 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_ctr
));
12906 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12907 NDR_PULL_ALLOC(ndr
, *r
->out
.ctr
);
12909 _mem_save_ctr_1
= NDR_PULL_GET_MEM_CTX(ndr
);
12910 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
12911 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
12912 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_1
, LIBNDR_FLAG_REF_ALLOC
);
12913 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
12914 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12916 return NDR_ERR_SUCCESS
;
12919 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRAddressToSitenamesExW
*r
)
12921 uint32_t cntr_addresses_1
;
12922 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesExW");
12924 if (flags
& NDR_SET_VALUES
) {
12925 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12927 if (flags
& NDR_IN
) {
12928 ndr_print_struct(ndr
, "in", "netr_DsRAddressToSitenamesExW");
12930 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12932 if (r
->in
.server_name
) {
12933 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12936 ndr_print_uint32(ndr
, "count", r
->in
.count
);
12937 ndr_print_ptr(ndr
, "addresses", r
->in
.addresses
);
12939 ndr
->print(ndr
, "%s: ARRAY(%d)", "addresses", r
->in
.count
);
12941 for (cntr_addresses_1
=0;cntr_addresses_1
<r
->in
.count
;cntr_addresses_1
++) {
12943 asprintf(&idx_1
, "[%d]", cntr_addresses_1
);
12945 ndr_print_netr_DsRAddress(ndr
, "addresses", &r
->in
.addresses
[cntr_addresses_1
]);
12953 if (flags
& NDR_OUT
) {
12954 ndr_print_struct(ndr
, "out", "netr_DsRAddressToSitenamesExW");
12956 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
12958 ndr_print_ptr(ndr
, "ctr", *r
->out
.ctr
);
12960 ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr
, "ctr", *r
->out
.ctr
);
12963 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12969 static enum ndr_err_code
ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push
*ndr
, int flags
, const struct netr_DsrGetDcSiteCoverageW
*r
)
12971 if (flags
& NDR_IN
) {
12972 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12973 if (r
->in
.server_name
) {
12974 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12975 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12976 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12977 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
12980 if (flags
& NDR_OUT
) {
12981 if (r
->out
.ctr
== NULL
) {
12982 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12984 NDR_CHECK(ndr_push_DcSitesCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.ctr
));
12985 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12987 return NDR_ERR_SUCCESS
;
12990 static enum ndr_err_code
ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull
*ndr
, int flags
, struct netr_DsrGetDcSiteCoverageW
*r
)
12992 uint32_t _ptr_server_name
;
12993 TALLOC_CTX
*_mem_save_server_name_0
;
12994 TALLOC_CTX
*_mem_save_ctr_0
;
12995 if (flags
& NDR_IN
) {
12996 ZERO_STRUCT(r
->out
);
12998 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12999 if (_ptr_server_name
) {
13000 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13002 r
->in
.server_name
= NULL
;
13004 if (r
->in
.server_name
) {
13005 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13006 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13007 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13008 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13009 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13010 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13012 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13013 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13014 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13016 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
13017 ZERO_STRUCTP(r
->out
.ctr
);
13019 if (flags
& NDR_OUT
) {
13020 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13021 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
13023 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13024 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
13025 NDR_CHECK(ndr_pull_DcSitesCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.ctr
));
13026 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
13027 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13029 return NDR_ERR_SUCCESS
;
13032 _PUBLIC_
void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsrGetDcSiteCoverageW
*r
)
13034 ndr_print_struct(ndr
, name
, "netr_DsrGetDcSiteCoverageW");
13036 if (flags
& NDR_SET_VALUES
) {
13037 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13039 if (flags
& NDR_IN
) {
13040 ndr_print_struct(ndr
, "in", "netr_DsrGetDcSiteCoverageW");
13042 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13044 if (r
->in
.server_name
) {
13045 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13050 if (flags
& NDR_OUT
) {
13051 ndr_print_struct(ndr
, "out", "netr_DsrGetDcSiteCoverageW");
13053 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
13055 ndr_print_DcSitesCtr(ndr
, "ctr", r
->out
.ctr
);
13057 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13063 static enum ndr_err_code
ndr_push_netr_LogonSamLogonEx(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogonEx
*r
)
13065 if (flags
& NDR_IN
) {
13066 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13067 if (r
->in
.server_name
) {
13068 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13069 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13070 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13071 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13073 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
13074 if (r
->in
.computer_name
) {
13075 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13076 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13077 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13078 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13080 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
13081 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
13082 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
13083 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
13084 if (r
->in
.flags
== NULL
) {
13085 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13087 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.flags
));
13089 if (flags
& NDR_OUT
) {
13090 if (r
->out
.validation
== NULL
) {
13091 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13093 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
13094 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
13095 if (r
->out
.authoritative
== NULL
) {
13096 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13098 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
13099 if (r
->out
.flags
== NULL
) {
13100 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13102 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.flags
));
13103 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
13105 return NDR_ERR_SUCCESS
;
13108 static enum ndr_err_code
ndr_pull_netr_LogonSamLogonEx(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogonEx
*r
)
13110 uint32_t _ptr_server_name
;
13111 uint32_t _ptr_computer_name
;
13112 TALLOC_CTX
*_mem_save_server_name_0
;
13113 TALLOC_CTX
*_mem_save_computer_name_0
;
13114 TALLOC_CTX
*_mem_save_validation_0
;
13115 TALLOC_CTX
*_mem_save_authoritative_0
;
13116 TALLOC_CTX
*_mem_save_flags_0
;
13117 if (flags
& NDR_IN
) {
13118 ZERO_STRUCT(r
->out
);
13120 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13121 if (_ptr_server_name
) {
13122 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13124 r
->in
.server_name
= NULL
;
13126 if (r
->in
.server_name
) {
13127 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13128 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13129 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13130 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13131 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13132 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13134 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13135 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13136 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13138 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
13139 if (_ptr_computer_name
) {
13140 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
13142 r
->in
.computer_name
= NULL
;
13144 if (r
->in
.computer_name
) {
13145 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13146 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
13147 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13148 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13149 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13150 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
13152 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13153 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
13154 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
13156 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
13157 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
13158 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
13159 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
13160 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13161 NDR_PULL_ALLOC(ndr
, r
->in
.flags
);
13163 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13164 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.flags
, LIBNDR_FLAG_REF_ALLOC
);
13165 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
13166 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
13167 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
13168 ZERO_STRUCTP(r
->out
.validation
);
13169 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
13170 ZERO_STRUCTP(r
->out
.authoritative
);
13171 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
13172 *r
->out
.flags
= *r
->in
.flags
;
13174 if (flags
& NDR_OUT
) {
13175 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13176 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
13178 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13179 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
13180 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
13181 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
13182 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
13183 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13184 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
13186 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13187 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
13188 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
13189 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
13190 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13191 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
13193 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13194 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.flags
, LIBNDR_FLAG_REF_ALLOC
);
13195 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.flags
));
13196 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
13197 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
13199 return NDR_ERR_SUCCESS
;
13202 _PUBLIC_
void ndr_print_netr_LogonSamLogonEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogonEx
*r
)
13204 ndr_print_struct(ndr
, name
, "netr_LogonSamLogonEx");
13206 if (flags
& NDR_SET_VALUES
) {
13207 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13209 if (flags
& NDR_IN
) {
13210 ndr_print_struct(ndr
, "in", "netr_LogonSamLogonEx");
13212 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13214 if (r
->in
.server_name
) {
13215 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13218 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
13220 if (r
->in
.computer_name
) {
13221 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13224 ndr_print_uint16(ndr
, "logon_level", r
->in
.logon_level
);
13225 ndr_print_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
);
13226 ndr_print_netr_LogonLevel(ndr
, "logon", &r
->in
.logon
);
13227 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
13228 ndr_print_ptr(ndr
, "flags", r
->in
.flags
);
13230 ndr_print_uint32(ndr
, "flags", *r
->in
.flags
);
13234 if (flags
& NDR_OUT
) {
13235 ndr_print_struct(ndr
, "out", "netr_LogonSamLogonEx");
13237 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
13239 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
13240 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
13242 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
13244 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
13246 ndr_print_ptr(ndr
, "flags", r
->out
.flags
);
13248 ndr_print_uint32(ndr
, "flags", *r
->out
.flags
);
13250 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
13256 static enum ndr_err_code
ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push
*ndr
, int flags
, const struct netr_DsrEnumerateDomainTrusts
*r
)
13258 if (flags
& NDR_IN
) {
13259 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13260 if (r
->in
.server_name
) {
13261 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13262 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13263 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13264 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13266 NDR_CHECK(ndr_push_netr_TrustFlags(ndr
, NDR_SCALARS
, r
->in
.trust_flags
));
13268 if (flags
& NDR_OUT
) {
13269 if (r
->out
.trusts
== NULL
) {
13270 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13272 if (*r
->out
.trusts
== NULL
) {
13273 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13275 NDR_CHECK(ndr_push_ref_ptr(ndr
));
13276 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.trusts
));
13277 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13279 return NDR_ERR_SUCCESS
;
13282 static enum ndr_err_code
ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull
*ndr
, int flags
, struct netr_DsrEnumerateDomainTrusts
*r
)
13284 uint32_t _ptr_server_name
;
13285 uint32_t _ptr_trusts
;
13286 TALLOC_CTX
*_mem_save_server_name_0
;
13287 TALLOC_CTX
*_mem_save_trusts_0
;
13288 TALLOC_CTX
*_mem_save_trusts_1
;
13289 if (flags
& NDR_IN
) {
13290 ZERO_STRUCT(r
->out
);
13292 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13293 if (_ptr_server_name
) {
13294 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13296 r
->in
.server_name
= NULL
;
13298 if (r
->in
.server_name
) {
13299 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13300 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13301 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13302 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13303 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13304 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13306 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13307 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13308 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13310 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr
, NDR_SCALARS
, &r
->in
.trust_flags
));
13311 NDR_PULL_ALLOC(ndr
, r
->out
.trusts
);
13312 ZERO_STRUCTP(r
->out
.trusts
);
13314 if (flags
& NDR_OUT
) {
13315 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13316 NDR_PULL_ALLOC(ndr
, r
->out
.trusts
);
13318 _mem_save_trusts_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13319 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.trusts
, LIBNDR_FLAG_REF_ALLOC
);
13320 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_trusts
));
13321 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13322 NDR_PULL_ALLOC(ndr
, *r
->out
.trusts
);
13324 _mem_save_trusts_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13325 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.trusts
, LIBNDR_FLAG_REF_ALLOC
);
13326 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.trusts
));
13327 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_1
, LIBNDR_FLAG_REF_ALLOC
);
13328 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_0
, LIBNDR_FLAG_REF_ALLOC
);
13329 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13331 return NDR_ERR_SUCCESS
;
13334 _PUBLIC_
void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsrEnumerateDomainTrusts
*r
)
13336 ndr_print_struct(ndr
, name
, "netr_DsrEnumerateDomainTrusts");
13338 if (flags
& NDR_SET_VALUES
) {
13339 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13341 if (flags
& NDR_IN
) {
13342 ndr_print_struct(ndr
, "in", "netr_DsrEnumerateDomainTrusts");
13344 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13346 if (r
->in
.server_name
) {
13347 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13350 ndr_print_netr_TrustFlags(ndr
, "trust_flags", r
->in
.trust_flags
);
13353 if (flags
& NDR_OUT
) {
13354 ndr_print_struct(ndr
, "out", "netr_DsrEnumerateDomainTrusts");
13356 ndr_print_ptr(ndr
, "trusts", r
->out
.trusts
);
13358 ndr_print_ptr(ndr
, "trusts", *r
->out
.trusts
);
13360 ndr_print_netr_DomainTrustList(ndr
, "trusts", *r
->out
.trusts
);
13363 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13369 static enum ndr_err_code
ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_push
*ndr
, int flags
, const struct netr_DSRDEREGISTERDNSHOSTRECORDS
*r
)
13371 if (flags
& NDR_IN
) {
13373 if (flags
& NDR_OUT
) {
13374 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13376 return NDR_ERR_SUCCESS
;
13379 static enum ndr_err_code
ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_pull
*ndr
, int flags
, struct netr_DSRDEREGISTERDNSHOSTRECORDS
*r
)
13381 if (flags
& NDR_IN
) {
13383 if (flags
& NDR_OUT
) {
13384 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13386 return NDR_ERR_SUCCESS
;
13389 _PUBLIC_
void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DSRDEREGISTERDNSHOSTRECORDS
*r
)
13391 ndr_print_struct(ndr
, name
, "netr_DSRDEREGISTERDNSHOSTRECORDS");
13393 if (flags
& NDR_SET_VALUES
) {
13394 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13396 if (flags
& NDR_IN
) {
13397 ndr_print_struct(ndr
, "in", "netr_DSRDEREGISTERDNSHOSTRECORDS");
13401 if (flags
& NDR_OUT
) {
13402 ndr_print_struct(ndr
, "out", "netr_DSRDEREGISTERDNSHOSTRECORDS");
13404 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13410 static enum ndr_err_code
ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerTrustPasswordsGet
*r
)
13412 if (flags
& NDR_IN
) {
13413 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13414 if (r
->in
.server_name
) {
13415 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13416 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13417 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13418 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13420 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13421 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13422 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13423 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.account_name
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13424 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
13425 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13426 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13427 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13428 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13429 if (r
->in
.credential
== NULL
) {
13430 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13432 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13434 if (flags
& NDR_OUT
) {
13435 if (r
->out
.return_authenticator
== NULL
) {
13436 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13438 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13439 if (r
->out
.password
== NULL
) {
13440 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13442 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password
));
13443 if (r
->out
.password2
== NULL
) {
13444 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13446 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password2
));
13447 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
13449 return NDR_ERR_SUCCESS
;
13452 static enum ndr_err_code
ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerTrustPasswordsGet
*r
)
13454 uint32_t _ptr_server_name
;
13455 TALLOC_CTX
*_mem_save_server_name_0
;
13456 TALLOC_CTX
*_mem_save_credential_0
;
13457 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13458 TALLOC_CTX
*_mem_save_password_0
;
13459 TALLOC_CTX
*_mem_save_password2_0
;
13460 if (flags
& NDR_IN
) {
13461 ZERO_STRUCT(r
->out
);
13463 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13464 if (_ptr_server_name
) {
13465 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13467 r
->in
.server_name
= NULL
;
13469 if (r
->in
.server_name
) {
13470 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13471 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13472 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13473 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13474 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13475 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13477 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13478 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13479 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13481 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
13482 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
13483 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
13484 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.account_name
), ndr_get_array_length(ndr
, &r
->in
.account_name
));
13486 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
13487 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.account_name
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t), CH_UTF16
));
13488 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
13489 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13490 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13491 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13492 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
13494 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13495 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
13496 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13497 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
13499 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13500 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
13501 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13502 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
13503 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13504 ZERO_STRUCTP(r
->out
.return_authenticator
);
13505 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
13506 ZERO_STRUCTP(r
->out
.password
);
13507 NDR_PULL_ALLOC(ndr
, r
->out
.password2
);
13508 ZERO_STRUCTP(r
->out
.password2
);
13510 if (flags
& NDR_OUT
) {
13511 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13512 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13514 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13515 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13516 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13517 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13518 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13519 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
13521 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13522 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password
, LIBNDR_FLAG_REF_ALLOC
);
13523 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password
));
13524 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, LIBNDR_FLAG_REF_ALLOC
);
13525 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13526 NDR_PULL_ALLOC(ndr
, r
->out
.password2
);
13528 _mem_save_password2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13529 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password2
, LIBNDR_FLAG_REF_ALLOC
);
13530 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.password2
));
13531 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password2_0
, LIBNDR_FLAG_REF_ALLOC
);
13532 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
13534 return NDR_ERR_SUCCESS
;
13537 _PUBLIC_
void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerTrustPasswordsGet
*r
)
13539 ndr_print_struct(ndr
, name
, "netr_ServerTrustPasswordsGet");
13541 if (flags
& NDR_SET_VALUES
) {
13542 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13544 if (flags
& NDR_IN
) {
13545 ndr_print_struct(ndr
, "in", "netr_ServerTrustPasswordsGet");
13547 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13549 if (r
->in
.server_name
) {
13550 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13553 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
13554 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
13555 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13556 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
13558 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
13562 if (flags
& NDR_OUT
) {
13563 ndr_print_struct(ndr
, "out", "netr_ServerTrustPasswordsGet");
13565 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13567 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13569 ndr_print_ptr(ndr
, "password", r
->out
.password
);
13571 ndr_print_samr_Password(ndr
, "password", r
->out
.password
);
13573 ndr_print_ptr(ndr
, "password2", r
->out
.password2
);
13575 ndr_print_samr_Password(ndr
, "password2", r
->out
.password2
);
13577 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
13583 static enum ndr_err_code
ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetForestTrustInformation
*r
)
13585 if (flags
& NDR_IN
) {
13586 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13587 if (r
->in
.server_name
) {
13588 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13589 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13590 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13591 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13593 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.trusted_domain_name
));
13594 if (r
->in
.trusted_domain_name
) {
13595 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
13596 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13597 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
13598 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.trusted_domain_name
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13600 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
13602 if (flags
& NDR_OUT
) {
13603 if (r
->out
.forest_trust_info
== NULL
) {
13604 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13606 if (*r
->out
.forest_trust_info
== NULL
) {
13607 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13609 NDR_CHECK(ndr_push_ref_ptr(ndr
));
13610 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
13611 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13613 return NDR_ERR_SUCCESS
;
13616 static enum ndr_err_code
ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetForestTrustInformation
*r
)
13618 uint32_t _ptr_server_name
;
13619 uint32_t _ptr_trusted_domain_name
;
13620 uint32_t _ptr_forest_trust_info
;
13621 TALLOC_CTX
*_mem_save_server_name_0
;
13622 TALLOC_CTX
*_mem_save_trusted_domain_name_0
;
13623 TALLOC_CTX
*_mem_save_forest_trust_info_0
;
13624 TALLOC_CTX
*_mem_save_forest_trust_info_1
;
13625 if (flags
& NDR_IN
) {
13626 ZERO_STRUCT(r
->out
);
13628 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13629 if (_ptr_server_name
) {
13630 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13632 r
->in
.server_name
= NULL
;
13634 if (r
->in
.server_name
) {
13635 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13636 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13637 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13638 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13639 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13640 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13642 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13643 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13644 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13646 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_domain_name
));
13647 if (_ptr_trusted_domain_name
) {
13648 NDR_PULL_ALLOC(ndr
, r
->in
.trusted_domain_name
);
13650 r
->in
.trusted_domain_name
= NULL
;
13652 if (r
->in
.trusted_domain_name
) {
13653 _mem_save_trusted_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13654 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.trusted_domain_name
, 0);
13655 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.trusted_domain_name
));
13656 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.trusted_domain_name
));
13657 if (ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
) > ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
)) {
13658 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
), ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
));
13660 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t)));
13661 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.trusted_domain_name
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t), CH_UTF16
));
13662 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domain_name_0
, 0);
13664 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.flags
));
13665 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
13666 ZERO_STRUCTP(r
->out
.forest_trust_info
);
13668 if (flags
& NDR_OUT
) {
13669 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13670 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
13672 _mem_save_forest_trust_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13673 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
13674 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_forest_trust_info
));
13675 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13676 NDR_PULL_ALLOC(ndr
, *r
->out
.forest_trust_info
);
13678 _mem_save_forest_trust_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13679 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
13680 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
13681 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_1
, LIBNDR_FLAG_REF_ALLOC
);
13682 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_0
, LIBNDR_FLAG_REF_ALLOC
);
13683 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13685 return NDR_ERR_SUCCESS
;
13688 _PUBLIC_
void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetForestTrustInformation
*r
)
13690 ndr_print_struct(ndr
, name
, "netr_DsRGetForestTrustInformation");
13692 if (flags
& NDR_SET_VALUES
) {
13693 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13695 if (flags
& NDR_IN
) {
13696 ndr_print_struct(ndr
, "in", "netr_DsRGetForestTrustInformation");
13698 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13700 if (r
->in
.server_name
) {
13701 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13704 ndr_print_ptr(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
13706 if (r
->in
.trusted_domain_name
) {
13707 ndr_print_string(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
13710 ndr_print_uint32(ndr
, "flags", r
->in
.flags
);
13713 if (flags
& NDR_OUT
) {
13714 ndr_print_struct(ndr
, "out", "netr_DsRGetForestTrustInformation");
13716 ndr_print_ptr(ndr
, "forest_trust_info", r
->out
.forest_trust_info
);
13718 ndr_print_ptr(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
13720 ndr_print_lsa_ForestTrustInformation(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
13723 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13729 static enum ndr_err_code
ndr_push_netr_GetForestTrustInformation(struct ndr_push
*ndr
, int flags
, const struct netr_GetForestTrustInformation
*r
)
13731 if (flags
& NDR_IN
) {
13732 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13733 if (r
->in
.server_name
) {
13734 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13735 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13736 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13737 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13739 if (r
->in
.trusted_domain_name
== NULL
) {
13740 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13742 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
13743 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13744 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
13745 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.trusted_domain_name
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13746 if (r
->in
.credential
== NULL
) {
13747 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13749 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13750 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
13752 if (flags
& NDR_OUT
) {
13753 if (r
->out
.return_authenticator
== NULL
) {
13754 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13756 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13757 if (r
->out
.forest_trust_info
== NULL
) {
13758 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13760 if (*r
->out
.forest_trust_info
== NULL
) {
13761 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13763 NDR_CHECK(ndr_push_ref_ptr(ndr
));
13764 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
13765 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13767 return NDR_ERR_SUCCESS
;
13770 static enum ndr_err_code
ndr_pull_netr_GetForestTrustInformation(struct ndr_pull
*ndr
, int flags
, struct netr_GetForestTrustInformation
*r
)
13772 uint32_t _ptr_server_name
;
13773 uint32_t _ptr_forest_trust_info
;
13774 TALLOC_CTX
*_mem_save_server_name_0
;
13775 TALLOC_CTX
*_mem_save_credential_0
;
13776 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13777 TALLOC_CTX
*_mem_save_forest_trust_info_0
;
13778 TALLOC_CTX
*_mem_save_forest_trust_info_1
;
13779 if (flags
& NDR_IN
) {
13780 ZERO_STRUCT(r
->out
);
13782 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13783 if (_ptr_server_name
) {
13784 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13786 r
->in
.server_name
= NULL
;
13788 if (r
->in
.server_name
) {
13789 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13790 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13791 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13792 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13793 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13794 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13796 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13797 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13798 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13800 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.trusted_domain_name
));
13801 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.trusted_domain_name
));
13802 if (ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
) > ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
)) {
13803 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
), ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
));
13805 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t)));
13806 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.trusted_domain_name
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t), CH_UTF16
));
13807 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13808 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
13810 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13811 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
13812 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13813 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
13814 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.flags
));
13815 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13816 ZERO_STRUCTP(r
->out
.return_authenticator
);
13817 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
13818 ZERO_STRUCTP(r
->out
.forest_trust_info
);
13820 if (flags
& NDR_OUT
) {
13821 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13822 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13824 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13825 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13826 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13827 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13828 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13829 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
13831 _mem_save_forest_trust_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13832 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
13833 NDR_CHECK(ndr_pull_ref_ptr(ndr
, &_ptr_forest_trust_info
));
13834 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13835 NDR_PULL_ALLOC(ndr
, *r
->out
.forest_trust_info
);
13837 _mem_save_forest_trust_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13838 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
13839 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
13840 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_1
, LIBNDR_FLAG_REF_ALLOC
);
13841 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_0
, LIBNDR_FLAG_REF_ALLOC
);
13842 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13844 return NDR_ERR_SUCCESS
;
13847 _PUBLIC_
void ndr_print_netr_GetForestTrustInformation(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetForestTrustInformation
*r
)
13849 ndr_print_struct(ndr
, name
, "netr_GetForestTrustInformation");
13851 if (flags
& NDR_SET_VALUES
) {
13852 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13854 if (flags
& NDR_IN
) {
13855 ndr_print_struct(ndr
, "in", "netr_GetForestTrustInformation");
13857 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13859 if (r
->in
.server_name
) {
13860 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13863 ndr_print_ptr(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
13865 ndr_print_string(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
13867 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
13869 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
13871 ndr_print_uint32(ndr
, "flags", r
->in
.flags
);
13874 if (flags
& NDR_OUT
) {
13875 ndr_print_struct(ndr
, "out", "netr_GetForestTrustInformation");
13877 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13879 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13881 ndr_print_ptr(ndr
, "forest_trust_info", r
->out
.forest_trust_info
);
13883 ndr_print_ptr(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
13885 ndr_print_lsa_ForestTrustInformation(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
13888 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13894 static enum ndr_err_code
ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogonWithFlags
*r
)
13896 if (flags
& NDR_IN
) {
13897 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13898 if (r
->in
.server_name
) {
13899 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13900 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13901 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13902 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.server_name
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13904 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
13905 if (r
->in
.computer_name
) {
13906 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13907 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13908 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13909 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computer_name
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13911 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
13912 if (r
->in
.credential
) {
13913 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13915 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
13916 if (r
->in
.return_authenticator
) {
13917 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
13919 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
13920 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
13921 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
13922 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
13923 if (r
->in
.flags
== NULL
) {
13924 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13926 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.flags
));
13928 if (flags
& NDR_OUT
) {
13929 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
13930 if (r
->out
.return_authenticator
) {
13931 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13933 if (r
->out
.validation
== NULL
) {
13934 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13936 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
13937 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
13938 if (r
->out
.authoritative
== NULL
) {
13939 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13941 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
13942 if (r
->out
.flags
== NULL
) {
13943 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13945 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.flags
));
13946 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
13948 return NDR_ERR_SUCCESS
;
13951 static enum ndr_err_code
ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogonWithFlags
*r
)
13953 uint32_t _ptr_server_name
;
13954 uint32_t _ptr_computer_name
;
13955 uint32_t _ptr_credential
;
13956 uint32_t _ptr_return_authenticator
;
13957 TALLOC_CTX
*_mem_save_server_name_0
;
13958 TALLOC_CTX
*_mem_save_computer_name_0
;
13959 TALLOC_CTX
*_mem_save_credential_0
;
13960 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13961 TALLOC_CTX
*_mem_save_validation_0
;
13962 TALLOC_CTX
*_mem_save_authoritative_0
;
13963 TALLOC_CTX
*_mem_save_flags_0
;
13964 if (flags
& NDR_IN
) {
13965 ZERO_STRUCT(r
->out
);
13967 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13968 if (_ptr_server_name
) {
13969 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13971 r
->in
.server_name
= NULL
;
13973 if (r
->in
.server_name
) {
13974 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13975 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13976 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13977 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13978 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13979 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.server_name
), ndr_get_array_length(ndr
, &r
->in
.server_name
));
13981 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13982 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.server_name
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t), CH_UTF16
));
13983 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13985 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
13986 if (_ptr_computer_name
) {
13987 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
13989 r
->in
.computer_name
= NULL
;
13991 if (r
->in
.computer_name
) {
13992 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13993 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
13994 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13995 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13996 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13997 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->in
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
13999 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
14000 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computer_name
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t), CH_UTF16
));
14001 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
14003 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
14004 if (_ptr_credential
) {
14005 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
14007 r
->in
.credential
= NULL
;
14009 if (r
->in
.credential
) {
14010 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14011 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
14012 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
14013 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
14015 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
14016 if (_ptr_return_authenticator
) {
14017 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
14019 r
->in
.return_authenticator
= NULL
;
14021 if (r
->in
.return_authenticator
) {
14022 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14023 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
14024 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
14025 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
14027 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
14028 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
14029 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
14030 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
14031 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14032 NDR_PULL_ALLOC(ndr
, r
->in
.flags
);
14034 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14035 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.flags
, LIBNDR_FLAG_REF_ALLOC
);
14036 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
14037 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
14038 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
14039 ZERO_STRUCTP(r
->out
.validation
);
14040 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
14041 ZERO_STRUCTP(r
->out
.authoritative
);
14042 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
14043 *r
->out
.flags
= *r
->in
.flags
;
14045 if (flags
& NDR_OUT
) {
14046 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
14047 if (_ptr_return_authenticator
) {
14048 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
14050 r
->out
.return_authenticator
= NULL
;
14052 if (r
->out
.return_authenticator
) {
14053 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14054 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
14055 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
14056 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
14058 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14059 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
14061 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14062 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
14063 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
14064 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
14065 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
14066 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14067 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
14069 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14070 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
14071 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
14072 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
14073 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14074 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
14076 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14077 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.flags
, LIBNDR_FLAG_REF_ALLOC
);
14078 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.flags
));
14079 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
14080 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
14082 return NDR_ERR_SUCCESS
;
14085 _PUBLIC_
void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogonWithFlags
*r
)
14087 ndr_print_struct(ndr
, name
, "netr_LogonSamLogonWithFlags");
14089 if (flags
& NDR_SET_VALUES
) {
14090 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14092 if (flags
& NDR_IN
) {
14093 ndr_print_struct(ndr
, "in", "netr_LogonSamLogonWithFlags");
14095 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14097 if (r
->in
.server_name
) {
14098 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14101 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
14103 if (r
->in
.computer_name
) {
14104 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
14107 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
14109 if (r
->in
.credential
) {
14110 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
14113 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
14115 if (r
->in
.return_authenticator
) {
14116 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
14119 ndr_print_uint16(ndr
, "logon_level", r
->in
.logon_level
);
14120 ndr_print_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
);
14121 ndr_print_netr_LogonLevel(ndr
, "logon", &r
->in
.logon
);
14122 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
14123 ndr_print_ptr(ndr
, "flags", r
->in
.flags
);
14125 ndr_print_uint32(ndr
, "flags", *r
->in
.flags
);
14129 if (flags
& NDR_OUT
) {
14130 ndr_print_struct(ndr
, "out", "netr_LogonSamLogonWithFlags");
14132 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
14134 if (r
->out
.return_authenticator
) {
14135 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
14138 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
14140 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
14141 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
14143 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
14145 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
14147 ndr_print_ptr(ndr
, "flags", r
->out
.flags
);
14149 ndr_print_uint32(ndr
, "flags", *r
->out
.flags
);
14151 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
14157 static enum ndr_err_code
ndr_push_netr_NETRSERVERGETTRUSTINFO(struct ndr_push
*ndr
, int flags
, const struct netr_NETRSERVERGETTRUSTINFO
*r
)
14159 if (flags
& NDR_IN
) {
14161 if (flags
& NDR_OUT
) {
14162 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14164 return NDR_ERR_SUCCESS
;
14167 static enum ndr_err_code
ndr_pull_netr_NETRSERVERGETTRUSTINFO(struct ndr_pull
*ndr
, int flags
, struct netr_NETRSERVERGETTRUSTINFO
*r
)
14169 if (flags
& NDR_IN
) {
14171 if (flags
& NDR_OUT
) {
14172 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14174 return NDR_ERR_SUCCESS
;
14177 _PUBLIC_
void ndr_print_netr_NETRSERVERGETTRUSTINFO(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRSERVERGETTRUSTINFO
*r
)
14179 ndr_print_struct(ndr
, name
, "netr_NETRSERVERGETTRUSTINFO");
14181 if (flags
& NDR_SET_VALUES
) {
14182 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14184 if (flags
& NDR_IN
) {
14185 ndr_print_struct(ndr
, "in", "netr_NETRSERVERGETTRUSTINFO");
14189 if (flags
& NDR_OUT
) {
14190 ndr_print_struct(ndr
, "out", "netr_NETRSERVERGETTRUSTINFO");
14192 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14198 static const struct ndr_interface_call netlogon_calls
[] = {
14200 "netr_LogonUasLogon",
14201 sizeof(struct netr_LogonUasLogon
),
14202 (ndr_push_flags_fn_t
) ndr_push_netr_LogonUasLogon
,
14203 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonUasLogon
,
14204 (ndr_print_function_t
) ndr_print_netr_LogonUasLogon
,
14208 "netr_LogonUasLogoff",
14209 sizeof(struct netr_LogonUasLogoff
),
14210 (ndr_push_flags_fn_t
) ndr_push_netr_LogonUasLogoff
,
14211 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonUasLogoff
,
14212 (ndr_print_function_t
) ndr_print_netr_LogonUasLogoff
,
14216 "netr_LogonSamLogon",
14217 sizeof(struct netr_LogonSamLogon
),
14218 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogon
,
14219 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogon
,
14220 (ndr_print_function_t
) ndr_print_netr_LogonSamLogon
,
14224 "netr_LogonSamLogoff",
14225 sizeof(struct netr_LogonSamLogoff
),
14226 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogoff
,
14227 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogoff
,
14228 (ndr_print_function_t
) ndr_print_netr_LogonSamLogoff
,
14232 "netr_ServerReqChallenge",
14233 sizeof(struct netr_ServerReqChallenge
),
14234 (ndr_push_flags_fn_t
) ndr_push_netr_ServerReqChallenge
,
14235 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerReqChallenge
,
14236 (ndr_print_function_t
) ndr_print_netr_ServerReqChallenge
,
14240 "netr_ServerAuthenticate",
14241 sizeof(struct netr_ServerAuthenticate
),
14242 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate
,
14243 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate
,
14244 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate
,
14248 "netr_ServerPasswordSet",
14249 sizeof(struct netr_ServerPasswordSet
),
14250 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordSet
,
14251 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordSet
,
14252 (ndr_print_function_t
) ndr_print_netr_ServerPasswordSet
,
14256 "netr_DatabaseDeltas",
14257 sizeof(struct netr_DatabaseDeltas
),
14258 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseDeltas
,
14259 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseDeltas
,
14260 (ndr_print_function_t
) ndr_print_netr_DatabaseDeltas
,
14264 "netr_DatabaseSync",
14265 sizeof(struct netr_DatabaseSync
),
14266 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseSync
,
14267 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseSync
,
14268 (ndr_print_function_t
) ndr_print_netr_DatabaseSync
,
14272 "netr_AccountDeltas",
14273 sizeof(struct netr_AccountDeltas
),
14274 (ndr_push_flags_fn_t
) ndr_push_netr_AccountDeltas
,
14275 (ndr_pull_flags_fn_t
) ndr_pull_netr_AccountDeltas
,
14276 (ndr_print_function_t
) ndr_print_netr_AccountDeltas
,
14280 "netr_AccountSync",
14281 sizeof(struct netr_AccountSync
),
14282 (ndr_push_flags_fn_t
) ndr_push_netr_AccountSync
,
14283 (ndr_pull_flags_fn_t
) ndr_pull_netr_AccountSync
,
14284 (ndr_print_function_t
) ndr_print_netr_AccountSync
,
14289 sizeof(struct netr_GetDcName
),
14290 (ndr_push_flags_fn_t
) ndr_push_netr_GetDcName
,
14291 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetDcName
,
14292 (ndr_print_function_t
) ndr_print_netr_GetDcName
,
14296 "netr_LogonControl",
14297 sizeof(struct netr_LogonControl
),
14298 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl
,
14299 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl
,
14300 (ndr_print_function_t
) ndr_print_netr_LogonControl
,
14304 "netr_GetAnyDCName",
14305 sizeof(struct netr_GetAnyDCName
),
14306 (ndr_push_flags_fn_t
) ndr_push_netr_GetAnyDCName
,
14307 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetAnyDCName
,
14308 (ndr_print_function_t
) ndr_print_netr_GetAnyDCName
,
14312 "netr_LogonControl2",
14313 sizeof(struct netr_LogonControl2
),
14314 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl2
,
14315 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl2
,
14316 (ndr_print_function_t
) ndr_print_netr_LogonControl2
,
14320 "netr_ServerAuthenticate2",
14321 sizeof(struct netr_ServerAuthenticate2
),
14322 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate2
,
14323 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate2
,
14324 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate2
,
14328 "netr_DatabaseSync2",
14329 sizeof(struct netr_DatabaseSync2
),
14330 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseSync2
,
14331 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseSync2
,
14332 (ndr_print_function_t
) ndr_print_netr_DatabaseSync2
,
14336 "netr_DatabaseRedo",
14337 sizeof(struct netr_DatabaseRedo
),
14338 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseRedo
,
14339 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseRedo
,
14340 (ndr_print_function_t
) ndr_print_netr_DatabaseRedo
,
14344 "netr_LogonControl2Ex",
14345 sizeof(struct netr_LogonControl2Ex
),
14346 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl2Ex
,
14347 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl2Ex
,
14348 (ndr_print_function_t
) ndr_print_netr_LogonControl2Ex
,
14352 "netr_NetrEnumerateTrustedDomains",
14353 sizeof(struct netr_NetrEnumerateTrustedDomains
),
14354 (ndr_push_flags_fn_t
) ndr_push_netr_NetrEnumerateTrustedDomains
,
14355 (ndr_pull_flags_fn_t
) ndr_pull_netr_NetrEnumerateTrustedDomains
,
14356 (ndr_print_function_t
) ndr_print_netr_NetrEnumerateTrustedDomains
,
14360 "netr_DsRGetDCName",
14361 sizeof(struct netr_DsRGetDCName
),
14362 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCName
,
14363 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCName
,
14364 (ndr_print_function_t
) ndr_print_netr_DsRGetDCName
,
14368 "netr_NETRLOGONDUMMYROUTINE1",
14369 sizeof(struct netr_NETRLOGONDUMMYROUTINE1
),
14370 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONDUMMYROUTINE1
,
14371 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONDUMMYROUTINE1
,
14372 (ndr_print_function_t
) ndr_print_netr_NETRLOGONDUMMYROUTINE1
,
14376 "netr_NETRLOGONSETSERVICEBITS",
14377 sizeof(struct netr_NETRLOGONSETSERVICEBITS
),
14378 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONSETSERVICEBITS
,
14379 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONSETSERVICEBITS
,
14380 (ndr_print_function_t
) ndr_print_netr_NETRLOGONSETSERVICEBITS
,
14384 "netr_NETRLOGONGETTRUSTRID",
14385 sizeof(struct netr_NETRLOGONGETTRUSTRID
),
14386 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONGETTRUSTRID
,
14387 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONGETTRUSTRID
,
14388 (ndr_print_function_t
) ndr_print_netr_NETRLOGONGETTRUSTRID
,
14392 "netr_NETRLOGONCOMPUTESERVERDIGEST",
14393 sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST
),
14394 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST
,
14395 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST
,
14396 (ndr_print_function_t
) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST
,
14400 "netr_NETRLOGONCOMPUTECLIENTDIGEST",
14401 sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST
),
14402 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
14403 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
14404 (ndr_print_function_t
) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
14408 "netr_ServerAuthenticate3",
14409 sizeof(struct netr_ServerAuthenticate3
),
14410 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate3
,
14411 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate3
,
14412 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate3
,
14416 "netr_DsRGetDCNameEx",
14417 sizeof(struct netr_DsRGetDCNameEx
),
14418 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCNameEx
,
14419 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCNameEx
,
14420 (ndr_print_function_t
) ndr_print_netr_DsRGetDCNameEx
,
14424 "netr_DsRGetSiteName",
14425 sizeof(struct netr_DsRGetSiteName
),
14426 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetSiteName
,
14427 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetSiteName
,
14428 (ndr_print_function_t
) ndr_print_netr_DsRGetSiteName
,
14432 "netr_LogonGetDomainInfo",
14433 sizeof(struct netr_LogonGetDomainInfo
),
14434 (ndr_push_flags_fn_t
) ndr_push_netr_LogonGetDomainInfo
,
14435 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonGetDomainInfo
,
14436 (ndr_print_function_t
) ndr_print_netr_LogonGetDomainInfo
,
14440 "netr_ServerPasswordSet2",
14441 sizeof(struct netr_ServerPasswordSet2
),
14442 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordSet2
,
14443 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordSet2
,
14444 (ndr_print_function_t
) ndr_print_netr_ServerPasswordSet2
,
14448 "netr_ServerPasswordGet",
14449 sizeof(struct netr_ServerPasswordGet
),
14450 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordGet
,
14451 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordGet
,
14452 (ndr_print_function_t
) ndr_print_netr_ServerPasswordGet
,
14456 "netr_NETRLOGONSENDTOSAM",
14457 sizeof(struct netr_NETRLOGONSENDTOSAM
),
14458 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONSENDTOSAM
,
14459 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONSENDTOSAM
,
14460 (ndr_print_function_t
) ndr_print_netr_NETRLOGONSENDTOSAM
,
14464 "netr_DsRAddressToSitenamesW",
14465 sizeof(struct netr_DsRAddressToSitenamesW
),
14466 (ndr_push_flags_fn_t
) ndr_push_netr_DsRAddressToSitenamesW
,
14467 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRAddressToSitenamesW
,
14468 (ndr_print_function_t
) ndr_print_netr_DsRAddressToSitenamesW
,
14472 "netr_DsRGetDCNameEx2",
14473 sizeof(struct netr_DsRGetDCNameEx2
),
14474 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCNameEx2
,
14475 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCNameEx2
,
14476 (ndr_print_function_t
) ndr_print_netr_DsRGetDCNameEx2
,
14480 "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN",
14481 sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
),
14482 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
14483 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
14484 (ndr_print_function_t
) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
14488 "netr_NetrEnumerateTrustedDomainsEx",
14489 sizeof(struct netr_NetrEnumerateTrustedDomainsEx
),
14490 (ndr_push_flags_fn_t
) ndr_push_netr_NetrEnumerateTrustedDomainsEx
,
14491 (ndr_pull_flags_fn_t
) ndr_pull_netr_NetrEnumerateTrustedDomainsEx
,
14492 (ndr_print_function_t
) ndr_print_netr_NetrEnumerateTrustedDomainsEx
,
14496 "netr_DsRAddressToSitenamesExW",
14497 sizeof(struct netr_DsRAddressToSitenamesExW
),
14498 (ndr_push_flags_fn_t
) ndr_push_netr_DsRAddressToSitenamesExW
,
14499 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRAddressToSitenamesExW
,
14500 (ndr_print_function_t
) ndr_print_netr_DsRAddressToSitenamesExW
,
14504 "netr_DsrGetDcSiteCoverageW",
14505 sizeof(struct netr_DsrGetDcSiteCoverageW
),
14506 (ndr_push_flags_fn_t
) ndr_push_netr_DsrGetDcSiteCoverageW
,
14507 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsrGetDcSiteCoverageW
,
14508 (ndr_print_function_t
) ndr_print_netr_DsrGetDcSiteCoverageW
,
14512 "netr_LogonSamLogonEx",
14513 sizeof(struct netr_LogonSamLogonEx
),
14514 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogonEx
,
14515 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogonEx
,
14516 (ndr_print_function_t
) ndr_print_netr_LogonSamLogonEx
,
14520 "netr_DsrEnumerateDomainTrusts",
14521 sizeof(struct netr_DsrEnumerateDomainTrusts
),
14522 (ndr_push_flags_fn_t
) ndr_push_netr_DsrEnumerateDomainTrusts
,
14523 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsrEnumerateDomainTrusts
,
14524 (ndr_print_function_t
) ndr_print_netr_DsrEnumerateDomainTrusts
,
14528 "netr_DSRDEREGISTERDNSHOSTRECORDS",
14529 sizeof(struct netr_DSRDEREGISTERDNSHOSTRECORDS
),
14530 (ndr_push_flags_fn_t
) ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS
,
14531 (ndr_pull_flags_fn_t
) ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS
,
14532 (ndr_print_function_t
) ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS
,
14536 "netr_ServerTrustPasswordsGet",
14537 sizeof(struct netr_ServerTrustPasswordsGet
),
14538 (ndr_push_flags_fn_t
) ndr_push_netr_ServerTrustPasswordsGet
,
14539 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerTrustPasswordsGet
,
14540 (ndr_print_function_t
) ndr_print_netr_ServerTrustPasswordsGet
,
14544 "netr_DsRGetForestTrustInformation",
14545 sizeof(struct netr_DsRGetForestTrustInformation
),
14546 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetForestTrustInformation
,
14547 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetForestTrustInformation
,
14548 (ndr_print_function_t
) ndr_print_netr_DsRGetForestTrustInformation
,
14552 "netr_GetForestTrustInformation",
14553 sizeof(struct netr_GetForestTrustInformation
),
14554 (ndr_push_flags_fn_t
) ndr_push_netr_GetForestTrustInformation
,
14555 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetForestTrustInformation
,
14556 (ndr_print_function_t
) ndr_print_netr_GetForestTrustInformation
,
14560 "netr_LogonSamLogonWithFlags",
14561 sizeof(struct netr_LogonSamLogonWithFlags
),
14562 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogonWithFlags
,
14563 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogonWithFlags
,
14564 (ndr_print_function_t
) ndr_print_netr_LogonSamLogonWithFlags
,
14568 "netr_NETRSERVERGETTRUSTINFO",
14569 sizeof(struct netr_NETRSERVERGETTRUSTINFO
),
14570 (ndr_push_flags_fn_t
) ndr_push_netr_NETRSERVERGETTRUSTINFO
,
14571 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRSERVERGETTRUSTINFO
,
14572 (ndr_print_function_t
) ndr_print_netr_NETRSERVERGETTRUSTINFO
,
14575 { NULL
, 0, NULL
, NULL
, NULL
, false }
14578 static const char * const netlogon_endpoint_strings
[] = {
14579 "ncacn_np:[\\pipe\\netlogon]",
14584 static const struct ndr_interface_string_array netlogon_endpoints
= {
14586 .names
= netlogon_endpoint_strings
14589 static const char * const netlogon_authservice_strings
[] = {
14593 static const struct ndr_interface_string_array netlogon_authservices
= {
14595 .names
= netlogon_authservice_strings
14599 const struct ndr_interface_table ndr_table_netlogon
= {
14600 .name
= "netlogon",
14602 {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},
14603 NDR_NETLOGON_VERSION
14605 .helpstring
= NDR_NETLOGON_HELPSTRING
,
14607 .calls
= netlogon_calls
,
14608 .endpoints
= &netlogon_endpoints
,
14609 .authservices
= &netlogon_authservices