s3-utils: Use ads_do_search_retry in net ads search
[Samba.git] / librpc / gen_ndr / ndr_netlogon.c
blobd29bf15af2baa6bfcb23cf8191ff9778bc4dcb92
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_netlogon.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_lsa.h"
8 #include "librpc/gen_ndr/ndr_samr.h"
9 #include "librpc/gen_ndr/ndr_security.h"
10 #include "librpc/gen_ndr/ndr_nbt.h"
11 static enum ndr_err_code ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r)
13 if (ndr_flags & NDR_SCALARS) {
14 NDR_CHECK(ndr_push_align(ndr, 5));
15 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
16 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priv));
17 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_flags));
18 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_count));
19 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pw_count));
20 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logon));
21 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logoff));
22 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->logoff_time));
23 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->kickoff_time));
24 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->password_age));
25 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_can_change));
26 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_must_change));
27 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer));
28 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
29 NDR_CHECK(ndr_push_unique_ptr(ndr, r->script_path));
30 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
31 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
33 if (ndr_flags & NDR_BUFFERS) {
34 if (r->account_name) {
35 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
36 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
37 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
38 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
40 if (r->computer) {
41 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16)));
42 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
43 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16)));
44 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer, ndr_charset_length(r->computer, CH_UTF16), sizeof(uint16_t), CH_UTF16));
46 if (r->domain) {
47 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
48 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
49 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
50 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
52 if (r->script_path) {
53 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16)));
54 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
55 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16)));
56 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->script_path, ndr_charset_length(r->script_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
59 return NDR_ERR_SUCCESS;
62 static enum ndr_err_code ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r)
64 uint32_t _ptr_account_name;
65 uint32_t size_account_name_1 = 0;
66 uint32_t length_account_name_1 = 0;
67 TALLOC_CTX *_mem_save_account_name_0;
68 uint32_t _ptr_computer;
69 uint32_t size_computer_1 = 0;
70 uint32_t length_computer_1 = 0;
71 TALLOC_CTX *_mem_save_computer_0;
72 uint32_t _ptr_domain;
73 uint32_t size_domain_1 = 0;
74 uint32_t length_domain_1 = 0;
75 TALLOC_CTX *_mem_save_domain_0;
76 uint32_t _ptr_script_path;
77 uint32_t size_script_path_1 = 0;
78 uint32_t length_script_path_1 = 0;
79 TALLOC_CTX *_mem_save_script_path_0;
80 if (ndr_flags & NDR_SCALARS) {
81 NDR_CHECK(ndr_pull_align(ndr, 5));
82 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
83 if (_ptr_account_name) {
84 NDR_PULL_ALLOC(ndr, r->account_name);
85 } else {
86 r->account_name = NULL;
88 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priv));
89 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_flags));
90 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_count));
91 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pw_count));
92 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logon));
93 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logoff));
94 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->logoff_time));
95 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->kickoff_time));
96 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->password_age));
97 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_can_change));
98 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_must_change));
99 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer));
100 if (_ptr_computer) {
101 NDR_PULL_ALLOC(ndr, r->computer);
102 } else {
103 r->computer = NULL;
105 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
106 if (_ptr_domain) {
107 NDR_PULL_ALLOC(ndr, r->domain);
108 } else {
109 r->domain = NULL;
111 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_script_path));
112 if (_ptr_script_path) {
113 NDR_PULL_ALLOC(ndr, r->script_path);
114 } else {
115 r->script_path = NULL;
117 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
118 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
120 if (ndr_flags & NDR_BUFFERS) {
121 if (r->account_name) {
122 _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
123 NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
124 NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
125 NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
126 size_account_name_1 = ndr_get_array_size(ndr, &r->account_name);
127 length_account_name_1 = ndr_get_array_length(ndr, &r->account_name);
128 if (length_account_name_1 > size_account_name_1) {
129 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
131 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
132 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
133 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
135 if (r->computer) {
136 _mem_save_computer_0 = NDR_PULL_GET_MEM_CTX(ndr);
137 NDR_PULL_SET_MEM_CTX(ndr, r->computer, 0);
138 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer));
139 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer));
140 size_computer_1 = ndr_get_array_size(ndr, &r->computer);
141 length_computer_1 = ndr_get_array_length(ndr, &r->computer);
142 if (length_computer_1 > size_computer_1) {
143 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_1, length_computer_1);
145 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_1, sizeof(uint16_t)));
146 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer, length_computer_1, sizeof(uint16_t), CH_UTF16));
147 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_0, 0);
149 if (r->domain) {
150 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
151 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
152 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
153 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
154 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
155 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
156 if (length_domain_1 > size_domain_1) {
157 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
159 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
160 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
161 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
163 if (r->script_path) {
164 _mem_save_script_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
165 NDR_PULL_SET_MEM_CTX(ndr, r->script_path, 0);
166 NDR_CHECK(ndr_pull_array_size(ndr, &r->script_path));
167 NDR_CHECK(ndr_pull_array_length(ndr, &r->script_path));
168 size_script_path_1 = ndr_get_array_size(ndr, &r->script_path);
169 length_script_path_1 = ndr_get_array_length(ndr, &r->script_path);
170 if (length_script_path_1 > size_script_path_1) {
171 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_script_path_1, length_script_path_1);
173 NDR_CHECK(ndr_check_string_terminator(ndr, length_script_path_1, sizeof(uint16_t)));
174 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->script_path, length_script_path_1, sizeof(uint16_t), CH_UTF16));
175 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0);
178 return NDR_ERR_SUCCESS;
181 _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r)
183 ndr_print_struct(ndr, name, "netr_UasInfo");
184 ndr->depth++;
185 ndr_print_ptr(ndr, "account_name", r->account_name);
186 ndr->depth++;
187 if (r->account_name) {
188 ndr_print_string(ndr, "account_name", r->account_name);
190 ndr->depth--;
191 ndr_print_uint32(ndr, "priv", r->priv);
192 ndr_print_uint32(ndr, "auth_flags", r->auth_flags);
193 ndr_print_uint32(ndr, "logon_count", r->logon_count);
194 ndr_print_uint32(ndr, "bad_pw_count", r->bad_pw_count);
195 ndr_print_time_t(ndr, "last_logon", r->last_logon);
196 ndr_print_time_t(ndr, "last_logoff", r->last_logoff);
197 ndr_print_time_t(ndr, "logoff_time", r->logoff_time);
198 ndr_print_time_t(ndr, "kickoff_time", r->kickoff_time);
199 ndr_print_uint32(ndr, "password_age", r->password_age);
200 ndr_print_time_t(ndr, "pw_can_change", r->pw_can_change);
201 ndr_print_time_t(ndr, "pw_must_change", r->pw_must_change);
202 ndr_print_ptr(ndr, "computer", r->computer);
203 ndr->depth++;
204 if (r->computer) {
205 ndr_print_string(ndr, "computer", r->computer);
207 ndr->depth--;
208 ndr_print_ptr(ndr, "domain", r->domain);
209 ndr->depth++;
210 if (r->domain) {
211 ndr_print_string(ndr, "domain", r->domain);
213 ndr->depth--;
214 ndr_print_ptr(ndr, "script_path", r->script_path);
215 ndr->depth++;
216 if (r->script_path) {
217 ndr_print_string(ndr, "script_path", r->script_path);
219 ndr->depth--;
220 ndr_print_uint32(ndr, "unknown", r->unknown);
221 ndr->depth--;
224 static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r)
226 if (ndr_flags & NDR_SCALARS) {
227 NDR_CHECK(ndr_push_align(ndr, 4));
228 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->duration));
229 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
230 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
232 if (ndr_flags & NDR_BUFFERS) {
234 return NDR_ERR_SUCCESS;
237 static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r)
239 if (ndr_flags & NDR_SCALARS) {
240 NDR_CHECK(ndr_pull_align(ndr, 4));
241 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->duration));
242 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
243 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
245 if (ndr_flags & NDR_BUFFERS) {
247 return NDR_ERR_SUCCESS;
250 _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r)
252 ndr_print_struct(ndr, name, "netr_UasLogoffInfo");
253 ndr->depth++;
254 ndr_print_uint32(ndr, "duration", r->duration);
255 ndr_print_uint16(ndr, "logon_count", r->logon_count);
256 ndr->depth--;
259 _PUBLIC_ enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r)
261 if (ndr_flags & NDR_SCALARS) {
262 NDR_CHECK(ndr_push_align(ndr, 4));
263 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->lockout_duration));
264 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->reset_count));
265 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_attempt_lockout));
266 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy));
267 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
269 if (ndr_flags & NDR_BUFFERS) {
271 return NDR_ERR_SUCCESS;
274 _PUBLIC_ enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r)
276 if (ndr_flags & NDR_SCALARS) {
277 NDR_CHECK(ndr_pull_align(ndr, 4));
278 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->lockout_duration));
279 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->reset_count));
280 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_attempt_lockout));
281 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
282 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
284 if (ndr_flags & NDR_BUFFERS) {
286 return NDR_ERR_SUCCESS;
289 _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r)
291 ndr_print_struct(ndr, name, "netr_AcctLockStr");
292 ndr->depth++;
293 ndr_print_dlong(ndr, "lockout_duration", r->lockout_duration);
294 ndr_print_udlong(ndr, "reset_count", r->reset_count);
295 ndr_print_uint32(ndr, "bad_attempt_lockout", r->bad_attempt_lockout);
296 ndr_print_uint32(ndr, "dummy", r->dummy);
297 ndr->depth--;
300 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r)
302 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
303 return NDR_ERR_SUCCESS;
306 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
308 uint32_t v;
309 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
310 *r = v;
311 return NDR_ERR_SUCCESS;
314 _PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r)
316 ndr_print_uint32(ndr, name, r);
317 ndr->depth++;
318 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r);
319 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r);
320 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r);
321 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_DONT_TRY_GUEST_ACCOUNT", MSV1_0_DONT_TRY_GUEST_ACCOUNT, r);
322 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r);
323 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PASSWORD_EXPIRY", MSV1_0_RETURN_PASSWORD_EXPIRY, r);
324 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_CLIENT_CHALLENGE", MSV1_0_USE_CLIENT_CHALLENGE, r);
325 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_GUEST_ACCOUNT_ONLY", MSV1_0_TRY_GUEST_ACCOUNT_ONLY, r);
326 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r);
327 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY", MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY, r);
328 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r);
329 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_DISABLE_PERSONAL_FALLBACK", MSV1_0_DISABLE_PERSONAL_FALLBACK, r);
330 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_FORCE_GUEST", MSV1_0_ALLOW_FORCE_GUEST, r);
331 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED", MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED, r);
332 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY", MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY, r);
333 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_MSVCHAPV2", MSV1_0_ALLOW_MSVCHAPV2, r);
334 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_S4U2SELF", MSV1_0_S4U2SELF, r);
335 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CHECK_LOGONHOURS_FOR_S4U", MSV1_0_CHECK_LOGONHOURS_FOR_S4U, r);
336 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_SUBAUTHENTICATION_DLL_EX", MSV1_0_SUBAUTHENTICATION_DLL_EX, r);
337 ndr->depth--;
340 static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
342 if (ndr_flags & NDR_SCALARS) {
343 NDR_CHECK(ndr_push_align(ndr, 5));
344 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
345 NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control));
346 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low));
347 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high));
348 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
349 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation));
350 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
352 if (ndr_flags & NDR_BUFFERS) {
353 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
354 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
355 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
357 return NDR_ERR_SUCCESS;
360 static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
362 if (ndr_flags & NDR_SCALARS) {
363 NDR_CHECK(ndr_pull_align(ndr, 5));
364 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
365 NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control));
366 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low));
367 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high));
368 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
369 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation));
370 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
372 if (ndr_flags & NDR_BUFFERS) {
373 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
374 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
375 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
377 return NDR_ERR_SUCCESS;
380 _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r)
382 ndr_print_struct(ndr, name, "netr_IdentityInfo");
383 ndr->depth++;
384 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
385 ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control);
386 ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low);
387 ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high);
388 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
389 ndr_print_lsa_String(ndr, "workstation", &r->workstation);
390 ndr->depth--;
393 static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
395 if (ndr_flags & NDR_SCALARS) {
396 NDR_CHECK(ndr_push_align(ndr, 5));
397 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
398 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
399 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
400 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
402 if (ndr_flags & NDR_BUFFERS) {
403 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
405 return NDR_ERR_SUCCESS;
408 static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
410 if (ndr_flags & NDR_SCALARS) {
411 NDR_CHECK(ndr_pull_align(ndr, 5));
412 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
413 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
414 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
415 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
417 if (ndr_flags & NDR_BUFFERS) {
418 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
420 return NDR_ERR_SUCCESS;
423 _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r)
425 ndr_print_struct(ndr, name, "netr_PasswordInfo");
426 ndr->depth++;
427 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
428 ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
429 ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
430 ndr->depth--;
433 static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
436 uint32_t _flags_save_STRUCT = ndr->flags;
437 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
438 if (ndr_flags & NDR_SCALARS) {
439 NDR_CHECK(ndr_push_align(ndr, 5));
440 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
441 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
442 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
443 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
445 if (ndr_flags & NDR_BUFFERS) {
446 if (r->data) {
447 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
448 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
449 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
450 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
453 ndr->flags = _flags_save_STRUCT;
455 return NDR_ERR_SUCCESS;
458 static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
460 uint32_t _ptr_data;
461 uint32_t size_data_1 = 0;
462 uint32_t length_data_1 = 0;
463 TALLOC_CTX *_mem_save_data_0;
465 uint32_t _flags_save_STRUCT = ndr->flags;
466 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
467 if (ndr_flags & NDR_SCALARS) {
468 NDR_CHECK(ndr_pull_align(ndr, 5));
469 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
470 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
471 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
472 if (_ptr_data) {
473 NDR_PULL_ALLOC(ndr, r->data);
474 } else {
475 r->data = NULL;
477 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
479 if (ndr_flags & NDR_BUFFERS) {
480 if (r->data) {
481 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
482 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
483 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
484 NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
485 size_data_1 = ndr_get_array_size(ndr, &r->data);
486 length_data_1 = ndr_get_array_length(ndr, &r->data);
487 if (length_data_1 > size_data_1) {
488 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_data_1, length_data_1);
490 NDR_PULL_ALLOC_N(ndr, r->data, size_data_1);
491 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, length_data_1));
492 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
494 if (r->data) {
495 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
497 if (r->data) {
498 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length));
501 ndr->flags = _flags_save_STRUCT;
503 return NDR_ERR_SUCCESS;
506 _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r)
508 ndr_print_struct(ndr, name, "netr_ChallengeResponse");
510 uint32_t _flags_save_STRUCT = ndr->flags;
511 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
512 ndr->depth++;
513 ndr_print_uint16(ndr, "length", r->length);
514 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
515 ndr_print_ptr(ndr, "data", r->data);
516 ndr->depth++;
517 if (r->data) {
518 ndr_print_array_uint8(ndr, "data", r->data, r->length);
520 ndr->depth--;
521 ndr->depth--;
522 ndr->flags = _flags_save_STRUCT;
526 static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
529 uint32_t _flags_save_STRUCT = ndr->flags;
530 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
531 if (ndr_flags & NDR_SCALARS) {
532 NDR_CHECK(ndr_push_align(ndr, 5));
533 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
534 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
535 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
536 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
537 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
539 if (ndr_flags & NDR_BUFFERS) {
540 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
541 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
542 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
544 ndr->flags = _flags_save_STRUCT;
546 return NDR_ERR_SUCCESS;
549 static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
551 uint32_t size_challenge_0 = 0;
553 uint32_t _flags_save_STRUCT = ndr->flags;
554 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
555 if (ndr_flags & NDR_SCALARS) {
556 NDR_CHECK(ndr_pull_align(ndr, 5));
557 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
558 size_challenge_0 = 8;
559 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, size_challenge_0));
560 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
561 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
562 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
564 if (ndr_flags & NDR_BUFFERS) {
565 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
566 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
567 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
569 ndr->flags = _flags_save_STRUCT;
571 return NDR_ERR_SUCCESS;
574 _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r)
576 ndr_print_struct(ndr, name, "netr_NetworkInfo");
578 uint32_t _flags_save_STRUCT = ndr->flags;
579 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
580 ndr->depth++;
581 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
582 ndr_print_array_uint8(ndr, "challenge", r->challenge, 8);
583 ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt);
584 ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm);
585 ndr->depth--;
586 ndr->flags = _flags_save_STRUCT;
590 static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r)
593 uint32_t _flags_save_STRUCT = ndr->flags;
594 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
595 if (ndr_flags & NDR_SCALARS) {
596 NDR_CHECK(ndr_push_align(ndr, 5));
597 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
598 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name));
599 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
600 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
601 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
603 if (ndr_flags & NDR_BUFFERS) {
604 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
605 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
606 if (r->data) {
607 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
608 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
611 ndr->flags = _flags_save_STRUCT;
613 return NDR_ERR_SUCCESS;
616 static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r)
618 uint32_t _ptr_data;
619 uint32_t size_data_1 = 0;
620 TALLOC_CTX *_mem_save_data_0;
622 uint32_t _flags_save_STRUCT = ndr->flags;
623 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
624 if (ndr_flags & NDR_SCALARS) {
625 NDR_CHECK(ndr_pull_align(ndr, 5));
626 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
627 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name));
628 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
629 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
630 if (_ptr_data) {
631 NDR_PULL_ALLOC(ndr, r->data);
632 } else {
633 r->data = NULL;
635 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
637 if (ndr_flags & NDR_BUFFERS) {
638 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
639 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
640 if (r->data) {
641 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
642 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
643 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
644 size_data_1 = ndr_get_array_size(ndr, &r->data);
645 NDR_PULL_ALLOC_N(ndr, r->data, size_data_1);
646 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_1));
647 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
649 if (r->data) {
650 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
653 ndr->flags = _flags_save_STRUCT;
655 return NDR_ERR_SUCCESS;
658 _PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r)
660 ndr_print_struct(ndr, name, "netr_GenericInfo");
662 uint32_t _flags_save_STRUCT = ndr->flags;
663 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
664 ndr->depth++;
665 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
666 ndr_print_lsa_String(ndr, "package_name", &r->package_name);
667 ndr_print_uint32(ndr, "length", r->length);
668 ndr_print_ptr(ndr, "data", r->data);
669 ndr->depth++;
670 if (r->data) {
671 ndr_print_array_uint8(ndr, "data", r->data, r->length);
673 ndr->depth--;
674 ndr->depth--;
675 ndr->flags = _flags_save_STRUCT;
679 static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r)
681 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
682 return NDR_ERR_SUCCESS;
685 static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r)
687 uint16_t v;
688 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
689 *r = v;
690 return NDR_ERR_SUCCESS;
693 _PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r)
695 const char *val = NULL;
697 switch (r) {
698 case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break;
699 case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break;
700 case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break;
701 case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break;
702 case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break;
703 case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break;
704 case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break;
706 ndr_print_enum(ndr, name, "ENUM", val, r);
709 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
711 if (ndr_flags & NDR_SCALARS) {
712 int level = ndr_push_get_switch_value(ndr, r);
713 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level));
714 NDR_CHECK(ndr_push_union_align(ndr, 5));
715 switch (level) {
716 case NetlogonInteractiveInformation: {
717 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
718 break; }
720 case NetlogonNetworkInformation: {
721 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
722 break; }
724 case NetlogonServiceInformation: {
725 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
726 break; }
728 case NetlogonGenericInformation: {
729 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
730 break; }
732 case NetlogonInteractiveTransitiveInformation: {
733 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
734 break; }
736 case NetlogonNetworkTransitiveInformation: {
737 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
738 break; }
740 case NetlogonServiceTransitiveInformation: {
741 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
742 break; }
744 default:
745 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
748 if (ndr_flags & NDR_BUFFERS) {
749 int level = ndr_push_get_switch_value(ndr, r);
750 switch (level) {
751 case NetlogonInteractiveInformation:
752 if (r->password) {
753 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
755 break;
757 case NetlogonNetworkInformation:
758 if (r->network) {
759 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
761 break;
763 case NetlogonServiceInformation:
764 if (r->password) {
765 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
767 break;
769 case NetlogonGenericInformation:
770 if (r->generic) {
771 NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
773 break;
775 case NetlogonInteractiveTransitiveInformation:
776 if (r->password) {
777 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
779 break;
781 case NetlogonNetworkTransitiveInformation:
782 if (r->network) {
783 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
785 break;
787 case NetlogonServiceTransitiveInformation:
788 if (r->password) {
789 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
791 break;
793 default:
794 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
797 return NDR_ERR_SUCCESS;
800 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
802 int level;
803 uint16_t _level;
804 TALLOC_CTX *_mem_save_password_0;
805 uint32_t _ptr_password;
806 TALLOC_CTX *_mem_save_network_0;
807 uint32_t _ptr_network;
808 TALLOC_CTX *_mem_save_generic_0;
809 uint32_t _ptr_generic;
810 level = ndr_pull_get_switch_value(ndr, r);
811 if (ndr_flags & NDR_SCALARS) {
812 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
813 if (_level != level) {
814 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
816 NDR_CHECK(ndr_pull_union_align(ndr, 5));
817 switch (level) {
818 case NetlogonInteractiveInformation: {
819 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
820 if (_ptr_password) {
821 NDR_PULL_ALLOC(ndr, r->password);
822 } else {
823 r->password = NULL;
825 break; }
827 case NetlogonNetworkInformation: {
828 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
829 if (_ptr_network) {
830 NDR_PULL_ALLOC(ndr, r->network);
831 } else {
832 r->network = NULL;
834 break; }
836 case NetlogonServiceInformation: {
837 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
838 if (_ptr_password) {
839 NDR_PULL_ALLOC(ndr, r->password);
840 } else {
841 r->password = NULL;
843 break; }
845 case NetlogonGenericInformation: {
846 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
847 if (_ptr_generic) {
848 NDR_PULL_ALLOC(ndr, r->generic);
849 } else {
850 r->generic = NULL;
852 break; }
854 case NetlogonInteractiveTransitiveInformation: {
855 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
856 if (_ptr_password) {
857 NDR_PULL_ALLOC(ndr, r->password);
858 } else {
859 r->password = NULL;
861 break; }
863 case NetlogonNetworkTransitiveInformation: {
864 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
865 if (_ptr_network) {
866 NDR_PULL_ALLOC(ndr, r->network);
867 } else {
868 r->network = NULL;
870 break; }
872 case NetlogonServiceTransitiveInformation: {
873 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
874 if (_ptr_password) {
875 NDR_PULL_ALLOC(ndr, r->password);
876 } else {
877 r->password = NULL;
879 break; }
881 default:
882 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
885 if (ndr_flags & NDR_BUFFERS) {
886 switch (level) {
887 case NetlogonInteractiveInformation:
888 if (r->password) {
889 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
890 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
891 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
892 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
894 break;
896 case NetlogonNetworkInformation:
897 if (r->network) {
898 _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
899 NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
900 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
901 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
903 break;
905 case NetlogonServiceInformation:
906 if (r->password) {
907 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
908 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
909 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
910 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
912 break;
914 case NetlogonGenericInformation:
915 if (r->generic) {
916 _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
917 NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
918 NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
919 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
921 break;
923 case NetlogonInteractiveTransitiveInformation:
924 if (r->password) {
925 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
926 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
927 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
928 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
930 break;
932 case NetlogonNetworkTransitiveInformation:
933 if (r->network) {
934 _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
935 NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
936 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
937 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
939 break;
941 case NetlogonServiceTransitiveInformation:
942 if (r->password) {
943 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
944 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
945 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
946 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
948 break;
950 default:
951 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
954 return NDR_ERR_SUCCESS;
957 _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
959 int level;
960 level = ndr_print_get_switch_value(ndr, r);
961 ndr_print_union(ndr, name, level, "netr_LogonLevel");
962 switch (level) {
963 case NetlogonInteractiveInformation:
964 ndr_print_ptr(ndr, "password", r->password);
965 ndr->depth++;
966 if (r->password) {
967 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
969 ndr->depth--;
970 break;
972 case NetlogonNetworkInformation:
973 ndr_print_ptr(ndr, "network", r->network);
974 ndr->depth++;
975 if (r->network) {
976 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
978 ndr->depth--;
979 break;
981 case NetlogonServiceInformation:
982 ndr_print_ptr(ndr, "password", r->password);
983 ndr->depth++;
984 if (r->password) {
985 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
987 ndr->depth--;
988 break;
990 case NetlogonGenericInformation:
991 ndr_print_ptr(ndr, "generic", r->generic);
992 ndr->depth++;
993 if (r->generic) {
994 ndr_print_netr_GenericInfo(ndr, "generic", r->generic);
996 ndr->depth--;
997 break;
999 case NetlogonInteractiveTransitiveInformation:
1000 ndr_print_ptr(ndr, "password", r->password);
1001 ndr->depth++;
1002 if (r->password) {
1003 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
1005 ndr->depth--;
1006 break;
1008 case NetlogonNetworkTransitiveInformation:
1009 ndr_print_ptr(ndr, "network", r->network);
1010 ndr->depth++;
1011 if (r->network) {
1012 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
1014 ndr->depth--;
1015 break;
1017 case NetlogonServiceTransitiveInformation:
1018 ndr_print_ptr(ndr, "password", r->password);
1019 ndr->depth++;
1020 if (r->password) {
1021 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
1023 ndr->depth--;
1024 break;
1026 default:
1027 ndr_print_bad_level(ndr, name, level);
1031 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
1034 uint32_t _flags_save_STRUCT = ndr->flags;
1035 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1036 if (ndr_flags & NDR_SCALARS) {
1037 NDR_CHECK(ndr_push_align(ndr, 1));
1038 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16));
1039 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1041 if (ndr_flags & NDR_BUFFERS) {
1043 ndr->flags = _flags_save_STRUCT;
1045 return NDR_ERR_SUCCESS;
1048 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
1050 uint32_t size_key_0 = 0;
1052 uint32_t _flags_save_STRUCT = ndr->flags;
1053 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1054 if (ndr_flags & NDR_SCALARS) {
1055 NDR_CHECK(ndr_pull_align(ndr, 1));
1056 size_key_0 = 16;
1057 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, size_key_0));
1058 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1060 if (ndr_flags & NDR_BUFFERS) {
1062 ndr->flags = _flags_save_STRUCT;
1064 return NDR_ERR_SUCCESS;
1067 _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r)
1069 ndr_print_struct(ndr, name, "netr_UserSessionKey");
1071 uint32_t _flags_save_STRUCT = ndr->flags;
1072 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1073 ndr->depth++;
1074 ndr_print_array_uint8(ndr, "key", r->key, 16);
1075 ndr->depth--;
1076 ndr->flags = _flags_save_STRUCT;
1080 _PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
1083 uint32_t _flags_save_STRUCT = ndr->flags;
1084 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1085 if (ndr_flags & NDR_SCALARS) {
1086 NDR_CHECK(ndr_push_align(ndr, 1));
1087 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8));
1088 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1090 if (ndr_flags & NDR_BUFFERS) {
1092 ndr->flags = _flags_save_STRUCT;
1094 return NDR_ERR_SUCCESS;
1097 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
1099 uint32_t size_key_0 = 0;
1101 uint32_t _flags_save_STRUCT = ndr->flags;
1102 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1103 if (ndr_flags & NDR_SCALARS) {
1104 NDR_CHECK(ndr_pull_align(ndr, 1));
1105 size_key_0 = 8;
1106 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, size_key_0));
1107 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1109 if (ndr_flags & NDR_BUFFERS) {
1111 ndr->flags = _flags_save_STRUCT;
1113 return NDR_ERR_SUCCESS;
1116 _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r)
1118 ndr_print_struct(ndr, name, "netr_LMSessionKey");
1120 uint32_t _flags_save_STRUCT = ndr->flags;
1121 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1122 ndr->depth++;
1123 ndr_print_array_uint8(ndr, "key", r->key, 8);
1124 ndr->depth--;
1125 ndr->flags = _flags_save_STRUCT;
1129 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1131 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1132 return NDR_ERR_SUCCESS;
1135 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1137 uint32_t v;
1138 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1139 *r = v;
1140 return NDR_ERR_SUCCESS;
1143 _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r)
1145 ndr_print_uint32(ndr, name, r);
1146 ndr->depth++;
1147 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r);
1148 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r);
1149 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r);
1150 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r);
1151 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r);
1152 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r);
1153 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r);
1154 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r);
1155 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r);
1156 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r);
1157 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r);
1158 ndr->depth--;
1161 static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
1163 uint32_t cntr_unknown_0;
1164 if (ndr_flags & NDR_SCALARS) {
1165 NDR_CHECK(ndr_push_align(ndr, 5));
1166 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
1167 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
1168 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
1169 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
1170 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
1171 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
1172 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1173 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1174 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1175 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1176 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1177 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1178 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
1179 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
1180 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
1181 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
1182 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1183 NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags));
1184 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1185 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1186 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1187 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
1188 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1189 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
1190 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1191 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
1193 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1195 if (ndr_flags & NDR_BUFFERS) {
1196 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1197 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1198 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1199 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1200 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1201 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1202 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1203 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1204 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1205 if (r->domain_sid) {
1206 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1209 return NDR_ERR_SUCCESS;
1212 static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
1214 uint32_t _ptr_domain_sid;
1215 TALLOC_CTX *_mem_save_domain_sid_0;
1216 uint32_t size_unknown_0 = 0;
1217 uint32_t cntr_unknown_0;
1218 if (ndr_flags & NDR_SCALARS) {
1219 NDR_CHECK(ndr_pull_align(ndr, 5));
1220 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
1221 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
1222 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
1223 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
1224 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
1225 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
1226 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1227 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1228 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1229 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1230 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1231 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1232 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
1233 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
1234 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
1235 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1236 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1237 NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags));
1238 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1239 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1240 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1241 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
1242 if (_ptr_domain_sid) {
1243 NDR_PULL_ALLOC(ndr, r->domain_sid);
1244 } else {
1245 r->domain_sid = NULL;
1247 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1248 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
1249 size_unknown_0 = 7;
1250 for (cntr_unknown_0 = 0; cntr_unknown_0 < size_unknown_0; cntr_unknown_0++) {
1251 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
1253 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1255 if (ndr_flags & NDR_BUFFERS) {
1256 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1257 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1258 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1259 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1260 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1261 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1262 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1263 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1264 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1265 if (r->domain_sid) {
1266 _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1267 NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
1268 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1269 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
1272 return NDR_ERR_SUCCESS;
1275 _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r)
1277 uint32_t cntr_unknown_0;
1278 ndr_print_struct(ndr, name, "netr_SamBaseInfo");
1279 ndr->depth++;
1280 ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
1281 ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
1282 ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
1283 ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
1284 ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
1285 ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
1286 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
1287 ndr_print_lsa_String(ndr, "full_name", &r->full_name);
1288 ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
1289 ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
1290 ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
1291 ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
1292 ndr_print_uint16(ndr, "logon_count", r->logon_count);
1293 ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
1294 ndr_print_uint32(ndr, "rid", r->rid);
1295 ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
1296 ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups);
1297 ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags);
1298 ndr_print_netr_UserSessionKey(ndr, "key", &r->key);
1299 ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server);
1300 ndr_print_lsa_StringLarge(ndr, "domain", &r->domain);
1301 ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
1302 ndr->depth++;
1303 if (r->domain_sid) {
1304 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
1306 ndr->depth--;
1307 ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey);
1308 ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
1309 ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)7);
1310 ndr->depth++;
1311 for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) {
1312 char *idx_0=NULL;
1313 if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
1314 ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
1315 free(idx_0);
1318 ndr->depth--;
1319 ndr->depth--;
1322 static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
1324 if (ndr_flags & NDR_SCALARS) {
1325 NDR_CHECK(ndr_push_align(ndr, 5));
1326 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1327 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1329 if (ndr_flags & NDR_BUFFERS) {
1330 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1332 return NDR_ERR_SUCCESS;
1335 static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
1337 if (ndr_flags & NDR_SCALARS) {
1338 NDR_CHECK(ndr_pull_align(ndr, 5));
1339 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1340 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1342 if (ndr_flags & NDR_BUFFERS) {
1343 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1345 return NDR_ERR_SUCCESS;
1348 _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r)
1350 ndr_print_struct(ndr, name, "netr_SamInfo2");
1351 ndr->depth++;
1352 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1353 ndr->depth--;
1356 static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
1358 if (ndr_flags & NDR_SCALARS) {
1359 NDR_CHECK(ndr_push_align(ndr, 5));
1360 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1361 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1362 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1364 if (ndr_flags & NDR_BUFFERS) {
1365 if (r->sid) {
1366 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1369 return NDR_ERR_SUCCESS;
1372 static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
1374 uint32_t _ptr_sid;
1375 TALLOC_CTX *_mem_save_sid_0;
1376 if (ndr_flags & NDR_SCALARS) {
1377 NDR_CHECK(ndr_pull_align(ndr, 5));
1378 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1379 if (_ptr_sid) {
1380 NDR_PULL_ALLOC(ndr, r->sid);
1381 } else {
1382 r->sid = NULL;
1384 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1385 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1387 if (ndr_flags & NDR_BUFFERS) {
1388 if (r->sid) {
1389 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1390 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1391 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1392 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1395 return NDR_ERR_SUCCESS;
1398 _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r)
1400 ndr_print_struct(ndr, name, "netr_SidAttr");
1401 ndr->depth++;
1402 ndr_print_ptr(ndr, "sid", r->sid);
1403 ndr->depth++;
1404 if (r->sid) {
1405 ndr_print_dom_sid2(ndr, "sid", r->sid);
1407 ndr->depth--;
1408 ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1409 ndr->depth--;
1412 _PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
1414 uint32_t cntr_sids_1;
1415 if (ndr_flags & NDR_SCALARS) {
1416 NDR_CHECK(ndr_push_align(ndr, 5));
1417 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1418 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1419 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1420 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1422 if (ndr_flags & NDR_BUFFERS) {
1423 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1424 if (r->sids) {
1425 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->sidcount));
1426 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1427 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1429 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1430 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1434 return NDR_ERR_SUCCESS;
1437 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
1439 uint32_t _ptr_sids;
1440 uint32_t size_sids_1 = 0;
1441 uint32_t cntr_sids_1;
1442 TALLOC_CTX *_mem_save_sids_0;
1443 TALLOC_CTX *_mem_save_sids_1;
1444 if (ndr_flags & NDR_SCALARS) {
1445 NDR_CHECK(ndr_pull_align(ndr, 5));
1446 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1447 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1448 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1449 if (_ptr_sids) {
1450 NDR_PULL_ALLOC(ndr, r->sids);
1451 } else {
1452 r->sids = NULL;
1454 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1456 if (ndr_flags & NDR_BUFFERS) {
1457 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1458 if (r->sids) {
1459 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1460 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1461 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1462 size_sids_1 = ndr_get_array_size(ndr, &r->sids);
1463 NDR_PULL_ALLOC_N(ndr, r->sids, size_sids_1);
1464 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1465 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1466 for (cntr_sids_1 = 0; cntr_sids_1 < size_sids_1; cntr_sids_1++) {
1467 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1469 for (cntr_sids_1 = 0; cntr_sids_1 < size_sids_1; cntr_sids_1++) {
1470 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1472 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1473 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1475 if (r->sids) {
1476 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1479 return NDR_ERR_SUCCESS;
1482 _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r)
1484 uint32_t cntr_sids_1;
1485 ndr_print_struct(ndr, name, "netr_SamInfo3");
1486 ndr->depth++;
1487 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1488 ndr_print_uint32(ndr, "sidcount", r->sidcount);
1489 ndr_print_ptr(ndr, "sids", r->sids);
1490 ndr->depth++;
1491 if (r->sids) {
1492 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1493 ndr->depth++;
1494 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1495 char *idx_1=NULL;
1496 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1497 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1498 free(idx_1);
1501 ndr->depth--;
1503 ndr->depth--;
1504 ndr->depth--;
1507 static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
1509 uint32_t cntr_sids_1;
1510 uint32_t cntr_unknown4_0;
1511 if (ndr_flags & NDR_SCALARS) {
1512 NDR_CHECK(ndr_push_align(ndr, 5));
1513 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1514 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1515 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1516 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
1517 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle));
1518 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1519 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0]));
1521 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1523 if (ndr_flags & NDR_BUFFERS) {
1524 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1525 if (r->sids) {
1526 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->sidcount));
1527 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1528 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1530 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1531 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1534 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1535 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1537 return NDR_ERR_SUCCESS;
1540 static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
1542 uint32_t _ptr_sids;
1543 uint32_t size_sids_1 = 0;
1544 uint32_t cntr_sids_1;
1545 TALLOC_CTX *_mem_save_sids_0;
1546 TALLOC_CTX *_mem_save_sids_1;
1547 uint32_t size_unknown4_0 = 0;
1548 uint32_t cntr_unknown4_0;
1549 if (ndr_flags & NDR_SCALARS) {
1550 NDR_CHECK(ndr_pull_align(ndr, 5));
1551 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1552 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1553 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1554 if (_ptr_sids) {
1555 NDR_PULL_ALLOC(ndr, r->sids);
1556 } else {
1557 r->sids = NULL;
1559 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest));
1560 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle));
1561 size_unknown4_0 = 20;
1562 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < size_unknown4_0; cntr_unknown4_0++) {
1563 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0]));
1565 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1567 if (ndr_flags & NDR_BUFFERS) {
1568 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1569 if (r->sids) {
1570 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1571 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1572 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1573 size_sids_1 = ndr_get_array_size(ndr, &r->sids);
1574 NDR_PULL_ALLOC_N(ndr, r->sids, size_sids_1);
1575 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1576 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1577 for (cntr_sids_1 = 0; cntr_sids_1 < size_sids_1; cntr_sids_1++) {
1578 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1580 for (cntr_sids_1 = 0; cntr_sids_1 < size_sids_1; cntr_sids_1++) {
1581 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1584 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1586 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1587 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1588 if (r->sids) {
1589 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1592 return NDR_ERR_SUCCESS;
1595 _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r)
1597 uint32_t cntr_sids_1;
1598 uint32_t cntr_unknown4_0;
1599 ndr_print_struct(ndr, name, "netr_SamInfo6");
1600 ndr->depth++;
1601 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1602 ndr_print_uint32(ndr, "sidcount", r->sidcount);
1603 ndr_print_ptr(ndr, "sids", r->sids);
1604 ndr->depth++;
1605 if (r->sids) {
1606 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1607 ndr->depth++;
1608 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1609 char *idx_1=NULL;
1610 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1611 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1612 free(idx_1);
1615 ndr->depth--;
1617 ndr->depth--;
1618 ndr_print_lsa_String(ndr, "forest", &r->forest);
1619 ndr_print_lsa_String(ndr, "principle", &r->principle);
1620 ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20);
1621 ndr->depth++;
1622 for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) {
1623 char *idx_0=NULL;
1624 if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) {
1625 ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]);
1626 free(idx_0);
1629 ndr->depth--;
1630 ndr->depth--;
1633 static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
1635 uint32_t cntr_expansionroom_0;
1636 if (ndr_flags & NDR_SCALARS) {
1637 NDR_CHECK(ndr_push_align(ndr, 5));
1638 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1639 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1640 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1641 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1642 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1643 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1644 NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth));
1645 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1646 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1647 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0]));
1649 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1650 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1651 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1652 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1653 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1655 if (ndr_flags & NDR_BUFFERS) {
1656 if (r->pac) {
1657 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->pac_size));
1658 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size));
1660 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1661 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1662 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1663 if (r->auth) {
1664 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->auth_size));
1665 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size));
1667 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1668 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1669 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1670 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1672 return NDR_ERR_SUCCESS;
1675 static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
1677 uint32_t _ptr_pac;
1678 uint32_t size_pac_1 = 0;
1679 TALLOC_CTX *_mem_save_pac_0;
1680 uint32_t _ptr_auth;
1681 uint32_t size_auth_1 = 0;
1682 TALLOC_CTX *_mem_save_auth_0;
1683 uint32_t size_expansionroom_0 = 0;
1684 uint32_t cntr_expansionroom_0;
1685 if (ndr_flags & NDR_SCALARS) {
1686 NDR_CHECK(ndr_pull_align(ndr, 5));
1687 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size));
1688 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1689 if (_ptr_pac) {
1690 NDR_PULL_ALLOC(ndr, r->pac);
1691 } else {
1692 r->pac = NULL;
1694 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1695 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1696 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1697 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size));
1698 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth));
1699 if (_ptr_auth) {
1700 NDR_PULL_ALLOC(ndr, r->auth);
1701 } else {
1702 r->auth = NULL;
1704 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1705 size_expansionroom_0 = 10;
1706 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < size_expansionroom_0; cntr_expansionroom_0++) {
1707 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0]));
1709 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1710 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1711 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1712 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1713 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1715 if (ndr_flags & NDR_BUFFERS) {
1716 if (r->pac) {
1717 _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1718 NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1719 NDR_CHECK(ndr_pull_array_size(ndr, &r->pac));
1720 size_pac_1 = ndr_get_array_size(ndr, &r->pac);
1721 NDR_PULL_ALLOC_N(ndr, r->pac, size_pac_1);
1722 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, size_pac_1));
1723 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1725 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1726 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1727 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1728 if (r->auth) {
1729 _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr);
1730 NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0);
1731 NDR_CHECK(ndr_pull_array_size(ndr, &r->auth));
1732 size_auth_1 = ndr_get_array_size(ndr, &r->auth);
1733 NDR_PULL_ALLOC_N(ndr, r->auth, size_auth_1);
1734 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, size_auth_1));
1735 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0);
1737 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1738 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1739 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1740 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1741 if (r->pac) {
1742 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size));
1744 if (r->auth) {
1745 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size));
1748 return NDR_ERR_SUCCESS;
1751 _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r)
1753 uint32_t cntr_expansionroom_0;
1754 ndr_print_struct(ndr, name, "netr_PacInfo");
1755 ndr->depth++;
1756 ndr_print_uint32(ndr, "pac_size", r->pac_size);
1757 ndr_print_ptr(ndr, "pac", r->pac);
1758 ndr->depth++;
1759 if (r->pac) {
1760 ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size);
1762 ndr->depth--;
1763 ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain);
1764 ndr_print_lsa_String(ndr, "logon_server", &r->logon_server);
1765 ndr_print_lsa_String(ndr, "principal_name", &r->principal_name);
1766 ndr_print_uint32(ndr, "auth_size", r->auth_size);
1767 ndr_print_ptr(ndr, "auth", r->auth);
1768 ndr->depth++;
1769 if (r->auth) {
1770 ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size);
1772 ndr->depth--;
1773 ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key);
1774 ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", (int)10);
1775 ndr->depth++;
1776 for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) {
1777 char *idx_0=NULL;
1778 if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) {
1779 ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]);
1780 free(idx_0);
1783 ndr->depth--;
1784 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
1785 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
1786 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
1787 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
1788 ndr->depth--;
1791 static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r)
1794 uint32_t _flags_save_STRUCT = ndr->flags;
1795 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1796 if (ndr_flags & NDR_SCALARS) {
1797 NDR_CHECK(ndr_push_align(ndr, 5));
1798 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
1799 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
1800 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1802 if (ndr_flags & NDR_BUFFERS) {
1803 if (r->data) {
1804 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
1805 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
1808 ndr->flags = _flags_save_STRUCT;
1810 return NDR_ERR_SUCCESS;
1813 static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r)
1815 uint32_t _ptr_data;
1816 uint32_t size_data_1 = 0;
1817 TALLOC_CTX *_mem_save_data_0;
1819 uint32_t _flags_save_STRUCT = ndr->flags;
1820 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1821 if (ndr_flags & NDR_SCALARS) {
1822 NDR_CHECK(ndr_pull_align(ndr, 5));
1823 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
1824 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1825 if (_ptr_data) {
1826 NDR_PULL_ALLOC(ndr, r->data);
1827 } else {
1828 r->data = NULL;
1830 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1832 if (ndr_flags & NDR_BUFFERS) {
1833 if (r->data) {
1834 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1835 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
1836 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
1837 size_data_1 = ndr_get_array_size(ndr, &r->data);
1838 NDR_PULL_ALLOC_N(ndr, r->data, size_data_1);
1839 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_1));
1840 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
1842 if (r->data) {
1843 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
1846 ndr->flags = _flags_save_STRUCT;
1848 return NDR_ERR_SUCCESS;
1851 _PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r)
1853 ndr_print_struct(ndr, name, "netr_GenericInfo2");
1855 uint32_t _flags_save_STRUCT = ndr->flags;
1856 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1857 ndr->depth++;
1858 ndr_print_uint32(ndr, "length", r->length);
1859 ndr_print_ptr(ndr, "data", r->data);
1860 ndr->depth++;
1861 if (r->data) {
1862 ndr_print_array_uint8(ndr, "data", r->data, r->length);
1864 ndr->depth--;
1865 ndr->depth--;
1866 ndr->flags = _flags_save_STRUCT;
1870 _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
1872 if (ndr_flags & NDR_SCALARS) {
1873 int level = ndr_push_get_switch_value(ndr, r);
1874 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
1875 NDR_CHECK(ndr_push_union_align(ndr, 5));
1876 switch (level) {
1877 case NetlogonValidationSamInfo: {
1878 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
1879 break; }
1881 case NetlogonValidationSamInfo2: {
1882 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
1883 break; }
1885 case 4: {
1886 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1887 break; }
1889 case NetlogonValidationGenericInfo2: {
1890 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
1891 break; }
1893 case NetlogonValidationSamInfo4: {
1894 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
1895 break; }
1897 default:
1898 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1901 if (ndr_flags & NDR_BUFFERS) {
1902 int level = ndr_push_get_switch_value(ndr, r);
1903 switch (level) {
1904 case NetlogonValidationSamInfo:
1905 if (r->sam2) {
1906 NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1908 break;
1910 case NetlogonValidationSamInfo2:
1911 if (r->sam3) {
1912 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1914 break;
1916 case 4:
1917 if (r->pac) {
1918 NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1920 break;
1922 case NetlogonValidationGenericInfo2:
1923 if (r->generic) {
1924 NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
1926 break;
1928 case NetlogonValidationSamInfo4:
1929 if (r->sam6) {
1930 NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1932 break;
1934 default:
1935 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1938 return NDR_ERR_SUCCESS;
1941 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
1943 int level;
1944 uint16_t _level;
1945 TALLOC_CTX *_mem_save_sam2_0;
1946 uint32_t _ptr_sam2;
1947 TALLOC_CTX *_mem_save_sam3_0;
1948 uint32_t _ptr_sam3;
1949 TALLOC_CTX *_mem_save_pac_0;
1950 uint32_t _ptr_pac;
1951 TALLOC_CTX *_mem_save_generic_0;
1952 uint32_t _ptr_generic;
1953 TALLOC_CTX *_mem_save_sam6_0;
1954 uint32_t _ptr_sam6;
1955 level = ndr_pull_get_switch_value(ndr, r);
1956 if (ndr_flags & NDR_SCALARS) {
1957 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1958 if (_level != level) {
1959 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1961 NDR_CHECK(ndr_pull_union_align(ndr, 5));
1962 switch (level) {
1963 case NetlogonValidationSamInfo: {
1964 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2));
1965 if (_ptr_sam2) {
1966 NDR_PULL_ALLOC(ndr, r->sam2);
1967 } else {
1968 r->sam2 = NULL;
1970 break; }
1972 case NetlogonValidationSamInfo2: {
1973 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3));
1974 if (_ptr_sam3) {
1975 NDR_PULL_ALLOC(ndr, r->sam3);
1976 } else {
1977 r->sam3 = NULL;
1979 break; }
1981 case 4: {
1982 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1983 if (_ptr_pac) {
1984 NDR_PULL_ALLOC(ndr, r->pac);
1985 } else {
1986 r->pac = NULL;
1988 break; }
1990 case NetlogonValidationGenericInfo2: {
1991 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
1992 if (_ptr_generic) {
1993 NDR_PULL_ALLOC(ndr, r->generic);
1994 } else {
1995 r->generic = NULL;
1997 break; }
1999 case NetlogonValidationSamInfo4: {
2000 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6));
2001 if (_ptr_sam6) {
2002 NDR_PULL_ALLOC(ndr, r->sam6);
2003 } else {
2004 r->sam6 = NULL;
2006 break; }
2008 default:
2009 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2012 if (ndr_flags & NDR_BUFFERS) {
2013 switch (level) {
2014 case NetlogonValidationSamInfo:
2015 if (r->sam2) {
2016 _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr);
2017 NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0);
2018 NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
2019 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0);
2021 break;
2023 case NetlogonValidationSamInfo2:
2024 if (r->sam3) {
2025 _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr);
2026 NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0);
2027 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
2028 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0);
2030 break;
2032 case 4:
2033 if (r->pac) {
2034 _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
2035 NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
2036 NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
2037 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
2039 break;
2041 case NetlogonValidationGenericInfo2:
2042 if (r->generic) {
2043 _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
2044 NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
2045 NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
2046 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
2048 break;
2050 case NetlogonValidationSamInfo4:
2051 if (r->sam6) {
2052 _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr);
2053 NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0);
2054 NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
2055 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0);
2057 break;
2059 default:
2060 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2063 return NDR_ERR_SUCCESS;
2066 _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r)
2068 int level;
2069 level = ndr_print_get_switch_value(ndr, r);
2070 ndr_print_union(ndr, name, level, "netr_Validation");
2071 switch (level) {
2072 case NetlogonValidationSamInfo:
2073 ndr_print_ptr(ndr, "sam2", r->sam2);
2074 ndr->depth++;
2075 if (r->sam2) {
2076 ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2);
2078 ndr->depth--;
2079 break;
2081 case NetlogonValidationSamInfo2:
2082 ndr_print_ptr(ndr, "sam3", r->sam3);
2083 ndr->depth++;
2084 if (r->sam3) {
2085 ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3);
2087 ndr->depth--;
2088 break;
2090 case 4:
2091 ndr_print_ptr(ndr, "pac", r->pac);
2092 ndr->depth++;
2093 if (r->pac) {
2094 ndr_print_netr_PacInfo(ndr, "pac", r->pac);
2096 ndr->depth--;
2097 break;
2099 case NetlogonValidationGenericInfo2:
2100 ndr_print_ptr(ndr, "generic", r->generic);
2101 ndr->depth++;
2102 if (r->generic) {
2103 ndr_print_netr_GenericInfo2(ndr, "generic", r->generic);
2105 ndr->depth--;
2106 break;
2108 case NetlogonValidationSamInfo4:
2109 ndr_print_ptr(ndr, "sam6", r->sam6);
2110 ndr->depth++;
2111 if (r->sam6) {
2112 ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6);
2114 ndr->depth--;
2115 break;
2117 default:
2118 ndr_print_bad_level(ndr, name, level);
2122 _PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
2125 uint32_t _flags_save_STRUCT = ndr->flags;
2126 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2127 if (ndr_flags & NDR_SCALARS) {
2128 NDR_CHECK(ndr_push_align(ndr, 1));
2129 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8));
2130 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
2132 if (ndr_flags & NDR_BUFFERS) {
2134 ndr->flags = _flags_save_STRUCT;
2136 return NDR_ERR_SUCCESS;
2139 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
2141 uint32_t size_data_0 = 0;
2143 uint32_t _flags_save_STRUCT = ndr->flags;
2144 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2145 if (ndr_flags & NDR_SCALARS) {
2146 NDR_CHECK(ndr_pull_align(ndr, 1));
2147 size_data_0 = 8;
2148 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_0));
2149 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
2151 if (ndr_flags & NDR_BUFFERS) {
2153 ndr->flags = _flags_save_STRUCT;
2155 return NDR_ERR_SUCCESS;
2158 _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r)
2160 ndr_print_struct(ndr, name, "netr_Credential");
2162 uint32_t _flags_save_STRUCT = ndr->flags;
2163 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2164 ndr->depth++;
2165 ndr_print_array_uint8(ndr, "data", r->data, 8);
2166 ndr->depth--;
2167 ndr->flags = _flags_save_STRUCT;
2171 _PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
2173 if (ndr_flags & NDR_SCALARS) {
2174 NDR_CHECK(ndr_push_align(ndr, 4));
2175 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2176 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
2177 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2179 if (ndr_flags & NDR_BUFFERS) {
2181 return NDR_ERR_SUCCESS;
2184 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
2186 if (ndr_flags & NDR_SCALARS) {
2187 NDR_CHECK(ndr_pull_align(ndr, 4));
2188 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2189 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
2190 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2192 if (ndr_flags & NDR_BUFFERS) {
2194 return NDR_ERR_SUCCESS;
2197 _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r)
2199 ndr_print_struct(ndr, name, "netr_Authenticator");
2200 ndr->depth++;
2201 ndr_print_netr_Credential(ndr, "cred", &r->cred);
2202 ndr_print_time_t(ndr, "timestamp", r->timestamp);
2203 ndr->depth--;
2206 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)
2208 if (ndr_flags & NDR_SCALARS) {
2209 NDR_CHECK(ndr_push_align(ndr, 5));
2210 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
2211 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2212 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2213 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2214 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2215 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2216 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2217 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2218 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2219 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2221 if (ndr_flags & NDR_BUFFERS) {
2222 if (r->account_name) {
2223 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2224 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2225 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2226 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2228 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2229 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2230 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2231 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2233 return NDR_ERR_SUCCESS;
2236 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
2238 uint32_t _ptr_account_name;
2239 uint32_t size_account_name_1 = 0;
2240 uint32_t length_account_name_1 = 0;
2241 TALLOC_CTX *_mem_save_account_name_0;
2242 if (ndr_flags & NDR_SCALARS) {
2243 NDR_CHECK(ndr_pull_align(ndr, 5));
2244 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
2245 if (_ptr_account_name) {
2246 NDR_PULL_ALLOC(ndr, r->account_name);
2247 } else {
2248 r->account_name = NULL;
2250 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2251 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2252 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2253 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2254 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2255 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2256 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2257 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2258 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2260 if (ndr_flags & NDR_BUFFERS) {
2261 if (r->account_name) {
2262 _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2263 NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
2264 NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
2265 NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
2266 size_account_name_1 = ndr_get_array_size(ndr, &r->account_name);
2267 length_account_name_1 = ndr_get_array_length(ndr, &r->account_name);
2268 if (length_account_name_1 > size_account_name_1) {
2269 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
2271 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
2272 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
2273 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
2275 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2276 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2277 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2278 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2280 return NDR_ERR_SUCCESS;
2283 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r)
2285 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER");
2286 ndr->depth++;
2287 ndr_print_ptr(ndr, "account_name", r->account_name);
2288 ndr->depth++;
2289 if (r->account_name) {
2290 ndr_print_string(ndr, "account_name", r->account_name);
2292 ndr->depth--;
2293 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2294 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2295 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2296 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2297 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2298 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2299 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2300 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2301 ndr->depth--;
2304 static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
2306 if (ndr_flags & NDR_SCALARS) {
2307 NDR_CHECK(ndr_push_align(ndr, 4));
2308 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2309 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2310 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
2311 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2312 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2314 if (ndr_flags & NDR_BUFFERS) {
2316 return NDR_ERR_SUCCESS;
2319 static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
2321 if (ndr_flags & NDR_SCALARS) {
2322 NDR_CHECK(ndr_pull_align(ndr, 4));
2323 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
2324 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
2325 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
2326 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2327 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2329 if (ndr_flags & NDR_BUFFERS) {
2331 return NDR_ERR_SUCCESS;
2334 _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r)
2336 ndr_print_struct(ndr, name, "netr_USER_KEY16");
2337 ndr->depth++;
2338 ndr_print_uint16(ndr, "length", r->length);
2339 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
2340 ndr_print_uint32(ndr, "flags", r->flags);
2341 ndr_print_samr_Password(ndr, "pwd", &r->pwd);
2342 ndr->depth--;
2345 static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
2347 if (ndr_flags & NDR_SCALARS) {
2348 NDR_CHECK(ndr_push_align(ndr, 4));
2349 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2350 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2351 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags));
2352 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2353 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2354 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags));
2355 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2356 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2357 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2359 if (ndr_flags & NDR_BUFFERS) {
2361 return NDR_ERR_SUCCESS;
2364 static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
2366 uint32_t size_nt_history_0 = 0;
2367 uint32_t size_lm_history_0 = 0;
2368 if (ndr_flags & NDR_SCALARS) {
2369 NDR_CHECK(ndr_pull_align(ndr, 4));
2370 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length));
2371 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size));
2372 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags));
2373 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length));
2374 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size));
2375 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags));
2376 size_nt_history_0 = r->nt_length;
2377 NDR_PULL_ALLOC_N(ndr, r->nt_history, size_nt_history_0);
2378 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, size_nt_history_0));
2379 size_lm_history_0 = r->lm_length;
2380 NDR_PULL_ALLOC_N(ndr, r->lm_history, size_lm_history_0);
2381 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, size_lm_history_0));
2382 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2384 if (ndr_flags & NDR_BUFFERS) {
2386 return NDR_ERR_SUCCESS;
2389 _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r)
2391 ndr_print_struct(ndr, name, "netr_PasswordHistory");
2392 ndr->depth++;
2393 ndr_print_uint16(ndr, "nt_length", r->nt_length);
2394 ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size);
2395 ndr_print_uint32(ndr, "nt_flags", r->nt_flags);
2396 ndr_print_uint16(ndr, "lm_length", r->lm_length);
2397 ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size);
2398 ndr_print_uint32(ndr, "lm_flags", r->lm_flags);
2399 ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length);
2400 ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length);
2401 ndr->depth--;
2404 static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
2406 if (ndr_flags & NDR_SCALARS) {
2407 NDR_CHECK(ndr_push_align(ndr, 4));
2408 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2409 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2410 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2411 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2413 if (ndr_flags & NDR_BUFFERS) {
2415 return NDR_ERR_SUCCESS;
2418 static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
2420 if (ndr_flags & NDR_SCALARS) {
2421 NDR_CHECK(ndr_pull_align(ndr, 4));
2422 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2423 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2424 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2425 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2427 if (ndr_flags & NDR_BUFFERS) {
2429 return NDR_ERR_SUCCESS;
2432 _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r)
2434 ndr_print_struct(ndr, name, "netr_USER_KEYS2");
2435 ndr->depth++;
2436 ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword);
2437 ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword);
2438 ndr_print_netr_PasswordHistory(ndr, "history", &r->history);
2439 ndr->depth--;
2442 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)
2444 if (ndr_flags & NDR_SCALARS) {
2445 NDR_CHECK(ndr_push_align(ndr, 4));
2446 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2447 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2449 if (ndr_flags & NDR_BUFFERS) {
2451 return NDR_ERR_SUCCESS;
2454 static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
2456 if (ndr_flags & NDR_SCALARS) {
2457 NDR_CHECK(ndr_pull_align(ndr, 4));
2458 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2459 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2461 if (ndr_flags & NDR_BUFFERS) {
2463 return NDR_ERR_SUCCESS;
2466 _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r)
2468 ndr_print_struct(ndr, name, "netr_USER_KEY_UNION");
2469 ndr->depth++;
2470 ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2);
2471 ndr->depth--;
2474 _PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
2476 if (ndr_flags & NDR_SCALARS) {
2477 NDR_CHECK(ndr_push_align(ndr, 4));
2478 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2479 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2480 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2482 if (ndr_flags & NDR_BUFFERS) {
2484 return NDR_ERR_SUCCESS;
2487 _PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
2489 if (ndr_flags & NDR_SCALARS) {
2490 NDR_CHECK(ndr_pull_align(ndr, 4));
2491 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2492 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2493 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2495 if (ndr_flags & NDR_BUFFERS) {
2497 return NDR_ERR_SUCCESS;
2500 _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r)
2502 ndr_print_struct(ndr, name, "netr_USER_KEYS");
2503 ndr->depth++;
2504 ndr_print_uint32(ndr, "version", r->version);
2505 ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys);
2506 ndr->depth--;
2509 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)
2511 if (ndr_flags & NDR_SCALARS) {
2512 NDR_CHECK(ndr_push_align(ndr, 5));
2513 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag));
2514 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2516 uint32_t _flags_save_uint8 = ndr->flags;
2517 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2518 NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData));
2519 ndr->flags = _flags_save_uint8;
2521 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2523 if (ndr_flags & NDR_BUFFERS) {
2525 uint32_t _flags_save_uint8 = ndr->flags;
2526 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2527 if (r->SensitiveData) {
2528 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->DataLength));
2529 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength));
2531 ndr->flags = _flags_save_uint8;
2534 return NDR_ERR_SUCCESS;
2537 static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
2539 uint32_t _ptr_SensitiveData;
2540 uint32_t size_SensitiveData_1 = 0;
2541 TALLOC_CTX *_mem_save_SensitiveData_0;
2542 if (ndr_flags & NDR_SCALARS) {
2543 NDR_CHECK(ndr_pull_align(ndr, 5));
2544 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag));
2545 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength));
2547 uint32_t _flags_save_uint8 = ndr->flags;
2548 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2549 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData));
2550 if (_ptr_SensitiveData) {
2551 NDR_PULL_ALLOC(ndr, r->SensitiveData);
2552 } else {
2553 r->SensitiveData = NULL;
2555 ndr->flags = _flags_save_uint8;
2557 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2559 if (ndr_flags & NDR_BUFFERS) {
2561 uint32_t _flags_save_uint8 = ndr->flags;
2562 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2563 if (r->SensitiveData) {
2564 _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr);
2565 NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0);
2566 NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData));
2567 size_SensitiveData_1 = ndr_get_array_size(ndr, &r->SensitiveData);
2568 NDR_PULL_ALLOC_N(ndr, r->SensitiveData, size_SensitiveData_1);
2569 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, size_SensitiveData_1));
2570 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0);
2572 ndr->flags = _flags_save_uint8;
2574 if (r->SensitiveData) {
2575 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength));
2578 return NDR_ERR_SUCCESS;
2581 _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r)
2583 ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO");
2584 ndr->depth++;
2585 ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag);
2586 ndr_print_uint32(ndr, "DataLength", r->DataLength);
2587 ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData);
2588 ndr->depth++;
2589 if (r->SensitiveData) {
2590 ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength);
2592 ndr->depth--;
2593 ndr->depth--;
2596 static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
2598 if (ndr_flags & NDR_SCALARS) {
2599 NDR_CHECK(ndr_push_align(ndr, 5));
2600 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2601 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2602 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2603 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2604 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2605 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2606 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2607 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2608 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2609 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2610 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2611 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2612 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2613 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2614 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2615 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2616 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2617 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2618 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2619 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present));
2620 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present));
2621 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2622 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2623 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2624 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2625 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2626 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2627 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2628 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2629 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2630 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2631 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2632 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2633 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2634 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2635 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2636 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2637 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2639 if (ndr_flags & NDR_BUFFERS) {
2640 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2641 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2642 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2643 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2644 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2645 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2646 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2647 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2648 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2649 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2650 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2651 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2652 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2653 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2654 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2655 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2657 return NDR_ERR_SUCCESS;
2660 static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
2662 if (ndr_flags & NDR_SCALARS) {
2663 NDR_CHECK(ndr_pull_align(ndr, 5));
2664 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2665 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2666 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2667 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2668 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2669 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2670 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2671 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2672 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2673 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2674 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2675 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2676 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2677 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2678 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2679 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2680 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2681 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2682 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2683 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present));
2684 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present));
2685 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2686 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2687 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2688 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2689 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2690 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2691 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2692 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2693 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2694 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2695 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2696 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2697 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2698 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2699 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2700 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2701 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2703 if (ndr_flags & NDR_BUFFERS) {
2704 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2705 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2706 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2707 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2708 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2709 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2710 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2711 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2712 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2713 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2714 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2715 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2716 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2717 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2718 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2719 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2721 return NDR_ERR_SUCCESS;
2724 _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r)
2726 ndr_print_struct(ndr, name, "netr_DELTA_USER");
2727 ndr->depth++;
2728 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2729 ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2730 ndr_print_uint32(ndr, "rid", r->rid);
2731 ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2732 ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2733 ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2734 ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2735 ndr_print_lsa_String(ndr, "description", &r->description);
2736 ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2737 ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2738 ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2739 ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2740 ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2741 ndr_print_uint16(ndr, "logon_count", r->logon_count);
2742 ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2743 ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2744 ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2745 ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
2746 ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
2747 ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present);
2748 ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present);
2749 ndr_print_uint8(ndr, "password_expired", r->password_expired);
2750 ndr_print_lsa_String(ndr, "comment", &r->comment);
2751 ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2752 ndr_print_uint16(ndr, "country_code", r->country_code);
2753 ndr_print_uint16(ndr, "code_page", r->code_page);
2754 ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info);
2755 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2756 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2757 ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2758 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2759 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2760 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2761 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2762 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2763 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2764 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2765 ndr->depth--;
2768 static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
2770 if (ndr_flags & NDR_SCALARS) {
2771 NDR_CHECK(ndr_push_align(ndr, 5));
2772 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2773 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2774 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time));
2775 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
2776 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
2777 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
2778 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
2779 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
2780 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
2781 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2782 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2783 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2784 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2785 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2786 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2787 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass));
2788 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2789 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2790 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2791 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2793 if (ndr_flags & NDR_BUFFERS) {
2794 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2795 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2796 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2797 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2798 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2799 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2800 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2802 return NDR_ERR_SUCCESS;
2805 static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
2807 if (ndr_flags & NDR_SCALARS) {
2808 NDR_CHECK(ndr_pull_align(ndr, 5));
2809 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2810 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2811 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time));
2812 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
2813 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
2814 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
2815 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
2816 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
2817 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
2818 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2819 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2820 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2821 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2822 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2823 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2824 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass));
2825 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2826 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2827 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2828 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2830 if (ndr_flags & NDR_BUFFERS) {
2831 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2832 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2833 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2834 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2835 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2836 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2837 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2839 return NDR_ERR_SUCCESS;
2842 _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r)
2844 ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN");
2845 ndr->depth++;
2846 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
2847 ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
2848 ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time);
2849 ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
2850 ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
2851 ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
2852 ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
2853 ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
2854 ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
2855 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2856 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2857 ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout);
2858 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2859 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2860 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2861 ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass);
2862 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2863 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2864 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2865 ndr->depth--;
2868 static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
2870 if (ndr_flags & NDR_SCALARS) {
2871 NDR_CHECK(ndr_push_align(ndr, 5));
2872 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2873 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2874 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
2875 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2876 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2877 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2878 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2879 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2880 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2881 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2882 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2883 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2884 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2885 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2886 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2888 if (ndr_flags & NDR_BUFFERS) {
2889 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2890 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2891 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2892 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2893 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2894 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2895 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2897 return NDR_ERR_SUCCESS;
2900 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
2902 if (ndr_flags & NDR_SCALARS) {
2903 NDR_CHECK(ndr_pull_align(ndr, 5));
2904 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2905 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2906 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
2907 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2908 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2909 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2910 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2911 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2912 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2913 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2914 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2915 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2916 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2917 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2918 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2920 if (ndr_flags & NDR_BUFFERS) {
2921 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2922 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2923 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2924 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2925 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2926 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2927 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2929 return NDR_ERR_SUCCESS;
2932 _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r)
2934 ndr_print_struct(ndr, name, "netr_DELTA_GROUP");
2935 ndr->depth++;
2936 ndr_print_lsa_String(ndr, "group_name", &r->group_name);
2937 ndr_print_uint32(ndr, "rid", r->rid);
2938 ndr_print_uint32(ndr, "attributes", r->attributes);
2939 ndr_print_lsa_String(ndr, "description", &r->description);
2940 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2941 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2942 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2943 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2944 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2945 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2946 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2947 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2948 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2949 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2950 ndr->depth--;
2953 static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
2955 if (ndr_flags & NDR_SCALARS) {
2956 NDR_CHECK(ndr_push_align(ndr, 5));
2957 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2958 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2959 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2960 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2961 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2962 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2963 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2964 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2965 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2966 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2967 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2969 if (ndr_flags & NDR_BUFFERS) {
2970 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2971 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2972 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2973 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2974 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2975 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2977 return NDR_ERR_SUCCESS;
2980 static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
2982 if (ndr_flags & NDR_SCALARS) {
2983 NDR_CHECK(ndr_pull_align(ndr, 5));
2984 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2985 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2986 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2987 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2988 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2989 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2990 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2991 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2992 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2993 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2994 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2996 if (ndr_flags & NDR_BUFFERS) {
2997 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2998 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2999 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3000 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3001 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3002 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3004 return NDR_ERR_SUCCESS;
3007 _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r)
3009 ndr_print_struct(ndr, name, "netr_DELTA_RENAME");
3010 ndr->depth++;
3011 ndr_print_lsa_String(ndr, "OldName", &r->OldName);
3012 ndr_print_lsa_String(ndr, "NewName", &r->NewName);
3013 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3014 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3015 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3016 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3017 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3018 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3019 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3020 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3021 ndr->depth--;
3024 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)
3026 uint32_t cntr_rids_1;
3027 uint32_t cntr_attribs_1;
3028 if (ndr_flags & NDR_SCALARS) {
3029 NDR_CHECK(ndr_push_align(ndr, 5));
3030 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
3031 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs));
3032 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
3033 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
3034 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
3035 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
3036 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
3037 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3039 if (ndr_flags & NDR_BUFFERS) {
3040 if (r->rids) {
3041 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_rids));
3042 for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
3043 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
3046 if (r->attribs) {
3047 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_rids));
3048 for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
3049 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1]));
3053 return NDR_ERR_SUCCESS;
3056 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
3058 uint32_t _ptr_rids;
3059 uint32_t size_rids_1 = 0;
3060 uint32_t cntr_rids_1;
3061 TALLOC_CTX *_mem_save_rids_0;
3062 TALLOC_CTX *_mem_save_rids_1;
3063 uint32_t _ptr_attribs;
3064 uint32_t size_attribs_1 = 0;
3065 uint32_t cntr_attribs_1;
3066 TALLOC_CTX *_mem_save_attribs_0;
3067 TALLOC_CTX *_mem_save_attribs_1;
3068 if (ndr_flags & NDR_SCALARS) {
3069 NDR_CHECK(ndr_pull_align(ndr, 5));
3070 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
3071 if (_ptr_rids) {
3072 NDR_PULL_ALLOC(ndr, r->rids);
3073 } else {
3074 r->rids = NULL;
3076 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs));
3077 if (_ptr_attribs) {
3078 NDR_PULL_ALLOC(ndr, r->attribs);
3079 } else {
3080 r->attribs = NULL;
3082 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
3083 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
3084 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
3085 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
3086 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
3087 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3089 if (ndr_flags & NDR_BUFFERS) {
3090 if (r->rids) {
3091 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
3092 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
3093 NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
3094 size_rids_1 = ndr_get_array_size(ndr, &r->rids);
3095 NDR_PULL_ALLOC_N(ndr, r->rids, size_rids_1);
3096 _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
3097 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
3098 for (cntr_rids_1 = 0; cntr_rids_1 < size_rids_1; cntr_rids_1++) {
3099 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
3101 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
3102 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
3104 if (r->attribs) {
3105 _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr);
3106 NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
3107 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs));
3108 size_attribs_1 = ndr_get_array_size(ndr, &r->attribs);
3109 NDR_PULL_ALLOC_N(ndr, r->attribs, size_attribs_1);
3110 _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr);
3111 NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
3112 for (cntr_attribs_1 = 0; cntr_attribs_1 < size_attribs_1; cntr_attribs_1++) {
3113 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1]));
3115 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0);
3116 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0);
3118 if (r->rids) {
3119 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
3121 if (r->attribs) {
3122 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids));
3125 return NDR_ERR_SUCCESS;
3128 _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r)
3130 uint32_t cntr_rids_1;
3131 uint32_t cntr_attribs_1;
3132 ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER");
3133 ndr->depth++;
3134 ndr_print_ptr(ndr, "rids", r->rids);
3135 ndr->depth++;
3136 if (r->rids) {
3137 ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
3138 ndr->depth++;
3139 for (cntr_rids_1=0;cntr_rids_1<r->num_rids;cntr_rids_1++) {
3140 char *idx_1=NULL;
3141 if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
3142 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
3143 free(idx_1);
3146 ndr->depth--;
3148 ndr->depth--;
3149 ndr_print_ptr(ndr, "attribs", r->attribs);
3150 ndr->depth++;
3151 if (r->attribs) {
3152 ndr->print(ndr, "%s: ARRAY(%d)", "attribs", (int)r->num_rids);
3153 ndr->depth++;
3154 for (cntr_attribs_1=0;cntr_attribs_1<r->num_rids;cntr_attribs_1++) {
3155 char *idx_1=NULL;
3156 if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) {
3157 ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]);
3158 free(idx_1);
3161 ndr->depth--;
3163 ndr->depth--;
3164 ndr_print_uint32(ndr, "num_rids", r->num_rids);
3165 ndr_print_uint32(ndr, "unknown1", r->unknown1);
3166 ndr_print_uint32(ndr, "unknown2", r->unknown2);
3167 ndr_print_uint32(ndr, "unknown3", r->unknown3);
3168 ndr_print_uint32(ndr, "unknown4", r->unknown4);
3169 ndr->depth--;
3172 static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r)
3174 if (ndr_flags & NDR_SCALARS) {
3175 NDR_CHECK(ndr_push_align(ndr, 5));
3176 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3177 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
3178 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3179 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3180 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
3181 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3182 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3183 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3184 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3185 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3186 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3187 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3188 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3190 if (ndr_flags & NDR_BUFFERS) {
3191 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3192 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3193 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
3194 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3195 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3196 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3198 return NDR_ERR_SUCCESS;
3201 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r)
3203 if (ndr_flags & NDR_SCALARS) {
3204 NDR_CHECK(ndr_pull_align(ndr, 5));
3205 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3206 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
3207 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3208 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3209 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
3210 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3211 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3212 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3213 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3214 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3215 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3216 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3217 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3219 if (ndr_flags & NDR_BUFFERS) {
3220 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3221 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3222 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
3223 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3224 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3225 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3227 return NDR_ERR_SUCCESS;
3230 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r)
3232 ndr_print_struct(ndr, name, "netr_DELTA_ALIAS");
3233 ndr->depth++;
3234 ndr_print_lsa_String(ndr, "alias_name", &r->alias_name);
3235 ndr_print_uint32(ndr, "rid", r->rid);
3236 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3237 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3238 ndr_print_lsa_String(ndr, "description", &r->description);
3239 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3240 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3241 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3242 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3243 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3244 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3245 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3246 ndr->depth--;
3249 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)
3251 if (ndr_flags & NDR_SCALARS) {
3252 NDR_CHECK(ndr_push_align(ndr, 5));
3253 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3254 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
3255 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
3256 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
3257 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
3258 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3260 if (ndr_flags & NDR_BUFFERS) {
3261 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3263 return NDR_ERR_SUCCESS;
3266 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r)
3268 if (ndr_flags & NDR_SCALARS) {
3269 NDR_CHECK(ndr_pull_align(ndr, 5));
3270 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3271 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
3272 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
3273 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
3274 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
3275 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3277 if (ndr_flags & NDR_BUFFERS) {
3278 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3280 return NDR_ERR_SUCCESS;
3283 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r)
3285 ndr_print_struct(ndr, name, "netr_DELTA_ALIAS_MEMBER");
3286 ndr->depth++;
3287 ndr_print_lsa_SidArray(ndr, "sids", &r->sids);
3288 ndr_print_uint32(ndr, "unknown1", r->unknown1);
3289 ndr_print_uint32(ndr, "unknown2", r->unknown2);
3290 ndr_print_uint32(ndr, "unknown3", r->unknown3);
3291 ndr_print_uint32(ndr, "unknown4", r->unknown4);
3292 ndr->depth--;
3295 static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r)
3297 if (ndr_flags & NDR_SCALARS) {
3298 NDR_CHECK(ndr_push_align(ndr, 4));
3299 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagedpoollimit));
3300 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonpagedpoollimit));
3301 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minimumworkingsetsize));
3302 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximumworkingsetsize));
3303 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefilelimit));
3304 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timelimit));
3305 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
3307 if (ndr_flags & NDR_BUFFERS) {
3309 return NDR_ERR_SUCCESS;
3312 static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r)
3314 if (ndr_flags & NDR_SCALARS) {
3315 NDR_CHECK(ndr_pull_align(ndr, 4));
3316 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagedpoollimit));
3317 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nonpagedpoollimit));
3318 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minimumworkingsetsize));
3319 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximumworkingsetsize));
3320 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefilelimit));
3321 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timelimit));
3322 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
3324 if (ndr_flags & NDR_BUFFERS) {
3326 return NDR_ERR_SUCCESS;
3329 _PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r)
3331 ndr_print_struct(ndr, name, "netr_QUOTA_LIMITS");
3332 ndr->depth++;
3333 ndr_print_uint32(ndr, "pagedpoollimit", r->pagedpoollimit);
3334 ndr_print_uint32(ndr, "nonpagedpoollimit", r->nonpagedpoollimit);
3335 ndr_print_uint32(ndr, "minimumworkingsetsize", r->minimumworkingsetsize);
3336 ndr_print_uint32(ndr, "maximumworkingsetsize", r->maximumworkingsetsize);
3337 ndr_print_uint32(ndr, "pagefilelimit", r->pagefilelimit);
3338 ndr_print_NTTIME(ndr, "timelimit", r->timelimit);
3339 ndr->depth--;
3342 static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r)
3344 uint32_t cntr_eventauditoptions_1;
3345 if (ndr_flags & NDR_SCALARS) {
3346 NDR_CHECK(ndr_push_align(ndr, 5));
3347 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlogsize));
3348 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->auditretentionperiod));
3349 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auditingmode));
3350 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount));
3351 NDR_CHECK(ndr_push_unique_ptr(ndr, r->eventauditoptions));
3352 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3353 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
3354 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3355 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
3356 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time));
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));
3367 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3369 if (ndr_flags & NDR_BUFFERS) {
3370 if (r->eventauditoptions) {
3371 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->maxauditeventcount + 1));
3372 for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) {
3373 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->eventauditoptions[cntr_eventauditoptions_1]));
3376 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name));
3377 if (r->sid) {
3378 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
3380 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3381 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3382 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3383 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3384 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3386 return NDR_ERR_SUCCESS;
3389 static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r)
3391 uint32_t _ptr_eventauditoptions;
3392 uint32_t size_eventauditoptions_1 = 0;
3393 uint32_t cntr_eventauditoptions_1;
3394 TALLOC_CTX *_mem_save_eventauditoptions_0;
3395 TALLOC_CTX *_mem_save_eventauditoptions_1;
3396 uint32_t _ptr_sid;
3397 TALLOC_CTX *_mem_save_sid_0;
3398 if (ndr_flags & NDR_SCALARS) {
3399 NDR_CHECK(ndr_pull_align(ndr, 5));
3400 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlogsize));
3401 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->auditretentionperiod));
3402 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auditingmode));
3403 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxauditeventcount));
3404 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eventauditoptions));
3405 if (_ptr_eventauditoptions) {
3406 NDR_PULL_ALLOC(ndr, r->eventauditoptions);
3407 } else {
3408 r->eventauditoptions = NULL;
3410 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3411 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
3412 if (_ptr_sid) {
3413 NDR_PULL_ALLOC(ndr, r->sid);
3414 } else {
3415 r->sid = NULL;
3417 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3418 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
3419 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time));
3420 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3421 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3422 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3423 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3424 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3425 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3426 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3427 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3428 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3429 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3430 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3432 if (ndr_flags & NDR_BUFFERS) {
3433 if (r->eventauditoptions) {
3434 _mem_save_eventauditoptions_0 = NDR_PULL_GET_MEM_CTX(ndr);
3435 NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0);
3436 NDR_CHECK(ndr_pull_array_size(ndr, &r->eventauditoptions));
3437 size_eventauditoptions_1 = ndr_get_array_size(ndr, &r->eventauditoptions);
3438 NDR_PULL_ALLOC_N(ndr, r->eventauditoptions, size_eventauditoptions_1);
3439 _mem_save_eventauditoptions_1 = NDR_PULL_GET_MEM_CTX(ndr);
3440 NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0);
3441 for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < size_eventauditoptions_1; cntr_eventauditoptions_1++) {
3442 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->eventauditoptions[cntr_eventauditoptions_1]));
3444 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_1, 0);
3445 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_0, 0);
3447 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name));
3448 if (r->sid) {
3449 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
3450 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
3451 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
3452 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
3454 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3455 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3456 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3457 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3458 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3459 if (r->eventauditoptions) {
3460 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eventauditoptions, r->maxauditeventcount + 1));
3463 return NDR_ERR_SUCCESS;
3466 _PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r)
3468 uint32_t cntr_eventauditoptions_1;
3469 ndr_print_struct(ndr, name, "netr_DELTA_POLICY");
3470 ndr->depth++;
3471 ndr_print_uint32(ndr, "maxlogsize", r->maxlogsize);
3472 ndr_print_NTTIME(ndr, "auditretentionperiod", r->auditretentionperiod);
3473 ndr_print_uint8(ndr, "auditingmode", r->auditingmode);
3474 ndr_print_uint32(ndr, "maxauditeventcount", r->maxauditeventcount);
3475 ndr_print_ptr(ndr, "eventauditoptions", r->eventauditoptions);
3476 ndr->depth++;
3477 if (r->eventauditoptions) {
3478 ndr->print(ndr, "%s: ARRAY(%d)", "eventauditoptions", (int)r->maxauditeventcount + 1);
3479 ndr->depth++;
3480 for (cntr_eventauditoptions_1=0;cntr_eventauditoptions_1<r->maxauditeventcount + 1;cntr_eventauditoptions_1++) {
3481 char *idx_1=NULL;
3482 if (asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1) != -1) {
3483 ndr_print_uint32(ndr, "eventauditoptions", r->eventauditoptions[cntr_eventauditoptions_1]);
3484 free(idx_1);
3487 ndr->depth--;
3489 ndr->depth--;
3490 ndr_print_lsa_String(ndr, "primary_domain_name", &r->primary_domain_name);
3491 ndr_print_ptr(ndr, "sid", r->sid);
3492 ndr->depth++;
3493 if (r->sid) {
3494 ndr_print_dom_sid2(ndr, "sid", r->sid);
3496 ndr->depth--;
3497 ndr_print_netr_QUOTA_LIMITS(ndr, "quota_limits", &r->quota_limits);
3498 ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
3499 ndr_print_NTTIME(ndr, "db_create_time", r->db_create_time);
3500 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3501 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3502 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3503 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3504 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3505 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3506 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3507 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3508 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3509 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3510 ndr->depth--;
3513 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)
3515 uint32_t cntr_controller_names_1;
3516 if (ndr_flags & NDR_SCALARS) {
3517 NDR_CHECK(ndr_push_align(ndr, 5));
3518 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
3519 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers));
3520 NDR_CHECK(ndr_push_unique_ptr(ndr, r->controller_names));
3521 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3522 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3523 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3524 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3525 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3526 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3527 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset));
3528 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3529 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3530 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3531 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3533 if (ndr_flags & NDR_BUFFERS) {
3534 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
3535 if (r->controller_names) {
3536 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_controllers));
3537 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3538 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1]));
3540 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3541 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1]));
3544 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3545 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3546 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3547 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3548 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3550 return NDR_ERR_SUCCESS;
3553 static enum ndr_err_code ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r)
3555 uint32_t _ptr_controller_names;
3556 uint32_t size_controller_names_1 = 0;
3557 uint32_t cntr_controller_names_1;
3558 TALLOC_CTX *_mem_save_controller_names_0;
3559 TALLOC_CTX *_mem_save_controller_names_1;
3560 if (ndr_flags & NDR_SCALARS) {
3561 NDR_CHECK(ndr_pull_align(ndr, 5));
3562 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
3563 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_controllers));
3564 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_controller_names));
3565 if (_ptr_controller_names) {
3566 NDR_PULL_ALLOC(ndr, r->controller_names);
3567 } else {
3568 r->controller_names = NULL;
3570 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3571 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3572 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3573 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3574 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3575 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3576 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset));
3577 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3578 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3579 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3580 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3582 if (ndr_flags & NDR_BUFFERS) {
3583 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
3584 if (r->controller_names) {
3585 _mem_save_controller_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
3586 NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0);
3587 NDR_CHECK(ndr_pull_array_size(ndr, &r->controller_names));
3588 size_controller_names_1 = ndr_get_array_size(ndr, &r->controller_names);
3589 NDR_PULL_ALLOC_N(ndr, r->controller_names, size_controller_names_1);
3590 _mem_save_controller_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
3591 NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0);
3592 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < size_controller_names_1; cntr_controller_names_1++) {
3593 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1]));
3595 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < size_controller_names_1; cntr_controller_names_1++) {
3596 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1]));
3598 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_1, 0);
3599 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_0, 0);
3601 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3602 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3603 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3604 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3605 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3606 if (r->controller_names) {
3607 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->controller_names, r->num_controllers));
3610 return NDR_ERR_SUCCESS;
3613 _PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r)
3615 uint32_t cntr_controller_names_1;
3616 ndr_print_struct(ndr, name, "netr_DELTA_TRUSTED_DOMAIN");
3617 ndr->depth++;
3618 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
3619 ndr_print_uint32(ndr, "num_controllers", r->num_controllers);
3620 ndr_print_ptr(ndr, "controller_names", r->controller_names);
3621 ndr->depth++;
3622 if (r->controller_names) {
3623 ndr->print(ndr, "%s: ARRAY(%d)", "controller_names", (int)r->num_controllers);
3624 ndr->depth++;
3625 for (cntr_controller_names_1=0;cntr_controller_names_1<r->num_controllers;cntr_controller_names_1++) {
3626 char *idx_1=NULL;
3627 if (asprintf(&idx_1, "[%d]", cntr_controller_names_1) != -1) {
3628 ndr_print_lsa_String(ndr, "controller_names", &r->controller_names[cntr_controller_names_1]);
3629 free(idx_1);
3632 ndr->depth--;
3634 ndr->depth--;
3635 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3636 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3637 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3638 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3639 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3640 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3641 ndr_print_uint32(ndr, "posix_offset", r->posix_offset);
3642 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3643 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3644 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3645 ndr->depth--;
3648 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)
3650 if (ndr_flags & NDR_SCALARS) {
3651 NDR_CHECK(ndr_push_align(ndr, 2));
3652 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3653 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3655 if (ndr_flags & NDR_BUFFERS) {
3657 return NDR_ERR_SUCCESS;
3660 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r)
3662 if (ndr_flags & NDR_SCALARS) {
3663 NDR_CHECK(ndr_pull_align(ndr, 2));
3664 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3665 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3667 if (ndr_flags & NDR_BUFFERS) {
3669 return NDR_ERR_SUCCESS;
3672 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r)
3674 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_TRUST");
3675 ndr->depth++;
3676 ndr_print_uint16(ndr, "unknown", r->unknown);
3677 ndr->depth--;
3680 static enum ndr_err_code ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r)
3682 uint32_t cntr_privilege_attrib_1;
3683 uint32_t cntr_privilege_name_1;
3684 if (ndr_flags & NDR_SCALARS) {
3685 NDR_CHECK(ndr_push_align(ndr, 5));
3686 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries));
3687 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_control));
3688 NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_attrib));
3689 NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_name));
3690 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits));
3691 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->system_flags));
3692 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3693 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3694 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3695 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3696 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3697 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3698 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3699 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3700 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3701 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3702 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3704 if (ndr_flags & NDR_BUFFERS) {
3705 if (r->privilege_attrib) {
3706 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->privilege_entries));
3707 for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) {
3708 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_attrib[cntr_privilege_attrib_1]));
3711 if (r->privilege_name) {
3712 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->privilege_entries));
3713 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3714 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1]));
3716 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3717 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1]));
3720 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3721 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3722 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3723 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3724 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3726 return NDR_ERR_SUCCESS;
3729 static enum ndr_err_code ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r)
3731 uint32_t _ptr_privilege_attrib;
3732 uint32_t size_privilege_attrib_1 = 0;
3733 uint32_t cntr_privilege_attrib_1;
3734 TALLOC_CTX *_mem_save_privilege_attrib_0;
3735 TALLOC_CTX *_mem_save_privilege_attrib_1;
3736 uint32_t _ptr_privilege_name;
3737 uint32_t size_privilege_name_1 = 0;
3738 uint32_t cntr_privilege_name_1;
3739 TALLOC_CTX *_mem_save_privilege_name_0;
3740 TALLOC_CTX *_mem_save_privilege_name_1;
3741 if (ndr_flags & NDR_SCALARS) {
3742 NDR_CHECK(ndr_pull_align(ndr, 5));
3743 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_entries));
3744 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_control));
3745 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_attrib));
3746 if (_ptr_privilege_attrib) {
3747 NDR_PULL_ALLOC(ndr, r->privilege_attrib);
3748 } else {
3749 r->privilege_attrib = NULL;
3751 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_name));
3752 if (_ptr_privilege_name) {
3753 NDR_PULL_ALLOC(ndr, r->privilege_name);
3754 } else {
3755 r->privilege_name = NULL;
3757 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits));
3758 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->system_flags));
3759 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3760 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3761 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3762 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3763 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3764 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3765 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3766 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3767 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3768 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3769 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3771 if (ndr_flags & NDR_BUFFERS) {
3772 if (r->privilege_attrib) {
3773 _mem_save_privilege_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr);
3774 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0);
3775 NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_attrib));
3776 size_privilege_attrib_1 = ndr_get_array_size(ndr, &r->privilege_attrib);
3777 NDR_PULL_ALLOC_N(ndr, r->privilege_attrib, size_privilege_attrib_1);
3778 _mem_save_privilege_attrib_1 = NDR_PULL_GET_MEM_CTX(ndr);
3779 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0);
3780 for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < size_privilege_attrib_1; cntr_privilege_attrib_1++) {
3781 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_attrib[cntr_privilege_attrib_1]));
3783 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_1, 0);
3784 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_0, 0);
3786 if (r->privilege_name) {
3787 _mem_save_privilege_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3788 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0);
3789 NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_name));
3790 size_privilege_name_1 = ndr_get_array_size(ndr, &r->privilege_name);
3791 NDR_PULL_ALLOC_N(ndr, r->privilege_name, size_privilege_name_1);
3792 _mem_save_privilege_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
3793 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0);
3794 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < size_privilege_name_1; cntr_privilege_name_1++) {
3795 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1]));
3797 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < size_privilege_name_1; cntr_privilege_name_1++) {
3798 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1]));
3800 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_1, 0);
3801 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_0, 0);
3803 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3804 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3805 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3806 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3807 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3808 if (r->privilege_attrib) {
3809 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_attrib, r->privilege_entries));
3811 if (r->privilege_name) {
3812 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_name, r->privilege_entries));
3815 return NDR_ERR_SUCCESS;
3818 _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r)
3820 uint32_t cntr_privilege_attrib_1;
3821 uint32_t cntr_privilege_name_1;
3822 ndr_print_struct(ndr, name, "netr_DELTA_ACCOUNT");
3823 ndr->depth++;
3824 ndr_print_uint32(ndr, "privilege_entries", r->privilege_entries);
3825 ndr_print_uint32(ndr, "privilege_control", r->privilege_control);
3826 ndr_print_ptr(ndr, "privilege_attrib", r->privilege_attrib);
3827 ndr->depth++;
3828 if (r->privilege_attrib) {
3829 ndr->print(ndr, "%s: ARRAY(%d)", "privilege_attrib", (int)r->privilege_entries);
3830 ndr->depth++;
3831 for (cntr_privilege_attrib_1=0;cntr_privilege_attrib_1<r->privilege_entries;cntr_privilege_attrib_1++) {
3832 char *idx_1=NULL;
3833 if (asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1) != -1) {
3834 ndr_print_uint32(ndr, "privilege_attrib", r->privilege_attrib[cntr_privilege_attrib_1]);
3835 free(idx_1);
3838 ndr->depth--;
3840 ndr->depth--;
3841 ndr_print_ptr(ndr, "privilege_name", r->privilege_name);
3842 ndr->depth++;
3843 if (r->privilege_name) {
3844 ndr->print(ndr, "%s: ARRAY(%d)", "privilege_name", (int)r->privilege_entries);
3845 ndr->depth++;
3846 for (cntr_privilege_name_1=0;cntr_privilege_name_1<r->privilege_entries;cntr_privilege_name_1++) {
3847 char *idx_1=NULL;
3848 if (asprintf(&idx_1, "[%d]", cntr_privilege_name_1) != -1) {
3849 ndr_print_lsa_String(ndr, "privilege_name", &r->privilege_name[cntr_privilege_name_1]);
3850 free(idx_1);
3853 ndr->depth--;
3855 ndr->depth--;
3856 ndr_print_netr_QUOTA_LIMITS(ndr, "quotalimits", &r->quotalimits);
3857 ndr_print_uint32(ndr, "system_flags", r->system_flags);
3858 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3859 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3860 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3861 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3862 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3863 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3864 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3865 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3866 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3867 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3868 ndr->depth--;
3871 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)
3873 if (ndr_flags & NDR_SCALARS) {
3874 NDR_CHECK(ndr_push_align(ndr, 2));
3875 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3876 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3878 if (ndr_flags & NDR_BUFFERS) {
3880 return NDR_ERR_SUCCESS;
3883 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r)
3885 if (ndr_flags & NDR_SCALARS) {
3886 NDR_CHECK(ndr_pull_align(ndr, 2));
3887 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3888 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3890 if (ndr_flags & NDR_BUFFERS) {
3892 return NDR_ERR_SUCCESS;
3895 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r)
3897 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_ACCOUNT");
3898 ndr->depth++;
3899 ndr_print_uint16(ndr, "unknown", r->unknown);
3900 ndr->depth--;
3903 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)
3905 if (ndr_flags & NDR_SCALARS) {
3906 NDR_CHECK(ndr_push_align(ndr, 2));
3907 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3908 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3910 if (ndr_flags & NDR_BUFFERS) {
3912 return NDR_ERR_SUCCESS;
3915 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r)
3917 if (ndr_flags & NDR_SCALARS) {
3918 NDR_CHECK(ndr_pull_align(ndr, 2));
3919 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3920 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3922 if (ndr_flags & NDR_BUFFERS) {
3924 return NDR_ERR_SUCCESS;
3927 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r)
3929 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_SECRET");
3930 ndr->depth++;
3931 ndr_print_uint16(ndr, "unknown", r->unknown);
3932 ndr->depth--;
3935 static enum ndr_err_code ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r)
3937 if (ndr_flags & NDR_SCALARS) {
3938 NDR_CHECK(ndr_push_align(ndr, 5));
3939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
3940 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen));
3941 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cipher_data));
3942 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3944 if (ndr_flags & NDR_BUFFERS) {
3945 if (r->cipher_data) {
3946 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->maxlen));
3947 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3948 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->len));
3949 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->cipher_data, r->len));
3952 return NDR_ERR_SUCCESS;
3955 static enum ndr_err_code ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r)
3957 uint32_t _ptr_cipher_data;
3958 uint32_t size_cipher_data_1 = 0;
3959 uint32_t length_cipher_data_1 = 0;
3960 TALLOC_CTX *_mem_save_cipher_data_0;
3961 if (ndr_flags & NDR_SCALARS) {
3962 NDR_CHECK(ndr_pull_align(ndr, 5));
3963 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len));
3964 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlen));
3965 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cipher_data));
3966 if (_ptr_cipher_data) {
3967 NDR_PULL_ALLOC(ndr, r->cipher_data);
3968 } else {
3969 r->cipher_data = NULL;
3971 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3973 if (ndr_flags & NDR_BUFFERS) {
3974 if (r->cipher_data) {
3975 _mem_save_cipher_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
3976 NDR_PULL_SET_MEM_CTX(ndr, r->cipher_data, 0);
3977 NDR_CHECK(ndr_pull_array_size(ndr, &r->cipher_data));
3978 NDR_CHECK(ndr_pull_array_length(ndr, &r->cipher_data));
3979 size_cipher_data_1 = ndr_get_array_size(ndr, &r->cipher_data);
3980 length_cipher_data_1 = ndr_get_array_length(ndr, &r->cipher_data);
3981 if (length_cipher_data_1 > size_cipher_data_1) {
3982 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_cipher_data_1, length_cipher_data_1);
3984 NDR_PULL_ALLOC_N(ndr, r->cipher_data, size_cipher_data_1);
3985 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->cipher_data, length_cipher_data_1));
3986 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cipher_data_0, 0);
3988 if (r->cipher_data) {
3989 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cipher_data, r->maxlen));
3991 if (r->cipher_data) {
3992 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->cipher_data, r->len));
3995 return NDR_ERR_SUCCESS;
3998 _PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r)
4000 ndr_print_struct(ndr, name, "netr_CIPHER_VALUE");
4001 ndr->depth++;
4002 ndr_print_uint32(ndr, "len", r->len);
4003 ndr_print_uint32(ndr, "maxlen", r->maxlen);
4004 ndr_print_ptr(ndr, "cipher_data", r->cipher_data);
4005 ndr->depth++;
4006 if (r->cipher_data) {
4007 ndr_print_array_uint8(ndr, "cipher_data", r->cipher_data, r->len);
4009 ndr->depth--;
4010 ndr->depth--;
4013 static enum ndr_err_code ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r)
4015 if (ndr_flags & NDR_SCALARS) {
4016 NDR_CHECK(ndr_push_align(ndr, 5));
4017 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher));
4018 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->current_cipher_set_time));
4019 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher));
4020 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->old_cipher_set_time));
4021 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
4022 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
4023 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
4024 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
4025 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
4026 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
4027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
4028 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
4029 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
4030 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
4031 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
4033 if (ndr_flags & NDR_BUFFERS) {
4034 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher));
4035 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher));
4036 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
4037 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
4038 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
4039 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
4040 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
4042 return NDR_ERR_SUCCESS;
4045 static enum ndr_err_code ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r)
4047 if (ndr_flags & NDR_SCALARS) {
4048 NDR_CHECK(ndr_pull_align(ndr, 5));
4049 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher));
4050 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->current_cipher_set_time));
4051 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher));
4052 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->old_cipher_set_time));
4053 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
4054 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
4055 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
4056 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
4057 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
4058 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
4059 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
4060 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
4061 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
4062 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
4063 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
4065 if (ndr_flags & NDR_BUFFERS) {
4066 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher));
4067 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher));
4068 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
4069 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
4070 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
4071 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
4072 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
4074 return NDR_ERR_SUCCESS;
4077 _PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r)
4079 ndr_print_struct(ndr, name, "netr_DELTA_SECRET");
4080 ndr->depth++;
4081 ndr_print_netr_CIPHER_VALUE(ndr, "current_cipher", &r->current_cipher);
4082 ndr_print_NTTIME(ndr, "current_cipher_set_time", r->current_cipher_set_time);
4083 ndr_print_netr_CIPHER_VALUE(ndr, "old_cipher", &r->old_cipher);
4084 ndr_print_NTTIME(ndr, "old_cipher_set_time", r->old_cipher_set_time);
4085 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
4086 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
4087 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
4088 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
4089 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
4090 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
4091 ndr_print_uint32(ndr, "unknown5", r->unknown5);
4092 ndr_print_uint32(ndr, "unknown6", r->unknown6);
4093 ndr_print_uint32(ndr, "unknown7", r->unknown7);
4094 ndr_print_uint32(ndr, "unknown8", r->unknown8);
4095 ndr->depth--;
4098 static enum ndr_err_code ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r)
4100 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
4101 return NDR_ERR_SUCCESS;
4104 static enum ndr_err_code ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r)
4106 uint16_t v;
4107 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
4108 *r = v;
4109 return NDR_ERR_SUCCESS;
4112 _PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r)
4114 const char *val = NULL;
4116 switch (r) {
4117 case NETR_DELTA_DOMAIN: val = "NETR_DELTA_DOMAIN"; break;
4118 case NETR_DELTA_GROUP: val = "NETR_DELTA_GROUP"; break;
4119 case NETR_DELTA_DELETE_GROUP: val = "NETR_DELTA_DELETE_GROUP"; break;
4120 case NETR_DELTA_RENAME_GROUP: val = "NETR_DELTA_RENAME_GROUP"; break;
4121 case NETR_DELTA_USER: val = "NETR_DELTA_USER"; break;
4122 case NETR_DELTA_DELETE_USER: val = "NETR_DELTA_DELETE_USER"; break;
4123 case NETR_DELTA_RENAME_USER: val = "NETR_DELTA_RENAME_USER"; break;
4124 case NETR_DELTA_GROUP_MEMBER: val = "NETR_DELTA_GROUP_MEMBER"; break;
4125 case NETR_DELTA_ALIAS: val = "NETR_DELTA_ALIAS"; break;
4126 case NETR_DELTA_DELETE_ALIAS: val = "NETR_DELTA_DELETE_ALIAS"; break;
4127 case NETR_DELTA_RENAME_ALIAS: val = "NETR_DELTA_RENAME_ALIAS"; break;
4128 case NETR_DELTA_ALIAS_MEMBER: val = "NETR_DELTA_ALIAS_MEMBER"; break;
4129 case NETR_DELTA_POLICY: val = "NETR_DELTA_POLICY"; break;
4130 case NETR_DELTA_TRUSTED_DOMAIN: val = "NETR_DELTA_TRUSTED_DOMAIN"; break;
4131 case NETR_DELTA_DELETE_TRUST: val = "NETR_DELTA_DELETE_TRUST"; break;
4132 case NETR_DELTA_ACCOUNT: val = "NETR_DELTA_ACCOUNT"; break;
4133 case NETR_DELTA_DELETE_ACCOUNT: val = "NETR_DELTA_DELETE_ACCOUNT"; break;
4134 case NETR_DELTA_SECRET: val = "NETR_DELTA_SECRET"; break;
4135 case NETR_DELTA_DELETE_SECRET: val = "NETR_DELTA_DELETE_SECRET"; break;
4136 case NETR_DELTA_DELETE_GROUP2: val = "NETR_DELTA_DELETE_GROUP2"; break;
4137 case NETR_DELTA_DELETE_USER2: val = "NETR_DELTA_DELETE_USER2"; break;
4138 case NETR_DELTA_MODIFY_COUNT: val = "NETR_DELTA_MODIFY_COUNT"; break;
4140 ndr_print_enum(ndr, name, "ENUM", val, r);
4143 static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r)
4145 if (ndr_flags & NDR_SCALARS) {
4146 int level = ndr_push_get_switch_value(ndr, r);
4147 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
4148 NDR_CHECK(ndr_push_union_align(ndr, 5));
4149 switch (level) {
4150 case NETR_DELTA_DOMAIN: {
4151 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
4152 break; }
4154 case NETR_DELTA_GROUP: {
4155 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group));
4156 break; }
4158 case NETR_DELTA_DELETE_GROUP: {
4159 break; }
4161 case NETR_DELTA_RENAME_GROUP: {
4162 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group));
4163 break; }
4165 case NETR_DELTA_USER: {
4166 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
4167 break; }
4169 case NETR_DELTA_DELETE_USER: {
4170 break; }
4172 case NETR_DELTA_RENAME_USER: {
4173 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user));
4174 break; }
4176 case NETR_DELTA_GROUP_MEMBER: {
4177 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member));
4178 break; }
4180 case NETR_DELTA_ALIAS: {
4181 NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias));
4182 break; }
4184 case NETR_DELTA_DELETE_ALIAS: {
4185 break; }
4187 case NETR_DELTA_RENAME_ALIAS: {
4188 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias));
4189 break; }
4191 case NETR_DELTA_ALIAS_MEMBER: {
4192 NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member));
4193 break; }
4195 case NETR_DELTA_POLICY: {
4196 NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
4197 break; }
4199 case NETR_DELTA_TRUSTED_DOMAIN: {
4200 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain));
4201 break; }
4203 case NETR_DELTA_DELETE_TRUST: {
4204 NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust));
4205 break; }
4207 case NETR_DELTA_ACCOUNT: {
4208 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account));
4209 break; }
4211 case NETR_DELTA_DELETE_ACCOUNT: {
4212 NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account));
4213 break; }
4215 case NETR_DELTA_SECRET: {
4216 NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret));
4217 break; }
4219 case NETR_DELTA_DELETE_SECRET: {
4220 NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret));
4221 break; }
4223 case NETR_DELTA_DELETE_GROUP2: {
4224 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group));
4225 break; }
4227 case NETR_DELTA_DELETE_USER2: {
4228 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user));
4229 break; }
4231 case NETR_DELTA_MODIFY_COUNT: {
4232 NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count));
4233 break; }
4235 default:
4236 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4239 if (ndr_flags & NDR_BUFFERS) {
4240 int level = ndr_push_get_switch_value(ndr, r);
4241 switch (level) {
4242 case NETR_DELTA_DOMAIN:
4243 if (r->domain) {
4244 NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4246 break;
4248 case NETR_DELTA_GROUP:
4249 if (r->group) {
4250 NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group));
4252 break;
4254 case NETR_DELTA_DELETE_GROUP:
4255 break;
4257 case NETR_DELTA_RENAME_GROUP:
4258 if (r->rename_group) {
4259 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group));
4261 break;
4263 case NETR_DELTA_USER:
4264 if (r->user) {
4265 NDR_CHECK(ndr_push_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user));
4267 break;
4269 case NETR_DELTA_DELETE_USER:
4270 break;
4272 case NETR_DELTA_RENAME_USER:
4273 if (r->rename_user) {
4274 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user));
4276 break;
4278 case NETR_DELTA_GROUP_MEMBER:
4279 if (r->group_member) {
4280 NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member));
4282 break;
4284 case NETR_DELTA_ALIAS:
4285 if (r->alias) {
4286 NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias));
4288 break;
4290 case NETR_DELTA_DELETE_ALIAS:
4291 break;
4293 case NETR_DELTA_RENAME_ALIAS:
4294 if (r->rename_alias) {
4295 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias));
4297 break;
4299 case NETR_DELTA_ALIAS_MEMBER:
4300 if (r->alias_member) {
4301 NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member));
4303 break;
4305 case NETR_DELTA_POLICY:
4306 if (r->policy) {
4307 NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy));
4309 break;
4311 case NETR_DELTA_TRUSTED_DOMAIN:
4312 if (r->trusted_domain) {
4313 NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain));
4315 break;
4317 case NETR_DELTA_DELETE_TRUST:
4318 break;
4320 case NETR_DELTA_ACCOUNT:
4321 if (r->account) {
4322 NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account));
4324 break;
4326 case NETR_DELTA_DELETE_ACCOUNT:
4327 break;
4329 case NETR_DELTA_SECRET:
4330 if (r->secret) {
4331 NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret));
4333 break;
4335 case NETR_DELTA_DELETE_SECRET:
4336 break;
4338 case NETR_DELTA_DELETE_GROUP2:
4339 if (r->delete_group) {
4340 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group));
4342 break;
4344 case NETR_DELTA_DELETE_USER2:
4345 if (r->delete_user) {
4346 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user));
4348 break;
4350 case NETR_DELTA_MODIFY_COUNT:
4351 if (r->modified_count) {
4352 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->modified_count));
4354 break;
4356 default:
4357 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4360 return NDR_ERR_SUCCESS;
4363 static enum ndr_err_code ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r)
4365 int level;
4366 uint16_t _level;
4367 TALLOC_CTX *_mem_save_domain_0;
4368 uint32_t _ptr_domain;
4369 TALLOC_CTX *_mem_save_group_0;
4370 uint32_t _ptr_group;
4371 TALLOC_CTX *_mem_save_rename_group_0;
4372 uint32_t _ptr_rename_group;
4373 TALLOC_CTX *_mem_save_user_0;
4374 uint32_t _ptr_user;
4375 TALLOC_CTX *_mem_save_rename_user_0;
4376 uint32_t _ptr_rename_user;
4377 TALLOC_CTX *_mem_save_group_member_0;
4378 uint32_t _ptr_group_member;
4379 TALLOC_CTX *_mem_save_alias_0;
4380 uint32_t _ptr_alias;
4381 TALLOC_CTX *_mem_save_rename_alias_0;
4382 uint32_t _ptr_rename_alias;
4383 TALLOC_CTX *_mem_save_alias_member_0;
4384 uint32_t _ptr_alias_member;
4385 TALLOC_CTX *_mem_save_policy_0;
4386 uint32_t _ptr_policy;
4387 TALLOC_CTX *_mem_save_trusted_domain_0;
4388 uint32_t _ptr_trusted_domain;
4389 TALLOC_CTX *_mem_save_account_0;
4390 uint32_t _ptr_account;
4391 TALLOC_CTX *_mem_save_secret_0;
4392 uint32_t _ptr_secret;
4393 TALLOC_CTX *_mem_save_delete_group_0;
4394 uint32_t _ptr_delete_group;
4395 TALLOC_CTX *_mem_save_delete_user_0;
4396 uint32_t _ptr_delete_user;
4397 TALLOC_CTX *_mem_save_modified_count_0;
4398 uint32_t _ptr_modified_count;
4399 level = ndr_pull_get_switch_value(ndr, r);
4400 if (ndr_flags & NDR_SCALARS) {
4401 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
4402 if (_level != level) {
4403 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4405 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4406 switch (level) {
4407 case NETR_DELTA_DOMAIN: {
4408 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
4409 if (_ptr_domain) {
4410 NDR_PULL_ALLOC(ndr, r->domain);
4411 } else {
4412 r->domain = NULL;
4414 break; }
4416 case NETR_DELTA_GROUP: {
4417 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group));
4418 if (_ptr_group) {
4419 NDR_PULL_ALLOC(ndr, r->group);
4420 } else {
4421 r->group = NULL;
4423 break; }
4425 case NETR_DELTA_DELETE_GROUP: {
4426 break; }
4428 case NETR_DELTA_RENAME_GROUP: {
4429 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_group));
4430 if (_ptr_rename_group) {
4431 NDR_PULL_ALLOC(ndr, r->rename_group);
4432 } else {
4433 r->rename_group = NULL;
4435 break; }
4437 case NETR_DELTA_USER: {
4438 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
4439 if (_ptr_user) {
4440 NDR_PULL_ALLOC(ndr, r->user);
4441 } else {
4442 r->user = NULL;
4444 break; }
4446 case NETR_DELTA_DELETE_USER: {
4447 break; }
4449 case NETR_DELTA_RENAME_USER: {
4450 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_user));
4451 if (_ptr_rename_user) {
4452 NDR_PULL_ALLOC(ndr, r->rename_user);
4453 } else {
4454 r->rename_user = NULL;
4456 break; }
4458 case NETR_DELTA_GROUP_MEMBER: {
4459 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_member));
4460 if (_ptr_group_member) {
4461 NDR_PULL_ALLOC(ndr, r->group_member);
4462 } else {
4463 r->group_member = NULL;
4465 break; }
4467 case NETR_DELTA_ALIAS: {
4468 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias));
4469 if (_ptr_alias) {
4470 NDR_PULL_ALLOC(ndr, r->alias);
4471 } else {
4472 r->alias = NULL;
4474 break; }
4476 case NETR_DELTA_DELETE_ALIAS: {
4477 break; }
4479 case NETR_DELTA_RENAME_ALIAS: {
4480 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_alias));
4481 if (_ptr_rename_alias) {
4482 NDR_PULL_ALLOC(ndr, r->rename_alias);
4483 } else {
4484 r->rename_alias = NULL;
4486 break; }
4488 case NETR_DELTA_ALIAS_MEMBER: {
4489 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias_member));
4490 if (_ptr_alias_member) {
4491 NDR_PULL_ALLOC(ndr, r->alias_member);
4492 } else {
4493 r->alias_member = NULL;
4495 break; }
4497 case NETR_DELTA_POLICY: {
4498 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy));
4499 if (_ptr_policy) {
4500 NDR_PULL_ALLOC(ndr, r->policy);
4501 } else {
4502 r->policy = NULL;
4504 break; }
4506 case NETR_DELTA_TRUSTED_DOMAIN: {
4507 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain));
4508 if (_ptr_trusted_domain) {
4509 NDR_PULL_ALLOC(ndr, r->trusted_domain);
4510 } else {
4511 r->trusted_domain = NULL;
4513 break; }
4515 case NETR_DELTA_DELETE_TRUST: {
4516 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust));
4517 break; }
4519 case NETR_DELTA_ACCOUNT: {
4520 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account));
4521 if (_ptr_account) {
4522 NDR_PULL_ALLOC(ndr, r->account);
4523 } else {
4524 r->account = NULL;
4526 break; }
4528 case NETR_DELTA_DELETE_ACCOUNT: {
4529 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account));
4530 break; }
4532 case NETR_DELTA_SECRET: {
4533 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secret));
4534 if (_ptr_secret) {
4535 NDR_PULL_ALLOC(ndr, r->secret);
4536 } else {
4537 r->secret = NULL;
4539 break; }
4541 case NETR_DELTA_DELETE_SECRET: {
4542 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret));
4543 break; }
4545 case NETR_DELTA_DELETE_GROUP2: {
4546 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_group));
4547 if (_ptr_delete_group) {
4548 NDR_PULL_ALLOC(ndr, r->delete_group);
4549 } else {
4550 r->delete_group = NULL;
4552 break; }
4554 case NETR_DELTA_DELETE_USER2: {
4555 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_user));
4556 if (_ptr_delete_user) {
4557 NDR_PULL_ALLOC(ndr, r->delete_user);
4558 } else {
4559 r->delete_user = NULL;
4561 break; }
4563 case NETR_DELTA_MODIFY_COUNT: {
4564 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_modified_count));
4565 if (_ptr_modified_count) {
4566 NDR_PULL_ALLOC(ndr, r->modified_count);
4567 } else {
4568 r->modified_count = NULL;
4570 break; }
4572 default:
4573 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4576 if (ndr_flags & NDR_BUFFERS) {
4577 switch (level) {
4578 case NETR_DELTA_DOMAIN:
4579 if (r->domain) {
4580 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
4581 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
4582 NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
4585 break;
4587 case NETR_DELTA_GROUP:
4588 if (r->group) {
4589 _mem_save_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4590 NDR_PULL_SET_MEM_CTX(ndr, r->group, 0);
4591 NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group));
4592 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_0, 0);
4594 break;
4596 case NETR_DELTA_DELETE_GROUP:
4597 break;
4599 case NETR_DELTA_RENAME_GROUP:
4600 if (r->rename_group) {
4601 _mem_save_rename_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4602 NDR_PULL_SET_MEM_CTX(ndr, r->rename_group, 0);
4603 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group));
4604 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_group_0, 0);
4606 break;
4608 case NETR_DELTA_USER:
4609 if (r->user) {
4610 _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4611 NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
4612 NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user));
4613 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
4615 break;
4617 case NETR_DELTA_DELETE_USER:
4618 break;
4620 case NETR_DELTA_RENAME_USER:
4621 if (r->rename_user) {
4622 _mem_save_rename_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4623 NDR_PULL_SET_MEM_CTX(ndr, r->rename_user, 0);
4624 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user));
4625 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_user_0, 0);
4627 break;
4629 case NETR_DELTA_GROUP_MEMBER:
4630 if (r->group_member) {
4631 _mem_save_group_member_0 = NDR_PULL_GET_MEM_CTX(ndr);
4632 NDR_PULL_SET_MEM_CTX(ndr, r->group_member, 0);
4633 NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member));
4634 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_member_0, 0);
4636 break;
4638 case NETR_DELTA_ALIAS:
4639 if (r->alias) {
4640 _mem_save_alias_0 = NDR_PULL_GET_MEM_CTX(ndr);
4641 NDR_PULL_SET_MEM_CTX(ndr, r->alias, 0);
4642 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias));
4643 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_0, 0);
4645 break;
4647 case NETR_DELTA_DELETE_ALIAS:
4648 break;
4650 case NETR_DELTA_RENAME_ALIAS:
4651 if (r->rename_alias) {
4652 _mem_save_rename_alias_0 = NDR_PULL_GET_MEM_CTX(ndr);
4653 NDR_PULL_SET_MEM_CTX(ndr, r->rename_alias, 0);
4654 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias));
4655 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_alias_0, 0);
4657 break;
4659 case NETR_DELTA_ALIAS_MEMBER:
4660 if (r->alias_member) {
4661 _mem_save_alias_member_0 = NDR_PULL_GET_MEM_CTX(ndr);
4662 NDR_PULL_SET_MEM_CTX(ndr, r->alias_member, 0);
4663 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member));
4664 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_member_0, 0);
4666 break;
4668 case NETR_DELTA_POLICY:
4669 if (r->policy) {
4670 _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
4671 NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0);
4672 NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy));
4673 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0);
4675 break;
4677 case NETR_DELTA_TRUSTED_DOMAIN:
4678 if (r->trusted_domain) {
4679 _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
4680 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain, 0);
4681 NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain));
4682 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, 0);
4684 break;
4686 case NETR_DELTA_DELETE_TRUST:
4687 break;
4689 case NETR_DELTA_ACCOUNT:
4690 if (r->account) {
4691 _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
4692 NDR_PULL_SET_MEM_CTX(ndr, r->account, 0);
4693 NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account));
4694 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0);
4696 break;
4698 case NETR_DELTA_DELETE_ACCOUNT:
4699 break;
4701 case NETR_DELTA_SECRET:
4702 if (r->secret) {
4703 _mem_save_secret_0 = NDR_PULL_GET_MEM_CTX(ndr);
4704 NDR_PULL_SET_MEM_CTX(ndr, r->secret, 0);
4705 NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret));
4706 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secret_0, 0);
4708 break;
4710 case NETR_DELTA_DELETE_SECRET:
4711 break;
4713 case NETR_DELTA_DELETE_GROUP2:
4714 if (r->delete_group) {
4715 _mem_save_delete_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4716 NDR_PULL_SET_MEM_CTX(ndr, r->delete_group, 0);
4717 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group));
4718 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_group_0, 0);
4720 break;
4722 case NETR_DELTA_DELETE_USER2:
4723 if (r->delete_user) {
4724 _mem_save_delete_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4725 NDR_PULL_SET_MEM_CTX(ndr, r->delete_user, 0);
4726 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user));
4727 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_user_0, 0);
4729 break;
4731 case NETR_DELTA_MODIFY_COUNT:
4732 if (r->modified_count) {
4733 _mem_save_modified_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
4734 NDR_PULL_SET_MEM_CTX(ndr, r->modified_count, 0);
4735 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->modified_count));
4736 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_modified_count_0, 0);
4738 break;
4740 default:
4741 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4744 return NDR_ERR_SUCCESS;
4747 _PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r)
4749 int level;
4750 level = ndr_print_get_switch_value(ndr, r);
4751 ndr_print_union(ndr, name, level, "netr_DELTA_UNION");
4752 switch (level) {
4753 case NETR_DELTA_DOMAIN:
4754 ndr_print_ptr(ndr, "domain", r->domain);
4755 ndr->depth++;
4756 if (r->domain) {
4757 ndr_print_netr_DELTA_DOMAIN(ndr, "domain", r->domain);
4759 ndr->depth--;
4760 break;
4762 case NETR_DELTA_GROUP:
4763 ndr_print_ptr(ndr, "group", r->group);
4764 ndr->depth++;
4765 if (r->group) {
4766 ndr_print_netr_DELTA_GROUP(ndr, "group", r->group);
4768 ndr->depth--;
4769 break;
4771 case NETR_DELTA_DELETE_GROUP:
4772 break;
4774 case NETR_DELTA_RENAME_GROUP:
4775 ndr_print_ptr(ndr, "rename_group", r->rename_group);
4776 ndr->depth++;
4777 if (r->rename_group) {
4778 ndr_print_netr_DELTA_RENAME(ndr, "rename_group", r->rename_group);
4780 ndr->depth--;
4781 break;
4783 case NETR_DELTA_USER:
4784 ndr_print_ptr(ndr, "user", r->user);
4785 ndr->depth++;
4786 if (r->user) {
4787 ndr_print_netr_DELTA_USER(ndr, "user", r->user);
4789 ndr->depth--;
4790 break;
4792 case NETR_DELTA_DELETE_USER:
4793 break;
4795 case NETR_DELTA_RENAME_USER:
4796 ndr_print_ptr(ndr, "rename_user", r->rename_user);
4797 ndr->depth++;
4798 if (r->rename_user) {
4799 ndr_print_netr_DELTA_RENAME(ndr, "rename_user", r->rename_user);
4801 ndr->depth--;
4802 break;
4804 case NETR_DELTA_GROUP_MEMBER:
4805 ndr_print_ptr(ndr, "group_member", r->group_member);
4806 ndr->depth++;
4807 if (r->group_member) {
4808 ndr_print_netr_DELTA_GROUP_MEMBER(ndr, "group_member", r->group_member);
4810 ndr->depth--;
4811 break;
4813 case NETR_DELTA_ALIAS:
4814 ndr_print_ptr(ndr, "alias", r->alias);
4815 ndr->depth++;
4816 if (r->alias) {
4817 ndr_print_netr_DELTA_ALIAS(ndr, "alias", r->alias);
4819 ndr->depth--;
4820 break;
4822 case NETR_DELTA_DELETE_ALIAS:
4823 break;
4825 case NETR_DELTA_RENAME_ALIAS:
4826 ndr_print_ptr(ndr, "rename_alias", r->rename_alias);
4827 ndr->depth++;
4828 if (r->rename_alias) {
4829 ndr_print_netr_DELTA_RENAME(ndr, "rename_alias", r->rename_alias);
4831 ndr->depth--;
4832 break;
4834 case NETR_DELTA_ALIAS_MEMBER:
4835 ndr_print_ptr(ndr, "alias_member", r->alias_member);
4836 ndr->depth++;
4837 if (r->alias_member) {
4838 ndr_print_netr_DELTA_ALIAS_MEMBER(ndr, "alias_member", r->alias_member);
4840 ndr->depth--;
4841 break;
4843 case NETR_DELTA_POLICY:
4844 ndr_print_ptr(ndr, "policy", r->policy);
4845 ndr->depth++;
4846 if (r->policy) {
4847 ndr_print_netr_DELTA_POLICY(ndr, "policy", r->policy);
4849 ndr->depth--;
4850 break;
4852 case NETR_DELTA_TRUSTED_DOMAIN:
4853 ndr_print_ptr(ndr, "trusted_domain", r->trusted_domain);
4854 ndr->depth++;
4855 if (r->trusted_domain) {
4856 ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr, "trusted_domain", r->trusted_domain);
4858 ndr->depth--;
4859 break;
4861 case NETR_DELTA_DELETE_TRUST:
4862 ndr_print_netr_DELTA_DELETE_TRUST(ndr, "delete_trust", &r->delete_trust);
4863 break;
4865 case NETR_DELTA_ACCOUNT:
4866 ndr_print_ptr(ndr, "account", r->account);
4867 ndr->depth++;
4868 if (r->account) {
4869 ndr_print_netr_DELTA_ACCOUNT(ndr, "account", r->account);
4871 ndr->depth--;
4872 break;
4874 case NETR_DELTA_DELETE_ACCOUNT:
4875 ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr, "delete_account", &r->delete_account);
4876 break;
4878 case NETR_DELTA_SECRET:
4879 ndr_print_ptr(ndr, "secret", r->secret);
4880 ndr->depth++;
4881 if (r->secret) {
4882 ndr_print_netr_DELTA_SECRET(ndr, "secret", r->secret);
4884 ndr->depth--;
4885 break;
4887 case NETR_DELTA_DELETE_SECRET:
4888 ndr_print_netr_DELTA_DELETE_SECRET(ndr, "delete_secret", &r->delete_secret);
4889 break;
4891 case NETR_DELTA_DELETE_GROUP2:
4892 ndr_print_ptr(ndr, "delete_group", r->delete_group);
4893 ndr->depth++;
4894 if (r->delete_group) {
4895 ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_group", r->delete_group);
4897 ndr->depth--;
4898 break;
4900 case NETR_DELTA_DELETE_USER2:
4901 ndr_print_ptr(ndr, "delete_user", r->delete_user);
4902 ndr->depth++;
4903 if (r->delete_user) {
4904 ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_user", r->delete_user);
4906 ndr->depth--;
4907 break;
4909 case NETR_DELTA_MODIFY_COUNT:
4910 ndr_print_ptr(ndr, "modified_count", r->modified_count);
4911 ndr->depth++;
4912 if (r->modified_count) {
4913 ndr_print_udlong(ndr, "modified_count", *r->modified_count);
4915 ndr->depth--;
4916 break;
4918 default:
4919 ndr_print_bad_level(ndr, name, level);
4923 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)
4925 if (ndr_flags & NDR_SCALARS) {
4926 int level = ndr_push_get_switch_value(ndr, r);
4927 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
4928 NDR_CHECK(ndr_push_union_align(ndr, 5));
4929 switch (level) {
4930 case NETR_DELTA_DOMAIN: {
4931 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4932 break; }
4934 case NETR_DELTA_GROUP: {
4935 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4936 break; }
4938 case NETR_DELTA_DELETE_GROUP: {
4939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4940 break; }
4942 case NETR_DELTA_RENAME_GROUP: {
4943 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4944 break; }
4946 case NETR_DELTA_USER: {
4947 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4948 break; }
4950 case NETR_DELTA_DELETE_USER: {
4951 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4952 break; }
4954 case NETR_DELTA_RENAME_USER: {
4955 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4956 break; }
4958 case NETR_DELTA_GROUP_MEMBER: {
4959 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4960 break; }
4962 case NETR_DELTA_ALIAS: {
4963 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4964 break; }
4966 case NETR_DELTA_DELETE_ALIAS: {
4967 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4968 break; }
4970 case NETR_DELTA_RENAME_ALIAS: {
4971 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4972 break; }
4974 case NETR_DELTA_ALIAS_MEMBER: {
4975 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4976 break; }
4978 case NETR_DELTA_POLICY: {
4979 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4980 break; }
4982 case NETR_DELTA_TRUSTED_DOMAIN: {
4983 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4984 break; }
4986 case NETR_DELTA_DELETE_TRUST: {
4987 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4988 break; }
4990 case NETR_DELTA_ACCOUNT: {
4991 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4992 break; }
4994 case NETR_DELTA_DELETE_ACCOUNT: {
4995 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4996 break; }
4998 case NETR_DELTA_SECRET: {
4999 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
5000 break; }
5002 case NETR_DELTA_DELETE_SECRET: {
5003 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
5004 break; }
5006 case NETR_DELTA_DELETE_GROUP2: {
5007 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
5008 break; }
5010 case NETR_DELTA_DELETE_USER2: {
5011 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
5012 break; }
5014 case NETR_DELTA_MODIFY_COUNT: {
5015 break; }
5017 default:
5018 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5021 if (ndr_flags & NDR_BUFFERS) {
5022 int level = ndr_push_get_switch_value(ndr, r);
5023 switch (level) {
5024 case NETR_DELTA_DOMAIN:
5025 break;
5027 case NETR_DELTA_GROUP:
5028 break;
5030 case NETR_DELTA_DELETE_GROUP:
5031 break;
5033 case NETR_DELTA_RENAME_GROUP:
5034 break;
5036 case NETR_DELTA_USER:
5037 break;
5039 case NETR_DELTA_DELETE_USER:
5040 break;
5042 case NETR_DELTA_RENAME_USER:
5043 break;
5045 case NETR_DELTA_GROUP_MEMBER:
5046 break;
5048 case NETR_DELTA_ALIAS:
5049 break;
5051 case NETR_DELTA_DELETE_ALIAS:
5052 break;
5054 case NETR_DELTA_RENAME_ALIAS:
5055 break;
5057 case NETR_DELTA_ALIAS_MEMBER:
5058 break;
5060 case NETR_DELTA_POLICY:
5061 if (r->sid) {
5062 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5064 break;
5066 case NETR_DELTA_TRUSTED_DOMAIN:
5067 if (r->sid) {
5068 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5070 break;
5072 case NETR_DELTA_DELETE_TRUST:
5073 if (r->sid) {
5074 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5076 break;
5078 case NETR_DELTA_ACCOUNT:
5079 if (r->sid) {
5080 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5082 break;
5084 case NETR_DELTA_DELETE_ACCOUNT:
5085 if (r->sid) {
5086 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5088 break;
5090 case NETR_DELTA_SECRET:
5091 if (r->name) {
5092 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5093 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5094 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5095 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5097 break;
5099 case NETR_DELTA_DELETE_SECRET:
5100 if (r->name) {
5101 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5102 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5103 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5104 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5106 break;
5108 case NETR_DELTA_DELETE_GROUP2:
5109 break;
5111 case NETR_DELTA_DELETE_USER2:
5112 break;
5114 case NETR_DELTA_MODIFY_COUNT:
5115 break;
5117 default:
5118 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5121 return NDR_ERR_SUCCESS;
5124 static enum ndr_err_code ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r)
5126 int level;
5127 uint16_t _level;
5128 TALLOC_CTX *_mem_save_sid_0;
5129 uint32_t _ptr_sid;
5130 TALLOC_CTX *_mem_save_name_0;
5131 uint32_t _ptr_name;
5132 uint32_t size_name_1 = 0;
5133 uint32_t length_name_1 = 0;
5134 level = ndr_pull_get_switch_value(ndr, r);
5135 if (ndr_flags & NDR_SCALARS) {
5136 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
5137 if (_level != level) {
5138 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5140 NDR_CHECK(ndr_pull_union_align(ndr, 5));
5141 switch (level) {
5142 case NETR_DELTA_DOMAIN: {
5143 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5144 break; }
5146 case NETR_DELTA_GROUP: {
5147 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5148 break; }
5150 case NETR_DELTA_DELETE_GROUP: {
5151 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5152 break; }
5154 case NETR_DELTA_RENAME_GROUP: {
5155 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5156 break; }
5158 case NETR_DELTA_USER: {
5159 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5160 break; }
5162 case NETR_DELTA_DELETE_USER: {
5163 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5164 break; }
5166 case NETR_DELTA_RENAME_USER: {
5167 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5168 break; }
5170 case NETR_DELTA_GROUP_MEMBER: {
5171 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5172 break; }
5174 case NETR_DELTA_ALIAS: {
5175 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5176 break; }
5178 case NETR_DELTA_DELETE_ALIAS: {
5179 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5180 break; }
5182 case NETR_DELTA_RENAME_ALIAS: {
5183 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5184 break; }
5186 case NETR_DELTA_ALIAS_MEMBER: {
5187 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5188 break; }
5190 case NETR_DELTA_POLICY: {
5191 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5192 if (_ptr_sid) {
5193 NDR_PULL_ALLOC(ndr, r->sid);
5194 } else {
5195 r->sid = NULL;
5197 break; }
5199 case NETR_DELTA_TRUSTED_DOMAIN: {
5200 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5201 if (_ptr_sid) {
5202 NDR_PULL_ALLOC(ndr, r->sid);
5203 } else {
5204 r->sid = NULL;
5206 break; }
5208 case NETR_DELTA_DELETE_TRUST: {
5209 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5210 if (_ptr_sid) {
5211 NDR_PULL_ALLOC(ndr, r->sid);
5212 } else {
5213 r->sid = NULL;
5215 break; }
5217 case NETR_DELTA_ACCOUNT: {
5218 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5219 if (_ptr_sid) {
5220 NDR_PULL_ALLOC(ndr, r->sid);
5221 } else {
5222 r->sid = NULL;
5224 break; }
5226 case NETR_DELTA_DELETE_ACCOUNT: {
5227 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5228 if (_ptr_sid) {
5229 NDR_PULL_ALLOC(ndr, r->sid);
5230 } else {
5231 r->sid = NULL;
5233 break; }
5235 case NETR_DELTA_SECRET: {
5236 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
5237 if (_ptr_name) {
5238 NDR_PULL_ALLOC(ndr, r->name);
5239 } else {
5240 r->name = NULL;
5242 break; }
5244 case NETR_DELTA_DELETE_SECRET: {
5245 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
5246 if (_ptr_name) {
5247 NDR_PULL_ALLOC(ndr, r->name);
5248 } else {
5249 r->name = NULL;
5251 break; }
5253 case NETR_DELTA_DELETE_GROUP2: {
5254 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5255 break; }
5257 case NETR_DELTA_DELETE_USER2: {
5258 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5259 break; }
5261 case NETR_DELTA_MODIFY_COUNT: {
5262 break; }
5264 default:
5265 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5268 if (ndr_flags & NDR_BUFFERS) {
5269 switch (level) {
5270 case NETR_DELTA_DOMAIN:
5271 break;
5273 case NETR_DELTA_GROUP:
5274 break;
5276 case NETR_DELTA_DELETE_GROUP:
5277 break;
5279 case NETR_DELTA_RENAME_GROUP:
5280 break;
5282 case NETR_DELTA_USER:
5283 break;
5285 case NETR_DELTA_DELETE_USER:
5286 break;
5288 case NETR_DELTA_RENAME_USER:
5289 break;
5291 case NETR_DELTA_GROUP_MEMBER:
5292 break;
5294 case NETR_DELTA_ALIAS:
5295 break;
5297 case NETR_DELTA_DELETE_ALIAS:
5298 break;
5300 case NETR_DELTA_RENAME_ALIAS:
5301 break;
5303 case NETR_DELTA_ALIAS_MEMBER:
5304 break;
5306 case NETR_DELTA_POLICY:
5307 if (r->sid) {
5308 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5309 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5310 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5311 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5313 break;
5315 case NETR_DELTA_TRUSTED_DOMAIN:
5316 if (r->sid) {
5317 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5318 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5319 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5320 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5322 break;
5324 case NETR_DELTA_DELETE_TRUST:
5325 if (r->sid) {
5326 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5327 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5328 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5329 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5331 break;
5333 case NETR_DELTA_ACCOUNT:
5334 if (r->sid) {
5335 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5336 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5337 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5338 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5340 break;
5342 case NETR_DELTA_DELETE_ACCOUNT:
5343 if (r->sid) {
5344 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5345 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5346 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5347 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5349 break;
5351 case NETR_DELTA_SECRET:
5352 if (r->name) {
5353 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5354 NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
5355 NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
5356 NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
5357 size_name_1 = ndr_get_array_size(ndr, &r->name);
5358 length_name_1 = ndr_get_array_length(ndr, &r->name);
5359 if (length_name_1 > size_name_1) {
5360 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_name_1, length_name_1);
5362 NDR_CHECK(ndr_check_string_terminator(ndr, length_name_1, sizeof(uint16_t)));
5363 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, length_name_1, sizeof(uint16_t), CH_UTF16));
5364 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
5366 break;
5368 case NETR_DELTA_DELETE_SECRET:
5369 if (r->name) {
5370 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5371 NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
5372 NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
5373 NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
5374 size_name_1 = ndr_get_array_size(ndr, &r->name);
5375 length_name_1 = ndr_get_array_length(ndr, &r->name);
5376 if (length_name_1 > size_name_1) {
5377 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_name_1, length_name_1);
5379 NDR_CHECK(ndr_check_string_terminator(ndr, length_name_1, sizeof(uint16_t)));
5380 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, length_name_1, sizeof(uint16_t), CH_UTF16));
5381 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
5383 break;
5385 case NETR_DELTA_DELETE_GROUP2:
5386 break;
5388 case NETR_DELTA_DELETE_USER2:
5389 break;
5391 case NETR_DELTA_MODIFY_COUNT:
5392 break;
5394 default:
5395 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5398 return NDR_ERR_SUCCESS;
5401 _PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r)
5403 int level;
5404 level = ndr_print_get_switch_value(ndr, r);
5405 ndr_print_union(ndr, name, level, "netr_DELTA_ID_UNION");
5406 switch (level) {
5407 case NETR_DELTA_DOMAIN:
5408 ndr_print_uint32(ndr, "rid", r->rid);
5409 break;
5411 case NETR_DELTA_GROUP:
5412 ndr_print_uint32(ndr, "rid", r->rid);
5413 break;
5415 case NETR_DELTA_DELETE_GROUP:
5416 ndr_print_uint32(ndr, "rid", r->rid);
5417 break;
5419 case NETR_DELTA_RENAME_GROUP:
5420 ndr_print_uint32(ndr, "rid", r->rid);
5421 break;
5423 case NETR_DELTA_USER:
5424 ndr_print_uint32(ndr, "rid", r->rid);
5425 break;
5427 case NETR_DELTA_DELETE_USER:
5428 ndr_print_uint32(ndr, "rid", r->rid);
5429 break;
5431 case NETR_DELTA_RENAME_USER:
5432 ndr_print_uint32(ndr, "rid", r->rid);
5433 break;
5435 case NETR_DELTA_GROUP_MEMBER:
5436 ndr_print_uint32(ndr, "rid", r->rid);
5437 break;
5439 case NETR_DELTA_ALIAS:
5440 ndr_print_uint32(ndr, "rid", r->rid);
5441 break;
5443 case NETR_DELTA_DELETE_ALIAS:
5444 ndr_print_uint32(ndr, "rid", r->rid);
5445 break;
5447 case NETR_DELTA_RENAME_ALIAS:
5448 ndr_print_uint32(ndr, "rid", r->rid);
5449 break;
5451 case NETR_DELTA_ALIAS_MEMBER:
5452 ndr_print_uint32(ndr, "rid", r->rid);
5453 break;
5455 case NETR_DELTA_POLICY:
5456 ndr_print_ptr(ndr, "sid", r->sid);
5457 ndr->depth++;
5458 if (r->sid) {
5459 ndr_print_dom_sid2(ndr, "sid", r->sid);
5461 ndr->depth--;
5462 break;
5464 case NETR_DELTA_TRUSTED_DOMAIN:
5465 ndr_print_ptr(ndr, "sid", r->sid);
5466 ndr->depth++;
5467 if (r->sid) {
5468 ndr_print_dom_sid2(ndr, "sid", r->sid);
5470 ndr->depth--;
5471 break;
5473 case NETR_DELTA_DELETE_TRUST:
5474 ndr_print_ptr(ndr, "sid", r->sid);
5475 ndr->depth++;
5476 if (r->sid) {
5477 ndr_print_dom_sid2(ndr, "sid", r->sid);
5479 ndr->depth--;
5480 break;
5482 case NETR_DELTA_ACCOUNT:
5483 ndr_print_ptr(ndr, "sid", r->sid);
5484 ndr->depth++;
5485 if (r->sid) {
5486 ndr_print_dom_sid2(ndr, "sid", r->sid);
5488 ndr->depth--;
5489 break;
5491 case NETR_DELTA_DELETE_ACCOUNT:
5492 ndr_print_ptr(ndr, "sid", r->sid);
5493 ndr->depth++;
5494 if (r->sid) {
5495 ndr_print_dom_sid2(ndr, "sid", r->sid);
5497 ndr->depth--;
5498 break;
5500 case NETR_DELTA_SECRET:
5501 ndr_print_ptr(ndr, "name", r->name);
5502 ndr->depth++;
5503 if (r->name) {
5504 ndr_print_string(ndr, "name", r->name);
5506 ndr->depth--;
5507 break;
5509 case NETR_DELTA_DELETE_SECRET:
5510 ndr_print_ptr(ndr, "name", r->name);
5511 ndr->depth++;
5512 if (r->name) {
5513 ndr_print_string(ndr, "name", r->name);
5515 ndr->depth--;
5516 break;
5518 case NETR_DELTA_DELETE_GROUP2:
5519 ndr_print_uint32(ndr, "rid", r->rid);
5520 break;
5522 case NETR_DELTA_DELETE_USER2:
5523 ndr_print_uint32(ndr, "rid", r->rid);
5524 break;
5526 case NETR_DELTA_MODIFY_COUNT:
5527 break;
5529 default:
5530 ndr_print_bad_level(ndr, name, level);
5534 static enum ndr_err_code ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r)
5536 if (ndr_flags & NDR_SCALARS) {
5537 NDR_CHECK(ndr_push_align(ndr, 5));
5538 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, r->delta_type));
5539 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_id_union, r->delta_type));
5540 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union));
5541 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_union, r->delta_type));
5542 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union));
5543 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5545 if (ndr_flags & NDR_BUFFERS) {
5546 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
5547 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
5549 return NDR_ERR_SUCCESS;
5552 static enum ndr_err_code ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r)
5554 if (ndr_flags & NDR_SCALARS) {
5555 NDR_CHECK(ndr_pull_align(ndr, 5));
5556 NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr, NDR_SCALARS, &r->delta_type));
5557 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_id_union, r->delta_type));
5558 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union));
5559 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_union, r->delta_type));
5560 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union));
5561 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5563 if (ndr_flags & NDR_BUFFERS) {
5564 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
5565 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
5567 return NDR_ERR_SUCCESS;
5570 _PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r)
5572 ndr_print_struct(ndr, name, "netr_DELTA_ENUM");
5573 ndr->depth++;
5574 ndr_print_netr_DeltaEnum(ndr, "delta_type", r->delta_type);
5575 ndr_print_set_switch_value(ndr, &r->delta_id_union, r->delta_type);
5576 ndr_print_netr_DELTA_ID_UNION(ndr, "delta_id_union", &r->delta_id_union);
5577 ndr_print_set_switch_value(ndr, &r->delta_union, r->delta_type);
5578 ndr_print_netr_DELTA_UNION(ndr, "delta_union", &r->delta_union);
5579 ndr->depth--;
5582 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)
5584 uint32_t cntr_delta_enum_1;
5585 if (ndr_flags & NDR_SCALARS) {
5586 NDR_CHECK(ndr_push_align(ndr, 5));
5587 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas));
5588 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delta_enum));
5589 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5591 if (ndr_flags & NDR_BUFFERS) {
5592 if (r->delta_enum) {
5593 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_deltas));
5594 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5595 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1]));
5597 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5598 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1]));
5602 return NDR_ERR_SUCCESS;
5605 static enum ndr_err_code ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r)
5607 uint32_t _ptr_delta_enum;
5608 uint32_t size_delta_enum_1 = 0;
5609 uint32_t cntr_delta_enum_1;
5610 TALLOC_CTX *_mem_save_delta_enum_0;
5611 TALLOC_CTX *_mem_save_delta_enum_1;
5612 if (ndr_flags & NDR_SCALARS) {
5613 NDR_CHECK(ndr_pull_align(ndr, 5));
5614 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_deltas));
5615 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum));
5616 if (_ptr_delta_enum) {
5617 NDR_PULL_ALLOC(ndr, r->delta_enum);
5618 } else {
5619 r->delta_enum = NULL;
5621 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5623 if (ndr_flags & NDR_BUFFERS) {
5624 if (r->delta_enum) {
5625 _mem_save_delta_enum_0 = NDR_PULL_GET_MEM_CTX(ndr);
5626 NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0);
5627 NDR_CHECK(ndr_pull_array_size(ndr, &r->delta_enum));
5628 size_delta_enum_1 = ndr_get_array_size(ndr, &r->delta_enum);
5629 NDR_PULL_ALLOC_N(ndr, r->delta_enum, size_delta_enum_1);
5630 _mem_save_delta_enum_1 = NDR_PULL_GET_MEM_CTX(ndr);
5631 NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0);
5632 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < size_delta_enum_1; cntr_delta_enum_1++) {
5633 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1]));
5635 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < size_delta_enum_1; cntr_delta_enum_1++) {
5636 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1]));
5638 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_1, 0);
5639 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_0, 0);
5641 if (r->delta_enum) {
5642 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->delta_enum, r->num_deltas));
5645 return NDR_ERR_SUCCESS;
5648 _PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r)
5650 uint32_t cntr_delta_enum_1;
5651 ndr_print_struct(ndr, name, "netr_DELTA_ENUM_ARRAY");
5652 ndr->depth++;
5653 ndr_print_uint32(ndr, "num_deltas", r->num_deltas);
5654 ndr_print_ptr(ndr, "delta_enum", r->delta_enum);
5655 ndr->depth++;
5656 if (r->delta_enum) {
5657 ndr->print(ndr, "%s: ARRAY(%d)", "delta_enum", (int)r->num_deltas);
5658 ndr->depth++;
5659 for (cntr_delta_enum_1=0;cntr_delta_enum_1<r->num_deltas;cntr_delta_enum_1++) {
5660 char *idx_1=NULL;
5661 if (asprintf(&idx_1, "[%d]", cntr_delta_enum_1) != -1) {
5662 ndr_print_netr_DELTA_ENUM(ndr, "delta_enum", &r->delta_enum[cntr_delta_enum_1]);
5663 free(idx_1);
5666 ndr->depth--;
5668 ndr->depth--;
5669 ndr->depth--;
5672 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)
5675 uint32_t _flags_save_STRUCT = ndr->flags;
5676 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5677 if (ndr_flags & NDR_SCALARS) {
5678 NDR_CHECK(ndr_push_align(ndr, 4));
5679 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16));
5680 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timecreated));
5681 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number));
5682 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5684 if (ndr_flags & NDR_BUFFERS) {
5686 ndr->flags = _flags_save_STRUCT;
5688 return NDR_ERR_SUCCESS;
5691 static enum ndr_err_code ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r)
5693 uint32_t size_computer_name_0 = 0;
5695 uint32_t _flags_save_STRUCT = ndr->flags;
5696 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5697 if (ndr_flags & NDR_SCALARS) {
5698 NDR_CHECK(ndr_pull_align(ndr, 4));
5699 size_computer_name_0 = 16;
5700 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->computer_name, size_computer_name_0));
5701 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timecreated));
5702 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number));
5703 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5705 if (ndr_flags & NDR_BUFFERS) {
5707 ndr->flags = _flags_save_STRUCT;
5709 return NDR_ERR_SUCCESS;
5712 _PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r)
5714 ndr_print_struct(ndr, name, "netr_UAS_INFO_0");
5716 uint32_t _flags_save_STRUCT = ndr->flags;
5717 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5718 ndr->depth++;
5719 ndr_print_array_uint8(ndr, "computer_name", r->computer_name, 16);
5720 ndr_print_uint32(ndr, "timecreated", r->timecreated);
5721 ndr_print_uint32(ndr, "serial_number", r->serial_number);
5722 ndr->depth--;
5723 ndr->flags = _flags_save_STRUCT;
5727 static enum ndr_err_code ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r)
5729 if (ndr_flags & NDR_SCALARS) {
5730 NDR_CHECK(ndr_push_align(ndr, 4));
5732 uint32_t _flags_save_DATA_BLOB = ndr->flags;
5733 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
5734 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
5735 ndr->flags = _flags_save_DATA_BLOB;
5737 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5739 if (ndr_flags & NDR_BUFFERS) {
5741 return NDR_ERR_SUCCESS;
5744 static enum ndr_err_code ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r)
5746 if (ndr_flags & NDR_SCALARS) {
5747 NDR_CHECK(ndr_pull_align(ndr, 4));
5749 uint32_t _flags_save_DATA_BLOB = ndr->flags;
5750 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
5751 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob));
5752 ndr->flags = _flags_save_DATA_BLOB;
5754 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5756 if (ndr_flags & NDR_BUFFERS) {
5758 return NDR_ERR_SUCCESS;
5761 _PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r)
5763 ndr_print_struct(ndr, name, "netr_AccountBuffer");
5764 ndr->depth++;
5765 ndr_print_DATA_BLOB(ndr, "blob", r->blob);
5766 ndr->depth--;
5769 static enum ndr_err_code ndr_push_netr_InfoFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
5771 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
5772 return NDR_ERR_SUCCESS;
5775 static enum ndr_err_code ndr_pull_netr_InfoFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
5777 uint32_t v;
5778 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
5779 *r = v;
5780 return NDR_ERR_SUCCESS;
5783 _PUBLIC_ void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r)
5785 ndr_print_uint32(ndr, name, r);
5786 ndr->depth++;
5787 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REPLICATION_NEEDED", NETLOGON_REPLICATION_NEEDED, r);
5788 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REPLICATION_IN_PROGRESS", NETLOGON_REPLICATION_IN_PROGRESS, r);
5789 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_FULL_SYNC_REPLICATION", NETLOGON_FULL_SYNC_REPLICATION, r);
5790 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REDO_NEEDED", NETLOGON_REDO_NEEDED, r);
5791 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_HAS_IP", NETLOGON_HAS_IP, r);
5792 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_HAS_TIMESERV", NETLOGON_HAS_TIMESERV, r);
5793 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_DNS_UPDATE_FAILURE", NETLOGON_DNS_UPDATE_FAILURE, r);
5794 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_VERIFY_STATUS_RETURNED", NETLOGON_VERIFY_STATUS_RETURNED, r);
5795 ndr->depth--;
5798 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)
5800 if (ndr_flags & NDR_SCALARS) {
5801 NDR_CHECK(ndr_push_align(ndr, 4));
5802 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5803 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
5804 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5806 if (ndr_flags & NDR_BUFFERS) {
5808 return NDR_ERR_SUCCESS;
5811 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r)
5813 if (ndr_flags & NDR_SCALARS) {
5814 NDR_CHECK(ndr_pull_align(ndr, 4));
5815 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5816 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
5817 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5819 if (ndr_flags & NDR_BUFFERS) {
5821 return NDR_ERR_SUCCESS;
5824 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r)
5826 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_1");
5827 ndr->depth++;
5828 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5829 ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
5830 ndr->depth--;
5833 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)
5835 if (ndr_flags & NDR_SCALARS) {
5836 NDR_CHECK(ndr_push_align(ndr, 5));
5837 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5838 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
5839 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name));
5840 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->tc_connection_status));
5841 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5843 if (ndr_flags & NDR_BUFFERS) {
5844 if (r->trusted_dc_name) {
5845 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5846 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5847 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5848 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));
5851 return NDR_ERR_SUCCESS;
5854 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r)
5856 uint32_t _ptr_trusted_dc_name;
5857 uint32_t size_trusted_dc_name_1 = 0;
5858 uint32_t length_trusted_dc_name_1 = 0;
5859 TALLOC_CTX *_mem_save_trusted_dc_name_0;
5860 if (ndr_flags & NDR_SCALARS) {
5861 NDR_CHECK(ndr_pull_align(ndr, 5));
5862 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5863 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
5864 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name));
5865 if (_ptr_trusted_dc_name) {
5866 NDR_PULL_ALLOC(ndr, r->trusted_dc_name);
5867 } else {
5868 r->trusted_dc_name = NULL;
5870 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->tc_connection_status));
5871 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5873 if (ndr_flags & NDR_BUFFERS) {
5874 if (r->trusted_dc_name) {
5875 _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5876 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0);
5877 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name));
5878 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name));
5879 size_trusted_dc_name_1 = ndr_get_array_size(ndr, &r->trusted_dc_name);
5880 length_trusted_dc_name_1 = ndr_get_array_length(ndr, &r->trusted_dc_name);
5881 if (length_trusted_dc_name_1 > size_trusted_dc_name_1) {
5882 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_trusted_dc_name_1, length_trusted_dc_name_1);
5884 NDR_CHECK(ndr_check_string_terminator(ndr, length_trusted_dc_name_1, sizeof(uint16_t)));
5885 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, length_trusted_dc_name_1, sizeof(uint16_t), CH_UTF16));
5886 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0);
5889 return NDR_ERR_SUCCESS;
5892 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r)
5894 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_2");
5895 ndr->depth++;
5896 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5897 ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
5898 ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name);
5899 ndr->depth++;
5900 if (r->trusted_dc_name) {
5901 ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name);
5903 ndr->depth--;
5904 ndr_print_WERROR(ndr, "tc_connection_status", r->tc_connection_status);
5905 ndr->depth--;
5908 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)
5910 if (ndr_flags & NDR_SCALARS) {
5911 NDR_CHECK(ndr_push_align(ndr, 4));
5912 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5913 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_attempts));
5914 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
5915 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
5916 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
5917 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
5918 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
5919 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5921 if (ndr_flags & NDR_BUFFERS) {
5923 return NDR_ERR_SUCCESS;
5926 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r)
5928 if (ndr_flags & NDR_SCALARS) {
5929 NDR_CHECK(ndr_pull_align(ndr, 4));
5930 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5931 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_attempts));
5932 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
5933 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
5934 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
5935 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
5936 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
5937 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5939 if (ndr_flags & NDR_BUFFERS) {
5941 return NDR_ERR_SUCCESS;
5944 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r)
5946 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_3");
5947 ndr->depth++;
5948 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5949 ndr_print_uint32(ndr, "logon_attempts", r->logon_attempts);
5950 ndr_print_uint32(ndr, "unknown1", r->unknown1);
5951 ndr_print_uint32(ndr, "unknown2", r->unknown2);
5952 ndr_print_uint32(ndr, "unknown3", r->unknown3);
5953 ndr_print_uint32(ndr, "unknown4", r->unknown4);
5954 ndr_print_uint32(ndr, "unknown5", r->unknown5);
5955 ndr->depth--;
5958 static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_4(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_4 *r)
5960 if (ndr_flags & NDR_SCALARS) {
5961 NDR_CHECK(ndr_push_align(ndr, 5));
5962 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name));
5963 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain_name));
5964 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5966 if (ndr_flags & NDR_BUFFERS) {
5967 if (r->trusted_dc_name) {
5968 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5969 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5970 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5971 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));
5973 if (r->trusted_domain_name) {
5974 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16)));
5975 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5976 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16)));
5977 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->trusted_domain_name, ndr_charset_length(r->trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5980 return NDR_ERR_SUCCESS;
5983 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_4(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_4 *r)
5985 uint32_t _ptr_trusted_dc_name;
5986 uint32_t size_trusted_dc_name_1 = 0;
5987 uint32_t length_trusted_dc_name_1 = 0;
5988 TALLOC_CTX *_mem_save_trusted_dc_name_0;
5989 uint32_t _ptr_trusted_domain_name;
5990 uint32_t size_trusted_domain_name_1 = 0;
5991 uint32_t length_trusted_domain_name_1 = 0;
5992 TALLOC_CTX *_mem_save_trusted_domain_name_0;
5993 if (ndr_flags & NDR_SCALARS) {
5994 NDR_CHECK(ndr_pull_align(ndr, 5));
5995 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name));
5996 if (_ptr_trusted_dc_name) {
5997 NDR_PULL_ALLOC(ndr, r->trusted_dc_name);
5998 } else {
5999 r->trusted_dc_name = NULL;
6001 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name));
6002 if (_ptr_trusted_domain_name) {
6003 NDR_PULL_ALLOC(ndr, r->trusted_domain_name);
6004 } else {
6005 r->trusted_domain_name = NULL;
6007 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
6009 if (ndr_flags & NDR_BUFFERS) {
6010 if (r->trusted_dc_name) {
6011 _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6012 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0);
6013 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name));
6014 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name));
6015 size_trusted_dc_name_1 = ndr_get_array_size(ndr, &r->trusted_dc_name);
6016 length_trusted_dc_name_1 = ndr_get_array_length(ndr, &r->trusted_dc_name);
6017 if (length_trusted_dc_name_1 > size_trusted_dc_name_1) {
6018 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_trusted_dc_name_1, length_trusted_dc_name_1);
6020 NDR_CHECK(ndr_check_string_terminator(ndr, length_trusted_dc_name_1, sizeof(uint16_t)));
6021 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, length_trusted_dc_name_1, sizeof(uint16_t), CH_UTF16));
6022 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0);
6024 if (r->trusted_domain_name) {
6025 _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6026 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain_name, 0);
6027 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_domain_name));
6028 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_domain_name));
6029 size_trusted_domain_name_1 = ndr_get_array_size(ndr, &r->trusted_domain_name);
6030 length_trusted_domain_name_1 = ndr_get_array_length(ndr, &r->trusted_domain_name);
6031 if (length_trusted_domain_name_1 > size_trusted_domain_name_1) {
6032 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_trusted_domain_name_1, length_trusted_domain_name_1);
6034 NDR_CHECK(ndr_check_string_terminator(ndr, length_trusted_domain_name_1, sizeof(uint16_t)));
6035 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_domain_name, length_trusted_domain_name_1, sizeof(uint16_t), CH_UTF16));
6036 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0);
6039 return NDR_ERR_SUCCESS;
6042 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_4(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_4 *r)
6044 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_4");
6045 ndr->depth++;
6046 ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name);
6047 ndr->depth++;
6048 if (r->trusted_dc_name) {
6049 ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name);
6051 ndr->depth--;
6052 ndr_print_ptr(ndr, "trusted_domain_name", r->trusted_domain_name);
6053 ndr->depth++;
6054 if (r->trusted_domain_name) {
6055 ndr_print_string(ndr, "trusted_domain_name", r->trusted_domain_name);
6057 ndr->depth--;
6058 ndr->depth--;
6061 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)
6063 if (ndr_flags & NDR_SCALARS) {
6064 int level = ndr_push_get_switch_value(ndr, r);
6065 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
6066 NDR_CHECK(ndr_push_union_align(ndr, 5));
6067 switch (level) {
6068 case 1: {
6069 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
6070 break; }
6072 case 2: {
6073 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
6074 break; }
6076 case 3: {
6077 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
6078 break; }
6080 case 4: {
6081 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4));
6082 break; }
6084 default: {
6085 break; }
6089 if (ndr_flags & NDR_BUFFERS) {
6090 int level = ndr_push_get_switch_value(ndr, r);
6091 switch (level) {
6092 case 1:
6093 if (r->info1) {
6094 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1));
6096 break;
6098 case 2:
6099 if (r->info2) {
6100 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
6102 break;
6104 case 3:
6105 if (r->info3) {
6106 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3));
6108 break;
6110 case 4:
6111 if (r->info4) {
6112 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
6114 break;
6116 default:
6117 break;
6121 return NDR_ERR_SUCCESS;
6124 static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r)
6126 int level;
6127 uint32_t _level;
6128 TALLOC_CTX *_mem_save_info1_0;
6129 uint32_t _ptr_info1;
6130 TALLOC_CTX *_mem_save_info2_0;
6131 uint32_t _ptr_info2;
6132 TALLOC_CTX *_mem_save_info3_0;
6133 uint32_t _ptr_info3;
6134 TALLOC_CTX *_mem_save_info4_0;
6135 uint32_t _ptr_info4;
6136 level = ndr_pull_get_switch_value(ndr, r);
6137 if (ndr_flags & NDR_SCALARS) {
6138 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
6139 if (_level != level) {
6140 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6142 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6143 switch (level) {
6144 case 1: {
6145 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
6146 if (_ptr_info1) {
6147 NDR_PULL_ALLOC(ndr, r->info1);
6148 } else {
6149 r->info1 = NULL;
6151 break; }
6153 case 2: {
6154 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
6155 if (_ptr_info2) {
6156 NDR_PULL_ALLOC(ndr, r->info2);
6157 } else {
6158 r->info2 = NULL;
6160 break; }
6162 case 3: {
6163 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
6164 if (_ptr_info3) {
6165 NDR_PULL_ALLOC(ndr, r->info3);
6166 } else {
6167 r->info3 = NULL;
6169 break; }
6171 case 4: {
6172 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4));
6173 if (_ptr_info4) {
6174 NDR_PULL_ALLOC(ndr, r->info4);
6175 } else {
6176 r->info4 = NULL;
6178 break; }
6180 default: {
6181 break; }
6185 if (ndr_flags & NDR_BUFFERS) {
6186 switch (level) {
6187 case 1:
6188 if (r->info1) {
6189 _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
6190 NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
6191 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1));
6192 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
6194 break;
6196 case 2:
6197 if (r->info2) {
6198 _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
6199 NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
6200 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
6201 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
6203 break;
6205 case 3:
6206 if (r->info3) {
6207 _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
6208 NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
6209 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3));
6210 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
6212 break;
6214 case 4:
6215 if (r->info4) {
6216 _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr);
6217 NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0);
6218 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
6219 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0);
6221 break;
6223 default:
6224 break;
6228 return NDR_ERR_SUCCESS;
6231 _PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r)
6233 int level;
6234 level = ndr_print_get_switch_value(ndr, r);
6235 ndr_print_union(ndr, name, level, "netr_CONTROL_QUERY_INFORMATION");
6236 switch (level) {
6237 case 1:
6238 ndr_print_ptr(ndr, "info1", r->info1);
6239 ndr->depth++;
6240 if (r->info1) {
6241 ndr_print_netr_NETLOGON_INFO_1(ndr, "info1", r->info1);
6243 ndr->depth--;
6244 break;
6246 case 2:
6247 ndr_print_ptr(ndr, "info2", r->info2);
6248 ndr->depth++;
6249 if (r->info2) {
6250 ndr_print_netr_NETLOGON_INFO_2(ndr, "info2", r->info2);
6252 ndr->depth--;
6253 break;
6255 case 3:
6256 ndr_print_ptr(ndr, "info3", r->info3);
6257 ndr->depth++;
6258 if (r->info3) {
6259 ndr_print_netr_NETLOGON_INFO_3(ndr, "info3", r->info3);
6261 ndr->depth--;
6262 break;
6264 case 4:
6265 ndr_print_ptr(ndr, "info4", r->info4);
6266 ndr->depth++;
6267 if (r->info4) {
6268 ndr_print_netr_NETLOGON_INFO_4(ndr, "info4", r->info4);
6270 ndr->depth--;
6271 break;
6273 default:
6274 break;
6279 static enum ndr_err_code ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r)
6281 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
6282 return NDR_ERR_SUCCESS;
6285 static enum ndr_err_code ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r)
6287 uint32_t v;
6288 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
6289 *r = v;
6290 return NDR_ERR_SUCCESS;
6293 _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r)
6295 const char *val = NULL;
6297 switch (r) {
6298 case NETLOGON_CONTROL_QUERY: val = "NETLOGON_CONTROL_QUERY"; break;
6299 case NETLOGON_CONTROL_REPLICATE: val = "NETLOGON_CONTROL_REPLICATE"; break;
6300 case NETLOGON_CONTROL_SYNCHRONIZE: val = "NETLOGON_CONTROL_SYNCHRONIZE"; break;
6301 case NETLOGON_CONTROL_PDC_REPLICATE: val = "NETLOGON_CONTROL_PDC_REPLICATE"; break;
6302 case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break;
6303 case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break;
6304 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break;
6305 case NETLOGON_CONTROL_FIND_USER: val = "NETLOGON_CONTROL_FIND_USER"; break;
6306 case NETLOGON_CONTROL_CHANGE_PASSWORD: val = "NETLOGON_CONTROL_CHANGE_PASSWORD"; break;
6307 case NETLOGON_CONTROL_TC_VERIFY: val = "NETLOGON_CONTROL_TC_VERIFY"; break;
6308 case NETLOGON_CONTROL_FORCE_DNS_REG: val = "NETLOGON_CONTROL_FORCE_DNS_REG"; break;
6309 case NETLOGON_CONTROL_QUERY_DNS_REG: val = "NETLOGON_CONTROL_QUERY_DNS_REG"; break;
6310 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG: val = "NETLOGON_CONTROL_BACKUP_CHANGE_LOG"; break;
6311 case NETLOGON_CONTROL_TRUNCATE_LOG: val = "NETLOGON_CONTROL_TRUNCATE_LOG"; break;
6312 case NETLOGON_CONTROL_SET_DBFLAG: val = "NETLOGON_CONTROL_SET_DBFLAG"; break;
6313 case NETLOGON_CONTROL_BREAKPOINT: val = "NETLOGON_CONTROL_BREAKPOINT"; break;
6315 ndr_print_enum(ndr, name, "ENUM", val, r);
6318 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)
6320 if (ndr_flags & NDR_SCALARS) {
6321 int level = ndr_push_get_switch_value(ndr, r);
6322 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
6323 NDR_CHECK(ndr_push_union_align(ndr, 5));
6324 switch (level) {
6325 case NETLOGON_CONTROL_REDISCOVER: {
6326 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6327 break; }
6329 case NETLOGON_CONTROL_TC_QUERY: {
6330 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6331 break; }
6333 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: {
6334 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6335 break; }
6337 case NETLOGON_CONTROL_CHANGE_PASSWORD: {
6338 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6339 break; }
6341 case NETLOGON_CONTROL_TC_VERIFY: {
6342 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6343 break; }
6345 case NETLOGON_CONTROL_FIND_USER: {
6346 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
6347 break; }
6349 case NETLOGON_CONTROL_SET_DBFLAG: {
6350 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level));
6351 break; }
6353 default: {
6354 break; }
6358 if (ndr_flags & NDR_BUFFERS) {
6359 int level = ndr_push_get_switch_value(ndr, r);
6360 switch (level) {
6361 case NETLOGON_CONTROL_REDISCOVER:
6362 if (r->domain) {
6363 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6364 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6365 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6366 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6368 break;
6370 case NETLOGON_CONTROL_TC_QUERY:
6371 if (r->domain) {
6372 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6373 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6374 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6375 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6377 break;
6379 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6380 if (r->domain) {
6381 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6382 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6383 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6384 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6386 break;
6388 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6389 if (r->domain) {
6390 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6391 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6392 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6393 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6395 break;
6397 case NETLOGON_CONTROL_TC_VERIFY:
6398 if (r->domain) {
6399 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6400 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6401 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6402 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6404 break;
6406 case NETLOGON_CONTROL_FIND_USER:
6407 if (r->user) {
6408 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
6409 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6410 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
6411 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6413 break;
6415 case NETLOGON_CONTROL_SET_DBFLAG:
6416 break;
6418 default:
6419 break;
6423 return NDR_ERR_SUCCESS;
6426 static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r)
6428 int level;
6429 uint32_t _level;
6430 TALLOC_CTX *_mem_save_domain_0;
6431 uint32_t _ptr_domain;
6432 uint32_t size_domain_1 = 0;
6433 uint32_t length_domain_1 = 0;
6434 TALLOC_CTX *_mem_save_user_0;
6435 uint32_t _ptr_user;
6436 uint32_t size_user_1 = 0;
6437 uint32_t length_user_1 = 0;
6438 level = ndr_pull_get_switch_value(ndr, r);
6439 if (ndr_flags & NDR_SCALARS) {
6440 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
6441 if (_level != level) {
6442 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6444 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6445 switch (level) {
6446 case NETLOGON_CONTROL_REDISCOVER: {
6447 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6448 if (_ptr_domain) {
6449 NDR_PULL_ALLOC(ndr, r->domain);
6450 } else {
6451 r->domain = NULL;
6453 break; }
6455 case NETLOGON_CONTROL_TC_QUERY: {
6456 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6457 if (_ptr_domain) {
6458 NDR_PULL_ALLOC(ndr, r->domain);
6459 } else {
6460 r->domain = NULL;
6462 break; }
6464 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: {
6465 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6466 if (_ptr_domain) {
6467 NDR_PULL_ALLOC(ndr, r->domain);
6468 } else {
6469 r->domain = NULL;
6471 break; }
6473 case NETLOGON_CONTROL_CHANGE_PASSWORD: {
6474 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6475 if (_ptr_domain) {
6476 NDR_PULL_ALLOC(ndr, r->domain);
6477 } else {
6478 r->domain = NULL;
6480 break; }
6482 case NETLOGON_CONTROL_TC_VERIFY: {
6483 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6484 if (_ptr_domain) {
6485 NDR_PULL_ALLOC(ndr, r->domain);
6486 } else {
6487 r->domain = NULL;
6489 break; }
6491 case NETLOGON_CONTROL_FIND_USER: {
6492 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
6493 if (_ptr_user) {
6494 NDR_PULL_ALLOC(ndr, r->user);
6495 } else {
6496 r->user = NULL;
6498 break; }
6500 case NETLOGON_CONTROL_SET_DBFLAG: {
6501 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->debug_level));
6502 break; }
6504 default: {
6505 break; }
6509 if (ndr_flags & NDR_BUFFERS) {
6510 switch (level) {
6511 case NETLOGON_CONTROL_REDISCOVER:
6512 if (r->domain) {
6513 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6514 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6515 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6516 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6517 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
6518 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
6519 if (length_domain_1 > size_domain_1) {
6520 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
6522 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
6523 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
6524 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6526 break;
6528 case NETLOGON_CONTROL_TC_QUERY:
6529 if (r->domain) {
6530 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6531 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6532 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6533 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6534 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
6535 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
6536 if (length_domain_1 > size_domain_1) {
6537 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
6539 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
6540 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
6541 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6543 break;
6545 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6546 if (r->domain) {
6547 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6548 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6549 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6550 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6551 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
6552 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
6553 if (length_domain_1 > size_domain_1) {
6554 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
6556 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
6557 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
6558 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6560 break;
6562 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6563 if (r->domain) {
6564 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6565 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6566 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6567 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6568 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
6569 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
6570 if (length_domain_1 > size_domain_1) {
6571 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
6573 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
6574 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
6575 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6577 break;
6579 case NETLOGON_CONTROL_TC_VERIFY:
6580 if (r->domain) {
6581 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6582 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6583 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6584 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6585 size_domain_1 = ndr_get_array_size(ndr, &r->domain);
6586 length_domain_1 = ndr_get_array_length(ndr, &r->domain);
6587 if (length_domain_1 > size_domain_1) {
6588 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
6590 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
6591 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
6592 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6594 break;
6596 case NETLOGON_CONTROL_FIND_USER:
6597 if (r->user) {
6598 _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
6599 NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
6600 NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
6601 NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
6602 size_user_1 = ndr_get_array_size(ndr, &r->user);
6603 length_user_1 = ndr_get_array_length(ndr, &r->user);
6604 if (length_user_1 > size_user_1) {
6605 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_user_1, length_user_1);
6607 NDR_CHECK(ndr_check_string_terminator(ndr, length_user_1, sizeof(uint16_t)));
6608 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, length_user_1, sizeof(uint16_t), CH_UTF16));
6609 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
6611 break;
6613 case NETLOGON_CONTROL_SET_DBFLAG:
6614 break;
6616 default:
6617 break;
6621 return NDR_ERR_SUCCESS;
6624 _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r)
6626 int level;
6627 level = ndr_print_get_switch_value(ndr, r);
6628 ndr_print_union(ndr, name, level, "netr_CONTROL_DATA_INFORMATION");
6629 switch (level) {
6630 case NETLOGON_CONTROL_REDISCOVER:
6631 ndr_print_ptr(ndr, "domain", r->domain);
6632 ndr->depth++;
6633 if (r->domain) {
6634 ndr_print_string(ndr, "domain", r->domain);
6636 ndr->depth--;
6637 break;
6639 case NETLOGON_CONTROL_TC_QUERY:
6640 ndr_print_ptr(ndr, "domain", r->domain);
6641 ndr->depth++;
6642 if (r->domain) {
6643 ndr_print_string(ndr, "domain", r->domain);
6645 ndr->depth--;
6646 break;
6648 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6649 ndr_print_ptr(ndr, "domain", r->domain);
6650 ndr->depth++;
6651 if (r->domain) {
6652 ndr_print_string(ndr, "domain", r->domain);
6654 ndr->depth--;
6655 break;
6657 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6658 ndr_print_ptr(ndr, "domain", r->domain);
6659 ndr->depth++;
6660 if (r->domain) {
6661 ndr_print_string(ndr, "domain", r->domain);
6663 ndr->depth--;
6664 break;
6666 case NETLOGON_CONTROL_TC_VERIFY:
6667 ndr_print_ptr(ndr, "domain", r->domain);
6668 ndr->depth++;
6669 if (r->domain) {
6670 ndr_print_string(ndr, "domain", r->domain);
6672 ndr->depth--;
6673 break;
6675 case NETLOGON_CONTROL_FIND_USER:
6676 ndr_print_ptr(ndr, "user", r->user);
6677 ndr->depth++;
6678 if (r->user) {
6679 ndr_print_string(ndr, "user", r->user);
6681 ndr->depth--;
6682 break;
6684 case NETLOGON_CONTROL_SET_DBFLAG:
6685 ndr_print_uint32(ndr, "debug_level", r->debug_level);
6686 break;
6688 default:
6689 break;
6694 _PUBLIC_ enum ndr_err_code ndr_push_netr_NegotiateFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
6696 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
6697 return NDR_ERR_SUCCESS;
6700 _PUBLIC_ enum ndr_err_code ndr_pull_netr_NegotiateFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
6702 uint32_t v;
6703 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
6704 *r = v;
6705 return NDR_ERR_SUCCESS;
6708 _PUBLIC_ void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r)
6710 ndr_print_uint32(ndr, name, r);
6711 ndr->depth++;
6712 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ACCOUNT_LOCKOUT", NETLOGON_NEG_ACCOUNT_LOCKOUT, r);
6713 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PERSISTENT_SAMREPL", NETLOGON_NEG_PERSISTENT_SAMREPL, r);
6714 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ARCFOUR", NETLOGON_NEG_ARCFOUR, r);
6715 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PROMOTION_COUNT", NETLOGON_NEG_PROMOTION_COUNT, r);
6716 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CHANGELOG_BDC", NETLOGON_NEG_CHANGELOG_BDC, r);
6717 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_FULL_SYNC_REPL", NETLOGON_NEG_FULL_SYNC_REPL, r);
6718 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_MULTIPLE_SIDS", NETLOGON_NEG_MULTIPLE_SIDS, r);
6719 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_REDO", NETLOGON_NEG_REDO, r);
6720 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL, r);
6721 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", NETLOGON_NEG_SEND_PASSWORD_INFO_PDC, r);
6722 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GENERIC_PASSTHROUGH", NETLOGON_NEG_GENERIC_PASSTHROUGH, r);
6723 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CONCURRENT_RPC", NETLOGON_NEG_CONCURRENT_RPC, r);
6724 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL, r);
6725 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL, r);
6726 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_STRONG_KEYS", NETLOGON_NEG_STRONG_KEYS, r);
6727 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_TRANSITIVE_TRUSTS", NETLOGON_NEG_TRANSITIVE_TRUSTS, r);
6728 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", NETLOGON_NEG_DNS_DOMAIN_TRUSTS, r);
6729 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_SET2", NETLOGON_NEG_PASSWORD_SET2, r);
6730 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GETDOMAININFO", NETLOGON_NEG_GETDOMAININFO, r);
6731 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CROSS_FOREST_TRUSTS", NETLOGON_NEG_CROSS_FOREST_TRUSTS, r);
6732 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION, r);
6733 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_RODC_PASSTHROUGH", NETLOGON_NEG_RODC_PASSTHROUGH, r);
6734 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SUPPORTS_AES_SHA2", NETLOGON_NEG_SUPPORTS_AES_SHA2, r);
6735 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SUPPORTS_AES", NETLOGON_NEG_SUPPORTS_AES, r);
6736 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", NETLOGON_NEG_AUTHENTICATED_RPC_LSASS, r);
6737 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC", NETLOGON_NEG_AUTHENTICATED_RPC, r);
6738 ndr->depth--;
6741 static enum ndr_err_code ndr_push_SyncStateEnum(struct ndr_push *ndr, int ndr_flags, enum SyncStateEnum r)
6743 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
6744 return NDR_ERR_SUCCESS;
6747 static enum ndr_err_code ndr_pull_SyncStateEnum(struct ndr_pull *ndr, int ndr_flags, enum SyncStateEnum *r)
6749 uint16_t v;
6750 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
6751 *r = v;
6752 return NDR_ERR_SUCCESS;
6755 _PUBLIC_ void ndr_print_SyncStateEnum(struct ndr_print *ndr, const char *name, enum SyncStateEnum r)
6757 const char *val = NULL;
6759 switch (r) {
6760 case SYNCSTATE_NORMAL_STATE: val = "SYNCSTATE_NORMAL_STATE"; break;
6761 case SYNCSTATE_DOMAIN_STATE: val = "SYNCSTATE_DOMAIN_STATE"; break;
6762 case SYNCSTATE_GROUP_STATE: val = "SYNCSTATE_GROUP_STATE"; break;
6763 case SYNCSTATE_UAS_BUILT_IN_GROUP_STATE: val = "SYNCSTATE_UAS_BUILT_IN_GROUP_STATE"; break;
6764 case SYNCSTATE_USER_STATE: val = "SYNCSTATE_USER_STATE"; break;
6765 case SYNCSTATE_GROUP_MEMBER_STATE: val = "SYNCSTATE_GROUP_MEMBER_STATE"; break;
6766 case SYNCSTATE_ALIAS_STATE: val = "SYNCSTATE_ALIAS_STATE"; break;
6767 case SYNCSTATE_ALIAS_MEMBER_STATE: val = "SYNCSTATE_ALIAS_MEMBER_STATE"; break;
6768 case SYNCSTATE_SAM_DONE_STATE: val = "SYNCSTATE_SAM_DONE_STATE"; break;
6770 ndr_print_enum(ndr, name, "ENUM", val, r);
6773 static enum ndr_err_code ndr_push_netr_ChangeLogFlags(struct ndr_push *ndr, int ndr_flags, uint16_t r)
6775 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
6776 return NDR_ERR_SUCCESS;
6779 static enum ndr_err_code ndr_pull_netr_ChangeLogFlags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
6781 uint16_t v;
6782 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
6783 *r = v;
6784 return NDR_ERR_SUCCESS;
6787 _PUBLIC_ void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r)
6789 ndr_print_uint16(ndr, name, r);
6790 ndr->depth++;
6791 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED, r);
6792 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_CHANGED_PASSWORD", NETR_CHANGELOG_CHANGED_PASSWORD, r);
6793 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_SID_INCLUDED", NETR_CHANGELOG_SID_INCLUDED, r);
6794 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_NAME_INCLUDED", NETR_CHANGELOG_NAME_INCLUDED, r);
6795 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", NETR_CHANGELOG_FIRST_PROMOTION_OBJ, r);
6796 ndr->depth--;
6799 static enum ndr_err_code ndr_push_netr_ChangeLogObject(struct ndr_push *ndr, int ndr_flags, const union netr_ChangeLogObject *r)
6801 if (ndr_flags & NDR_SCALARS) {
6802 int level = ndr_push_get_switch_value(ndr, r);
6803 NDR_CHECK(ndr_push_union_align(ndr, 4));
6804 switch (level) {
6805 case NETR_CHANGELOG_SID_INCLUDED: {
6806 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->object_sid));
6807 break; }
6809 case NETR_CHANGELOG_NAME_INCLUDED: {
6811 uint32_t _flags_save_string = ndr->flags;
6812 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
6813 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->object_name));
6814 ndr->flags = _flags_save_string;
6816 break; }
6818 default: {
6819 break; }
6823 if (ndr_flags & NDR_BUFFERS) {
6824 int level = ndr_push_get_switch_value(ndr, r);
6825 switch (level) {
6826 case NETR_CHANGELOG_SID_INCLUDED:
6827 break;
6829 case NETR_CHANGELOG_NAME_INCLUDED:
6830 break;
6832 default:
6833 break;
6837 return NDR_ERR_SUCCESS;
6840 static enum ndr_err_code ndr_pull_netr_ChangeLogObject(struct ndr_pull *ndr, int ndr_flags, union netr_ChangeLogObject *r)
6842 int level;
6843 level = ndr_pull_get_switch_value(ndr, r);
6844 if (ndr_flags & NDR_SCALARS) {
6845 NDR_CHECK(ndr_pull_union_align(ndr, 4));
6846 switch (level) {
6847 case NETR_CHANGELOG_SID_INCLUDED: {
6848 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->object_sid));
6849 break; }
6851 case NETR_CHANGELOG_NAME_INCLUDED: {
6853 uint32_t _flags_save_string = ndr->flags;
6854 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
6855 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->object_name));
6856 ndr->flags = _flags_save_string;
6858 break; }
6860 default: {
6861 break; }
6865 if (ndr_flags & NDR_BUFFERS) {
6866 switch (level) {
6867 case NETR_CHANGELOG_SID_INCLUDED:
6868 break;
6870 case NETR_CHANGELOG_NAME_INCLUDED:
6871 break;
6873 default:
6874 break;
6878 return NDR_ERR_SUCCESS;
6881 _PUBLIC_ void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r)
6883 int level;
6884 level = ndr_print_get_switch_value(ndr, r);
6885 ndr_print_union(ndr, name, level, "netr_ChangeLogObject");
6886 switch (level) {
6887 case NETR_CHANGELOG_SID_INCLUDED:
6888 ndr_print_dom_sid(ndr, "object_sid", &r->object_sid);
6889 break;
6891 case NETR_CHANGELOG_NAME_INCLUDED:
6892 ndr_print_string(ndr, "object_name", r->object_name);
6893 break;
6895 default:
6896 break;
6901 _PUBLIC_ enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r)
6903 if (ndr_flags & NDR_SCALARS) {
6904 NDR_CHECK(ndr_push_align(ndr, 4));
6905 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number1));
6906 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number2));
6907 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_rid));
6908 NDR_CHECK(ndr_push_netr_ChangeLogFlags(ndr, NDR_SCALARS, r->flags));
6909 NDR_CHECK(ndr_push_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, r->db_index));
6910 NDR_CHECK(ndr_push_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, r->delta_type));
6911 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)));
6912 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object));
6913 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
6915 if (ndr_flags & NDR_BUFFERS) {
6916 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object));
6918 return NDR_ERR_SUCCESS;
6921 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r)
6923 if (ndr_flags & NDR_SCALARS) {
6924 NDR_CHECK(ndr_pull_align(ndr, 4));
6925 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number1));
6926 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number2));
6927 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_rid));
6928 NDR_CHECK(ndr_pull_netr_ChangeLogFlags(ndr, NDR_SCALARS, &r->flags));
6929 NDR_CHECK(ndr_pull_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, &r->db_index));
6930 NDR_CHECK(ndr_pull_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, &r->delta_type));
6931 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)));
6932 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object));
6933 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
6935 if (ndr_flags & NDR_BUFFERS) {
6936 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object));
6938 return NDR_ERR_SUCCESS;
6941 _PUBLIC_ void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r)
6943 ndr_print_struct(ndr, name, "netr_ChangeLogEntry");
6944 ndr->depth++;
6945 ndr_print_uint32(ndr, "serial_number1", r->serial_number1);
6946 ndr_print_uint32(ndr, "serial_number2", r->serial_number2);
6947 ndr_print_uint32(ndr, "object_rid", r->object_rid);
6948 ndr_print_netr_ChangeLogFlags(ndr, "flags", r->flags);
6949 ndr_print_netr_SamDatabaseID8Bit(ndr, "db_index", r->db_index);
6950 ndr_print_netr_DeltaEnum8Bit(ndr, "delta_type", r->delta_type);
6951 ndr_print_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED));
6952 ndr_print_netr_ChangeLogObject(ndr, "object", &r->object);
6953 ndr->depth--;
6956 _PUBLIC_ size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, struct smb_iconv_convenience *ic, int flags)
6958 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_netr_ChangeLogEntry, ic);
6961 static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r)
6963 if (ndr_flags & NDR_SCALARS) {
6964 NDR_CHECK(ndr_push_align(ndr, 5));
6965 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
6966 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
6967 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
6969 if (ndr_flags & NDR_BUFFERS) {
6970 if (r->data) {
6971 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
6972 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
6975 return NDR_ERR_SUCCESS;
6978 static enum ndr_err_code ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r)
6980 uint32_t _ptr_data;
6981 uint32_t size_data_1 = 0;
6982 TALLOC_CTX *_mem_save_data_0;
6983 if (ndr_flags & NDR_SCALARS) {
6984 NDR_CHECK(ndr_pull_align(ndr, 5));
6985 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
6986 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
6987 if (_ptr_data) {
6988 NDR_PULL_ALLOC(ndr, r->data);
6989 } else {
6990 r->data = NULL;
6992 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
6994 if (ndr_flags & NDR_BUFFERS) {
6995 if (r->data) {
6996 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
6997 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
6998 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
6999 size_data_1 = ndr_get_array_size(ndr, &r->data);
7000 NDR_PULL_ALLOC_N(ndr, r->data, size_data_1);
7001 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_1));
7002 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
7004 if (r->data) {
7005 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
7008 return NDR_ERR_SUCCESS;
7011 _PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r)
7013 ndr_print_struct(ndr, name, "netr_Blob");
7014 ndr->depth++;
7015 ndr_print_uint32(ndr, "length", r->length);
7016 ndr_print_ptr(ndr, "data", r->data);
7017 ndr->depth++;
7018 if (r->data) {
7019 ndr_print_array_uint8(ndr, "data", r->data, r->length);
7021 ndr->depth--;
7022 ndr->depth--;
7025 static enum ndr_err_code ndr_push_netr_DsRGetDCName_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7028 return NDR_ERR_SUCCESS;
7031 static enum ndr_err_code ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7033 uint32_t v;
7034 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7035 *r = v;
7036 return NDR_ERR_SUCCESS;
7039 _PUBLIC_ void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r)
7041 ndr_print_uint32(ndr, name, r);
7042 ndr->depth++;
7043 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r);
7044 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r);
7045 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r);
7046 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r);
7047 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r);
7048 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r);
7049 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r);
7050 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r);
7051 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r);
7052 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r);
7053 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r);
7054 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r);
7055 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r);
7056 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r);
7057 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r);
7058 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r);
7059 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r);
7060 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WEB_SERVICE_REQUIRED", DS_WEB_SERVICE_REQUIRED, r);
7061 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r);
7062 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r);
7063 ndr->depth--;
7066 static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r)
7068 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
7069 return NDR_ERR_SUCCESS;
7072 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r)
7074 uint32_t v;
7075 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
7076 *r = v;
7077 return NDR_ERR_SUCCESS;
7080 _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r)
7082 const char *val = NULL;
7084 switch (r) {
7085 case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break;
7086 case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break;
7088 ndr_print_enum(ndr, name, "ENUM", val, r);
7091 static enum ndr_err_code ndr_push_netr_DsR_DcFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7093 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7094 return NDR_ERR_SUCCESS;
7097 static enum ndr_err_code ndr_pull_netr_DsR_DcFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7099 uint32_t v;
7100 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7101 *r = v;
7102 return NDR_ERR_SUCCESS;
7105 _PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7107 ndr_print_uint32(ndr, name, r);
7108 ndr->depth++;
7109 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC, r);
7110 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r);
7111 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r);
7112 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r);
7113 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r);
7114 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r);
7115 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r);
7116 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r);
7117 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r);
7118 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r);
7119 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r);
7120 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r);
7121 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r);
7122 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r);
7123 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST, r);
7124 ndr->depth--;
7127 _PUBLIC_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r)
7129 if (ndr_flags & NDR_SCALARS) {
7130 NDR_CHECK(ndr_push_align(ndr, 5));
7131 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc));
7132 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address));
7133 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type));
7134 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
7135 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
7136 NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name));
7137 NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags));
7138 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name));
7139 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name));
7140 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7142 if (ndr_flags & NDR_BUFFERS) {
7143 if (r->dc_unc) {
7144 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16)));
7145 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7146 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16)));
7147 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_unc, ndr_charset_length(r->dc_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7149 if (r->dc_address) {
7150 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16)));
7151 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7152 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16)));
7153 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_address, ndr_charset_length(r->dc_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7155 if (r->domain_name) {
7156 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
7157 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7158 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
7159 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7161 if (r->forest_name) {
7162 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16)));
7163 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7164 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16)));
7165 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest_name, ndr_charset_length(r->forest_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7167 if (r->dc_site_name) {
7168 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16)));
7169 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7170 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16)));
7171 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));
7173 if (r->client_site_name) {
7174 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16)));
7175 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7176 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16)));
7177 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));
7180 return NDR_ERR_SUCCESS;
7183 _PUBLIC_ enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r)
7185 uint32_t _ptr_dc_unc;
7186 uint32_t size_dc_unc_1 = 0;
7187 uint32_t length_dc_unc_1 = 0;
7188 TALLOC_CTX *_mem_save_dc_unc_0;
7189 uint32_t _ptr_dc_address;
7190 uint32_t size_dc_address_1 = 0;
7191 uint32_t length_dc_address_1 = 0;
7192 TALLOC_CTX *_mem_save_dc_address_0;
7193 uint32_t _ptr_domain_name;
7194 uint32_t size_domain_name_1 = 0;
7195 uint32_t length_domain_name_1 = 0;
7196 TALLOC_CTX *_mem_save_domain_name_0;
7197 uint32_t _ptr_forest_name;
7198 uint32_t size_forest_name_1 = 0;
7199 uint32_t length_forest_name_1 = 0;
7200 TALLOC_CTX *_mem_save_forest_name_0;
7201 uint32_t _ptr_dc_site_name;
7202 uint32_t size_dc_site_name_1 = 0;
7203 uint32_t length_dc_site_name_1 = 0;
7204 TALLOC_CTX *_mem_save_dc_site_name_0;
7205 uint32_t _ptr_client_site_name;
7206 uint32_t size_client_site_name_1 = 0;
7207 uint32_t length_client_site_name_1 = 0;
7208 TALLOC_CTX *_mem_save_client_site_name_0;
7209 if (ndr_flags & NDR_SCALARS) {
7210 NDR_CHECK(ndr_pull_align(ndr, 5));
7211 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_unc));
7212 if (_ptr_dc_unc) {
7213 NDR_PULL_ALLOC(ndr, r->dc_unc);
7214 } else {
7215 r->dc_unc = NULL;
7217 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_address));
7218 if (_ptr_dc_address) {
7219 NDR_PULL_ALLOC(ndr, r->dc_address);
7220 } else {
7221 r->dc_address = NULL;
7223 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type));
7224 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
7225 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
7226 if (_ptr_domain_name) {
7227 NDR_PULL_ALLOC(ndr, r->domain_name);
7228 } else {
7229 r->domain_name = NULL;
7231 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_name));
7232 if (_ptr_forest_name) {
7233 NDR_PULL_ALLOC(ndr, r->forest_name);
7234 } else {
7235 r->forest_name = NULL;
7237 NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags));
7238 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name));
7239 if (_ptr_dc_site_name) {
7240 NDR_PULL_ALLOC(ndr, r->dc_site_name);
7241 } else {
7242 r->dc_site_name = NULL;
7244 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_site_name));
7245 if (_ptr_client_site_name) {
7246 NDR_PULL_ALLOC(ndr, r->client_site_name);
7247 } else {
7248 r->client_site_name = NULL;
7250 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7252 if (ndr_flags & NDR_BUFFERS) {
7253 if (r->dc_unc) {
7254 _mem_save_dc_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
7255 NDR_PULL_SET_MEM_CTX(ndr, r->dc_unc, 0);
7256 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_unc));
7257 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_unc));
7258 size_dc_unc_1 = ndr_get_array_size(ndr, &r->dc_unc);
7259 length_dc_unc_1 = ndr_get_array_length(ndr, &r->dc_unc);
7260 if (length_dc_unc_1 > size_dc_unc_1) {
7261 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dc_unc_1, length_dc_unc_1);
7263 NDR_CHECK(ndr_check_string_terminator(ndr, length_dc_unc_1, sizeof(uint16_t)));
7264 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_unc, length_dc_unc_1, sizeof(uint16_t), CH_UTF16));
7265 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_unc_0, 0);
7267 if (r->dc_address) {
7268 _mem_save_dc_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
7269 NDR_PULL_SET_MEM_CTX(ndr, r->dc_address, 0);
7270 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_address));
7271 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_address));
7272 size_dc_address_1 = ndr_get_array_size(ndr, &r->dc_address);
7273 length_dc_address_1 = ndr_get_array_length(ndr, &r->dc_address);
7274 if (length_dc_address_1 > size_dc_address_1) {
7275 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dc_address_1, length_dc_address_1);
7277 NDR_CHECK(ndr_check_string_terminator(ndr, length_dc_address_1, sizeof(uint16_t)));
7278 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_address, length_dc_address_1, sizeof(uint16_t), CH_UTF16));
7279 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_address_0, 0);
7281 if (r->domain_name) {
7282 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7283 NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0);
7284 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
7285 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
7286 size_domain_name_1 = ndr_get_array_size(ndr, &r->domain_name);
7287 length_domain_name_1 = ndr_get_array_length(ndr, &r->domain_name);
7288 if (length_domain_name_1 > size_domain_name_1) {
7289 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
7291 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint16_t)));
7292 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, length_domain_name_1, sizeof(uint16_t), CH_UTF16));
7293 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
7295 if (r->forest_name) {
7296 _mem_save_forest_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7297 NDR_PULL_SET_MEM_CTX(ndr, r->forest_name, 0);
7298 NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_name));
7299 NDR_CHECK(ndr_pull_array_length(ndr, &r->forest_name));
7300 size_forest_name_1 = ndr_get_array_size(ndr, &r->forest_name);
7301 length_forest_name_1 = ndr_get_array_length(ndr, &r->forest_name);
7302 if (length_forest_name_1 > size_forest_name_1) {
7303 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_forest_name_1, length_forest_name_1);
7305 NDR_CHECK(ndr_check_string_terminator(ndr, length_forest_name_1, sizeof(uint16_t)));
7306 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest_name, length_forest_name_1, sizeof(uint16_t), CH_UTF16));
7307 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_name_0, 0);
7309 if (r->dc_site_name) {
7310 _mem_save_dc_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7311 NDR_PULL_SET_MEM_CTX(ndr, r->dc_site_name, 0);
7312 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_site_name));
7313 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_site_name));
7314 size_dc_site_name_1 = ndr_get_array_size(ndr, &r->dc_site_name);
7315 length_dc_site_name_1 = ndr_get_array_length(ndr, &r->dc_site_name);
7316 if (length_dc_site_name_1 > size_dc_site_name_1) {
7317 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dc_site_name_1, length_dc_site_name_1);
7319 NDR_CHECK(ndr_check_string_terminator(ndr, length_dc_site_name_1, sizeof(uint16_t)));
7320 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_site_name, length_dc_site_name_1, sizeof(uint16_t), CH_UTF16));
7321 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_site_name_0, 0);
7323 if (r->client_site_name) {
7324 _mem_save_client_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7325 NDR_PULL_SET_MEM_CTX(ndr, r->client_site_name, 0);
7326 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_site_name));
7327 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_site_name));
7328 size_client_site_name_1 = ndr_get_array_size(ndr, &r->client_site_name);
7329 length_client_site_name_1 = ndr_get_array_length(ndr, &r->client_site_name);
7330 if (length_client_site_name_1 > size_client_site_name_1) {
7331 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_site_name_1, length_client_site_name_1);
7333 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_site_name_1, sizeof(uint16_t)));
7334 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_site_name, length_client_site_name_1, sizeof(uint16_t), CH_UTF16));
7335 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_site_name_0, 0);
7338 return NDR_ERR_SUCCESS;
7341 _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r)
7343 ndr_print_struct(ndr, name, "netr_DsRGetDCNameInfo");
7344 ndr->depth++;
7345 ndr_print_ptr(ndr, "dc_unc", r->dc_unc);
7346 ndr->depth++;
7347 if (r->dc_unc) {
7348 ndr_print_string(ndr, "dc_unc", r->dc_unc);
7350 ndr->depth--;
7351 ndr_print_ptr(ndr, "dc_address", r->dc_address);
7352 ndr->depth++;
7353 if (r->dc_address) {
7354 ndr_print_string(ndr, "dc_address", r->dc_address);
7356 ndr->depth--;
7357 ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type);
7358 ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
7359 ndr_print_ptr(ndr, "domain_name", r->domain_name);
7360 ndr->depth++;
7361 if (r->domain_name) {
7362 ndr_print_string(ndr, "domain_name", r->domain_name);
7364 ndr->depth--;
7365 ndr_print_ptr(ndr, "forest_name", r->forest_name);
7366 ndr->depth++;
7367 if (r->forest_name) {
7368 ndr_print_string(ndr, "forest_name", r->forest_name);
7370 ndr->depth--;
7371 ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags);
7372 ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name);
7373 ndr->depth++;
7374 if (r->dc_site_name) {
7375 ndr_print_string(ndr, "dc_site_name", r->dc_site_name);
7377 ndr->depth--;
7378 ndr_print_ptr(ndr, "client_site_name", r->client_site_name);
7379 ndr->depth++;
7380 if (r->client_site_name) {
7381 ndr_print_string(ndr, "client_site_name", r->client_site_name);
7383 ndr->depth--;
7384 ndr->depth--;
7387 static enum ndr_err_code ndr_push_netr_Capabilities(struct ndr_push *ndr, int ndr_flags, const union netr_Capabilities *r)
7389 if (ndr_flags & NDR_SCALARS) {
7390 int level = ndr_push_get_switch_value(ndr, r);
7391 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
7392 NDR_CHECK(ndr_push_union_align(ndr, 4));
7393 switch (level) {
7394 case 1: {
7395 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, r->server_capabilities));
7396 break; }
7398 default:
7399 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7402 if (ndr_flags & NDR_BUFFERS) {
7403 int level = ndr_push_get_switch_value(ndr, r);
7404 switch (level) {
7405 case 1:
7406 break;
7408 default:
7409 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7412 return NDR_ERR_SUCCESS;
7415 static enum ndr_err_code ndr_pull_netr_Capabilities(struct ndr_pull *ndr, int ndr_flags, union netr_Capabilities *r)
7417 int level;
7418 uint32_t _level;
7419 level = ndr_pull_get_switch_value(ndr, r);
7420 if (ndr_flags & NDR_SCALARS) {
7421 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
7422 if (_level != level) {
7423 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
7425 NDR_CHECK(ndr_pull_union_align(ndr, 4));
7426 switch (level) {
7427 case 1: {
7428 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, &r->server_capabilities));
7429 break; }
7431 default:
7432 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7435 if (ndr_flags & NDR_BUFFERS) {
7436 switch (level) {
7437 case 1:
7438 break;
7440 default:
7441 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7444 return NDR_ERR_SUCCESS;
7447 _PUBLIC_ void ndr_print_netr_Capabilities(struct ndr_print *ndr, const char *name, const union netr_Capabilities *r)
7449 int level;
7450 level = ndr_print_get_switch_value(ndr, r);
7451 ndr_print_union(ndr, name, level, "netr_Capabilities");
7452 switch (level) {
7453 case 1:
7454 ndr_print_netr_NegotiateFlags(ndr, "server_capabilities", r->server_capabilities);
7455 break;
7457 default:
7458 ndr_print_bad_level(ndr, name, level);
7462 static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7464 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7465 return NDR_ERR_SUCCESS;
7468 static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7470 uint32_t v;
7471 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7472 *r = v;
7473 return NDR_ERR_SUCCESS;
7476 _PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7478 ndr_print_uint32(ndr, name, r);
7479 ndr->depth++;
7480 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
7481 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
7482 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
7483 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
7484 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
7485 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
7486 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5, r);
7487 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES, r);
7488 ndr->depth--;
7491 static enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7493 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7494 return NDR_ERR_SUCCESS;
7497 static enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7499 uint32_t v;
7500 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7501 *r = v;
7502 return NDR_ERR_SUCCESS;
7505 _PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7507 ndr_print_uint32(ndr, name, r);
7508 ndr->depth++;
7509 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS, r);
7510 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE, r);
7511 ndr->depth--;
7514 static enum ndr_err_code ndr_push_netr_SuiteMask(struct ndr_push *ndr, int ndr_flags, uint16_t r)
7516 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
7517 return NDR_ERR_SUCCESS;
7520 static enum ndr_err_code ndr_pull_netr_SuiteMask(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
7522 uint16_t v;
7523 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
7524 *r = v;
7525 return NDR_ERR_SUCCESS;
7528 _PUBLIC_ void ndr_print_netr_SuiteMask(struct ndr_print *ndr, const char *name, uint16_t r)
7530 ndr_print_uint16(ndr, name, r);
7531 ndr->depth++;
7532 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_BACKOFFICE", NETR_VER_SUITE_BACKOFFICE, r);
7533 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_BLADE", NETR_VER_SUITE_BLADE, r);
7534 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_COMPUTE_SERVER", NETR_VER_SUITE_COMPUTE_SERVER, r);
7535 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_DATACENTER", NETR_VER_SUITE_DATACENTER, r);
7536 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_ENTERPRISE", NETR_VER_SUITE_ENTERPRISE, r);
7537 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_EMBEDDEDNT", NETR_VER_SUITE_EMBEDDEDNT, r);
7538 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_PERSONAL", NETR_VER_SUITE_PERSONAL, r);
7539 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SINGLEUSERTS", NETR_VER_SUITE_SINGLEUSERTS, r);
7540 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SMALLBUSINESS", NETR_VER_SUITE_SMALLBUSINESS, r);
7541 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED", NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED, r);
7542 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_STORAGE_SERVER", NETR_VER_SUITE_STORAGE_SERVER, r);
7543 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_TERMINAL", NETR_VER_SUITE_TERMINAL, r);
7544 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_WH_SERVER", NETR_VER_SUITE_WH_SERVER, r);
7545 ndr->depth--;
7548 static enum ndr_err_code ndr_push_netr_ProductType(struct ndr_push *ndr, int ndr_flags, uint8_t r)
7550 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
7551 return NDR_ERR_SUCCESS;
7554 static enum ndr_err_code ndr_pull_netr_ProductType(struct ndr_pull *ndr, int ndr_flags, uint8_t *r)
7556 uint8_t v;
7557 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
7558 *r = v;
7559 return NDR_ERR_SUCCESS;
7562 _PUBLIC_ void ndr_print_netr_ProductType(struct ndr_print *ndr, const char *name, uint8_t r)
7564 ndr_print_uint8(ndr, name, r);
7565 ndr->depth++;
7566 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_DOMAIN_CONTROLLER", NETR_VER_NT_DOMAIN_CONTROLLER, r);
7567 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_SERVER", NETR_VER_NT_SERVER, r);
7568 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_WORKSTATION", NETR_VER_NT_WORKSTATION, r);
7569 ndr->depth--;
7572 static enum ndr_err_code ndr_push_netr_LsaPolicyInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_LsaPolicyInformation *r)
7574 if (ndr_flags & NDR_SCALARS) {
7575 NDR_CHECK(ndr_push_align(ndr, 5));
7576 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size));
7577 NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
7578 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7580 if (ndr_flags & NDR_BUFFERS) {
7581 if (r->policy) {
7582 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->policy_size));
7583 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->policy, r->policy_size));
7586 return NDR_ERR_SUCCESS;
7589 static enum ndr_err_code ndr_pull_netr_LsaPolicyInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_LsaPolicyInformation *r)
7591 uint32_t _ptr_policy;
7592 uint32_t size_policy_1 = 0;
7593 TALLOC_CTX *_mem_save_policy_0;
7594 if (ndr_flags & NDR_SCALARS) {
7595 NDR_CHECK(ndr_pull_align(ndr, 5));
7596 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->policy_size));
7597 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy));
7598 if (_ptr_policy) {
7599 NDR_PULL_ALLOC(ndr, r->policy);
7600 } else {
7601 r->policy = NULL;
7603 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7605 if (ndr_flags & NDR_BUFFERS) {
7606 if (r->policy) {
7607 _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
7608 NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0);
7609 NDR_CHECK(ndr_pull_array_size(ndr, &r->policy));
7610 size_policy_1 = ndr_get_array_size(ndr, &r->policy);
7611 NDR_PULL_ALLOC_N(ndr, r->policy, size_policy_1);
7612 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->policy, size_policy_1));
7613 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0);
7615 if (r->policy) {
7616 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->policy, r->policy_size));
7619 return NDR_ERR_SUCCESS;
7622 _PUBLIC_ void ndr_print_netr_LsaPolicyInformation(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInformation *r)
7624 ndr_print_struct(ndr, name, "netr_LsaPolicyInformation");
7625 ndr->depth++;
7626 ndr_print_uint32(ndr, "policy_size", r->policy_size);
7627 ndr_print_ptr(ndr, "policy", r->policy);
7628 ndr->depth++;
7629 if (r->policy) {
7630 ndr_print_array_uint8(ndr, "policy", r->policy, r->policy_size);
7632 ndr->depth--;
7633 ndr->depth--;
7636 static enum ndr_err_code ndr_push_netr_OsVersionInfoEx(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersionInfoEx *r)
7638 if (ndr_flags & NDR_SCALARS) {
7639 NDR_CHECK(ndr_push_align(ndr, 4));
7640 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 284));
7641 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MajorVersion));
7642 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MinorVersion));
7643 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->BuildNumber));
7644 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->PlatformId));
7646 uint32_t _flags_save_string = ndr->flags;
7647 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
7649 struct ndr_push *_ndr_CSDVersion;
7650 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_CSDVersion, 0, 256));
7651 NDR_CHECK(ndr_push_string(_ndr_CSDVersion, NDR_SCALARS, r->CSDVersion));
7652 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_CSDVersion, 0, 256));
7654 ndr->flags = _flags_save_string;
7656 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ServicePackMajor));
7657 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ServicePackMinor));
7658 NDR_CHECK(ndr_push_netr_SuiteMask(ndr, NDR_SCALARS, r->SuiteMask));
7659 NDR_CHECK(ndr_push_netr_ProductType(ndr, NDR_SCALARS, r->ProductType));
7660 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Reserved));
7661 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
7663 if (ndr_flags & NDR_BUFFERS) {
7665 return NDR_ERR_SUCCESS;
7668 static enum ndr_err_code ndr_pull_netr_OsVersionInfoEx(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersionInfoEx *r)
7670 if (ndr_flags & NDR_SCALARS) {
7671 NDR_CHECK(ndr_pull_align(ndr, 4));
7672 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->OSVersionInfoSize));
7673 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MajorVersion));
7674 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MinorVersion));
7675 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->BuildNumber));
7676 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->PlatformId));
7678 uint32_t _flags_save_string = ndr->flags;
7679 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
7681 struct ndr_pull *_ndr_CSDVersion;
7682 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_CSDVersion, 0, 256));
7683 NDR_CHECK(ndr_pull_string(_ndr_CSDVersion, NDR_SCALARS, &r->CSDVersion));
7684 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_CSDVersion, 0, 256));
7686 ndr->flags = _flags_save_string;
7688 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ServicePackMajor));
7689 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ServicePackMinor));
7690 NDR_CHECK(ndr_pull_netr_SuiteMask(ndr, NDR_SCALARS, &r->SuiteMask));
7691 NDR_CHECK(ndr_pull_netr_ProductType(ndr, NDR_SCALARS, &r->ProductType));
7692 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Reserved));
7693 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
7695 if (ndr_flags & NDR_BUFFERS) {
7697 return NDR_ERR_SUCCESS;
7700 _PUBLIC_ void ndr_print_netr_OsVersionInfoEx(struct ndr_print *ndr, const char *name, const struct netr_OsVersionInfoEx *r)
7702 ndr_print_struct(ndr, name, "netr_OsVersionInfoEx");
7703 ndr->depth++;
7704 ndr_print_uint32(ndr, "OSVersionInfoSize", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?284:r->OSVersionInfoSize);
7705 ndr_print_uint32(ndr, "MajorVersion", r->MajorVersion);
7706 ndr_print_uint32(ndr, "MinorVersion", r->MinorVersion);
7707 ndr_print_uint32(ndr, "BuildNumber", r->BuildNumber);
7708 ndr_print_uint32(ndr, "PlatformId", r->PlatformId);
7709 ndr_print_string(ndr, "CSDVersion", r->CSDVersion);
7710 ndr_print_uint16(ndr, "ServicePackMajor", r->ServicePackMajor);
7711 ndr_print_uint16(ndr, "ServicePackMinor", r->ServicePackMinor);
7712 ndr_print_netr_SuiteMask(ndr, "SuiteMask", r->SuiteMask);
7713 ndr_print_netr_ProductType(ndr, "ProductType", r->ProductType);
7714 ndr_print_uint8(ndr, "Reserved", r->Reserved);
7715 ndr->depth--;
7718 static enum ndr_err_code ndr_push_netr_OsVersion(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersion *r)
7720 if (ndr_flags & NDR_SCALARS) {
7721 NDR_CHECK(ndr_push_align(ndr, 4));
7722 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 142));
7723 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
7724 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 142));
7725 NDR_CHECK(ndr_push_netr_OsVersionInfoEx(ndr, NDR_SCALARS, &r->os));
7726 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
7728 if (ndr_flags & NDR_BUFFERS) {
7730 return NDR_ERR_SUCCESS;
7733 static enum ndr_err_code ndr_pull_netr_OsVersion(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersion *r)
7735 if (ndr_flags & NDR_SCALARS) {
7736 NDR_CHECK(ndr_pull_align(ndr, 4));
7737 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
7738 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
7739 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
7740 NDR_CHECK(ndr_pull_netr_OsVersionInfoEx(ndr, NDR_SCALARS, &r->os));
7741 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
7743 if (ndr_flags & NDR_BUFFERS) {
7745 return NDR_ERR_SUCCESS;
7748 _PUBLIC_ void ndr_print_netr_OsVersion(struct ndr_print *ndr, const char *name, const struct netr_OsVersion *r)
7750 ndr_print_struct(ndr, name, "netr_OsVersion");
7751 ndr->depth++;
7752 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?142:r->length);
7753 ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy);
7754 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?142:r->size);
7755 ndr_print_netr_OsVersionInfoEx(ndr, "os", &r->os);
7756 ndr->depth--;
7759 static enum ndr_err_code ndr_push_netr_OsVersionContainer(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersionContainer *r)
7761 if (ndr_flags & NDR_SCALARS) {
7762 NDR_CHECK(ndr_push_align(ndr, 5));
7763 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->os == NULL?0:284));
7764 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->os == NULL?0:284));
7765 NDR_CHECK(ndr_push_unique_ptr(ndr, r->os));
7766 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7768 if (ndr_flags & NDR_BUFFERS) {
7769 if (r->os) {
7770 NDR_CHECK(ndr_push_netr_OsVersion(ndr, NDR_SCALARS, r->os));
7773 return NDR_ERR_SUCCESS;
7776 static enum ndr_err_code ndr_pull_netr_OsVersionContainer(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersionContainer *r)
7778 uint32_t _ptr_os;
7779 TALLOC_CTX *_mem_save_os_0;
7780 if (ndr_flags & NDR_SCALARS) {
7781 NDR_CHECK(ndr_pull_align(ndr, 5));
7782 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
7783 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
7784 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_os));
7785 if (_ptr_os) {
7786 NDR_PULL_ALLOC(ndr, r->os);
7787 } else {
7788 r->os = NULL;
7790 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7792 if (ndr_flags & NDR_BUFFERS) {
7793 if (r->os) {
7794 _mem_save_os_0 = NDR_PULL_GET_MEM_CTX(ndr);
7795 NDR_PULL_SET_MEM_CTX(ndr, r->os, 0);
7796 NDR_CHECK(ndr_pull_netr_OsVersion(ndr, NDR_SCALARS, r->os));
7797 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_os_0, 0);
7800 return NDR_ERR_SUCCESS;
7803 _PUBLIC_ void ndr_print_netr_OsVersionContainer(struct ndr_print *ndr, const char *name, const struct netr_OsVersionContainer *r)
7805 ndr_print_struct(ndr, name, "netr_OsVersionContainer");
7806 ndr->depth++;
7807 ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->os == NULL?0:284:r->length);
7808 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->os == NULL?0:284:r->size);
7809 ndr_print_ptr(ndr, "os", r->os);
7810 ndr->depth++;
7811 if (r->os) {
7812 ndr_print_netr_OsVersion(ndr, "os", r->os);
7814 ndr->depth--;
7815 ndr->depth--;
7818 static enum ndr_err_code ndr_push_netr_WorkstationInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_WorkstationInformation *r)
7820 if (ndr_flags & NDR_SCALARS) {
7821 NDR_CHECK(ndr_push_align(ndr, 5));
7822 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
7823 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_hostname));
7824 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
7825 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy1));
7826 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy2));
7827 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy3));
7828 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy4));
7829 NDR_CHECK(ndr_push_netr_OsVersionContainer(ndr, NDR_SCALARS, &r->os_version));
7830 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->os_name));
7831 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummy_string3));
7832 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummy_string4));
7833 NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags));
7834 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long2));
7835 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
7836 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
7837 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7839 if (ndr_flags & NDR_BUFFERS) {
7840 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
7841 if (r->dns_hostname) {
7842 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_hostname, CH_UTF16)));
7843 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7844 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_hostname, CH_UTF16)));
7845 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_hostname, ndr_charset_length(r->dns_hostname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7847 if (r->sitename) {
7848 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->sitename, CH_UTF16)));
7849 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7850 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->sitename, CH_UTF16)));
7851 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->sitename, ndr_charset_length(r->sitename, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7853 if (r->dummy1) {
7854 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy1, CH_UTF16)));
7855 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7856 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy1, CH_UTF16)));
7857 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy1, ndr_charset_length(r->dummy1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7859 if (r->dummy2) {
7860 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy2, CH_UTF16)));
7861 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7862 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy2, CH_UTF16)));
7863 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy2, ndr_charset_length(r->dummy2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7865 if (r->dummy3) {
7866 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy3, CH_UTF16)));
7867 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7868 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy3, CH_UTF16)));
7869 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy3, ndr_charset_length(r->dummy3, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7871 if (r->dummy4) {
7872 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy4, CH_UTF16)));
7873 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7874 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy4, CH_UTF16)));
7875 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy4, ndr_charset_length(r->dummy4, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7877 NDR_CHECK(ndr_push_netr_OsVersionContainer(ndr, NDR_BUFFERS, &r->os_version));
7878 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->os_name));
7879 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string3));
7880 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string4));
7882 return NDR_ERR_SUCCESS;
7885 static enum ndr_err_code ndr_pull_netr_WorkstationInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_WorkstationInformation *r)
7887 uint32_t _ptr_dns_hostname;
7888 uint32_t size_dns_hostname_1 = 0;
7889 uint32_t length_dns_hostname_1 = 0;
7890 TALLOC_CTX *_mem_save_dns_hostname_0;
7891 uint32_t _ptr_sitename;
7892 uint32_t size_sitename_1 = 0;
7893 uint32_t length_sitename_1 = 0;
7894 TALLOC_CTX *_mem_save_sitename_0;
7895 uint32_t _ptr_dummy1;
7896 uint32_t size_dummy1_1 = 0;
7897 uint32_t length_dummy1_1 = 0;
7898 TALLOC_CTX *_mem_save_dummy1_0;
7899 uint32_t _ptr_dummy2;
7900 uint32_t size_dummy2_1 = 0;
7901 uint32_t length_dummy2_1 = 0;
7902 TALLOC_CTX *_mem_save_dummy2_0;
7903 uint32_t _ptr_dummy3;
7904 uint32_t size_dummy3_1 = 0;
7905 uint32_t length_dummy3_1 = 0;
7906 TALLOC_CTX *_mem_save_dummy3_0;
7907 uint32_t _ptr_dummy4;
7908 uint32_t size_dummy4_1 = 0;
7909 uint32_t length_dummy4_1 = 0;
7910 TALLOC_CTX *_mem_save_dummy4_0;
7911 if (ndr_flags & NDR_SCALARS) {
7912 NDR_CHECK(ndr_pull_align(ndr, 5));
7913 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
7914 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_hostname));
7915 if (_ptr_dns_hostname) {
7916 NDR_PULL_ALLOC(ndr, r->dns_hostname);
7917 } else {
7918 r->dns_hostname = NULL;
7920 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
7921 if (_ptr_sitename) {
7922 NDR_PULL_ALLOC(ndr, r->sitename);
7923 } else {
7924 r->sitename = NULL;
7926 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy1));
7927 if (_ptr_dummy1) {
7928 NDR_PULL_ALLOC(ndr, r->dummy1);
7929 } else {
7930 r->dummy1 = NULL;
7932 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy2));
7933 if (_ptr_dummy2) {
7934 NDR_PULL_ALLOC(ndr, r->dummy2);
7935 } else {
7936 r->dummy2 = NULL;
7938 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy3));
7939 if (_ptr_dummy3) {
7940 NDR_PULL_ALLOC(ndr, r->dummy3);
7941 } else {
7942 r->dummy3 = NULL;
7944 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy4));
7945 if (_ptr_dummy4) {
7946 NDR_PULL_ALLOC(ndr, r->dummy4);
7947 } else {
7948 r->dummy4 = NULL;
7950 NDR_CHECK(ndr_pull_netr_OsVersionContainer(ndr, NDR_SCALARS, &r->os_version));
7951 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->os_name));
7952 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummy_string3));
7953 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummy_string4));
7954 NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags));
7955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long2));
7956 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
7957 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
7958 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7960 if (ndr_flags & NDR_BUFFERS) {
7961 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
7962 if (r->dns_hostname) {
7963 _mem_save_dns_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
7964 NDR_PULL_SET_MEM_CTX(ndr, r->dns_hostname, 0);
7965 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_hostname));
7966 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_hostname));
7967 size_dns_hostname_1 = ndr_get_array_size(ndr, &r->dns_hostname);
7968 length_dns_hostname_1 = ndr_get_array_length(ndr, &r->dns_hostname);
7969 if (length_dns_hostname_1 > size_dns_hostname_1) {
7970 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dns_hostname_1, length_dns_hostname_1);
7972 NDR_CHECK(ndr_check_string_terminator(ndr, length_dns_hostname_1, sizeof(uint16_t)));
7973 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_hostname, length_dns_hostname_1, sizeof(uint16_t), CH_UTF16));
7974 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_hostname_0, 0);
7976 if (r->sitename) {
7977 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
7978 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
7979 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
7980 NDR_CHECK(ndr_pull_array_length(ndr, &r->sitename));
7981 size_sitename_1 = ndr_get_array_size(ndr, &r->sitename);
7982 length_sitename_1 = ndr_get_array_length(ndr, &r->sitename);
7983 if (length_sitename_1 > size_sitename_1) {
7984 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_sitename_1, length_sitename_1);
7986 NDR_CHECK(ndr_check_string_terminator(ndr, length_sitename_1, sizeof(uint16_t)));
7987 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->sitename, length_sitename_1, sizeof(uint16_t), CH_UTF16));
7988 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
7990 if (r->dummy1) {
7991 _mem_save_dummy1_0 = NDR_PULL_GET_MEM_CTX(ndr);
7992 NDR_PULL_SET_MEM_CTX(ndr, r->dummy1, 0);
7993 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy1));
7994 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy1));
7995 size_dummy1_1 = ndr_get_array_size(ndr, &r->dummy1);
7996 length_dummy1_1 = ndr_get_array_length(ndr, &r->dummy1);
7997 if (length_dummy1_1 > size_dummy1_1) {
7998 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dummy1_1, length_dummy1_1);
8000 NDR_CHECK(ndr_check_string_terminator(ndr, length_dummy1_1, sizeof(uint16_t)));
8001 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy1, length_dummy1_1, sizeof(uint16_t), CH_UTF16));
8002 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy1_0, 0);
8004 if (r->dummy2) {
8005 _mem_save_dummy2_0 = NDR_PULL_GET_MEM_CTX(ndr);
8006 NDR_PULL_SET_MEM_CTX(ndr, r->dummy2, 0);
8007 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy2));
8008 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy2));
8009 size_dummy2_1 = ndr_get_array_size(ndr, &r->dummy2);
8010 length_dummy2_1 = ndr_get_array_length(ndr, &r->dummy2);
8011 if (length_dummy2_1 > size_dummy2_1) {
8012 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dummy2_1, length_dummy2_1);
8014 NDR_CHECK(ndr_check_string_terminator(ndr, length_dummy2_1, sizeof(uint16_t)));
8015 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy2, length_dummy2_1, sizeof(uint16_t), CH_UTF16));
8016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy2_0, 0);
8018 if (r->dummy3) {
8019 _mem_save_dummy3_0 = NDR_PULL_GET_MEM_CTX(ndr);
8020 NDR_PULL_SET_MEM_CTX(ndr, r->dummy3, 0);
8021 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy3));
8022 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy3));
8023 size_dummy3_1 = ndr_get_array_size(ndr, &r->dummy3);
8024 length_dummy3_1 = ndr_get_array_length(ndr, &r->dummy3);
8025 if (length_dummy3_1 > size_dummy3_1) {
8026 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dummy3_1, length_dummy3_1);
8028 NDR_CHECK(ndr_check_string_terminator(ndr, length_dummy3_1, sizeof(uint16_t)));
8029 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy3, length_dummy3_1, sizeof(uint16_t), CH_UTF16));
8030 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy3_0, 0);
8032 if (r->dummy4) {
8033 _mem_save_dummy4_0 = NDR_PULL_GET_MEM_CTX(ndr);
8034 NDR_PULL_SET_MEM_CTX(ndr, r->dummy4, 0);
8035 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy4));
8036 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy4));
8037 size_dummy4_1 = ndr_get_array_size(ndr, &r->dummy4);
8038 length_dummy4_1 = ndr_get_array_length(ndr, &r->dummy4);
8039 if (length_dummy4_1 > size_dummy4_1) {
8040 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dummy4_1, length_dummy4_1);
8042 NDR_CHECK(ndr_check_string_terminator(ndr, length_dummy4_1, sizeof(uint16_t)));
8043 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy4, length_dummy4_1, sizeof(uint16_t), CH_UTF16));
8044 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy4_0, 0);
8046 NDR_CHECK(ndr_pull_netr_OsVersionContainer(ndr, NDR_BUFFERS, &r->os_version));
8047 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->os_name));
8048 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string3));
8049 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string4));
8051 return NDR_ERR_SUCCESS;
8054 _PUBLIC_ void ndr_print_netr_WorkstationInformation(struct ndr_print *ndr, const char *name, const struct netr_WorkstationInformation *r)
8056 ndr_print_struct(ndr, name, "netr_WorkstationInformation");
8057 ndr->depth++;
8058 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy", &r->lsa_policy);
8059 ndr_print_ptr(ndr, "dns_hostname", r->dns_hostname);
8060 ndr->depth++;
8061 if (r->dns_hostname) {
8062 ndr_print_string(ndr, "dns_hostname", r->dns_hostname);
8064 ndr->depth--;
8065 ndr_print_ptr(ndr, "sitename", r->sitename);
8066 ndr->depth++;
8067 if (r->sitename) {
8068 ndr_print_string(ndr, "sitename", r->sitename);
8070 ndr->depth--;
8071 ndr_print_ptr(ndr, "dummy1", r->dummy1);
8072 ndr->depth++;
8073 if (r->dummy1) {
8074 ndr_print_string(ndr, "dummy1", r->dummy1);
8076 ndr->depth--;
8077 ndr_print_ptr(ndr, "dummy2", r->dummy2);
8078 ndr->depth++;
8079 if (r->dummy2) {
8080 ndr_print_string(ndr, "dummy2", r->dummy2);
8082 ndr->depth--;
8083 ndr_print_ptr(ndr, "dummy3", r->dummy3);
8084 ndr->depth++;
8085 if (r->dummy3) {
8086 ndr_print_string(ndr, "dummy3", r->dummy3);
8088 ndr->depth--;
8089 ndr_print_ptr(ndr, "dummy4", r->dummy4);
8090 ndr->depth++;
8091 if (r->dummy4) {
8092 ndr_print_string(ndr, "dummy4", r->dummy4);
8094 ndr->depth--;
8095 ndr_print_netr_OsVersionContainer(ndr, "os_version", &r->os_version);
8096 ndr_print_lsa_String(ndr, "os_name", &r->os_name);
8097 ndr_print_lsa_String(ndr, "dummy_string3", &r->dummy_string3);
8098 ndr_print_lsa_String(ndr, "dummy_string4", &r->dummy_string4);
8099 ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags);
8100 ndr_print_uint32(ndr, "dummy_long2", r->dummy_long2);
8101 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
8102 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
8103 ndr->depth--;
8106 static enum ndr_err_code ndr_push_netr_WorkstationInfo(struct ndr_push *ndr, int ndr_flags, const union netr_WorkstationInfo *r)
8108 if (ndr_flags & NDR_SCALARS) {
8109 int level = ndr_push_get_switch_value(ndr, r);
8110 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
8111 NDR_CHECK(ndr_push_union_align(ndr, 5));
8112 switch (level) {
8113 case 1: {
8114 NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_info));
8115 break; }
8117 case 2: {
8118 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lsa_policy_info));
8119 break; }
8121 default:
8122 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8125 if (ndr_flags & NDR_BUFFERS) {
8126 int level = ndr_push_get_switch_value(ndr, r);
8127 switch (level) {
8128 case 1:
8129 if (r->workstation_info) {
8130 NDR_CHECK(ndr_push_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->workstation_info));
8132 break;
8134 case 2:
8135 if (r->lsa_policy_info) {
8136 NDR_CHECK(ndr_push_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8138 break;
8140 default:
8141 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8144 return NDR_ERR_SUCCESS;
8147 static enum ndr_err_code ndr_pull_netr_WorkstationInfo(struct ndr_pull *ndr, int ndr_flags, union netr_WorkstationInfo *r)
8149 int level;
8150 uint32_t _level;
8151 TALLOC_CTX *_mem_save_workstation_info_0;
8152 uint32_t _ptr_workstation_info;
8153 TALLOC_CTX *_mem_save_lsa_policy_info_0;
8154 uint32_t _ptr_lsa_policy_info;
8155 level = ndr_pull_get_switch_value(ndr, r);
8156 if (ndr_flags & NDR_SCALARS) {
8157 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8158 if (_level != level) {
8159 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8161 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8162 switch (level) {
8163 case 1: {
8164 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_info));
8165 if (_ptr_workstation_info) {
8166 NDR_PULL_ALLOC(ndr, r->workstation_info);
8167 } else {
8168 r->workstation_info = NULL;
8170 break; }
8172 case 2: {
8173 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lsa_policy_info));
8174 if (_ptr_lsa_policy_info) {
8175 NDR_PULL_ALLOC(ndr, r->lsa_policy_info);
8176 } else {
8177 r->lsa_policy_info = NULL;
8179 break; }
8181 default:
8182 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8185 if (ndr_flags & NDR_BUFFERS) {
8186 switch (level) {
8187 case 1:
8188 if (r->workstation_info) {
8189 _mem_save_workstation_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8190 NDR_PULL_SET_MEM_CTX(ndr, r->workstation_info, 0);
8191 NDR_CHECK(ndr_pull_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->workstation_info));
8192 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_info_0, 0);
8194 break;
8196 case 2:
8197 if (r->lsa_policy_info) {
8198 _mem_save_lsa_policy_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8199 NDR_PULL_SET_MEM_CTX(ndr, r->lsa_policy_info, 0);
8200 NDR_CHECK(ndr_pull_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8201 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lsa_policy_info_0, 0);
8203 break;
8205 default:
8206 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8209 return NDR_ERR_SUCCESS;
8212 _PUBLIC_ void ndr_print_netr_WorkstationInfo(struct ndr_print *ndr, const char *name, const union netr_WorkstationInfo *r)
8214 int level;
8215 level = ndr_print_get_switch_value(ndr, r);
8216 ndr_print_union(ndr, name, level, "netr_WorkstationInfo");
8217 switch (level) {
8218 case 1:
8219 ndr_print_ptr(ndr, "workstation_info", r->workstation_info);
8220 ndr->depth++;
8221 if (r->workstation_info) {
8222 ndr_print_netr_WorkstationInformation(ndr, "workstation_info", r->workstation_info);
8224 ndr->depth--;
8225 break;
8227 case 2:
8228 ndr_print_ptr(ndr, "lsa_policy_info", r->lsa_policy_info);
8229 ndr->depth++;
8230 if (r->lsa_policy_info) {
8231 ndr_print_netr_WorkstationInformation(ndr, "lsa_policy_info", r->lsa_policy_info);
8233 ndr->depth--;
8234 break;
8236 default:
8237 ndr_print_bad_level(ndr, name, level);
8241 static enum ndr_err_code ndr_push_netr_trust_extension(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension *r)
8243 if (ndr_flags & NDR_SCALARS) {
8244 NDR_CHECK(ndr_push_align(ndr, 4));
8245 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
8246 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8247 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
8248 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->flags));
8249 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index));
8250 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type));
8251 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes));
8252 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
8254 if (ndr_flags & NDR_BUFFERS) {
8256 return NDR_ERR_SUCCESS;
8259 static enum ndr_err_code ndr_pull_netr_trust_extension(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension *r)
8261 if (ndr_flags & NDR_SCALARS) {
8262 NDR_CHECK(ndr_pull_align(ndr, 4));
8263 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
8264 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
8265 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
8266 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->flags));
8267 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index));
8268 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type));
8269 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes));
8270 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
8272 if (ndr_flags & NDR_BUFFERS) {
8274 return NDR_ERR_SUCCESS;
8277 _PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r)
8279 ndr_print_struct(ndr, name, "netr_trust_extension");
8280 ndr->depth++;
8281 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->length);
8282 ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy);
8283 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->size);
8284 ndr_print_netr_TrustFlags(ndr, "flags", r->flags);
8285 ndr_print_uint32(ndr, "parent_index", r->parent_index);
8286 ndr_print_uint32(ndr, "trust_type", r->trust_type);
8287 ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes);
8288 ndr->depth--;
8291 static enum ndr_err_code ndr_push_netr_trust_extension_container(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension_container *r)
8293 if (ndr_flags & NDR_SCALARS) {
8294 NDR_CHECK(ndr_push_align(ndr, 5));
8295 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
8296 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
8297 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
8298 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8300 if (ndr_flags & NDR_BUFFERS) {
8301 if (r->info) {
8302 NDR_CHECK(ndr_push_netr_trust_extension(ndr, NDR_SCALARS, r->info));
8305 return NDR_ERR_SUCCESS;
8308 static enum ndr_err_code ndr_pull_netr_trust_extension_container(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension_container *r)
8310 uint32_t _ptr_info;
8311 TALLOC_CTX *_mem_save_info_0;
8312 if (ndr_flags & NDR_SCALARS) {
8313 NDR_CHECK(ndr_pull_align(ndr, 5));
8314 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
8315 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
8316 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
8317 if (_ptr_info) {
8318 NDR_PULL_ALLOC(ndr, r->info);
8319 } else {
8320 r->info = NULL;
8322 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8324 if (ndr_flags & NDR_BUFFERS) {
8325 if (r->info) {
8326 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8327 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
8328 NDR_CHECK(ndr_pull_netr_trust_extension(ndr, NDR_SCALARS, r->info));
8329 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
8332 return NDR_ERR_SUCCESS;
8335 _PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r)
8337 ndr_print_struct(ndr, name, "netr_trust_extension_container");
8338 ndr->depth++;
8339 ndr_print_uint16(ndr, "length", r->length);
8340 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
8341 ndr_print_ptr(ndr, "info", r->info);
8342 ndr->depth++;
8343 if (r->info) {
8344 ndr_print_netr_trust_extension(ndr, "info", r->info);
8346 ndr->depth--;
8347 ndr->depth--;
8350 static enum ndr_err_code ndr_push_netr_OneDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_OneDomainInfo *r)
8352 if (ndr_flags & NDR_SCALARS) {
8353 NDR_CHECK(ndr_push_align(ndr, 5));
8354 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domainname));
8355 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domainname));
8356 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forestname));
8357 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
8358 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
8359 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
8360 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8361 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8362 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8363 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long1));
8364 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long2));
8365 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
8366 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
8367 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8369 if (ndr_flags & NDR_BUFFERS) {
8370 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domainname));
8371 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domainname));
8372 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forestname));
8373 if (r->domain_sid) {
8374 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
8376 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
8377 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8378 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8379 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8381 return NDR_ERR_SUCCESS;
8384 static enum ndr_err_code ndr_pull_netr_OneDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_OneDomainInfo *r)
8386 uint32_t _ptr_domain_sid;
8387 TALLOC_CTX *_mem_save_domain_sid_0;
8388 if (ndr_flags & NDR_SCALARS) {
8389 NDR_CHECK(ndr_pull_align(ndr, 5));
8390 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domainname));
8391 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domainname));
8392 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forestname));
8393 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
8394 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
8395 if (_ptr_domain_sid) {
8396 NDR_PULL_ALLOC(ndr, r->domain_sid);
8397 } else {
8398 r->domain_sid = NULL;
8400 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
8401 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8402 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8403 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8404 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long1));
8405 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long2));
8406 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
8407 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
8408 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8410 if (ndr_flags & NDR_BUFFERS) {
8411 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domainname));
8412 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domainname));
8413 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forestname));
8414 if (r->domain_sid) {
8415 _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
8416 NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
8417 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
8418 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
8420 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
8421 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8422 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8423 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8425 return NDR_ERR_SUCCESS;
8428 _PUBLIC_ void ndr_print_netr_OneDomainInfo(struct ndr_print *ndr, const char *name, const struct netr_OneDomainInfo *r)
8430 ndr_print_struct(ndr, name, "netr_OneDomainInfo");
8431 ndr->depth++;
8432 ndr_print_lsa_StringLarge(ndr, "domainname", &r->domainname);
8433 ndr_print_lsa_StringLarge(ndr, "dns_domainname", &r->dns_domainname);
8434 ndr_print_lsa_StringLarge(ndr, "dns_forestname", &r->dns_forestname);
8435 ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
8436 ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
8437 ndr->depth++;
8438 if (r->domain_sid) {
8439 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
8441 ndr->depth--;
8442 ndr_print_netr_trust_extension_container(ndr, "trust_extension", &r->trust_extension);
8443 ndr_print_lsa_StringLarge(ndr, "dummy_string2", &r->dummy_string2);
8444 ndr_print_lsa_StringLarge(ndr, "dummy_string3", &r->dummy_string3);
8445 ndr_print_lsa_StringLarge(ndr, "dummy_string4", &r->dummy_string4);
8446 ndr_print_uint32(ndr, "dummy_long1", r->dummy_long1);
8447 ndr_print_uint32(ndr, "dummy_long2", r->dummy_long2);
8448 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
8449 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
8450 ndr->depth--;
8453 _PUBLIC_ enum ndr_err_code ndr_push_netr_SupportedEncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
8455 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8456 return NDR_ERR_SUCCESS;
8459 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SupportedEncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
8461 uint32_t v;
8462 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8463 *r = v;
8464 return NDR_ERR_SUCCESS;
8467 _PUBLIC_ void ndr_print_netr_SupportedEncTypes(struct ndr_print *ndr, const char *name, uint32_t r)
8469 ndr_print_uint32(ndr, name, r);
8470 ndr->depth++;
8471 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_CRC32", ENC_CRC32, r);
8472 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_RSA_MD5", ENC_RSA_MD5, r);
8473 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_RC4_HMAC_MD5", ENC_RC4_HMAC_MD5, r);
8474 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_HMAC_SHA1_96_AES128", ENC_HMAC_SHA1_96_AES128, r);
8475 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_HMAC_SHA1_96_AES256", ENC_HMAC_SHA1_96_AES256, r);
8476 ndr->depth--;
8479 static enum ndr_err_code ndr_push_netr_DomainInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInformation *r)
8481 uint32_t cntr_trusted_domains_1;
8482 if (ndr_flags & NDR_SCALARS) {
8483 NDR_CHECK(ndr_push_align(ndr, 5));
8484 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->primary_domain));
8485 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trusted_domain_count));
8486 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domains));
8487 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
8488 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_hostname));
8489 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8490 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8491 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8492 NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags));
8493 NDR_CHECK(ndr_push_netr_SupportedEncTypes(ndr, NDR_SCALARS, r->supported_enc_types));
8494 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
8495 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
8496 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8498 if (ndr_flags & NDR_BUFFERS) {
8499 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->primary_domain));
8500 if (r->trusted_domains) {
8501 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->trusted_domain_count));
8502 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8503 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->trusted_domains[cntr_trusted_domains_1]));
8505 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8506 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->trusted_domains[cntr_trusted_domains_1]));
8509 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
8510 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_hostname));
8511 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8512 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8513 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8515 return NDR_ERR_SUCCESS;
8518 static enum ndr_err_code ndr_pull_netr_DomainInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInformation *r)
8520 uint32_t _ptr_trusted_domains;
8521 uint32_t size_trusted_domains_1 = 0;
8522 uint32_t cntr_trusted_domains_1;
8523 TALLOC_CTX *_mem_save_trusted_domains_0;
8524 TALLOC_CTX *_mem_save_trusted_domains_1;
8525 if (ndr_flags & NDR_SCALARS) {
8526 NDR_CHECK(ndr_pull_align(ndr, 5));
8527 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->primary_domain));
8528 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trusted_domain_count));
8529 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domains));
8530 if (_ptr_trusted_domains) {
8531 NDR_PULL_ALLOC(ndr, r->trusted_domains);
8532 } else {
8533 r->trusted_domains = NULL;
8535 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
8536 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_hostname));
8537 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8538 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8539 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8540 NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags));
8541 NDR_CHECK(ndr_pull_netr_SupportedEncTypes(ndr, NDR_SCALARS, &r->supported_enc_types));
8542 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
8543 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
8544 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8546 if (ndr_flags & NDR_BUFFERS) {
8547 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->primary_domain));
8548 if (r->trusted_domains) {
8549 _mem_save_trusted_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
8550 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domains, 0);
8551 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_domains));
8552 size_trusted_domains_1 = ndr_get_array_size(ndr, &r->trusted_domains);
8553 NDR_PULL_ALLOC_N(ndr, r->trusted_domains, size_trusted_domains_1);
8554 _mem_save_trusted_domains_1 = NDR_PULL_GET_MEM_CTX(ndr);
8555 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domains, 0);
8556 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < size_trusted_domains_1; cntr_trusted_domains_1++) {
8557 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->trusted_domains[cntr_trusted_domains_1]));
8559 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < size_trusted_domains_1; cntr_trusted_domains_1++) {
8560 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->trusted_domains[cntr_trusted_domains_1]));
8562 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_1, 0);
8563 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_0, 0);
8565 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
8566 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_hostname));
8567 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8568 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8569 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8570 if (r->trusted_domains) {
8571 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusted_domains, r->trusted_domain_count));
8574 return NDR_ERR_SUCCESS;
8577 _PUBLIC_ void ndr_print_netr_DomainInformation(struct ndr_print *ndr, const char *name, const struct netr_DomainInformation *r)
8579 uint32_t cntr_trusted_domains_1;
8580 ndr_print_struct(ndr, name, "netr_DomainInformation");
8581 ndr->depth++;
8582 ndr_print_netr_OneDomainInfo(ndr, "primary_domain", &r->primary_domain);
8583 ndr_print_uint32(ndr, "trusted_domain_count", r->trusted_domain_count);
8584 ndr_print_ptr(ndr, "trusted_domains", r->trusted_domains);
8585 ndr->depth++;
8586 if (r->trusted_domains) {
8587 ndr->print(ndr, "%s: ARRAY(%d)", "trusted_domains", (int)r->trusted_domain_count);
8588 ndr->depth++;
8589 for (cntr_trusted_domains_1=0;cntr_trusted_domains_1<r->trusted_domain_count;cntr_trusted_domains_1++) {
8590 char *idx_1=NULL;
8591 if (asprintf(&idx_1, "[%d]", cntr_trusted_domains_1) != -1) {
8592 ndr_print_netr_OneDomainInfo(ndr, "trusted_domains", &r->trusted_domains[cntr_trusted_domains_1]);
8593 free(idx_1);
8596 ndr->depth--;
8598 ndr->depth--;
8599 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy", &r->lsa_policy);
8600 ndr_print_lsa_StringLarge(ndr, "dns_hostname", &r->dns_hostname);
8601 ndr_print_lsa_StringLarge(ndr, "dummy_string2", &r->dummy_string2);
8602 ndr_print_lsa_StringLarge(ndr, "dummy_string3", &r->dummy_string3);
8603 ndr_print_lsa_StringLarge(ndr, "dummy_string4", &r->dummy_string4);
8604 ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags);
8605 ndr_print_netr_SupportedEncTypes(ndr, "supported_enc_types", r->supported_enc_types);
8606 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
8607 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
8608 ndr->depth--;
8611 static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r)
8613 if (ndr_flags & NDR_SCALARS) {
8614 int level = ndr_push_get_switch_value(ndr, r);
8615 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
8616 NDR_CHECK(ndr_push_union_align(ndr, 5));
8617 switch (level) {
8618 case 1: {
8619 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_info));
8620 break; }
8622 case 2: {
8623 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lsa_policy_info));
8624 break; }
8626 default:
8627 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8630 if (ndr_flags & NDR_BUFFERS) {
8631 int level = ndr_push_get_switch_value(ndr, r);
8632 switch (level) {
8633 case 1:
8634 if (r->domain_info) {
8635 NDR_CHECK(ndr_push_netr_DomainInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_info));
8637 break;
8639 case 2:
8640 if (r->lsa_policy_info) {
8641 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8643 break;
8645 default:
8646 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8649 return NDR_ERR_SUCCESS;
8652 static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r)
8654 int level;
8655 uint32_t _level;
8656 TALLOC_CTX *_mem_save_domain_info_0;
8657 uint32_t _ptr_domain_info;
8658 TALLOC_CTX *_mem_save_lsa_policy_info_0;
8659 uint32_t _ptr_lsa_policy_info;
8660 level = ndr_pull_get_switch_value(ndr, r);
8661 if (ndr_flags & NDR_SCALARS) {
8662 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8663 if (_level != level) {
8664 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8666 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8667 switch (level) {
8668 case 1: {
8669 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_info));
8670 if (_ptr_domain_info) {
8671 NDR_PULL_ALLOC(ndr, r->domain_info);
8672 } else {
8673 r->domain_info = NULL;
8675 break; }
8677 case 2: {
8678 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lsa_policy_info));
8679 if (_ptr_lsa_policy_info) {
8680 NDR_PULL_ALLOC(ndr, r->lsa_policy_info);
8681 } else {
8682 r->lsa_policy_info = NULL;
8684 break; }
8686 default:
8687 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8690 if (ndr_flags & NDR_BUFFERS) {
8691 switch (level) {
8692 case 1:
8693 if (r->domain_info) {
8694 _mem_save_domain_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8695 NDR_PULL_SET_MEM_CTX(ndr, r->domain_info, 0);
8696 NDR_CHECK(ndr_pull_netr_DomainInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_info));
8697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_info_0, 0);
8699 break;
8701 case 2:
8702 if (r->lsa_policy_info) {
8703 _mem_save_lsa_policy_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8704 NDR_PULL_SET_MEM_CTX(ndr, r->lsa_policy_info, 0);
8705 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8706 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lsa_policy_info_0, 0);
8708 break;
8710 default:
8711 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8714 return NDR_ERR_SUCCESS;
8717 _PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r)
8719 int level;
8720 level = ndr_print_get_switch_value(ndr, r);
8721 ndr_print_union(ndr, name, level, "netr_DomainInfo");
8722 switch (level) {
8723 case 1:
8724 ndr_print_ptr(ndr, "domain_info", r->domain_info);
8725 ndr->depth++;
8726 if (r->domain_info) {
8727 ndr_print_netr_DomainInformation(ndr, "domain_info", r->domain_info);
8729 ndr->depth--;
8730 break;
8732 case 2:
8733 ndr_print_ptr(ndr, "lsa_policy_info", r->lsa_policy_info);
8734 ndr->depth++;
8735 if (r->lsa_policy_info) {
8736 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy_info", r->lsa_policy_info);
8738 ndr->depth--;
8739 break;
8741 default:
8742 ndr_print_bad_level(ndr, name, level);
8746 static enum ndr_err_code ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r)
8749 uint32_t _flags_save_STRUCT = ndr->flags;
8750 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8751 if (ndr_flags & NDR_SCALARS) {
8752 NDR_CHECK(ndr_push_align(ndr, 4));
8753 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 512));
8754 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
8755 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
8757 if (ndr_flags & NDR_BUFFERS) {
8759 ndr->flags = _flags_save_STRUCT;
8761 return NDR_ERR_SUCCESS;
8764 static enum ndr_err_code ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r)
8766 uint32_t size_data_0 = 0;
8768 uint32_t _flags_save_STRUCT = ndr->flags;
8769 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8770 if (ndr_flags & NDR_SCALARS) {
8771 NDR_CHECK(ndr_pull_align(ndr, 4));
8772 size_data_0 = 512;
8773 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_0));
8774 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
8775 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
8777 if (ndr_flags & NDR_BUFFERS) {
8779 ndr->flags = _flags_save_STRUCT;
8781 return NDR_ERR_SUCCESS;
8784 _PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r)
8786 ndr_print_struct(ndr, name, "netr_CryptPassword");
8788 uint32_t _flags_save_STRUCT = ndr->flags;
8789 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8790 ndr->depth++;
8791 ndr_print_array_uint8(ndr, "data", r->data, 512);
8792 ndr_print_uint32(ndr, "length", r->length);
8793 ndr->depth--;
8794 ndr->flags = _flags_save_STRUCT;
8798 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r)
8800 uint32_t cntr_sitename_1;
8801 if (ndr_flags & NDR_SCALARS) {
8802 NDR_CHECK(ndr_push_align(ndr, 5));
8803 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8804 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
8805 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8807 if (ndr_flags & NDR_BUFFERS) {
8808 if (r->sitename) {
8809 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
8810 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8811 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
8813 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8814 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
8818 return NDR_ERR_SUCCESS;
8821 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r)
8823 uint32_t _ptr_sitename;
8824 uint32_t size_sitename_1 = 0;
8825 uint32_t cntr_sitename_1;
8826 TALLOC_CTX *_mem_save_sitename_0;
8827 TALLOC_CTX *_mem_save_sitename_1;
8828 if (ndr_flags & NDR_SCALARS) {
8829 NDR_CHECK(ndr_pull_align(ndr, 5));
8830 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8831 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
8832 if (_ptr_sitename) {
8833 NDR_PULL_ALLOC(ndr, r->sitename);
8834 } else {
8835 r->sitename = NULL;
8837 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8839 if (ndr_flags & NDR_BUFFERS) {
8840 if (r->sitename) {
8841 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
8842 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
8843 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
8844 size_sitename_1 = ndr_get_array_size(ndr, &r->sitename);
8845 NDR_PULL_ALLOC_N(ndr, r->sitename, size_sitename_1);
8846 _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
8847 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
8848 for (cntr_sitename_1 = 0; cntr_sitename_1 < size_sitename_1; cntr_sitename_1++) {
8849 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
8851 for (cntr_sitename_1 = 0; cntr_sitename_1 < size_sitename_1; cntr_sitename_1++) {
8852 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
8854 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
8855 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
8857 if (r->sitename) {
8858 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
8861 return NDR_ERR_SUCCESS;
8864 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r)
8866 uint32_t cntr_sitename_1;
8867 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr");
8868 ndr->depth++;
8869 ndr_print_uint32(ndr, "count", r->count);
8870 ndr_print_ptr(ndr, "sitename", r->sitename);
8871 ndr->depth++;
8872 if (r->sitename) {
8873 ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count);
8874 ndr->depth++;
8875 for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
8876 char *idx_1=NULL;
8877 if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) {
8878 ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
8879 free(idx_1);
8882 ndr->depth--;
8884 ndr->depth--;
8885 ndr->depth--;
8888 static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r)
8890 if (ndr_flags & NDR_SCALARS) {
8891 NDR_CHECK(ndr_push_align(ndr, 5));
8892 NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
8893 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
8894 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8896 if (ndr_flags & NDR_BUFFERS) {
8897 if (r->buffer) {
8898 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->size));
8899 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size));
8902 return NDR_ERR_SUCCESS;
8905 static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *r)
8907 uint32_t _ptr_buffer;
8908 uint32_t size_buffer_1 = 0;
8909 TALLOC_CTX *_mem_save_buffer_0;
8910 if (ndr_flags & NDR_SCALARS) {
8911 NDR_CHECK(ndr_pull_align(ndr, 5));
8912 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
8913 if (_ptr_buffer) {
8914 NDR_PULL_ALLOC(ndr, r->buffer);
8915 } else {
8916 r->buffer = NULL;
8918 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
8919 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8921 if (ndr_flags & NDR_BUFFERS) {
8922 if (r->buffer) {
8923 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
8924 NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0);
8925 NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer));
8926 size_buffer_1 = ndr_get_array_size(ndr, &r->buffer);
8927 NDR_PULL_ALLOC_N(ndr, r->buffer, size_buffer_1);
8928 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, size_buffer_1));
8929 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
8931 if (r->buffer) {
8932 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size));
8935 return NDR_ERR_SUCCESS;
8938 _PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r)
8940 ndr_print_struct(ndr, name, "netr_DsRAddress");
8941 ndr->depth++;
8942 ndr_print_ptr(ndr, "buffer", r->buffer);
8943 ndr->depth++;
8944 if (r->buffer) {
8945 ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size);
8947 ndr->depth--;
8948 ndr_print_uint32(ndr, "size", r->size);
8949 ndr->depth--;
8952 static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r)
8954 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
8955 return NDR_ERR_SUCCESS;
8958 static enum ndr_err_code ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r)
8960 uint32_t v;
8961 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
8962 *r = v;
8963 return NDR_ERR_SUCCESS;
8966 _PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r)
8968 const char *val = NULL;
8970 switch (r) {
8971 case NETR_TRUST_TYPE_DOWNLEVEL: val = "NETR_TRUST_TYPE_DOWNLEVEL"; break;
8972 case NETR_TRUST_TYPE_UPLEVEL: val = "NETR_TRUST_TYPE_UPLEVEL"; break;
8973 case NETR_TRUST_TYPE_MIT: val = "NETR_TRUST_TYPE_MIT"; break;
8974 case NETR_TRUST_TYPE_DCE: val = "NETR_TRUST_TYPE_DCE"; break;
8976 ndr_print_enum(ndr, name, "ENUM", val, r);
8979 static enum ndr_err_code ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
8981 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8982 return NDR_ERR_SUCCESS;
8985 static enum ndr_err_code ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
8987 uint32_t v;
8988 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8989 *r = v;
8990 return NDR_ERR_SUCCESS;
8993 _PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
8995 ndr_print_uint32(ndr, name, r);
8996 ndr->depth++;
8997 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE, r);
8998 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r);
8999 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r);
9000 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r);
9001 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r);
9002 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST, r);
9003 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r);
9004 ndr->depth--;
9007 static enum ndr_err_code ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r)
9009 if (ndr_flags & NDR_SCALARS) {
9010 NDR_CHECK(ndr_push_align(ndr, 5));
9011 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
9012 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
9013 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->trust_flags));
9014 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index));
9015 NDR_CHECK(ndr_push_netr_TrustType(ndr, NDR_SCALARS, r->trust_type));
9016 NDR_CHECK(ndr_push_netr_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes));
9017 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
9018 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
9019 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9021 if (ndr_flags & NDR_BUFFERS) {
9022 if (r->netbios_name) {
9023 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
9024 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9025 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
9026 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9028 if (r->dns_name) {
9029 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
9030 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9031 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
9032 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9034 if (r->sid) {
9035 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
9038 return NDR_ERR_SUCCESS;
9041 static enum ndr_err_code ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r)
9043 uint32_t _ptr_netbios_name;
9044 uint32_t size_netbios_name_1 = 0;
9045 uint32_t length_netbios_name_1 = 0;
9046 TALLOC_CTX *_mem_save_netbios_name_0;
9047 uint32_t _ptr_dns_name;
9048 uint32_t size_dns_name_1 = 0;
9049 uint32_t length_dns_name_1 = 0;
9050 TALLOC_CTX *_mem_save_dns_name_0;
9051 uint32_t _ptr_sid;
9052 TALLOC_CTX *_mem_save_sid_0;
9053 if (ndr_flags & NDR_SCALARS) {
9054 NDR_CHECK(ndr_pull_align(ndr, 5));
9055 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
9056 if (_ptr_netbios_name) {
9057 NDR_PULL_ALLOC(ndr, r->netbios_name);
9058 } else {
9059 r->netbios_name = NULL;
9061 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
9062 if (_ptr_dns_name) {
9063 NDR_PULL_ALLOC(ndr, r->dns_name);
9064 } else {
9065 r->dns_name = NULL;
9067 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->trust_flags));
9068 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index));
9069 NDR_CHECK(ndr_pull_netr_TrustType(ndr, NDR_SCALARS, &r->trust_type));
9070 NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes));
9071 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
9072 if (_ptr_sid) {
9073 NDR_PULL_ALLOC(ndr, r->sid);
9074 } else {
9075 r->sid = NULL;
9077 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
9078 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9080 if (ndr_flags & NDR_BUFFERS) {
9081 if (r->netbios_name) {
9082 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9083 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
9084 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
9085 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
9086 size_netbios_name_1 = ndr_get_array_size(ndr, &r->netbios_name);
9087 length_netbios_name_1 = ndr_get_array_length(ndr, &r->netbios_name);
9088 if (length_netbios_name_1 > size_netbios_name_1) {
9089 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_netbios_name_1, length_netbios_name_1);
9091 NDR_CHECK(ndr_check_string_terminator(ndr, length_netbios_name_1, sizeof(uint16_t)));
9092 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, length_netbios_name_1, sizeof(uint16_t), CH_UTF16));
9093 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
9095 if (r->dns_name) {
9096 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9097 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
9098 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
9099 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
9100 size_dns_name_1 = ndr_get_array_size(ndr, &r->dns_name);
9101 length_dns_name_1 = ndr_get_array_length(ndr, &r->dns_name);
9102 if (length_dns_name_1 > size_dns_name_1) {
9103 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dns_name_1, length_dns_name_1);
9105 NDR_CHECK(ndr_check_string_terminator(ndr, length_dns_name_1, sizeof(uint16_t)));
9106 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, length_dns_name_1, sizeof(uint16_t), CH_UTF16));
9107 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
9109 if (r->sid) {
9110 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
9111 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
9112 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
9113 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
9116 return NDR_ERR_SUCCESS;
9119 _PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r)
9121 ndr_print_struct(ndr, name, "netr_DomainTrust");
9122 ndr->depth++;
9123 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
9124 ndr->depth++;
9125 if (r->netbios_name) {
9126 ndr_print_string(ndr, "netbios_name", r->netbios_name);
9128 ndr->depth--;
9129 ndr_print_ptr(ndr, "dns_name", r->dns_name);
9130 ndr->depth++;
9131 if (r->dns_name) {
9132 ndr_print_string(ndr, "dns_name", r->dns_name);
9134 ndr->depth--;
9135 ndr_print_netr_TrustFlags(ndr, "trust_flags", r->trust_flags);
9136 ndr_print_uint32(ndr, "parent_index", r->parent_index);
9137 ndr_print_netr_TrustType(ndr, "trust_type", r->trust_type);
9138 ndr_print_netr_TrustAttributes(ndr, "trust_attributes", r->trust_attributes);
9139 ndr_print_ptr(ndr, "sid", r->sid);
9140 ndr->depth++;
9141 if (r->sid) {
9142 ndr_print_dom_sid2(ndr, "sid", r->sid);
9144 ndr->depth--;
9145 ndr_print_GUID(ndr, "guid", &r->guid);
9146 ndr->depth--;
9149 static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r)
9151 uint32_t cntr_array_1;
9152 if (ndr_flags & NDR_SCALARS) {
9153 NDR_CHECK(ndr_push_align(ndr, 5));
9154 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9155 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
9156 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9158 if (ndr_flags & NDR_BUFFERS) {
9159 if (r->array) {
9160 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9161 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
9162 NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
9164 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
9165 NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
9169 return NDR_ERR_SUCCESS;
9172 static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r)
9174 uint32_t _ptr_array;
9175 uint32_t size_array_1 = 0;
9176 uint32_t cntr_array_1;
9177 TALLOC_CTX *_mem_save_array_0;
9178 TALLOC_CTX *_mem_save_array_1;
9179 if (ndr_flags & NDR_SCALARS) {
9180 NDR_CHECK(ndr_pull_align(ndr, 5));
9181 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9182 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
9183 if (_ptr_array) {
9184 NDR_PULL_ALLOC(ndr, r->array);
9185 } else {
9186 r->array = NULL;
9188 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9190 if (ndr_flags & NDR_BUFFERS) {
9191 if (r->array) {
9192 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9193 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9194 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9195 size_array_1 = ndr_get_array_size(ndr, &r->array);
9196 NDR_PULL_ALLOC_N(ndr, r->array, size_array_1);
9197 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
9198 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9199 for (cntr_array_1 = 0; cntr_array_1 < size_array_1; cntr_array_1++) {
9200 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
9202 for (cntr_array_1 = 0; cntr_array_1 < size_array_1; cntr_array_1++) {
9203 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
9205 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
9206 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9208 if (r->array) {
9209 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9212 return NDR_ERR_SUCCESS;
9215 _PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r)
9217 uint32_t cntr_array_1;
9218 ndr_print_struct(ndr, name, "netr_DomainTrustList");
9219 ndr->depth++;
9220 ndr_print_uint32(ndr, "count", r->count);
9221 ndr_print_ptr(ndr, "array", r->array);
9222 ndr->depth++;
9223 if (r->array) {
9224 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9225 ndr->depth++;
9226 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
9227 char *idx_1=NULL;
9228 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
9229 ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]);
9230 free(idx_1);
9233 ndr->depth--;
9235 ndr->depth--;
9236 ndr->depth--;
9239 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r)
9241 uint32_t cntr_sitename_1;
9242 uint32_t cntr_subnetname_1;
9243 if (ndr_flags & NDR_SCALARS) {
9244 NDR_CHECK(ndr_push_align(ndr, 5));
9245 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9246 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
9247 NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname));
9248 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9250 if (ndr_flags & NDR_BUFFERS) {
9251 if (r->sitename) {
9252 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9253 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9254 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
9256 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9257 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
9260 if (r->subnetname) {
9261 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9262 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9263 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
9265 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9266 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
9270 return NDR_ERR_SUCCESS;
9273 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r)
9275 uint32_t _ptr_sitename;
9276 uint32_t size_sitename_1 = 0;
9277 uint32_t cntr_sitename_1;
9278 TALLOC_CTX *_mem_save_sitename_0;
9279 TALLOC_CTX *_mem_save_sitename_1;
9280 uint32_t _ptr_subnetname;
9281 uint32_t size_subnetname_1 = 0;
9282 uint32_t cntr_subnetname_1;
9283 TALLOC_CTX *_mem_save_subnetname_0;
9284 TALLOC_CTX *_mem_save_subnetname_1;
9285 if (ndr_flags & NDR_SCALARS) {
9286 NDR_CHECK(ndr_pull_align(ndr, 5));
9287 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9288 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
9289 if (_ptr_sitename) {
9290 NDR_PULL_ALLOC(ndr, r->sitename);
9291 } else {
9292 r->sitename = NULL;
9294 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname));
9295 if (_ptr_subnetname) {
9296 NDR_PULL_ALLOC(ndr, r->subnetname);
9297 } else {
9298 r->subnetname = NULL;
9300 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9302 if (ndr_flags & NDR_BUFFERS) {
9303 if (r->sitename) {
9304 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
9305 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
9306 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
9307 size_sitename_1 = ndr_get_array_size(ndr, &r->sitename);
9308 NDR_PULL_ALLOC_N(ndr, r->sitename, size_sitename_1);
9309 _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
9310 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
9311 for (cntr_sitename_1 = 0; cntr_sitename_1 < size_sitename_1; cntr_sitename_1++) {
9312 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
9314 for (cntr_sitename_1 = 0; cntr_sitename_1 < size_sitename_1; cntr_sitename_1++) {
9315 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
9317 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
9318 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
9320 if (r->subnetname) {
9321 _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr);
9322 NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
9323 NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname));
9324 size_subnetname_1 = ndr_get_array_size(ndr, &r->subnetname);
9325 NDR_PULL_ALLOC_N(ndr, r->subnetname, size_subnetname_1);
9326 _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr);
9327 NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
9328 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < size_subnetname_1; cntr_subnetname_1++) {
9329 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
9331 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < size_subnetname_1; cntr_subnetname_1++) {
9332 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
9334 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0);
9335 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0);
9337 if (r->sitename) {
9338 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
9340 if (r->subnetname) {
9341 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count));
9344 return NDR_ERR_SUCCESS;
9347 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r)
9349 uint32_t cntr_sitename_1;
9350 uint32_t cntr_subnetname_1;
9351 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr");
9352 ndr->depth++;
9353 ndr_print_uint32(ndr, "count", r->count);
9354 ndr_print_ptr(ndr, "sitename", r->sitename);
9355 ndr->depth++;
9356 if (r->sitename) {
9357 ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count);
9358 ndr->depth++;
9359 for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
9360 char *idx_1=NULL;
9361 if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) {
9362 ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
9363 free(idx_1);
9366 ndr->depth--;
9368 ndr->depth--;
9369 ndr_print_ptr(ndr, "subnetname", r->subnetname);
9370 ndr->depth++;
9371 if (r->subnetname) {
9372 ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", (int)r->count);
9373 ndr->depth++;
9374 for (cntr_subnetname_1=0;cntr_subnetname_1<r->count;cntr_subnetname_1++) {
9375 char *idx_1=NULL;
9376 if (asprintf(&idx_1, "[%d]", cntr_subnetname_1) != -1) {
9377 ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]);
9378 free(idx_1);
9381 ndr->depth--;
9383 ndr->depth--;
9384 ndr->depth--;
9387 static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r)
9389 uint32_t cntr_sites_1;
9390 if (ndr_flags & NDR_SCALARS) {
9391 NDR_CHECK(ndr_push_align(ndr, 5));
9392 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites));
9393 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites));
9394 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9396 if (ndr_flags & NDR_BUFFERS) {
9397 if (r->sites) {
9398 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_sites));
9399 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9400 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
9402 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9403 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
9407 return NDR_ERR_SUCCESS;
9410 static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r)
9412 uint32_t _ptr_sites;
9413 uint32_t size_sites_1 = 0;
9414 uint32_t cntr_sites_1;
9415 TALLOC_CTX *_mem_save_sites_0;
9416 TALLOC_CTX *_mem_save_sites_1;
9417 if (ndr_flags & NDR_SCALARS) {
9418 NDR_CHECK(ndr_pull_align(ndr, 5));
9419 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites));
9420 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites));
9421 if (_ptr_sites) {
9422 NDR_PULL_ALLOC(ndr, r->sites);
9423 } else {
9424 r->sites = NULL;
9426 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9428 if (ndr_flags & NDR_BUFFERS) {
9429 if (r->sites) {
9430 _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr);
9431 NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
9432 NDR_CHECK(ndr_pull_array_size(ndr, &r->sites));
9433 size_sites_1 = ndr_get_array_size(ndr, &r->sites);
9434 NDR_PULL_ALLOC_N(ndr, r->sites, size_sites_1);
9435 _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr);
9436 NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
9437 for (cntr_sites_1 = 0; cntr_sites_1 < size_sites_1; cntr_sites_1++) {
9438 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
9440 for (cntr_sites_1 = 0; cntr_sites_1 < size_sites_1; cntr_sites_1++) {
9441 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
9443 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0);
9444 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0);
9446 if (r->sites) {
9447 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites));
9450 return NDR_ERR_SUCCESS;
9453 _PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r)
9455 uint32_t cntr_sites_1;
9456 ndr_print_struct(ndr, name, "DcSitesCtr");
9457 ndr->depth++;
9458 ndr_print_uint32(ndr, "num_sites", r->num_sites);
9459 ndr_print_ptr(ndr, "sites", r->sites);
9460 ndr->depth++;
9461 if (r->sites) {
9462 ndr->print(ndr, "%s: ARRAY(%d)", "sites", (int)r->num_sites);
9463 ndr->depth++;
9464 for (cntr_sites_1=0;cntr_sites_1<r->num_sites;cntr_sites_1++) {
9465 char *idx_1=NULL;
9466 if (asprintf(&idx_1, "[%d]", cntr_sites_1) != -1) {
9467 ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]);
9468 free(idx_1);
9471 ndr->depth--;
9473 ndr->depth--;
9474 ndr->depth--;
9477 static enum ndr_err_code ndr_push_netr_TrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_TrustInfo *r)
9479 uint32_t cntr_data_1;
9480 uint32_t cntr_entries_1;
9481 if (ndr_flags & NDR_SCALARS) {
9482 NDR_CHECK(ndr_push_align(ndr, 5));
9483 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9484 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
9485 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entry_count));
9486 NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries));
9487 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9489 if (ndr_flags & NDR_BUFFERS) {
9490 if (r->data) {
9491 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9492 for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) {
9493 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data[cntr_data_1]));
9496 if (r->entries) {
9497 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9498 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9499 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
9501 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9502 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
9506 return NDR_ERR_SUCCESS;
9509 static enum ndr_err_code ndr_pull_netr_TrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_TrustInfo *r)
9511 uint32_t _ptr_data;
9512 uint32_t size_data_1 = 0;
9513 uint32_t cntr_data_1;
9514 TALLOC_CTX *_mem_save_data_0;
9515 TALLOC_CTX *_mem_save_data_1;
9516 uint32_t _ptr_entries;
9517 uint32_t size_entries_1 = 0;
9518 uint32_t cntr_entries_1;
9519 TALLOC_CTX *_mem_save_entries_0;
9520 TALLOC_CTX *_mem_save_entries_1;
9521 if (ndr_flags & NDR_SCALARS) {
9522 NDR_CHECK(ndr_pull_align(ndr, 5));
9523 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9524 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
9525 if (_ptr_data) {
9526 NDR_PULL_ALLOC(ndr, r->data);
9527 } else {
9528 r->data = NULL;
9530 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entry_count));
9531 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries));
9532 if (_ptr_entries) {
9533 NDR_PULL_ALLOC(ndr, r->entries);
9534 } else {
9535 r->entries = NULL;
9537 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9539 if (ndr_flags & NDR_BUFFERS) {
9540 if (r->data) {
9541 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
9542 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
9543 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
9544 size_data_1 = ndr_get_array_size(ndr, &r->data);
9545 NDR_PULL_ALLOC_N(ndr, r->data, size_data_1);
9546 _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
9547 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
9548 for (cntr_data_1 = 0; cntr_data_1 < size_data_1; cntr_data_1++) {
9549 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data[cntr_data_1]));
9551 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
9552 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
9554 if (r->entries) {
9555 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
9556 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
9557 NDR_CHECK(ndr_pull_array_size(ndr, &r->entries));
9558 size_entries_1 = ndr_get_array_size(ndr, &r->entries);
9559 NDR_PULL_ALLOC_N(ndr, r->entries, size_entries_1);
9560 _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr);
9561 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
9562 for (cntr_entries_1 = 0; cntr_entries_1 < size_entries_1; cntr_entries_1++) {
9563 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
9565 for (cntr_entries_1 = 0; cntr_entries_1 < size_entries_1; cntr_entries_1++) {
9566 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
9568 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0);
9569 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
9571 if (r->data) {
9572 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->count));
9574 if (r->entries) {
9575 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count));
9578 return NDR_ERR_SUCCESS;
9581 _PUBLIC_ void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r)
9583 uint32_t cntr_data_1;
9584 uint32_t cntr_entries_1;
9585 ndr_print_struct(ndr, name, "netr_TrustInfo");
9586 ndr->depth++;
9587 ndr_print_uint32(ndr, "count", r->count);
9588 ndr_print_ptr(ndr, "data", r->data);
9589 ndr->depth++;
9590 if (r->data) {
9591 ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->count);
9592 ndr->depth++;
9593 for (cntr_data_1=0;cntr_data_1<r->count;cntr_data_1++) {
9594 char *idx_1=NULL;
9595 if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) {
9596 ndr_print_uint32(ndr, "data", r->data[cntr_data_1]);
9597 free(idx_1);
9600 ndr->depth--;
9602 ndr->depth--;
9603 ndr_print_uint32(ndr, "entry_count", r->entry_count);
9604 ndr_print_ptr(ndr, "entries", r->entries);
9605 ndr->depth++;
9606 if (r->entries) {
9607 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count);
9608 ndr->depth++;
9609 for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) {
9610 char *idx_1=NULL;
9611 if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) {
9612 ndr_print_lsa_String(ndr, "entries", &r->entries[cntr_entries_1]);
9613 free(idx_1);
9616 ndr->depth--;
9618 ndr->depth--;
9619 ndr->depth--;
9622 static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r)
9624 if (flags & NDR_IN) {
9625 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9626 if (r->in.server_name) {
9627 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9628 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9629 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9630 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));
9632 if (r->in.account_name == NULL) {
9633 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9635 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9636 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9637 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9638 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));
9639 if (r->in.workstation == NULL) {
9640 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9642 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9643 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9644 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9645 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9647 if (flags & NDR_OUT) {
9648 if (r->out.info == NULL) {
9649 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9651 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
9652 if (*r->out.info) {
9653 NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
9655 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
9657 return NDR_ERR_SUCCESS;
9660 static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r)
9662 uint32_t _ptr_server_name;
9663 uint32_t size_server_name_1 = 0;
9664 uint32_t length_server_name_1 = 0;
9665 uint32_t size_account_name_1 = 0;
9666 uint32_t length_account_name_1 = 0;
9667 uint32_t size_workstation_1 = 0;
9668 uint32_t length_workstation_1 = 0;
9669 uint32_t _ptr_info;
9670 TALLOC_CTX *_mem_save_server_name_0;
9671 TALLOC_CTX *_mem_save_info_0;
9672 TALLOC_CTX *_mem_save_info_1;
9673 if (flags & NDR_IN) {
9674 ZERO_STRUCT(r->out);
9676 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
9677 if (_ptr_server_name) {
9678 NDR_PULL_ALLOC(ndr, r->in.server_name);
9679 } else {
9680 r->in.server_name = NULL;
9682 if (r->in.server_name) {
9683 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9684 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
9685 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
9686 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
9687 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
9688 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
9689 if (length_server_name_1 > size_server_name_1) {
9690 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
9692 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
9693 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
9694 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
9696 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
9697 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
9698 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
9699 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
9700 if (length_account_name_1 > size_account_name_1) {
9701 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
9703 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
9704 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
9705 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation));
9706 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation));
9707 size_workstation_1 = ndr_get_array_size(ndr, &r->in.workstation);
9708 length_workstation_1 = ndr_get_array_length(ndr, &r->in.workstation);
9709 if (length_workstation_1 > size_workstation_1) {
9710 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_workstation_1, length_workstation_1);
9712 NDR_CHECK(ndr_check_string_terminator(ndr, length_workstation_1, sizeof(uint16_t)));
9713 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, length_workstation_1, sizeof(uint16_t), CH_UTF16));
9714 NDR_PULL_ALLOC(ndr, r->out.info);
9715 ZERO_STRUCTP(r->out.info);
9717 if (flags & NDR_OUT) {
9718 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9719 NDR_PULL_ALLOC(ndr, r->out.info);
9721 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
9722 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
9723 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
9724 if (_ptr_info) {
9725 NDR_PULL_ALLOC(ndr, *r->out.info);
9726 } else {
9727 *r->out.info = NULL;
9729 if (*r->out.info) {
9730 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
9731 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
9732 NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
9733 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
9735 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
9736 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
9738 return NDR_ERR_SUCCESS;
9741 _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r)
9743 ndr_print_struct(ndr, name, "netr_LogonUasLogon");
9744 ndr->depth++;
9745 if (flags & NDR_SET_VALUES) {
9746 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
9748 if (flags & NDR_IN) {
9749 ndr_print_struct(ndr, "in", "netr_LogonUasLogon");
9750 ndr->depth++;
9751 ndr_print_ptr(ndr, "server_name", r->in.server_name);
9752 ndr->depth++;
9753 if (r->in.server_name) {
9754 ndr_print_string(ndr, "server_name", r->in.server_name);
9756 ndr->depth--;
9757 ndr_print_ptr(ndr, "account_name", r->in.account_name);
9758 ndr->depth++;
9759 ndr_print_string(ndr, "account_name", r->in.account_name);
9760 ndr->depth--;
9761 ndr_print_ptr(ndr, "workstation", r->in.workstation);
9762 ndr->depth++;
9763 ndr_print_string(ndr, "workstation", r->in.workstation);
9764 ndr->depth--;
9765 ndr->depth--;
9767 if (flags & NDR_OUT) {
9768 ndr_print_struct(ndr, "out", "netr_LogonUasLogon");
9769 ndr->depth++;
9770 ndr_print_ptr(ndr, "info", r->out.info);
9771 ndr->depth++;
9772 ndr_print_ptr(ndr, "info", *r->out.info);
9773 ndr->depth++;
9774 if (*r->out.info) {
9775 ndr_print_netr_UasInfo(ndr, "info", *r->out.info);
9777 ndr->depth--;
9778 ndr->depth--;
9779 ndr_print_WERROR(ndr, "result", r->out.result);
9780 ndr->depth--;
9782 ndr->depth--;
9785 static enum ndr_err_code ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r)
9787 if (flags & NDR_IN) {
9788 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9789 if (r->in.server_name) {
9790 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9791 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9792 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9793 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));
9795 if (r->in.account_name == NULL) {
9796 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9798 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9799 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9800 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9801 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));
9802 if (r->in.workstation == NULL) {
9803 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9805 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9806 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9807 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9808 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9810 if (flags & NDR_OUT) {
9811 if (r->out.info == NULL) {
9812 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9814 NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info));
9815 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
9817 return NDR_ERR_SUCCESS;
9820 static enum ndr_err_code ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r)
9822 uint32_t _ptr_server_name;
9823 uint32_t size_server_name_1 = 0;
9824 uint32_t length_server_name_1 = 0;
9825 uint32_t size_account_name_1 = 0;
9826 uint32_t length_account_name_1 = 0;
9827 uint32_t size_workstation_1 = 0;
9828 uint32_t length_workstation_1 = 0;
9829 TALLOC_CTX *_mem_save_server_name_0;
9830 TALLOC_CTX *_mem_save_info_0;
9831 if (flags & NDR_IN) {
9832 ZERO_STRUCT(r->out);
9834 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
9835 if (_ptr_server_name) {
9836 NDR_PULL_ALLOC(ndr, r->in.server_name);
9837 } else {
9838 r->in.server_name = NULL;
9840 if (r->in.server_name) {
9841 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9842 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
9843 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
9844 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
9845 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
9846 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
9847 if (length_server_name_1 > size_server_name_1) {
9848 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
9850 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
9851 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
9852 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
9854 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
9855 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
9856 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
9857 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
9858 if (length_account_name_1 > size_account_name_1) {
9859 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
9861 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
9862 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
9863 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation));
9864 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation));
9865 size_workstation_1 = ndr_get_array_size(ndr, &r->in.workstation);
9866 length_workstation_1 = ndr_get_array_length(ndr, &r->in.workstation);
9867 if (length_workstation_1 > size_workstation_1) {
9868 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_workstation_1, length_workstation_1);
9870 NDR_CHECK(ndr_check_string_terminator(ndr, length_workstation_1, sizeof(uint16_t)));
9871 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, length_workstation_1, sizeof(uint16_t), CH_UTF16));
9872 NDR_PULL_ALLOC(ndr, r->out.info);
9873 ZERO_STRUCTP(r->out.info);
9875 if (flags & NDR_OUT) {
9876 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9877 NDR_PULL_ALLOC(ndr, r->out.info);
9879 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
9880 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
9881 NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info));
9882 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
9883 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
9885 return NDR_ERR_SUCCESS;
9888 _PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r)
9890 ndr_print_struct(ndr, name, "netr_LogonUasLogoff");
9891 ndr->depth++;
9892 if (flags & NDR_SET_VALUES) {
9893 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
9895 if (flags & NDR_IN) {
9896 ndr_print_struct(ndr, "in", "netr_LogonUasLogoff");
9897 ndr->depth++;
9898 ndr_print_ptr(ndr, "server_name", r->in.server_name);
9899 ndr->depth++;
9900 if (r->in.server_name) {
9901 ndr_print_string(ndr, "server_name", r->in.server_name);
9903 ndr->depth--;
9904 ndr_print_ptr(ndr, "account_name", r->in.account_name);
9905 ndr->depth++;
9906 ndr_print_string(ndr, "account_name", r->in.account_name);
9907 ndr->depth--;
9908 ndr_print_ptr(ndr, "workstation", r->in.workstation);
9909 ndr->depth++;
9910 ndr_print_string(ndr, "workstation", r->in.workstation);
9911 ndr->depth--;
9912 ndr->depth--;
9914 if (flags & NDR_OUT) {
9915 ndr_print_struct(ndr, "out", "netr_LogonUasLogoff");
9916 ndr->depth++;
9917 ndr_print_ptr(ndr, "info", r->out.info);
9918 ndr->depth++;
9919 ndr_print_netr_UasLogoffInfo(ndr, "info", r->out.info);
9920 ndr->depth--;
9921 ndr_print_WERROR(ndr, "result", r->out.result);
9922 ndr->depth--;
9924 ndr->depth--;
9927 static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r)
9929 if (flags & NDR_IN) {
9930 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9931 if (r->in.server_name) {
9932 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9933 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9934 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9935 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));
9937 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
9938 if (r->in.computer_name) {
9939 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9940 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9941 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9942 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));
9944 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
9945 if (r->in.credential) {
9946 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
9948 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
9949 if (r->in.return_authenticator) {
9950 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
9952 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
9953 if (r->in.logon == NULL) {
9954 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9956 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
9957 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
9958 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
9960 if (flags & NDR_OUT) {
9961 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
9962 if (r->out.return_authenticator) {
9963 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
9965 if (r->out.validation == NULL) {
9966 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9968 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
9969 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
9970 if (r->out.authoritative == NULL) {
9971 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9973 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
9974 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
9976 return NDR_ERR_SUCCESS;
9979 static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r)
9981 uint32_t _ptr_server_name;
9982 uint32_t size_server_name_1 = 0;
9983 uint32_t length_server_name_1 = 0;
9984 uint32_t _ptr_computer_name;
9985 uint32_t size_computer_name_1 = 0;
9986 uint32_t length_computer_name_1 = 0;
9987 uint32_t _ptr_credential;
9988 uint32_t _ptr_return_authenticator;
9989 TALLOC_CTX *_mem_save_server_name_0;
9990 TALLOC_CTX *_mem_save_computer_name_0;
9991 TALLOC_CTX *_mem_save_credential_0;
9992 TALLOC_CTX *_mem_save_return_authenticator_0;
9993 TALLOC_CTX *_mem_save_logon_0;
9994 TALLOC_CTX *_mem_save_validation_0;
9995 TALLOC_CTX *_mem_save_authoritative_0;
9996 if (flags & NDR_IN) {
9997 ZERO_STRUCT(r->out);
9999 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10000 if (_ptr_server_name) {
10001 NDR_PULL_ALLOC(ndr, r->in.server_name);
10002 } else {
10003 r->in.server_name = NULL;
10005 if (r->in.server_name) {
10006 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10007 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10008 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10009 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10010 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
10011 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
10012 if (length_server_name_1 > size_server_name_1) {
10013 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
10015 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
10016 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
10017 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10019 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
10020 if (_ptr_computer_name) {
10021 NDR_PULL_ALLOC(ndr, r->in.computer_name);
10022 } else {
10023 r->in.computer_name = NULL;
10025 if (r->in.computer_name) {
10026 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10027 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
10028 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10029 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10030 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
10031 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
10032 if (length_computer_name_1 > size_computer_name_1) {
10033 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
10035 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
10036 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
10037 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
10039 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
10040 if (_ptr_credential) {
10041 NDR_PULL_ALLOC(ndr, r->in.credential);
10042 } else {
10043 r->in.credential = NULL;
10045 if (r->in.credential) {
10046 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10047 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
10048 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10049 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
10051 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10052 if (_ptr_return_authenticator) {
10053 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10054 } else {
10055 r->in.return_authenticator = NULL;
10057 if (r->in.return_authenticator) {
10058 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10059 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
10060 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10061 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10063 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
10064 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10065 NDR_PULL_ALLOC(ndr, r->in.logon);
10067 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
10068 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
10069 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
10070 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
10071 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
10072 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
10073 NDR_PULL_ALLOC(ndr, r->out.validation);
10074 ZERO_STRUCTP(r->out.validation);
10075 NDR_PULL_ALLOC(ndr, r->out.authoritative);
10076 ZERO_STRUCTP(r->out.authoritative);
10078 if (flags & NDR_OUT) {
10079 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10080 if (_ptr_return_authenticator) {
10081 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10082 } else {
10083 r->out.return_authenticator = NULL;
10085 if (r->out.return_authenticator) {
10086 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10087 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
10088 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10089 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10091 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10092 NDR_PULL_ALLOC(ndr, r->out.validation);
10094 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
10095 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
10096 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
10097 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
10098 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
10099 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10100 NDR_PULL_ALLOC(ndr, r->out.authoritative);
10102 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
10103 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
10104 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
10105 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
10106 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10108 return NDR_ERR_SUCCESS;
10111 _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r)
10113 ndr_print_struct(ndr, name, "netr_LogonSamLogon");
10114 ndr->depth++;
10115 if (flags & NDR_SET_VALUES) {
10116 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10118 if (flags & NDR_IN) {
10119 ndr_print_struct(ndr, "in", "netr_LogonSamLogon");
10120 ndr->depth++;
10121 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10122 ndr->depth++;
10123 if (r->in.server_name) {
10124 ndr_print_string(ndr, "server_name", r->in.server_name);
10126 ndr->depth--;
10127 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10128 ndr->depth++;
10129 if (r->in.computer_name) {
10130 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10132 ndr->depth--;
10133 ndr_print_ptr(ndr, "credential", r->in.credential);
10134 ndr->depth++;
10135 if (r->in.credential) {
10136 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10138 ndr->depth--;
10139 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
10140 ndr->depth++;
10141 if (r->in.return_authenticator) {
10142 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
10144 ndr->depth--;
10145 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
10146 ndr_print_ptr(ndr, "logon", r->in.logon);
10147 ndr->depth++;
10148 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
10149 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
10150 ndr->depth--;
10151 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
10152 ndr->depth--;
10154 if (flags & NDR_OUT) {
10155 ndr_print_struct(ndr, "out", "netr_LogonSamLogon");
10156 ndr->depth++;
10157 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10158 ndr->depth++;
10159 if (r->out.return_authenticator) {
10160 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10162 ndr->depth--;
10163 ndr_print_ptr(ndr, "validation", r->out.validation);
10164 ndr->depth++;
10165 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
10166 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
10167 ndr->depth--;
10168 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
10169 ndr->depth++;
10170 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
10171 ndr->depth--;
10172 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10173 ndr->depth--;
10175 ndr->depth--;
10178 static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r)
10180 if (flags & NDR_IN) {
10181 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10182 if (r->in.server_name) {
10183 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10184 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10185 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10186 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));
10188 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
10189 if (r->in.computer_name) {
10190 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10191 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10192 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10193 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));
10195 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
10196 if (r->in.credential) {
10197 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10199 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
10200 if (r->in.return_authenticator) {
10201 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10203 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
10204 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
10205 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
10207 if (flags & NDR_OUT) {
10208 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
10209 if (r->out.return_authenticator) {
10210 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10212 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10214 return NDR_ERR_SUCCESS;
10217 static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r)
10219 uint32_t _ptr_server_name;
10220 uint32_t size_server_name_1 = 0;
10221 uint32_t length_server_name_1 = 0;
10222 uint32_t _ptr_computer_name;
10223 uint32_t size_computer_name_1 = 0;
10224 uint32_t length_computer_name_1 = 0;
10225 uint32_t _ptr_credential;
10226 uint32_t _ptr_return_authenticator;
10227 TALLOC_CTX *_mem_save_server_name_0;
10228 TALLOC_CTX *_mem_save_computer_name_0;
10229 TALLOC_CTX *_mem_save_credential_0;
10230 TALLOC_CTX *_mem_save_return_authenticator_0;
10231 if (flags & NDR_IN) {
10232 ZERO_STRUCT(r->out);
10234 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10235 if (_ptr_server_name) {
10236 NDR_PULL_ALLOC(ndr, r->in.server_name);
10237 } else {
10238 r->in.server_name = NULL;
10240 if (r->in.server_name) {
10241 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10242 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10243 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10244 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10245 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
10246 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
10247 if (length_server_name_1 > size_server_name_1) {
10248 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
10250 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
10251 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
10252 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10254 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
10255 if (_ptr_computer_name) {
10256 NDR_PULL_ALLOC(ndr, r->in.computer_name);
10257 } else {
10258 r->in.computer_name = NULL;
10260 if (r->in.computer_name) {
10261 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10262 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
10263 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10264 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10265 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
10266 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
10267 if (length_computer_name_1 > size_computer_name_1) {
10268 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
10270 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
10271 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
10272 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
10274 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
10275 if (_ptr_credential) {
10276 NDR_PULL_ALLOC(ndr, r->in.credential);
10277 } else {
10278 r->in.credential = NULL;
10280 if (r->in.credential) {
10281 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10282 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
10283 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10284 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
10286 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10287 if (_ptr_return_authenticator) {
10288 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10289 } else {
10290 r->in.return_authenticator = NULL;
10292 if (r->in.return_authenticator) {
10293 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10294 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
10295 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10296 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10298 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
10299 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
10300 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
10302 if (flags & NDR_OUT) {
10303 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10304 if (_ptr_return_authenticator) {
10305 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10306 } else {
10307 r->out.return_authenticator = NULL;
10309 if (r->out.return_authenticator) {
10310 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10311 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
10312 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10313 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10315 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10317 return NDR_ERR_SUCCESS;
10320 _PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r)
10322 ndr_print_struct(ndr, name, "netr_LogonSamLogoff");
10323 ndr->depth++;
10324 if (flags & NDR_SET_VALUES) {
10325 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10327 if (flags & NDR_IN) {
10328 ndr_print_struct(ndr, "in", "netr_LogonSamLogoff");
10329 ndr->depth++;
10330 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10331 ndr->depth++;
10332 if (r->in.server_name) {
10333 ndr_print_string(ndr, "server_name", r->in.server_name);
10335 ndr->depth--;
10336 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10337 ndr->depth++;
10338 if (r->in.computer_name) {
10339 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10341 ndr->depth--;
10342 ndr_print_ptr(ndr, "credential", r->in.credential);
10343 ndr->depth++;
10344 if (r->in.credential) {
10345 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10347 ndr->depth--;
10348 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
10349 ndr->depth++;
10350 if (r->in.return_authenticator) {
10351 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
10353 ndr->depth--;
10354 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
10355 ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
10356 ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
10357 ndr->depth--;
10359 if (flags & NDR_OUT) {
10360 ndr_print_struct(ndr, "out", "netr_LogonSamLogoff");
10361 ndr->depth++;
10362 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10363 ndr->depth++;
10364 if (r->out.return_authenticator) {
10365 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10367 ndr->depth--;
10368 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10369 ndr->depth--;
10371 ndr->depth--;
10374 _PUBLIC_ enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r)
10376 if (flags & NDR_IN) {
10377 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10378 if (r->in.server_name) {
10379 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10380 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10381 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10382 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));
10384 if (r->in.computer_name == NULL) {
10385 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10387 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10388 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10389 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10390 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));
10391 if (r->in.credentials == NULL) {
10392 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10394 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10396 if (flags & NDR_OUT) {
10397 if (r->out.return_credentials == NULL) {
10398 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10400 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10401 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10403 return NDR_ERR_SUCCESS;
10406 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r)
10408 uint32_t _ptr_server_name;
10409 uint32_t size_server_name_1 = 0;
10410 uint32_t length_server_name_1 = 0;
10411 uint32_t size_computer_name_1 = 0;
10412 uint32_t length_computer_name_1 = 0;
10413 TALLOC_CTX *_mem_save_server_name_0;
10414 TALLOC_CTX *_mem_save_credentials_0;
10415 TALLOC_CTX *_mem_save_return_credentials_0;
10416 if (flags & NDR_IN) {
10417 ZERO_STRUCT(r->out);
10419 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10420 if (_ptr_server_name) {
10421 NDR_PULL_ALLOC(ndr, r->in.server_name);
10422 } else {
10423 r->in.server_name = NULL;
10425 if (r->in.server_name) {
10426 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10427 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10428 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10429 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10430 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
10431 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
10432 if (length_server_name_1 > size_server_name_1) {
10433 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
10435 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
10436 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
10437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10439 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10440 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10441 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
10442 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
10443 if (length_computer_name_1 > size_computer_name_1) {
10444 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
10446 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
10447 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
10448 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10449 NDR_PULL_ALLOC(ndr, r->in.credentials);
10451 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10452 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
10453 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10454 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10455 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10456 ZERO_STRUCTP(r->out.return_credentials);
10458 if (flags & NDR_OUT) {
10459 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10460 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10462 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10463 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
10464 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10465 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10466 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10468 return NDR_ERR_SUCCESS;
10471 _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r)
10473 ndr_print_struct(ndr, name, "netr_ServerReqChallenge");
10474 ndr->depth++;
10475 if (flags & NDR_SET_VALUES) {
10476 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10478 if (flags & NDR_IN) {
10479 ndr_print_struct(ndr, "in", "netr_ServerReqChallenge");
10480 ndr->depth++;
10481 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10482 ndr->depth++;
10483 if (r->in.server_name) {
10484 ndr_print_string(ndr, "server_name", r->in.server_name);
10486 ndr->depth--;
10487 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10488 ndr->depth++;
10489 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10490 ndr->depth--;
10491 ndr_print_ptr(ndr, "credentials", r->in.credentials);
10492 ndr->depth++;
10493 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
10494 ndr->depth--;
10495 ndr->depth--;
10497 if (flags & NDR_OUT) {
10498 ndr_print_struct(ndr, "out", "netr_ServerReqChallenge");
10499 ndr->depth++;
10500 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
10501 ndr->depth++;
10502 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
10503 ndr->depth--;
10504 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10505 ndr->depth--;
10507 ndr->depth--;
10510 static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r)
10512 if (flags & NDR_IN) {
10513 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10514 if (r->in.server_name) {
10515 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10516 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10517 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10518 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));
10520 if (r->in.account_name == NULL) {
10521 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10523 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10524 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10525 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10526 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));
10527 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
10528 if (r->in.computer_name == NULL) {
10529 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10531 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10532 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10533 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10534 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));
10535 if (r->in.credentials == NULL) {
10536 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10538 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10540 if (flags & NDR_OUT) {
10541 if (r->out.return_credentials == NULL) {
10542 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10544 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10545 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10547 return NDR_ERR_SUCCESS;
10550 static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r)
10552 uint32_t _ptr_server_name;
10553 uint32_t size_server_name_1 = 0;
10554 uint32_t length_server_name_1 = 0;
10555 uint32_t size_account_name_1 = 0;
10556 uint32_t length_account_name_1 = 0;
10557 uint32_t size_computer_name_1 = 0;
10558 uint32_t length_computer_name_1 = 0;
10559 TALLOC_CTX *_mem_save_server_name_0;
10560 TALLOC_CTX *_mem_save_credentials_0;
10561 TALLOC_CTX *_mem_save_return_credentials_0;
10562 if (flags & NDR_IN) {
10563 ZERO_STRUCT(r->out);
10565 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10566 if (_ptr_server_name) {
10567 NDR_PULL_ALLOC(ndr, r->in.server_name);
10568 } else {
10569 r->in.server_name = NULL;
10571 if (r->in.server_name) {
10572 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10573 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10574 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10575 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10576 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
10577 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
10578 if (length_server_name_1 > size_server_name_1) {
10579 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
10581 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
10582 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
10583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10585 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
10586 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
10587 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
10588 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
10589 if (length_account_name_1 > size_account_name_1) {
10590 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
10592 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
10593 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
10594 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
10595 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10596 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10597 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
10598 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
10599 if (length_computer_name_1 > size_computer_name_1) {
10600 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
10602 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
10603 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
10604 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10605 NDR_PULL_ALLOC(ndr, r->in.credentials);
10607 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10608 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
10609 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10610 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10611 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10612 ZERO_STRUCTP(r->out.return_credentials);
10614 if (flags & NDR_OUT) {
10615 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10616 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10618 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10619 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
10620 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10621 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10622 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10624 return NDR_ERR_SUCCESS;
10627 _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r)
10629 ndr_print_struct(ndr, name, "netr_ServerAuthenticate");
10630 ndr->depth++;
10631 if (flags & NDR_SET_VALUES) {
10632 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10634 if (flags & NDR_IN) {
10635 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate");
10636 ndr->depth++;
10637 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10638 ndr->depth++;
10639 if (r->in.server_name) {
10640 ndr_print_string(ndr, "server_name", r->in.server_name);
10642 ndr->depth--;
10643 ndr_print_ptr(ndr, "account_name", r->in.account_name);
10644 ndr->depth++;
10645 ndr_print_string(ndr, "account_name", r->in.account_name);
10646 ndr->depth--;
10647 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
10648 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10649 ndr->depth++;
10650 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10651 ndr->depth--;
10652 ndr_print_ptr(ndr, "credentials", r->in.credentials);
10653 ndr->depth++;
10654 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
10655 ndr->depth--;
10656 ndr->depth--;
10658 if (flags & NDR_OUT) {
10659 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate");
10660 ndr->depth++;
10661 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
10662 ndr->depth++;
10663 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
10664 ndr->depth--;
10665 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10666 ndr->depth--;
10668 ndr->depth--;
10671 static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r)
10673 if (flags & NDR_IN) {
10674 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10675 if (r->in.server_name) {
10676 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10677 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10678 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10679 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));
10681 if (r->in.account_name == NULL) {
10682 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10684 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10685 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10686 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10687 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));
10688 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
10689 if (r->in.computer_name == NULL) {
10690 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10692 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10693 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10694 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10695 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));
10696 if (r->in.credential == NULL) {
10697 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10699 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10700 if (r->in.new_password == NULL) {
10701 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10703 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_password));
10705 if (flags & NDR_OUT) {
10706 if (r->out.return_authenticator == NULL) {
10707 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10709 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10710 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10712 return NDR_ERR_SUCCESS;
10715 static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r)
10717 uint32_t _ptr_server_name;
10718 uint32_t size_server_name_1 = 0;
10719 uint32_t length_server_name_1 = 0;
10720 uint32_t size_account_name_1 = 0;
10721 uint32_t length_account_name_1 = 0;
10722 uint32_t size_computer_name_1 = 0;
10723 uint32_t length_computer_name_1 = 0;
10724 TALLOC_CTX *_mem_save_server_name_0;
10725 TALLOC_CTX *_mem_save_credential_0;
10726 TALLOC_CTX *_mem_save_return_authenticator_0;
10727 TALLOC_CTX *_mem_save_new_password_0;
10728 if (flags & NDR_IN) {
10729 ZERO_STRUCT(r->out);
10731 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10732 if (_ptr_server_name) {
10733 NDR_PULL_ALLOC(ndr, r->in.server_name);
10734 } else {
10735 r->in.server_name = NULL;
10737 if (r->in.server_name) {
10738 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10739 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10740 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10741 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10742 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
10743 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
10744 if (length_server_name_1 > size_server_name_1) {
10745 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
10747 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
10748 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
10749 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10751 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
10752 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
10753 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
10754 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
10755 if (length_account_name_1 > size_account_name_1) {
10756 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
10758 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
10759 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
10760 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
10761 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10762 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10763 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
10764 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
10765 if (length_computer_name_1 > size_computer_name_1) {
10766 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
10768 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
10769 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
10770 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10771 NDR_PULL_ALLOC(ndr, r->in.credential);
10773 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10774 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
10775 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10776 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
10777 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10778 NDR_PULL_ALLOC(ndr, r->in.new_password);
10780 _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
10781 NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
10782 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_password));
10783 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
10784 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10785 ZERO_STRUCTP(r->out.return_authenticator);
10787 if (flags & NDR_OUT) {
10788 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10789 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10791 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10792 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10793 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10794 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10795 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10797 return NDR_ERR_SUCCESS;
10800 _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r)
10802 ndr_print_struct(ndr, name, "netr_ServerPasswordSet");
10803 ndr->depth++;
10804 if (flags & NDR_SET_VALUES) {
10805 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10807 if (flags & NDR_IN) {
10808 ndr_print_struct(ndr, "in", "netr_ServerPasswordSet");
10809 ndr->depth++;
10810 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10811 ndr->depth++;
10812 if (r->in.server_name) {
10813 ndr_print_string(ndr, "server_name", r->in.server_name);
10815 ndr->depth--;
10816 ndr_print_ptr(ndr, "account_name", r->in.account_name);
10817 ndr->depth++;
10818 ndr_print_string(ndr, "account_name", r->in.account_name);
10819 ndr->depth--;
10820 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
10821 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10822 ndr->depth++;
10823 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10824 ndr->depth--;
10825 ndr_print_ptr(ndr, "credential", r->in.credential);
10826 ndr->depth++;
10827 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10828 ndr->depth--;
10829 ndr_print_ptr(ndr, "new_password", r->in.new_password);
10830 ndr->depth++;
10831 ndr_print_samr_Password(ndr, "new_password", r->in.new_password);
10832 ndr->depth--;
10833 ndr->depth--;
10835 if (flags & NDR_OUT) {
10836 ndr_print_struct(ndr, "out", "netr_ServerPasswordSet");
10837 ndr->depth++;
10838 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10839 ndr->depth++;
10840 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10841 ndr->depth--;
10842 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10843 ndr->depth--;
10845 ndr->depth--;
10848 static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r)
10850 if (flags & NDR_IN) {
10851 if (r->in.logon_server == NULL) {
10852 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10854 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10855 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10856 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10857 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));
10858 if (r->in.computername == NULL) {
10859 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10861 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10862 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10863 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10864 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10865 if (r->in.credential == NULL) {
10866 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10868 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10869 if (r->in.return_authenticator == NULL) {
10870 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10872 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10873 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
10874 if (r->in.sequence_num == NULL) {
10875 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10877 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->in.sequence_num));
10878 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
10880 if (flags & NDR_OUT) {
10881 if (r->out.return_authenticator == NULL) {
10882 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10884 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10885 if (r->out.sequence_num == NULL) {
10886 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10888 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num));
10889 if (r->out.delta_enum_array == NULL) {
10890 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10892 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
10893 if (*r->out.delta_enum_array) {
10894 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10896 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10898 return NDR_ERR_SUCCESS;
10901 static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r)
10903 uint32_t size_logon_server_1 = 0;
10904 uint32_t length_logon_server_1 = 0;
10905 uint32_t size_computername_1 = 0;
10906 uint32_t length_computername_1 = 0;
10907 uint32_t _ptr_delta_enum_array;
10908 TALLOC_CTX *_mem_save_credential_0;
10909 TALLOC_CTX *_mem_save_return_authenticator_0;
10910 TALLOC_CTX *_mem_save_sequence_num_0;
10911 TALLOC_CTX *_mem_save_delta_enum_array_0;
10912 TALLOC_CTX *_mem_save_delta_enum_array_1;
10913 if (flags & NDR_IN) {
10914 ZERO_STRUCT(r->out);
10916 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
10917 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
10918 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
10919 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
10920 if (length_logon_server_1 > size_logon_server_1) {
10921 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
10923 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
10924 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
10925 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
10926 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
10927 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
10928 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
10929 if (length_computername_1 > size_computername_1) {
10930 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
10932 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
10933 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
10934 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10935 NDR_PULL_ALLOC(ndr, r->in.credential);
10937 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10938 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
10939 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10940 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
10941 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10942 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10944 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10945 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10946 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10947 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10948 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
10949 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10950 NDR_PULL_ALLOC(ndr, r->in.sequence_num);
10952 _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr);
10953 NDR_PULL_SET_MEM_CTX(ndr, r->in.sequence_num, LIBNDR_FLAG_REF_ALLOC);
10954 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->in.sequence_num));
10955 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC);
10956 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
10957 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10958 *r->out.return_authenticator = *r->in.return_authenticator;
10959 NDR_PULL_ALLOC(ndr, r->out.sequence_num);
10960 *r->out.sequence_num = *r->in.sequence_num;
10961 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10962 ZERO_STRUCTP(r->out.delta_enum_array);
10964 if (flags & NDR_OUT) {
10965 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10966 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10968 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10969 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10970 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10971 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10972 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10973 NDR_PULL_ALLOC(ndr, r->out.sequence_num);
10975 _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr);
10976 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC);
10977 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num));
10978 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC);
10979 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10980 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10982 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10983 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
10984 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
10985 if (_ptr_delta_enum_array) {
10986 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
10987 } else {
10988 *r->out.delta_enum_array = NULL;
10990 if (*r->out.delta_enum_array) {
10991 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
10992 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
10993 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10994 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
10996 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
10997 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10999 return NDR_ERR_SUCCESS;
11002 _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r)
11004 ndr_print_struct(ndr, name, "netr_DatabaseDeltas");
11005 ndr->depth++;
11006 if (flags & NDR_SET_VALUES) {
11007 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11009 if (flags & NDR_IN) {
11010 ndr_print_struct(ndr, "in", "netr_DatabaseDeltas");
11011 ndr->depth++;
11012 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11013 ndr->depth++;
11014 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11015 ndr->depth--;
11016 ndr_print_ptr(ndr, "computername", r->in.computername);
11017 ndr->depth++;
11018 ndr_print_string(ndr, "computername", r->in.computername);
11019 ndr->depth--;
11020 ndr_print_ptr(ndr, "credential", r->in.credential);
11021 ndr->depth++;
11022 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
11023 ndr->depth--;
11024 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11025 ndr->depth++;
11026 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11027 ndr->depth--;
11028 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
11029 ndr_print_ptr(ndr, "sequence_num", r->in.sequence_num);
11030 ndr->depth++;
11031 ndr_print_udlong(ndr, "sequence_num", *r->in.sequence_num);
11032 ndr->depth--;
11033 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
11034 ndr->depth--;
11036 if (flags & NDR_OUT) {
11037 ndr_print_struct(ndr, "out", "netr_DatabaseDeltas");
11038 ndr->depth++;
11039 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11040 ndr->depth++;
11041 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11042 ndr->depth--;
11043 ndr_print_ptr(ndr, "sequence_num", r->out.sequence_num);
11044 ndr->depth++;
11045 ndr_print_udlong(ndr, "sequence_num", *r->out.sequence_num);
11046 ndr->depth--;
11047 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
11048 ndr->depth++;
11049 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
11050 ndr->depth++;
11051 if (*r->out.delta_enum_array) {
11052 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
11054 ndr->depth--;
11055 ndr->depth--;
11056 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11057 ndr->depth--;
11059 ndr->depth--;
11062 static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r)
11064 if (flags & NDR_IN) {
11065 if (r->in.logon_server == NULL) {
11066 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11068 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11069 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11070 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11071 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));
11072 if (r->in.computername == NULL) {
11073 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11075 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11076 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11077 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11078 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11079 if (r->in.credential == NULL) {
11080 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11082 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
11083 if (r->in.return_authenticator == NULL) {
11084 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11086 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11087 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
11088 if (r->in.sync_context == NULL) {
11089 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11091 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context));
11092 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
11094 if (flags & NDR_OUT) {
11095 if (r->out.return_authenticator == NULL) {
11096 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11098 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11099 if (r->out.sync_context == NULL) {
11100 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11102 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
11103 if (r->out.delta_enum_array == NULL) {
11104 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11106 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
11107 if (*r->out.delta_enum_array) {
11108 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
11110 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
11112 return NDR_ERR_SUCCESS;
11115 static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r)
11117 uint32_t size_logon_server_1 = 0;
11118 uint32_t length_logon_server_1 = 0;
11119 uint32_t size_computername_1 = 0;
11120 uint32_t length_computername_1 = 0;
11121 uint32_t _ptr_delta_enum_array;
11122 TALLOC_CTX *_mem_save_credential_0;
11123 TALLOC_CTX *_mem_save_return_authenticator_0;
11124 TALLOC_CTX *_mem_save_sync_context_0;
11125 TALLOC_CTX *_mem_save_delta_enum_array_0;
11126 TALLOC_CTX *_mem_save_delta_enum_array_1;
11127 if (flags & NDR_IN) {
11128 ZERO_STRUCT(r->out);
11130 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11131 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11132 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
11133 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
11134 if (length_logon_server_1 > size_logon_server_1) {
11135 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
11137 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
11138 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
11139 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
11140 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
11141 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
11142 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
11143 if (length_computername_1 > size_computername_1) {
11144 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
11146 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
11147 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
11148 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11149 NDR_PULL_ALLOC(ndr, r->in.credential);
11151 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
11152 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
11153 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
11154 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
11155 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11156 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
11158 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11159 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11160 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11161 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11162 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
11163 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11164 NDR_PULL_ALLOC(ndr, r->in.sync_context);
11166 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
11167 NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC);
11168 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context));
11169 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
11170 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
11171 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11172 *r->out.return_authenticator = *r->in.return_authenticator;
11173 NDR_PULL_ALLOC(ndr, r->out.sync_context);
11174 *r->out.sync_context = *r->in.sync_context;
11175 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
11176 ZERO_STRUCTP(r->out.delta_enum_array);
11178 if (flags & NDR_OUT) {
11179 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11180 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11182 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11183 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11184 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11185 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11186 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11187 NDR_PULL_ALLOC(ndr, r->out.sync_context);
11189 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
11190 NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
11191 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
11192 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
11193 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11194 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
11196 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11197 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
11198 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
11199 if (_ptr_delta_enum_array) {
11200 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
11201 } else {
11202 *r->out.delta_enum_array = NULL;
11204 if (*r->out.delta_enum_array) {
11205 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
11206 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
11207 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
11208 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
11210 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
11211 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
11213 return NDR_ERR_SUCCESS;
11216 _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r)
11218 ndr_print_struct(ndr, name, "netr_DatabaseSync");
11219 ndr->depth++;
11220 if (flags & NDR_SET_VALUES) {
11221 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11223 if (flags & NDR_IN) {
11224 ndr_print_struct(ndr, "in", "netr_DatabaseSync");
11225 ndr->depth++;
11226 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11227 ndr->depth++;
11228 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11229 ndr->depth--;
11230 ndr_print_ptr(ndr, "computername", r->in.computername);
11231 ndr->depth++;
11232 ndr_print_string(ndr, "computername", r->in.computername);
11233 ndr->depth--;
11234 ndr_print_ptr(ndr, "credential", r->in.credential);
11235 ndr->depth++;
11236 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
11237 ndr->depth--;
11238 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11239 ndr->depth++;
11240 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11241 ndr->depth--;
11242 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
11243 ndr_print_ptr(ndr, "sync_context", r->in.sync_context);
11244 ndr->depth++;
11245 ndr_print_uint32(ndr, "sync_context", *r->in.sync_context);
11246 ndr->depth--;
11247 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
11248 ndr->depth--;
11250 if (flags & NDR_OUT) {
11251 ndr_print_struct(ndr, "out", "netr_DatabaseSync");
11252 ndr->depth++;
11253 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11254 ndr->depth++;
11255 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11256 ndr->depth--;
11257 ndr_print_ptr(ndr, "sync_context", r->out.sync_context);
11258 ndr->depth++;
11259 ndr_print_uint32(ndr, "sync_context", *r->out.sync_context);
11260 ndr->depth--;
11261 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
11262 ndr->depth++;
11263 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
11264 ndr->depth++;
11265 if (*r->out.delta_enum_array) {
11266 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
11268 ndr->depth--;
11269 ndr->depth--;
11270 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11271 ndr->depth--;
11273 ndr->depth--;
11276 static enum ndr_err_code ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r)
11278 if (flags & NDR_IN) {
11279 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11280 if (r->in.logon_server) {
11281 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11282 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11283 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11284 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));
11286 if (r->in.computername == NULL) {
11287 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11289 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11290 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11291 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11292 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11293 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11294 if (r->in.return_authenticator == NULL) {
11295 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11297 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11298 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas));
11299 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
11300 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11301 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize));
11303 if (flags & NDR_OUT) {
11304 if (r->out.return_authenticator == NULL) {
11305 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11307 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11308 if (r->out.buffer == NULL) {
11309 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11312 struct ndr_push *_ndr_buffer;
11313 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11314 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11315 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1));
11317 if (r->out.count_returned == NULL) {
11318 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11320 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned));
11321 if (r->out.total_entries == NULL) {
11322 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11324 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries));
11325 if (r->out.recordid == NULL) {
11326 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11328 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11329 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
11331 return NDR_ERR_SUCCESS;
11334 static enum ndr_err_code ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r)
11336 uint32_t _ptr_logon_server;
11337 uint32_t size_logon_server_1 = 0;
11338 uint32_t length_logon_server_1 = 0;
11339 uint32_t size_computername_1 = 0;
11340 uint32_t length_computername_1 = 0;
11341 TALLOC_CTX *_mem_save_logon_server_0;
11342 TALLOC_CTX *_mem_save_return_authenticator_0;
11343 TALLOC_CTX *_mem_save_buffer_0;
11344 TALLOC_CTX *_mem_save_count_returned_0;
11345 TALLOC_CTX *_mem_save_total_entries_0;
11346 TALLOC_CTX *_mem_save_recordid_0;
11347 if (flags & NDR_IN) {
11348 ZERO_STRUCT(r->out);
11350 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11351 if (_ptr_logon_server) {
11352 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11353 } else {
11354 r->in.logon_server = NULL;
11356 if (r->in.logon_server) {
11357 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11358 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11359 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11360 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11361 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
11362 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
11363 if (length_logon_server_1 > size_logon_server_1) {
11364 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
11366 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
11367 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
11368 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11370 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
11371 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
11372 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
11373 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
11374 if (length_computername_1 > size_computername_1) {
11375 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
11377 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
11378 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
11379 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11380 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11381 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
11383 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11384 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11385 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11386 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11387 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas));
11388 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
11389 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11390 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize));
11391 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11392 *r->out.return_authenticator = *r->in.return_authenticator;
11393 NDR_PULL_ALLOC(ndr, r->out.buffer);
11394 ZERO_STRUCTP(r->out.buffer);
11395 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11396 ZERO_STRUCTP(r->out.count_returned);
11397 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11398 ZERO_STRUCTP(r->out.total_entries);
11399 NDR_PULL_ALLOC(ndr, r->out.recordid);
11400 ZERO_STRUCTP(r->out.recordid);
11402 if (flags & NDR_OUT) {
11403 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11404 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11406 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11407 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11408 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11409 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11410 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11411 NDR_PULL_ALLOC(ndr, r->out.buffer);
11413 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
11414 NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC);
11416 struct ndr_pull *_ndr_buffer;
11417 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11418 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11419 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1));
11421 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC);
11422 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11423 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11425 _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
11426 NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC);
11427 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned));
11428 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC);
11429 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11430 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11432 _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
11433 NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC);
11434 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries));
11435 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC);
11436 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11437 NDR_PULL_ALLOC(ndr, r->out.recordid);
11439 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11440 NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC);
11441 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11442 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11443 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
11445 return NDR_ERR_SUCCESS;
11448 _PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r)
11450 ndr_print_struct(ndr, name, "netr_AccountDeltas");
11451 ndr->depth++;
11452 if (flags & NDR_SET_VALUES) {
11453 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11455 if (flags & NDR_IN) {
11456 ndr_print_struct(ndr, "in", "netr_AccountDeltas");
11457 ndr->depth++;
11458 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11459 ndr->depth++;
11460 if (r->in.logon_server) {
11461 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11463 ndr->depth--;
11464 ndr_print_ptr(ndr, "computername", r->in.computername);
11465 ndr->depth++;
11466 ndr_print_string(ndr, "computername", r->in.computername);
11467 ndr->depth--;
11468 ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
11469 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11470 ndr->depth++;
11471 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11472 ndr->depth--;
11473 ndr_print_netr_UAS_INFO_0(ndr, "uas", &r->in.uas);
11474 ndr_print_uint32(ndr, "count", r->in.count);
11475 ndr_print_uint32(ndr, "level", r->in.level);
11476 ndr_print_uint32(ndr, "buffersize", r->in.buffersize);
11477 ndr->depth--;
11479 if (flags & NDR_OUT) {
11480 ndr_print_struct(ndr, "out", "netr_AccountDeltas");
11481 ndr->depth++;
11482 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11483 ndr->depth++;
11484 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11485 ndr->depth--;
11486 ndr_print_ptr(ndr, "buffer", r->out.buffer);
11487 ndr->depth++;
11488 ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer);
11489 ndr->depth--;
11490 ndr_print_ptr(ndr, "count_returned", r->out.count_returned);
11491 ndr->depth++;
11492 ndr_print_uint32(ndr, "count_returned", *r->out.count_returned);
11493 ndr->depth--;
11494 ndr_print_ptr(ndr, "total_entries", r->out.total_entries);
11495 ndr->depth++;
11496 ndr_print_uint32(ndr, "total_entries", *r->out.total_entries);
11497 ndr->depth--;
11498 ndr_print_ptr(ndr, "recordid", r->out.recordid);
11499 ndr->depth++;
11500 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid);
11501 ndr->depth--;
11502 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11503 ndr->depth--;
11505 ndr->depth--;
11508 static enum ndr_err_code ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r)
11510 if (flags & NDR_IN) {
11511 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11512 if (r->in.logon_server) {
11513 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11514 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11515 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11516 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));
11518 if (r->in.computername == NULL) {
11519 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11521 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11522 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11523 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11524 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11525 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11526 if (r->in.return_authenticator == NULL) {
11527 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11529 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11530 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reference));
11531 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11532 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize));
11533 if (r->in.recordid == NULL) {
11534 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11536 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid));
11538 if (flags & NDR_OUT) {
11539 if (r->out.return_authenticator == NULL) {
11540 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11542 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11543 if (r->out.buffer == NULL) {
11544 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11547 struct ndr_push *_ndr_buffer;
11548 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11549 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11550 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1));
11552 if (r->out.count_returned == NULL) {
11553 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11555 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned));
11556 if (r->out.total_entries == NULL) {
11557 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11559 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries));
11560 if (r->out.next_reference == NULL) {
11561 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11563 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.next_reference));
11564 if (r->out.recordid == NULL) {
11565 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11567 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11568 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
11570 return NDR_ERR_SUCCESS;
11573 static enum ndr_err_code ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r)
11575 uint32_t _ptr_logon_server;
11576 uint32_t size_logon_server_1 = 0;
11577 uint32_t length_logon_server_1 = 0;
11578 uint32_t size_computername_1 = 0;
11579 uint32_t length_computername_1 = 0;
11580 TALLOC_CTX *_mem_save_logon_server_0;
11581 TALLOC_CTX *_mem_save_return_authenticator_0;
11582 TALLOC_CTX *_mem_save_buffer_0;
11583 TALLOC_CTX *_mem_save_count_returned_0;
11584 TALLOC_CTX *_mem_save_total_entries_0;
11585 TALLOC_CTX *_mem_save_next_reference_0;
11586 TALLOC_CTX *_mem_save_recordid_0;
11587 if (flags & NDR_IN) {
11588 ZERO_STRUCT(r->out);
11590 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11591 if (_ptr_logon_server) {
11592 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11593 } else {
11594 r->in.logon_server = NULL;
11596 if (r->in.logon_server) {
11597 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11598 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11599 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11600 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11601 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
11602 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
11603 if (length_logon_server_1 > size_logon_server_1) {
11604 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
11606 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
11607 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
11608 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11610 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
11611 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
11612 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
11613 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
11614 if (length_computername_1 > size_computername_1) {
11615 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
11617 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
11618 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
11619 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11620 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11621 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
11623 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11624 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11625 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11626 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11627 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reference));
11628 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11629 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize));
11630 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11631 NDR_PULL_ALLOC(ndr, r->in.recordid);
11633 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11634 NDR_PULL_SET_MEM_CTX(ndr, r->in.recordid, LIBNDR_FLAG_REF_ALLOC);
11635 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid));
11636 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11637 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11638 *r->out.return_authenticator = *r->in.return_authenticator;
11639 NDR_PULL_ALLOC(ndr, r->out.buffer);
11640 ZERO_STRUCTP(r->out.buffer);
11641 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11642 ZERO_STRUCTP(r->out.count_returned);
11643 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11644 ZERO_STRUCTP(r->out.total_entries);
11645 NDR_PULL_ALLOC(ndr, r->out.next_reference);
11646 ZERO_STRUCTP(r->out.next_reference);
11647 NDR_PULL_ALLOC(ndr, r->out.recordid);
11648 *r->out.recordid = *r->in.recordid;
11650 if (flags & NDR_OUT) {
11651 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11652 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11654 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11655 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11656 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11657 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11658 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11659 NDR_PULL_ALLOC(ndr, r->out.buffer);
11661 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
11662 NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC);
11664 struct ndr_pull *_ndr_buffer;
11665 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11666 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11667 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1));
11669 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC);
11670 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11671 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11673 _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
11674 NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC);
11675 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned));
11676 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC);
11677 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11678 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11680 _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
11681 NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC);
11682 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries));
11683 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC);
11684 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11685 NDR_PULL_ALLOC(ndr, r->out.next_reference);
11687 _mem_save_next_reference_0 = NDR_PULL_GET_MEM_CTX(ndr);
11688 NDR_PULL_SET_MEM_CTX(ndr, r->out.next_reference, LIBNDR_FLAG_REF_ALLOC);
11689 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.next_reference));
11690 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_reference_0, LIBNDR_FLAG_REF_ALLOC);
11691 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11692 NDR_PULL_ALLOC(ndr, r->out.recordid);
11694 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11695 NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC);
11696 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11698 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
11700 return NDR_ERR_SUCCESS;
11703 _PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r)
11705 ndr_print_struct(ndr, name, "netr_AccountSync");
11706 ndr->depth++;
11707 if (flags & NDR_SET_VALUES) {
11708 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11710 if (flags & NDR_IN) {
11711 ndr_print_struct(ndr, "in", "netr_AccountSync");
11712 ndr->depth++;
11713 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11714 ndr->depth++;
11715 if (r->in.logon_server) {
11716 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11718 ndr->depth--;
11719 ndr_print_ptr(ndr, "computername", r->in.computername);
11720 ndr->depth++;
11721 ndr_print_string(ndr, "computername", r->in.computername);
11722 ndr->depth--;
11723 ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
11724 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11725 ndr->depth++;
11726 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11727 ndr->depth--;
11728 ndr_print_uint32(ndr, "reference", r->in.reference);
11729 ndr_print_uint32(ndr, "level", r->in.level);
11730 ndr_print_uint32(ndr, "buffersize", r->in.buffersize);
11731 ndr_print_ptr(ndr, "recordid", r->in.recordid);
11732 ndr->depth++;
11733 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->in.recordid);
11734 ndr->depth--;
11735 ndr->depth--;
11737 if (flags & NDR_OUT) {
11738 ndr_print_struct(ndr, "out", "netr_AccountSync");
11739 ndr->depth++;
11740 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11741 ndr->depth++;
11742 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11743 ndr->depth--;
11744 ndr_print_ptr(ndr, "buffer", r->out.buffer);
11745 ndr->depth++;
11746 ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer);
11747 ndr->depth--;
11748 ndr_print_ptr(ndr, "count_returned", r->out.count_returned);
11749 ndr->depth++;
11750 ndr_print_uint32(ndr, "count_returned", *r->out.count_returned);
11751 ndr->depth--;
11752 ndr_print_ptr(ndr, "total_entries", r->out.total_entries);
11753 ndr->depth++;
11754 ndr_print_uint32(ndr, "total_entries", *r->out.total_entries);
11755 ndr->depth--;
11756 ndr_print_ptr(ndr, "next_reference", r->out.next_reference);
11757 ndr->depth++;
11758 ndr_print_uint32(ndr, "next_reference", *r->out.next_reference);
11759 ndr->depth--;
11760 ndr_print_ptr(ndr, "recordid", r->out.recordid);
11761 ndr->depth++;
11762 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid);
11763 ndr->depth--;
11764 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11765 ndr->depth--;
11767 ndr->depth--;
11770 static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r)
11772 if (flags & NDR_IN) {
11773 if (r->in.logon_server == NULL) {
11774 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11776 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11777 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11778 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11779 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));
11780 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname));
11781 if (r->in.domainname) {
11782 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11783 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11784 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11785 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11788 if (flags & NDR_OUT) {
11789 if (r->out.dcname == NULL) {
11790 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11792 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
11793 if (*r->out.dcname) {
11794 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
11795 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11796 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
11797 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11799 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11801 return NDR_ERR_SUCCESS;
11804 static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r)
11806 uint32_t size_logon_server_1 = 0;
11807 uint32_t length_logon_server_1 = 0;
11808 uint32_t _ptr_domainname;
11809 uint32_t size_domainname_1 = 0;
11810 uint32_t length_domainname_1 = 0;
11811 uint32_t _ptr_dcname;
11812 uint32_t size_dcname_2 = 0;
11813 uint32_t length_dcname_2 = 0;
11814 TALLOC_CTX *_mem_save_domainname_0;
11815 TALLOC_CTX *_mem_save_dcname_0;
11816 TALLOC_CTX *_mem_save_dcname_1;
11817 if (flags & NDR_IN) {
11818 ZERO_STRUCT(r->out);
11820 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11821 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11822 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
11823 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
11824 if (length_logon_server_1 > size_logon_server_1) {
11825 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
11827 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
11828 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
11829 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname));
11830 if (_ptr_domainname) {
11831 NDR_PULL_ALLOC(ndr, r->in.domainname);
11832 } else {
11833 r->in.domainname = NULL;
11835 if (r->in.domainname) {
11836 _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11837 NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0);
11838 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname));
11839 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname));
11840 size_domainname_1 = ndr_get_array_size(ndr, &r->in.domainname);
11841 length_domainname_1 = ndr_get_array_length(ndr, &r->in.domainname);
11842 if (length_domainname_1 > size_domainname_1) {
11843 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domainname_1, length_domainname_1);
11845 NDR_CHECK(ndr_check_string_terminator(ndr, length_domainname_1, sizeof(uint16_t)));
11846 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, length_domainname_1, sizeof(uint16_t), CH_UTF16));
11847 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0);
11849 NDR_PULL_ALLOC(ndr, r->out.dcname);
11850 ZERO_STRUCTP(r->out.dcname);
11852 if (flags & NDR_OUT) {
11853 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11854 NDR_PULL_ALLOC(ndr, r->out.dcname);
11856 _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11857 NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
11858 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
11859 if (_ptr_dcname) {
11860 NDR_PULL_ALLOC(ndr, *r->out.dcname);
11861 } else {
11862 *r->out.dcname = NULL;
11864 if (*r->out.dcname) {
11865 _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
11866 NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
11867 NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
11868 NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
11869 size_dcname_2 = ndr_get_array_size(ndr, r->out.dcname);
11870 length_dcname_2 = ndr_get_array_length(ndr, r->out.dcname);
11871 if (length_dcname_2 > size_dcname_2) {
11872 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dcname_2, length_dcname_2);
11874 NDR_CHECK(ndr_check_string_terminator(ndr, length_dcname_2, sizeof(uint16_t)));
11875 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, length_dcname_2, sizeof(uint16_t), CH_UTF16));
11876 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
11878 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
11879 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11881 return NDR_ERR_SUCCESS;
11884 _PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r)
11886 ndr_print_struct(ndr, name, "netr_GetDcName");
11887 ndr->depth++;
11888 if (flags & NDR_SET_VALUES) {
11889 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11891 if (flags & NDR_IN) {
11892 ndr_print_struct(ndr, "in", "netr_GetDcName");
11893 ndr->depth++;
11894 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11895 ndr->depth++;
11896 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11897 ndr->depth--;
11898 ndr_print_ptr(ndr, "domainname", r->in.domainname);
11899 ndr->depth++;
11900 if (r->in.domainname) {
11901 ndr_print_string(ndr, "domainname", r->in.domainname);
11903 ndr->depth--;
11904 ndr->depth--;
11906 if (flags & NDR_OUT) {
11907 ndr_print_struct(ndr, "out", "netr_GetDcName");
11908 ndr->depth++;
11909 ndr_print_ptr(ndr, "dcname", r->out.dcname);
11910 ndr->depth++;
11911 ndr_print_ptr(ndr, "dcname", *r->out.dcname);
11912 ndr->depth++;
11913 if (*r->out.dcname) {
11914 ndr_print_string(ndr, "dcname", *r->out.dcname);
11916 ndr->depth--;
11917 ndr->depth--;
11918 ndr_print_WERROR(ndr, "result", r->out.result);
11919 ndr->depth--;
11921 ndr->depth--;
11924 static enum ndr_err_code ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r)
11926 if (flags & NDR_IN) {
11927 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11928 if (r->in.logon_server) {
11929 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11930 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11931 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11932 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));
11934 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
11935 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11937 if (flags & NDR_OUT) {
11938 if (r->out.query == NULL) {
11939 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11941 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
11942 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11943 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11945 return NDR_ERR_SUCCESS;
11948 static enum ndr_err_code ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r)
11950 uint32_t _ptr_logon_server;
11951 uint32_t size_logon_server_1 = 0;
11952 uint32_t length_logon_server_1 = 0;
11953 TALLOC_CTX *_mem_save_logon_server_0;
11954 TALLOC_CTX *_mem_save_query_0;
11955 if (flags & NDR_IN) {
11956 ZERO_STRUCT(r->out);
11958 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11959 if (_ptr_logon_server) {
11960 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11961 } else {
11962 r->in.logon_server = NULL;
11964 if (r->in.logon_server) {
11965 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11966 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11967 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11968 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11969 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
11970 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
11971 if (length_logon_server_1 > size_logon_server_1) {
11972 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
11974 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
11975 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
11976 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11978 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
11979 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11980 NDR_PULL_ALLOC(ndr, r->out.query);
11981 ZERO_STRUCTP(r->out.query);
11983 if (flags & NDR_OUT) {
11984 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11985 NDR_PULL_ALLOC(ndr, r->out.query);
11987 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
11988 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
11989 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
11990 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11991 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
11992 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11994 return NDR_ERR_SUCCESS;
11997 _PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r)
11999 ndr_print_struct(ndr, name, "netr_LogonControl");
12000 ndr->depth++;
12001 if (flags & NDR_SET_VALUES) {
12002 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12004 if (flags & NDR_IN) {
12005 ndr_print_struct(ndr, "in", "netr_LogonControl");
12006 ndr->depth++;
12007 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12008 ndr->depth++;
12009 if (r->in.logon_server) {
12010 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12012 ndr->depth--;
12013 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
12014 ndr_print_uint32(ndr, "level", r->in.level);
12015 ndr->depth--;
12017 if (flags & NDR_OUT) {
12018 ndr_print_struct(ndr, "out", "netr_LogonControl");
12019 ndr->depth++;
12020 ndr_print_ptr(ndr, "query", r->out.query);
12021 ndr->depth++;
12022 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
12023 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
12024 ndr->depth--;
12025 ndr_print_WERROR(ndr, "result", r->out.result);
12026 ndr->depth--;
12028 ndr->depth--;
12031 static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r)
12033 if (flags & NDR_IN) {
12034 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
12035 if (r->in.logon_server) {
12036 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12037 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12038 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12039 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));
12041 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname));
12042 if (r->in.domainname) {
12043 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
12044 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12045 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
12046 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12049 if (flags & NDR_OUT) {
12050 if (r->out.dcname == NULL) {
12051 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12053 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
12054 if (*r->out.dcname) {
12055 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
12056 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12057 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
12058 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12060 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12062 return NDR_ERR_SUCCESS;
12065 static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r)
12067 uint32_t _ptr_logon_server;
12068 uint32_t size_logon_server_1 = 0;
12069 uint32_t length_logon_server_1 = 0;
12070 uint32_t _ptr_domainname;
12071 uint32_t size_domainname_1 = 0;
12072 uint32_t length_domainname_1 = 0;
12073 uint32_t _ptr_dcname;
12074 uint32_t size_dcname_2 = 0;
12075 uint32_t length_dcname_2 = 0;
12076 TALLOC_CTX *_mem_save_logon_server_0;
12077 TALLOC_CTX *_mem_save_domainname_0;
12078 TALLOC_CTX *_mem_save_dcname_0;
12079 TALLOC_CTX *_mem_save_dcname_1;
12080 if (flags & NDR_IN) {
12081 ZERO_STRUCT(r->out);
12083 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
12084 if (_ptr_logon_server) {
12085 NDR_PULL_ALLOC(ndr, r->in.logon_server);
12086 } else {
12087 r->in.logon_server = NULL;
12089 if (r->in.logon_server) {
12090 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
12091 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
12092 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12093 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12094 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
12095 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
12096 if (length_logon_server_1 > size_logon_server_1) {
12097 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
12099 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
12100 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
12101 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
12103 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname));
12104 if (_ptr_domainname) {
12105 NDR_PULL_ALLOC(ndr, r->in.domainname);
12106 } else {
12107 r->in.domainname = NULL;
12109 if (r->in.domainname) {
12110 _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr);
12111 NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0);
12112 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname));
12113 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname));
12114 size_domainname_1 = ndr_get_array_size(ndr, &r->in.domainname);
12115 length_domainname_1 = ndr_get_array_length(ndr, &r->in.domainname);
12116 if (length_domainname_1 > size_domainname_1) {
12117 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domainname_1, length_domainname_1);
12119 NDR_CHECK(ndr_check_string_terminator(ndr, length_domainname_1, sizeof(uint16_t)));
12120 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, length_domainname_1, sizeof(uint16_t), CH_UTF16));
12121 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0);
12123 NDR_PULL_ALLOC(ndr, r->out.dcname);
12124 ZERO_STRUCTP(r->out.dcname);
12126 if (flags & NDR_OUT) {
12127 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12128 NDR_PULL_ALLOC(ndr, r->out.dcname);
12130 _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
12131 NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
12132 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
12133 if (_ptr_dcname) {
12134 NDR_PULL_ALLOC(ndr, *r->out.dcname);
12135 } else {
12136 *r->out.dcname = NULL;
12138 if (*r->out.dcname) {
12139 _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
12140 NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
12141 NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
12142 NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
12143 size_dcname_2 = ndr_get_array_size(ndr, r->out.dcname);
12144 length_dcname_2 = ndr_get_array_length(ndr, r->out.dcname);
12145 if (length_dcname_2 > size_dcname_2) {
12146 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dcname_2, length_dcname_2);
12148 NDR_CHECK(ndr_check_string_terminator(ndr, length_dcname_2, sizeof(uint16_t)));
12149 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, length_dcname_2, sizeof(uint16_t), CH_UTF16));
12150 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
12152 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
12153 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12155 return NDR_ERR_SUCCESS;
12158 _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r)
12160 ndr_print_struct(ndr, name, "netr_GetAnyDCName");
12161 ndr->depth++;
12162 if (flags & NDR_SET_VALUES) {
12163 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12165 if (flags & NDR_IN) {
12166 ndr_print_struct(ndr, "in", "netr_GetAnyDCName");
12167 ndr->depth++;
12168 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12169 ndr->depth++;
12170 if (r->in.logon_server) {
12171 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12173 ndr->depth--;
12174 ndr_print_ptr(ndr, "domainname", r->in.domainname);
12175 ndr->depth++;
12176 if (r->in.domainname) {
12177 ndr_print_string(ndr, "domainname", r->in.domainname);
12179 ndr->depth--;
12180 ndr->depth--;
12182 if (flags & NDR_OUT) {
12183 ndr_print_struct(ndr, "out", "netr_GetAnyDCName");
12184 ndr->depth++;
12185 ndr_print_ptr(ndr, "dcname", r->out.dcname);
12186 ndr->depth++;
12187 ndr_print_ptr(ndr, "dcname", *r->out.dcname);
12188 ndr->depth++;
12189 if (*r->out.dcname) {
12190 ndr_print_string(ndr, "dcname", *r->out.dcname);
12192 ndr->depth--;
12193 ndr->depth--;
12194 ndr_print_WERROR(ndr, "result", r->out.result);
12195 ndr->depth--;
12197 ndr->depth--;
12200 static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r)
12202 if (flags & NDR_IN) {
12203 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
12204 if (r->in.logon_server) {
12205 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12206 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12207 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12208 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));
12210 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
12211 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
12212 if (r->in.data == NULL) {
12213 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12215 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code));
12216 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12218 if (flags & NDR_OUT) {
12219 if (r->out.query == NULL) {
12220 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12222 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
12223 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
12224 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12226 return NDR_ERR_SUCCESS;
12229 static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r)
12231 uint32_t _ptr_logon_server;
12232 uint32_t size_logon_server_1 = 0;
12233 uint32_t length_logon_server_1 = 0;
12234 TALLOC_CTX *_mem_save_logon_server_0;
12235 TALLOC_CTX *_mem_save_data_0;
12236 TALLOC_CTX *_mem_save_query_0;
12237 if (flags & NDR_IN) {
12238 ZERO_STRUCT(r->out);
12240 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
12241 if (_ptr_logon_server) {
12242 NDR_PULL_ALLOC(ndr, r->in.logon_server);
12243 } else {
12244 r->in.logon_server = NULL;
12246 if (r->in.logon_server) {
12247 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
12248 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
12249 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12250 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12251 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
12252 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
12253 if (length_logon_server_1 > size_logon_server_1) {
12254 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
12256 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
12257 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
12258 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
12260 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
12261 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
12262 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12263 NDR_PULL_ALLOC(ndr, r->in.data);
12265 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
12266 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
12267 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code));
12268 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12269 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
12270 NDR_PULL_ALLOC(ndr, r->out.query);
12271 ZERO_STRUCTP(r->out.query);
12273 if (flags & NDR_OUT) {
12274 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12275 NDR_PULL_ALLOC(ndr, r->out.query);
12277 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
12278 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
12279 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
12280 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
12281 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
12282 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12284 return NDR_ERR_SUCCESS;
12287 _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r)
12289 ndr_print_struct(ndr, name, "netr_LogonControl2");
12290 ndr->depth++;
12291 if (flags & NDR_SET_VALUES) {
12292 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12294 if (flags & NDR_IN) {
12295 ndr_print_struct(ndr, "in", "netr_LogonControl2");
12296 ndr->depth++;
12297 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12298 ndr->depth++;
12299 if (r->in.logon_server) {
12300 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12302 ndr->depth--;
12303 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
12304 ndr_print_uint32(ndr, "level", r->in.level);
12305 ndr_print_ptr(ndr, "data", r->in.data);
12306 ndr->depth++;
12307 ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code);
12308 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data);
12309 ndr->depth--;
12310 ndr->depth--;
12312 if (flags & NDR_OUT) {
12313 ndr_print_struct(ndr, "out", "netr_LogonControl2");
12314 ndr->depth++;
12315 ndr_print_ptr(ndr, "query", r->out.query);
12316 ndr->depth++;
12317 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
12318 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
12319 ndr->depth--;
12320 ndr_print_WERROR(ndr, "result", r->out.result);
12321 ndr->depth--;
12323 ndr->depth--;
12326 static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r)
12328 if (flags & NDR_IN) {
12329 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
12330 if (r->in.server_name) {
12331 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12332 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12333 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12334 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));
12336 if (r->in.account_name == NULL) {
12337 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12339 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
12340 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12341 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
12342 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));
12343 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
12344 if (r->in.computer_name == NULL) {
12345 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12347 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
12348 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12349 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
12350 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));
12351 if (r->in.credentials == NULL) {
12352 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12354 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
12355 if (r->in.negotiate_flags == NULL) {
12356 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12358 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags));
12360 if (flags & NDR_OUT) {
12361 if (r->out.return_credentials == NULL) {
12362 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12364 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
12365 if (r->out.negotiate_flags == NULL) {
12366 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12368 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags));
12369 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12371 return NDR_ERR_SUCCESS;
12374 static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r)
12376 uint32_t _ptr_server_name;
12377 uint32_t size_server_name_1 = 0;
12378 uint32_t length_server_name_1 = 0;
12379 uint32_t size_account_name_1 = 0;
12380 uint32_t length_account_name_1 = 0;
12381 uint32_t size_computer_name_1 = 0;
12382 uint32_t length_computer_name_1 = 0;
12383 TALLOC_CTX *_mem_save_server_name_0;
12384 TALLOC_CTX *_mem_save_credentials_0;
12385 TALLOC_CTX *_mem_save_return_credentials_0;
12386 TALLOC_CTX *_mem_save_negotiate_flags_0;
12387 if (flags & NDR_IN) {
12388 ZERO_STRUCT(r->out);
12390 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
12391 if (_ptr_server_name) {
12392 NDR_PULL_ALLOC(ndr, r->in.server_name);
12393 } else {
12394 r->in.server_name = NULL;
12396 if (r->in.server_name) {
12397 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
12398 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
12399 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
12400 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
12401 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
12402 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
12403 if (length_server_name_1 > size_server_name_1) {
12404 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
12406 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
12407 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
12408 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
12410 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
12411 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
12412 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
12413 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
12414 if (length_account_name_1 > size_account_name_1) {
12415 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
12417 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
12418 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
12419 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
12420 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
12421 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
12422 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
12423 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
12424 if (length_computer_name_1 > size_computer_name_1) {
12425 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
12427 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
12428 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
12429 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12430 NDR_PULL_ALLOC(ndr, r->in.credentials);
12432 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
12433 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
12434 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
12435 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
12436 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12437 NDR_PULL_ALLOC(ndr, r->in.negotiate_flags);
12439 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
12440 NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
12441 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags));
12442 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
12443 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
12444 ZERO_STRUCTP(r->out.return_credentials);
12445 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
12446 *r->out.negotiate_flags = *r->in.negotiate_flags;
12448 if (flags & NDR_OUT) {
12449 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12450 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
12452 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
12453 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
12454 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
12455 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
12456 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12457 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
12459 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
12460 NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
12461 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags));
12462 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
12463 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12465 return NDR_ERR_SUCCESS;
12468 _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r)
12470 ndr_print_struct(ndr, name, "netr_ServerAuthenticate2");
12471 ndr->depth++;
12472 if (flags & NDR_SET_VALUES) {
12473 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12475 if (flags & NDR_IN) {
12476 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate2");
12477 ndr->depth++;
12478 ndr_print_ptr(ndr, "server_name", r->in.server_name);
12479 ndr->depth++;
12480 if (r->in.server_name) {
12481 ndr_print_string(ndr, "server_name", r->in.server_name);
12483 ndr->depth--;
12484 ndr_print_ptr(ndr, "account_name", r->in.account_name);
12485 ndr->depth++;
12486 ndr_print_string(ndr, "account_name", r->in.account_name);
12487 ndr->depth--;
12488 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
12489 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
12490 ndr->depth++;
12491 ndr_print_string(ndr, "computer_name", r->in.computer_name);
12492 ndr->depth--;
12493 ndr_print_ptr(ndr, "credentials", r->in.credentials);
12494 ndr->depth++;
12495 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
12496 ndr->depth--;
12497 ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags);
12498 ndr->depth++;
12499 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags);
12500 ndr->depth--;
12501 ndr->depth--;
12503 if (flags & NDR_OUT) {
12504 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2");
12505 ndr->depth++;
12506 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
12507 ndr->depth++;
12508 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
12509 ndr->depth--;
12510 ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags);
12511 ndr->depth++;
12512 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags);
12513 ndr->depth--;
12514 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12515 ndr->depth--;
12517 ndr->depth--;
12520 static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r)
12522 if (flags & NDR_IN) {
12523 if (r->in.logon_server == NULL) {
12524 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12526 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12527 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12528 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12529 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));
12530 if (r->in.computername == NULL) {
12531 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12533 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12534 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12535 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12536 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12537 if (r->in.credential == NULL) {
12538 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12540 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12541 if (r->in.return_authenticator == NULL) {
12542 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12544 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12545 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
12546 NDR_CHECK(ndr_push_SyncStateEnum(ndr, NDR_SCALARS, r->in.restart_state));
12547 if (r->in.sync_context == NULL) {
12548 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12550 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context));
12551 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
12553 if (flags & NDR_OUT) {
12554 if (r->out.return_authenticator == NULL) {
12555 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12557 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12558 if (r->out.sync_context == NULL) {
12559 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12561 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
12562 if (r->out.delta_enum_array == NULL) {
12563 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12565 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
12566 if (*r->out.delta_enum_array) {
12567 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12569 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12571 return NDR_ERR_SUCCESS;
12574 static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r)
12576 uint32_t size_logon_server_1 = 0;
12577 uint32_t length_logon_server_1 = 0;
12578 uint32_t size_computername_1 = 0;
12579 uint32_t length_computername_1 = 0;
12580 uint32_t _ptr_delta_enum_array;
12581 TALLOC_CTX *_mem_save_credential_0;
12582 TALLOC_CTX *_mem_save_return_authenticator_0;
12583 TALLOC_CTX *_mem_save_sync_context_0;
12584 TALLOC_CTX *_mem_save_delta_enum_array_0;
12585 TALLOC_CTX *_mem_save_delta_enum_array_1;
12586 if (flags & NDR_IN) {
12587 ZERO_STRUCT(r->out);
12589 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12590 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12591 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
12592 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
12593 if (length_logon_server_1 > size_logon_server_1) {
12594 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
12596 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
12597 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
12598 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
12599 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
12600 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
12601 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
12602 if (length_computername_1 > size_computername_1) {
12603 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
12605 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
12606 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
12607 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12608 NDR_PULL_ALLOC(ndr, r->in.credential);
12610 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
12611 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
12612 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12613 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
12614 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12615 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
12617 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12618 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12619 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12620 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12621 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
12622 NDR_CHECK(ndr_pull_SyncStateEnum(ndr, NDR_SCALARS, &r->in.restart_state));
12623 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12624 NDR_PULL_ALLOC(ndr, r->in.sync_context);
12626 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
12627 NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC);
12628 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context));
12629 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
12630 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
12631 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12632 *r->out.return_authenticator = *r->in.return_authenticator;
12633 NDR_PULL_ALLOC(ndr, r->out.sync_context);
12634 *r->out.sync_context = *r->in.sync_context;
12635 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12636 ZERO_STRUCTP(r->out.delta_enum_array);
12638 if (flags & NDR_OUT) {
12639 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12640 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12642 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12643 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12644 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12645 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12646 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12647 NDR_PULL_ALLOC(ndr, r->out.sync_context);
12649 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
12650 NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
12651 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
12652 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
12653 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12654 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12656 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
12657 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
12658 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
12659 if (_ptr_delta_enum_array) {
12660 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
12661 } else {
12662 *r->out.delta_enum_array = NULL;
12664 if (*r->out.delta_enum_array) {
12665 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
12666 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
12667 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12668 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
12670 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
12671 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12673 return NDR_ERR_SUCCESS;
12676 _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r)
12678 ndr_print_struct(ndr, name, "netr_DatabaseSync2");
12679 ndr->depth++;
12680 if (flags & NDR_SET_VALUES) {
12681 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12683 if (flags & NDR_IN) {
12684 ndr_print_struct(ndr, "in", "netr_DatabaseSync2");
12685 ndr->depth++;
12686 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12687 ndr->depth++;
12688 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12689 ndr->depth--;
12690 ndr_print_ptr(ndr, "computername", r->in.computername);
12691 ndr->depth++;
12692 ndr_print_string(ndr, "computername", r->in.computername);
12693 ndr->depth--;
12694 ndr_print_ptr(ndr, "credential", r->in.credential);
12695 ndr->depth++;
12696 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
12697 ndr->depth--;
12698 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
12699 ndr->depth++;
12700 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
12701 ndr->depth--;
12702 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
12703 ndr_print_SyncStateEnum(ndr, "restart_state", r->in.restart_state);
12704 ndr_print_ptr(ndr, "sync_context", r->in.sync_context);
12705 ndr->depth++;
12706 ndr_print_uint32(ndr, "sync_context", *r->in.sync_context);
12707 ndr->depth--;
12708 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
12709 ndr->depth--;
12711 if (flags & NDR_OUT) {
12712 ndr_print_struct(ndr, "out", "netr_DatabaseSync2");
12713 ndr->depth++;
12714 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
12715 ndr->depth++;
12716 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
12717 ndr->depth--;
12718 ndr_print_ptr(ndr, "sync_context", r->out.sync_context);
12719 ndr->depth++;
12720 ndr_print_uint32(ndr, "sync_context", *r->out.sync_context);
12721 ndr->depth--;
12722 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
12723 ndr->depth++;
12724 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
12725 ndr->depth++;
12726 if (*r->out.delta_enum_array) {
12727 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
12729 ndr->depth--;
12730 ndr->depth--;
12731 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12732 ndr->depth--;
12734 ndr->depth--;
12737 static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r)
12739 if (flags & NDR_IN) {
12740 if (r->in.logon_server == NULL) {
12741 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12743 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12744 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12745 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12746 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));
12747 if (r->in.computername == NULL) {
12748 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12750 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12751 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12752 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12753 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12754 if (r->in.credential == NULL) {
12755 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12757 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12758 if (r->in.return_authenticator == NULL) {
12759 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12761 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12763 struct ndr_push *_ndr_change_log_entry;
12764 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->iconv_convenience, ndr->flags)));
12765 NDR_CHECK(ndr_push_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry));
12766 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->iconv_convenience, ndr->flags)));
12768 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->iconv_convenience, ndr->flags)));
12770 if (flags & NDR_OUT) {
12771 if (r->out.return_authenticator == NULL) {
12772 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12774 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12775 if (r->out.delta_enum_array == NULL) {
12776 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12778 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
12779 if (*r->out.delta_enum_array) {
12780 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12782 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12784 return NDR_ERR_SUCCESS;
12787 static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r)
12789 uint32_t size_logon_server_1 = 0;
12790 uint32_t length_logon_server_1 = 0;
12791 uint32_t size_computername_1 = 0;
12792 uint32_t length_computername_1 = 0;
12793 uint32_t _ptr_delta_enum_array;
12794 TALLOC_CTX *_mem_save_credential_0;
12795 TALLOC_CTX *_mem_save_return_authenticator_0;
12796 TALLOC_CTX *_mem_save_delta_enum_array_0;
12797 TALLOC_CTX *_mem_save_delta_enum_array_1;
12798 if (flags & NDR_IN) {
12799 ZERO_STRUCT(r->out);
12801 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12802 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12803 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
12804 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
12805 if (length_logon_server_1 > size_logon_server_1) {
12806 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
12808 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
12809 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
12810 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
12811 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
12812 size_computername_1 = ndr_get_array_size(ndr, &r->in.computername);
12813 length_computername_1 = ndr_get_array_length(ndr, &r->in.computername);
12814 if (length_computername_1 > size_computername_1) {
12815 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computername_1, length_computername_1);
12817 NDR_CHECK(ndr_check_string_terminator(ndr, length_computername_1, sizeof(uint16_t)));
12818 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, length_computername_1, sizeof(uint16_t), CH_UTF16));
12819 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12820 NDR_PULL_ALLOC(ndr, r->in.credential);
12822 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
12823 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
12824 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12825 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
12826 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12827 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
12829 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12830 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12831 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12832 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12834 struct ndr_pull *_ndr_change_log_entry;
12835 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_change_log_entry, 4, r->in.change_log_entry_size));
12836 NDR_CHECK(ndr_pull_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry));
12837 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_change_log_entry, 4, r->in.change_log_entry_size));
12839 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size));
12840 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12841 *r->out.return_authenticator = *r->in.return_authenticator;
12842 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12843 ZERO_STRUCTP(r->out.delta_enum_array);
12845 if (flags & NDR_OUT) {
12846 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12847 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12849 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12850 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12851 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12852 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12853 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12854 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12856 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
12857 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
12858 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
12859 if (_ptr_delta_enum_array) {
12860 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
12861 } else {
12862 *r->out.delta_enum_array = NULL;
12864 if (*r->out.delta_enum_array) {
12865 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
12866 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
12867 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12868 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
12870 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
12871 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12873 return NDR_ERR_SUCCESS;
12876 _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r)
12878 ndr_print_struct(ndr, name, "netr_DatabaseRedo");
12879 ndr->depth++;
12880 if (flags & NDR_SET_VALUES) {
12881 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12883 if (flags & NDR_IN) {
12884 ndr_print_struct(ndr, "in", "netr_DatabaseRedo");
12885 ndr->depth++;
12886 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12887 ndr->depth++;
12888 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12889 ndr->depth--;
12890 ndr_print_ptr(ndr, "computername", r->in.computername);
12891 ndr->depth++;
12892 ndr_print_string(ndr, "computername", r->in.computername);
12893 ndr->depth--;
12894 ndr_print_ptr(ndr, "credential", r->in.credential);
12895 ndr->depth++;
12896 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
12897 ndr->depth--;
12898 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
12899 ndr->depth++;
12900 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
12901 ndr->depth--;
12902 ndr_print_netr_ChangeLogEntry(ndr, "change_log_entry", &r->in.change_log_entry);
12903 ndr_print_uint32(ndr, "change_log_entry_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->iconv_convenience, ndr->flags):r->in.change_log_entry_size);
12904 ndr->depth--;
12906 if (flags & NDR_OUT) {
12907 ndr_print_struct(ndr, "out", "netr_DatabaseRedo");
12908 ndr->depth++;
12909 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
12910 ndr->depth++;
12911 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
12912 ndr->depth--;
12913 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
12914 ndr->depth++;
12915 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
12916 ndr->depth++;
12917 if (*r->out.delta_enum_array) {
12918 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
12920 ndr->depth--;
12921 ndr->depth--;
12922 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12923 ndr->depth--;
12925 ndr->depth--;
12928 static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r)
12930 if (flags & NDR_IN) {
12931 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
12932 if (r->in.logon_server) {
12933 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12934 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12935 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12936 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));
12938 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
12939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
12940 if (r->in.data == NULL) {
12941 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12943 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code));
12944 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12946 if (flags & NDR_OUT) {
12947 if (r->out.query == NULL) {
12948 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12950 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
12951 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
12952 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12954 return NDR_ERR_SUCCESS;
12957 static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r)
12959 uint32_t _ptr_logon_server;
12960 uint32_t size_logon_server_1 = 0;
12961 uint32_t length_logon_server_1 = 0;
12962 TALLOC_CTX *_mem_save_logon_server_0;
12963 TALLOC_CTX *_mem_save_data_0;
12964 TALLOC_CTX *_mem_save_query_0;
12965 if (flags & NDR_IN) {
12966 ZERO_STRUCT(r->out);
12968 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
12969 if (_ptr_logon_server) {
12970 NDR_PULL_ALLOC(ndr, r->in.logon_server);
12971 } else {
12972 r->in.logon_server = NULL;
12974 if (r->in.logon_server) {
12975 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
12976 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
12977 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12978 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12979 size_logon_server_1 = ndr_get_array_size(ndr, &r->in.logon_server);
12980 length_logon_server_1 = ndr_get_array_length(ndr, &r->in.logon_server);
12981 if (length_logon_server_1 > size_logon_server_1) {
12982 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_logon_server_1, length_logon_server_1);
12984 NDR_CHECK(ndr_check_string_terminator(ndr, length_logon_server_1, sizeof(uint16_t)));
12985 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, length_logon_server_1, sizeof(uint16_t), CH_UTF16));
12986 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
12988 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
12989 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
12990 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12991 NDR_PULL_ALLOC(ndr, r->in.data);
12993 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
12994 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
12995 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code));
12996 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12997 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
12998 NDR_PULL_ALLOC(ndr, r->out.query);
12999 ZERO_STRUCTP(r->out.query);
13001 if (flags & NDR_OUT) {
13002 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13003 NDR_PULL_ALLOC(ndr, r->out.query);
13005 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
13006 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
13007 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
13008 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
13009 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
13010 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13012 return NDR_ERR_SUCCESS;
13015 _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r)
13017 ndr_print_struct(ndr, name, "netr_LogonControl2Ex");
13018 ndr->depth++;
13019 if (flags & NDR_SET_VALUES) {
13020 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13022 if (flags & NDR_IN) {
13023 ndr_print_struct(ndr, "in", "netr_LogonControl2Ex");
13024 ndr->depth++;
13025 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
13026 ndr->depth++;
13027 if (r->in.logon_server) {
13028 ndr_print_string(ndr, "logon_server", r->in.logon_server);
13030 ndr->depth--;
13031 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
13032 ndr_print_uint32(ndr, "level", r->in.level);
13033 ndr_print_ptr(ndr, "data", r->in.data);
13034 ndr->depth++;
13035 ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code);
13036 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data);
13037 ndr->depth--;
13038 ndr->depth--;
13040 if (flags & NDR_OUT) {
13041 ndr_print_struct(ndr, "out", "netr_LogonControl2Ex");
13042 ndr->depth++;
13043 ndr_print_ptr(ndr, "query", r->out.query);
13044 ndr->depth++;
13045 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
13046 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
13047 ndr->depth--;
13048 ndr_print_WERROR(ndr, "result", r->out.result);
13049 ndr->depth--;
13051 ndr->depth--;
13054 static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
13056 if (flags & NDR_IN) {
13057 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
13058 if (r->in.server_name) {
13059 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13060 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13061 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13062 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));
13065 if (flags & NDR_OUT) {
13066 if (r->out.trusted_domains_blob == NULL) {
13067 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13069 NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
13070 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13072 return NDR_ERR_SUCCESS;
13075 static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r)
13077 uint32_t _ptr_server_name;
13078 uint32_t size_server_name_1 = 0;
13079 uint32_t length_server_name_1 = 0;
13080 TALLOC_CTX *_mem_save_server_name_0;
13081 TALLOC_CTX *_mem_save_trusted_domains_blob_0;
13082 if (flags & NDR_IN) {
13083 ZERO_STRUCT(r->out);
13085 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
13086 if (_ptr_server_name) {
13087 NDR_PULL_ALLOC(ndr, r->in.server_name);
13088 } else {
13089 r->in.server_name = NULL;
13091 if (r->in.server_name) {
13092 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13093 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
13094 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13095 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13096 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
13097 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
13098 if (length_server_name_1 > size_server_name_1) {
13099 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
13101 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
13102 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
13103 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
13105 NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
13106 ZERO_STRUCTP(r->out.trusted_domains_blob);
13108 if (flags & NDR_OUT) {
13109 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13110 NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
13112 _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
13113 NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC);
13114 NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
13115 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC);
13116 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13118 return NDR_ERR_SUCCESS;
13121 _PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
13123 ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains");
13124 ndr->depth++;
13125 if (flags & NDR_SET_VALUES) {
13126 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13128 if (flags & NDR_IN) {
13129 ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains");
13130 ndr->depth++;
13131 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13132 ndr->depth++;
13133 if (r->in.server_name) {
13134 ndr_print_string(ndr, "server_name", r->in.server_name);
13136 ndr->depth--;
13137 ndr->depth--;
13139 if (flags & NDR_OUT) {
13140 ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains");
13141 ndr->depth++;
13142 ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
13143 ndr->depth++;
13144 ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
13145 ndr->depth--;
13146 ndr_print_WERROR(ndr, "result", r->out.result);
13147 ndr->depth--;
13149 ndr->depth--;
13152 static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r)
13154 if (flags & NDR_IN) {
13155 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
13156 if (r->in.server_unc) {
13157 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
13158 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13159 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
13160 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));
13162 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
13163 if (r->in.domain_name) {
13164 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13165 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13166 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13167 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));
13169 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
13170 if (r->in.domain_guid) {
13171 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
13173 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_guid));
13174 if (r->in.site_guid) {
13175 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.site_guid));
13177 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
13179 if (flags & NDR_OUT) {
13180 if (r->out.info == NULL) {
13181 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13183 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
13184 if (*r->out.info) {
13185 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
13187 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13189 return NDR_ERR_SUCCESS;
13192 static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r)
13194 uint32_t _ptr_server_unc;
13195 uint32_t size_server_unc_1 = 0;
13196 uint32_t length_server_unc_1 = 0;
13197 uint32_t _ptr_domain_name;
13198 uint32_t size_domain_name_1 = 0;
13199 uint32_t length_domain_name_1 = 0;
13200 uint32_t _ptr_domain_guid;
13201 uint32_t _ptr_site_guid;
13202 uint32_t _ptr_info;
13203 TALLOC_CTX *_mem_save_server_unc_0;
13204 TALLOC_CTX *_mem_save_domain_name_0;
13205 TALLOC_CTX *_mem_save_domain_guid_0;
13206 TALLOC_CTX *_mem_save_site_guid_0;
13207 TALLOC_CTX *_mem_save_info_0;
13208 TALLOC_CTX *_mem_save_info_1;
13209 if (flags & NDR_IN) {
13210 ZERO_STRUCT(r->out);
13212 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
13213 if (_ptr_server_unc) {
13214 NDR_PULL_ALLOC(ndr, r->in.server_unc);
13215 } else {
13216 r->in.server_unc = NULL;
13218 if (r->in.server_unc) {
13219 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
13220 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
13221 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
13222 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
13223 size_server_unc_1 = ndr_get_array_size(ndr, &r->in.server_unc);
13224 length_server_unc_1 = ndr_get_array_length(ndr, &r->in.server_unc);
13225 if (length_server_unc_1 > size_server_unc_1) {
13226 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_unc_1, length_server_unc_1);
13228 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_unc_1, sizeof(uint16_t)));
13229 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, length_server_unc_1, sizeof(uint16_t), CH_UTF16));
13230 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
13232 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
13233 if (_ptr_domain_name) {
13234 NDR_PULL_ALLOC(ndr, r->in.domain_name);
13235 } else {
13236 r->in.domain_name = NULL;
13238 if (r->in.domain_name) {
13239 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13240 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
13241 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
13242 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
13243 size_domain_name_1 = ndr_get_array_size(ndr, &r->in.domain_name);
13244 length_domain_name_1 = ndr_get_array_length(ndr, &r->in.domain_name);
13245 if (length_domain_name_1 > size_domain_name_1) {
13246 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
13248 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint16_t)));
13249 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, length_domain_name_1, sizeof(uint16_t), CH_UTF16));
13250 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
13252 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
13253 if (_ptr_domain_guid) {
13254 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
13255 } else {
13256 r->in.domain_guid = NULL;
13258 if (r->in.domain_guid) {
13259 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13260 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
13261 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
13262 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
13264 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_guid));
13265 if (_ptr_site_guid) {
13266 NDR_PULL_ALLOC(ndr, r->in.site_guid);
13267 } else {
13268 r->in.site_guid = NULL;
13270 if (r->in.site_guid) {
13271 _mem_save_site_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13272 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_guid, 0);
13273 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.site_guid));
13274 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0);
13276 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
13277 NDR_PULL_ALLOC(ndr, r->out.info);
13278 ZERO_STRUCTP(r->out.info);
13280 if (flags & NDR_OUT) {
13281 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13282 NDR_PULL_ALLOC(ndr, r->out.info);
13284 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13285 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
13286 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
13287 if (_ptr_info) {
13288 NDR_PULL_ALLOC(ndr, *r->out.info);
13289 } else {
13290 *r->out.info = NULL;
13292 if (*r->out.info) {
13293 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
13294 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
13295 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
13296 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
13298 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
13299 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13301 return NDR_ERR_SUCCESS;
13304 _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r)
13306 ndr_print_struct(ndr, name, "netr_DsRGetDCName");
13307 ndr->depth++;
13308 if (flags & NDR_SET_VALUES) {
13309 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13311 if (flags & NDR_IN) {
13312 ndr_print_struct(ndr, "in", "netr_DsRGetDCName");
13313 ndr->depth++;
13314 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
13315 ndr->depth++;
13316 if (r->in.server_unc) {
13317 ndr_print_string(ndr, "server_unc", r->in.server_unc);
13319 ndr->depth--;
13320 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
13321 ndr->depth++;
13322 if (r->in.domain_name) {
13323 ndr_print_string(ndr, "domain_name", r->in.domain_name);
13325 ndr->depth--;
13326 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
13327 ndr->depth++;
13328 if (r->in.domain_guid) {
13329 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
13331 ndr->depth--;
13332 ndr_print_ptr(ndr, "site_guid", r->in.site_guid);
13333 ndr->depth++;
13334 if (r->in.site_guid) {
13335 ndr_print_GUID(ndr, "site_guid", r->in.site_guid);
13337 ndr->depth--;
13338 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
13339 ndr->depth--;
13341 if (flags & NDR_OUT) {
13342 ndr_print_struct(ndr, "out", "netr_DsRGetDCName");
13343 ndr->depth++;
13344 ndr_print_ptr(ndr, "info", r->out.info);
13345 ndr->depth++;
13346 ndr_print_ptr(ndr, "info", *r->out.info);
13347 ndr->depth++;
13348 if (*r->out.info) {
13349 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
13351 ndr->depth--;
13352 ndr->depth--;
13353 ndr_print_WERROR(ndr, "result", r->out.result);
13354 ndr->depth--;
13356 ndr->depth--;
13359 static enum ndr_err_code ndr_push_netr_LogonGetCapabilities(struct ndr_push *ndr, int flags, const struct netr_LogonGetCapabilities *r)
13361 if (flags & NDR_IN) {
13362 if (r->in.server_name == NULL) {
13363 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13365 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13366 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13367 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13368 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));
13369 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
13370 if (r->in.computer_name) {
13371 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13372 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13373 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13374 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));
13376 if (r->in.credential == NULL) {
13377 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13379 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
13380 if (r->in.return_authenticator == NULL) {
13381 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13383 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
13384 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.query_level));
13386 if (flags & NDR_OUT) {
13387 if (r->out.return_authenticator == NULL) {
13388 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13390 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
13391 if (r->out.capabilities == NULL) {
13392 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13394 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.capabilities, r->in.query_level));
13395 NDR_CHECK(ndr_push_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities));
13396 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
13398 return NDR_ERR_SUCCESS;
13401 static enum ndr_err_code ndr_pull_netr_LogonGetCapabilities(struct ndr_pull *ndr, int flags, struct netr_LogonGetCapabilities *r)
13403 uint32_t size_server_name_1 = 0;
13404 uint32_t length_server_name_1 = 0;
13405 uint32_t _ptr_computer_name;
13406 uint32_t size_computer_name_1 = 0;
13407 uint32_t length_computer_name_1 = 0;
13408 TALLOC_CTX *_mem_save_computer_name_0;
13409 TALLOC_CTX *_mem_save_credential_0;
13410 TALLOC_CTX *_mem_save_return_authenticator_0;
13411 TALLOC_CTX *_mem_save_capabilities_0;
13412 if (flags & NDR_IN) {
13413 ZERO_STRUCT(r->out);
13415 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13416 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13417 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
13418 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
13419 if (length_server_name_1 > size_server_name_1) {
13420 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
13422 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
13423 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
13424 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
13425 if (_ptr_computer_name) {
13426 NDR_PULL_ALLOC(ndr, r->in.computer_name);
13427 } else {
13428 r->in.computer_name = NULL;
13430 if (r->in.computer_name) {
13431 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13432 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
13433 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
13434 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
13435 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
13436 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
13437 if (length_computer_name_1 > size_computer_name_1) {
13438 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
13440 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
13441 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
13442 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
13444 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13445 NDR_PULL_ALLOC(ndr, r->in.credential);
13447 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
13448 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
13449 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
13450 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
13451 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13452 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
13454 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
13455 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
13456 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
13457 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
13458 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.query_level));
13459 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
13460 *r->out.return_authenticator = *r->in.return_authenticator;
13461 NDR_PULL_ALLOC(ndr, r->out.capabilities);
13462 ZERO_STRUCTP(r->out.capabilities);
13464 if (flags & NDR_OUT) {
13465 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13466 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
13468 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
13469 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
13470 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
13471 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
13472 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13473 NDR_PULL_ALLOC(ndr, r->out.capabilities);
13475 _mem_save_capabilities_0 = NDR_PULL_GET_MEM_CTX(ndr);
13476 NDR_PULL_SET_MEM_CTX(ndr, r->out.capabilities, LIBNDR_FLAG_REF_ALLOC);
13477 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.capabilities, r->in.query_level));
13478 NDR_CHECK(ndr_pull_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities));
13479 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_capabilities_0, LIBNDR_FLAG_REF_ALLOC);
13480 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
13482 return NDR_ERR_SUCCESS;
13485 _PUBLIC_ void ndr_print_netr_LogonGetCapabilities(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetCapabilities *r)
13487 ndr_print_struct(ndr, name, "netr_LogonGetCapabilities");
13488 ndr->depth++;
13489 if (flags & NDR_SET_VALUES) {
13490 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13492 if (flags & NDR_IN) {
13493 ndr_print_struct(ndr, "in", "netr_LogonGetCapabilities");
13494 ndr->depth++;
13495 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13496 ndr->depth++;
13497 ndr_print_string(ndr, "server_name", r->in.server_name);
13498 ndr->depth--;
13499 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
13500 ndr->depth++;
13501 if (r->in.computer_name) {
13502 ndr_print_string(ndr, "computer_name", r->in.computer_name);
13504 ndr->depth--;
13505 ndr_print_ptr(ndr, "credential", r->in.credential);
13506 ndr->depth++;
13507 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
13508 ndr->depth--;
13509 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
13510 ndr->depth++;
13511 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
13512 ndr->depth--;
13513 ndr_print_uint32(ndr, "query_level", r->in.query_level);
13514 ndr->depth--;
13516 if (flags & NDR_OUT) {
13517 ndr_print_struct(ndr, "out", "netr_LogonGetCapabilities");
13518 ndr->depth++;
13519 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
13520 ndr->depth++;
13521 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
13522 ndr->depth--;
13523 ndr_print_ptr(ndr, "capabilities", r->out.capabilities);
13524 ndr->depth++;
13525 ndr_print_set_switch_value(ndr, r->out.capabilities, r->in.query_level);
13526 ndr_print_netr_Capabilities(ndr, "capabilities", r->out.capabilities);
13527 ndr->depth--;
13528 ndr_print_NTSTATUS(ndr, "result", r->out.result);
13529 ndr->depth--;
13531 ndr->depth--;
13534 static enum ndr_err_code ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
13536 if (flags & NDR_IN) {
13538 if (flags & NDR_OUT) {
13539 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13541 return NDR_ERR_SUCCESS;
13544 static enum ndr_err_code ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r)
13546 if (flags & NDR_IN) {
13548 if (flags & NDR_OUT) {
13549 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13551 return NDR_ERR_SUCCESS;
13554 _PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
13556 ndr_print_struct(ndr, name, "netr_NETRLOGONSETSERVICEBITS");
13557 ndr->depth++;
13558 if (flags & NDR_SET_VALUES) {
13559 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13561 if (flags & NDR_IN) {
13562 ndr_print_struct(ndr, "in", "netr_NETRLOGONSETSERVICEBITS");
13563 ndr->depth++;
13564 ndr->depth--;
13566 if (flags & NDR_OUT) {
13567 ndr_print_struct(ndr, "out", "netr_NETRLOGONSETSERVICEBITS");
13568 ndr->depth++;
13569 ndr_print_WERROR(ndr, "result", r->out.result);
13570 ndr->depth--;
13572 ndr->depth--;
13575 static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r)
13577 if (flags & NDR_IN) {
13578 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
13579 if (r->in.server_name) {
13580 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13581 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13582 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13583 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));
13585 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
13586 if (r->in.domain_name) {
13587 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13588 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13589 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13590 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));
13593 if (flags & NDR_OUT) {
13594 if (r->out.rid == NULL) {
13595 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13597 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
13598 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13600 return NDR_ERR_SUCCESS;
13603 static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r)
13605 uint32_t _ptr_server_name;
13606 uint32_t size_server_name_1 = 0;
13607 uint32_t length_server_name_1 = 0;
13608 uint32_t _ptr_domain_name;
13609 uint32_t size_domain_name_1 = 0;
13610 uint32_t length_domain_name_1 = 0;
13611 TALLOC_CTX *_mem_save_server_name_0;
13612 TALLOC_CTX *_mem_save_domain_name_0;
13613 TALLOC_CTX *_mem_save_rid_0;
13614 if (flags & NDR_IN) {
13615 ZERO_STRUCT(r->out);
13617 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
13618 if (_ptr_server_name) {
13619 NDR_PULL_ALLOC(ndr, r->in.server_name);
13620 } else {
13621 r->in.server_name = NULL;
13623 if (r->in.server_name) {
13624 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13625 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
13626 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13627 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13628 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
13629 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
13630 if (length_server_name_1 > size_server_name_1) {
13631 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
13633 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
13634 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
13635 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
13637 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
13638 if (_ptr_domain_name) {
13639 NDR_PULL_ALLOC(ndr, r->in.domain_name);
13640 } else {
13641 r->in.domain_name = NULL;
13643 if (r->in.domain_name) {
13644 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13645 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
13646 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
13647 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
13648 size_domain_name_1 = ndr_get_array_size(ndr, &r->in.domain_name);
13649 length_domain_name_1 = ndr_get_array_length(ndr, &r->in.domain_name);
13650 if (length_domain_name_1 > size_domain_name_1) {
13651 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
13653 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint16_t)));
13654 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, length_domain_name_1, sizeof(uint16_t), CH_UTF16));
13655 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
13657 NDR_PULL_ALLOC(ndr, r->out.rid);
13658 ZERO_STRUCTP(r->out.rid);
13660 if (flags & NDR_OUT) {
13661 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13662 NDR_PULL_ALLOC(ndr, r->out.rid);
13664 _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13665 NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC);
13666 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid));
13667 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
13668 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13670 return NDR_ERR_SUCCESS;
13673 _PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r)
13675 ndr_print_struct(ndr, name, "netr_LogonGetTrustRid");
13676 ndr->depth++;
13677 if (flags & NDR_SET_VALUES) {
13678 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13680 if (flags & NDR_IN) {
13681 ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid");
13682 ndr->depth++;
13683 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13684 ndr->depth++;
13685 if (r->in.server_name) {
13686 ndr_print_string(ndr, "server_name", r->in.server_name);
13688 ndr->depth--;
13689 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
13690 ndr->depth++;
13691 if (r->in.domain_name) {
13692 ndr_print_string(ndr, "domain_name", r->in.domain_name);
13694 ndr->depth--;
13695 ndr->depth--;
13697 if (flags & NDR_OUT) {
13698 ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid");
13699 ndr->depth++;
13700 ndr_print_ptr(ndr, "rid", r->out.rid);
13701 ndr->depth++;
13702 ndr_print_uint32(ndr, "rid", *r->out.rid);
13703 ndr->depth--;
13704 ndr_print_WERROR(ndr, "result", r->out.result);
13705 ndr->depth--;
13707 ndr->depth--;
13710 static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13712 if (flags & NDR_IN) {
13714 if (flags & NDR_OUT) {
13715 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13717 return NDR_ERR_SUCCESS;
13720 static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13722 if (flags & NDR_IN) {
13724 if (flags & NDR_OUT) {
13725 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13727 return NDR_ERR_SUCCESS;
13730 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13732 ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTESERVERDIGEST");
13733 ndr->depth++;
13734 if (flags & NDR_SET_VALUES) {
13735 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13737 if (flags & NDR_IN) {
13738 ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST");
13739 ndr->depth++;
13740 ndr->depth--;
13742 if (flags & NDR_OUT) {
13743 ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST");
13744 ndr->depth++;
13745 ndr_print_WERROR(ndr, "result", r->out.result);
13746 ndr->depth--;
13748 ndr->depth--;
13751 static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13753 if (flags & NDR_IN) {
13755 if (flags & NDR_OUT) {
13756 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13758 return NDR_ERR_SUCCESS;
13761 static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13763 if (flags & NDR_IN) {
13765 if (flags & NDR_OUT) {
13766 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13768 return NDR_ERR_SUCCESS;
13771 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13773 ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13774 ndr->depth++;
13775 if (flags & NDR_SET_VALUES) {
13776 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13778 if (flags & NDR_IN) {
13779 ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13780 ndr->depth++;
13781 ndr->depth--;
13783 if (flags & NDR_OUT) {
13784 ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13785 ndr->depth++;
13786 ndr_print_WERROR(ndr, "result", r->out.result);
13787 ndr->depth--;
13789 ndr->depth--;
13792 _PUBLIC_ enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r)
13794 if (flags & NDR_IN) {
13795 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
13796 if (r->in.server_name) {
13797 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13798 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13799 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13800 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));
13802 if (r->in.account_name == NULL) {
13803 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13805 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
13806 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13807 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
13808 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));
13809 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
13810 if (r->in.computer_name == NULL) {
13811 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13813 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13814 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13815 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13816 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));
13817 if (r->in.credentials == NULL) {
13818 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13820 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
13821 if (r->in.negotiate_flags == NULL) {
13822 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13824 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags));
13826 if (flags & NDR_OUT) {
13827 if (r->out.return_credentials == NULL) {
13828 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13830 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
13831 if (r->out.negotiate_flags == NULL) {
13832 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13834 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags));
13835 if (r->out.rid == NULL) {
13836 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13838 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
13839 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
13841 return NDR_ERR_SUCCESS;
13844 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r)
13846 uint32_t _ptr_server_name;
13847 uint32_t size_server_name_1 = 0;
13848 uint32_t length_server_name_1 = 0;
13849 uint32_t size_account_name_1 = 0;
13850 uint32_t length_account_name_1 = 0;
13851 uint32_t size_computer_name_1 = 0;
13852 uint32_t length_computer_name_1 = 0;
13853 TALLOC_CTX *_mem_save_server_name_0;
13854 TALLOC_CTX *_mem_save_credentials_0;
13855 TALLOC_CTX *_mem_save_return_credentials_0;
13856 TALLOC_CTX *_mem_save_negotiate_flags_0;
13857 TALLOC_CTX *_mem_save_rid_0;
13858 if (flags & NDR_IN) {
13859 ZERO_STRUCT(r->out);
13861 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
13862 if (_ptr_server_name) {
13863 NDR_PULL_ALLOC(ndr, r->in.server_name);
13864 } else {
13865 r->in.server_name = NULL;
13867 if (r->in.server_name) {
13868 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13869 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
13870 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13871 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13872 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
13873 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
13874 if (length_server_name_1 > size_server_name_1) {
13875 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
13877 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
13878 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
13879 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
13881 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
13882 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
13883 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
13884 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
13885 if (length_account_name_1 > size_account_name_1) {
13886 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
13888 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
13889 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
13890 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
13891 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
13892 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
13893 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
13894 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
13895 if (length_computer_name_1 > size_computer_name_1) {
13896 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
13898 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
13899 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
13900 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13901 NDR_PULL_ALLOC(ndr, r->in.credentials);
13903 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
13904 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
13905 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
13906 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
13907 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13908 NDR_PULL_ALLOC(ndr, r->in.negotiate_flags);
13910 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
13911 NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
13912 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags));
13913 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
13914 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
13915 ZERO_STRUCTP(r->out.return_credentials);
13916 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
13917 *r->out.negotiate_flags = *r->in.negotiate_flags;
13918 NDR_PULL_ALLOC(ndr, r->out.rid);
13919 ZERO_STRUCTP(r->out.rid);
13921 if (flags & NDR_OUT) {
13922 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13923 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
13925 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
13926 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
13927 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
13928 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
13929 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13930 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
13932 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
13933 NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
13934 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags));
13935 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
13936 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13937 NDR_PULL_ALLOC(ndr, r->out.rid);
13939 _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13940 NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC);
13941 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid));
13942 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
13943 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
13945 return NDR_ERR_SUCCESS;
13948 _PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r)
13950 ndr_print_struct(ndr, name, "netr_ServerAuthenticate3");
13951 ndr->depth++;
13952 if (flags & NDR_SET_VALUES) {
13953 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13955 if (flags & NDR_IN) {
13956 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate3");
13957 ndr->depth++;
13958 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13959 ndr->depth++;
13960 if (r->in.server_name) {
13961 ndr_print_string(ndr, "server_name", r->in.server_name);
13963 ndr->depth--;
13964 ndr_print_ptr(ndr, "account_name", r->in.account_name);
13965 ndr->depth++;
13966 ndr_print_string(ndr, "account_name", r->in.account_name);
13967 ndr->depth--;
13968 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
13969 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
13970 ndr->depth++;
13971 ndr_print_string(ndr, "computer_name", r->in.computer_name);
13972 ndr->depth--;
13973 ndr_print_ptr(ndr, "credentials", r->in.credentials);
13974 ndr->depth++;
13975 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
13976 ndr->depth--;
13977 ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags);
13978 ndr->depth++;
13979 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags);
13980 ndr->depth--;
13981 ndr->depth--;
13983 if (flags & NDR_OUT) {
13984 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate3");
13985 ndr->depth++;
13986 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
13987 ndr->depth++;
13988 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
13989 ndr->depth--;
13990 ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags);
13991 ndr->depth++;
13992 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags);
13993 ndr->depth--;
13994 ndr_print_ptr(ndr, "rid", r->out.rid);
13995 ndr->depth++;
13996 ndr_print_uint32(ndr, "rid", *r->out.rid);
13997 ndr->depth--;
13998 ndr_print_NTSTATUS(ndr, "result", r->out.result);
13999 ndr->depth--;
14001 ndr->depth--;
14004 static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r)
14006 if (flags & NDR_IN) {
14007 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
14008 if (r->in.server_unc) {
14009 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
14010 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14011 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
14012 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));
14014 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
14015 if (r->in.domain_name) {
14016 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
14017 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14018 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
14019 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));
14021 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
14022 if (r->in.domain_guid) {
14023 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
14025 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
14026 if (r->in.site_name) {
14027 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
14028 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14029 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
14030 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));
14032 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
14034 if (flags & NDR_OUT) {
14035 if (r->out.info == NULL) {
14036 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14038 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
14039 if (*r->out.info) {
14040 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
14042 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14044 return NDR_ERR_SUCCESS;
14047 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r)
14049 uint32_t _ptr_server_unc;
14050 uint32_t size_server_unc_1 = 0;
14051 uint32_t length_server_unc_1 = 0;
14052 uint32_t _ptr_domain_name;
14053 uint32_t size_domain_name_1 = 0;
14054 uint32_t length_domain_name_1 = 0;
14055 uint32_t _ptr_domain_guid;
14056 uint32_t _ptr_site_name;
14057 uint32_t size_site_name_1 = 0;
14058 uint32_t length_site_name_1 = 0;
14059 uint32_t _ptr_info;
14060 TALLOC_CTX *_mem_save_server_unc_0;
14061 TALLOC_CTX *_mem_save_domain_name_0;
14062 TALLOC_CTX *_mem_save_domain_guid_0;
14063 TALLOC_CTX *_mem_save_site_name_0;
14064 TALLOC_CTX *_mem_save_info_0;
14065 TALLOC_CTX *_mem_save_info_1;
14066 if (flags & NDR_IN) {
14067 ZERO_STRUCT(r->out);
14069 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
14070 if (_ptr_server_unc) {
14071 NDR_PULL_ALLOC(ndr, r->in.server_unc);
14072 } else {
14073 r->in.server_unc = NULL;
14075 if (r->in.server_unc) {
14076 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
14077 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
14078 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
14079 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
14080 size_server_unc_1 = ndr_get_array_size(ndr, &r->in.server_unc);
14081 length_server_unc_1 = ndr_get_array_length(ndr, &r->in.server_unc);
14082 if (length_server_unc_1 > size_server_unc_1) {
14083 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_unc_1, length_server_unc_1);
14085 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_unc_1, sizeof(uint16_t)));
14086 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, length_server_unc_1, sizeof(uint16_t), CH_UTF16));
14087 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
14089 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
14090 if (_ptr_domain_name) {
14091 NDR_PULL_ALLOC(ndr, r->in.domain_name);
14092 } else {
14093 r->in.domain_name = NULL;
14095 if (r->in.domain_name) {
14096 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14097 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
14098 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
14099 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
14100 size_domain_name_1 = ndr_get_array_size(ndr, &r->in.domain_name);
14101 length_domain_name_1 = ndr_get_array_length(ndr, &r->in.domain_name);
14102 if (length_domain_name_1 > size_domain_name_1) {
14103 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
14105 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint16_t)));
14106 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, length_domain_name_1, sizeof(uint16_t), CH_UTF16));
14107 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
14109 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
14110 if (_ptr_domain_guid) {
14111 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
14112 } else {
14113 r->in.domain_guid = NULL;
14115 if (r->in.domain_guid) {
14116 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
14117 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
14118 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
14119 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
14121 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
14122 if (_ptr_site_name) {
14123 NDR_PULL_ALLOC(ndr, r->in.site_name);
14124 } else {
14125 r->in.site_name = NULL;
14127 if (r->in.site_name) {
14128 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14129 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
14130 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
14131 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
14132 size_site_name_1 = ndr_get_array_size(ndr, &r->in.site_name);
14133 length_site_name_1 = ndr_get_array_length(ndr, &r->in.site_name);
14134 if (length_site_name_1 > size_site_name_1) {
14135 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_site_name_1, length_site_name_1);
14137 NDR_CHECK(ndr_check_string_terminator(ndr, length_site_name_1, sizeof(uint16_t)));
14138 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, length_site_name_1, sizeof(uint16_t), CH_UTF16));
14139 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
14141 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
14142 NDR_PULL_ALLOC(ndr, r->out.info);
14143 ZERO_STRUCTP(r->out.info);
14145 if (flags & NDR_OUT) {
14146 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14147 NDR_PULL_ALLOC(ndr, r->out.info);
14149 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
14150 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
14151 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
14152 if (_ptr_info) {
14153 NDR_PULL_ALLOC(ndr, *r->out.info);
14154 } else {
14155 *r->out.info = NULL;
14157 if (*r->out.info) {
14158 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
14159 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
14160 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
14161 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
14163 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
14164 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14166 return NDR_ERR_SUCCESS;
14169 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r)
14171 ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx");
14172 ndr->depth++;
14173 if (flags & NDR_SET_VALUES) {
14174 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14176 if (flags & NDR_IN) {
14177 ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx");
14178 ndr->depth++;
14179 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
14180 ndr->depth++;
14181 if (r->in.server_unc) {
14182 ndr_print_string(ndr, "server_unc", r->in.server_unc);
14184 ndr->depth--;
14185 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
14186 ndr->depth++;
14187 if (r->in.domain_name) {
14188 ndr_print_string(ndr, "domain_name", r->in.domain_name);
14190 ndr->depth--;
14191 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
14192 ndr->depth++;
14193 if (r->in.domain_guid) {
14194 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
14196 ndr->depth--;
14197 ndr_print_ptr(ndr, "site_name", r->in.site_name);
14198 ndr->depth++;
14199 if (r->in.site_name) {
14200 ndr_print_string(ndr, "site_name", r->in.site_name);
14202 ndr->depth--;
14203 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
14204 ndr->depth--;
14206 if (flags & NDR_OUT) {
14207 ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx");
14208 ndr->depth++;
14209 ndr_print_ptr(ndr, "info", r->out.info);
14210 ndr->depth++;
14211 ndr_print_ptr(ndr, "info", *r->out.info);
14212 ndr->depth++;
14213 if (*r->out.info) {
14214 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
14216 ndr->depth--;
14217 ndr->depth--;
14218 ndr_print_WERROR(ndr, "result", r->out.result);
14219 ndr->depth--;
14221 ndr->depth--;
14224 static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r)
14226 if (flags & NDR_IN) {
14227 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
14228 if (r->in.computer_name) {
14229 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14230 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14231 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14232 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));
14235 if (flags & NDR_OUT) {
14236 if (r->out.site == NULL) {
14237 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14239 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site));
14240 if (*r->out.site) {
14241 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
14242 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14243 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
14244 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16));
14246 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14248 return NDR_ERR_SUCCESS;
14251 static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r)
14253 uint32_t _ptr_computer_name;
14254 uint32_t size_computer_name_1 = 0;
14255 uint32_t length_computer_name_1 = 0;
14256 uint32_t _ptr_site;
14257 uint32_t size_site_2 = 0;
14258 uint32_t length_site_2 = 0;
14259 TALLOC_CTX *_mem_save_computer_name_0;
14260 TALLOC_CTX *_mem_save_site_0;
14261 TALLOC_CTX *_mem_save_site_1;
14262 if (flags & NDR_IN) {
14263 ZERO_STRUCT(r->out);
14265 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
14266 if (_ptr_computer_name) {
14267 NDR_PULL_ALLOC(ndr, r->in.computer_name);
14268 } else {
14269 r->in.computer_name = NULL;
14271 if (r->in.computer_name) {
14272 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14273 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
14274 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14275 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14276 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
14277 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
14278 if (length_computer_name_1 > size_computer_name_1) {
14279 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
14281 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
14282 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
14283 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
14285 NDR_PULL_ALLOC(ndr, r->out.site);
14286 ZERO_STRUCTP(r->out.site);
14288 if (flags & NDR_OUT) {
14289 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14290 NDR_PULL_ALLOC(ndr, r->out.site);
14292 _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr);
14293 NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC);
14294 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site));
14295 if (_ptr_site) {
14296 NDR_PULL_ALLOC(ndr, *r->out.site);
14297 } else {
14298 *r->out.site = NULL;
14300 if (*r->out.site) {
14301 _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr);
14302 NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0);
14303 NDR_CHECK(ndr_pull_array_size(ndr, r->out.site));
14304 NDR_CHECK(ndr_pull_array_length(ndr, r->out.site));
14305 size_site_2 = ndr_get_array_size(ndr, r->out.site);
14306 length_site_2 = ndr_get_array_length(ndr, r->out.site);
14307 if (length_site_2 > size_site_2) {
14308 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_site_2, length_site_2);
14310 NDR_CHECK(ndr_check_string_terminator(ndr, length_site_2, sizeof(uint16_t)));
14311 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, length_site_2, sizeof(uint16_t), CH_UTF16));
14312 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0);
14314 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC);
14315 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14317 return NDR_ERR_SUCCESS;
14320 _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r)
14322 ndr_print_struct(ndr, name, "netr_DsRGetSiteName");
14323 ndr->depth++;
14324 if (flags & NDR_SET_VALUES) {
14325 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14327 if (flags & NDR_IN) {
14328 ndr_print_struct(ndr, "in", "netr_DsRGetSiteName");
14329 ndr->depth++;
14330 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14331 ndr->depth++;
14332 if (r->in.computer_name) {
14333 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14335 ndr->depth--;
14336 ndr->depth--;
14338 if (flags & NDR_OUT) {
14339 ndr_print_struct(ndr, "out", "netr_DsRGetSiteName");
14340 ndr->depth++;
14341 ndr_print_ptr(ndr, "site", r->out.site);
14342 ndr->depth++;
14343 ndr_print_ptr(ndr, "site", *r->out.site);
14344 ndr->depth++;
14345 if (*r->out.site) {
14346 ndr_print_string(ndr, "site", *r->out.site);
14348 ndr->depth--;
14349 ndr->depth--;
14350 ndr_print_WERROR(ndr, "result", r->out.result);
14351 ndr->depth--;
14353 ndr->depth--;
14356 static enum ndr_err_code ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r)
14358 if (flags & NDR_IN) {
14359 if (r->in.server_name == NULL) {
14360 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14362 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14363 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14364 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14365 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));
14366 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
14367 if (r->in.computer_name) {
14368 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14369 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14370 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14371 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));
14373 if (r->in.credential == NULL) {
14374 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14376 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14377 if (r->in.return_authenticator == NULL) {
14378 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14380 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
14381 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
14382 if (r->in.query == NULL) {
14383 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14385 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.query, r->in.level));
14386 NDR_CHECK(ndr_push_netr_WorkstationInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.query));
14388 if (flags & NDR_OUT) {
14389 if (r->out.return_authenticator == NULL) {
14390 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14392 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14393 if (r->out.info == NULL) {
14394 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14396 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
14397 NDR_CHECK(ndr_push_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14398 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
14400 return NDR_ERR_SUCCESS;
14403 static enum ndr_err_code ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r)
14405 uint32_t size_server_name_1 = 0;
14406 uint32_t length_server_name_1 = 0;
14407 uint32_t _ptr_computer_name;
14408 uint32_t size_computer_name_1 = 0;
14409 uint32_t length_computer_name_1 = 0;
14410 TALLOC_CTX *_mem_save_computer_name_0;
14411 TALLOC_CTX *_mem_save_credential_0;
14412 TALLOC_CTX *_mem_save_return_authenticator_0;
14413 TALLOC_CTX *_mem_save_query_0;
14414 TALLOC_CTX *_mem_save_info_0;
14415 if (flags & NDR_IN) {
14416 ZERO_STRUCT(r->out);
14418 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14419 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14420 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
14421 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
14422 if (length_server_name_1 > size_server_name_1) {
14423 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
14425 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
14426 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
14427 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
14428 if (_ptr_computer_name) {
14429 NDR_PULL_ALLOC(ndr, r->in.computer_name);
14430 } else {
14431 r->in.computer_name = NULL;
14433 if (r->in.computer_name) {
14434 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14435 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
14436 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14437 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14438 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
14439 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
14440 if (length_computer_name_1 > size_computer_name_1) {
14441 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
14443 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
14444 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
14445 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
14447 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14448 NDR_PULL_ALLOC(ndr, r->in.credential);
14450 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14451 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14452 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14453 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14454 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14455 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
14457 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14458 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14459 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
14460 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14461 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
14462 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14463 NDR_PULL_ALLOC(ndr, r->in.query);
14465 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
14466 NDR_PULL_SET_MEM_CTX(ndr, r->in.query, LIBNDR_FLAG_REF_ALLOC);
14467 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.query, r->in.level));
14468 NDR_CHECK(ndr_pull_netr_WorkstationInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.query));
14469 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
14470 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14471 *r->out.return_authenticator = *r->in.return_authenticator;
14472 NDR_PULL_ALLOC(ndr, r->out.info);
14473 ZERO_STRUCTP(r->out.info);
14475 if (flags & NDR_OUT) {
14476 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14477 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14479 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14480 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14481 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14482 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14483 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14484 NDR_PULL_ALLOC(ndr, r->out.info);
14486 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
14487 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
14488 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
14489 NDR_CHECK(ndr_pull_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14490 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
14491 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
14493 return NDR_ERR_SUCCESS;
14496 _PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r)
14498 ndr_print_struct(ndr, name, "netr_LogonGetDomainInfo");
14499 ndr->depth++;
14500 if (flags & NDR_SET_VALUES) {
14501 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14503 if (flags & NDR_IN) {
14504 ndr_print_struct(ndr, "in", "netr_LogonGetDomainInfo");
14505 ndr->depth++;
14506 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14507 ndr->depth++;
14508 ndr_print_string(ndr, "server_name", r->in.server_name);
14509 ndr->depth--;
14510 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14511 ndr->depth++;
14512 if (r->in.computer_name) {
14513 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14515 ndr->depth--;
14516 ndr_print_ptr(ndr, "credential", r->in.credential);
14517 ndr->depth++;
14518 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14519 ndr->depth--;
14520 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
14521 ndr->depth++;
14522 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
14523 ndr->depth--;
14524 ndr_print_uint32(ndr, "level", r->in.level);
14525 ndr_print_ptr(ndr, "query", r->in.query);
14526 ndr->depth++;
14527 ndr_print_set_switch_value(ndr, r->in.query, r->in.level);
14528 ndr_print_netr_WorkstationInfo(ndr, "query", r->in.query);
14529 ndr->depth--;
14530 ndr->depth--;
14532 if (flags & NDR_OUT) {
14533 ndr_print_struct(ndr, "out", "netr_LogonGetDomainInfo");
14534 ndr->depth++;
14535 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14536 ndr->depth++;
14537 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14538 ndr->depth--;
14539 ndr_print_ptr(ndr, "info", r->out.info);
14540 ndr->depth++;
14541 ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
14542 ndr_print_netr_DomainInfo(ndr, "info", r->out.info);
14543 ndr->depth--;
14544 ndr_print_NTSTATUS(ndr, "result", r->out.result);
14545 ndr->depth--;
14547 ndr->depth--;
14550 static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r)
14552 if (flags & NDR_IN) {
14553 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14554 if (r->in.server_name) {
14555 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14556 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14557 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14558 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));
14560 if (r->in.account_name == NULL) {
14561 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14563 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14564 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14565 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14566 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));
14567 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
14568 if (r->in.computer_name == NULL) {
14569 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14571 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14572 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14573 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14574 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));
14575 if (r->in.credential == NULL) {
14576 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14578 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14579 if (r->in.new_password == NULL) {
14580 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14582 NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
14584 if (flags & NDR_OUT) {
14585 if (r->out.return_authenticator == NULL) {
14586 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14588 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14589 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
14591 return NDR_ERR_SUCCESS;
14594 static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r)
14596 uint32_t _ptr_server_name;
14597 uint32_t size_server_name_1 = 0;
14598 uint32_t length_server_name_1 = 0;
14599 uint32_t size_account_name_1 = 0;
14600 uint32_t length_account_name_1 = 0;
14601 uint32_t size_computer_name_1 = 0;
14602 uint32_t length_computer_name_1 = 0;
14603 TALLOC_CTX *_mem_save_server_name_0;
14604 TALLOC_CTX *_mem_save_credential_0;
14605 TALLOC_CTX *_mem_save_return_authenticator_0;
14606 TALLOC_CTX *_mem_save_new_password_0;
14607 if (flags & NDR_IN) {
14608 ZERO_STRUCT(r->out);
14610 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14611 if (_ptr_server_name) {
14612 NDR_PULL_ALLOC(ndr, r->in.server_name);
14613 } else {
14614 r->in.server_name = NULL;
14616 if (r->in.server_name) {
14617 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14618 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14619 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14620 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14621 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
14622 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
14623 if (length_server_name_1 > size_server_name_1) {
14624 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
14626 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
14627 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
14628 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
14630 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
14631 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
14632 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
14633 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
14634 if (length_account_name_1 > size_account_name_1) {
14635 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
14637 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
14638 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
14639 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
14640 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14641 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14642 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
14643 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
14644 if (length_computer_name_1 > size_computer_name_1) {
14645 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
14647 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
14648 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
14649 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14650 NDR_PULL_ALLOC(ndr, r->in.credential);
14652 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14653 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14654 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14655 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14656 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14657 NDR_PULL_ALLOC(ndr, r->in.new_password);
14659 _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
14660 NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
14661 NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
14662 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
14663 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14664 ZERO_STRUCTP(r->out.return_authenticator);
14666 if (flags & NDR_OUT) {
14667 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14668 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14670 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14671 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14672 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14673 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14674 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
14676 return NDR_ERR_SUCCESS;
14679 _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r)
14681 ndr_print_struct(ndr, name, "netr_ServerPasswordSet2");
14682 ndr->depth++;
14683 if (flags & NDR_SET_VALUES) {
14684 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14686 if (flags & NDR_IN) {
14687 ndr_print_struct(ndr, "in", "netr_ServerPasswordSet2");
14688 ndr->depth++;
14689 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14690 ndr->depth++;
14691 if (r->in.server_name) {
14692 ndr_print_string(ndr, "server_name", r->in.server_name);
14694 ndr->depth--;
14695 ndr_print_ptr(ndr, "account_name", r->in.account_name);
14696 ndr->depth++;
14697 ndr_print_string(ndr, "account_name", r->in.account_name);
14698 ndr->depth--;
14699 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
14700 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14701 ndr->depth++;
14702 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14703 ndr->depth--;
14704 ndr_print_ptr(ndr, "credential", r->in.credential);
14705 ndr->depth++;
14706 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14707 ndr->depth--;
14708 ndr_print_ptr(ndr, "new_password", r->in.new_password);
14709 ndr->depth++;
14710 ndr_print_netr_CryptPassword(ndr, "new_password", r->in.new_password);
14711 ndr->depth--;
14712 ndr->depth--;
14714 if (flags & NDR_OUT) {
14715 ndr_print_struct(ndr, "out", "netr_ServerPasswordSet2");
14716 ndr->depth++;
14717 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14718 ndr->depth++;
14719 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14720 ndr->depth--;
14721 ndr_print_NTSTATUS(ndr, "result", r->out.result);
14722 ndr->depth--;
14724 ndr->depth--;
14727 static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r)
14729 if (flags & NDR_IN) {
14730 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14731 if (r->in.server_name) {
14732 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14733 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14734 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14735 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));
14737 if (r->in.account_name == NULL) {
14738 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14740 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14741 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14742 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14743 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));
14744 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
14745 if (r->in.computer_name == NULL) {
14746 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14748 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14749 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14750 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14751 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));
14752 if (r->in.credential == NULL) {
14753 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14755 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14757 if (flags & NDR_OUT) {
14758 if (r->out.return_authenticator == NULL) {
14759 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14761 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14762 if (r->out.password == NULL) {
14763 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14765 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password));
14766 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14768 return NDR_ERR_SUCCESS;
14771 static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r)
14773 uint32_t _ptr_server_name;
14774 uint32_t size_server_name_1 = 0;
14775 uint32_t length_server_name_1 = 0;
14776 uint32_t size_account_name_1 = 0;
14777 uint32_t length_account_name_1 = 0;
14778 uint32_t size_computer_name_1 = 0;
14779 uint32_t length_computer_name_1 = 0;
14780 TALLOC_CTX *_mem_save_server_name_0;
14781 TALLOC_CTX *_mem_save_credential_0;
14782 TALLOC_CTX *_mem_save_return_authenticator_0;
14783 TALLOC_CTX *_mem_save_password_0;
14784 if (flags & NDR_IN) {
14785 ZERO_STRUCT(r->out);
14787 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14788 if (_ptr_server_name) {
14789 NDR_PULL_ALLOC(ndr, r->in.server_name);
14790 } else {
14791 r->in.server_name = NULL;
14793 if (r->in.server_name) {
14794 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14795 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14796 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14797 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14798 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
14799 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
14800 if (length_server_name_1 > size_server_name_1) {
14801 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
14803 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
14804 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
14805 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
14807 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
14808 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
14809 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
14810 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
14811 if (length_account_name_1 > size_account_name_1) {
14812 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
14814 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
14815 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
14816 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
14817 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14818 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14819 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
14820 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
14821 if (length_computer_name_1 > size_computer_name_1) {
14822 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
14824 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
14825 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
14826 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14827 NDR_PULL_ALLOC(ndr, r->in.credential);
14829 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14830 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14831 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14832 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14833 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14834 ZERO_STRUCTP(r->out.return_authenticator);
14835 NDR_PULL_ALLOC(ndr, r->out.password);
14836 ZERO_STRUCTP(r->out.password);
14838 if (flags & NDR_OUT) {
14839 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14840 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14842 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14843 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14844 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14845 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14846 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14847 NDR_PULL_ALLOC(ndr, r->out.password);
14849 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
14850 NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
14851 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password));
14852 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
14853 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14855 return NDR_ERR_SUCCESS;
14858 _PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r)
14860 ndr_print_struct(ndr, name, "netr_ServerPasswordGet");
14861 ndr->depth++;
14862 if (flags & NDR_SET_VALUES) {
14863 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14865 if (flags & NDR_IN) {
14866 ndr_print_struct(ndr, "in", "netr_ServerPasswordGet");
14867 ndr->depth++;
14868 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14869 ndr->depth++;
14870 if (r->in.server_name) {
14871 ndr_print_string(ndr, "server_name", r->in.server_name);
14873 ndr->depth--;
14874 ndr_print_ptr(ndr, "account_name", r->in.account_name);
14875 ndr->depth++;
14876 ndr_print_string(ndr, "account_name", r->in.account_name);
14877 ndr->depth--;
14878 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
14879 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14880 ndr->depth++;
14881 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14882 ndr->depth--;
14883 ndr_print_ptr(ndr, "credential", r->in.credential);
14884 ndr->depth++;
14885 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14886 ndr->depth--;
14887 ndr->depth--;
14889 if (flags & NDR_OUT) {
14890 ndr_print_struct(ndr, "out", "netr_ServerPasswordGet");
14891 ndr->depth++;
14892 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14893 ndr->depth++;
14894 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14895 ndr->depth--;
14896 ndr_print_ptr(ndr, "password", r->out.password);
14897 ndr->depth++;
14898 ndr_print_samr_Password(ndr, "password", r->out.password);
14899 ndr->depth--;
14900 ndr_print_WERROR(ndr, "result", r->out.result);
14901 ndr->depth--;
14903 ndr->depth--;
14906 static enum ndr_err_code ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
14908 if (flags & NDR_IN) {
14910 if (flags & NDR_OUT) {
14911 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14913 return NDR_ERR_SUCCESS;
14916 static enum ndr_err_code ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r)
14918 if (flags & NDR_IN) {
14920 if (flags & NDR_OUT) {
14921 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14923 return NDR_ERR_SUCCESS;
14926 _PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
14928 ndr_print_struct(ndr, name, "netr_NETRLOGONSENDTOSAM");
14929 ndr->depth++;
14930 if (flags & NDR_SET_VALUES) {
14931 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14933 if (flags & NDR_IN) {
14934 ndr_print_struct(ndr, "in", "netr_NETRLOGONSENDTOSAM");
14935 ndr->depth++;
14936 ndr->depth--;
14938 if (flags & NDR_OUT) {
14939 ndr_print_struct(ndr, "out", "netr_NETRLOGONSENDTOSAM");
14940 ndr->depth++;
14941 ndr_print_WERROR(ndr, "result", r->out.result);
14942 ndr->depth--;
14944 ndr->depth--;
14947 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r)
14949 uint32_t cntr_addresses_1;
14950 if (flags & NDR_IN) {
14951 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14952 if (r->in.server_name) {
14953 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14954 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14955 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14956 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));
14958 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
14959 if (r->in.addresses == NULL) {
14960 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14962 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.count));
14963 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14964 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
14966 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14967 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
14970 if (flags & NDR_OUT) {
14971 if (r->out.ctr == NULL) {
14972 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14974 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
14975 if (*r->out.ctr) {
14976 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
14978 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14980 return NDR_ERR_SUCCESS;
14983 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r)
14985 uint32_t _ptr_server_name;
14986 uint32_t size_server_name_1 = 0;
14987 uint32_t length_server_name_1 = 0;
14988 uint32_t size_addresses_1 = 0;
14989 uint32_t cntr_addresses_1;
14990 uint32_t _ptr_ctr;
14991 TALLOC_CTX *_mem_save_server_name_0;
14992 TALLOC_CTX *_mem_save_addresses_1;
14993 TALLOC_CTX *_mem_save_ctr_0;
14994 TALLOC_CTX *_mem_save_ctr_1;
14995 if (flags & NDR_IN) {
14996 ZERO_STRUCT(r->out);
14998 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14999 if (_ptr_server_name) {
15000 NDR_PULL_ALLOC(ndr, r->in.server_name);
15001 } else {
15002 r->in.server_name = NULL;
15004 if (r->in.server_name) {
15005 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15006 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15007 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15008 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15009 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
15010 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
15011 if (length_server_name_1 > size_server_name_1) {
15012 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
15014 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
15015 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
15016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15018 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
15019 if (r->in.count > 32000) {
15020 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
15022 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
15023 size_addresses_1 = ndr_get_array_size(ndr, &r->in.addresses);
15024 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15025 NDR_PULL_ALLOC_N(ndr, r->in.addresses, size_addresses_1);
15027 _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
15028 NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
15029 for (cntr_addresses_1 = 0; cntr_addresses_1 < size_addresses_1; cntr_addresses_1++) {
15030 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
15032 for (cntr_addresses_1 = 0; cntr_addresses_1 < size_addresses_1; cntr_addresses_1++) {
15033 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
15035 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
15036 NDR_PULL_ALLOC(ndr, r->out.ctr);
15037 ZERO_STRUCTP(r->out.ctr);
15038 if (r->in.addresses) {
15039 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
15042 if (flags & NDR_OUT) {
15043 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15044 NDR_PULL_ALLOC(ndr, r->out.ctr);
15046 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15047 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15048 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
15049 if (_ptr_ctr) {
15050 NDR_PULL_ALLOC(ndr, *r->out.ctr);
15051 } else {
15052 *r->out.ctr = NULL;
15054 if (*r->out.ctr) {
15055 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
15056 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
15057 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15058 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
15060 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15061 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15063 return NDR_ERR_SUCCESS;
15066 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r)
15068 uint32_t cntr_addresses_1;
15069 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW");
15070 ndr->depth++;
15071 if (flags & NDR_SET_VALUES) {
15072 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15074 if (flags & NDR_IN) {
15075 ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW");
15076 ndr->depth++;
15077 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15078 ndr->depth++;
15079 if (r->in.server_name) {
15080 ndr_print_string(ndr, "server_name", r->in.server_name);
15082 ndr->depth--;
15083 ndr_print_uint32(ndr, "count", r->in.count);
15084 ndr_print_ptr(ndr, "addresses", r->in.addresses);
15085 ndr->depth++;
15086 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count);
15087 ndr->depth++;
15088 for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
15089 char *idx_1=NULL;
15090 if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) {
15091 ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
15092 free(idx_1);
15095 ndr->depth--;
15096 ndr->depth--;
15097 ndr->depth--;
15099 if (flags & NDR_OUT) {
15100 ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW");
15101 ndr->depth++;
15102 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15103 ndr->depth++;
15104 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
15105 ndr->depth++;
15106 if (*r->out.ctr) {
15107 ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr);
15109 ndr->depth--;
15110 ndr->depth--;
15111 ndr_print_WERROR(ndr, "result", r->out.result);
15112 ndr->depth--;
15114 ndr->depth--;
15117 static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r)
15119 if (flags & NDR_IN) {
15120 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
15121 if (r->in.server_unc) {
15122 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
15123 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15124 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
15125 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));
15127 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_account));
15128 if (r->in.client_account) {
15129 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16)));
15130 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15131 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16)));
15132 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));
15134 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask));
15135 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
15136 if (r->in.domain_name) {
15137 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
15138 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15139 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
15140 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));
15142 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
15143 if (r->in.domain_guid) {
15144 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
15146 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
15147 if (r->in.site_name) {
15148 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
15149 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15150 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
15151 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));
15153 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
15155 if (flags & NDR_OUT) {
15156 if (r->out.info == NULL) {
15157 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15159 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
15160 if (*r->out.info) {
15161 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
15163 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15165 return NDR_ERR_SUCCESS;
15168 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r)
15170 uint32_t _ptr_server_unc;
15171 uint32_t size_server_unc_1 = 0;
15172 uint32_t length_server_unc_1 = 0;
15173 uint32_t _ptr_client_account;
15174 uint32_t size_client_account_1 = 0;
15175 uint32_t length_client_account_1 = 0;
15176 uint32_t _ptr_domain_name;
15177 uint32_t size_domain_name_1 = 0;
15178 uint32_t length_domain_name_1 = 0;
15179 uint32_t _ptr_domain_guid;
15180 uint32_t _ptr_site_name;
15181 uint32_t size_site_name_1 = 0;
15182 uint32_t length_site_name_1 = 0;
15183 uint32_t _ptr_info;
15184 TALLOC_CTX *_mem_save_server_unc_0;
15185 TALLOC_CTX *_mem_save_client_account_0;
15186 TALLOC_CTX *_mem_save_domain_name_0;
15187 TALLOC_CTX *_mem_save_domain_guid_0;
15188 TALLOC_CTX *_mem_save_site_name_0;
15189 TALLOC_CTX *_mem_save_info_0;
15190 TALLOC_CTX *_mem_save_info_1;
15191 if (flags & NDR_IN) {
15192 ZERO_STRUCT(r->out);
15194 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
15195 if (_ptr_server_unc) {
15196 NDR_PULL_ALLOC(ndr, r->in.server_unc);
15197 } else {
15198 r->in.server_unc = NULL;
15200 if (r->in.server_unc) {
15201 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
15202 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
15203 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
15204 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
15205 size_server_unc_1 = ndr_get_array_size(ndr, &r->in.server_unc);
15206 length_server_unc_1 = ndr_get_array_length(ndr, &r->in.server_unc);
15207 if (length_server_unc_1 > size_server_unc_1) {
15208 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_unc_1, length_server_unc_1);
15210 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_unc_1, sizeof(uint16_t)));
15211 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, length_server_unc_1, sizeof(uint16_t), CH_UTF16));
15212 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
15214 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account));
15215 if (_ptr_client_account) {
15216 NDR_PULL_ALLOC(ndr, r->in.client_account);
15217 } else {
15218 r->in.client_account = NULL;
15220 if (r->in.client_account) {
15221 _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
15222 NDR_PULL_SET_MEM_CTX(ndr, r->in.client_account, 0);
15223 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_account));
15224 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_account));
15225 size_client_account_1 = ndr_get_array_size(ndr, &r->in.client_account);
15226 length_client_account_1 = ndr_get_array_length(ndr, &r->in.client_account);
15227 if (length_client_account_1 > size_client_account_1) {
15228 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_account_1, length_client_account_1);
15230 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_account_1, sizeof(uint16_t)));
15231 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, length_client_account_1, sizeof(uint16_t), CH_UTF16));
15232 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0);
15234 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask));
15235 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
15236 if (_ptr_domain_name) {
15237 NDR_PULL_ALLOC(ndr, r->in.domain_name);
15238 } else {
15239 r->in.domain_name = NULL;
15241 if (r->in.domain_name) {
15242 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15243 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
15244 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
15245 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
15246 size_domain_name_1 = ndr_get_array_size(ndr, &r->in.domain_name);
15247 length_domain_name_1 = ndr_get_array_length(ndr, &r->in.domain_name);
15248 if (length_domain_name_1 > size_domain_name_1) {
15249 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
15251 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint16_t)));
15252 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, length_domain_name_1, sizeof(uint16_t), CH_UTF16));
15253 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
15255 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
15256 if (_ptr_domain_guid) {
15257 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
15258 } else {
15259 r->in.domain_guid = NULL;
15261 if (r->in.domain_guid) {
15262 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
15263 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
15264 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
15265 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
15267 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
15268 if (_ptr_site_name) {
15269 NDR_PULL_ALLOC(ndr, r->in.site_name);
15270 } else {
15271 r->in.site_name = NULL;
15273 if (r->in.site_name) {
15274 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15275 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
15276 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
15277 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
15278 size_site_name_1 = ndr_get_array_size(ndr, &r->in.site_name);
15279 length_site_name_1 = ndr_get_array_length(ndr, &r->in.site_name);
15280 if (length_site_name_1 > size_site_name_1) {
15281 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_site_name_1, length_site_name_1);
15283 NDR_CHECK(ndr_check_string_terminator(ndr, length_site_name_1, sizeof(uint16_t)));
15284 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, length_site_name_1, sizeof(uint16_t), CH_UTF16));
15285 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
15287 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
15288 NDR_PULL_ALLOC(ndr, r->out.info);
15289 ZERO_STRUCTP(r->out.info);
15291 if (flags & NDR_OUT) {
15292 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15293 NDR_PULL_ALLOC(ndr, r->out.info);
15295 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
15296 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
15297 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
15298 if (_ptr_info) {
15299 NDR_PULL_ALLOC(ndr, *r->out.info);
15300 } else {
15301 *r->out.info = NULL;
15303 if (*r->out.info) {
15304 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
15305 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
15306 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
15307 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
15309 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
15310 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15312 return NDR_ERR_SUCCESS;
15315 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r)
15317 ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx2");
15318 ndr->depth++;
15319 if (flags & NDR_SET_VALUES) {
15320 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15322 if (flags & NDR_IN) {
15323 ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx2");
15324 ndr->depth++;
15325 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
15326 ndr->depth++;
15327 if (r->in.server_unc) {
15328 ndr_print_string(ndr, "server_unc", r->in.server_unc);
15330 ndr->depth--;
15331 ndr_print_ptr(ndr, "client_account", r->in.client_account);
15332 ndr->depth++;
15333 if (r->in.client_account) {
15334 ndr_print_string(ndr, "client_account", r->in.client_account);
15336 ndr->depth--;
15337 ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask);
15338 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
15339 ndr->depth++;
15340 if (r->in.domain_name) {
15341 ndr_print_string(ndr, "domain_name", r->in.domain_name);
15343 ndr->depth--;
15344 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
15345 ndr->depth++;
15346 if (r->in.domain_guid) {
15347 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
15349 ndr->depth--;
15350 ndr_print_ptr(ndr, "site_name", r->in.site_name);
15351 ndr->depth++;
15352 if (r->in.site_name) {
15353 ndr_print_string(ndr, "site_name", r->in.site_name);
15355 ndr->depth--;
15356 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
15357 ndr->depth--;
15359 if (flags & NDR_OUT) {
15360 ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx2");
15361 ndr->depth++;
15362 ndr_print_ptr(ndr, "info", r->out.info);
15363 ndr->depth++;
15364 ndr_print_ptr(ndr, "info", *r->out.info);
15365 ndr->depth++;
15366 if (*r->out.info) {
15367 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
15369 ndr->depth--;
15370 ndr->depth--;
15371 ndr_print_WERROR(ndr, "result", r->out.result);
15372 ndr->depth--;
15374 ndr->depth--;
15377 static enum ndr_err_code ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
15379 if (flags & NDR_IN) {
15381 if (flags & NDR_OUT) {
15382 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15384 return NDR_ERR_SUCCESS;
15387 static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
15389 if (flags & NDR_IN) {
15391 if (flags & NDR_OUT) {
15392 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15394 return NDR_ERR_SUCCESS;
15397 _PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
15399 ndr_print_struct(ndr, name, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
15400 ndr->depth++;
15401 if (flags & NDR_SET_VALUES) {
15402 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15404 if (flags & NDR_IN) {
15405 ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
15406 ndr->depth++;
15407 ndr->depth--;
15409 if (flags & NDR_OUT) {
15410 ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
15411 ndr->depth++;
15412 ndr_print_WERROR(ndr, "result", r->out.result);
15413 ndr->depth--;
15415 ndr->depth--;
15418 static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
15420 if (flags & NDR_IN) {
15421 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15422 if (r->in.server_name) {
15423 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15424 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15425 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15426 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));
15429 if (flags & NDR_OUT) {
15430 if (r->out.dom_trust_list == NULL) {
15431 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15433 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
15434 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15436 return NDR_ERR_SUCCESS;
15439 static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r)
15441 uint32_t _ptr_server_name;
15442 uint32_t size_server_name_1 = 0;
15443 uint32_t length_server_name_1 = 0;
15444 TALLOC_CTX *_mem_save_server_name_0;
15445 TALLOC_CTX *_mem_save_dom_trust_list_0;
15446 if (flags & NDR_IN) {
15447 ZERO_STRUCT(r->out);
15449 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15450 if (_ptr_server_name) {
15451 NDR_PULL_ALLOC(ndr, r->in.server_name);
15452 } else {
15453 r->in.server_name = NULL;
15455 if (r->in.server_name) {
15456 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15457 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15458 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15459 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15460 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
15461 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
15462 if (length_server_name_1 > size_server_name_1) {
15463 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
15465 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
15466 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
15467 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15469 NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
15470 ZERO_STRUCTP(r->out.dom_trust_list);
15472 if (flags & NDR_OUT) {
15473 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15474 NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
15476 _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
15477 NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC);
15478 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
15479 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC);
15480 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15482 return NDR_ERR_SUCCESS;
15485 _PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
15487 ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx");
15488 ndr->depth++;
15489 if (flags & NDR_SET_VALUES) {
15490 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15492 if (flags & NDR_IN) {
15493 ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx");
15494 ndr->depth++;
15495 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15496 ndr->depth++;
15497 if (r->in.server_name) {
15498 ndr_print_string(ndr, "server_name", r->in.server_name);
15500 ndr->depth--;
15501 ndr->depth--;
15503 if (flags & NDR_OUT) {
15504 ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx");
15505 ndr->depth++;
15506 ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list);
15507 ndr->depth++;
15508 ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list);
15509 ndr->depth--;
15510 ndr_print_WERROR(ndr, "result", r->out.result);
15511 ndr->depth--;
15513 ndr->depth--;
15516 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r)
15518 uint32_t cntr_addresses_1;
15519 if (flags & NDR_IN) {
15520 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15521 if (r->in.server_name) {
15522 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15523 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15524 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15525 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));
15527 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
15528 if (r->in.addresses == NULL) {
15529 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15531 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.count));
15532 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15533 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
15535 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15536 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
15539 if (flags & NDR_OUT) {
15540 if (r->out.ctr == NULL) {
15541 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15543 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
15544 if (*r->out.ctr) {
15545 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15547 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15549 return NDR_ERR_SUCCESS;
15552 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r)
15554 uint32_t _ptr_server_name;
15555 uint32_t size_server_name_1 = 0;
15556 uint32_t length_server_name_1 = 0;
15557 uint32_t size_addresses_1 = 0;
15558 uint32_t cntr_addresses_1;
15559 uint32_t _ptr_ctr;
15560 TALLOC_CTX *_mem_save_server_name_0;
15561 TALLOC_CTX *_mem_save_addresses_1;
15562 TALLOC_CTX *_mem_save_ctr_0;
15563 TALLOC_CTX *_mem_save_ctr_1;
15564 if (flags & NDR_IN) {
15565 ZERO_STRUCT(r->out);
15567 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15568 if (_ptr_server_name) {
15569 NDR_PULL_ALLOC(ndr, r->in.server_name);
15570 } else {
15571 r->in.server_name = NULL;
15573 if (r->in.server_name) {
15574 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15575 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15576 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15577 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15578 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
15579 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
15580 if (length_server_name_1 > size_server_name_1) {
15581 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
15583 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
15584 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
15585 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15587 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
15588 if (r->in.count > 32000) {
15589 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
15591 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
15592 size_addresses_1 = ndr_get_array_size(ndr, &r->in.addresses);
15593 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15594 NDR_PULL_ALLOC_N(ndr, r->in.addresses, size_addresses_1);
15596 _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
15597 NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
15598 for (cntr_addresses_1 = 0; cntr_addresses_1 < size_addresses_1; cntr_addresses_1++) {
15599 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
15601 for (cntr_addresses_1 = 0; cntr_addresses_1 < size_addresses_1; cntr_addresses_1++) {
15602 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
15604 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
15605 NDR_PULL_ALLOC(ndr, r->out.ctr);
15606 ZERO_STRUCTP(r->out.ctr);
15607 if (r->in.addresses) {
15608 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
15611 if (flags & NDR_OUT) {
15612 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15613 NDR_PULL_ALLOC(ndr, r->out.ctr);
15615 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15616 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15617 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
15618 if (_ptr_ctr) {
15619 NDR_PULL_ALLOC(ndr, *r->out.ctr);
15620 } else {
15621 *r->out.ctr = NULL;
15623 if (*r->out.ctr) {
15624 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
15625 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
15626 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15627 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
15629 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15630 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15632 return NDR_ERR_SUCCESS;
15635 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r)
15637 uint32_t cntr_addresses_1;
15638 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW");
15639 ndr->depth++;
15640 if (flags & NDR_SET_VALUES) {
15641 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15643 if (flags & NDR_IN) {
15644 ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW");
15645 ndr->depth++;
15646 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15647 ndr->depth++;
15648 if (r->in.server_name) {
15649 ndr_print_string(ndr, "server_name", r->in.server_name);
15651 ndr->depth--;
15652 ndr_print_uint32(ndr, "count", r->in.count);
15653 ndr_print_ptr(ndr, "addresses", r->in.addresses);
15654 ndr->depth++;
15655 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count);
15656 ndr->depth++;
15657 for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
15658 char *idx_1=NULL;
15659 if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) {
15660 ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
15661 free(idx_1);
15664 ndr->depth--;
15665 ndr->depth--;
15666 ndr->depth--;
15668 if (flags & NDR_OUT) {
15669 ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW");
15670 ndr->depth++;
15671 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15672 ndr->depth++;
15673 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
15674 ndr->depth++;
15675 if (*r->out.ctr) {
15676 ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr);
15678 ndr->depth--;
15679 ndr->depth--;
15680 ndr_print_WERROR(ndr, "result", r->out.result);
15681 ndr->depth--;
15683 ndr->depth--;
15686 static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
15688 if (flags & NDR_IN) {
15689 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15690 if (r->in.server_name) {
15691 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15692 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15693 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15694 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));
15697 if (flags & NDR_OUT) {
15698 if (r->out.ctr == NULL) {
15699 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15701 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
15702 if (*r->out.ctr) {
15703 NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15705 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15707 return NDR_ERR_SUCCESS;
15710 static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r)
15712 uint32_t _ptr_server_name;
15713 uint32_t size_server_name_1 = 0;
15714 uint32_t length_server_name_1 = 0;
15715 uint32_t _ptr_ctr;
15716 TALLOC_CTX *_mem_save_server_name_0;
15717 TALLOC_CTX *_mem_save_ctr_0;
15718 TALLOC_CTX *_mem_save_ctr_1;
15719 if (flags & NDR_IN) {
15720 ZERO_STRUCT(r->out);
15722 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15723 if (_ptr_server_name) {
15724 NDR_PULL_ALLOC(ndr, r->in.server_name);
15725 } else {
15726 r->in.server_name = NULL;
15728 if (r->in.server_name) {
15729 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15730 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15731 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15732 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15733 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
15734 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
15735 if (length_server_name_1 > size_server_name_1) {
15736 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
15738 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
15739 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
15740 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15742 NDR_PULL_ALLOC(ndr, r->out.ctr);
15743 ZERO_STRUCTP(r->out.ctr);
15745 if (flags & NDR_OUT) {
15746 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15747 NDR_PULL_ALLOC(ndr, r->out.ctr);
15749 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15750 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15751 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
15752 if (_ptr_ctr) {
15753 NDR_PULL_ALLOC(ndr, *r->out.ctr);
15754 } else {
15755 *r->out.ctr = NULL;
15757 if (*r->out.ctr) {
15758 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
15759 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
15760 NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15761 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
15763 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15764 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15766 return NDR_ERR_SUCCESS;
15769 _PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
15771 ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW");
15772 ndr->depth++;
15773 if (flags & NDR_SET_VALUES) {
15774 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15776 if (flags & NDR_IN) {
15777 ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW");
15778 ndr->depth++;
15779 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15780 ndr->depth++;
15781 if (r->in.server_name) {
15782 ndr_print_string(ndr, "server_name", r->in.server_name);
15784 ndr->depth--;
15785 ndr->depth--;
15787 if (flags & NDR_OUT) {
15788 ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW");
15789 ndr->depth++;
15790 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15791 ndr->depth++;
15792 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
15793 ndr->depth++;
15794 if (*r->out.ctr) {
15795 ndr_print_DcSitesCtr(ndr, "ctr", *r->out.ctr);
15797 ndr->depth--;
15798 ndr->depth--;
15799 ndr_print_WERROR(ndr, "result", r->out.result);
15800 ndr->depth--;
15802 ndr->depth--;
15805 static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r)
15807 if (flags & NDR_IN) {
15808 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15809 if (r->in.server_name) {
15810 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15811 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15812 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15813 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));
15815 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
15816 if (r->in.computer_name) {
15817 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15818 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15819 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15820 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));
15822 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
15823 if (r->in.logon == NULL) {
15824 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15826 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
15827 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
15828 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
15829 if (r->in.flags == NULL) {
15830 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15832 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags));
15834 if (flags & NDR_OUT) {
15835 if (r->out.validation == NULL) {
15836 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15838 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
15839 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
15840 if (r->out.authoritative == NULL) {
15841 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15843 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
15844 if (r->out.flags == NULL) {
15845 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15847 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
15848 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
15850 return NDR_ERR_SUCCESS;
15853 static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r)
15855 uint32_t _ptr_server_name;
15856 uint32_t size_server_name_1 = 0;
15857 uint32_t length_server_name_1 = 0;
15858 uint32_t _ptr_computer_name;
15859 uint32_t size_computer_name_1 = 0;
15860 uint32_t length_computer_name_1 = 0;
15861 TALLOC_CTX *_mem_save_server_name_0;
15862 TALLOC_CTX *_mem_save_computer_name_0;
15863 TALLOC_CTX *_mem_save_logon_0;
15864 TALLOC_CTX *_mem_save_validation_0;
15865 TALLOC_CTX *_mem_save_authoritative_0;
15866 TALLOC_CTX *_mem_save_flags_0;
15867 if (flags & NDR_IN) {
15868 ZERO_STRUCT(r->out);
15870 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15871 if (_ptr_server_name) {
15872 NDR_PULL_ALLOC(ndr, r->in.server_name);
15873 } else {
15874 r->in.server_name = NULL;
15876 if (r->in.server_name) {
15877 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15878 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15879 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15880 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15881 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
15882 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
15883 if (length_server_name_1 > size_server_name_1) {
15884 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
15886 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
15887 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
15888 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15890 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
15891 if (_ptr_computer_name) {
15892 NDR_PULL_ALLOC(ndr, r->in.computer_name);
15893 } else {
15894 r->in.computer_name = NULL;
15896 if (r->in.computer_name) {
15897 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15898 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
15899 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
15900 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
15901 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
15902 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
15903 if (length_computer_name_1 > size_computer_name_1) {
15904 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
15906 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
15907 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
15908 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
15910 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
15911 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15912 NDR_PULL_ALLOC(ndr, r->in.logon);
15914 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
15915 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
15916 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
15917 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
15918 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
15919 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
15920 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15921 NDR_PULL_ALLOC(ndr, r->in.flags);
15923 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
15924 NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC);
15925 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags));
15926 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
15927 NDR_PULL_ALLOC(ndr, r->out.validation);
15928 ZERO_STRUCTP(r->out.validation);
15929 NDR_PULL_ALLOC(ndr, r->out.authoritative);
15930 ZERO_STRUCTP(r->out.authoritative);
15931 NDR_PULL_ALLOC(ndr, r->out.flags);
15932 *r->out.flags = *r->in.flags;
15934 if (flags & NDR_OUT) {
15935 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15936 NDR_PULL_ALLOC(ndr, r->out.validation);
15938 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
15939 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
15940 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
15941 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
15942 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
15943 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15944 NDR_PULL_ALLOC(ndr, r->out.authoritative);
15946 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
15947 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
15948 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
15949 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
15950 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15951 NDR_PULL_ALLOC(ndr, r->out.flags);
15953 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
15954 NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC);
15955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags));
15956 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
15957 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
15959 return NDR_ERR_SUCCESS;
15962 _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r)
15964 ndr_print_struct(ndr, name, "netr_LogonSamLogonEx");
15965 ndr->depth++;
15966 if (flags & NDR_SET_VALUES) {
15967 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15969 if (flags & NDR_IN) {
15970 ndr_print_struct(ndr, "in", "netr_LogonSamLogonEx");
15971 ndr->depth++;
15972 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15973 ndr->depth++;
15974 if (r->in.server_name) {
15975 ndr_print_string(ndr, "server_name", r->in.server_name);
15977 ndr->depth--;
15978 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
15979 ndr->depth++;
15980 if (r->in.computer_name) {
15981 ndr_print_string(ndr, "computer_name", r->in.computer_name);
15983 ndr->depth--;
15984 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
15985 ndr_print_ptr(ndr, "logon", r->in.logon);
15986 ndr->depth++;
15987 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
15988 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
15989 ndr->depth--;
15990 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
15991 ndr_print_ptr(ndr, "flags", r->in.flags);
15992 ndr->depth++;
15993 ndr_print_uint32(ndr, "flags", *r->in.flags);
15994 ndr->depth--;
15995 ndr->depth--;
15997 if (flags & NDR_OUT) {
15998 ndr_print_struct(ndr, "out", "netr_LogonSamLogonEx");
15999 ndr->depth++;
16000 ndr_print_ptr(ndr, "validation", r->out.validation);
16001 ndr->depth++;
16002 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
16003 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
16004 ndr->depth--;
16005 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
16006 ndr->depth++;
16007 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
16008 ndr->depth--;
16009 ndr_print_ptr(ndr, "flags", r->out.flags);
16010 ndr->depth++;
16011 ndr_print_uint32(ndr, "flags", *r->out.flags);
16012 ndr->depth--;
16013 ndr_print_NTSTATUS(ndr, "result", r->out.result);
16014 ndr->depth--;
16016 ndr->depth--;
16019 static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
16021 if (flags & NDR_IN) {
16022 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16023 if (r->in.server_name) {
16024 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16025 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16026 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16027 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));
16029 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags));
16031 if (flags & NDR_OUT) {
16032 if (r->out.trusts == NULL) {
16033 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16035 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
16036 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16038 return NDR_ERR_SUCCESS;
16041 static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r)
16043 uint32_t _ptr_server_name;
16044 uint32_t size_server_name_1 = 0;
16045 uint32_t length_server_name_1 = 0;
16046 TALLOC_CTX *_mem_save_server_name_0;
16047 TALLOC_CTX *_mem_save_trusts_0;
16048 if (flags & NDR_IN) {
16049 ZERO_STRUCT(r->out);
16051 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16052 if (_ptr_server_name) {
16053 NDR_PULL_ALLOC(ndr, r->in.server_name);
16054 } else {
16055 r->in.server_name = NULL;
16057 if (r->in.server_name) {
16058 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16059 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16060 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16061 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16062 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16063 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16064 if (length_server_name_1 > size_server_name_1) {
16065 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16067 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16068 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16069 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16071 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags));
16072 NDR_PULL_ALLOC(ndr, r->out.trusts);
16073 ZERO_STRUCTP(r->out.trusts);
16075 if (flags & NDR_OUT) {
16076 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16077 NDR_PULL_ALLOC(ndr, r->out.trusts);
16079 _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr);
16080 NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC);
16081 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
16082 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC);
16083 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16085 return NDR_ERR_SUCCESS;
16088 _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
16090 ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts");
16091 ndr->depth++;
16092 if (flags & NDR_SET_VALUES) {
16093 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16095 if (flags & NDR_IN) {
16096 ndr_print_struct(ndr, "in", "netr_DsrEnumerateDomainTrusts");
16097 ndr->depth++;
16098 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16099 ndr->depth++;
16100 if (r->in.server_name) {
16101 ndr_print_string(ndr, "server_name", r->in.server_name);
16103 ndr->depth--;
16104 ndr_print_netr_TrustFlags(ndr, "trust_flags", r->in.trust_flags);
16105 ndr->depth--;
16107 if (flags & NDR_OUT) {
16108 ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts");
16109 ndr->depth++;
16110 ndr_print_ptr(ndr, "trusts", r->out.trusts);
16111 ndr->depth++;
16112 ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts);
16113 ndr->depth--;
16114 ndr_print_WERROR(ndr, "result", r->out.result);
16115 ndr->depth--;
16117 ndr->depth--;
16120 static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
16122 if (flags & NDR_IN) {
16123 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16124 if (r->in.server_name) {
16125 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16126 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16127 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16128 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));
16130 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain));
16131 if (r->in.domain) {
16132 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
16133 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16134 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
16135 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
16137 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
16138 if (r->in.domain_guid) {
16139 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
16141 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid));
16142 if (r->in.dsa_guid) {
16143 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.dsa_guid));
16145 if (r->in.dns_host == NULL) {
16146 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16148 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
16149 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16150 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
16151 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_host, ndr_charset_length(r->in.dns_host, CH_UTF16), sizeof(uint16_t), CH_UTF16));
16153 if (flags & NDR_OUT) {
16154 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16156 return NDR_ERR_SUCCESS;
16159 static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r)
16161 uint32_t _ptr_server_name;
16162 uint32_t size_server_name_1 = 0;
16163 uint32_t length_server_name_1 = 0;
16164 uint32_t _ptr_domain;
16165 uint32_t size_domain_1 = 0;
16166 uint32_t length_domain_1 = 0;
16167 uint32_t _ptr_domain_guid;
16168 uint32_t _ptr_dsa_guid;
16169 uint32_t size_dns_host_1 = 0;
16170 uint32_t length_dns_host_1 = 0;
16171 TALLOC_CTX *_mem_save_server_name_0;
16172 TALLOC_CTX *_mem_save_domain_0;
16173 TALLOC_CTX *_mem_save_domain_guid_0;
16174 TALLOC_CTX *_mem_save_dsa_guid_0;
16175 if (flags & NDR_IN) {
16176 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16177 if (_ptr_server_name) {
16178 NDR_PULL_ALLOC(ndr, r->in.server_name);
16179 } else {
16180 r->in.server_name = NULL;
16182 if (r->in.server_name) {
16183 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16184 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16185 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16186 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16187 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16188 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16189 if (length_server_name_1 > size_server_name_1) {
16190 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16192 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16193 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16194 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16196 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
16197 if (_ptr_domain) {
16198 NDR_PULL_ALLOC(ndr, r->in.domain);
16199 } else {
16200 r->in.domain = NULL;
16202 if (r->in.domain) {
16203 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
16204 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0);
16205 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
16206 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
16207 size_domain_1 = ndr_get_array_size(ndr, &r->in.domain);
16208 length_domain_1 = ndr_get_array_length(ndr, &r->in.domain);
16209 if (length_domain_1 > size_domain_1) {
16210 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
16212 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint16_t)));
16213 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, length_domain_1, sizeof(uint16_t), CH_UTF16));
16214 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
16216 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
16217 if (_ptr_domain_guid) {
16218 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
16219 } else {
16220 r->in.domain_guid = NULL;
16222 if (r->in.domain_guid) {
16223 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
16224 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
16225 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
16226 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
16228 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid));
16229 if (_ptr_dsa_guid) {
16230 NDR_PULL_ALLOC(ndr, r->in.dsa_guid);
16231 } else {
16232 r->in.dsa_guid = NULL;
16234 if (r->in.dsa_guid) {
16235 _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
16236 NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0);
16237 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.dsa_guid));
16238 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0);
16240 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host));
16241 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host));
16242 size_dns_host_1 = ndr_get_array_size(ndr, &r->in.dns_host);
16243 length_dns_host_1 = ndr_get_array_length(ndr, &r->in.dns_host);
16244 if (length_dns_host_1 > size_dns_host_1) {
16245 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dns_host_1, length_dns_host_1);
16247 NDR_CHECK(ndr_check_string_terminator(ndr, length_dns_host_1, sizeof(uint16_t)));
16248 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, length_dns_host_1, sizeof(uint16_t), CH_UTF16));
16250 if (flags & NDR_OUT) {
16251 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16253 return NDR_ERR_SUCCESS;
16256 _PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
16258 ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords");
16259 ndr->depth++;
16260 if (flags & NDR_SET_VALUES) {
16261 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16263 if (flags & NDR_IN) {
16264 ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords");
16265 ndr->depth++;
16266 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16267 ndr->depth++;
16268 if (r->in.server_name) {
16269 ndr_print_string(ndr, "server_name", r->in.server_name);
16271 ndr->depth--;
16272 ndr_print_ptr(ndr, "domain", r->in.domain);
16273 ndr->depth++;
16274 if (r->in.domain) {
16275 ndr_print_string(ndr, "domain", r->in.domain);
16277 ndr->depth--;
16278 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
16279 ndr->depth++;
16280 if (r->in.domain_guid) {
16281 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
16283 ndr->depth--;
16284 ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid);
16285 ndr->depth++;
16286 if (r->in.dsa_guid) {
16287 ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid);
16289 ndr->depth--;
16290 ndr_print_ptr(ndr, "dns_host", r->in.dns_host);
16291 ndr->depth++;
16292 ndr_print_string(ndr, "dns_host", r->in.dns_host);
16293 ndr->depth--;
16294 ndr->depth--;
16296 if (flags & NDR_OUT) {
16297 ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords");
16298 ndr->depth++;
16299 ndr_print_WERROR(ndr, "result", r->out.result);
16300 ndr->depth--;
16302 ndr->depth--;
16305 static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r)
16307 if (flags & NDR_IN) {
16308 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16309 if (r->in.server_name) {
16310 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16311 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16312 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16313 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));
16315 if (r->in.account_name == NULL) {
16316 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16318 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
16319 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16320 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
16321 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));
16322 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
16323 if (r->in.computer_name == NULL) {
16324 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16326 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16327 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16328 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16329 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));
16330 if (r->in.credential == NULL) {
16331 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16333 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16335 if (flags & NDR_OUT) {
16336 if (r->out.return_authenticator == NULL) {
16337 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16339 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16340 if (r->out.password == NULL) {
16341 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16343 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password));
16344 if (r->out.password2 == NULL) {
16345 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16347 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password2));
16348 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
16350 return NDR_ERR_SUCCESS;
16353 static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r)
16355 uint32_t _ptr_server_name;
16356 uint32_t size_server_name_1 = 0;
16357 uint32_t length_server_name_1 = 0;
16358 uint32_t size_account_name_1 = 0;
16359 uint32_t length_account_name_1 = 0;
16360 uint32_t size_computer_name_1 = 0;
16361 uint32_t length_computer_name_1 = 0;
16362 TALLOC_CTX *_mem_save_server_name_0;
16363 TALLOC_CTX *_mem_save_credential_0;
16364 TALLOC_CTX *_mem_save_return_authenticator_0;
16365 TALLOC_CTX *_mem_save_password_0;
16366 TALLOC_CTX *_mem_save_password2_0;
16367 if (flags & NDR_IN) {
16368 ZERO_STRUCT(r->out);
16370 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16371 if (_ptr_server_name) {
16372 NDR_PULL_ALLOC(ndr, r->in.server_name);
16373 } else {
16374 r->in.server_name = NULL;
16376 if (r->in.server_name) {
16377 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16378 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16379 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16380 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16381 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16382 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16383 if (length_server_name_1 > size_server_name_1) {
16384 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16386 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16387 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16388 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16390 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
16391 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
16392 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
16393 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
16394 if (length_account_name_1 > size_account_name_1) {
16395 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
16397 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
16398 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
16399 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
16400 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
16401 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
16402 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
16403 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
16404 if (length_computer_name_1 > size_computer_name_1) {
16405 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
16407 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
16408 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
16409 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16410 NDR_PULL_ALLOC(ndr, r->in.credential);
16412 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16413 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
16414 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16415 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
16416 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16417 ZERO_STRUCTP(r->out.return_authenticator);
16418 NDR_PULL_ALLOC(ndr, r->out.password);
16419 ZERO_STRUCTP(r->out.password);
16420 NDR_PULL_ALLOC(ndr, r->out.password2);
16421 ZERO_STRUCTP(r->out.password2);
16423 if (flags & NDR_OUT) {
16424 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16425 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16427 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16428 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
16429 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16430 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
16431 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16432 NDR_PULL_ALLOC(ndr, r->out.password);
16434 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
16435 NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
16436 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password));
16437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
16438 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16439 NDR_PULL_ALLOC(ndr, r->out.password2);
16441 _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr);
16442 NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC);
16443 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password2));
16444 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC);
16445 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
16447 return NDR_ERR_SUCCESS;
16450 _PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r)
16452 ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet");
16453 ndr->depth++;
16454 if (flags & NDR_SET_VALUES) {
16455 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16457 if (flags & NDR_IN) {
16458 ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet");
16459 ndr->depth++;
16460 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16461 ndr->depth++;
16462 if (r->in.server_name) {
16463 ndr_print_string(ndr, "server_name", r->in.server_name);
16465 ndr->depth--;
16466 ndr_print_ptr(ndr, "account_name", r->in.account_name);
16467 ndr->depth++;
16468 ndr_print_string(ndr, "account_name", r->in.account_name);
16469 ndr->depth--;
16470 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
16471 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
16472 ndr->depth++;
16473 ndr_print_string(ndr, "computer_name", r->in.computer_name);
16474 ndr->depth--;
16475 ndr_print_ptr(ndr, "credential", r->in.credential);
16476 ndr->depth++;
16477 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
16478 ndr->depth--;
16479 ndr->depth--;
16481 if (flags & NDR_OUT) {
16482 ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet");
16483 ndr->depth++;
16484 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
16485 ndr->depth++;
16486 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
16487 ndr->depth--;
16488 ndr_print_ptr(ndr, "password", r->out.password);
16489 ndr->depth++;
16490 ndr_print_samr_Password(ndr, "password", r->out.password);
16491 ndr->depth--;
16492 ndr_print_ptr(ndr, "password2", r->out.password2);
16493 ndr->depth++;
16494 ndr_print_samr_Password(ndr, "password2", r->out.password2);
16495 ndr->depth--;
16496 ndr_print_NTSTATUS(ndr, "result", r->out.result);
16497 ndr->depth--;
16499 ndr->depth--;
16502 static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r)
16504 if (flags & NDR_IN) {
16505 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16506 if (r->in.server_name) {
16507 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16508 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16509 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16510 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));
16512 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name));
16513 if (r->in.trusted_domain_name) {
16514 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16515 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16516 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16517 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));
16519 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
16521 if (flags & NDR_OUT) {
16522 if (r->out.forest_trust_info == NULL) {
16523 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16525 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
16526 if (*r->out.forest_trust_info) {
16527 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16529 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16531 return NDR_ERR_SUCCESS;
16534 static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r)
16536 uint32_t _ptr_server_name;
16537 uint32_t size_server_name_1 = 0;
16538 uint32_t length_server_name_1 = 0;
16539 uint32_t _ptr_trusted_domain_name;
16540 uint32_t size_trusted_domain_name_1 = 0;
16541 uint32_t length_trusted_domain_name_1 = 0;
16542 uint32_t _ptr_forest_trust_info;
16543 TALLOC_CTX *_mem_save_server_name_0;
16544 TALLOC_CTX *_mem_save_trusted_domain_name_0;
16545 TALLOC_CTX *_mem_save_forest_trust_info_0;
16546 TALLOC_CTX *_mem_save_forest_trust_info_1;
16547 if (flags & NDR_IN) {
16548 ZERO_STRUCT(r->out);
16550 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16551 if (_ptr_server_name) {
16552 NDR_PULL_ALLOC(ndr, r->in.server_name);
16553 } else {
16554 r->in.server_name = NULL;
16556 if (r->in.server_name) {
16557 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16558 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16559 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16560 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16561 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16562 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16563 if (length_server_name_1 > size_server_name_1) {
16564 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16566 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16567 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16568 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16570 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name));
16571 if (_ptr_trusted_domain_name) {
16572 NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name);
16573 } else {
16574 r->in.trusted_domain_name = NULL;
16576 if (r->in.trusted_domain_name) {
16577 _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16578 NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0);
16579 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
16580 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
16581 size_trusted_domain_name_1 = ndr_get_array_size(ndr, &r->in.trusted_domain_name);
16582 length_trusted_domain_name_1 = ndr_get_array_length(ndr, &r->in.trusted_domain_name);
16583 if (length_trusted_domain_name_1 > size_trusted_domain_name_1) {
16584 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_trusted_domain_name_1, length_trusted_domain_name_1);
16586 NDR_CHECK(ndr_check_string_terminator(ndr, length_trusted_domain_name_1, sizeof(uint16_t)));
16587 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, length_trusted_domain_name_1, sizeof(uint16_t), CH_UTF16));
16588 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0);
16590 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
16591 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16592 ZERO_STRUCTP(r->out.forest_trust_info);
16594 if (flags & NDR_OUT) {
16595 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16596 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16598 _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
16599 NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
16600 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
16601 if (_ptr_forest_trust_info) {
16602 NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
16603 } else {
16604 *r->out.forest_trust_info = NULL;
16606 if (*r->out.forest_trust_info) {
16607 _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
16608 NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
16609 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16610 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
16612 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
16613 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16615 return NDR_ERR_SUCCESS;
16618 _PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r)
16620 ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation");
16621 ndr->depth++;
16622 if (flags & NDR_SET_VALUES) {
16623 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16625 if (flags & NDR_IN) {
16626 ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation");
16627 ndr->depth++;
16628 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16629 ndr->depth++;
16630 if (r->in.server_name) {
16631 ndr_print_string(ndr, "server_name", r->in.server_name);
16633 ndr->depth--;
16634 ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16635 ndr->depth++;
16636 if (r->in.trusted_domain_name) {
16637 ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16639 ndr->depth--;
16640 ndr_print_uint32(ndr, "flags", r->in.flags);
16641 ndr->depth--;
16643 if (flags & NDR_OUT) {
16644 ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation");
16645 ndr->depth++;
16646 ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
16647 ndr->depth++;
16648 ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
16649 ndr->depth++;
16650 if (*r->out.forest_trust_info) {
16651 ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
16653 ndr->depth--;
16654 ndr->depth--;
16655 ndr_print_WERROR(ndr, "result", r->out.result);
16656 ndr->depth--;
16658 ndr->depth--;
16661 static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r)
16663 if (flags & NDR_IN) {
16664 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16665 if (r->in.server_name) {
16666 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16667 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16668 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16669 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));
16671 if (r->in.trusted_domain_name == NULL) {
16672 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16674 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16675 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16676 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16677 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));
16678 if (r->in.credential == NULL) {
16679 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16681 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16682 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
16684 if (flags & NDR_OUT) {
16685 if (r->out.return_authenticator == NULL) {
16686 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16688 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16689 if (r->out.forest_trust_info == NULL) {
16690 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16692 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
16693 if (*r->out.forest_trust_info) {
16694 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16696 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16698 return NDR_ERR_SUCCESS;
16701 static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r)
16703 uint32_t _ptr_server_name;
16704 uint32_t size_server_name_1 = 0;
16705 uint32_t length_server_name_1 = 0;
16706 uint32_t size_trusted_domain_name_1 = 0;
16707 uint32_t length_trusted_domain_name_1 = 0;
16708 uint32_t _ptr_forest_trust_info;
16709 TALLOC_CTX *_mem_save_server_name_0;
16710 TALLOC_CTX *_mem_save_credential_0;
16711 TALLOC_CTX *_mem_save_return_authenticator_0;
16712 TALLOC_CTX *_mem_save_forest_trust_info_0;
16713 TALLOC_CTX *_mem_save_forest_trust_info_1;
16714 if (flags & NDR_IN) {
16715 ZERO_STRUCT(r->out);
16717 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16718 if (_ptr_server_name) {
16719 NDR_PULL_ALLOC(ndr, r->in.server_name);
16720 } else {
16721 r->in.server_name = NULL;
16723 if (r->in.server_name) {
16724 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16725 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16726 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16727 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16728 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16729 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16730 if (length_server_name_1 > size_server_name_1) {
16731 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16733 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16734 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16735 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16737 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
16738 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
16739 size_trusted_domain_name_1 = ndr_get_array_size(ndr, &r->in.trusted_domain_name);
16740 length_trusted_domain_name_1 = ndr_get_array_length(ndr, &r->in.trusted_domain_name);
16741 if (length_trusted_domain_name_1 > size_trusted_domain_name_1) {
16742 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_trusted_domain_name_1, length_trusted_domain_name_1);
16744 NDR_CHECK(ndr_check_string_terminator(ndr, length_trusted_domain_name_1, sizeof(uint16_t)));
16745 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, length_trusted_domain_name_1, sizeof(uint16_t), CH_UTF16));
16746 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16747 NDR_PULL_ALLOC(ndr, r->in.credential);
16749 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16750 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
16751 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16752 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
16753 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
16754 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16755 ZERO_STRUCTP(r->out.return_authenticator);
16756 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16757 ZERO_STRUCTP(r->out.forest_trust_info);
16759 if (flags & NDR_OUT) {
16760 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16761 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16763 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16764 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
16765 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16766 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
16767 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16768 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16770 _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
16771 NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
16772 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
16773 if (_ptr_forest_trust_info) {
16774 NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
16775 } else {
16776 *r->out.forest_trust_info = NULL;
16778 if (*r->out.forest_trust_info) {
16779 _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
16780 NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
16781 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16782 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
16784 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
16785 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16787 return NDR_ERR_SUCCESS;
16790 _PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r)
16792 ndr_print_struct(ndr, name, "netr_GetForestTrustInformation");
16793 ndr->depth++;
16794 if (flags & NDR_SET_VALUES) {
16795 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16797 if (flags & NDR_IN) {
16798 ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation");
16799 ndr->depth++;
16800 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16801 ndr->depth++;
16802 if (r->in.server_name) {
16803 ndr_print_string(ndr, "server_name", r->in.server_name);
16805 ndr->depth--;
16806 ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16807 ndr->depth++;
16808 ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16809 ndr->depth--;
16810 ndr_print_ptr(ndr, "credential", r->in.credential);
16811 ndr->depth++;
16812 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
16813 ndr->depth--;
16814 ndr_print_uint32(ndr, "flags", r->in.flags);
16815 ndr->depth--;
16817 if (flags & NDR_OUT) {
16818 ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation");
16819 ndr->depth++;
16820 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
16821 ndr->depth++;
16822 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
16823 ndr->depth--;
16824 ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
16825 ndr->depth++;
16826 ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
16827 ndr->depth++;
16828 if (*r->out.forest_trust_info) {
16829 ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
16831 ndr->depth--;
16832 ndr->depth--;
16833 ndr_print_WERROR(ndr, "result", r->out.result);
16834 ndr->depth--;
16836 ndr->depth--;
16839 static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r)
16841 if (flags & NDR_IN) {
16842 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16843 if (r->in.server_name) {
16844 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16845 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16846 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16847 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));
16849 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
16850 if (r->in.computer_name) {
16851 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16852 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16853 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16854 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));
16856 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
16857 if (r->in.credential) {
16858 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16860 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
16861 if (r->in.return_authenticator) {
16862 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
16864 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
16865 if (r->in.logon == NULL) {
16866 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16868 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
16869 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
16870 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
16871 if (r->in.flags == NULL) {
16872 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16874 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags));
16876 if (flags & NDR_OUT) {
16877 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
16878 if (r->out.return_authenticator) {
16879 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16881 if (r->out.validation == NULL) {
16882 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16884 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
16885 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
16886 if (r->out.authoritative == NULL) {
16887 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16889 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
16890 if (r->out.flags == NULL) {
16891 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16893 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
16894 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
16896 return NDR_ERR_SUCCESS;
16899 static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r)
16901 uint32_t _ptr_server_name;
16902 uint32_t size_server_name_1 = 0;
16903 uint32_t length_server_name_1 = 0;
16904 uint32_t _ptr_computer_name;
16905 uint32_t size_computer_name_1 = 0;
16906 uint32_t length_computer_name_1 = 0;
16907 uint32_t _ptr_credential;
16908 uint32_t _ptr_return_authenticator;
16909 TALLOC_CTX *_mem_save_server_name_0;
16910 TALLOC_CTX *_mem_save_computer_name_0;
16911 TALLOC_CTX *_mem_save_credential_0;
16912 TALLOC_CTX *_mem_save_return_authenticator_0;
16913 TALLOC_CTX *_mem_save_logon_0;
16914 TALLOC_CTX *_mem_save_validation_0;
16915 TALLOC_CTX *_mem_save_authoritative_0;
16916 TALLOC_CTX *_mem_save_flags_0;
16917 if (flags & NDR_IN) {
16918 ZERO_STRUCT(r->out);
16920 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16921 if (_ptr_server_name) {
16922 NDR_PULL_ALLOC(ndr, r->in.server_name);
16923 } else {
16924 r->in.server_name = NULL;
16926 if (r->in.server_name) {
16927 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16928 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16929 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16930 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16931 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
16932 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
16933 if (length_server_name_1 > size_server_name_1) {
16934 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
16936 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
16937 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
16938 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16940 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
16941 if (_ptr_computer_name) {
16942 NDR_PULL_ALLOC(ndr, r->in.computer_name);
16943 } else {
16944 r->in.computer_name = NULL;
16946 if (r->in.computer_name) {
16947 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16948 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
16949 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
16950 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
16951 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
16952 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
16953 if (length_computer_name_1 > size_computer_name_1) {
16954 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
16956 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
16957 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
16958 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
16960 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
16961 if (_ptr_credential) {
16962 NDR_PULL_ALLOC(ndr, r->in.credential);
16963 } else {
16964 r->in.credential = NULL;
16966 if (r->in.credential) {
16967 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16968 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
16969 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16970 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
16972 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
16973 if (_ptr_return_authenticator) {
16974 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
16975 } else {
16976 r->in.return_authenticator = NULL;
16978 if (r->in.return_authenticator) {
16979 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16980 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
16981 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
16982 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
16984 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
16985 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16986 NDR_PULL_ALLOC(ndr, r->in.logon);
16988 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
16989 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
16990 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
16991 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
16992 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
16993 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
16994 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16995 NDR_PULL_ALLOC(ndr, r->in.flags);
16997 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
16998 NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC);
16999 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags));
17000 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
17001 NDR_PULL_ALLOC(ndr, r->out.validation);
17002 ZERO_STRUCTP(r->out.validation);
17003 NDR_PULL_ALLOC(ndr, r->out.authoritative);
17004 ZERO_STRUCTP(r->out.authoritative);
17005 NDR_PULL_ALLOC(ndr, r->out.flags);
17006 *r->out.flags = *r->in.flags;
17008 if (flags & NDR_OUT) {
17009 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
17010 if (_ptr_return_authenticator) {
17011 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
17012 } else {
17013 r->out.return_authenticator = NULL;
17015 if (r->out.return_authenticator) {
17016 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
17017 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
17018 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
17019 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
17021 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17022 NDR_PULL_ALLOC(ndr, r->out.validation);
17024 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
17025 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
17026 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
17027 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
17028 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
17029 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17030 NDR_PULL_ALLOC(ndr, r->out.authoritative);
17032 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
17033 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
17034 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
17035 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
17036 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17037 NDR_PULL_ALLOC(ndr, r->out.flags);
17039 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
17040 NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC);
17041 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags));
17042 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
17043 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
17045 return NDR_ERR_SUCCESS;
17048 _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r)
17050 ndr_print_struct(ndr, name, "netr_LogonSamLogonWithFlags");
17051 ndr->depth++;
17052 if (flags & NDR_SET_VALUES) {
17053 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
17055 if (flags & NDR_IN) {
17056 ndr_print_struct(ndr, "in", "netr_LogonSamLogonWithFlags");
17057 ndr->depth++;
17058 ndr_print_ptr(ndr, "server_name", r->in.server_name);
17059 ndr->depth++;
17060 if (r->in.server_name) {
17061 ndr_print_string(ndr, "server_name", r->in.server_name);
17063 ndr->depth--;
17064 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
17065 ndr->depth++;
17066 if (r->in.computer_name) {
17067 ndr_print_string(ndr, "computer_name", r->in.computer_name);
17069 ndr->depth--;
17070 ndr_print_ptr(ndr, "credential", r->in.credential);
17071 ndr->depth++;
17072 if (r->in.credential) {
17073 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
17075 ndr->depth--;
17076 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
17077 ndr->depth++;
17078 if (r->in.return_authenticator) {
17079 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
17081 ndr->depth--;
17082 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
17083 ndr_print_ptr(ndr, "logon", r->in.logon);
17084 ndr->depth++;
17085 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
17086 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
17087 ndr->depth--;
17088 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
17089 ndr_print_ptr(ndr, "flags", r->in.flags);
17090 ndr->depth++;
17091 ndr_print_uint32(ndr, "flags", *r->in.flags);
17092 ndr->depth--;
17093 ndr->depth--;
17095 if (flags & NDR_OUT) {
17096 ndr_print_struct(ndr, "out", "netr_LogonSamLogonWithFlags");
17097 ndr->depth++;
17098 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
17099 ndr->depth++;
17100 if (r->out.return_authenticator) {
17101 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
17103 ndr->depth--;
17104 ndr_print_ptr(ndr, "validation", r->out.validation);
17105 ndr->depth++;
17106 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
17107 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
17108 ndr->depth--;
17109 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
17110 ndr->depth++;
17111 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
17112 ndr->depth--;
17113 ndr_print_ptr(ndr, "flags", r->out.flags);
17114 ndr->depth++;
17115 ndr_print_uint32(ndr, "flags", *r->out.flags);
17116 ndr->depth--;
17117 ndr_print_NTSTATUS(ndr, "result", r->out.result);
17118 ndr->depth--;
17120 ndr->depth--;
17123 static enum ndr_err_code ndr_push_netr_ServerGetTrustInfo(struct ndr_push *ndr, int flags, const struct netr_ServerGetTrustInfo *r)
17125 if (flags & NDR_IN) {
17126 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
17127 if (r->in.server_name) {
17128 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
17129 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
17130 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
17131 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));
17133 if (r->in.account_name == NULL) {
17134 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17136 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
17137 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
17138 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
17139 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));
17140 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
17141 if (r->in.computer_name == NULL) {
17142 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17144 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
17145 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
17146 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
17147 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));
17148 if (r->in.credential == NULL) {
17149 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17151 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
17153 if (flags & NDR_OUT) {
17154 if (r->out.return_authenticator == NULL) {
17155 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17157 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
17158 if (r->out.new_owf_password == NULL) {
17159 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17161 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
17162 if (r->out.old_owf_password == NULL) {
17163 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17165 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
17166 if (r->out.trust_info == NULL) {
17167 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
17169 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.trust_info));
17170 if (*r->out.trust_info) {
17171 NDR_CHECK(ndr_push_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
17173 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
17175 return NDR_ERR_SUCCESS;
17178 static enum ndr_err_code ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull *ndr, int flags, struct netr_ServerGetTrustInfo *r)
17180 uint32_t _ptr_server_name;
17181 uint32_t size_server_name_1 = 0;
17182 uint32_t length_server_name_1 = 0;
17183 uint32_t size_account_name_1 = 0;
17184 uint32_t length_account_name_1 = 0;
17185 uint32_t size_computer_name_1 = 0;
17186 uint32_t length_computer_name_1 = 0;
17187 uint32_t _ptr_trust_info;
17188 TALLOC_CTX *_mem_save_server_name_0;
17189 TALLOC_CTX *_mem_save_credential_0;
17190 TALLOC_CTX *_mem_save_return_authenticator_0;
17191 TALLOC_CTX *_mem_save_new_owf_password_0;
17192 TALLOC_CTX *_mem_save_old_owf_password_0;
17193 TALLOC_CTX *_mem_save_trust_info_0;
17194 TALLOC_CTX *_mem_save_trust_info_1;
17195 if (flags & NDR_IN) {
17196 ZERO_STRUCT(r->out);
17198 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
17199 if (_ptr_server_name) {
17200 NDR_PULL_ALLOC(ndr, r->in.server_name);
17201 } else {
17202 r->in.server_name = NULL;
17204 if (r->in.server_name) {
17205 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
17206 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
17207 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
17208 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
17209 size_server_name_1 = ndr_get_array_size(ndr, &r->in.server_name);
17210 length_server_name_1 = ndr_get_array_length(ndr, &r->in.server_name);
17211 if (length_server_name_1 > size_server_name_1) {
17212 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
17214 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint16_t)));
17215 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, length_server_name_1, sizeof(uint16_t), CH_UTF16));
17216 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
17218 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
17219 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
17220 size_account_name_1 = ndr_get_array_size(ndr, &r->in.account_name);
17221 length_account_name_1 = ndr_get_array_length(ndr, &r->in.account_name);
17222 if (length_account_name_1 > size_account_name_1) {
17223 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_account_name_1, length_account_name_1);
17225 NDR_CHECK(ndr_check_string_terminator(ndr, length_account_name_1, sizeof(uint16_t)));
17226 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, length_account_name_1, sizeof(uint16_t), CH_UTF16));
17227 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
17228 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
17229 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
17230 size_computer_name_1 = ndr_get_array_size(ndr, &r->in.computer_name);
17231 length_computer_name_1 = ndr_get_array_length(ndr, &r->in.computer_name);
17232 if (length_computer_name_1 > size_computer_name_1) {
17233 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_computer_name_1, length_computer_name_1);
17235 NDR_CHECK(ndr_check_string_terminator(ndr, length_computer_name_1, sizeof(uint16_t)));
17236 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, length_computer_name_1, sizeof(uint16_t), CH_UTF16));
17237 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17238 NDR_PULL_ALLOC(ndr, r->in.credential);
17240 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
17241 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
17242 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
17243 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
17244 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
17245 ZERO_STRUCTP(r->out.return_authenticator);
17246 NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
17247 ZERO_STRUCTP(r->out.new_owf_password);
17248 NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
17249 ZERO_STRUCTP(r->out.old_owf_password);
17250 NDR_PULL_ALLOC(ndr, r->out.trust_info);
17251 ZERO_STRUCTP(r->out.trust_info);
17253 if (flags & NDR_OUT) {
17254 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17255 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
17257 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
17258 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
17259 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
17260 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
17261 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17262 NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
17264 _mem_save_new_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
17265 NDR_PULL_SET_MEM_CTX(ndr, r->out.new_owf_password, LIBNDR_FLAG_REF_ALLOC);
17266 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
17267 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
17268 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17269 NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
17271 _mem_save_old_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
17272 NDR_PULL_SET_MEM_CTX(ndr, r->out.old_owf_password, LIBNDR_FLAG_REF_ALLOC);
17273 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
17274 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
17275 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
17276 NDR_PULL_ALLOC(ndr, r->out.trust_info);
17278 _mem_save_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
17279 NDR_PULL_SET_MEM_CTX(ndr, r->out.trust_info, LIBNDR_FLAG_REF_ALLOC);
17280 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trust_info));
17281 if (_ptr_trust_info) {
17282 NDR_PULL_ALLOC(ndr, *r->out.trust_info);
17283 } else {
17284 *r->out.trust_info = NULL;
17286 if (*r->out.trust_info) {
17287 _mem_save_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
17288 NDR_PULL_SET_MEM_CTX(ndr, *r->out.trust_info, 0);
17289 NDR_CHECK(ndr_pull_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
17290 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_1, 0);
17292 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
17293 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
17295 return NDR_ERR_SUCCESS;
17298 _PUBLIC_ void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r)
17300 ndr_print_struct(ndr, name, "netr_ServerGetTrustInfo");
17301 ndr->depth++;
17302 if (flags & NDR_SET_VALUES) {
17303 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
17305 if (flags & NDR_IN) {
17306 ndr_print_struct(ndr, "in", "netr_ServerGetTrustInfo");
17307 ndr->depth++;
17308 ndr_print_ptr(ndr, "server_name", r->in.server_name);
17309 ndr->depth++;
17310 if (r->in.server_name) {
17311 ndr_print_string(ndr, "server_name", r->in.server_name);
17313 ndr->depth--;
17314 ndr_print_ptr(ndr, "account_name", r->in.account_name);
17315 ndr->depth++;
17316 ndr_print_string(ndr, "account_name", r->in.account_name);
17317 ndr->depth--;
17318 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
17319 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
17320 ndr->depth++;
17321 ndr_print_string(ndr, "computer_name", r->in.computer_name);
17322 ndr->depth--;
17323 ndr_print_ptr(ndr, "credential", r->in.credential);
17324 ndr->depth++;
17325 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
17326 ndr->depth--;
17327 ndr->depth--;
17329 if (flags & NDR_OUT) {
17330 ndr_print_struct(ndr, "out", "netr_ServerGetTrustInfo");
17331 ndr->depth++;
17332 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
17333 ndr->depth++;
17334 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
17335 ndr->depth--;
17336 ndr_print_ptr(ndr, "new_owf_password", r->out.new_owf_password);
17337 ndr->depth++;
17338 ndr_print_samr_Password(ndr, "new_owf_password", r->out.new_owf_password);
17339 ndr->depth--;
17340 ndr_print_ptr(ndr, "old_owf_password", r->out.old_owf_password);
17341 ndr->depth++;
17342 ndr_print_samr_Password(ndr, "old_owf_password", r->out.old_owf_password);
17343 ndr->depth--;
17344 ndr_print_ptr(ndr, "trust_info", r->out.trust_info);
17345 ndr->depth++;
17346 ndr_print_ptr(ndr, "trust_info", *r->out.trust_info);
17347 ndr->depth++;
17348 if (*r->out.trust_info) {
17349 ndr_print_netr_TrustInfo(ndr, "trust_info", *r->out.trust_info);
17351 ndr->depth--;
17352 ndr->depth--;
17353 ndr_print_NTSTATUS(ndr, "result", r->out.result);
17354 ndr->depth--;
17356 ndr->depth--;
17359 static const struct ndr_interface_call netlogon_calls[] = {
17361 "netr_LogonUasLogon",
17362 sizeof(struct netr_LogonUasLogon),
17363 (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogon,
17364 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogon,
17365 (ndr_print_function_t) ndr_print_netr_LogonUasLogon,
17366 false,
17369 "netr_LogonUasLogoff",
17370 sizeof(struct netr_LogonUasLogoff),
17371 (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogoff,
17372 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogoff,
17373 (ndr_print_function_t) ndr_print_netr_LogonUasLogoff,
17374 false,
17377 "netr_LogonSamLogon",
17378 sizeof(struct netr_LogonSamLogon),
17379 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogon,
17380 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogon,
17381 (ndr_print_function_t) ndr_print_netr_LogonSamLogon,
17382 false,
17385 "netr_LogonSamLogoff",
17386 sizeof(struct netr_LogonSamLogoff),
17387 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogoff,
17388 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogoff,
17389 (ndr_print_function_t) ndr_print_netr_LogonSamLogoff,
17390 false,
17393 "netr_ServerReqChallenge",
17394 sizeof(struct netr_ServerReqChallenge),
17395 (ndr_push_flags_fn_t) ndr_push_netr_ServerReqChallenge,
17396 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerReqChallenge,
17397 (ndr_print_function_t) ndr_print_netr_ServerReqChallenge,
17398 false,
17401 "netr_ServerAuthenticate",
17402 sizeof(struct netr_ServerAuthenticate),
17403 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate,
17404 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate,
17405 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate,
17406 false,
17409 "netr_ServerPasswordSet",
17410 sizeof(struct netr_ServerPasswordSet),
17411 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet,
17412 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet,
17413 (ndr_print_function_t) ndr_print_netr_ServerPasswordSet,
17414 false,
17417 "netr_DatabaseDeltas",
17418 sizeof(struct netr_DatabaseDeltas),
17419 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseDeltas,
17420 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseDeltas,
17421 (ndr_print_function_t) ndr_print_netr_DatabaseDeltas,
17422 false,
17425 "netr_DatabaseSync",
17426 sizeof(struct netr_DatabaseSync),
17427 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync,
17428 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync,
17429 (ndr_print_function_t) ndr_print_netr_DatabaseSync,
17430 false,
17433 "netr_AccountDeltas",
17434 sizeof(struct netr_AccountDeltas),
17435 (ndr_push_flags_fn_t) ndr_push_netr_AccountDeltas,
17436 (ndr_pull_flags_fn_t) ndr_pull_netr_AccountDeltas,
17437 (ndr_print_function_t) ndr_print_netr_AccountDeltas,
17438 false,
17441 "netr_AccountSync",
17442 sizeof(struct netr_AccountSync),
17443 (ndr_push_flags_fn_t) ndr_push_netr_AccountSync,
17444 (ndr_pull_flags_fn_t) ndr_pull_netr_AccountSync,
17445 (ndr_print_function_t) ndr_print_netr_AccountSync,
17446 false,
17449 "netr_GetDcName",
17450 sizeof(struct netr_GetDcName),
17451 (ndr_push_flags_fn_t) ndr_push_netr_GetDcName,
17452 (ndr_pull_flags_fn_t) ndr_pull_netr_GetDcName,
17453 (ndr_print_function_t) ndr_print_netr_GetDcName,
17454 false,
17457 "netr_LogonControl",
17458 sizeof(struct netr_LogonControl),
17459 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl,
17460 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl,
17461 (ndr_print_function_t) ndr_print_netr_LogonControl,
17462 false,
17465 "netr_GetAnyDCName",
17466 sizeof(struct netr_GetAnyDCName),
17467 (ndr_push_flags_fn_t) ndr_push_netr_GetAnyDCName,
17468 (ndr_pull_flags_fn_t) ndr_pull_netr_GetAnyDCName,
17469 (ndr_print_function_t) ndr_print_netr_GetAnyDCName,
17470 false,
17473 "netr_LogonControl2",
17474 sizeof(struct netr_LogonControl2),
17475 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2,
17476 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2,
17477 (ndr_print_function_t) ndr_print_netr_LogonControl2,
17478 false,
17481 "netr_ServerAuthenticate2",
17482 sizeof(struct netr_ServerAuthenticate2),
17483 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate2,
17484 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate2,
17485 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate2,
17486 false,
17489 "netr_DatabaseSync2",
17490 sizeof(struct netr_DatabaseSync2),
17491 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync2,
17492 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync2,
17493 (ndr_print_function_t) ndr_print_netr_DatabaseSync2,
17494 false,
17497 "netr_DatabaseRedo",
17498 sizeof(struct netr_DatabaseRedo),
17499 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseRedo,
17500 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseRedo,
17501 (ndr_print_function_t) ndr_print_netr_DatabaseRedo,
17502 false,
17505 "netr_LogonControl2Ex",
17506 sizeof(struct netr_LogonControl2Ex),
17507 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2Ex,
17508 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2Ex,
17509 (ndr_print_function_t) ndr_print_netr_LogonControl2Ex,
17510 false,
17513 "netr_NetrEnumerateTrustedDomains",
17514 sizeof(struct netr_NetrEnumerateTrustedDomains),
17515 (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains,
17516 (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains,
17517 (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains,
17518 false,
17521 "netr_DsRGetDCName",
17522 sizeof(struct netr_DsRGetDCName),
17523 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCName,
17524 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCName,
17525 (ndr_print_function_t) ndr_print_netr_DsRGetDCName,
17526 false,
17529 "netr_LogonGetCapabilities",
17530 sizeof(struct netr_LogonGetCapabilities),
17531 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetCapabilities,
17532 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetCapabilities,
17533 (ndr_print_function_t) ndr_print_netr_LogonGetCapabilities,
17534 false,
17537 "netr_NETRLOGONSETSERVICEBITS",
17538 sizeof(struct netr_NETRLOGONSETSERVICEBITS),
17539 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSETSERVICEBITS,
17540 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSETSERVICEBITS,
17541 (ndr_print_function_t) ndr_print_netr_NETRLOGONSETSERVICEBITS,
17542 false,
17545 "netr_LogonGetTrustRid",
17546 sizeof(struct netr_LogonGetTrustRid),
17547 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid,
17548 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid,
17549 (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid,
17550 false,
17553 "netr_NETRLOGONCOMPUTESERVERDIGEST",
17554 sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST),
17555 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST,
17556 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST,
17557 (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST,
17558 false,
17561 "netr_NETRLOGONCOMPUTECLIENTDIGEST",
17562 sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST),
17563 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17564 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17565 (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17566 false,
17569 "netr_ServerAuthenticate3",
17570 sizeof(struct netr_ServerAuthenticate3),
17571 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate3,
17572 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate3,
17573 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate3,
17574 false,
17577 "netr_DsRGetDCNameEx",
17578 sizeof(struct netr_DsRGetDCNameEx),
17579 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx,
17580 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx,
17581 (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx,
17582 false,
17585 "netr_DsRGetSiteName",
17586 sizeof(struct netr_DsRGetSiteName),
17587 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetSiteName,
17588 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetSiteName,
17589 (ndr_print_function_t) ndr_print_netr_DsRGetSiteName,
17590 false,
17593 "netr_LogonGetDomainInfo",
17594 sizeof(struct netr_LogonGetDomainInfo),
17595 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetDomainInfo,
17596 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetDomainInfo,
17597 (ndr_print_function_t) ndr_print_netr_LogonGetDomainInfo,
17598 false,
17601 "netr_ServerPasswordSet2",
17602 sizeof(struct netr_ServerPasswordSet2),
17603 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet2,
17604 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet2,
17605 (ndr_print_function_t) ndr_print_netr_ServerPasswordSet2,
17606 false,
17609 "netr_ServerPasswordGet",
17610 sizeof(struct netr_ServerPasswordGet),
17611 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet,
17612 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet,
17613 (ndr_print_function_t) ndr_print_netr_ServerPasswordGet,
17614 false,
17617 "netr_NETRLOGONSENDTOSAM",
17618 sizeof(struct netr_NETRLOGONSENDTOSAM),
17619 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSENDTOSAM,
17620 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSENDTOSAM,
17621 (ndr_print_function_t) ndr_print_netr_NETRLOGONSENDTOSAM,
17622 false,
17625 "netr_DsRAddressToSitenamesW",
17626 sizeof(struct netr_DsRAddressToSitenamesW),
17627 (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW,
17628 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW,
17629 (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW,
17630 false,
17633 "netr_DsRGetDCNameEx2",
17634 sizeof(struct netr_DsRGetDCNameEx2),
17635 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx2,
17636 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx2,
17637 (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx2,
17638 false,
17641 "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN",
17642 sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN),
17643 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17644 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17645 (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17646 false,
17649 "netr_NetrEnumerateTrustedDomainsEx",
17650 sizeof(struct netr_NetrEnumerateTrustedDomainsEx),
17651 (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx,
17652 (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx,
17653 (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx,
17654 false,
17657 "netr_DsRAddressToSitenamesExW",
17658 sizeof(struct netr_DsRAddressToSitenamesExW),
17659 (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW,
17660 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW,
17661 (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW,
17662 false,
17665 "netr_DsrGetDcSiteCoverageW",
17666 sizeof(struct netr_DsrGetDcSiteCoverageW),
17667 (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW,
17668 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW,
17669 (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW,
17670 false,
17673 "netr_LogonSamLogonEx",
17674 sizeof(struct netr_LogonSamLogonEx),
17675 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonEx,
17676 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonEx,
17677 (ndr_print_function_t) ndr_print_netr_LogonSamLogonEx,
17678 false,
17681 "netr_DsrEnumerateDomainTrusts",
17682 sizeof(struct netr_DsrEnumerateDomainTrusts),
17683 (ndr_push_flags_fn_t) ndr_push_netr_DsrEnumerateDomainTrusts,
17684 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrEnumerateDomainTrusts,
17685 (ndr_print_function_t) ndr_print_netr_DsrEnumerateDomainTrusts,
17686 false,
17689 "netr_DsrDeregisterDNSHostRecords",
17690 sizeof(struct netr_DsrDeregisterDNSHostRecords),
17691 (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords,
17692 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords,
17693 (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords,
17694 false,
17697 "netr_ServerTrustPasswordsGet",
17698 sizeof(struct netr_ServerTrustPasswordsGet),
17699 (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet,
17700 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet,
17701 (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet,
17702 false,
17705 "netr_DsRGetForestTrustInformation",
17706 sizeof(struct netr_DsRGetForestTrustInformation),
17707 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation,
17708 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation,
17709 (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation,
17710 false,
17713 "netr_GetForestTrustInformation",
17714 sizeof(struct netr_GetForestTrustInformation),
17715 (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation,
17716 (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation,
17717 (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation,
17718 false,
17721 "netr_LogonSamLogonWithFlags",
17722 sizeof(struct netr_LogonSamLogonWithFlags),
17723 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonWithFlags,
17724 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonWithFlags,
17725 (ndr_print_function_t) ndr_print_netr_LogonSamLogonWithFlags,
17726 false,
17729 "netr_ServerGetTrustInfo",
17730 sizeof(struct netr_ServerGetTrustInfo),
17731 (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo,
17732 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo,
17733 (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo,
17734 false,
17736 { NULL, 0, NULL, NULL, NULL, false }
17739 static const char * const netlogon_endpoint_strings[] = {
17740 "ncacn_np:[\\pipe\\netlogon]",
17741 "ncacn_ip_tcp:",
17742 "ncalrpc:",
17745 static const struct ndr_interface_string_array netlogon_endpoints = {
17746 .count = 3,
17747 .names = netlogon_endpoint_strings
17750 static const char * const netlogon_authservice_strings[] = {
17751 "host",
17754 static const struct ndr_interface_string_array netlogon_authservices = {
17755 .count = 1,
17756 .names = netlogon_authservice_strings
17760 const struct ndr_interface_table ndr_table_netlogon = {
17761 .name = "netlogon",
17762 .syntax_id = {
17763 {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},
17764 NDR_NETLOGON_VERSION
17766 .helpstring = NDR_NETLOGON_HELPSTRING,
17767 .num_calls = 47,
17768 .calls = netlogon_calls,
17769 .endpoints = &netlogon_endpoints,
17770 .authservices = &netlogon_authservices