s4-smbtorture: simplify test_PrinterInfo_DevMode a bit.
[Samba/nascimento.git] / librpc / gen_ndr / ndr_netlogon.c
blob3693860e013991e51b4da0f561b6c013498de458
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 TALLOC_CTX *_mem_save_account_name_0;
66 uint32_t _ptr_computer;
67 TALLOC_CTX *_mem_save_computer_0;
68 uint32_t _ptr_domain;
69 TALLOC_CTX *_mem_save_domain_0;
70 uint32_t _ptr_script_path;
71 TALLOC_CTX *_mem_save_script_path_0;
72 if (ndr_flags & NDR_SCALARS) {
73 NDR_CHECK(ndr_pull_align(ndr, 5));
74 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
75 if (_ptr_account_name) {
76 NDR_PULL_ALLOC(ndr, r->account_name);
77 } else {
78 r->account_name = NULL;
80 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priv));
81 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_flags));
82 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_count));
83 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pw_count));
84 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logon));
85 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logoff));
86 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->logoff_time));
87 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->kickoff_time));
88 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->password_age));
89 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_can_change));
90 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_must_change));
91 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer));
92 if (_ptr_computer) {
93 NDR_PULL_ALLOC(ndr, r->computer);
94 } else {
95 r->computer = NULL;
97 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
98 if (_ptr_domain) {
99 NDR_PULL_ALLOC(ndr, r->domain);
100 } else {
101 r->domain = NULL;
103 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_script_path));
104 if (_ptr_script_path) {
105 NDR_PULL_ALLOC(ndr, r->script_path);
106 } else {
107 r->script_path = NULL;
109 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
110 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
112 if (ndr_flags & NDR_BUFFERS) {
113 if (r->account_name) {
114 _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
115 NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
116 NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
117 NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
118 if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
119 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name));
121 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t)));
122 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16));
123 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
125 if (r->computer) {
126 _mem_save_computer_0 = NDR_PULL_GET_MEM_CTX(ndr);
127 NDR_PULL_SET_MEM_CTX(ndr, r->computer, 0);
128 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer));
129 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer));
130 if (ndr_get_array_length(ndr, &r->computer) > ndr_get_array_size(ndr, &r->computer)) {
131 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer), ndr_get_array_length(ndr, &r->computer));
133 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t)));
134 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t), CH_UTF16));
135 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_0, 0);
137 if (r->domain) {
138 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
139 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
140 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
141 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
142 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
143 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
145 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
146 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
147 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
149 if (r->script_path) {
150 _mem_save_script_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
151 NDR_PULL_SET_MEM_CTX(ndr, r->script_path, 0);
152 NDR_CHECK(ndr_pull_array_size(ndr, &r->script_path));
153 NDR_CHECK(ndr_pull_array_length(ndr, &r->script_path));
154 if (ndr_get_array_length(ndr, &r->script_path) > ndr_get_array_size(ndr, &r->script_path)) {
155 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->script_path), ndr_get_array_length(ndr, &r->script_path));
157 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t)));
158 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->script_path, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t), CH_UTF16));
159 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0);
162 return NDR_ERR_SUCCESS;
165 _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r)
167 ndr_print_struct(ndr, name, "netr_UasInfo");
168 ndr->depth++;
169 ndr_print_ptr(ndr, "account_name", r->account_name);
170 ndr->depth++;
171 if (r->account_name) {
172 ndr_print_string(ndr, "account_name", r->account_name);
174 ndr->depth--;
175 ndr_print_uint32(ndr, "priv", r->priv);
176 ndr_print_uint32(ndr, "auth_flags", r->auth_flags);
177 ndr_print_uint32(ndr, "logon_count", r->logon_count);
178 ndr_print_uint32(ndr, "bad_pw_count", r->bad_pw_count);
179 ndr_print_time_t(ndr, "last_logon", r->last_logon);
180 ndr_print_time_t(ndr, "last_logoff", r->last_logoff);
181 ndr_print_time_t(ndr, "logoff_time", r->logoff_time);
182 ndr_print_time_t(ndr, "kickoff_time", r->kickoff_time);
183 ndr_print_uint32(ndr, "password_age", r->password_age);
184 ndr_print_time_t(ndr, "pw_can_change", r->pw_can_change);
185 ndr_print_time_t(ndr, "pw_must_change", r->pw_must_change);
186 ndr_print_ptr(ndr, "computer", r->computer);
187 ndr->depth++;
188 if (r->computer) {
189 ndr_print_string(ndr, "computer", r->computer);
191 ndr->depth--;
192 ndr_print_ptr(ndr, "domain", r->domain);
193 ndr->depth++;
194 if (r->domain) {
195 ndr_print_string(ndr, "domain", r->domain);
197 ndr->depth--;
198 ndr_print_ptr(ndr, "script_path", r->script_path);
199 ndr->depth++;
200 if (r->script_path) {
201 ndr_print_string(ndr, "script_path", r->script_path);
203 ndr->depth--;
204 ndr_print_uint32(ndr, "unknown", r->unknown);
205 ndr->depth--;
208 static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r)
210 if (ndr_flags & NDR_SCALARS) {
211 NDR_CHECK(ndr_push_align(ndr, 4));
212 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->duration));
213 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
214 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
216 if (ndr_flags & NDR_BUFFERS) {
218 return NDR_ERR_SUCCESS;
221 static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r)
223 if (ndr_flags & NDR_SCALARS) {
224 NDR_CHECK(ndr_pull_align(ndr, 4));
225 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->duration));
226 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
227 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
229 if (ndr_flags & NDR_BUFFERS) {
231 return NDR_ERR_SUCCESS;
234 _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r)
236 ndr_print_struct(ndr, name, "netr_UasLogoffInfo");
237 ndr->depth++;
238 ndr_print_uint32(ndr, "duration", r->duration);
239 ndr_print_uint16(ndr, "logon_count", r->logon_count);
240 ndr->depth--;
243 _PUBLIC_ enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r)
245 if (ndr_flags & NDR_SCALARS) {
246 NDR_CHECK(ndr_push_align(ndr, 4));
247 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->lockout_duration));
248 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->reset_count));
249 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_attempt_lockout));
250 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy));
251 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
253 if (ndr_flags & NDR_BUFFERS) {
255 return NDR_ERR_SUCCESS;
258 _PUBLIC_ enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r)
260 if (ndr_flags & NDR_SCALARS) {
261 NDR_CHECK(ndr_pull_align(ndr, 4));
262 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->lockout_duration));
263 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->reset_count));
264 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_attempt_lockout));
265 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
266 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
268 if (ndr_flags & NDR_BUFFERS) {
270 return NDR_ERR_SUCCESS;
273 _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r)
275 ndr_print_struct(ndr, name, "netr_AcctLockStr");
276 ndr->depth++;
277 ndr_print_dlong(ndr, "lockout_duration", r->lockout_duration);
278 ndr_print_udlong(ndr, "reset_count", r->reset_count);
279 ndr_print_uint32(ndr, "bad_attempt_lockout", r->bad_attempt_lockout);
280 ndr_print_uint32(ndr, "dummy", r->dummy);
281 ndr->depth--;
284 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r)
286 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
287 return NDR_ERR_SUCCESS;
290 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
292 uint32_t v;
293 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
294 *r = v;
295 return NDR_ERR_SUCCESS;
298 _PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r)
300 ndr_print_uint32(ndr, name, r);
301 ndr->depth++;
302 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r);
303 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r);
304 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r);
305 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_DONT_TRY_GUEST_ACCOUNT", MSV1_0_DONT_TRY_GUEST_ACCOUNT, r);
306 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r);
307 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PASSWORD_EXPIRY", MSV1_0_RETURN_PASSWORD_EXPIRY, r);
308 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_CLIENT_CHALLENGE", MSV1_0_USE_CLIENT_CHALLENGE, r);
309 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_GUEST_ACCOUNT_ONLY", MSV1_0_TRY_GUEST_ACCOUNT_ONLY, r);
310 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r);
311 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY", MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY, r);
312 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r);
313 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_DISABLE_PERSONAL_FALLBACK", MSV1_0_DISABLE_PERSONAL_FALLBACK, r);
314 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_FORCE_GUEST", MSV1_0_ALLOW_FORCE_GUEST, r);
315 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED", MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED, r);
316 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY", MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY, r);
317 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_MSVCHAPV2", MSV1_0_ALLOW_MSVCHAPV2, r);
318 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_S4U2SELF", MSV1_0_S4U2SELF, r);
319 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CHECK_LOGONHOURS_FOR_S4U", MSV1_0_CHECK_LOGONHOURS_FOR_S4U, r);
320 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_SUBAUTHENTICATION_DLL_EX", MSV1_0_SUBAUTHENTICATION_DLL_EX, r);
321 ndr->depth--;
324 static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
326 if (ndr_flags & NDR_SCALARS) {
327 NDR_CHECK(ndr_push_align(ndr, 5));
328 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
329 NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control));
330 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low));
331 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high));
332 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
333 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation));
334 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
336 if (ndr_flags & NDR_BUFFERS) {
337 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
338 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
339 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
341 return NDR_ERR_SUCCESS;
344 static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
346 if (ndr_flags & NDR_SCALARS) {
347 NDR_CHECK(ndr_pull_align(ndr, 5));
348 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
349 NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control));
350 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low));
351 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high));
352 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
353 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation));
354 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
356 if (ndr_flags & NDR_BUFFERS) {
357 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
358 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
359 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
361 return NDR_ERR_SUCCESS;
364 _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r)
366 ndr_print_struct(ndr, name, "netr_IdentityInfo");
367 ndr->depth++;
368 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
369 ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control);
370 ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low);
371 ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high);
372 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
373 ndr_print_lsa_String(ndr, "workstation", &r->workstation);
374 ndr->depth--;
377 static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
379 if (ndr_flags & NDR_SCALARS) {
380 NDR_CHECK(ndr_push_align(ndr, 5));
381 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
382 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
383 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
384 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
386 if (ndr_flags & NDR_BUFFERS) {
387 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
389 return NDR_ERR_SUCCESS;
392 static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
394 if (ndr_flags & NDR_SCALARS) {
395 NDR_CHECK(ndr_pull_align(ndr, 5));
396 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
397 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
398 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
399 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
401 if (ndr_flags & NDR_BUFFERS) {
402 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
404 return NDR_ERR_SUCCESS;
407 _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r)
409 ndr_print_struct(ndr, name, "netr_PasswordInfo");
410 ndr->depth++;
411 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
412 ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
413 ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
414 ndr->depth--;
417 static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
420 uint32_t _flags_save_STRUCT = ndr->flags;
421 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
422 if (ndr_flags & NDR_SCALARS) {
423 NDR_CHECK(ndr_push_align(ndr, 5));
424 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
425 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
426 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
427 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
429 if (ndr_flags & NDR_BUFFERS) {
430 if (r->data) {
431 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
432 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
433 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
434 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
437 ndr->flags = _flags_save_STRUCT;
439 return NDR_ERR_SUCCESS;
442 static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
444 uint32_t _ptr_data;
445 TALLOC_CTX *_mem_save_data_0;
447 uint32_t _flags_save_STRUCT = ndr->flags;
448 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
449 if (ndr_flags & NDR_SCALARS) {
450 NDR_CHECK(ndr_pull_align(ndr, 5));
451 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
452 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
453 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
454 if (_ptr_data) {
455 NDR_PULL_ALLOC(ndr, r->data);
456 } else {
457 r->data = NULL;
459 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
461 if (ndr_flags & NDR_BUFFERS) {
462 if (r->data) {
463 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
464 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
465 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
466 NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
467 if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) {
468 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data));
470 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
471 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data)));
472 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
474 if (r->data) {
475 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
477 if (r->data) {
478 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length));
481 ndr->flags = _flags_save_STRUCT;
483 return NDR_ERR_SUCCESS;
486 _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r)
488 ndr_print_struct(ndr, name, "netr_ChallengeResponse");
490 uint32_t _flags_save_STRUCT = ndr->flags;
491 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
492 ndr->depth++;
493 ndr_print_uint16(ndr, "length", r->length);
494 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
495 ndr_print_ptr(ndr, "data", r->data);
496 ndr->depth++;
497 if (r->data) {
498 ndr_print_array_uint8(ndr, "data", r->data, r->length);
500 ndr->depth--;
501 ndr->depth--;
502 ndr->flags = _flags_save_STRUCT;
506 static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
509 uint32_t _flags_save_STRUCT = ndr->flags;
510 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
511 if (ndr_flags & NDR_SCALARS) {
512 NDR_CHECK(ndr_push_align(ndr, 5));
513 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
514 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
515 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
516 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
517 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
519 if (ndr_flags & NDR_BUFFERS) {
520 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
521 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
522 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
524 ndr->flags = _flags_save_STRUCT;
526 return NDR_ERR_SUCCESS;
529 static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
532 uint32_t _flags_save_STRUCT = ndr->flags;
533 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
534 if (ndr_flags & NDR_SCALARS) {
535 NDR_CHECK(ndr_pull_align(ndr, 5));
536 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
537 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
538 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
539 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
540 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
542 if (ndr_flags & NDR_BUFFERS) {
543 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
544 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
545 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
547 ndr->flags = _flags_save_STRUCT;
549 return NDR_ERR_SUCCESS;
552 _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r)
554 ndr_print_struct(ndr, name, "netr_NetworkInfo");
556 uint32_t _flags_save_STRUCT = ndr->flags;
557 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
558 ndr->depth++;
559 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
560 ndr_print_array_uint8(ndr, "challenge", r->challenge, 8);
561 ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt);
562 ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm);
563 ndr->depth--;
564 ndr->flags = _flags_save_STRUCT;
568 static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r)
571 uint32_t _flags_save_STRUCT = ndr->flags;
572 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
573 if (ndr_flags & NDR_SCALARS) {
574 NDR_CHECK(ndr_push_align(ndr, 5));
575 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
576 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name));
577 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
578 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
579 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
581 if (ndr_flags & NDR_BUFFERS) {
582 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
583 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
584 if (r->data) {
585 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
586 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
589 ndr->flags = _flags_save_STRUCT;
591 return NDR_ERR_SUCCESS;
594 static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r)
596 uint32_t _ptr_data;
597 TALLOC_CTX *_mem_save_data_0;
599 uint32_t _flags_save_STRUCT = ndr->flags;
600 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
601 if (ndr_flags & NDR_SCALARS) {
602 NDR_CHECK(ndr_pull_align(ndr, 5));
603 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
604 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name));
605 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
606 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
607 if (_ptr_data) {
608 NDR_PULL_ALLOC(ndr, r->data);
609 } else {
610 r->data = NULL;
612 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
614 if (ndr_flags & NDR_BUFFERS) {
615 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
616 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
617 if (r->data) {
618 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
619 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
620 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
621 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
622 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
623 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
625 if (r->data) {
626 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
629 ndr->flags = _flags_save_STRUCT;
631 return NDR_ERR_SUCCESS;
634 _PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r)
636 ndr_print_struct(ndr, name, "netr_GenericInfo");
638 uint32_t _flags_save_STRUCT = ndr->flags;
639 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
640 ndr->depth++;
641 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
642 ndr_print_lsa_String(ndr, "package_name", &r->package_name);
643 ndr_print_uint32(ndr, "length", r->length);
644 ndr_print_ptr(ndr, "data", r->data);
645 ndr->depth++;
646 if (r->data) {
647 ndr_print_array_uint8(ndr, "data", r->data, r->length);
649 ndr->depth--;
650 ndr->depth--;
651 ndr->flags = _flags_save_STRUCT;
655 static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r)
657 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
658 return NDR_ERR_SUCCESS;
661 static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r)
663 uint16_t v;
664 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
665 *r = v;
666 return NDR_ERR_SUCCESS;
669 _PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r)
671 const char *val = NULL;
673 switch (r) {
674 case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break;
675 case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break;
676 case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break;
677 case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break;
678 case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break;
679 case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break;
680 case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break;
682 ndr_print_enum(ndr, name, "ENUM", val, r);
685 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
687 if (ndr_flags & NDR_SCALARS) {
688 int level = ndr_push_get_switch_value(ndr, r);
689 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level));
690 NDR_CHECK(ndr_push_union_align(ndr, 5));
691 switch (level) {
692 case NetlogonInteractiveInformation: {
693 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
694 break; }
696 case NetlogonNetworkInformation: {
697 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
698 break; }
700 case NetlogonServiceInformation: {
701 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
702 break; }
704 case NetlogonGenericInformation: {
705 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
706 break; }
708 case NetlogonInteractiveTransitiveInformation: {
709 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
710 break; }
712 case NetlogonNetworkTransitiveInformation: {
713 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
714 break; }
716 case NetlogonServiceTransitiveInformation: {
717 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
718 break; }
720 default:
721 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
724 if (ndr_flags & NDR_BUFFERS) {
725 int level = ndr_push_get_switch_value(ndr, r);
726 switch (level) {
727 case NetlogonInteractiveInformation:
728 if (r->password) {
729 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
731 break;
733 case NetlogonNetworkInformation:
734 if (r->network) {
735 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
737 break;
739 case NetlogonServiceInformation:
740 if (r->password) {
741 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
743 break;
745 case NetlogonGenericInformation:
746 if (r->generic) {
747 NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
749 break;
751 case NetlogonInteractiveTransitiveInformation:
752 if (r->password) {
753 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
755 break;
757 case NetlogonNetworkTransitiveInformation:
758 if (r->network) {
759 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
761 break;
763 case NetlogonServiceTransitiveInformation:
764 if (r->password) {
765 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
767 break;
769 default:
770 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
773 return NDR_ERR_SUCCESS;
776 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
778 int level;
779 uint16_t _level;
780 TALLOC_CTX *_mem_save_password_0;
781 TALLOC_CTX *_mem_save_network_0;
782 TALLOC_CTX *_mem_save_generic_0;
783 level = ndr_pull_get_switch_value(ndr, r);
784 if (ndr_flags & NDR_SCALARS) {
785 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
786 if (_level != level) {
787 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
789 NDR_CHECK(ndr_pull_union_align(ndr, 5));
790 switch (level) {
791 case NetlogonInteractiveInformation: {
792 uint32_t _ptr_password;
793 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
794 if (_ptr_password) {
795 NDR_PULL_ALLOC(ndr, r->password);
796 } else {
797 r->password = NULL;
799 break; }
801 case NetlogonNetworkInformation: {
802 uint32_t _ptr_network;
803 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
804 if (_ptr_network) {
805 NDR_PULL_ALLOC(ndr, r->network);
806 } else {
807 r->network = NULL;
809 break; }
811 case NetlogonServiceInformation: {
812 uint32_t _ptr_password;
813 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
814 if (_ptr_password) {
815 NDR_PULL_ALLOC(ndr, r->password);
816 } else {
817 r->password = NULL;
819 break; }
821 case NetlogonGenericInformation: {
822 uint32_t _ptr_generic;
823 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
824 if (_ptr_generic) {
825 NDR_PULL_ALLOC(ndr, r->generic);
826 } else {
827 r->generic = NULL;
829 break; }
831 case NetlogonInteractiveTransitiveInformation: {
832 uint32_t _ptr_password;
833 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
834 if (_ptr_password) {
835 NDR_PULL_ALLOC(ndr, r->password);
836 } else {
837 r->password = NULL;
839 break; }
841 case NetlogonNetworkTransitiveInformation: {
842 uint32_t _ptr_network;
843 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
844 if (_ptr_network) {
845 NDR_PULL_ALLOC(ndr, r->network);
846 } else {
847 r->network = NULL;
849 break; }
851 case NetlogonServiceTransitiveInformation: {
852 uint32_t _ptr_password;
853 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
854 if (_ptr_password) {
855 NDR_PULL_ALLOC(ndr, r->password);
856 } else {
857 r->password = NULL;
859 break; }
861 default:
862 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
865 if (ndr_flags & NDR_BUFFERS) {
866 switch (level) {
867 case NetlogonInteractiveInformation:
868 if (r->password) {
869 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
870 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
871 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
872 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
874 break;
876 case NetlogonNetworkInformation:
877 if (r->network) {
878 _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
879 NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
880 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
881 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
883 break;
885 case NetlogonServiceInformation:
886 if (r->password) {
887 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
888 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
889 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
890 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
892 break;
894 case NetlogonGenericInformation:
895 if (r->generic) {
896 _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
897 NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
898 NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
899 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
901 break;
903 case NetlogonInteractiveTransitiveInformation:
904 if (r->password) {
905 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
906 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
907 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
908 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
910 break;
912 case NetlogonNetworkTransitiveInformation:
913 if (r->network) {
914 _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
915 NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
916 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
917 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
919 break;
921 case NetlogonServiceTransitiveInformation:
922 if (r->password) {
923 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
924 NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
925 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
926 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
928 break;
930 default:
931 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
934 return NDR_ERR_SUCCESS;
937 _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
939 int level;
940 level = ndr_print_get_switch_value(ndr, r);
941 ndr_print_union(ndr, name, level, "netr_LogonLevel");
942 switch (level) {
943 case NetlogonInteractiveInformation:
944 ndr_print_ptr(ndr, "password", r->password);
945 ndr->depth++;
946 if (r->password) {
947 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
949 ndr->depth--;
950 break;
952 case NetlogonNetworkInformation:
953 ndr_print_ptr(ndr, "network", r->network);
954 ndr->depth++;
955 if (r->network) {
956 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
958 ndr->depth--;
959 break;
961 case NetlogonServiceInformation:
962 ndr_print_ptr(ndr, "password", r->password);
963 ndr->depth++;
964 if (r->password) {
965 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
967 ndr->depth--;
968 break;
970 case NetlogonGenericInformation:
971 ndr_print_ptr(ndr, "generic", r->generic);
972 ndr->depth++;
973 if (r->generic) {
974 ndr_print_netr_GenericInfo(ndr, "generic", r->generic);
976 ndr->depth--;
977 break;
979 case NetlogonInteractiveTransitiveInformation:
980 ndr_print_ptr(ndr, "password", r->password);
981 ndr->depth++;
982 if (r->password) {
983 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
985 ndr->depth--;
986 break;
988 case NetlogonNetworkTransitiveInformation:
989 ndr_print_ptr(ndr, "network", r->network);
990 ndr->depth++;
991 if (r->network) {
992 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
994 ndr->depth--;
995 break;
997 case NetlogonServiceTransitiveInformation:
998 ndr_print_ptr(ndr, "password", r->password);
999 ndr->depth++;
1000 if (r->password) {
1001 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
1003 ndr->depth--;
1004 break;
1006 default:
1007 ndr_print_bad_level(ndr, name, level);
1011 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
1014 uint32_t _flags_save_STRUCT = ndr->flags;
1015 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1016 if (ndr_flags & NDR_SCALARS) {
1017 NDR_CHECK(ndr_push_align(ndr, 1));
1018 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16));
1019 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1021 if (ndr_flags & NDR_BUFFERS) {
1023 ndr->flags = _flags_save_STRUCT;
1025 return NDR_ERR_SUCCESS;
1028 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
1031 uint32_t _flags_save_STRUCT = ndr->flags;
1032 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1033 if (ndr_flags & NDR_SCALARS) {
1034 NDR_CHECK(ndr_pull_align(ndr, 1));
1035 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 16));
1036 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1038 if (ndr_flags & NDR_BUFFERS) {
1040 ndr->flags = _flags_save_STRUCT;
1042 return NDR_ERR_SUCCESS;
1045 _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r)
1047 ndr_print_struct(ndr, name, "netr_UserSessionKey");
1049 uint32_t _flags_save_STRUCT = ndr->flags;
1050 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1051 ndr->depth++;
1052 ndr_print_array_uint8(ndr, "key", r->key, 16);
1053 ndr->depth--;
1054 ndr->flags = _flags_save_STRUCT;
1058 _PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
1061 uint32_t _flags_save_STRUCT = ndr->flags;
1062 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1063 if (ndr_flags & NDR_SCALARS) {
1064 NDR_CHECK(ndr_push_align(ndr, 1));
1065 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8));
1066 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1068 if (ndr_flags & NDR_BUFFERS) {
1070 ndr->flags = _flags_save_STRUCT;
1072 return NDR_ERR_SUCCESS;
1075 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
1078 uint32_t _flags_save_STRUCT = ndr->flags;
1079 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1080 if (ndr_flags & NDR_SCALARS) {
1081 NDR_CHECK(ndr_pull_align(ndr, 1));
1082 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 8));
1083 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1085 if (ndr_flags & NDR_BUFFERS) {
1087 ndr->flags = _flags_save_STRUCT;
1089 return NDR_ERR_SUCCESS;
1092 _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r)
1094 ndr_print_struct(ndr, name, "netr_LMSessionKey");
1096 uint32_t _flags_save_STRUCT = ndr->flags;
1097 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1098 ndr->depth++;
1099 ndr_print_array_uint8(ndr, "key", r->key, 8);
1100 ndr->depth--;
1101 ndr->flags = _flags_save_STRUCT;
1105 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1107 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1108 return NDR_ERR_SUCCESS;
1111 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1113 uint32_t v;
1114 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1115 *r = v;
1116 return NDR_ERR_SUCCESS;
1119 _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r)
1121 ndr_print_uint32(ndr, name, r);
1122 ndr->depth++;
1123 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r);
1124 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r);
1125 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r);
1126 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r);
1127 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r);
1128 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r);
1129 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r);
1130 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r);
1131 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r);
1132 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r);
1133 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r);
1134 ndr->depth--;
1137 static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
1139 uint32_t cntr_unknown_0;
1140 if (ndr_flags & NDR_SCALARS) {
1141 NDR_CHECK(ndr_push_align(ndr, 5));
1142 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
1143 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
1144 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
1145 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
1146 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
1147 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
1148 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1149 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1150 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1151 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1152 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1153 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1154 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
1155 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
1156 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
1157 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
1158 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1159 NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags));
1160 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1161 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1162 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1163 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
1164 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1165 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
1166 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1167 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
1169 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1171 if (ndr_flags & NDR_BUFFERS) {
1172 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1173 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1174 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1175 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1176 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1177 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1178 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1179 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1180 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1181 if (r->domain_sid) {
1182 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1185 return NDR_ERR_SUCCESS;
1188 static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
1190 uint32_t _ptr_domain_sid;
1191 TALLOC_CTX *_mem_save_domain_sid_0;
1192 uint32_t cntr_unknown_0;
1193 if (ndr_flags & NDR_SCALARS) {
1194 NDR_CHECK(ndr_pull_align(ndr, 5));
1195 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
1196 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
1197 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
1198 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
1199 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
1200 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
1201 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1202 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1203 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1204 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1205 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1206 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1207 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
1208 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
1209 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
1210 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1211 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1212 NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags));
1213 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1214 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1215 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1216 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
1217 if (_ptr_domain_sid) {
1218 NDR_PULL_ALLOC(ndr, r->domain_sid);
1219 } else {
1220 r->domain_sid = NULL;
1222 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1223 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
1224 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1225 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
1227 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1229 if (ndr_flags & NDR_BUFFERS) {
1230 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1231 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1232 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1233 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1234 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1235 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1236 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1237 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1238 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1239 if (r->domain_sid) {
1240 _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1241 NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
1242 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1243 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
1246 return NDR_ERR_SUCCESS;
1249 _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r)
1251 uint32_t cntr_unknown_0;
1252 ndr_print_struct(ndr, name, "netr_SamBaseInfo");
1253 ndr->depth++;
1254 ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
1255 ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
1256 ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
1257 ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
1258 ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
1259 ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
1260 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
1261 ndr_print_lsa_String(ndr, "full_name", &r->full_name);
1262 ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
1263 ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
1264 ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
1265 ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
1266 ndr_print_uint16(ndr, "logon_count", r->logon_count);
1267 ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
1268 ndr_print_uint32(ndr, "rid", r->rid);
1269 ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
1270 ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups);
1271 ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags);
1272 ndr_print_netr_UserSessionKey(ndr, "key", &r->key);
1273 ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server);
1274 ndr_print_lsa_StringLarge(ndr, "domain", &r->domain);
1275 ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
1276 ndr->depth++;
1277 if (r->domain_sid) {
1278 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
1280 ndr->depth--;
1281 ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey);
1282 ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
1283 ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)7);
1284 ndr->depth++;
1285 for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) {
1286 char *idx_0=NULL;
1287 if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
1288 ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
1289 free(idx_0);
1292 ndr->depth--;
1293 ndr->depth--;
1296 static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
1298 if (ndr_flags & NDR_SCALARS) {
1299 NDR_CHECK(ndr_push_align(ndr, 5));
1300 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1301 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1303 if (ndr_flags & NDR_BUFFERS) {
1304 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1306 return NDR_ERR_SUCCESS;
1309 static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
1311 if (ndr_flags & NDR_SCALARS) {
1312 NDR_CHECK(ndr_pull_align(ndr, 5));
1313 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1314 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1316 if (ndr_flags & NDR_BUFFERS) {
1317 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1319 return NDR_ERR_SUCCESS;
1322 _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r)
1324 ndr_print_struct(ndr, name, "netr_SamInfo2");
1325 ndr->depth++;
1326 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1327 ndr->depth--;
1330 static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
1332 if (ndr_flags & NDR_SCALARS) {
1333 NDR_CHECK(ndr_push_align(ndr, 5));
1334 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1335 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1336 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1338 if (ndr_flags & NDR_BUFFERS) {
1339 if (r->sid) {
1340 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1343 return NDR_ERR_SUCCESS;
1346 static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
1348 uint32_t _ptr_sid;
1349 TALLOC_CTX *_mem_save_sid_0;
1350 if (ndr_flags & NDR_SCALARS) {
1351 NDR_CHECK(ndr_pull_align(ndr, 5));
1352 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1353 if (_ptr_sid) {
1354 NDR_PULL_ALLOC(ndr, r->sid);
1355 } else {
1356 r->sid = NULL;
1358 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1359 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1361 if (ndr_flags & NDR_BUFFERS) {
1362 if (r->sid) {
1363 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1364 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1365 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1366 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1369 return NDR_ERR_SUCCESS;
1372 _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r)
1374 ndr_print_struct(ndr, name, "netr_SidAttr");
1375 ndr->depth++;
1376 ndr_print_ptr(ndr, "sid", r->sid);
1377 ndr->depth++;
1378 if (r->sid) {
1379 ndr_print_dom_sid2(ndr, "sid", r->sid);
1381 ndr->depth--;
1382 ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1383 ndr->depth--;
1386 _PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
1388 uint32_t cntr_sids_1;
1389 if (ndr_flags & NDR_SCALARS) {
1390 NDR_CHECK(ndr_push_align(ndr, 5));
1391 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1392 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1393 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1394 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1396 if (ndr_flags & NDR_BUFFERS) {
1397 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1398 if (r->sids) {
1399 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->sidcount));
1400 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1401 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1403 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1404 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1408 return NDR_ERR_SUCCESS;
1411 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
1413 uint32_t _ptr_sids;
1414 uint32_t cntr_sids_1;
1415 TALLOC_CTX *_mem_save_sids_0;
1416 TALLOC_CTX *_mem_save_sids_1;
1417 if (ndr_flags & NDR_SCALARS) {
1418 NDR_CHECK(ndr_pull_align(ndr, 5));
1419 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1420 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1421 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1422 if (_ptr_sids) {
1423 NDR_PULL_ALLOC(ndr, r->sids);
1424 } else {
1425 r->sids = NULL;
1427 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1429 if (ndr_flags & NDR_BUFFERS) {
1430 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1431 if (r->sids) {
1432 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1433 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1434 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1435 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1436 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1437 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1438 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1439 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1441 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1442 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1444 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1445 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1447 if (r->sids) {
1448 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1451 return NDR_ERR_SUCCESS;
1454 _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r)
1456 uint32_t cntr_sids_1;
1457 ndr_print_struct(ndr, name, "netr_SamInfo3");
1458 ndr->depth++;
1459 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1460 ndr_print_uint32(ndr, "sidcount", r->sidcount);
1461 ndr_print_ptr(ndr, "sids", r->sids);
1462 ndr->depth++;
1463 if (r->sids) {
1464 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1465 ndr->depth++;
1466 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1467 char *idx_1=NULL;
1468 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1469 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1470 free(idx_1);
1473 ndr->depth--;
1475 ndr->depth--;
1476 ndr->depth--;
1479 static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
1481 uint32_t cntr_sids_1;
1482 uint32_t cntr_unknown4_0;
1483 if (ndr_flags & NDR_SCALARS) {
1484 NDR_CHECK(ndr_push_align(ndr, 5));
1485 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1486 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1487 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1488 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
1489 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle));
1490 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1491 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0]));
1493 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1495 if (ndr_flags & NDR_BUFFERS) {
1496 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1497 if (r->sids) {
1498 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->sidcount));
1499 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1500 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1502 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1503 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1506 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1507 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1509 return NDR_ERR_SUCCESS;
1512 static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
1514 uint32_t _ptr_sids;
1515 uint32_t cntr_sids_1;
1516 TALLOC_CTX *_mem_save_sids_0;
1517 TALLOC_CTX *_mem_save_sids_1;
1518 uint32_t cntr_unknown4_0;
1519 if (ndr_flags & NDR_SCALARS) {
1520 NDR_CHECK(ndr_pull_align(ndr, 5));
1521 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1522 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1523 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1524 if (_ptr_sids) {
1525 NDR_PULL_ALLOC(ndr, r->sids);
1526 } else {
1527 r->sids = NULL;
1529 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest));
1530 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle));
1531 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1532 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0]));
1534 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1536 if (ndr_flags & NDR_BUFFERS) {
1537 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1538 if (r->sids) {
1539 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1540 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1541 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1542 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1543 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1544 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1545 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1546 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1548 for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1549 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1551 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1552 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1554 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1555 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1556 if (r->sids) {
1557 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1560 return NDR_ERR_SUCCESS;
1563 _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r)
1565 uint32_t cntr_sids_1;
1566 uint32_t cntr_unknown4_0;
1567 ndr_print_struct(ndr, name, "netr_SamInfo6");
1568 ndr->depth++;
1569 ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1570 ndr_print_uint32(ndr, "sidcount", r->sidcount);
1571 ndr_print_ptr(ndr, "sids", r->sids);
1572 ndr->depth++;
1573 if (r->sids) {
1574 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1575 ndr->depth++;
1576 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1577 char *idx_1=NULL;
1578 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1579 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1580 free(idx_1);
1583 ndr->depth--;
1585 ndr->depth--;
1586 ndr_print_lsa_String(ndr, "forest", &r->forest);
1587 ndr_print_lsa_String(ndr, "principle", &r->principle);
1588 ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20);
1589 ndr->depth++;
1590 for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) {
1591 char *idx_0=NULL;
1592 if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) {
1593 ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]);
1594 free(idx_0);
1597 ndr->depth--;
1598 ndr->depth--;
1601 static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
1603 uint32_t cntr_expansionroom_0;
1604 if (ndr_flags & NDR_SCALARS) {
1605 NDR_CHECK(ndr_push_align(ndr, 5));
1606 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1607 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1608 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1609 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1610 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1611 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1612 NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth));
1613 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1614 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1615 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0]));
1617 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1618 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1619 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1620 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1621 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1623 if (ndr_flags & NDR_BUFFERS) {
1624 if (r->pac) {
1625 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->pac_size));
1626 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size));
1628 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1629 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1630 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1631 if (r->auth) {
1632 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->auth_size));
1633 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size));
1635 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1636 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1637 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1638 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1640 return NDR_ERR_SUCCESS;
1643 static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
1645 uint32_t _ptr_pac;
1646 TALLOC_CTX *_mem_save_pac_0;
1647 uint32_t _ptr_auth;
1648 TALLOC_CTX *_mem_save_auth_0;
1649 uint32_t cntr_expansionroom_0;
1650 if (ndr_flags & NDR_SCALARS) {
1651 NDR_CHECK(ndr_pull_align(ndr, 5));
1652 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size));
1653 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1654 if (_ptr_pac) {
1655 NDR_PULL_ALLOC(ndr, r->pac);
1656 } else {
1657 r->pac = NULL;
1659 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1660 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1661 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1662 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size));
1663 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth));
1664 if (_ptr_auth) {
1665 NDR_PULL_ALLOC(ndr, r->auth);
1666 } else {
1667 r->auth = NULL;
1669 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1670 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1671 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0]));
1673 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1674 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1675 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1676 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1677 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1679 if (ndr_flags & NDR_BUFFERS) {
1680 if (r->pac) {
1681 _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1682 NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1683 NDR_CHECK(ndr_pull_array_size(ndr, &r->pac));
1684 NDR_PULL_ALLOC_N(ndr, r->pac, ndr_get_array_size(ndr, &r->pac));
1685 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, ndr_get_array_size(ndr, &r->pac)));
1686 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1688 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1689 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1690 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1691 if (r->auth) {
1692 _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr);
1693 NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0);
1694 NDR_CHECK(ndr_pull_array_size(ndr, &r->auth));
1695 NDR_PULL_ALLOC_N(ndr, r->auth, ndr_get_array_size(ndr, &r->auth));
1696 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, ndr_get_array_size(ndr, &r->auth)));
1697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0);
1699 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1700 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1701 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1702 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1703 if (r->pac) {
1704 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size));
1706 if (r->auth) {
1707 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size));
1710 return NDR_ERR_SUCCESS;
1713 _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r)
1715 uint32_t cntr_expansionroom_0;
1716 ndr_print_struct(ndr, name, "netr_PacInfo");
1717 ndr->depth++;
1718 ndr_print_uint32(ndr, "pac_size", r->pac_size);
1719 ndr_print_ptr(ndr, "pac", r->pac);
1720 ndr->depth++;
1721 if (r->pac) {
1722 ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size);
1724 ndr->depth--;
1725 ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain);
1726 ndr_print_lsa_String(ndr, "logon_server", &r->logon_server);
1727 ndr_print_lsa_String(ndr, "principal_name", &r->principal_name);
1728 ndr_print_uint32(ndr, "auth_size", r->auth_size);
1729 ndr_print_ptr(ndr, "auth", r->auth);
1730 ndr->depth++;
1731 if (r->auth) {
1732 ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size);
1734 ndr->depth--;
1735 ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key);
1736 ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", (int)10);
1737 ndr->depth++;
1738 for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) {
1739 char *idx_0=NULL;
1740 if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) {
1741 ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]);
1742 free(idx_0);
1745 ndr->depth--;
1746 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
1747 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
1748 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
1749 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
1750 ndr->depth--;
1753 static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r)
1756 uint32_t _flags_save_STRUCT = ndr->flags;
1757 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1758 if (ndr_flags & NDR_SCALARS) {
1759 NDR_CHECK(ndr_push_align(ndr, 5));
1760 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
1761 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
1762 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1764 if (ndr_flags & NDR_BUFFERS) {
1765 if (r->data) {
1766 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
1767 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
1770 ndr->flags = _flags_save_STRUCT;
1772 return NDR_ERR_SUCCESS;
1775 static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r)
1777 uint32_t _ptr_data;
1778 TALLOC_CTX *_mem_save_data_0;
1780 uint32_t _flags_save_STRUCT = ndr->flags;
1781 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1782 if (ndr_flags & NDR_SCALARS) {
1783 NDR_CHECK(ndr_pull_align(ndr, 5));
1784 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
1785 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1786 if (_ptr_data) {
1787 NDR_PULL_ALLOC(ndr, r->data);
1788 } else {
1789 r->data = NULL;
1791 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1793 if (ndr_flags & NDR_BUFFERS) {
1794 if (r->data) {
1795 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1796 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
1797 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
1798 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
1799 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
1800 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
1802 if (r->data) {
1803 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
1806 ndr->flags = _flags_save_STRUCT;
1808 return NDR_ERR_SUCCESS;
1811 _PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r)
1813 ndr_print_struct(ndr, name, "netr_GenericInfo2");
1815 uint32_t _flags_save_STRUCT = ndr->flags;
1816 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1817 ndr->depth++;
1818 ndr_print_uint32(ndr, "length", r->length);
1819 ndr_print_ptr(ndr, "data", r->data);
1820 ndr->depth++;
1821 if (r->data) {
1822 ndr_print_array_uint8(ndr, "data", r->data, r->length);
1824 ndr->depth--;
1825 ndr->depth--;
1826 ndr->flags = _flags_save_STRUCT;
1830 _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
1832 if (ndr_flags & NDR_SCALARS) {
1833 int level = ndr_push_get_switch_value(ndr, r);
1834 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
1835 NDR_CHECK(ndr_push_union_align(ndr, 5));
1836 switch (level) {
1837 case NetlogonValidationSamInfo: {
1838 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
1839 break; }
1841 case NetlogonValidationSamInfo2: {
1842 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
1843 break; }
1845 case 4: {
1846 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1847 break; }
1849 case NetlogonValidationGenericInfo2: {
1850 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
1851 break; }
1853 case NetlogonValidationSamInfo4: {
1854 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
1855 break; }
1857 default:
1858 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1861 if (ndr_flags & NDR_BUFFERS) {
1862 int level = ndr_push_get_switch_value(ndr, r);
1863 switch (level) {
1864 case NetlogonValidationSamInfo:
1865 if (r->sam2) {
1866 NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1868 break;
1870 case NetlogonValidationSamInfo2:
1871 if (r->sam3) {
1872 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1874 break;
1876 case 4:
1877 if (r->pac) {
1878 NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1880 break;
1882 case NetlogonValidationGenericInfo2:
1883 if (r->generic) {
1884 NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
1886 break;
1888 case NetlogonValidationSamInfo4:
1889 if (r->sam6) {
1890 NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1892 break;
1894 default:
1895 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1898 return NDR_ERR_SUCCESS;
1901 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
1903 int level;
1904 uint16_t _level;
1905 TALLOC_CTX *_mem_save_sam2_0;
1906 TALLOC_CTX *_mem_save_sam3_0;
1907 TALLOC_CTX *_mem_save_pac_0;
1908 TALLOC_CTX *_mem_save_generic_0;
1909 TALLOC_CTX *_mem_save_sam6_0;
1910 level = ndr_pull_get_switch_value(ndr, r);
1911 if (ndr_flags & NDR_SCALARS) {
1912 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1913 if (_level != level) {
1914 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1916 NDR_CHECK(ndr_pull_union_align(ndr, 5));
1917 switch (level) {
1918 case NetlogonValidationSamInfo: {
1919 uint32_t _ptr_sam2;
1920 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2));
1921 if (_ptr_sam2) {
1922 NDR_PULL_ALLOC(ndr, r->sam2);
1923 } else {
1924 r->sam2 = NULL;
1926 break; }
1928 case NetlogonValidationSamInfo2: {
1929 uint32_t _ptr_sam3;
1930 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3));
1931 if (_ptr_sam3) {
1932 NDR_PULL_ALLOC(ndr, r->sam3);
1933 } else {
1934 r->sam3 = NULL;
1936 break; }
1938 case 4: {
1939 uint32_t _ptr_pac;
1940 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1941 if (_ptr_pac) {
1942 NDR_PULL_ALLOC(ndr, r->pac);
1943 } else {
1944 r->pac = NULL;
1946 break; }
1948 case NetlogonValidationGenericInfo2: {
1949 uint32_t _ptr_generic;
1950 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
1951 if (_ptr_generic) {
1952 NDR_PULL_ALLOC(ndr, r->generic);
1953 } else {
1954 r->generic = NULL;
1956 break; }
1958 case NetlogonValidationSamInfo4: {
1959 uint32_t _ptr_sam6;
1960 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6));
1961 if (_ptr_sam6) {
1962 NDR_PULL_ALLOC(ndr, r->sam6);
1963 } else {
1964 r->sam6 = NULL;
1966 break; }
1968 default:
1969 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1972 if (ndr_flags & NDR_BUFFERS) {
1973 switch (level) {
1974 case NetlogonValidationSamInfo:
1975 if (r->sam2) {
1976 _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1977 NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0);
1978 NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1979 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0);
1981 break;
1983 case NetlogonValidationSamInfo2:
1984 if (r->sam3) {
1985 _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1986 NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0);
1987 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1988 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0);
1990 break;
1992 case 4:
1993 if (r->pac) {
1994 _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1995 NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1996 NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1997 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1999 break;
2001 case NetlogonValidationGenericInfo2:
2002 if (r->generic) {
2003 _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
2004 NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
2005 NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
2006 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
2008 break;
2010 case NetlogonValidationSamInfo4:
2011 if (r->sam6) {
2012 _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr);
2013 NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0);
2014 NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
2015 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0);
2017 break;
2019 default:
2020 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2023 return NDR_ERR_SUCCESS;
2026 _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r)
2028 int level;
2029 level = ndr_print_get_switch_value(ndr, r);
2030 ndr_print_union(ndr, name, level, "netr_Validation");
2031 switch (level) {
2032 case NetlogonValidationSamInfo:
2033 ndr_print_ptr(ndr, "sam2", r->sam2);
2034 ndr->depth++;
2035 if (r->sam2) {
2036 ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2);
2038 ndr->depth--;
2039 break;
2041 case NetlogonValidationSamInfo2:
2042 ndr_print_ptr(ndr, "sam3", r->sam3);
2043 ndr->depth++;
2044 if (r->sam3) {
2045 ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3);
2047 ndr->depth--;
2048 break;
2050 case 4:
2051 ndr_print_ptr(ndr, "pac", r->pac);
2052 ndr->depth++;
2053 if (r->pac) {
2054 ndr_print_netr_PacInfo(ndr, "pac", r->pac);
2056 ndr->depth--;
2057 break;
2059 case NetlogonValidationGenericInfo2:
2060 ndr_print_ptr(ndr, "generic", r->generic);
2061 ndr->depth++;
2062 if (r->generic) {
2063 ndr_print_netr_GenericInfo2(ndr, "generic", r->generic);
2065 ndr->depth--;
2066 break;
2068 case NetlogonValidationSamInfo4:
2069 ndr_print_ptr(ndr, "sam6", r->sam6);
2070 ndr->depth++;
2071 if (r->sam6) {
2072 ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6);
2074 ndr->depth--;
2075 break;
2077 default:
2078 ndr_print_bad_level(ndr, name, level);
2082 _PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
2085 uint32_t _flags_save_STRUCT = ndr->flags;
2086 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2087 if (ndr_flags & NDR_SCALARS) {
2088 NDR_CHECK(ndr_push_align(ndr, 1));
2089 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8));
2090 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
2092 if (ndr_flags & NDR_BUFFERS) {
2094 ndr->flags = _flags_save_STRUCT;
2096 return NDR_ERR_SUCCESS;
2099 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
2102 uint32_t _flags_save_STRUCT = ndr->flags;
2103 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2104 if (ndr_flags & NDR_SCALARS) {
2105 NDR_CHECK(ndr_pull_align(ndr, 1));
2106 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 8));
2107 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
2109 if (ndr_flags & NDR_BUFFERS) {
2111 ndr->flags = _flags_save_STRUCT;
2113 return NDR_ERR_SUCCESS;
2116 _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r)
2118 ndr_print_struct(ndr, name, "netr_Credential");
2120 uint32_t _flags_save_STRUCT = ndr->flags;
2121 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2122 ndr->depth++;
2123 ndr_print_array_uint8(ndr, "data", r->data, 8);
2124 ndr->depth--;
2125 ndr->flags = _flags_save_STRUCT;
2129 _PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
2131 if (ndr_flags & NDR_SCALARS) {
2132 NDR_CHECK(ndr_push_align(ndr, 4));
2133 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2134 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
2135 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2137 if (ndr_flags & NDR_BUFFERS) {
2139 return NDR_ERR_SUCCESS;
2142 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
2144 if (ndr_flags & NDR_SCALARS) {
2145 NDR_CHECK(ndr_pull_align(ndr, 4));
2146 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2147 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
2148 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2150 if (ndr_flags & NDR_BUFFERS) {
2152 return NDR_ERR_SUCCESS;
2155 _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r)
2157 ndr_print_struct(ndr, name, "netr_Authenticator");
2158 ndr->depth++;
2159 ndr_print_netr_Credential(ndr, "cred", &r->cred);
2160 ndr_print_time_t(ndr, "timestamp", r->timestamp);
2161 ndr->depth--;
2164 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)
2166 if (ndr_flags & NDR_SCALARS) {
2167 NDR_CHECK(ndr_push_align(ndr, 5));
2168 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
2169 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2170 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2171 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2172 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2173 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2174 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2175 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2176 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2177 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2179 if (ndr_flags & NDR_BUFFERS) {
2180 if (r->account_name) {
2181 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2182 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2183 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2184 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2186 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2187 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2188 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2189 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2191 return NDR_ERR_SUCCESS;
2194 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
2196 uint32_t _ptr_account_name;
2197 TALLOC_CTX *_mem_save_account_name_0;
2198 if (ndr_flags & NDR_SCALARS) {
2199 NDR_CHECK(ndr_pull_align(ndr, 5));
2200 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
2201 if (_ptr_account_name) {
2202 NDR_PULL_ALLOC(ndr, r->account_name);
2203 } else {
2204 r->account_name = NULL;
2206 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2207 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2208 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2209 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2210 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2211 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2212 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2213 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2214 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2216 if (ndr_flags & NDR_BUFFERS) {
2217 if (r->account_name) {
2218 _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2219 NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
2220 NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
2221 NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
2222 if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
2223 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name));
2225 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t)));
2226 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16));
2227 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
2229 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2230 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2231 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2232 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2234 return NDR_ERR_SUCCESS;
2237 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r)
2239 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER");
2240 ndr->depth++;
2241 ndr_print_ptr(ndr, "account_name", r->account_name);
2242 ndr->depth++;
2243 if (r->account_name) {
2244 ndr_print_string(ndr, "account_name", r->account_name);
2246 ndr->depth--;
2247 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2248 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2249 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2250 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2251 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2252 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2253 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2254 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2255 ndr->depth--;
2258 static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
2260 if (ndr_flags & NDR_SCALARS) {
2261 NDR_CHECK(ndr_push_align(ndr, 4));
2262 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2263 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2264 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
2265 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2266 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2268 if (ndr_flags & NDR_BUFFERS) {
2270 return NDR_ERR_SUCCESS;
2273 static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
2275 if (ndr_flags & NDR_SCALARS) {
2276 NDR_CHECK(ndr_pull_align(ndr, 4));
2277 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
2278 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
2279 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
2280 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2281 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2283 if (ndr_flags & NDR_BUFFERS) {
2285 return NDR_ERR_SUCCESS;
2288 _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r)
2290 ndr_print_struct(ndr, name, "netr_USER_KEY16");
2291 ndr->depth++;
2292 ndr_print_uint16(ndr, "length", r->length);
2293 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
2294 ndr_print_uint32(ndr, "flags", r->flags);
2295 ndr_print_samr_Password(ndr, "pwd", &r->pwd);
2296 ndr->depth--;
2299 static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
2301 if (ndr_flags & NDR_SCALARS) {
2302 NDR_CHECK(ndr_push_align(ndr, 4));
2303 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2304 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2305 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags));
2306 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2307 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2308 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags));
2309 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2310 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2311 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2313 if (ndr_flags & NDR_BUFFERS) {
2315 return NDR_ERR_SUCCESS;
2318 static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
2320 if (ndr_flags & NDR_SCALARS) {
2321 NDR_CHECK(ndr_pull_align(ndr, 4));
2322 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length));
2323 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size));
2324 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags));
2325 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length));
2326 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size));
2327 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags));
2328 NDR_PULL_ALLOC_N(ndr, r->nt_history, r->nt_length);
2329 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2330 NDR_PULL_ALLOC_N(ndr, r->lm_history, r->lm_length);
2331 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2332 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2334 if (ndr_flags & NDR_BUFFERS) {
2336 return NDR_ERR_SUCCESS;
2339 _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r)
2341 ndr_print_struct(ndr, name, "netr_PasswordHistory");
2342 ndr->depth++;
2343 ndr_print_uint16(ndr, "nt_length", r->nt_length);
2344 ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size);
2345 ndr_print_uint32(ndr, "nt_flags", r->nt_flags);
2346 ndr_print_uint16(ndr, "lm_length", r->lm_length);
2347 ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size);
2348 ndr_print_uint32(ndr, "lm_flags", r->lm_flags);
2349 ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length);
2350 ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length);
2351 ndr->depth--;
2354 static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
2356 if (ndr_flags & NDR_SCALARS) {
2357 NDR_CHECK(ndr_push_align(ndr, 4));
2358 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2359 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2360 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2361 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2363 if (ndr_flags & NDR_BUFFERS) {
2365 return NDR_ERR_SUCCESS;
2368 static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
2370 if (ndr_flags & NDR_SCALARS) {
2371 NDR_CHECK(ndr_pull_align(ndr, 4));
2372 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2373 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2374 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2375 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2377 if (ndr_flags & NDR_BUFFERS) {
2379 return NDR_ERR_SUCCESS;
2382 _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r)
2384 ndr_print_struct(ndr, name, "netr_USER_KEYS2");
2385 ndr->depth++;
2386 ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword);
2387 ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword);
2388 ndr_print_netr_PasswordHistory(ndr, "history", &r->history);
2389 ndr->depth--;
2392 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)
2394 if (ndr_flags & NDR_SCALARS) {
2395 NDR_CHECK(ndr_push_align(ndr, 4));
2396 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2397 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2399 if (ndr_flags & NDR_BUFFERS) {
2401 return NDR_ERR_SUCCESS;
2404 static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
2406 if (ndr_flags & NDR_SCALARS) {
2407 NDR_CHECK(ndr_pull_align(ndr, 4));
2408 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2409 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2411 if (ndr_flags & NDR_BUFFERS) {
2413 return NDR_ERR_SUCCESS;
2416 _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r)
2418 ndr_print_struct(ndr, name, "netr_USER_KEY_UNION");
2419 ndr->depth++;
2420 ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2);
2421 ndr->depth--;
2424 _PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
2426 if (ndr_flags & NDR_SCALARS) {
2427 NDR_CHECK(ndr_push_align(ndr, 4));
2428 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2429 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2430 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2432 if (ndr_flags & NDR_BUFFERS) {
2434 return NDR_ERR_SUCCESS;
2437 _PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
2439 if (ndr_flags & NDR_SCALARS) {
2440 NDR_CHECK(ndr_pull_align(ndr, 4));
2441 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2442 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2443 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2445 if (ndr_flags & NDR_BUFFERS) {
2447 return NDR_ERR_SUCCESS;
2450 _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r)
2452 ndr_print_struct(ndr, name, "netr_USER_KEYS");
2453 ndr->depth++;
2454 ndr_print_uint32(ndr, "version", r->version);
2455 ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys);
2456 ndr->depth--;
2459 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)
2461 if (ndr_flags & NDR_SCALARS) {
2462 NDR_CHECK(ndr_push_align(ndr, 5));
2463 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag));
2464 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2466 uint32_t _flags_save_uint8 = ndr->flags;
2467 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2468 NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData));
2469 ndr->flags = _flags_save_uint8;
2471 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2473 if (ndr_flags & NDR_BUFFERS) {
2475 uint32_t _flags_save_uint8 = ndr->flags;
2476 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2477 if (r->SensitiveData) {
2478 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->DataLength));
2479 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength));
2481 ndr->flags = _flags_save_uint8;
2484 return NDR_ERR_SUCCESS;
2487 static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
2489 uint32_t _ptr_SensitiveData;
2490 TALLOC_CTX *_mem_save_SensitiveData_0;
2491 if (ndr_flags & NDR_SCALARS) {
2492 NDR_CHECK(ndr_pull_align(ndr, 5));
2493 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag));
2494 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength));
2496 uint32_t _flags_save_uint8 = ndr->flags;
2497 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2498 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData));
2499 if (_ptr_SensitiveData) {
2500 NDR_PULL_ALLOC(ndr, r->SensitiveData);
2501 } else {
2502 r->SensitiveData = NULL;
2504 ndr->flags = _flags_save_uint8;
2506 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2508 if (ndr_flags & NDR_BUFFERS) {
2510 uint32_t _flags_save_uint8 = ndr->flags;
2511 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2512 if (r->SensitiveData) {
2513 _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr);
2514 NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0);
2515 NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData));
2516 NDR_PULL_ALLOC_N(ndr, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData));
2517 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData)));
2518 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0);
2520 ndr->flags = _flags_save_uint8;
2522 if (r->SensitiveData) {
2523 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength));
2526 return NDR_ERR_SUCCESS;
2529 _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r)
2531 ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO");
2532 ndr->depth++;
2533 ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag);
2534 ndr_print_uint32(ndr, "DataLength", r->DataLength);
2535 ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData);
2536 ndr->depth++;
2537 if (r->SensitiveData) {
2538 ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength);
2540 ndr->depth--;
2541 ndr->depth--;
2544 static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
2546 if (ndr_flags & NDR_SCALARS) {
2547 NDR_CHECK(ndr_push_align(ndr, 5));
2548 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2549 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2550 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2551 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2552 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2553 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2554 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2555 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2556 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2557 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2558 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2559 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2560 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2561 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2562 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2563 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2564 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2565 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2566 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2567 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present));
2568 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present));
2569 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2570 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2571 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2572 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2573 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2574 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2575 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2576 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2577 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2578 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2579 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2580 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2581 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2582 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2583 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2584 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2585 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2587 if (ndr_flags & NDR_BUFFERS) {
2588 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2589 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2590 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2591 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2592 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2593 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2594 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2595 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2596 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2597 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2598 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2599 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2600 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2601 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2602 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2603 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2605 return NDR_ERR_SUCCESS;
2608 static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
2610 if (ndr_flags & NDR_SCALARS) {
2611 NDR_CHECK(ndr_pull_align(ndr, 5));
2612 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2613 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2614 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2615 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2616 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2617 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2618 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2619 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2620 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2621 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2622 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2623 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2624 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2625 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2626 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2627 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2628 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2629 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2630 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2631 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present));
2632 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present));
2633 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2634 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2635 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2636 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2637 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2638 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2639 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2640 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2641 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2642 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2643 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2644 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2645 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2646 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2647 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2648 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2649 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2651 if (ndr_flags & NDR_BUFFERS) {
2652 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2653 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2654 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2655 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2656 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2657 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2658 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2659 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2660 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2661 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2662 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2663 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2664 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2665 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2666 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2667 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2669 return NDR_ERR_SUCCESS;
2672 _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r)
2674 ndr_print_struct(ndr, name, "netr_DELTA_USER");
2675 ndr->depth++;
2676 ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2677 ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2678 ndr_print_uint32(ndr, "rid", r->rid);
2679 ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2680 ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2681 ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2682 ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2683 ndr_print_lsa_String(ndr, "description", &r->description);
2684 ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2685 ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2686 ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2687 ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2688 ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2689 ndr_print_uint16(ndr, "logon_count", r->logon_count);
2690 ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2691 ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2692 ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2693 ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
2694 ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
2695 ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present);
2696 ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present);
2697 ndr_print_uint8(ndr, "password_expired", r->password_expired);
2698 ndr_print_lsa_String(ndr, "comment", &r->comment);
2699 ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2700 ndr_print_uint16(ndr, "country_code", r->country_code);
2701 ndr_print_uint16(ndr, "code_page", r->code_page);
2702 ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info);
2703 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2704 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2705 ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2706 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2707 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2708 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2709 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2710 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2711 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2712 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2713 ndr->depth--;
2716 static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
2718 if (ndr_flags & NDR_SCALARS) {
2719 NDR_CHECK(ndr_push_align(ndr, 5));
2720 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2721 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2722 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time));
2723 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
2724 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
2725 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
2726 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
2727 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
2728 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
2729 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2730 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2731 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2732 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2733 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2734 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2735 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass));
2736 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2737 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2738 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2739 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2741 if (ndr_flags & NDR_BUFFERS) {
2742 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2743 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2744 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2745 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2746 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2747 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2748 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2750 return NDR_ERR_SUCCESS;
2753 static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
2755 if (ndr_flags & NDR_SCALARS) {
2756 NDR_CHECK(ndr_pull_align(ndr, 5));
2757 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2758 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2759 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time));
2760 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
2761 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
2762 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
2763 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
2764 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
2765 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
2766 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2767 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2768 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2769 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2770 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2771 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2772 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass));
2773 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2774 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2775 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2776 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2778 if (ndr_flags & NDR_BUFFERS) {
2779 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2780 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2781 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2782 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2783 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2784 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2785 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2787 return NDR_ERR_SUCCESS;
2790 _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r)
2792 ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN");
2793 ndr->depth++;
2794 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
2795 ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
2796 ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time);
2797 ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
2798 ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
2799 ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
2800 ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
2801 ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
2802 ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
2803 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2804 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2805 ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout);
2806 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2807 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2808 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2809 ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass);
2810 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2811 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2812 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2813 ndr->depth--;
2816 static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
2818 if (ndr_flags & NDR_SCALARS) {
2819 NDR_CHECK(ndr_push_align(ndr, 5));
2820 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2821 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2822 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
2823 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2824 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2825 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2826 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2827 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2828 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2829 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2830 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2831 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2832 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2833 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2834 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2836 if (ndr_flags & NDR_BUFFERS) {
2837 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2838 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2839 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2840 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2841 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2842 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2843 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2845 return NDR_ERR_SUCCESS;
2848 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
2850 if (ndr_flags & NDR_SCALARS) {
2851 NDR_CHECK(ndr_pull_align(ndr, 5));
2852 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2853 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2854 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
2855 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2856 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2857 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2858 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2859 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2860 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2861 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2862 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2863 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2864 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2865 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2866 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2868 if (ndr_flags & NDR_BUFFERS) {
2869 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2870 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2871 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2872 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2873 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2874 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2875 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2877 return NDR_ERR_SUCCESS;
2880 _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r)
2882 ndr_print_struct(ndr, name, "netr_DELTA_GROUP");
2883 ndr->depth++;
2884 ndr_print_lsa_String(ndr, "group_name", &r->group_name);
2885 ndr_print_uint32(ndr, "rid", r->rid);
2886 ndr_print_uint32(ndr, "attributes", r->attributes);
2887 ndr_print_lsa_String(ndr, "description", &r->description);
2888 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2889 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2890 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2891 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2892 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2893 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2894 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2895 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2896 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2897 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2898 ndr->depth--;
2901 static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
2903 if (ndr_flags & NDR_SCALARS) {
2904 NDR_CHECK(ndr_push_align(ndr, 5));
2905 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2906 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2907 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2908 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2909 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2910 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2911 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2912 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2913 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2914 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2915 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2917 if (ndr_flags & NDR_BUFFERS) {
2918 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2919 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2920 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2921 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2922 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2923 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2925 return NDR_ERR_SUCCESS;
2928 static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
2930 if (ndr_flags & NDR_SCALARS) {
2931 NDR_CHECK(ndr_pull_align(ndr, 5));
2932 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2933 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2934 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2935 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2936 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2937 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2938 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2939 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2940 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2941 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2942 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2944 if (ndr_flags & NDR_BUFFERS) {
2945 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2946 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2947 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2948 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2949 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2950 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2952 return NDR_ERR_SUCCESS;
2955 _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r)
2957 ndr_print_struct(ndr, name, "netr_DELTA_RENAME");
2958 ndr->depth++;
2959 ndr_print_lsa_String(ndr, "OldName", &r->OldName);
2960 ndr_print_lsa_String(ndr, "NewName", &r->NewName);
2961 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2962 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2963 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2964 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2965 ndr_print_uint32(ndr, "unknown5", r->unknown5);
2966 ndr_print_uint32(ndr, "unknown6", r->unknown6);
2967 ndr_print_uint32(ndr, "unknown7", r->unknown7);
2968 ndr_print_uint32(ndr, "unknown8", r->unknown8);
2969 ndr->depth--;
2972 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)
2974 uint32_t cntr_rids_1;
2975 uint32_t cntr_attribs_1;
2976 if (ndr_flags & NDR_SCALARS) {
2977 NDR_CHECK(ndr_push_align(ndr, 5));
2978 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
2979 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs));
2980 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2981 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
2982 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
2983 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
2984 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
2985 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2987 if (ndr_flags & NDR_BUFFERS) {
2988 if (r->rids) {
2989 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_rids));
2990 for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
2991 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
2994 if (r->attribs) {
2995 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_rids));
2996 for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
2997 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1]));
3001 return NDR_ERR_SUCCESS;
3004 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
3006 uint32_t _ptr_rids;
3007 uint32_t cntr_rids_1;
3008 TALLOC_CTX *_mem_save_rids_0;
3009 TALLOC_CTX *_mem_save_rids_1;
3010 uint32_t _ptr_attribs;
3011 uint32_t cntr_attribs_1;
3012 TALLOC_CTX *_mem_save_attribs_0;
3013 TALLOC_CTX *_mem_save_attribs_1;
3014 if (ndr_flags & NDR_SCALARS) {
3015 NDR_CHECK(ndr_pull_align(ndr, 5));
3016 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
3017 if (_ptr_rids) {
3018 NDR_PULL_ALLOC(ndr, r->rids);
3019 } else {
3020 r->rids = NULL;
3022 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs));
3023 if (_ptr_attribs) {
3024 NDR_PULL_ALLOC(ndr, r->attribs);
3025 } else {
3026 r->attribs = NULL;
3028 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
3029 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
3030 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
3031 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
3032 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
3033 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3035 if (ndr_flags & NDR_BUFFERS) {
3036 if (r->rids) {
3037 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
3038 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
3039 NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
3040 NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
3041 _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
3042 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
3043 for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
3044 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
3046 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
3047 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
3049 if (r->attribs) {
3050 _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr);
3051 NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
3052 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs));
3053 NDR_PULL_ALLOC_N(ndr, r->attribs, ndr_get_array_size(ndr, &r->attribs));
3054 _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr);
3055 NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
3056 for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
3057 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1]));
3059 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0);
3060 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0);
3062 if (r->rids) {
3063 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
3065 if (r->attribs) {
3066 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids));
3069 return NDR_ERR_SUCCESS;
3072 _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r)
3074 uint32_t cntr_rids_1;
3075 uint32_t cntr_attribs_1;
3076 ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER");
3077 ndr->depth++;
3078 ndr_print_ptr(ndr, "rids", r->rids);
3079 ndr->depth++;
3080 if (r->rids) {
3081 ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
3082 ndr->depth++;
3083 for (cntr_rids_1=0;cntr_rids_1<r->num_rids;cntr_rids_1++) {
3084 char *idx_1=NULL;
3085 if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
3086 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
3087 free(idx_1);
3090 ndr->depth--;
3092 ndr->depth--;
3093 ndr_print_ptr(ndr, "attribs", r->attribs);
3094 ndr->depth++;
3095 if (r->attribs) {
3096 ndr->print(ndr, "%s: ARRAY(%d)", "attribs", (int)r->num_rids);
3097 ndr->depth++;
3098 for (cntr_attribs_1=0;cntr_attribs_1<r->num_rids;cntr_attribs_1++) {
3099 char *idx_1=NULL;
3100 if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) {
3101 ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]);
3102 free(idx_1);
3105 ndr->depth--;
3107 ndr->depth--;
3108 ndr_print_uint32(ndr, "num_rids", r->num_rids);
3109 ndr_print_uint32(ndr, "unknown1", r->unknown1);
3110 ndr_print_uint32(ndr, "unknown2", r->unknown2);
3111 ndr_print_uint32(ndr, "unknown3", r->unknown3);
3112 ndr_print_uint32(ndr, "unknown4", r->unknown4);
3113 ndr->depth--;
3116 static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r)
3118 if (ndr_flags & NDR_SCALARS) {
3119 NDR_CHECK(ndr_push_align(ndr, 5));
3120 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3121 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
3122 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3123 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3124 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
3125 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3126 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3127 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3128 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3129 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3130 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3131 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3132 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3134 if (ndr_flags & NDR_BUFFERS) {
3135 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3136 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3137 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
3138 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3139 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3140 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3142 return NDR_ERR_SUCCESS;
3145 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r)
3147 if (ndr_flags & NDR_SCALARS) {
3148 NDR_CHECK(ndr_pull_align(ndr, 5));
3149 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3150 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
3151 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3152 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3153 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
3154 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3155 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3156 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3157 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3158 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3159 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3160 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3161 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3163 if (ndr_flags & NDR_BUFFERS) {
3164 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3165 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3166 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
3167 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3168 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3169 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3171 return NDR_ERR_SUCCESS;
3174 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r)
3176 ndr_print_struct(ndr, name, "netr_DELTA_ALIAS");
3177 ndr->depth++;
3178 ndr_print_lsa_String(ndr, "alias_name", &r->alias_name);
3179 ndr_print_uint32(ndr, "rid", r->rid);
3180 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3181 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3182 ndr_print_lsa_String(ndr, "description", &r->description);
3183 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3184 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3185 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3186 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3187 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3188 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3189 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3190 ndr->depth--;
3193 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)
3195 if (ndr_flags & NDR_SCALARS) {
3196 NDR_CHECK(ndr_push_align(ndr, 5));
3197 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3198 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
3199 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
3200 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
3201 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
3202 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3204 if (ndr_flags & NDR_BUFFERS) {
3205 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3207 return NDR_ERR_SUCCESS;
3210 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r)
3212 if (ndr_flags & NDR_SCALARS) {
3213 NDR_CHECK(ndr_pull_align(ndr, 5));
3214 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3215 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
3216 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
3217 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
3218 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
3219 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3221 if (ndr_flags & NDR_BUFFERS) {
3222 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3224 return NDR_ERR_SUCCESS;
3227 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r)
3229 ndr_print_struct(ndr, name, "netr_DELTA_ALIAS_MEMBER");
3230 ndr->depth++;
3231 ndr_print_lsa_SidArray(ndr, "sids", &r->sids);
3232 ndr_print_uint32(ndr, "unknown1", r->unknown1);
3233 ndr_print_uint32(ndr, "unknown2", r->unknown2);
3234 ndr_print_uint32(ndr, "unknown3", r->unknown3);
3235 ndr_print_uint32(ndr, "unknown4", r->unknown4);
3236 ndr->depth--;
3239 static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r)
3241 if (ndr_flags & NDR_SCALARS) {
3242 NDR_CHECK(ndr_push_align(ndr, 4));
3243 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagedpoollimit));
3244 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonpagedpoollimit));
3245 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minimumworkingsetsize));
3246 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximumworkingsetsize));
3247 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefilelimit));
3248 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timelimit));
3249 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
3251 if (ndr_flags & NDR_BUFFERS) {
3253 return NDR_ERR_SUCCESS;
3256 static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r)
3258 if (ndr_flags & NDR_SCALARS) {
3259 NDR_CHECK(ndr_pull_align(ndr, 4));
3260 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagedpoollimit));
3261 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nonpagedpoollimit));
3262 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minimumworkingsetsize));
3263 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximumworkingsetsize));
3264 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefilelimit));
3265 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timelimit));
3266 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
3268 if (ndr_flags & NDR_BUFFERS) {
3270 return NDR_ERR_SUCCESS;
3273 _PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r)
3275 ndr_print_struct(ndr, name, "netr_QUOTA_LIMITS");
3276 ndr->depth++;
3277 ndr_print_uint32(ndr, "pagedpoollimit", r->pagedpoollimit);
3278 ndr_print_uint32(ndr, "nonpagedpoollimit", r->nonpagedpoollimit);
3279 ndr_print_uint32(ndr, "minimumworkingsetsize", r->minimumworkingsetsize);
3280 ndr_print_uint32(ndr, "maximumworkingsetsize", r->maximumworkingsetsize);
3281 ndr_print_uint32(ndr, "pagefilelimit", r->pagefilelimit);
3282 ndr_print_NTTIME(ndr, "timelimit", r->timelimit);
3283 ndr->depth--;
3286 static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r)
3288 uint32_t cntr_eventauditoptions_1;
3289 if (ndr_flags & NDR_SCALARS) {
3290 NDR_CHECK(ndr_push_align(ndr, 5));
3291 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlogsize));
3292 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->auditretentionperiod));
3293 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auditingmode));
3294 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount));
3295 NDR_CHECK(ndr_push_unique_ptr(ndr, r->eventauditoptions));
3296 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3297 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
3298 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3299 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
3300 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time));
3301 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3302 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3303 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3304 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3305 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3306 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3307 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3308 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3309 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3310 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3311 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3313 if (ndr_flags & NDR_BUFFERS) {
3314 if (r->eventauditoptions) {
3315 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->maxauditeventcount + 1));
3316 for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) {
3317 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->eventauditoptions[cntr_eventauditoptions_1]));
3320 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name));
3321 if (r->sid) {
3322 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
3324 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3325 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3326 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3327 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3328 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3330 return NDR_ERR_SUCCESS;
3333 static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r)
3335 uint32_t _ptr_eventauditoptions;
3336 uint32_t cntr_eventauditoptions_1;
3337 TALLOC_CTX *_mem_save_eventauditoptions_0;
3338 TALLOC_CTX *_mem_save_eventauditoptions_1;
3339 uint32_t _ptr_sid;
3340 TALLOC_CTX *_mem_save_sid_0;
3341 if (ndr_flags & NDR_SCALARS) {
3342 NDR_CHECK(ndr_pull_align(ndr, 5));
3343 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlogsize));
3344 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->auditretentionperiod));
3345 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auditingmode));
3346 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxauditeventcount));
3347 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eventauditoptions));
3348 if (_ptr_eventauditoptions) {
3349 NDR_PULL_ALLOC(ndr, r->eventauditoptions);
3350 } else {
3351 r->eventauditoptions = NULL;
3353 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3354 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
3355 if (_ptr_sid) {
3356 NDR_PULL_ALLOC(ndr, r->sid);
3357 } else {
3358 r->sid = NULL;
3360 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3361 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
3362 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time));
3363 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3364 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3365 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3366 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3367 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3368 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3369 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3370 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3371 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3372 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3373 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3375 if (ndr_flags & NDR_BUFFERS) {
3376 if (r->eventauditoptions) {
3377 _mem_save_eventauditoptions_0 = NDR_PULL_GET_MEM_CTX(ndr);
3378 NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0);
3379 NDR_CHECK(ndr_pull_array_size(ndr, &r->eventauditoptions));
3380 NDR_PULL_ALLOC_N(ndr, r->eventauditoptions, ndr_get_array_size(ndr, &r->eventauditoptions));
3381 _mem_save_eventauditoptions_1 = NDR_PULL_GET_MEM_CTX(ndr);
3382 NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0);
3383 for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) {
3384 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->eventauditoptions[cntr_eventauditoptions_1]));
3386 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_1, 0);
3387 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_0, 0);
3389 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name));
3390 if (r->sid) {
3391 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
3392 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
3393 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
3394 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
3396 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3397 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3398 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3399 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3400 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3401 if (r->eventauditoptions) {
3402 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eventauditoptions, r->maxauditeventcount + 1));
3405 return NDR_ERR_SUCCESS;
3408 _PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r)
3410 uint32_t cntr_eventauditoptions_1;
3411 ndr_print_struct(ndr, name, "netr_DELTA_POLICY");
3412 ndr->depth++;
3413 ndr_print_uint32(ndr, "maxlogsize", r->maxlogsize);
3414 ndr_print_NTTIME(ndr, "auditretentionperiod", r->auditretentionperiod);
3415 ndr_print_uint8(ndr, "auditingmode", r->auditingmode);
3416 ndr_print_uint32(ndr, "maxauditeventcount", r->maxauditeventcount);
3417 ndr_print_ptr(ndr, "eventauditoptions", r->eventauditoptions);
3418 ndr->depth++;
3419 if (r->eventauditoptions) {
3420 ndr->print(ndr, "%s: ARRAY(%d)", "eventauditoptions", (int)r->maxauditeventcount + 1);
3421 ndr->depth++;
3422 for (cntr_eventauditoptions_1=0;cntr_eventauditoptions_1<r->maxauditeventcount + 1;cntr_eventauditoptions_1++) {
3423 char *idx_1=NULL;
3424 if (asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1) != -1) {
3425 ndr_print_uint32(ndr, "eventauditoptions", r->eventauditoptions[cntr_eventauditoptions_1]);
3426 free(idx_1);
3429 ndr->depth--;
3431 ndr->depth--;
3432 ndr_print_lsa_String(ndr, "primary_domain_name", &r->primary_domain_name);
3433 ndr_print_ptr(ndr, "sid", r->sid);
3434 ndr->depth++;
3435 if (r->sid) {
3436 ndr_print_dom_sid2(ndr, "sid", r->sid);
3438 ndr->depth--;
3439 ndr_print_netr_QUOTA_LIMITS(ndr, "quota_limits", &r->quota_limits);
3440 ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
3441 ndr_print_NTTIME(ndr, "db_create_time", r->db_create_time);
3442 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3443 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3444 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3445 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3446 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3447 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3448 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3449 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3450 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3451 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3452 ndr->depth--;
3455 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)
3457 uint32_t cntr_controller_names_1;
3458 if (ndr_flags & NDR_SCALARS) {
3459 NDR_CHECK(ndr_push_align(ndr, 5));
3460 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
3461 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers));
3462 NDR_CHECK(ndr_push_unique_ptr(ndr, r->controller_names));
3463 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3464 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3465 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3466 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3467 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3468 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3469 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset));
3470 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3471 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3472 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3473 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3475 if (ndr_flags & NDR_BUFFERS) {
3476 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
3477 if (r->controller_names) {
3478 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_controllers));
3479 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3480 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1]));
3482 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3483 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1]));
3486 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3487 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3488 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3489 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3490 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3492 return NDR_ERR_SUCCESS;
3495 static enum ndr_err_code ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r)
3497 uint32_t _ptr_controller_names;
3498 uint32_t cntr_controller_names_1;
3499 TALLOC_CTX *_mem_save_controller_names_0;
3500 TALLOC_CTX *_mem_save_controller_names_1;
3501 if (ndr_flags & NDR_SCALARS) {
3502 NDR_CHECK(ndr_pull_align(ndr, 5));
3503 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
3504 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_controllers));
3505 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_controller_names));
3506 if (_ptr_controller_names) {
3507 NDR_PULL_ALLOC(ndr, r->controller_names);
3508 } else {
3509 r->controller_names = NULL;
3511 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3512 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3513 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3514 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3515 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3516 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3517 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset));
3518 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3519 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3520 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3521 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3523 if (ndr_flags & NDR_BUFFERS) {
3524 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
3525 if (r->controller_names) {
3526 _mem_save_controller_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
3527 NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0);
3528 NDR_CHECK(ndr_pull_array_size(ndr, &r->controller_names));
3529 NDR_PULL_ALLOC_N(ndr, r->controller_names, ndr_get_array_size(ndr, &r->controller_names));
3530 _mem_save_controller_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
3531 NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0);
3532 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3533 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1]));
3535 for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) {
3536 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1]));
3538 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_1, 0);
3539 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_0, 0);
3541 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3542 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3543 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3544 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3545 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3546 if (r->controller_names) {
3547 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->controller_names, r->num_controllers));
3550 return NDR_ERR_SUCCESS;
3553 _PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r)
3555 uint32_t cntr_controller_names_1;
3556 ndr_print_struct(ndr, name, "netr_DELTA_TRUSTED_DOMAIN");
3557 ndr->depth++;
3558 ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
3559 ndr_print_uint32(ndr, "num_controllers", r->num_controllers);
3560 ndr_print_ptr(ndr, "controller_names", r->controller_names);
3561 ndr->depth++;
3562 if (r->controller_names) {
3563 ndr->print(ndr, "%s: ARRAY(%d)", "controller_names", (int)r->num_controllers);
3564 ndr->depth++;
3565 for (cntr_controller_names_1=0;cntr_controller_names_1<r->num_controllers;cntr_controller_names_1++) {
3566 char *idx_1=NULL;
3567 if (asprintf(&idx_1, "[%d]", cntr_controller_names_1) != -1) {
3568 ndr_print_lsa_String(ndr, "controller_names", &r->controller_names[cntr_controller_names_1]);
3569 free(idx_1);
3572 ndr->depth--;
3574 ndr->depth--;
3575 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3576 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3577 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3578 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3579 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3580 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3581 ndr_print_uint32(ndr, "posix_offset", r->posix_offset);
3582 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3583 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3584 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3585 ndr->depth--;
3588 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)
3590 if (ndr_flags & NDR_SCALARS) {
3591 NDR_CHECK(ndr_push_align(ndr, 2));
3592 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3593 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3595 if (ndr_flags & NDR_BUFFERS) {
3597 return NDR_ERR_SUCCESS;
3600 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r)
3602 if (ndr_flags & NDR_SCALARS) {
3603 NDR_CHECK(ndr_pull_align(ndr, 2));
3604 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3605 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3607 if (ndr_flags & NDR_BUFFERS) {
3609 return NDR_ERR_SUCCESS;
3612 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r)
3614 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_TRUST");
3615 ndr->depth++;
3616 ndr_print_uint16(ndr, "unknown", r->unknown);
3617 ndr->depth--;
3620 static enum ndr_err_code ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r)
3622 uint32_t cntr_privilege_attrib_1;
3623 uint32_t cntr_privilege_name_1;
3624 if (ndr_flags & NDR_SCALARS) {
3625 NDR_CHECK(ndr_push_align(ndr, 5));
3626 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries));
3627 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_control));
3628 NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_attrib));
3629 NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_name));
3630 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits));
3631 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->system_flags));
3632 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3633 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3634 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3635 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3636 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3637 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3638 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3639 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3640 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3641 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3642 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3644 if (ndr_flags & NDR_BUFFERS) {
3645 if (r->privilege_attrib) {
3646 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->privilege_entries));
3647 for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) {
3648 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_attrib[cntr_privilege_attrib_1]));
3651 if (r->privilege_name) {
3652 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->privilege_entries));
3653 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3654 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1]));
3656 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3657 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1]));
3660 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3661 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3662 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3663 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3664 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3666 return NDR_ERR_SUCCESS;
3669 static enum ndr_err_code ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r)
3671 uint32_t _ptr_privilege_attrib;
3672 uint32_t cntr_privilege_attrib_1;
3673 TALLOC_CTX *_mem_save_privilege_attrib_0;
3674 TALLOC_CTX *_mem_save_privilege_attrib_1;
3675 uint32_t _ptr_privilege_name;
3676 uint32_t cntr_privilege_name_1;
3677 TALLOC_CTX *_mem_save_privilege_name_0;
3678 TALLOC_CTX *_mem_save_privilege_name_1;
3679 if (ndr_flags & NDR_SCALARS) {
3680 NDR_CHECK(ndr_pull_align(ndr, 5));
3681 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_entries));
3682 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_control));
3683 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_attrib));
3684 if (_ptr_privilege_attrib) {
3685 NDR_PULL_ALLOC(ndr, r->privilege_attrib);
3686 } else {
3687 r->privilege_attrib = NULL;
3689 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_name));
3690 if (_ptr_privilege_name) {
3691 NDR_PULL_ALLOC(ndr, r->privilege_name);
3692 } else {
3693 r->privilege_name = NULL;
3695 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits));
3696 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->system_flags));
3697 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3698 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3699 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3700 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3701 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3702 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3703 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3704 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3705 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3706 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3707 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3709 if (ndr_flags & NDR_BUFFERS) {
3710 if (r->privilege_attrib) {
3711 _mem_save_privilege_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr);
3712 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0);
3713 NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_attrib));
3714 NDR_PULL_ALLOC_N(ndr, r->privilege_attrib, ndr_get_array_size(ndr, &r->privilege_attrib));
3715 _mem_save_privilege_attrib_1 = NDR_PULL_GET_MEM_CTX(ndr);
3716 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0);
3717 for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) {
3718 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_attrib[cntr_privilege_attrib_1]));
3720 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_1, 0);
3721 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_0, 0);
3723 if (r->privilege_name) {
3724 _mem_save_privilege_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3725 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0);
3726 NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_name));
3727 NDR_PULL_ALLOC_N(ndr, r->privilege_name, ndr_get_array_size(ndr, &r->privilege_name));
3728 _mem_save_privilege_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
3729 NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0);
3730 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3731 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1]));
3733 for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) {
3734 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1]));
3736 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_1, 0);
3737 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_0, 0);
3739 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3740 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3741 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3742 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3743 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3744 if (r->privilege_attrib) {
3745 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_attrib, r->privilege_entries));
3747 if (r->privilege_name) {
3748 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_name, r->privilege_entries));
3751 return NDR_ERR_SUCCESS;
3754 _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r)
3756 uint32_t cntr_privilege_attrib_1;
3757 uint32_t cntr_privilege_name_1;
3758 ndr_print_struct(ndr, name, "netr_DELTA_ACCOUNT");
3759 ndr->depth++;
3760 ndr_print_uint32(ndr, "privilege_entries", r->privilege_entries);
3761 ndr_print_uint32(ndr, "privilege_control", r->privilege_control);
3762 ndr_print_ptr(ndr, "privilege_attrib", r->privilege_attrib);
3763 ndr->depth++;
3764 if (r->privilege_attrib) {
3765 ndr->print(ndr, "%s: ARRAY(%d)", "privilege_attrib", (int)r->privilege_entries);
3766 ndr->depth++;
3767 for (cntr_privilege_attrib_1=0;cntr_privilege_attrib_1<r->privilege_entries;cntr_privilege_attrib_1++) {
3768 char *idx_1=NULL;
3769 if (asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1) != -1) {
3770 ndr_print_uint32(ndr, "privilege_attrib", r->privilege_attrib[cntr_privilege_attrib_1]);
3771 free(idx_1);
3774 ndr->depth--;
3776 ndr->depth--;
3777 ndr_print_ptr(ndr, "privilege_name", r->privilege_name);
3778 ndr->depth++;
3779 if (r->privilege_name) {
3780 ndr->print(ndr, "%s: ARRAY(%d)", "privilege_name", (int)r->privilege_entries);
3781 ndr->depth++;
3782 for (cntr_privilege_name_1=0;cntr_privilege_name_1<r->privilege_entries;cntr_privilege_name_1++) {
3783 char *idx_1=NULL;
3784 if (asprintf(&idx_1, "[%d]", cntr_privilege_name_1) != -1) {
3785 ndr_print_lsa_String(ndr, "privilege_name", &r->privilege_name[cntr_privilege_name_1]);
3786 free(idx_1);
3789 ndr->depth--;
3791 ndr->depth--;
3792 ndr_print_netr_QUOTA_LIMITS(ndr, "quotalimits", &r->quotalimits);
3793 ndr_print_uint32(ndr, "system_flags", r->system_flags);
3794 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3795 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3796 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
3797 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3798 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3799 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3800 ndr_print_uint32(ndr, "unknown5", r->unknown5);
3801 ndr_print_uint32(ndr, "unknown6", r->unknown6);
3802 ndr_print_uint32(ndr, "unknown7", r->unknown7);
3803 ndr_print_uint32(ndr, "unknown8", r->unknown8);
3804 ndr->depth--;
3807 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)
3809 if (ndr_flags & NDR_SCALARS) {
3810 NDR_CHECK(ndr_push_align(ndr, 2));
3811 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3812 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3814 if (ndr_flags & NDR_BUFFERS) {
3816 return NDR_ERR_SUCCESS;
3819 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r)
3821 if (ndr_flags & NDR_SCALARS) {
3822 NDR_CHECK(ndr_pull_align(ndr, 2));
3823 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3824 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3826 if (ndr_flags & NDR_BUFFERS) {
3828 return NDR_ERR_SUCCESS;
3831 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r)
3833 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_ACCOUNT");
3834 ndr->depth++;
3835 ndr_print_uint16(ndr, "unknown", r->unknown);
3836 ndr->depth--;
3839 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)
3841 if (ndr_flags & NDR_SCALARS) {
3842 NDR_CHECK(ndr_push_align(ndr, 2));
3843 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown));
3844 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
3846 if (ndr_flags & NDR_BUFFERS) {
3848 return NDR_ERR_SUCCESS;
3851 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r)
3853 if (ndr_flags & NDR_SCALARS) {
3854 NDR_CHECK(ndr_pull_align(ndr, 2));
3855 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown));
3856 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
3858 if (ndr_flags & NDR_BUFFERS) {
3860 return NDR_ERR_SUCCESS;
3863 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r)
3865 ndr_print_struct(ndr, name, "netr_DELTA_DELETE_SECRET");
3866 ndr->depth++;
3867 ndr_print_uint16(ndr, "unknown", r->unknown);
3868 ndr->depth--;
3871 static enum ndr_err_code ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r)
3873 if (ndr_flags & NDR_SCALARS) {
3874 NDR_CHECK(ndr_push_align(ndr, 5));
3875 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
3876 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen));
3877 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cipher_data));
3878 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3880 if (ndr_flags & NDR_BUFFERS) {
3881 if (r->cipher_data) {
3882 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->maxlen));
3883 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3884 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->len));
3885 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->cipher_data, r->len));
3888 return NDR_ERR_SUCCESS;
3891 static enum ndr_err_code ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r)
3893 uint32_t _ptr_cipher_data;
3894 TALLOC_CTX *_mem_save_cipher_data_0;
3895 if (ndr_flags & NDR_SCALARS) {
3896 NDR_CHECK(ndr_pull_align(ndr, 5));
3897 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len));
3898 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlen));
3899 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cipher_data));
3900 if (_ptr_cipher_data) {
3901 NDR_PULL_ALLOC(ndr, r->cipher_data);
3902 } else {
3903 r->cipher_data = NULL;
3905 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3907 if (ndr_flags & NDR_BUFFERS) {
3908 if (r->cipher_data) {
3909 _mem_save_cipher_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
3910 NDR_PULL_SET_MEM_CTX(ndr, r->cipher_data, 0);
3911 NDR_CHECK(ndr_pull_array_size(ndr, &r->cipher_data));
3912 NDR_CHECK(ndr_pull_array_length(ndr, &r->cipher_data));
3913 if (ndr_get_array_length(ndr, &r->cipher_data) > ndr_get_array_size(ndr, &r->cipher_data)) {
3914 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->cipher_data), ndr_get_array_length(ndr, &r->cipher_data));
3916 NDR_PULL_ALLOC_N(ndr, r->cipher_data, ndr_get_array_size(ndr, &r->cipher_data));
3917 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->cipher_data, ndr_get_array_length(ndr, &r->cipher_data)));
3918 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cipher_data_0, 0);
3920 if (r->cipher_data) {
3921 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cipher_data, r->maxlen));
3923 if (r->cipher_data) {
3924 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->cipher_data, r->len));
3927 return NDR_ERR_SUCCESS;
3930 _PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r)
3932 ndr_print_struct(ndr, name, "netr_CIPHER_VALUE");
3933 ndr->depth++;
3934 ndr_print_uint32(ndr, "len", r->len);
3935 ndr_print_uint32(ndr, "maxlen", r->maxlen);
3936 ndr_print_ptr(ndr, "cipher_data", r->cipher_data);
3937 ndr->depth++;
3938 if (r->cipher_data) {
3939 ndr_print_array_uint8(ndr, "cipher_data", r->cipher_data, r->len);
3941 ndr->depth--;
3942 ndr->depth--;
3945 static enum ndr_err_code ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r)
3947 if (ndr_flags & NDR_SCALARS) {
3948 NDR_CHECK(ndr_push_align(ndr, 5));
3949 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher));
3950 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->current_cipher_set_time));
3951 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher));
3952 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->old_cipher_set_time));
3953 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3954 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3955 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3956 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3957 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3958 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3959 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3960 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3961 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3962 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3963 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3965 if (ndr_flags & NDR_BUFFERS) {
3966 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher));
3967 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher));
3968 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3969 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3970 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3971 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3972 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3974 return NDR_ERR_SUCCESS;
3977 static enum ndr_err_code ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r)
3979 if (ndr_flags & NDR_SCALARS) {
3980 NDR_CHECK(ndr_pull_align(ndr, 5));
3981 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher));
3982 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->current_cipher_set_time));
3983 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher));
3984 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->old_cipher_set_time));
3985 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3986 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3987 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3988 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3989 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3990 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3991 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3992 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3993 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3994 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3995 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3997 if (ndr_flags & NDR_BUFFERS) {
3998 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher));
3999 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher));
4000 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
4001 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
4002 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
4003 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
4004 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
4006 return NDR_ERR_SUCCESS;
4009 _PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r)
4011 ndr_print_struct(ndr, name, "netr_DELTA_SECRET");
4012 ndr->depth++;
4013 ndr_print_netr_CIPHER_VALUE(ndr, "current_cipher", &r->current_cipher);
4014 ndr_print_NTTIME(ndr, "current_cipher_set_time", r->current_cipher_set_time);
4015 ndr_print_netr_CIPHER_VALUE(ndr, "old_cipher", &r->old_cipher);
4016 ndr_print_NTTIME(ndr, "old_cipher_set_time", r->old_cipher_set_time);
4017 ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
4018 ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
4019 ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
4020 ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
4021 ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
4022 ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
4023 ndr_print_uint32(ndr, "unknown5", r->unknown5);
4024 ndr_print_uint32(ndr, "unknown6", r->unknown6);
4025 ndr_print_uint32(ndr, "unknown7", r->unknown7);
4026 ndr_print_uint32(ndr, "unknown8", r->unknown8);
4027 ndr->depth--;
4030 static enum ndr_err_code ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r)
4032 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
4033 return NDR_ERR_SUCCESS;
4036 static enum ndr_err_code ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r)
4038 uint16_t v;
4039 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
4040 *r = v;
4041 return NDR_ERR_SUCCESS;
4044 _PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r)
4046 const char *val = NULL;
4048 switch (r) {
4049 case NETR_DELTA_DOMAIN: val = "NETR_DELTA_DOMAIN"; break;
4050 case NETR_DELTA_GROUP: val = "NETR_DELTA_GROUP"; break;
4051 case NETR_DELTA_DELETE_GROUP: val = "NETR_DELTA_DELETE_GROUP"; break;
4052 case NETR_DELTA_RENAME_GROUP: val = "NETR_DELTA_RENAME_GROUP"; break;
4053 case NETR_DELTA_USER: val = "NETR_DELTA_USER"; break;
4054 case NETR_DELTA_DELETE_USER: val = "NETR_DELTA_DELETE_USER"; break;
4055 case NETR_DELTA_RENAME_USER: val = "NETR_DELTA_RENAME_USER"; break;
4056 case NETR_DELTA_GROUP_MEMBER: val = "NETR_DELTA_GROUP_MEMBER"; break;
4057 case NETR_DELTA_ALIAS: val = "NETR_DELTA_ALIAS"; break;
4058 case NETR_DELTA_DELETE_ALIAS: val = "NETR_DELTA_DELETE_ALIAS"; break;
4059 case NETR_DELTA_RENAME_ALIAS: val = "NETR_DELTA_RENAME_ALIAS"; break;
4060 case NETR_DELTA_ALIAS_MEMBER: val = "NETR_DELTA_ALIAS_MEMBER"; break;
4061 case NETR_DELTA_POLICY: val = "NETR_DELTA_POLICY"; break;
4062 case NETR_DELTA_TRUSTED_DOMAIN: val = "NETR_DELTA_TRUSTED_DOMAIN"; break;
4063 case NETR_DELTA_DELETE_TRUST: val = "NETR_DELTA_DELETE_TRUST"; break;
4064 case NETR_DELTA_ACCOUNT: val = "NETR_DELTA_ACCOUNT"; break;
4065 case NETR_DELTA_DELETE_ACCOUNT: val = "NETR_DELTA_DELETE_ACCOUNT"; break;
4066 case NETR_DELTA_SECRET: val = "NETR_DELTA_SECRET"; break;
4067 case NETR_DELTA_DELETE_SECRET: val = "NETR_DELTA_DELETE_SECRET"; break;
4068 case NETR_DELTA_DELETE_GROUP2: val = "NETR_DELTA_DELETE_GROUP2"; break;
4069 case NETR_DELTA_DELETE_USER2: val = "NETR_DELTA_DELETE_USER2"; break;
4070 case NETR_DELTA_MODIFY_COUNT: val = "NETR_DELTA_MODIFY_COUNT"; break;
4072 ndr_print_enum(ndr, name, "ENUM", val, r);
4075 static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r)
4077 if (ndr_flags & NDR_SCALARS) {
4078 int level = ndr_push_get_switch_value(ndr, r);
4079 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
4080 NDR_CHECK(ndr_push_union_align(ndr, 5));
4081 switch (level) {
4082 case NETR_DELTA_DOMAIN: {
4083 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
4084 break; }
4086 case NETR_DELTA_GROUP: {
4087 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group));
4088 break; }
4090 case NETR_DELTA_DELETE_GROUP: {
4091 break; }
4093 case NETR_DELTA_RENAME_GROUP: {
4094 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group));
4095 break; }
4097 case NETR_DELTA_USER: {
4098 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
4099 break; }
4101 case NETR_DELTA_DELETE_USER: {
4102 break; }
4104 case NETR_DELTA_RENAME_USER: {
4105 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user));
4106 break; }
4108 case NETR_DELTA_GROUP_MEMBER: {
4109 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member));
4110 break; }
4112 case NETR_DELTA_ALIAS: {
4113 NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias));
4114 break; }
4116 case NETR_DELTA_DELETE_ALIAS: {
4117 break; }
4119 case NETR_DELTA_RENAME_ALIAS: {
4120 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias));
4121 break; }
4123 case NETR_DELTA_ALIAS_MEMBER: {
4124 NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member));
4125 break; }
4127 case NETR_DELTA_POLICY: {
4128 NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
4129 break; }
4131 case NETR_DELTA_TRUSTED_DOMAIN: {
4132 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain));
4133 break; }
4135 case NETR_DELTA_DELETE_TRUST: {
4136 NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust));
4137 break; }
4139 case NETR_DELTA_ACCOUNT: {
4140 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account));
4141 break; }
4143 case NETR_DELTA_DELETE_ACCOUNT: {
4144 NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account));
4145 break; }
4147 case NETR_DELTA_SECRET: {
4148 NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret));
4149 break; }
4151 case NETR_DELTA_DELETE_SECRET: {
4152 NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret));
4153 break; }
4155 case NETR_DELTA_DELETE_GROUP2: {
4156 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group));
4157 break; }
4159 case NETR_DELTA_DELETE_USER2: {
4160 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user));
4161 break; }
4163 case NETR_DELTA_MODIFY_COUNT: {
4164 NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count));
4165 break; }
4167 default:
4168 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4171 if (ndr_flags & NDR_BUFFERS) {
4172 int level = ndr_push_get_switch_value(ndr, r);
4173 switch (level) {
4174 case NETR_DELTA_DOMAIN:
4175 if (r->domain) {
4176 NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4178 break;
4180 case NETR_DELTA_GROUP:
4181 if (r->group) {
4182 NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group));
4184 break;
4186 case NETR_DELTA_DELETE_GROUP:
4187 break;
4189 case NETR_DELTA_RENAME_GROUP:
4190 if (r->rename_group) {
4191 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group));
4193 break;
4195 case NETR_DELTA_USER:
4196 if (r->user) {
4197 NDR_CHECK(ndr_push_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user));
4199 break;
4201 case NETR_DELTA_DELETE_USER:
4202 break;
4204 case NETR_DELTA_RENAME_USER:
4205 if (r->rename_user) {
4206 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user));
4208 break;
4210 case NETR_DELTA_GROUP_MEMBER:
4211 if (r->group_member) {
4212 NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member));
4214 break;
4216 case NETR_DELTA_ALIAS:
4217 if (r->alias) {
4218 NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias));
4220 break;
4222 case NETR_DELTA_DELETE_ALIAS:
4223 break;
4225 case NETR_DELTA_RENAME_ALIAS:
4226 if (r->rename_alias) {
4227 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias));
4229 break;
4231 case NETR_DELTA_ALIAS_MEMBER:
4232 if (r->alias_member) {
4233 NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member));
4235 break;
4237 case NETR_DELTA_POLICY:
4238 if (r->policy) {
4239 NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy));
4241 break;
4243 case NETR_DELTA_TRUSTED_DOMAIN:
4244 if (r->trusted_domain) {
4245 NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain));
4247 break;
4249 case NETR_DELTA_DELETE_TRUST:
4250 break;
4252 case NETR_DELTA_ACCOUNT:
4253 if (r->account) {
4254 NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account));
4256 break;
4258 case NETR_DELTA_DELETE_ACCOUNT:
4259 break;
4261 case NETR_DELTA_SECRET:
4262 if (r->secret) {
4263 NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret));
4265 break;
4267 case NETR_DELTA_DELETE_SECRET:
4268 break;
4270 case NETR_DELTA_DELETE_GROUP2:
4271 if (r->delete_group) {
4272 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group));
4274 break;
4276 case NETR_DELTA_DELETE_USER2:
4277 if (r->delete_user) {
4278 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user));
4280 break;
4282 case NETR_DELTA_MODIFY_COUNT:
4283 if (r->modified_count) {
4284 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->modified_count));
4286 break;
4288 default:
4289 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4292 return NDR_ERR_SUCCESS;
4295 static enum ndr_err_code ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r)
4297 int level;
4298 uint16_t _level;
4299 TALLOC_CTX *_mem_save_domain_0;
4300 TALLOC_CTX *_mem_save_group_0;
4301 TALLOC_CTX *_mem_save_rename_group_0;
4302 TALLOC_CTX *_mem_save_user_0;
4303 TALLOC_CTX *_mem_save_rename_user_0;
4304 TALLOC_CTX *_mem_save_group_member_0;
4305 TALLOC_CTX *_mem_save_alias_0;
4306 TALLOC_CTX *_mem_save_rename_alias_0;
4307 TALLOC_CTX *_mem_save_alias_member_0;
4308 TALLOC_CTX *_mem_save_policy_0;
4309 TALLOC_CTX *_mem_save_trusted_domain_0;
4310 TALLOC_CTX *_mem_save_account_0;
4311 TALLOC_CTX *_mem_save_secret_0;
4312 TALLOC_CTX *_mem_save_delete_group_0;
4313 TALLOC_CTX *_mem_save_delete_user_0;
4314 TALLOC_CTX *_mem_save_modified_count_0;
4315 level = ndr_pull_get_switch_value(ndr, r);
4316 if (ndr_flags & NDR_SCALARS) {
4317 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
4318 if (_level != level) {
4319 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4321 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4322 switch (level) {
4323 case NETR_DELTA_DOMAIN: {
4324 uint32_t _ptr_domain;
4325 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
4326 if (_ptr_domain) {
4327 NDR_PULL_ALLOC(ndr, r->domain);
4328 } else {
4329 r->domain = NULL;
4331 break; }
4333 case NETR_DELTA_GROUP: {
4334 uint32_t _ptr_group;
4335 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group));
4336 if (_ptr_group) {
4337 NDR_PULL_ALLOC(ndr, r->group);
4338 } else {
4339 r->group = NULL;
4341 break; }
4343 case NETR_DELTA_DELETE_GROUP: {
4344 break; }
4346 case NETR_DELTA_RENAME_GROUP: {
4347 uint32_t _ptr_rename_group;
4348 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_group));
4349 if (_ptr_rename_group) {
4350 NDR_PULL_ALLOC(ndr, r->rename_group);
4351 } else {
4352 r->rename_group = NULL;
4354 break; }
4356 case NETR_DELTA_USER: {
4357 uint32_t _ptr_user;
4358 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
4359 if (_ptr_user) {
4360 NDR_PULL_ALLOC(ndr, r->user);
4361 } else {
4362 r->user = NULL;
4364 break; }
4366 case NETR_DELTA_DELETE_USER: {
4367 break; }
4369 case NETR_DELTA_RENAME_USER: {
4370 uint32_t _ptr_rename_user;
4371 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_user));
4372 if (_ptr_rename_user) {
4373 NDR_PULL_ALLOC(ndr, r->rename_user);
4374 } else {
4375 r->rename_user = NULL;
4377 break; }
4379 case NETR_DELTA_GROUP_MEMBER: {
4380 uint32_t _ptr_group_member;
4381 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_member));
4382 if (_ptr_group_member) {
4383 NDR_PULL_ALLOC(ndr, r->group_member);
4384 } else {
4385 r->group_member = NULL;
4387 break; }
4389 case NETR_DELTA_ALIAS: {
4390 uint32_t _ptr_alias;
4391 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias));
4392 if (_ptr_alias) {
4393 NDR_PULL_ALLOC(ndr, r->alias);
4394 } else {
4395 r->alias = NULL;
4397 break; }
4399 case NETR_DELTA_DELETE_ALIAS: {
4400 break; }
4402 case NETR_DELTA_RENAME_ALIAS: {
4403 uint32_t _ptr_rename_alias;
4404 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_alias));
4405 if (_ptr_rename_alias) {
4406 NDR_PULL_ALLOC(ndr, r->rename_alias);
4407 } else {
4408 r->rename_alias = NULL;
4410 break; }
4412 case NETR_DELTA_ALIAS_MEMBER: {
4413 uint32_t _ptr_alias_member;
4414 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias_member));
4415 if (_ptr_alias_member) {
4416 NDR_PULL_ALLOC(ndr, r->alias_member);
4417 } else {
4418 r->alias_member = NULL;
4420 break; }
4422 case NETR_DELTA_POLICY: {
4423 uint32_t _ptr_policy;
4424 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy));
4425 if (_ptr_policy) {
4426 NDR_PULL_ALLOC(ndr, r->policy);
4427 } else {
4428 r->policy = NULL;
4430 break; }
4432 case NETR_DELTA_TRUSTED_DOMAIN: {
4433 uint32_t _ptr_trusted_domain;
4434 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain));
4435 if (_ptr_trusted_domain) {
4436 NDR_PULL_ALLOC(ndr, r->trusted_domain);
4437 } else {
4438 r->trusted_domain = NULL;
4440 break; }
4442 case NETR_DELTA_DELETE_TRUST: {
4443 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust));
4444 break; }
4446 case NETR_DELTA_ACCOUNT: {
4447 uint32_t _ptr_account;
4448 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account));
4449 if (_ptr_account) {
4450 NDR_PULL_ALLOC(ndr, r->account);
4451 } else {
4452 r->account = NULL;
4454 break; }
4456 case NETR_DELTA_DELETE_ACCOUNT: {
4457 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account));
4458 break; }
4460 case NETR_DELTA_SECRET: {
4461 uint32_t _ptr_secret;
4462 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secret));
4463 if (_ptr_secret) {
4464 NDR_PULL_ALLOC(ndr, r->secret);
4465 } else {
4466 r->secret = NULL;
4468 break; }
4470 case NETR_DELTA_DELETE_SECRET: {
4471 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret));
4472 break; }
4474 case NETR_DELTA_DELETE_GROUP2: {
4475 uint32_t _ptr_delete_group;
4476 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_group));
4477 if (_ptr_delete_group) {
4478 NDR_PULL_ALLOC(ndr, r->delete_group);
4479 } else {
4480 r->delete_group = NULL;
4482 break; }
4484 case NETR_DELTA_DELETE_USER2: {
4485 uint32_t _ptr_delete_user;
4486 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_user));
4487 if (_ptr_delete_user) {
4488 NDR_PULL_ALLOC(ndr, r->delete_user);
4489 } else {
4490 r->delete_user = NULL;
4492 break; }
4494 case NETR_DELTA_MODIFY_COUNT: {
4495 uint32_t _ptr_modified_count;
4496 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_modified_count));
4497 if (_ptr_modified_count) {
4498 NDR_PULL_ALLOC(ndr, r->modified_count);
4499 } else {
4500 r->modified_count = NULL;
4502 break; }
4504 default:
4505 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4508 if (ndr_flags & NDR_BUFFERS) {
4509 switch (level) {
4510 case NETR_DELTA_DOMAIN:
4511 if (r->domain) {
4512 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
4513 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
4514 NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4515 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
4517 break;
4519 case NETR_DELTA_GROUP:
4520 if (r->group) {
4521 _mem_save_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4522 NDR_PULL_SET_MEM_CTX(ndr, r->group, 0);
4523 NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group));
4524 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_0, 0);
4526 break;
4528 case NETR_DELTA_DELETE_GROUP:
4529 break;
4531 case NETR_DELTA_RENAME_GROUP:
4532 if (r->rename_group) {
4533 _mem_save_rename_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4534 NDR_PULL_SET_MEM_CTX(ndr, r->rename_group, 0);
4535 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group));
4536 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_group_0, 0);
4538 break;
4540 case NETR_DELTA_USER:
4541 if (r->user) {
4542 _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4543 NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
4544 NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user));
4545 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
4547 break;
4549 case NETR_DELTA_DELETE_USER:
4550 break;
4552 case NETR_DELTA_RENAME_USER:
4553 if (r->rename_user) {
4554 _mem_save_rename_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4555 NDR_PULL_SET_MEM_CTX(ndr, r->rename_user, 0);
4556 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user));
4557 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_user_0, 0);
4559 break;
4561 case NETR_DELTA_GROUP_MEMBER:
4562 if (r->group_member) {
4563 _mem_save_group_member_0 = NDR_PULL_GET_MEM_CTX(ndr);
4564 NDR_PULL_SET_MEM_CTX(ndr, r->group_member, 0);
4565 NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member));
4566 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_member_0, 0);
4568 break;
4570 case NETR_DELTA_ALIAS:
4571 if (r->alias) {
4572 _mem_save_alias_0 = NDR_PULL_GET_MEM_CTX(ndr);
4573 NDR_PULL_SET_MEM_CTX(ndr, r->alias, 0);
4574 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias));
4575 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_0, 0);
4577 break;
4579 case NETR_DELTA_DELETE_ALIAS:
4580 break;
4582 case NETR_DELTA_RENAME_ALIAS:
4583 if (r->rename_alias) {
4584 _mem_save_rename_alias_0 = NDR_PULL_GET_MEM_CTX(ndr);
4585 NDR_PULL_SET_MEM_CTX(ndr, r->rename_alias, 0);
4586 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias));
4587 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_alias_0, 0);
4589 break;
4591 case NETR_DELTA_ALIAS_MEMBER:
4592 if (r->alias_member) {
4593 _mem_save_alias_member_0 = NDR_PULL_GET_MEM_CTX(ndr);
4594 NDR_PULL_SET_MEM_CTX(ndr, r->alias_member, 0);
4595 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member));
4596 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_member_0, 0);
4598 break;
4600 case NETR_DELTA_POLICY:
4601 if (r->policy) {
4602 _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
4603 NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0);
4604 NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy));
4605 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0);
4607 break;
4609 case NETR_DELTA_TRUSTED_DOMAIN:
4610 if (r->trusted_domain) {
4611 _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
4612 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain, 0);
4613 NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain));
4614 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, 0);
4616 break;
4618 case NETR_DELTA_DELETE_TRUST:
4619 break;
4621 case NETR_DELTA_ACCOUNT:
4622 if (r->account) {
4623 _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
4624 NDR_PULL_SET_MEM_CTX(ndr, r->account, 0);
4625 NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account));
4626 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0);
4628 break;
4630 case NETR_DELTA_DELETE_ACCOUNT:
4631 break;
4633 case NETR_DELTA_SECRET:
4634 if (r->secret) {
4635 _mem_save_secret_0 = NDR_PULL_GET_MEM_CTX(ndr);
4636 NDR_PULL_SET_MEM_CTX(ndr, r->secret, 0);
4637 NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret));
4638 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secret_0, 0);
4640 break;
4642 case NETR_DELTA_DELETE_SECRET:
4643 break;
4645 case NETR_DELTA_DELETE_GROUP2:
4646 if (r->delete_group) {
4647 _mem_save_delete_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4648 NDR_PULL_SET_MEM_CTX(ndr, r->delete_group, 0);
4649 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group));
4650 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_group_0, 0);
4652 break;
4654 case NETR_DELTA_DELETE_USER2:
4655 if (r->delete_user) {
4656 _mem_save_delete_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
4657 NDR_PULL_SET_MEM_CTX(ndr, r->delete_user, 0);
4658 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user));
4659 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_user_0, 0);
4661 break;
4663 case NETR_DELTA_MODIFY_COUNT:
4664 if (r->modified_count) {
4665 _mem_save_modified_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
4666 NDR_PULL_SET_MEM_CTX(ndr, r->modified_count, 0);
4667 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->modified_count));
4668 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_modified_count_0, 0);
4670 break;
4672 default:
4673 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4676 return NDR_ERR_SUCCESS;
4679 _PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r)
4681 int level;
4682 level = ndr_print_get_switch_value(ndr, r);
4683 ndr_print_union(ndr, name, level, "netr_DELTA_UNION");
4684 switch (level) {
4685 case NETR_DELTA_DOMAIN:
4686 ndr_print_ptr(ndr, "domain", r->domain);
4687 ndr->depth++;
4688 if (r->domain) {
4689 ndr_print_netr_DELTA_DOMAIN(ndr, "domain", r->domain);
4691 ndr->depth--;
4692 break;
4694 case NETR_DELTA_GROUP:
4695 ndr_print_ptr(ndr, "group", r->group);
4696 ndr->depth++;
4697 if (r->group) {
4698 ndr_print_netr_DELTA_GROUP(ndr, "group", r->group);
4700 ndr->depth--;
4701 break;
4703 case NETR_DELTA_DELETE_GROUP:
4704 break;
4706 case NETR_DELTA_RENAME_GROUP:
4707 ndr_print_ptr(ndr, "rename_group", r->rename_group);
4708 ndr->depth++;
4709 if (r->rename_group) {
4710 ndr_print_netr_DELTA_RENAME(ndr, "rename_group", r->rename_group);
4712 ndr->depth--;
4713 break;
4715 case NETR_DELTA_USER:
4716 ndr_print_ptr(ndr, "user", r->user);
4717 ndr->depth++;
4718 if (r->user) {
4719 ndr_print_netr_DELTA_USER(ndr, "user", r->user);
4721 ndr->depth--;
4722 break;
4724 case NETR_DELTA_DELETE_USER:
4725 break;
4727 case NETR_DELTA_RENAME_USER:
4728 ndr_print_ptr(ndr, "rename_user", r->rename_user);
4729 ndr->depth++;
4730 if (r->rename_user) {
4731 ndr_print_netr_DELTA_RENAME(ndr, "rename_user", r->rename_user);
4733 ndr->depth--;
4734 break;
4736 case NETR_DELTA_GROUP_MEMBER:
4737 ndr_print_ptr(ndr, "group_member", r->group_member);
4738 ndr->depth++;
4739 if (r->group_member) {
4740 ndr_print_netr_DELTA_GROUP_MEMBER(ndr, "group_member", r->group_member);
4742 ndr->depth--;
4743 break;
4745 case NETR_DELTA_ALIAS:
4746 ndr_print_ptr(ndr, "alias", r->alias);
4747 ndr->depth++;
4748 if (r->alias) {
4749 ndr_print_netr_DELTA_ALIAS(ndr, "alias", r->alias);
4751 ndr->depth--;
4752 break;
4754 case NETR_DELTA_DELETE_ALIAS:
4755 break;
4757 case NETR_DELTA_RENAME_ALIAS:
4758 ndr_print_ptr(ndr, "rename_alias", r->rename_alias);
4759 ndr->depth++;
4760 if (r->rename_alias) {
4761 ndr_print_netr_DELTA_RENAME(ndr, "rename_alias", r->rename_alias);
4763 ndr->depth--;
4764 break;
4766 case NETR_DELTA_ALIAS_MEMBER:
4767 ndr_print_ptr(ndr, "alias_member", r->alias_member);
4768 ndr->depth++;
4769 if (r->alias_member) {
4770 ndr_print_netr_DELTA_ALIAS_MEMBER(ndr, "alias_member", r->alias_member);
4772 ndr->depth--;
4773 break;
4775 case NETR_DELTA_POLICY:
4776 ndr_print_ptr(ndr, "policy", r->policy);
4777 ndr->depth++;
4778 if (r->policy) {
4779 ndr_print_netr_DELTA_POLICY(ndr, "policy", r->policy);
4781 ndr->depth--;
4782 break;
4784 case NETR_DELTA_TRUSTED_DOMAIN:
4785 ndr_print_ptr(ndr, "trusted_domain", r->trusted_domain);
4786 ndr->depth++;
4787 if (r->trusted_domain) {
4788 ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr, "trusted_domain", r->trusted_domain);
4790 ndr->depth--;
4791 break;
4793 case NETR_DELTA_DELETE_TRUST:
4794 ndr_print_netr_DELTA_DELETE_TRUST(ndr, "delete_trust", &r->delete_trust);
4795 break;
4797 case NETR_DELTA_ACCOUNT:
4798 ndr_print_ptr(ndr, "account", r->account);
4799 ndr->depth++;
4800 if (r->account) {
4801 ndr_print_netr_DELTA_ACCOUNT(ndr, "account", r->account);
4803 ndr->depth--;
4804 break;
4806 case NETR_DELTA_DELETE_ACCOUNT:
4807 ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr, "delete_account", &r->delete_account);
4808 break;
4810 case NETR_DELTA_SECRET:
4811 ndr_print_ptr(ndr, "secret", r->secret);
4812 ndr->depth++;
4813 if (r->secret) {
4814 ndr_print_netr_DELTA_SECRET(ndr, "secret", r->secret);
4816 ndr->depth--;
4817 break;
4819 case NETR_DELTA_DELETE_SECRET:
4820 ndr_print_netr_DELTA_DELETE_SECRET(ndr, "delete_secret", &r->delete_secret);
4821 break;
4823 case NETR_DELTA_DELETE_GROUP2:
4824 ndr_print_ptr(ndr, "delete_group", r->delete_group);
4825 ndr->depth++;
4826 if (r->delete_group) {
4827 ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_group", r->delete_group);
4829 ndr->depth--;
4830 break;
4832 case NETR_DELTA_DELETE_USER2:
4833 ndr_print_ptr(ndr, "delete_user", r->delete_user);
4834 ndr->depth++;
4835 if (r->delete_user) {
4836 ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_user", r->delete_user);
4838 ndr->depth--;
4839 break;
4841 case NETR_DELTA_MODIFY_COUNT:
4842 ndr_print_ptr(ndr, "modified_count", r->modified_count);
4843 ndr->depth++;
4844 if (r->modified_count) {
4845 ndr_print_udlong(ndr, "modified_count", *r->modified_count);
4847 ndr->depth--;
4848 break;
4850 default:
4851 ndr_print_bad_level(ndr, name, level);
4855 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)
4857 if (ndr_flags & NDR_SCALARS) {
4858 int level = ndr_push_get_switch_value(ndr, r);
4859 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
4860 NDR_CHECK(ndr_push_union_align(ndr, 5));
4861 switch (level) {
4862 case NETR_DELTA_DOMAIN: {
4863 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4864 break; }
4866 case NETR_DELTA_GROUP: {
4867 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4868 break; }
4870 case NETR_DELTA_DELETE_GROUP: {
4871 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4872 break; }
4874 case NETR_DELTA_RENAME_GROUP: {
4875 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4876 break; }
4878 case NETR_DELTA_USER: {
4879 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4880 break; }
4882 case NETR_DELTA_DELETE_USER: {
4883 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4884 break; }
4886 case NETR_DELTA_RENAME_USER: {
4887 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4888 break; }
4890 case NETR_DELTA_GROUP_MEMBER: {
4891 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4892 break; }
4894 case NETR_DELTA_ALIAS: {
4895 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4896 break; }
4898 case NETR_DELTA_DELETE_ALIAS: {
4899 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4900 break; }
4902 case NETR_DELTA_RENAME_ALIAS: {
4903 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4904 break; }
4906 case NETR_DELTA_ALIAS_MEMBER: {
4907 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4908 break; }
4910 case NETR_DELTA_POLICY: {
4911 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4912 break; }
4914 case NETR_DELTA_TRUSTED_DOMAIN: {
4915 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4916 break; }
4918 case NETR_DELTA_DELETE_TRUST: {
4919 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4920 break; }
4922 case NETR_DELTA_ACCOUNT: {
4923 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4924 break; }
4926 case NETR_DELTA_DELETE_ACCOUNT: {
4927 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
4928 break; }
4930 case NETR_DELTA_SECRET: {
4931 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
4932 break; }
4934 case NETR_DELTA_DELETE_SECRET: {
4935 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
4936 break; }
4938 case NETR_DELTA_DELETE_GROUP2: {
4939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4940 break; }
4942 case NETR_DELTA_DELETE_USER2: {
4943 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
4944 break; }
4946 case NETR_DELTA_MODIFY_COUNT: {
4947 break; }
4949 default:
4950 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4953 if (ndr_flags & NDR_BUFFERS) {
4954 int level = ndr_push_get_switch_value(ndr, r);
4955 switch (level) {
4956 case NETR_DELTA_DOMAIN:
4957 break;
4959 case NETR_DELTA_GROUP:
4960 break;
4962 case NETR_DELTA_DELETE_GROUP:
4963 break;
4965 case NETR_DELTA_RENAME_GROUP:
4966 break;
4968 case NETR_DELTA_USER:
4969 break;
4971 case NETR_DELTA_DELETE_USER:
4972 break;
4974 case NETR_DELTA_RENAME_USER:
4975 break;
4977 case NETR_DELTA_GROUP_MEMBER:
4978 break;
4980 case NETR_DELTA_ALIAS:
4981 break;
4983 case NETR_DELTA_DELETE_ALIAS:
4984 break;
4986 case NETR_DELTA_RENAME_ALIAS:
4987 break;
4989 case NETR_DELTA_ALIAS_MEMBER:
4990 break;
4992 case NETR_DELTA_POLICY:
4993 if (r->sid) {
4994 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
4996 break;
4998 case NETR_DELTA_TRUSTED_DOMAIN:
4999 if (r->sid) {
5000 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5002 break;
5004 case NETR_DELTA_DELETE_TRUST:
5005 if (r->sid) {
5006 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5008 break;
5010 case NETR_DELTA_ACCOUNT:
5011 if (r->sid) {
5012 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5014 break;
5016 case NETR_DELTA_DELETE_ACCOUNT:
5017 if (r->sid) {
5018 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5020 break;
5022 case NETR_DELTA_SECRET:
5023 if (r->name) {
5024 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5025 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5026 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5027 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5029 break;
5031 case NETR_DELTA_DELETE_SECRET:
5032 if (r->name) {
5033 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5034 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5035 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
5036 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5038 break;
5040 case NETR_DELTA_DELETE_GROUP2:
5041 break;
5043 case NETR_DELTA_DELETE_USER2:
5044 break;
5046 case NETR_DELTA_MODIFY_COUNT:
5047 break;
5049 default:
5050 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5053 return NDR_ERR_SUCCESS;
5056 static enum ndr_err_code ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r)
5058 int level;
5059 uint16_t _level;
5060 TALLOC_CTX *_mem_save_sid_0;
5061 TALLOC_CTX *_mem_save_name_0;
5062 level = ndr_pull_get_switch_value(ndr, r);
5063 if (ndr_flags & NDR_SCALARS) {
5064 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
5065 if (_level != level) {
5066 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5068 NDR_CHECK(ndr_pull_union_align(ndr, 5));
5069 switch (level) {
5070 case NETR_DELTA_DOMAIN: {
5071 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5072 break; }
5074 case NETR_DELTA_GROUP: {
5075 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5076 break; }
5078 case NETR_DELTA_DELETE_GROUP: {
5079 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5080 break; }
5082 case NETR_DELTA_RENAME_GROUP: {
5083 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5084 break; }
5086 case NETR_DELTA_USER: {
5087 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5088 break; }
5090 case NETR_DELTA_DELETE_USER: {
5091 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5092 break; }
5094 case NETR_DELTA_RENAME_USER: {
5095 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5096 break; }
5098 case NETR_DELTA_GROUP_MEMBER: {
5099 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5100 break; }
5102 case NETR_DELTA_ALIAS: {
5103 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5104 break; }
5106 case NETR_DELTA_DELETE_ALIAS: {
5107 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5108 break; }
5110 case NETR_DELTA_RENAME_ALIAS: {
5111 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5112 break; }
5114 case NETR_DELTA_ALIAS_MEMBER: {
5115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5116 break; }
5118 case NETR_DELTA_POLICY: {
5119 uint32_t _ptr_sid;
5120 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5121 if (_ptr_sid) {
5122 NDR_PULL_ALLOC(ndr, r->sid);
5123 } else {
5124 r->sid = NULL;
5126 break; }
5128 case NETR_DELTA_TRUSTED_DOMAIN: {
5129 uint32_t _ptr_sid;
5130 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5131 if (_ptr_sid) {
5132 NDR_PULL_ALLOC(ndr, r->sid);
5133 } else {
5134 r->sid = NULL;
5136 break; }
5138 case NETR_DELTA_DELETE_TRUST: {
5139 uint32_t _ptr_sid;
5140 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5141 if (_ptr_sid) {
5142 NDR_PULL_ALLOC(ndr, r->sid);
5143 } else {
5144 r->sid = NULL;
5146 break; }
5148 case NETR_DELTA_ACCOUNT: {
5149 uint32_t _ptr_sid;
5150 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5151 if (_ptr_sid) {
5152 NDR_PULL_ALLOC(ndr, r->sid);
5153 } else {
5154 r->sid = NULL;
5156 break; }
5158 case NETR_DELTA_DELETE_ACCOUNT: {
5159 uint32_t _ptr_sid;
5160 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
5161 if (_ptr_sid) {
5162 NDR_PULL_ALLOC(ndr, r->sid);
5163 } else {
5164 r->sid = NULL;
5166 break; }
5168 case NETR_DELTA_SECRET: {
5169 uint32_t _ptr_name;
5170 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
5171 if (_ptr_name) {
5172 NDR_PULL_ALLOC(ndr, r->name);
5173 } else {
5174 r->name = NULL;
5176 break; }
5178 case NETR_DELTA_DELETE_SECRET: {
5179 uint32_t _ptr_name;
5180 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
5181 if (_ptr_name) {
5182 NDR_PULL_ALLOC(ndr, r->name);
5183 } else {
5184 r->name = NULL;
5186 break; }
5188 case NETR_DELTA_DELETE_GROUP2: {
5189 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5190 break; }
5192 case NETR_DELTA_DELETE_USER2: {
5193 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
5194 break; }
5196 case NETR_DELTA_MODIFY_COUNT: {
5197 break; }
5199 default:
5200 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5203 if (ndr_flags & NDR_BUFFERS) {
5204 switch (level) {
5205 case NETR_DELTA_DOMAIN:
5206 break;
5208 case NETR_DELTA_GROUP:
5209 break;
5211 case NETR_DELTA_DELETE_GROUP:
5212 break;
5214 case NETR_DELTA_RENAME_GROUP:
5215 break;
5217 case NETR_DELTA_USER:
5218 break;
5220 case NETR_DELTA_DELETE_USER:
5221 break;
5223 case NETR_DELTA_RENAME_USER:
5224 break;
5226 case NETR_DELTA_GROUP_MEMBER:
5227 break;
5229 case NETR_DELTA_ALIAS:
5230 break;
5232 case NETR_DELTA_DELETE_ALIAS:
5233 break;
5235 case NETR_DELTA_RENAME_ALIAS:
5236 break;
5238 case NETR_DELTA_ALIAS_MEMBER:
5239 break;
5241 case NETR_DELTA_POLICY:
5242 if (r->sid) {
5243 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5244 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5245 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5246 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5248 break;
5250 case NETR_DELTA_TRUSTED_DOMAIN:
5251 if (r->sid) {
5252 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5253 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5254 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5255 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5257 break;
5259 case NETR_DELTA_DELETE_TRUST:
5260 if (r->sid) {
5261 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5262 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5263 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5264 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5266 break;
5268 case NETR_DELTA_ACCOUNT:
5269 if (r->sid) {
5270 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5271 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5272 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5273 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5275 break;
5277 case NETR_DELTA_DELETE_ACCOUNT:
5278 if (r->sid) {
5279 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
5280 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
5281 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
5282 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
5284 break;
5286 case NETR_DELTA_SECRET:
5287 if (r->name) {
5288 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5289 NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
5290 NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
5291 NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
5292 if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
5293 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
5295 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t)));
5296 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
5297 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
5299 break;
5301 case NETR_DELTA_DELETE_SECRET:
5302 if (r->name) {
5303 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5304 NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
5305 NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
5306 NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
5307 if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
5308 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
5310 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t)));
5311 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
5312 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
5314 break;
5316 case NETR_DELTA_DELETE_GROUP2:
5317 break;
5319 case NETR_DELTA_DELETE_USER2:
5320 break;
5322 case NETR_DELTA_MODIFY_COUNT:
5323 break;
5325 default:
5326 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5329 return NDR_ERR_SUCCESS;
5332 _PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r)
5334 int level;
5335 level = ndr_print_get_switch_value(ndr, r);
5336 ndr_print_union(ndr, name, level, "netr_DELTA_ID_UNION");
5337 switch (level) {
5338 case NETR_DELTA_DOMAIN:
5339 ndr_print_uint32(ndr, "rid", r->rid);
5340 break;
5342 case NETR_DELTA_GROUP:
5343 ndr_print_uint32(ndr, "rid", r->rid);
5344 break;
5346 case NETR_DELTA_DELETE_GROUP:
5347 ndr_print_uint32(ndr, "rid", r->rid);
5348 break;
5350 case NETR_DELTA_RENAME_GROUP:
5351 ndr_print_uint32(ndr, "rid", r->rid);
5352 break;
5354 case NETR_DELTA_USER:
5355 ndr_print_uint32(ndr, "rid", r->rid);
5356 break;
5358 case NETR_DELTA_DELETE_USER:
5359 ndr_print_uint32(ndr, "rid", r->rid);
5360 break;
5362 case NETR_DELTA_RENAME_USER:
5363 ndr_print_uint32(ndr, "rid", r->rid);
5364 break;
5366 case NETR_DELTA_GROUP_MEMBER:
5367 ndr_print_uint32(ndr, "rid", r->rid);
5368 break;
5370 case NETR_DELTA_ALIAS:
5371 ndr_print_uint32(ndr, "rid", r->rid);
5372 break;
5374 case NETR_DELTA_DELETE_ALIAS:
5375 ndr_print_uint32(ndr, "rid", r->rid);
5376 break;
5378 case NETR_DELTA_RENAME_ALIAS:
5379 ndr_print_uint32(ndr, "rid", r->rid);
5380 break;
5382 case NETR_DELTA_ALIAS_MEMBER:
5383 ndr_print_uint32(ndr, "rid", r->rid);
5384 break;
5386 case NETR_DELTA_POLICY:
5387 ndr_print_ptr(ndr, "sid", r->sid);
5388 ndr->depth++;
5389 if (r->sid) {
5390 ndr_print_dom_sid2(ndr, "sid", r->sid);
5392 ndr->depth--;
5393 break;
5395 case NETR_DELTA_TRUSTED_DOMAIN:
5396 ndr_print_ptr(ndr, "sid", r->sid);
5397 ndr->depth++;
5398 if (r->sid) {
5399 ndr_print_dom_sid2(ndr, "sid", r->sid);
5401 ndr->depth--;
5402 break;
5404 case NETR_DELTA_DELETE_TRUST:
5405 ndr_print_ptr(ndr, "sid", r->sid);
5406 ndr->depth++;
5407 if (r->sid) {
5408 ndr_print_dom_sid2(ndr, "sid", r->sid);
5410 ndr->depth--;
5411 break;
5413 case NETR_DELTA_ACCOUNT:
5414 ndr_print_ptr(ndr, "sid", r->sid);
5415 ndr->depth++;
5416 if (r->sid) {
5417 ndr_print_dom_sid2(ndr, "sid", r->sid);
5419 ndr->depth--;
5420 break;
5422 case NETR_DELTA_DELETE_ACCOUNT:
5423 ndr_print_ptr(ndr, "sid", r->sid);
5424 ndr->depth++;
5425 if (r->sid) {
5426 ndr_print_dom_sid2(ndr, "sid", r->sid);
5428 ndr->depth--;
5429 break;
5431 case NETR_DELTA_SECRET:
5432 ndr_print_ptr(ndr, "name", r->name);
5433 ndr->depth++;
5434 if (r->name) {
5435 ndr_print_string(ndr, "name", r->name);
5437 ndr->depth--;
5438 break;
5440 case NETR_DELTA_DELETE_SECRET:
5441 ndr_print_ptr(ndr, "name", r->name);
5442 ndr->depth++;
5443 if (r->name) {
5444 ndr_print_string(ndr, "name", r->name);
5446 ndr->depth--;
5447 break;
5449 case NETR_DELTA_DELETE_GROUP2:
5450 ndr_print_uint32(ndr, "rid", r->rid);
5451 break;
5453 case NETR_DELTA_DELETE_USER2:
5454 ndr_print_uint32(ndr, "rid", r->rid);
5455 break;
5457 case NETR_DELTA_MODIFY_COUNT:
5458 break;
5460 default:
5461 ndr_print_bad_level(ndr, name, level);
5465 static enum ndr_err_code ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r)
5467 if (ndr_flags & NDR_SCALARS) {
5468 NDR_CHECK(ndr_push_align(ndr, 5));
5469 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, r->delta_type));
5470 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_id_union, r->delta_type));
5471 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union));
5472 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_union, r->delta_type));
5473 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union));
5474 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5476 if (ndr_flags & NDR_BUFFERS) {
5477 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
5478 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
5480 return NDR_ERR_SUCCESS;
5483 static enum ndr_err_code ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r)
5485 if (ndr_flags & NDR_SCALARS) {
5486 NDR_CHECK(ndr_pull_align(ndr, 5));
5487 NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr, NDR_SCALARS, &r->delta_type));
5488 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_id_union, r->delta_type));
5489 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union));
5490 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_union, r->delta_type));
5491 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union));
5492 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5494 if (ndr_flags & NDR_BUFFERS) {
5495 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
5496 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
5498 return NDR_ERR_SUCCESS;
5501 _PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r)
5503 ndr_print_struct(ndr, name, "netr_DELTA_ENUM");
5504 ndr->depth++;
5505 ndr_print_netr_DeltaEnum(ndr, "delta_type", r->delta_type);
5506 ndr_print_set_switch_value(ndr, &r->delta_id_union, r->delta_type);
5507 ndr_print_netr_DELTA_ID_UNION(ndr, "delta_id_union", &r->delta_id_union);
5508 ndr_print_set_switch_value(ndr, &r->delta_union, r->delta_type);
5509 ndr_print_netr_DELTA_UNION(ndr, "delta_union", &r->delta_union);
5510 ndr->depth--;
5513 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)
5515 uint32_t cntr_delta_enum_1;
5516 if (ndr_flags & NDR_SCALARS) {
5517 NDR_CHECK(ndr_push_align(ndr, 5));
5518 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas));
5519 NDR_CHECK(ndr_push_unique_ptr(ndr, r->delta_enum));
5520 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5522 if (ndr_flags & NDR_BUFFERS) {
5523 if (r->delta_enum) {
5524 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_deltas));
5525 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5526 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1]));
5528 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5529 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1]));
5533 return NDR_ERR_SUCCESS;
5536 static enum ndr_err_code ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r)
5538 uint32_t _ptr_delta_enum;
5539 uint32_t cntr_delta_enum_1;
5540 TALLOC_CTX *_mem_save_delta_enum_0;
5541 TALLOC_CTX *_mem_save_delta_enum_1;
5542 if (ndr_flags & NDR_SCALARS) {
5543 NDR_CHECK(ndr_pull_align(ndr, 5));
5544 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_deltas));
5545 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum));
5546 if (_ptr_delta_enum) {
5547 NDR_PULL_ALLOC(ndr, r->delta_enum);
5548 } else {
5549 r->delta_enum = NULL;
5551 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5553 if (ndr_flags & NDR_BUFFERS) {
5554 if (r->delta_enum) {
5555 _mem_save_delta_enum_0 = NDR_PULL_GET_MEM_CTX(ndr);
5556 NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0);
5557 NDR_CHECK(ndr_pull_array_size(ndr, &r->delta_enum));
5558 NDR_PULL_ALLOC_N(ndr, r->delta_enum, ndr_get_array_size(ndr, &r->delta_enum));
5559 _mem_save_delta_enum_1 = NDR_PULL_GET_MEM_CTX(ndr);
5560 NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0);
5561 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5562 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1]));
5564 for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) {
5565 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1]));
5567 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_1, 0);
5568 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_0, 0);
5570 if (r->delta_enum) {
5571 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->delta_enum, r->num_deltas));
5574 return NDR_ERR_SUCCESS;
5577 _PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r)
5579 uint32_t cntr_delta_enum_1;
5580 ndr_print_struct(ndr, name, "netr_DELTA_ENUM_ARRAY");
5581 ndr->depth++;
5582 ndr_print_uint32(ndr, "num_deltas", r->num_deltas);
5583 ndr_print_ptr(ndr, "delta_enum", r->delta_enum);
5584 ndr->depth++;
5585 if (r->delta_enum) {
5586 ndr->print(ndr, "%s: ARRAY(%d)", "delta_enum", (int)r->num_deltas);
5587 ndr->depth++;
5588 for (cntr_delta_enum_1=0;cntr_delta_enum_1<r->num_deltas;cntr_delta_enum_1++) {
5589 char *idx_1=NULL;
5590 if (asprintf(&idx_1, "[%d]", cntr_delta_enum_1) != -1) {
5591 ndr_print_netr_DELTA_ENUM(ndr, "delta_enum", &r->delta_enum[cntr_delta_enum_1]);
5592 free(idx_1);
5595 ndr->depth--;
5597 ndr->depth--;
5598 ndr->depth--;
5601 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)
5604 uint32_t _flags_save_STRUCT = ndr->flags;
5605 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5606 if (ndr_flags & NDR_SCALARS) {
5607 NDR_CHECK(ndr_push_align(ndr, 4));
5608 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16));
5609 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timecreated));
5610 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number));
5611 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5613 if (ndr_flags & NDR_BUFFERS) {
5615 ndr->flags = _flags_save_STRUCT;
5617 return NDR_ERR_SUCCESS;
5620 static enum ndr_err_code ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r)
5623 uint32_t _flags_save_STRUCT = ndr->flags;
5624 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5625 if (ndr_flags & NDR_SCALARS) {
5626 NDR_CHECK(ndr_pull_align(ndr, 4));
5627 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16));
5628 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timecreated));
5629 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number));
5630 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5632 if (ndr_flags & NDR_BUFFERS) {
5634 ndr->flags = _flags_save_STRUCT;
5636 return NDR_ERR_SUCCESS;
5639 _PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r)
5641 ndr_print_struct(ndr, name, "netr_UAS_INFO_0");
5643 uint32_t _flags_save_STRUCT = ndr->flags;
5644 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
5645 ndr->depth++;
5646 ndr_print_array_uint8(ndr, "computer_name", r->computer_name, 16);
5647 ndr_print_uint32(ndr, "timecreated", r->timecreated);
5648 ndr_print_uint32(ndr, "serial_number", r->serial_number);
5649 ndr->depth--;
5650 ndr->flags = _flags_save_STRUCT;
5654 static enum ndr_err_code ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r)
5656 if (ndr_flags & NDR_SCALARS) {
5657 NDR_CHECK(ndr_push_align(ndr, 4));
5659 uint32_t _flags_save_DATA_BLOB = ndr->flags;
5660 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
5661 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
5662 ndr->flags = _flags_save_DATA_BLOB;
5664 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5666 if (ndr_flags & NDR_BUFFERS) {
5668 return NDR_ERR_SUCCESS;
5671 static enum ndr_err_code ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r)
5673 if (ndr_flags & NDR_SCALARS) {
5674 NDR_CHECK(ndr_pull_align(ndr, 4));
5676 uint32_t _flags_save_DATA_BLOB = ndr->flags;
5677 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
5678 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob));
5679 ndr->flags = _flags_save_DATA_BLOB;
5681 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5683 if (ndr_flags & NDR_BUFFERS) {
5685 return NDR_ERR_SUCCESS;
5688 _PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r)
5690 ndr_print_struct(ndr, name, "netr_AccountBuffer");
5691 ndr->depth++;
5692 ndr_print_DATA_BLOB(ndr, "blob", r->blob);
5693 ndr->depth--;
5696 static enum ndr_err_code ndr_push_netr_InfoFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
5698 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
5699 return NDR_ERR_SUCCESS;
5702 static enum ndr_err_code ndr_pull_netr_InfoFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
5704 uint32_t v;
5705 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
5706 *r = v;
5707 return NDR_ERR_SUCCESS;
5710 _PUBLIC_ void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r)
5712 ndr_print_uint32(ndr, name, r);
5713 ndr->depth++;
5714 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REPLICATION_NEEDED", NETLOGON_REPLICATION_NEEDED, r);
5715 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REPLICATION_IN_PROGRESS", NETLOGON_REPLICATION_IN_PROGRESS, r);
5716 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_FULL_SYNC_REPLICATION", NETLOGON_FULL_SYNC_REPLICATION, r);
5717 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_REDO_NEEDED", NETLOGON_REDO_NEEDED, r);
5718 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_HAS_IP", NETLOGON_HAS_IP, r);
5719 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_HAS_TIMESERV", NETLOGON_HAS_TIMESERV, r);
5720 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_DNS_UPDATE_FAILURE", NETLOGON_DNS_UPDATE_FAILURE, r);
5721 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_VERIFY_STATUS_RETURNED", NETLOGON_VERIFY_STATUS_RETURNED, r);
5722 ndr->depth--;
5725 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)
5727 if (ndr_flags & NDR_SCALARS) {
5728 NDR_CHECK(ndr_push_align(ndr, 4));
5729 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5730 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
5731 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5733 if (ndr_flags & NDR_BUFFERS) {
5735 return NDR_ERR_SUCCESS;
5738 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r)
5740 if (ndr_flags & NDR_SCALARS) {
5741 NDR_CHECK(ndr_pull_align(ndr, 4));
5742 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5743 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
5744 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5746 if (ndr_flags & NDR_BUFFERS) {
5748 return NDR_ERR_SUCCESS;
5751 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r)
5753 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_1");
5754 ndr->depth++;
5755 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5756 ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
5757 ndr->depth--;
5760 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)
5762 if (ndr_flags & NDR_SCALARS) {
5763 NDR_CHECK(ndr_push_align(ndr, 5));
5764 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5765 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
5766 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name));
5767 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->tc_connection_status));
5768 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5770 if (ndr_flags & NDR_BUFFERS) {
5771 if (r->trusted_dc_name) {
5772 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5773 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5774 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5775 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));
5778 return NDR_ERR_SUCCESS;
5781 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r)
5783 uint32_t _ptr_trusted_dc_name;
5784 TALLOC_CTX *_mem_save_trusted_dc_name_0;
5785 if (ndr_flags & NDR_SCALARS) {
5786 NDR_CHECK(ndr_pull_align(ndr, 5));
5787 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5788 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
5789 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name));
5790 if (_ptr_trusted_dc_name) {
5791 NDR_PULL_ALLOC(ndr, r->trusted_dc_name);
5792 } else {
5793 r->trusted_dc_name = NULL;
5795 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->tc_connection_status));
5796 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5798 if (ndr_flags & NDR_BUFFERS) {
5799 if (r->trusted_dc_name) {
5800 _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5801 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0);
5802 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name));
5803 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name));
5804 if (ndr_get_array_length(ndr, &r->trusted_dc_name) > ndr_get_array_size(ndr, &r->trusted_dc_name)) {
5805 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_dc_name), ndr_get_array_length(ndr, &r->trusted_dc_name));
5807 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t)));
5808 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t), CH_UTF16));
5809 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0);
5812 return NDR_ERR_SUCCESS;
5815 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r)
5817 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_2");
5818 ndr->depth++;
5819 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5820 ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
5821 ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name);
5822 ndr->depth++;
5823 if (r->trusted_dc_name) {
5824 ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name);
5826 ndr->depth--;
5827 ndr_print_WERROR(ndr, "tc_connection_status", r->tc_connection_status);
5828 ndr->depth--;
5831 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)
5833 if (ndr_flags & NDR_SCALARS) {
5834 NDR_CHECK(ndr_push_align(ndr, 4));
5835 NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
5836 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_attempts));
5837 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
5838 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
5839 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
5840 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
5841 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
5842 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
5844 if (ndr_flags & NDR_BUFFERS) {
5846 return NDR_ERR_SUCCESS;
5849 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r)
5851 if (ndr_flags & NDR_SCALARS) {
5852 NDR_CHECK(ndr_pull_align(ndr, 4));
5853 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
5854 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_attempts));
5855 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
5856 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
5857 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
5858 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
5859 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
5860 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
5862 if (ndr_flags & NDR_BUFFERS) {
5864 return NDR_ERR_SUCCESS;
5867 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r)
5869 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_3");
5870 ndr->depth++;
5871 ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
5872 ndr_print_uint32(ndr, "logon_attempts", r->logon_attempts);
5873 ndr_print_uint32(ndr, "unknown1", r->unknown1);
5874 ndr_print_uint32(ndr, "unknown2", r->unknown2);
5875 ndr_print_uint32(ndr, "unknown3", r->unknown3);
5876 ndr_print_uint32(ndr, "unknown4", r->unknown4);
5877 ndr_print_uint32(ndr, "unknown5", r->unknown5);
5878 ndr->depth--;
5881 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)
5883 if (ndr_flags & NDR_SCALARS) {
5884 NDR_CHECK(ndr_push_align(ndr, 5));
5885 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name));
5886 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain_name));
5887 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
5889 if (ndr_flags & NDR_BUFFERS) {
5890 if (r->trusted_dc_name) {
5891 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5892 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5893 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16)));
5894 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));
5896 if (r->trusted_domain_name) {
5897 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16)));
5898 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5899 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16)));
5900 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));
5903 return NDR_ERR_SUCCESS;
5906 static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_4(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_4 *r)
5908 uint32_t _ptr_trusted_dc_name;
5909 TALLOC_CTX *_mem_save_trusted_dc_name_0;
5910 uint32_t _ptr_trusted_domain_name;
5911 TALLOC_CTX *_mem_save_trusted_domain_name_0;
5912 if (ndr_flags & NDR_SCALARS) {
5913 NDR_CHECK(ndr_pull_align(ndr, 5));
5914 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name));
5915 if (_ptr_trusted_dc_name) {
5916 NDR_PULL_ALLOC(ndr, r->trusted_dc_name);
5917 } else {
5918 r->trusted_dc_name = NULL;
5920 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name));
5921 if (_ptr_trusted_domain_name) {
5922 NDR_PULL_ALLOC(ndr, r->trusted_domain_name);
5923 } else {
5924 r->trusted_domain_name = NULL;
5926 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
5928 if (ndr_flags & NDR_BUFFERS) {
5929 if (r->trusted_dc_name) {
5930 _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5931 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0);
5932 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name));
5933 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name));
5934 if (ndr_get_array_length(ndr, &r->trusted_dc_name) > ndr_get_array_size(ndr, &r->trusted_dc_name)) {
5935 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_dc_name), ndr_get_array_length(ndr, &r->trusted_dc_name));
5937 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t)));
5938 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t), CH_UTF16));
5939 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0);
5941 if (r->trusted_domain_name) {
5942 _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5943 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain_name, 0);
5944 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_domain_name));
5945 NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_domain_name));
5946 if (ndr_get_array_length(ndr, &r->trusted_domain_name) > ndr_get_array_size(ndr, &r->trusted_domain_name)) {
5947 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_domain_name), ndr_get_array_length(ndr, &r->trusted_domain_name));
5949 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_domain_name), sizeof(uint16_t)));
5950 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_domain_name, ndr_get_array_length(ndr, &r->trusted_domain_name), sizeof(uint16_t), CH_UTF16));
5951 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0);
5954 return NDR_ERR_SUCCESS;
5957 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_4(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_4 *r)
5959 ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_4");
5960 ndr->depth++;
5961 ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name);
5962 ndr->depth++;
5963 if (r->trusted_dc_name) {
5964 ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name);
5966 ndr->depth--;
5967 ndr_print_ptr(ndr, "trusted_domain_name", r->trusted_domain_name);
5968 ndr->depth++;
5969 if (r->trusted_domain_name) {
5970 ndr_print_string(ndr, "trusted_domain_name", r->trusted_domain_name);
5972 ndr->depth--;
5973 ndr->depth--;
5976 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)
5978 if (ndr_flags & NDR_SCALARS) {
5979 int level = ndr_push_get_switch_value(ndr, r);
5980 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
5981 NDR_CHECK(ndr_push_union_align(ndr, 5));
5982 switch (level) {
5983 case 1: {
5984 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
5985 break; }
5987 case 2: {
5988 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
5989 break; }
5991 case 3: {
5992 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
5993 break; }
5995 case 4: {
5996 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4));
5997 break; }
5999 default: {
6000 break; }
6004 if (ndr_flags & NDR_BUFFERS) {
6005 int level = ndr_push_get_switch_value(ndr, r);
6006 switch (level) {
6007 case 1:
6008 if (r->info1) {
6009 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1));
6011 break;
6013 case 2:
6014 if (r->info2) {
6015 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
6017 break;
6019 case 3:
6020 if (r->info3) {
6021 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3));
6023 break;
6025 case 4:
6026 if (r->info4) {
6027 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
6029 break;
6031 default:
6032 break;
6036 return NDR_ERR_SUCCESS;
6039 static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r)
6041 int level;
6042 uint32_t _level;
6043 TALLOC_CTX *_mem_save_info1_0;
6044 TALLOC_CTX *_mem_save_info2_0;
6045 TALLOC_CTX *_mem_save_info3_0;
6046 TALLOC_CTX *_mem_save_info4_0;
6047 level = ndr_pull_get_switch_value(ndr, r);
6048 if (ndr_flags & NDR_SCALARS) {
6049 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
6050 if (_level != level) {
6051 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6053 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6054 switch (level) {
6055 case 1: {
6056 uint32_t _ptr_info1;
6057 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
6058 if (_ptr_info1) {
6059 NDR_PULL_ALLOC(ndr, r->info1);
6060 } else {
6061 r->info1 = NULL;
6063 break; }
6065 case 2: {
6066 uint32_t _ptr_info2;
6067 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
6068 if (_ptr_info2) {
6069 NDR_PULL_ALLOC(ndr, r->info2);
6070 } else {
6071 r->info2 = NULL;
6073 break; }
6075 case 3: {
6076 uint32_t _ptr_info3;
6077 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
6078 if (_ptr_info3) {
6079 NDR_PULL_ALLOC(ndr, r->info3);
6080 } else {
6081 r->info3 = NULL;
6083 break; }
6085 case 4: {
6086 uint32_t _ptr_info4;
6087 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4));
6088 if (_ptr_info4) {
6089 NDR_PULL_ALLOC(ndr, r->info4);
6090 } else {
6091 r->info4 = NULL;
6093 break; }
6095 default: {
6096 break; }
6100 if (ndr_flags & NDR_BUFFERS) {
6101 switch (level) {
6102 case 1:
6103 if (r->info1) {
6104 _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
6105 NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
6106 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1));
6107 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
6109 break;
6111 case 2:
6112 if (r->info2) {
6113 _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
6114 NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
6115 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
6116 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
6118 break;
6120 case 3:
6121 if (r->info3) {
6122 _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
6123 NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
6124 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3));
6125 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
6127 break;
6129 case 4:
6130 if (r->info4) {
6131 _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr);
6132 NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0);
6133 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
6134 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0);
6136 break;
6138 default:
6139 break;
6143 return NDR_ERR_SUCCESS;
6146 _PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r)
6148 int level;
6149 level = ndr_print_get_switch_value(ndr, r);
6150 ndr_print_union(ndr, name, level, "netr_CONTROL_QUERY_INFORMATION");
6151 switch (level) {
6152 case 1:
6153 ndr_print_ptr(ndr, "info1", r->info1);
6154 ndr->depth++;
6155 if (r->info1) {
6156 ndr_print_netr_NETLOGON_INFO_1(ndr, "info1", r->info1);
6158 ndr->depth--;
6159 break;
6161 case 2:
6162 ndr_print_ptr(ndr, "info2", r->info2);
6163 ndr->depth++;
6164 if (r->info2) {
6165 ndr_print_netr_NETLOGON_INFO_2(ndr, "info2", r->info2);
6167 ndr->depth--;
6168 break;
6170 case 3:
6171 ndr_print_ptr(ndr, "info3", r->info3);
6172 ndr->depth++;
6173 if (r->info3) {
6174 ndr_print_netr_NETLOGON_INFO_3(ndr, "info3", r->info3);
6176 ndr->depth--;
6177 break;
6179 case 4:
6180 ndr_print_ptr(ndr, "info4", r->info4);
6181 ndr->depth++;
6182 if (r->info4) {
6183 ndr_print_netr_NETLOGON_INFO_4(ndr, "info4", r->info4);
6185 ndr->depth--;
6186 break;
6188 default:
6189 break;
6194 static enum ndr_err_code ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r)
6196 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
6197 return NDR_ERR_SUCCESS;
6200 static enum ndr_err_code ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r)
6202 uint32_t v;
6203 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
6204 *r = v;
6205 return NDR_ERR_SUCCESS;
6208 _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r)
6210 const char *val = NULL;
6212 switch (r) {
6213 case NETLOGON_CONTROL_QUERY: val = "NETLOGON_CONTROL_QUERY"; break;
6214 case NETLOGON_CONTROL_REPLICATE: val = "NETLOGON_CONTROL_REPLICATE"; break;
6215 case NETLOGON_CONTROL_SYNCHRONIZE: val = "NETLOGON_CONTROL_SYNCHRONIZE"; break;
6216 case NETLOGON_CONTROL_PDC_REPLICATE: val = "NETLOGON_CONTROL_PDC_REPLICATE"; break;
6217 case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break;
6218 case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break;
6219 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break;
6220 case NETLOGON_CONTROL_FIND_USER: val = "NETLOGON_CONTROL_FIND_USER"; break;
6221 case NETLOGON_CONTROL_CHANGE_PASSWORD: val = "NETLOGON_CONTROL_CHANGE_PASSWORD"; break;
6222 case NETLOGON_CONTROL_TC_VERIFY: val = "NETLOGON_CONTROL_TC_VERIFY"; break;
6223 case NETLOGON_CONTROL_FORCE_DNS_REG: val = "NETLOGON_CONTROL_FORCE_DNS_REG"; break;
6224 case NETLOGON_CONTROL_QUERY_DNS_REG: val = "NETLOGON_CONTROL_QUERY_DNS_REG"; break;
6225 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG: val = "NETLOGON_CONTROL_BACKUP_CHANGE_LOG"; break;
6226 case NETLOGON_CONTROL_TRUNCATE_LOG: val = "NETLOGON_CONTROL_TRUNCATE_LOG"; break;
6227 case NETLOGON_CONTROL_SET_DBFLAG: val = "NETLOGON_CONTROL_SET_DBFLAG"; break;
6228 case NETLOGON_CONTROL_BREAKPOINT: val = "NETLOGON_CONTROL_BREAKPOINT"; break;
6230 ndr_print_enum(ndr, name, "ENUM", val, r);
6233 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)
6235 if (ndr_flags & NDR_SCALARS) {
6236 int level = ndr_push_get_switch_value(ndr, r);
6237 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
6238 NDR_CHECK(ndr_push_union_align(ndr, 5));
6239 switch (level) {
6240 case NETLOGON_CONTROL_REDISCOVER: {
6241 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6242 break; }
6244 case NETLOGON_CONTROL_TC_QUERY: {
6245 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6246 break; }
6248 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: {
6249 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6250 break; }
6252 case NETLOGON_CONTROL_CHANGE_PASSWORD: {
6253 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6254 break; }
6256 case NETLOGON_CONTROL_TC_VERIFY: {
6257 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
6258 break; }
6260 case NETLOGON_CONTROL_FIND_USER: {
6261 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
6262 break; }
6264 case NETLOGON_CONTROL_SET_DBFLAG: {
6265 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level));
6266 break; }
6268 default: {
6269 break; }
6273 if (ndr_flags & NDR_BUFFERS) {
6274 int level = ndr_push_get_switch_value(ndr, r);
6275 switch (level) {
6276 case NETLOGON_CONTROL_REDISCOVER:
6277 if (r->domain) {
6278 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6279 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6280 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6281 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6283 break;
6285 case NETLOGON_CONTROL_TC_QUERY:
6286 if (r->domain) {
6287 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6288 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6289 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6290 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6292 break;
6294 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6295 if (r->domain) {
6296 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6297 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6298 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6299 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6301 break;
6303 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6304 if (r->domain) {
6305 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6306 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6307 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6308 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6310 break;
6312 case NETLOGON_CONTROL_TC_VERIFY:
6313 if (r->domain) {
6314 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6315 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6316 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
6317 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6319 break;
6321 case NETLOGON_CONTROL_FIND_USER:
6322 if (r->user) {
6323 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
6324 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6325 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
6326 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6328 break;
6330 case NETLOGON_CONTROL_SET_DBFLAG:
6331 break;
6333 default:
6334 break;
6338 return NDR_ERR_SUCCESS;
6341 static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r)
6343 int level;
6344 uint32_t _level;
6345 TALLOC_CTX *_mem_save_domain_0;
6346 TALLOC_CTX *_mem_save_user_0;
6347 level = ndr_pull_get_switch_value(ndr, r);
6348 if (ndr_flags & NDR_SCALARS) {
6349 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
6350 if (_level != level) {
6351 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6353 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6354 switch (level) {
6355 case NETLOGON_CONTROL_REDISCOVER: {
6356 uint32_t _ptr_domain;
6357 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6358 if (_ptr_domain) {
6359 NDR_PULL_ALLOC(ndr, r->domain);
6360 } else {
6361 r->domain = NULL;
6363 break; }
6365 case NETLOGON_CONTROL_TC_QUERY: {
6366 uint32_t _ptr_domain;
6367 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6368 if (_ptr_domain) {
6369 NDR_PULL_ALLOC(ndr, r->domain);
6370 } else {
6371 r->domain = NULL;
6373 break; }
6375 case NETLOGON_CONTROL_TRANSPORT_NOTIFY: {
6376 uint32_t _ptr_domain;
6377 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6378 if (_ptr_domain) {
6379 NDR_PULL_ALLOC(ndr, r->domain);
6380 } else {
6381 r->domain = NULL;
6383 break; }
6385 case NETLOGON_CONTROL_CHANGE_PASSWORD: {
6386 uint32_t _ptr_domain;
6387 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6388 if (_ptr_domain) {
6389 NDR_PULL_ALLOC(ndr, r->domain);
6390 } else {
6391 r->domain = NULL;
6393 break; }
6395 case NETLOGON_CONTROL_TC_VERIFY: {
6396 uint32_t _ptr_domain;
6397 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
6398 if (_ptr_domain) {
6399 NDR_PULL_ALLOC(ndr, r->domain);
6400 } else {
6401 r->domain = NULL;
6403 break; }
6405 case NETLOGON_CONTROL_FIND_USER: {
6406 uint32_t _ptr_user;
6407 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
6408 if (_ptr_user) {
6409 NDR_PULL_ALLOC(ndr, r->user);
6410 } else {
6411 r->user = NULL;
6413 break; }
6415 case NETLOGON_CONTROL_SET_DBFLAG: {
6416 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->debug_level));
6417 break; }
6419 default: {
6420 break; }
6424 if (ndr_flags & NDR_BUFFERS) {
6425 switch (level) {
6426 case NETLOGON_CONTROL_REDISCOVER:
6427 if (r->domain) {
6428 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6429 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6430 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6431 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6432 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
6433 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
6435 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
6436 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
6437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6439 break;
6441 case NETLOGON_CONTROL_TC_QUERY:
6442 if (r->domain) {
6443 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6444 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6445 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6446 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6447 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
6448 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
6450 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
6451 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
6452 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6454 break;
6456 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6457 if (r->domain) {
6458 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6459 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6460 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6461 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6462 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
6463 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
6465 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
6466 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
6467 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6469 break;
6471 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6472 if (r->domain) {
6473 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6474 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6475 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6476 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6477 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
6478 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
6480 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
6481 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
6482 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6484 break;
6486 case NETLOGON_CONTROL_TC_VERIFY:
6487 if (r->domain) {
6488 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
6489 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
6490 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
6491 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
6492 if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
6493 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
6495 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
6496 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
6497 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
6499 break;
6501 case NETLOGON_CONTROL_FIND_USER:
6502 if (r->user) {
6503 _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
6504 NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
6505 NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
6506 NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
6507 if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
6508 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
6510 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
6511 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
6512 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
6514 break;
6516 case NETLOGON_CONTROL_SET_DBFLAG:
6517 break;
6519 default:
6520 break;
6524 return NDR_ERR_SUCCESS;
6527 _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r)
6529 int level;
6530 level = ndr_print_get_switch_value(ndr, r);
6531 ndr_print_union(ndr, name, level, "netr_CONTROL_DATA_INFORMATION");
6532 switch (level) {
6533 case NETLOGON_CONTROL_REDISCOVER:
6534 ndr_print_ptr(ndr, "domain", r->domain);
6535 ndr->depth++;
6536 if (r->domain) {
6537 ndr_print_string(ndr, "domain", r->domain);
6539 ndr->depth--;
6540 break;
6542 case NETLOGON_CONTROL_TC_QUERY:
6543 ndr_print_ptr(ndr, "domain", r->domain);
6544 ndr->depth++;
6545 if (r->domain) {
6546 ndr_print_string(ndr, "domain", r->domain);
6548 ndr->depth--;
6549 break;
6551 case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
6552 ndr_print_ptr(ndr, "domain", r->domain);
6553 ndr->depth++;
6554 if (r->domain) {
6555 ndr_print_string(ndr, "domain", r->domain);
6557 ndr->depth--;
6558 break;
6560 case NETLOGON_CONTROL_CHANGE_PASSWORD:
6561 ndr_print_ptr(ndr, "domain", r->domain);
6562 ndr->depth++;
6563 if (r->domain) {
6564 ndr_print_string(ndr, "domain", r->domain);
6566 ndr->depth--;
6567 break;
6569 case NETLOGON_CONTROL_TC_VERIFY:
6570 ndr_print_ptr(ndr, "domain", r->domain);
6571 ndr->depth++;
6572 if (r->domain) {
6573 ndr_print_string(ndr, "domain", r->domain);
6575 ndr->depth--;
6576 break;
6578 case NETLOGON_CONTROL_FIND_USER:
6579 ndr_print_ptr(ndr, "user", r->user);
6580 ndr->depth++;
6581 if (r->user) {
6582 ndr_print_string(ndr, "user", r->user);
6584 ndr->depth--;
6585 break;
6587 case NETLOGON_CONTROL_SET_DBFLAG:
6588 ndr_print_uint32(ndr, "debug_level", r->debug_level);
6589 break;
6591 default:
6592 break;
6597 _PUBLIC_ enum ndr_err_code ndr_push_netr_NegotiateFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
6599 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
6600 return NDR_ERR_SUCCESS;
6603 _PUBLIC_ enum ndr_err_code ndr_pull_netr_NegotiateFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
6605 uint32_t v;
6606 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
6607 *r = v;
6608 return NDR_ERR_SUCCESS;
6611 _PUBLIC_ void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r)
6613 ndr_print_uint32(ndr, name, r);
6614 ndr->depth++;
6615 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ACCOUNT_LOCKOUT", NETLOGON_NEG_ACCOUNT_LOCKOUT, r);
6616 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PERSISTENT_SAMREPL", NETLOGON_NEG_PERSISTENT_SAMREPL, r);
6617 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ARCFOUR", NETLOGON_NEG_ARCFOUR, r);
6618 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PROMOTION_COUNT", NETLOGON_NEG_PROMOTION_COUNT, r);
6619 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CHANGELOG_BDC", NETLOGON_NEG_CHANGELOG_BDC, r);
6620 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_FULL_SYNC_REPL", NETLOGON_NEG_FULL_SYNC_REPL, r);
6621 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_MULTIPLE_SIDS", NETLOGON_NEG_MULTIPLE_SIDS, r);
6622 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_REDO", NETLOGON_NEG_REDO, r);
6623 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL, r);
6624 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", NETLOGON_NEG_SEND_PASSWORD_INFO_PDC, r);
6625 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GENERIC_PASSTHROUGH", NETLOGON_NEG_GENERIC_PASSTHROUGH, r);
6626 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CONCURRENT_RPC", NETLOGON_NEG_CONCURRENT_RPC, r);
6627 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL, r);
6628 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL, r);
6629 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_STRONG_KEYS", NETLOGON_NEG_STRONG_KEYS, r);
6630 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_TRANSITIVE_TRUSTS", NETLOGON_NEG_TRANSITIVE_TRUSTS, r);
6631 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", NETLOGON_NEG_DNS_DOMAIN_TRUSTS, r);
6632 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_SET2", NETLOGON_NEG_PASSWORD_SET2, r);
6633 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GETDOMAININFO", NETLOGON_NEG_GETDOMAININFO, r);
6634 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CROSS_FOREST_TRUSTS", NETLOGON_NEG_CROSS_FOREST_TRUSTS, r);
6635 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION, r);
6636 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_RODC_PASSTHROUGH", NETLOGON_NEG_RODC_PASSTHROUGH, r);
6637 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SUPPORTS_AES_SHA2", NETLOGON_NEG_SUPPORTS_AES_SHA2, r);
6638 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SUPPORTS_AES", NETLOGON_NEG_SUPPORTS_AES, r);
6639 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", NETLOGON_NEG_AUTHENTICATED_RPC_LSASS, r);
6640 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC", NETLOGON_NEG_AUTHENTICATED_RPC, r);
6641 ndr->depth--;
6644 static enum ndr_err_code ndr_push_SyncStateEnum(struct ndr_push *ndr, int ndr_flags, enum SyncStateEnum r)
6646 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
6647 return NDR_ERR_SUCCESS;
6650 static enum ndr_err_code ndr_pull_SyncStateEnum(struct ndr_pull *ndr, int ndr_flags, enum SyncStateEnum *r)
6652 uint16_t v;
6653 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
6654 *r = v;
6655 return NDR_ERR_SUCCESS;
6658 _PUBLIC_ void ndr_print_SyncStateEnum(struct ndr_print *ndr, const char *name, enum SyncStateEnum r)
6660 const char *val = NULL;
6662 switch (r) {
6663 case SYNCSTATE_NORMAL_STATE: val = "SYNCSTATE_NORMAL_STATE"; break;
6664 case SYNCSTATE_DOMAIN_STATE: val = "SYNCSTATE_DOMAIN_STATE"; break;
6665 case SYNCSTATE_GROUP_STATE: val = "SYNCSTATE_GROUP_STATE"; break;
6666 case SYNCSTATE_UAS_BUILT_IN_GROUP_STATE: val = "SYNCSTATE_UAS_BUILT_IN_GROUP_STATE"; break;
6667 case SYNCSTATE_USER_STATE: val = "SYNCSTATE_USER_STATE"; break;
6668 case SYNCSTATE_GROUP_MEMBER_STATE: val = "SYNCSTATE_GROUP_MEMBER_STATE"; break;
6669 case SYNCSTATE_ALIAS_STATE: val = "SYNCSTATE_ALIAS_STATE"; break;
6670 case SYNCSTATE_ALIAS_MEMBER_STATE: val = "SYNCSTATE_ALIAS_MEMBER_STATE"; break;
6671 case SYNCSTATE_SAM_DONE_STATE: val = "SYNCSTATE_SAM_DONE_STATE"; break;
6673 ndr_print_enum(ndr, name, "ENUM", val, r);
6676 static enum ndr_err_code ndr_push_netr_ChangeLogFlags(struct ndr_push *ndr, int ndr_flags, uint16_t r)
6678 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
6679 return NDR_ERR_SUCCESS;
6682 static enum ndr_err_code ndr_pull_netr_ChangeLogFlags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
6684 uint16_t v;
6685 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
6686 *r = v;
6687 return NDR_ERR_SUCCESS;
6690 _PUBLIC_ void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r)
6692 ndr_print_uint16(ndr, name, r);
6693 ndr->depth++;
6694 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED, r);
6695 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_CHANGED_PASSWORD", NETR_CHANGELOG_CHANGED_PASSWORD, r);
6696 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_SID_INCLUDED", NETR_CHANGELOG_SID_INCLUDED, r);
6697 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_NAME_INCLUDED", NETR_CHANGELOG_NAME_INCLUDED, r);
6698 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", NETR_CHANGELOG_FIRST_PROMOTION_OBJ, r);
6699 ndr->depth--;
6702 static enum ndr_err_code ndr_push_netr_ChangeLogObject(struct ndr_push *ndr, int ndr_flags, const union netr_ChangeLogObject *r)
6704 if (ndr_flags & NDR_SCALARS) {
6705 int level = ndr_push_get_switch_value(ndr, r);
6706 NDR_CHECK(ndr_push_union_align(ndr, 4));
6707 switch (level) {
6708 case NETR_CHANGELOG_SID_INCLUDED: {
6709 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->object_sid));
6710 break; }
6712 case NETR_CHANGELOG_NAME_INCLUDED: {
6714 uint32_t _flags_save_string = ndr->flags;
6715 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
6716 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->object_name));
6717 ndr->flags = _flags_save_string;
6719 break; }
6721 default: {
6722 break; }
6726 if (ndr_flags & NDR_BUFFERS) {
6727 int level = ndr_push_get_switch_value(ndr, r);
6728 switch (level) {
6729 case NETR_CHANGELOG_SID_INCLUDED:
6730 break;
6732 case NETR_CHANGELOG_NAME_INCLUDED:
6733 break;
6735 default:
6736 break;
6740 return NDR_ERR_SUCCESS;
6743 static enum ndr_err_code ndr_pull_netr_ChangeLogObject(struct ndr_pull *ndr, int ndr_flags, union netr_ChangeLogObject *r)
6745 int level;
6746 level = ndr_pull_get_switch_value(ndr, r);
6747 if (ndr_flags & NDR_SCALARS) {
6748 NDR_CHECK(ndr_pull_union_align(ndr, 4));
6749 switch (level) {
6750 case NETR_CHANGELOG_SID_INCLUDED: {
6751 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->object_sid));
6752 break; }
6754 case NETR_CHANGELOG_NAME_INCLUDED: {
6756 uint32_t _flags_save_string = ndr->flags;
6757 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
6758 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->object_name));
6759 ndr->flags = _flags_save_string;
6761 break; }
6763 default: {
6764 break; }
6768 if (ndr_flags & NDR_BUFFERS) {
6769 switch (level) {
6770 case NETR_CHANGELOG_SID_INCLUDED:
6771 break;
6773 case NETR_CHANGELOG_NAME_INCLUDED:
6774 break;
6776 default:
6777 break;
6781 return NDR_ERR_SUCCESS;
6784 _PUBLIC_ void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r)
6786 int level;
6787 level = ndr_print_get_switch_value(ndr, r);
6788 ndr_print_union(ndr, name, level, "netr_ChangeLogObject");
6789 switch (level) {
6790 case NETR_CHANGELOG_SID_INCLUDED:
6791 ndr_print_dom_sid(ndr, "object_sid", &r->object_sid);
6792 break;
6794 case NETR_CHANGELOG_NAME_INCLUDED:
6795 ndr_print_string(ndr, "object_name", r->object_name);
6796 break;
6798 default:
6799 break;
6804 _PUBLIC_ enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r)
6806 if (ndr_flags & NDR_SCALARS) {
6807 NDR_CHECK(ndr_push_align(ndr, 4));
6808 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number1));
6809 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number2));
6810 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_rid));
6811 NDR_CHECK(ndr_push_netr_ChangeLogFlags(ndr, NDR_SCALARS, r->flags));
6812 NDR_CHECK(ndr_push_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, r->db_index));
6813 NDR_CHECK(ndr_push_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, r->delta_type));
6814 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)));
6815 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object));
6816 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
6818 if (ndr_flags & NDR_BUFFERS) {
6819 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object));
6821 return NDR_ERR_SUCCESS;
6824 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r)
6826 if (ndr_flags & NDR_SCALARS) {
6827 NDR_CHECK(ndr_pull_align(ndr, 4));
6828 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number1));
6829 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number2));
6830 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_rid));
6831 NDR_CHECK(ndr_pull_netr_ChangeLogFlags(ndr, NDR_SCALARS, &r->flags));
6832 NDR_CHECK(ndr_pull_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, &r->db_index));
6833 NDR_CHECK(ndr_pull_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, &r->delta_type));
6834 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)));
6835 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object));
6836 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
6838 if (ndr_flags & NDR_BUFFERS) {
6839 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object));
6841 return NDR_ERR_SUCCESS;
6844 _PUBLIC_ void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r)
6846 ndr_print_struct(ndr, name, "netr_ChangeLogEntry");
6847 ndr->depth++;
6848 ndr_print_uint32(ndr, "serial_number1", r->serial_number1);
6849 ndr_print_uint32(ndr, "serial_number2", r->serial_number2);
6850 ndr_print_uint32(ndr, "object_rid", r->object_rid);
6851 ndr_print_netr_ChangeLogFlags(ndr, "flags", r->flags);
6852 ndr_print_netr_SamDatabaseID8Bit(ndr, "db_index", r->db_index);
6853 ndr_print_netr_DeltaEnum8Bit(ndr, "delta_type", r->delta_type);
6854 ndr_print_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED));
6855 ndr_print_netr_ChangeLogObject(ndr, "object", &r->object);
6856 ndr->depth--;
6859 _PUBLIC_ size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, struct smb_iconv_convenience *ic, int flags)
6861 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_netr_ChangeLogEntry, ic);
6864 static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r)
6866 if (ndr_flags & NDR_SCALARS) {
6867 NDR_CHECK(ndr_push_align(ndr, 5));
6868 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
6869 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
6870 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
6872 if (ndr_flags & NDR_BUFFERS) {
6873 if (r->data) {
6874 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
6875 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
6878 return NDR_ERR_SUCCESS;
6881 static enum ndr_err_code ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r)
6883 uint32_t _ptr_data;
6884 TALLOC_CTX *_mem_save_data_0;
6885 if (ndr_flags & NDR_SCALARS) {
6886 NDR_CHECK(ndr_pull_align(ndr, 5));
6887 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
6888 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
6889 if (_ptr_data) {
6890 NDR_PULL_ALLOC(ndr, r->data);
6891 } else {
6892 r->data = NULL;
6894 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
6896 if (ndr_flags & NDR_BUFFERS) {
6897 if (r->data) {
6898 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
6899 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
6900 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
6901 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
6902 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
6903 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
6905 if (r->data) {
6906 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
6909 return NDR_ERR_SUCCESS;
6912 _PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r)
6914 ndr_print_struct(ndr, name, "netr_Blob");
6915 ndr->depth++;
6916 ndr_print_uint32(ndr, "length", r->length);
6917 ndr_print_ptr(ndr, "data", r->data);
6918 ndr->depth++;
6919 if (r->data) {
6920 ndr_print_array_uint8(ndr, "data", r->data, r->length);
6922 ndr->depth--;
6923 ndr->depth--;
6926 static enum ndr_err_code ndr_push_netr_DsRGetDCName_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
6928 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
6929 return NDR_ERR_SUCCESS;
6932 static enum ndr_err_code ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
6934 uint32_t v;
6935 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
6936 *r = v;
6937 return NDR_ERR_SUCCESS;
6940 _PUBLIC_ void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r)
6942 ndr_print_uint32(ndr, name, r);
6943 ndr->depth++;
6944 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r);
6945 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r);
6946 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r);
6947 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r);
6948 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r);
6949 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r);
6950 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r);
6951 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r);
6952 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r);
6953 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r);
6954 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r);
6955 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r);
6956 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r);
6957 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r);
6958 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r);
6959 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r);
6960 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r);
6961 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WEB_SERVICE_REQUIRED", DS_WEB_SERVICE_REQUIRED, r);
6962 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r);
6963 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r);
6964 ndr->depth--;
6967 static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r)
6969 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
6970 return NDR_ERR_SUCCESS;
6973 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r)
6975 uint32_t v;
6976 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
6977 *r = v;
6978 return NDR_ERR_SUCCESS;
6981 _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r)
6983 const char *val = NULL;
6985 switch (r) {
6986 case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break;
6987 case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break;
6989 ndr_print_enum(ndr, name, "ENUM", val, r);
6992 static enum ndr_err_code ndr_push_netr_DsR_DcFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
6994 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
6995 return NDR_ERR_SUCCESS;
6998 static enum ndr_err_code ndr_pull_netr_DsR_DcFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7000 uint32_t v;
7001 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7002 *r = v;
7003 return NDR_ERR_SUCCESS;
7006 _PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7008 ndr_print_uint32(ndr, name, r);
7009 ndr->depth++;
7010 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC, r);
7011 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r);
7012 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r);
7013 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r);
7014 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r);
7015 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r);
7016 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r);
7017 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r);
7018 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r);
7019 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r);
7020 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r);
7021 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r);
7022 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r);
7023 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r);
7024 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST_ROOT", DS_DNS_FOREST_ROOT, r);
7025 ndr->depth--;
7028 _PUBLIC_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r)
7030 if (ndr_flags & NDR_SCALARS) {
7031 NDR_CHECK(ndr_push_align(ndr, 5));
7032 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc));
7033 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address));
7034 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type));
7035 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
7036 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
7037 NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name));
7038 NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags));
7039 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name));
7040 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name));
7041 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7043 if (ndr_flags & NDR_BUFFERS) {
7044 if (r->dc_unc) {
7045 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16)));
7046 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7047 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16)));
7048 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_unc, ndr_charset_length(r->dc_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7050 if (r->dc_address) {
7051 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16)));
7052 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7053 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16)));
7054 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_address, ndr_charset_length(r->dc_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7056 if (r->domain_name) {
7057 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
7058 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7059 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
7060 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7062 if (r->forest_name) {
7063 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16)));
7064 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7065 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16)));
7066 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest_name, ndr_charset_length(r->forest_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7068 if (r->dc_site_name) {
7069 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16)));
7070 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7071 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16)));
7072 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));
7074 if (r->client_site_name) {
7075 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16)));
7076 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7077 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16)));
7078 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));
7081 return NDR_ERR_SUCCESS;
7084 _PUBLIC_ enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r)
7086 uint32_t _ptr_dc_unc;
7087 TALLOC_CTX *_mem_save_dc_unc_0;
7088 uint32_t _ptr_dc_address;
7089 TALLOC_CTX *_mem_save_dc_address_0;
7090 uint32_t _ptr_domain_name;
7091 TALLOC_CTX *_mem_save_domain_name_0;
7092 uint32_t _ptr_forest_name;
7093 TALLOC_CTX *_mem_save_forest_name_0;
7094 uint32_t _ptr_dc_site_name;
7095 TALLOC_CTX *_mem_save_dc_site_name_0;
7096 uint32_t _ptr_client_site_name;
7097 TALLOC_CTX *_mem_save_client_site_name_0;
7098 if (ndr_flags & NDR_SCALARS) {
7099 NDR_CHECK(ndr_pull_align(ndr, 5));
7100 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_unc));
7101 if (_ptr_dc_unc) {
7102 NDR_PULL_ALLOC(ndr, r->dc_unc);
7103 } else {
7104 r->dc_unc = NULL;
7106 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_address));
7107 if (_ptr_dc_address) {
7108 NDR_PULL_ALLOC(ndr, r->dc_address);
7109 } else {
7110 r->dc_address = NULL;
7112 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type));
7113 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
7114 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
7115 if (_ptr_domain_name) {
7116 NDR_PULL_ALLOC(ndr, r->domain_name);
7117 } else {
7118 r->domain_name = NULL;
7120 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_name));
7121 if (_ptr_forest_name) {
7122 NDR_PULL_ALLOC(ndr, r->forest_name);
7123 } else {
7124 r->forest_name = NULL;
7126 NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags));
7127 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name));
7128 if (_ptr_dc_site_name) {
7129 NDR_PULL_ALLOC(ndr, r->dc_site_name);
7130 } else {
7131 r->dc_site_name = NULL;
7133 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_site_name));
7134 if (_ptr_client_site_name) {
7135 NDR_PULL_ALLOC(ndr, r->client_site_name);
7136 } else {
7137 r->client_site_name = NULL;
7139 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7141 if (ndr_flags & NDR_BUFFERS) {
7142 if (r->dc_unc) {
7143 _mem_save_dc_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
7144 NDR_PULL_SET_MEM_CTX(ndr, r->dc_unc, 0);
7145 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_unc));
7146 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_unc));
7147 if (ndr_get_array_length(ndr, &r->dc_unc) > ndr_get_array_size(ndr, &r->dc_unc)) {
7148 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_unc), ndr_get_array_length(ndr, &r->dc_unc));
7150 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t)));
7151 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_unc, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t), CH_UTF16));
7152 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_unc_0, 0);
7154 if (r->dc_address) {
7155 _mem_save_dc_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
7156 NDR_PULL_SET_MEM_CTX(ndr, r->dc_address, 0);
7157 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_address));
7158 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_address));
7159 if (ndr_get_array_length(ndr, &r->dc_address) > ndr_get_array_size(ndr, &r->dc_address)) {
7160 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_address), ndr_get_array_length(ndr, &r->dc_address));
7162 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t)));
7163 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_address, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t), CH_UTF16));
7164 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_address_0, 0);
7166 if (r->domain_name) {
7167 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7168 NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0);
7169 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
7170 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
7171 if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) {
7172 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name));
7174 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t)));
7175 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16));
7176 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
7178 if (r->forest_name) {
7179 _mem_save_forest_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7180 NDR_PULL_SET_MEM_CTX(ndr, r->forest_name, 0);
7181 NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_name));
7182 NDR_CHECK(ndr_pull_array_length(ndr, &r->forest_name));
7183 if (ndr_get_array_length(ndr, &r->forest_name) > ndr_get_array_size(ndr, &r->forest_name)) {
7184 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest_name), ndr_get_array_length(ndr, &r->forest_name));
7186 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t)));
7187 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest_name, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t), CH_UTF16));
7188 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_name_0, 0);
7190 if (r->dc_site_name) {
7191 _mem_save_dc_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7192 NDR_PULL_SET_MEM_CTX(ndr, r->dc_site_name, 0);
7193 NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_site_name));
7194 NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_site_name));
7195 if (ndr_get_array_length(ndr, &r->dc_site_name) > ndr_get_array_size(ndr, &r->dc_site_name)) {
7196 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_site_name), ndr_get_array_length(ndr, &r->dc_site_name));
7198 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t)));
7199 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_site_name, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t), CH_UTF16));
7200 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_site_name_0, 0);
7202 if (r->client_site_name) {
7203 _mem_save_client_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7204 NDR_PULL_SET_MEM_CTX(ndr, r->client_site_name, 0);
7205 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_site_name));
7206 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_site_name));
7207 if (ndr_get_array_length(ndr, &r->client_site_name) > ndr_get_array_size(ndr, &r->client_site_name)) {
7208 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_site_name), ndr_get_array_length(ndr, &r->client_site_name));
7210 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t)));
7211 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_site_name, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t), CH_UTF16));
7212 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_site_name_0, 0);
7215 return NDR_ERR_SUCCESS;
7218 _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r)
7220 ndr_print_struct(ndr, name, "netr_DsRGetDCNameInfo");
7221 ndr->depth++;
7222 ndr_print_ptr(ndr, "dc_unc", r->dc_unc);
7223 ndr->depth++;
7224 if (r->dc_unc) {
7225 ndr_print_string(ndr, "dc_unc", r->dc_unc);
7227 ndr->depth--;
7228 ndr_print_ptr(ndr, "dc_address", r->dc_address);
7229 ndr->depth++;
7230 if (r->dc_address) {
7231 ndr_print_string(ndr, "dc_address", r->dc_address);
7233 ndr->depth--;
7234 ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type);
7235 ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
7236 ndr_print_ptr(ndr, "domain_name", r->domain_name);
7237 ndr->depth++;
7238 if (r->domain_name) {
7239 ndr_print_string(ndr, "domain_name", r->domain_name);
7241 ndr->depth--;
7242 ndr_print_ptr(ndr, "forest_name", r->forest_name);
7243 ndr->depth++;
7244 if (r->forest_name) {
7245 ndr_print_string(ndr, "forest_name", r->forest_name);
7247 ndr->depth--;
7248 ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags);
7249 ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name);
7250 ndr->depth++;
7251 if (r->dc_site_name) {
7252 ndr_print_string(ndr, "dc_site_name", r->dc_site_name);
7254 ndr->depth--;
7255 ndr_print_ptr(ndr, "client_site_name", r->client_site_name);
7256 ndr->depth++;
7257 if (r->client_site_name) {
7258 ndr_print_string(ndr, "client_site_name", r->client_site_name);
7260 ndr->depth--;
7261 ndr->depth--;
7264 static enum ndr_err_code ndr_push_netr_Capabilities(struct ndr_push *ndr, int ndr_flags, const union netr_Capabilities *r)
7266 if (ndr_flags & NDR_SCALARS) {
7267 int level = ndr_push_get_switch_value(ndr, r);
7268 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
7269 NDR_CHECK(ndr_push_union_align(ndr, 4));
7270 switch (level) {
7271 case 1: {
7272 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, r->server_capabilities));
7273 break; }
7275 default:
7276 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7279 if (ndr_flags & NDR_BUFFERS) {
7280 int level = ndr_push_get_switch_value(ndr, r);
7281 switch (level) {
7282 case 1:
7283 break;
7285 default:
7286 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7289 return NDR_ERR_SUCCESS;
7292 static enum ndr_err_code ndr_pull_netr_Capabilities(struct ndr_pull *ndr, int ndr_flags, union netr_Capabilities *r)
7294 int level;
7295 uint32_t _level;
7296 level = ndr_pull_get_switch_value(ndr, r);
7297 if (ndr_flags & NDR_SCALARS) {
7298 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
7299 if (_level != level) {
7300 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
7302 NDR_CHECK(ndr_pull_union_align(ndr, 4));
7303 switch (level) {
7304 case 1: {
7305 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, &r->server_capabilities));
7306 break; }
7308 default:
7309 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7312 if (ndr_flags & NDR_BUFFERS) {
7313 switch (level) {
7314 case 1:
7315 break;
7317 default:
7318 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7321 return NDR_ERR_SUCCESS;
7324 _PUBLIC_ void ndr_print_netr_Capabilities(struct ndr_print *ndr, const char *name, const union netr_Capabilities *r)
7326 int level;
7327 level = ndr_print_get_switch_value(ndr, r);
7328 ndr_print_union(ndr, name, level, "netr_Capabilities");
7329 switch (level) {
7330 case 1:
7331 ndr_print_netr_NegotiateFlags(ndr, "server_capabilities", r->server_capabilities);
7332 break;
7334 default:
7335 ndr_print_bad_level(ndr, name, level);
7339 static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7341 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7342 return NDR_ERR_SUCCESS;
7345 static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7347 uint32_t v;
7348 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7349 *r = v;
7350 return NDR_ERR_SUCCESS;
7353 _PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7355 ndr_print_uint32(ndr, name, r);
7356 ndr->depth++;
7357 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
7358 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
7359 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
7360 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
7361 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
7362 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
7363 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5, r);
7364 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES, r);
7365 ndr->depth--;
7368 static enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
7370 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
7371 return NDR_ERR_SUCCESS;
7374 static enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
7376 uint32_t v;
7377 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
7378 *r = v;
7379 return NDR_ERR_SUCCESS;
7382 _PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r)
7384 ndr_print_uint32(ndr, name, r);
7385 ndr->depth++;
7386 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS, r);
7387 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE, r);
7388 ndr->depth--;
7391 static enum ndr_err_code ndr_push_netr_SuiteMask(struct ndr_push *ndr, int ndr_flags, uint16_t r)
7393 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
7394 return NDR_ERR_SUCCESS;
7397 static enum ndr_err_code ndr_pull_netr_SuiteMask(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
7399 uint16_t v;
7400 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
7401 *r = v;
7402 return NDR_ERR_SUCCESS;
7405 _PUBLIC_ void ndr_print_netr_SuiteMask(struct ndr_print *ndr, const char *name, uint16_t r)
7407 ndr_print_uint16(ndr, name, r);
7408 ndr->depth++;
7409 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_BACKOFFICE", NETR_VER_SUITE_BACKOFFICE, r);
7410 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_BLADE", NETR_VER_SUITE_BLADE, r);
7411 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_COMPUTE_SERVER", NETR_VER_SUITE_COMPUTE_SERVER, r);
7412 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_DATACENTER", NETR_VER_SUITE_DATACENTER, r);
7413 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_ENTERPRISE", NETR_VER_SUITE_ENTERPRISE, r);
7414 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_EMBEDDEDNT", NETR_VER_SUITE_EMBEDDEDNT, r);
7415 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_PERSONAL", NETR_VER_SUITE_PERSONAL, r);
7416 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SINGLEUSERTS", NETR_VER_SUITE_SINGLEUSERTS, r);
7417 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SMALLBUSINESS", NETR_VER_SUITE_SMALLBUSINESS, r);
7418 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED", NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED, r);
7419 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_STORAGE_SERVER", NETR_VER_SUITE_STORAGE_SERVER, r);
7420 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_TERMINAL", NETR_VER_SUITE_TERMINAL, r);
7421 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_VER_SUITE_WH_SERVER", NETR_VER_SUITE_WH_SERVER, r);
7422 ndr->depth--;
7425 static enum ndr_err_code ndr_push_netr_ProductType(struct ndr_push *ndr, int ndr_flags, uint8_t r)
7427 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
7428 return NDR_ERR_SUCCESS;
7431 static enum ndr_err_code ndr_pull_netr_ProductType(struct ndr_pull *ndr, int ndr_flags, uint8_t *r)
7433 uint8_t v;
7434 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
7435 *r = v;
7436 return NDR_ERR_SUCCESS;
7439 _PUBLIC_ void ndr_print_netr_ProductType(struct ndr_print *ndr, const char *name, uint8_t r)
7441 ndr_print_uint8(ndr, name, r);
7442 ndr->depth++;
7443 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_DOMAIN_CONTROLLER", NETR_VER_NT_DOMAIN_CONTROLLER, r);
7444 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_SERVER", NETR_VER_NT_SERVER, r);
7445 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "NETR_VER_NT_WORKSTATION", NETR_VER_NT_WORKSTATION, r);
7446 ndr->depth--;
7449 static enum ndr_err_code ndr_push_netr_LsaPolicyInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_LsaPolicyInformation *r)
7451 if (ndr_flags & NDR_SCALARS) {
7452 NDR_CHECK(ndr_push_align(ndr, 5));
7453 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size));
7454 NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
7455 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7457 if (ndr_flags & NDR_BUFFERS) {
7458 if (r->policy) {
7459 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->policy_size));
7460 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->policy, r->policy_size));
7463 return NDR_ERR_SUCCESS;
7466 static enum ndr_err_code ndr_pull_netr_LsaPolicyInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_LsaPolicyInformation *r)
7468 uint32_t _ptr_policy;
7469 TALLOC_CTX *_mem_save_policy_0;
7470 if (ndr_flags & NDR_SCALARS) {
7471 NDR_CHECK(ndr_pull_align(ndr, 5));
7472 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->policy_size));
7473 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy));
7474 if (_ptr_policy) {
7475 NDR_PULL_ALLOC(ndr, r->policy);
7476 } else {
7477 r->policy = NULL;
7479 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7481 if (ndr_flags & NDR_BUFFERS) {
7482 if (r->policy) {
7483 _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
7484 NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0);
7485 NDR_CHECK(ndr_pull_array_size(ndr, &r->policy));
7486 NDR_PULL_ALLOC_N(ndr, r->policy, ndr_get_array_size(ndr, &r->policy));
7487 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->policy, ndr_get_array_size(ndr, &r->policy)));
7488 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0);
7490 if (r->policy) {
7491 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->policy, r->policy_size));
7494 return NDR_ERR_SUCCESS;
7497 _PUBLIC_ void ndr_print_netr_LsaPolicyInformation(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInformation *r)
7499 ndr_print_struct(ndr, name, "netr_LsaPolicyInformation");
7500 ndr->depth++;
7501 ndr_print_uint32(ndr, "policy_size", r->policy_size);
7502 ndr_print_ptr(ndr, "policy", r->policy);
7503 ndr->depth++;
7504 if (r->policy) {
7505 ndr_print_array_uint8(ndr, "policy", r->policy, r->policy_size);
7507 ndr->depth--;
7508 ndr->depth--;
7511 static enum ndr_err_code ndr_push_netr_OsVersionInfoEx(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersionInfoEx *r)
7513 if (ndr_flags & NDR_SCALARS) {
7514 NDR_CHECK(ndr_push_align(ndr, 4));
7515 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 284));
7516 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MajorVersion));
7517 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MinorVersion));
7518 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->BuildNumber));
7519 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->PlatformId));
7521 uint32_t _flags_save_string = ndr->flags;
7522 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
7524 struct ndr_push *_ndr_CSDVersion;
7525 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_CSDVersion, 0, 256));
7526 NDR_CHECK(ndr_push_string(_ndr_CSDVersion, NDR_SCALARS, r->CSDVersion));
7527 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_CSDVersion, 0, 256));
7529 ndr->flags = _flags_save_string;
7531 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ServicePackMajor));
7532 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ServicePackMinor));
7533 NDR_CHECK(ndr_push_netr_SuiteMask(ndr, NDR_SCALARS, r->SuiteMask));
7534 NDR_CHECK(ndr_push_netr_ProductType(ndr, NDR_SCALARS, r->ProductType));
7535 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Reserved));
7536 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
7538 if (ndr_flags & NDR_BUFFERS) {
7540 return NDR_ERR_SUCCESS;
7543 static enum ndr_err_code ndr_pull_netr_OsVersionInfoEx(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersionInfoEx *r)
7545 if (ndr_flags & NDR_SCALARS) {
7546 NDR_CHECK(ndr_pull_align(ndr, 4));
7547 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->OSVersionInfoSize));
7548 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MajorVersion));
7549 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MinorVersion));
7550 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->BuildNumber));
7551 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->PlatformId));
7553 uint32_t _flags_save_string = ndr->flags;
7554 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
7556 struct ndr_pull *_ndr_CSDVersion;
7557 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_CSDVersion, 0, 256));
7558 NDR_CHECK(ndr_pull_string(_ndr_CSDVersion, NDR_SCALARS, &r->CSDVersion));
7559 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_CSDVersion, 0, 256));
7561 ndr->flags = _flags_save_string;
7563 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ServicePackMajor));
7564 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ServicePackMinor));
7565 NDR_CHECK(ndr_pull_netr_SuiteMask(ndr, NDR_SCALARS, &r->SuiteMask));
7566 NDR_CHECK(ndr_pull_netr_ProductType(ndr, NDR_SCALARS, &r->ProductType));
7567 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Reserved));
7568 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
7570 if (ndr_flags & NDR_BUFFERS) {
7572 return NDR_ERR_SUCCESS;
7575 _PUBLIC_ void ndr_print_netr_OsVersionInfoEx(struct ndr_print *ndr, const char *name, const struct netr_OsVersionInfoEx *r)
7577 ndr_print_struct(ndr, name, "netr_OsVersionInfoEx");
7578 ndr->depth++;
7579 ndr_print_uint32(ndr, "OSVersionInfoSize", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?284:r->OSVersionInfoSize);
7580 ndr_print_uint32(ndr, "MajorVersion", r->MajorVersion);
7581 ndr_print_uint32(ndr, "MinorVersion", r->MinorVersion);
7582 ndr_print_uint32(ndr, "BuildNumber", r->BuildNumber);
7583 ndr_print_uint32(ndr, "PlatformId", r->PlatformId);
7584 ndr_print_string(ndr, "CSDVersion", r->CSDVersion);
7585 ndr_print_uint16(ndr, "ServicePackMajor", r->ServicePackMajor);
7586 ndr_print_uint16(ndr, "ServicePackMinor", r->ServicePackMinor);
7587 ndr_print_netr_SuiteMask(ndr, "SuiteMask", r->SuiteMask);
7588 ndr_print_netr_ProductType(ndr, "ProductType", r->ProductType);
7589 ndr_print_uint8(ndr, "Reserved", r->Reserved);
7590 ndr->depth--;
7593 static enum ndr_err_code ndr_push_netr_OsVersion(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersion *r)
7595 if (ndr_flags & NDR_SCALARS) {
7596 NDR_CHECK(ndr_push_align(ndr, 4));
7597 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 142));
7598 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
7599 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 142));
7600 NDR_CHECK(ndr_push_netr_OsVersionInfoEx(ndr, NDR_SCALARS, &r->os));
7601 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
7603 if (ndr_flags & NDR_BUFFERS) {
7605 return NDR_ERR_SUCCESS;
7608 static enum ndr_err_code ndr_pull_netr_OsVersion(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersion *r)
7610 if (ndr_flags & NDR_SCALARS) {
7611 NDR_CHECK(ndr_pull_align(ndr, 4));
7612 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
7613 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
7614 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
7615 NDR_CHECK(ndr_pull_netr_OsVersionInfoEx(ndr, NDR_SCALARS, &r->os));
7616 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
7618 if (ndr_flags & NDR_BUFFERS) {
7620 return NDR_ERR_SUCCESS;
7623 _PUBLIC_ void ndr_print_netr_OsVersion(struct ndr_print *ndr, const char *name, const struct netr_OsVersion *r)
7625 ndr_print_struct(ndr, name, "netr_OsVersion");
7626 ndr->depth++;
7627 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?142:r->length);
7628 ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy);
7629 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?142:r->size);
7630 ndr_print_netr_OsVersionInfoEx(ndr, "os", &r->os);
7631 ndr->depth--;
7634 static enum ndr_err_code ndr_push_netr_OsVersionContainer(struct ndr_push *ndr, int ndr_flags, const struct netr_OsVersionContainer *r)
7636 if (ndr_flags & NDR_SCALARS) {
7637 NDR_CHECK(ndr_push_align(ndr, 5));
7638 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->os == NULL?0:284));
7639 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->os == NULL?0:284));
7640 NDR_CHECK(ndr_push_unique_ptr(ndr, r->os));
7641 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7643 if (ndr_flags & NDR_BUFFERS) {
7644 if (r->os) {
7645 NDR_CHECK(ndr_push_netr_OsVersion(ndr, NDR_SCALARS, r->os));
7648 return NDR_ERR_SUCCESS;
7651 static enum ndr_err_code ndr_pull_netr_OsVersionContainer(struct ndr_pull *ndr, int ndr_flags, struct netr_OsVersionContainer *r)
7653 uint32_t _ptr_os;
7654 TALLOC_CTX *_mem_save_os_0;
7655 if (ndr_flags & NDR_SCALARS) {
7656 NDR_CHECK(ndr_pull_align(ndr, 5));
7657 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
7658 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
7659 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_os));
7660 if (_ptr_os) {
7661 NDR_PULL_ALLOC(ndr, r->os);
7662 } else {
7663 r->os = NULL;
7665 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7667 if (ndr_flags & NDR_BUFFERS) {
7668 if (r->os) {
7669 _mem_save_os_0 = NDR_PULL_GET_MEM_CTX(ndr);
7670 NDR_PULL_SET_MEM_CTX(ndr, r->os, 0);
7671 NDR_CHECK(ndr_pull_netr_OsVersion(ndr, NDR_SCALARS, r->os));
7672 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_os_0, 0);
7675 return NDR_ERR_SUCCESS;
7678 _PUBLIC_ void ndr_print_netr_OsVersionContainer(struct ndr_print *ndr, const char *name, const struct netr_OsVersionContainer *r)
7680 ndr_print_struct(ndr, name, "netr_OsVersionContainer");
7681 ndr->depth++;
7682 ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->os == NULL?0:284:r->length);
7683 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->os == NULL?0:284:r->size);
7684 ndr_print_ptr(ndr, "os", r->os);
7685 ndr->depth++;
7686 if (r->os) {
7687 ndr_print_netr_OsVersion(ndr, "os", r->os);
7689 ndr->depth--;
7690 ndr->depth--;
7693 static enum ndr_err_code ndr_push_netr_WorkstationInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_WorkstationInformation *r)
7695 if (ndr_flags & NDR_SCALARS) {
7696 NDR_CHECK(ndr_push_align(ndr, 5));
7697 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
7698 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_hostname));
7699 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
7700 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy1));
7701 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy2));
7702 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy3));
7703 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dummy4));
7704 NDR_CHECK(ndr_push_netr_OsVersionContainer(ndr, NDR_SCALARS, &r->os_version));
7705 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->os_name));
7706 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummy_string3));
7707 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummy_string4));
7708 NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags));
7709 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long2));
7710 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
7711 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
7712 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
7714 if (ndr_flags & NDR_BUFFERS) {
7715 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
7716 if (r->dns_hostname) {
7717 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_hostname, CH_UTF16)));
7718 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7719 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_hostname, CH_UTF16)));
7720 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_hostname, ndr_charset_length(r->dns_hostname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7722 if (r->sitename) {
7723 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->sitename, CH_UTF16)));
7724 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7725 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->sitename, CH_UTF16)));
7726 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->sitename, ndr_charset_length(r->sitename, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7728 if (r->dummy1) {
7729 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy1, CH_UTF16)));
7730 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7731 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy1, CH_UTF16)));
7732 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy1, ndr_charset_length(r->dummy1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7734 if (r->dummy2) {
7735 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy2, CH_UTF16)));
7736 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7737 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy2, CH_UTF16)));
7738 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy2, ndr_charset_length(r->dummy2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7740 if (r->dummy3) {
7741 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy3, CH_UTF16)));
7742 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7743 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy3, CH_UTF16)));
7744 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy3, ndr_charset_length(r->dummy3, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7746 if (r->dummy4) {
7747 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy4, CH_UTF16)));
7748 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7749 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dummy4, CH_UTF16)));
7750 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dummy4, ndr_charset_length(r->dummy4, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7752 NDR_CHECK(ndr_push_netr_OsVersionContainer(ndr, NDR_BUFFERS, &r->os_version));
7753 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->os_name));
7754 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string3));
7755 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string4));
7757 return NDR_ERR_SUCCESS;
7760 static enum ndr_err_code ndr_pull_netr_WorkstationInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_WorkstationInformation *r)
7762 uint32_t _ptr_dns_hostname;
7763 TALLOC_CTX *_mem_save_dns_hostname_0;
7764 uint32_t _ptr_sitename;
7765 TALLOC_CTX *_mem_save_sitename_0;
7766 uint32_t _ptr_dummy1;
7767 TALLOC_CTX *_mem_save_dummy1_0;
7768 uint32_t _ptr_dummy2;
7769 TALLOC_CTX *_mem_save_dummy2_0;
7770 uint32_t _ptr_dummy3;
7771 TALLOC_CTX *_mem_save_dummy3_0;
7772 uint32_t _ptr_dummy4;
7773 TALLOC_CTX *_mem_save_dummy4_0;
7774 if (ndr_flags & NDR_SCALARS) {
7775 NDR_CHECK(ndr_pull_align(ndr, 5));
7776 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
7777 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_hostname));
7778 if (_ptr_dns_hostname) {
7779 NDR_PULL_ALLOC(ndr, r->dns_hostname);
7780 } else {
7781 r->dns_hostname = NULL;
7783 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
7784 if (_ptr_sitename) {
7785 NDR_PULL_ALLOC(ndr, r->sitename);
7786 } else {
7787 r->sitename = NULL;
7789 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy1));
7790 if (_ptr_dummy1) {
7791 NDR_PULL_ALLOC(ndr, r->dummy1);
7792 } else {
7793 r->dummy1 = NULL;
7795 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy2));
7796 if (_ptr_dummy2) {
7797 NDR_PULL_ALLOC(ndr, r->dummy2);
7798 } else {
7799 r->dummy2 = NULL;
7801 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy3));
7802 if (_ptr_dummy3) {
7803 NDR_PULL_ALLOC(ndr, r->dummy3);
7804 } else {
7805 r->dummy3 = NULL;
7807 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dummy4));
7808 if (_ptr_dummy4) {
7809 NDR_PULL_ALLOC(ndr, r->dummy4);
7810 } else {
7811 r->dummy4 = NULL;
7813 NDR_CHECK(ndr_pull_netr_OsVersionContainer(ndr, NDR_SCALARS, &r->os_version));
7814 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->os_name));
7815 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummy_string3));
7816 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummy_string4));
7817 NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags));
7818 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long2));
7819 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
7820 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
7821 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
7823 if (ndr_flags & NDR_BUFFERS) {
7824 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
7825 if (r->dns_hostname) {
7826 _mem_save_dns_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
7827 NDR_PULL_SET_MEM_CTX(ndr, r->dns_hostname, 0);
7828 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_hostname));
7829 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_hostname));
7830 if (ndr_get_array_length(ndr, &r->dns_hostname) > ndr_get_array_size(ndr, &r->dns_hostname)) {
7831 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_hostname), ndr_get_array_length(ndr, &r->dns_hostname));
7833 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_hostname), sizeof(uint16_t)));
7834 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_hostname, ndr_get_array_length(ndr, &r->dns_hostname), sizeof(uint16_t), CH_UTF16));
7835 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_hostname_0, 0);
7837 if (r->sitename) {
7838 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
7839 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
7840 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
7841 NDR_CHECK(ndr_pull_array_length(ndr, &r->sitename));
7842 if (ndr_get_array_length(ndr, &r->sitename) > ndr_get_array_size(ndr, &r->sitename)) {
7843 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->sitename), ndr_get_array_length(ndr, &r->sitename));
7845 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->sitename), sizeof(uint16_t)));
7846 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->sitename, ndr_get_array_length(ndr, &r->sitename), sizeof(uint16_t), CH_UTF16));
7847 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
7849 if (r->dummy1) {
7850 _mem_save_dummy1_0 = NDR_PULL_GET_MEM_CTX(ndr);
7851 NDR_PULL_SET_MEM_CTX(ndr, r->dummy1, 0);
7852 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy1));
7853 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy1));
7854 if (ndr_get_array_length(ndr, &r->dummy1) > ndr_get_array_size(ndr, &r->dummy1)) {
7855 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dummy1), ndr_get_array_length(ndr, &r->dummy1));
7857 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dummy1), sizeof(uint16_t)));
7858 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy1, ndr_get_array_length(ndr, &r->dummy1), sizeof(uint16_t), CH_UTF16));
7859 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy1_0, 0);
7861 if (r->dummy2) {
7862 _mem_save_dummy2_0 = NDR_PULL_GET_MEM_CTX(ndr);
7863 NDR_PULL_SET_MEM_CTX(ndr, r->dummy2, 0);
7864 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy2));
7865 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy2));
7866 if (ndr_get_array_length(ndr, &r->dummy2) > ndr_get_array_size(ndr, &r->dummy2)) {
7867 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dummy2), ndr_get_array_length(ndr, &r->dummy2));
7869 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dummy2), sizeof(uint16_t)));
7870 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy2, ndr_get_array_length(ndr, &r->dummy2), sizeof(uint16_t), CH_UTF16));
7871 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy2_0, 0);
7873 if (r->dummy3) {
7874 _mem_save_dummy3_0 = NDR_PULL_GET_MEM_CTX(ndr);
7875 NDR_PULL_SET_MEM_CTX(ndr, r->dummy3, 0);
7876 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy3));
7877 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy3));
7878 if (ndr_get_array_length(ndr, &r->dummy3) > ndr_get_array_size(ndr, &r->dummy3)) {
7879 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dummy3), ndr_get_array_length(ndr, &r->dummy3));
7881 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dummy3), sizeof(uint16_t)));
7882 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy3, ndr_get_array_length(ndr, &r->dummy3), sizeof(uint16_t), CH_UTF16));
7883 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy3_0, 0);
7885 if (r->dummy4) {
7886 _mem_save_dummy4_0 = NDR_PULL_GET_MEM_CTX(ndr);
7887 NDR_PULL_SET_MEM_CTX(ndr, r->dummy4, 0);
7888 NDR_CHECK(ndr_pull_array_size(ndr, &r->dummy4));
7889 NDR_CHECK(ndr_pull_array_length(ndr, &r->dummy4));
7890 if (ndr_get_array_length(ndr, &r->dummy4) > ndr_get_array_size(ndr, &r->dummy4)) {
7891 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dummy4), ndr_get_array_length(ndr, &r->dummy4));
7893 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dummy4), sizeof(uint16_t)));
7894 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dummy4, ndr_get_array_length(ndr, &r->dummy4), sizeof(uint16_t), CH_UTF16));
7895 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dummy4_0, 0);
7897 NDR_CHECK(ndr_pull_netr_OsVersionContainer(ndr, NDR_BUFFERS, &r->os_version));
7898 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->os_name));
7899 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string3));
7900 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummy_string4));
7902 return NDR_ERR_SUCCESS;
7905 _PUBLIC_ void ndr_print_netr_WorkstationInformation(struct ndr_print *ndr, const char *name, const struct netr_WorkstationInformation *r)
7907 ndr_print_struct(ndr, name, "netr_WorkstationInformation");
7908 ndr->depth++;
7909 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy", &r->lsa_policy);
7910 ndr_print_ptr(ndr, "dns_hostname", r->dns_hostname);
7911 ndr->depth++;
7912 if (r->dns_hostname) {
7913 ndr_print_string(ndr, "dns_hostname", r->dns_hostname);
7915 ndr->depth--;
7916 ndr_print_ptr(ndr, "sitename", r->sitename);
7917 ndr->depth++;
7918 if (r->sitename) {
7919 ndr_print_string(ndr, "sitename", r->sitename);
7921 ndr->depth--;
7922 ndr_print_ptr(ndr, "dummy1", r->dummy1);
7923 ndr->depth++;
7924 if (r->dummy1) {
7925 ndr_print_string(ndr, "dummy1", r->dummy1);
7927 ndr->depth--;
7928 ndr_print_ptr(ndr, "dummy2", r->dummy2);
7929 ndr->depth++;
7930 if (r->dummy2) {
7931 ndr_print_string(ndr, "dummy2", r->dummy2);
7933 ndr->depth--;
7934 ndr_print_ptr(ndr, "dummy3", r->dummy3);
7935 ndr->depth++;
7936 if (r->dummy3) {
7937 ndr_print_string(ndr, "dummy3", r->dummy3);
7939 ndr->depth--;
7940 ndr_print_ptr(ndr, "dummy4", r->dummy4);
7941 ndr->depth++;
7942 if (r->dummy4) {
7943 ndr_print_string(ndr, "dummy4", r->dummy4);
7945 ndr->depth--;
7946 ndr_print_netr_OsVersionContainer(ndr, "os_version", &r->os_version);
7947 ndr_print_lsa_String(ndr, "os_name", &r->os_name);
7948 ndr_print_lsa_String(ndr, "dummy_string3", &r->dummy_string3);
7949 ndr_print_lsa_String(ndr, "dummy_string4", &r->dummy_string4);
7950 ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags);
7951 ndr_print_uint32(ndr, "dummy_long2", r->dummy_long2);
7952 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
7953 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
7954 ndr->depth--;
7957 static enum ndr_err_code ndr_push_netr_WorkstationInfo(struct ndr_push *ndr, int ndr_flags, const union netr_WorkstationInfo *r)
7959 if (ndr_flags & NDR_SCALARS) {
7960 int level = ndr_push_get_switch_value(ndr, r);
7961 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
7962 NDR_CHECK(ndr_push_union_align(ndr, 5));
7963 switch (level) {
7964 case 1: {
7965 NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_info));
7966 break; }
7968 case 2: {
7969 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lsa_policy_info));
7970 break; }
7972 default:
7973 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7976 if (ndr_flags & NDR_BUFFERS) {
7977 int level = ndr_push_get_switch_value(ndr, r);
7978 switch (level) {
7979 case 1:
7980 if (r->workstation_info) {
7981 NDR_CHECK(ndr_push_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->workstation_info));
7983 break;
7985 case 2:
7986 if (r->lsa_policy_info) {
7987 NDR_CHECK(ndr_push_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
7989 break;
7991 default:
7992 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
7995 return NDR_ERR_SUCCESS;
7998 static enum ndr_err_code ndr_pull_netr_WorkstationInfo(struct ndr_pull *ndr, int ndr_flags, union netr_WorkstationInfo *r)
8000 int level;
8001 uint32_t _level;
8002 TALLOC_CTX *_mem_save_workstation_info_0;
8003 TALLOC_CTX *_mem_save_lsa_policy_info_0;
8004 level = ndr_pull_get_switch_value(ndr, r);
8005 if (ndr_flags & NDR_SCALARS) {
8006 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8007 if (_level != level) {
8008 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8010 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8011 switch (level) {
8012 case 1: {
8013 uint32_t _ptr_workstation_info;
8014 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_info));
8015 if (_ptr_workstation_info) {
8016 NDR_PULL_ALLOC(ndr, r->workstation_info);
8017 } else {
8018 r->workstation_info = NULL;
8020 break; }
8022 case 2: {
8023 uint32_t _ptr_lsa_policy_info;
8024 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lsa_policy_info));
8025 if (_ptr_lsa_policy_info) {
8026 NDR_PULL_ALLOC(ndr, r->lsa_policy_info);
8027 } else {
8028 r->lsa_policy_info = NULL;
8030 break; }
8032 default:
8033 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8036 if (ndr_flags & NDR_BUFFERS) {
8037 switch (level) {
8038 case 1:
8039 if (r->workstation_info) {
8040 _mem_save_workstation_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8041 NDR_PULL_SET_MEM_CTX(ndr, r->workstation_info, 0);
8042 NDR_CHECK(ndr_pull_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->workstation_info));
8043 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_info_0, 0);
8045 break;
8047 case 2:
8048 if (r->lsa_policy_info) {
8049 _mem_save_lsa_policy_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8050 NDR_PULL_SET_MEM_CTX(ndr, r->lsa_policy_info, 0);
8051 NDR_CHECK(ndr_pull_netr_WorkstationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8052 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lsa_policy_info_0, 0);
8054 break;
8056 default:
8057 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8060 return NDR_ERR_SUCCESS;
8063 _PUBLIC_ void ndr_print_netr_WorkstationInfo(struct ndr_print *ndr, const char *name, const union netr_WorkstationInfo *r)
8065 int level;
8066 level = ndr_print_get_switch_value(ndr, r);
8067 ndr_print_union(ndr, name, level, "netr_WorkstationInfo");
8068 switch (level) {
8069 case 1:
8070 ndr_print_ptr(ndr, "workstation_info", r->workstation_info);
8071 ndr->depth++;
8072 if (r->workstation_info) {
8073 ndr_print_netr_WorkstationInformation(ndr, "workstation_info", r->workstation_info);
8075 ndr->depth--;
8076 break;
8078 case 2:
8079 ndr_print_ptr(ndr, "lsa_policy_info", r->lsa_policy_info);
8080 ndr->depth++;
8081 if (r->lsa_policy_info) {
8082 ndr_print_netr_WorkstationInformation(ndr, "lsa_policy_info", r->lsa_policy_info);
8084 ndr->depth--;
8085 break;
8087 default:
8088 ndr_print_bad_level(ndr, name, level);
8092 static enum ndr_err_code ndr_push_netr_trust_extension(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension *r)
8094 if (ndr_flags & NDR_SCALARS) {
8095 NDR_CHECK(ndr_push_align(ndr, 4));
8096 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
8097 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8098 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
8099 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->flags));
8100 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index));
8101 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type));
8102 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes));
8103 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
8105 if (ndr_flags & NDR_BUFFERS) {
8107 return NDR_ERR_SUCCESS;
8110 static enum ndr_err_code ndr_pull_netr_trust_extension(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension *r)
8112 if (ndr_flags & NDR_SCALARS) {
8113 NDR_CHECK(ndr_pull_align(ndr, 4));
8114 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
8115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
8116 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
8117 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->flags));
8118 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index));
8119 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type));
8120 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes));
8121 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
8123 if (ndr_flags & NDR_BUFFERS) {
8125 return NDR_ERR_SUCCESS;
8128 _PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r)
8130 ndr_print_struct(ndr, name, "netr_trust_extension");
8131 ndr->depth++;
8132 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->length);
8133 ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy);
8134 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->size);
8135 ndr_print_netr_TrustFlags(ndr, "flags", r->flags);
8136 ndr_print_uint32(ndr, "parent_index", r->parent_index);
8137 ndr_print_uint32(ndr, "trust_type", r->trust_type);
8138 ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes);
8139 ndr->depth--;
8142 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)
8144 if (ndr_flags & NDR_SCALARS) {
8145 NDR_CHECK(ndr_push_align(ndr, 5));
8146 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
8147 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
8148 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
8149 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8151 if (ndr_flags & NDR_BUFFERS) {
8152 if (r->info) {
8153 NDR_CHECK(ndr_push_netr_trust_extension(ndr, NDR_SCALARS, r->info));
8156 return NDR_ERR_SUCCESS;
8159 static enum ndr_err_code ndr_pull_netr_trust_extension_container(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension_container *r)
8161 uint32_t _ptr_info;
8162 TALLOC_CTX *_mem_save_info_0;
8163 if (ndr_flags & NDR_SCALARS) {
8164 NDR_CHECK(ndr_pull_align(ndr, 5));
8165 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
8166 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
8167 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
8168 if (_ptr_info) {
8169 NDR_PULL_ALLOC(ndr, r->info);
8170 } else {
8171 r->info = NULL;
8173 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8175 if (ndr_flags & NDR_BUFFERS) {
8176 if (r->info) {
8177 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8178 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
8179 NDR_CHECK(ndr_pull_netr_trust_extension(ndr, NDR_SCALARS, r->info));
8180 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
8183 return NDR_ERR_SUCCESS;
8186 _PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r)
8188 ndr_print_struct(ndr, name, "netr_trust_extension_container");
8189 ndr->depth++;
8190 ndr_print_uint16(ndr, "length", r->length);
8191 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
8192 ndr_print_ptr(ndr, "info", r->info);
8193 ndr->depth++;
8194 if (r->info) {
8195 ndr_print_netr_trust_extension(ndr, "info", r->info);
8197 ndr->depth--;
8198 ndr->depth--;
8201 static enum ndr_err_code ndr_push_netr_OneDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_OneDomainInfo *r)
8203 if (ndr_flags & NDR_SCALARS) {
8204 NDR_CHECK(ndr_push_align(ndr, 5));
8205 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domainname));
8206 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domainname));
8207 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forestname));
8208 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
8209 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
8210 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
8211 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8212 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8213 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8214 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long1));
8215 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long2));
8216 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
8217 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
8218 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8220 if (ndr_flags & NDR_BUFFERS) {
8221 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domainname));
8222 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domainname));
8223 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forestname));
8224 if (r->domain_sid) {
8225 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
8227 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
8228 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8229 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8230 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8232 return NDR_ERR_SUCCESS;
8235 static enum ndr_err_code ndr_pull_netr_OneDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_OneDomainInfo *r)
8237 uint32_t _ptr_domain_sid;
8238 TALLOC_CTX *_mem_save_domain_sid_0;
8239 if (ndr_flags & NDR_SCALARS) {
8240 NDR_CHECK(ndr_pull_align(ndr, 5));
8241 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domainname));
8242 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domainname));
8243 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forestname));
8244 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
8245 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
8246 if (_ptr_domain_sid) {
8247 NDR_PULL_ALLOC(ndr, r->domain_sid);
8248 } else {
8249 r->domain_sid = NULL;
8251 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
8252 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8253 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8254 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8255 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long1));
8256 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long2));
8257 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
8258 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
8259 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8261 if (ndr_flags & NDR_BUFFERS) {
8262 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domainname));
8263 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domainname));
8264 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forestname));
8265 if (r->domain_sid) {
8266 _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
8267 NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
8268 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
8269 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
8271 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
8272 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8273 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8274 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8276 return NDR_ERR_SUCCESS;
8279 _PUBLIC_ void ndr_print_netr_OneDomainInfo(struct ndr_print *ndr, const char *name, const struct netr_OneDomainInfo *r)
8281 ndr_print_struct(ndr, name, "netr_OneDomainInfo");
8282 ndr->depth++;
8283 ndr_print_lsa_StringLarge(ndr, "domainname", &r->domainname);
8284 ndr_print_lsa_StringLarge(ndr, "dns_domainname", &r->dns_domainname);
8285 ndr_print_lsa_StringLarge(ndr, "dns_forestname", &r->dns_forestname);
8286 ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
8287 ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
8288 ndr->depth++;
8289 if (r->domain_sid) {
8290 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
8292 ndr->depth--;
8293 ndr_print_netr_trust_extension_container(ndr, "trust_extension", &r->trust_extension);
8294 ndr_print_lsa_StringLarge(ndr, "dummy_string2", &r->dummy_string2);
8295 ndr_print_lsa_StringLarge(ndr, "dummy_string3", &r->dummy_string3);
8296 ndr_print_lsa_StringLarge(ndr, "dummy_string4", &r->dummy_string4);
8297 ndr_print_uint32(ndr, "dummy_long1", r->dummy_long1);
8298 ndr_print_uint32(ndr, "dummy_long2", r->dummy_long2);
8299 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
8300 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
8301 ndr->depth--;
8304 _PUBLIC_ enum ndr_err_code ndr_push_netr_SupportedEncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
8306 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8307 return NDR_ERR_SUCCESS;
8310 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SupportedEncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
8312 uint32_t v;
8313 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8314 *r = v;
8315 return NDR_ERR_SUCCESS;
8318 _PUBLIC_ void ndr_print_netr_SupportedEncTypes(struct ndr_print *ndr, const char *name, uint32_t r)
8320 ndr_print_uint32(ndr, name, r);
8321 ndr->depth++;
8322 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_CRC32", ENC_CRC32, r);
8323 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_RSA_MD5", ENC_RSA_MD5, r);
8324 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_RC4_HMAC_MD5", ENC_RC4_HMAC_MD5, r);
8325 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_HMAC_SHA1_96_AES128", ENC_HMAC_SHA1_96_AES128, r);
8326 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ENC_HMAC_SHA1_96_AES256", ENC_HMAC_SHA1_96_AES256, r);
8327 ndr->depth--;
8330 static enum ndr_err_code ndr_push_netr_DomainInformation(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInformation *r)
8332 uint32_t cntr_trusted_domains_1;
8333 if (ndr_flags & NDR_SCALARS) {
8334 NDR_CHECK(ndr_push_align(ndr, 5));
8335 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->primary_domain));
8336 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trusted_domain_count));
8337 NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domains));
8338 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
8339 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_hostname));
8340 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8341 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8342 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8343 NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags));
8344 NDR_CHECK(ndr_push_netr_SupportedEncTypes(ndr, NDR_SCALARS, r->supported_enc_types));
8345 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long3));
8346 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy_long4));
8347 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8349 if (ndr_flags & NDR_BUFFERS) {
8350 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->primary_domain));
8351 if (r->trusted_domains) {
8352 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->trusted_domain_count));
8353 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8354 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->trusted_domains[cntr_trusted_domains_1]));
8356 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8357 NDR_CHECK(ndr_push_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->trusted_domains[cntr_trusted_domains_1]));
8360 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
8361 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_hostname));
8362 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8363 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8364 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8366 return NDR_ERR_SUCCESS;
8369 static enum ndr_err_code ndr_pull_netr_DomainInformation(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInformation *r)
8371 uint32_t _ptr_trusted_domains;
8372 uint32_t cntr_trusted_domains_1;
8373 TALLOC_CTX *_mem_save_trusted_domains_0;
8374 TALLOC_CTX *_mem_save_trusted_domains_1;
8375 if (ndr_flags & NDR_SCALARS) {
8376 NDR_CHECK(ndr_pull_align(ndr, 5));
8377 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->primary_domain));
8378 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trusted_domain_count));
8379 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domains));
8380 if (_ptr_trusted_domains) {
8381 NDR_PULL_ALLOC(ndr, r->trusted_domains);
8382 } else {
8383 r->trusted_domains = NULL;
8385 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS, &r->lsa_policy));
8386 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_hostname));
8387 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string2));
8388 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string3));
8389 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dummy_string4));
8390 NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags));
8391 NDR_CHECK(ndr_pull_netr_SupportedEncTypes(ndr, NDR_SCALARS, &r->supported_enc_types));
8392 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long3));
8393 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy_long4));
8394 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8396 if (ndr_flags & NDR_BUFFERS) {
8397 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->primary_domain));
8398 if (r->trusted_domains) {
8399 _mem_save_trusted_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
8400 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domains, 0);
8401 NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_domains));
8402 NDR_PULL_ALLOC_N(ndr, r->trusted_domains, ndr_get_array_size(ndr, &r->trusted_domains));
8403 _mem_save_trusted_domains_1 = NDR_PULL_GET_MEM_CTX(ndr);
8404 NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domains, 0);
8405 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8406 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_SCALARS, &r->trusted_domains[cntr_trusted_domains_1]));
8408 for (cntr_trusted_domains_1 = 0; cntr_trusted_domains_1 < r->trusted_domain_count; cntr_trusted_domains_1++) {
8409 NDR_CHECK(ndr_pull_netr_OneDomainInfo(ndr, NDR_BUFFERS, &r->trusted_domains[cntr_trusted_domains_1]));
8411 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_1, 0);
8412 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_0, 0);
8414 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_BUFFERS, &r->lsa_policy));
8415 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_hostname));
8416 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string2));
8417 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string3));
8418 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dummy_string4));
8419 if (r->trusted_domains) {
8420 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusted_domains, r->trusted_domain_count));
8423 return NDR_ERR_SUCCESS;
8426 _PUBLIC_ void ndr_print_netr_DomainInformation(struct ndr_print *ndr, const char *name, const struct netr_DomainInformation *r)
8428 uint32_t cntr_trusted_domains_1;
8429 ndr_print_struct(ndr, name, "netr_DomainInformation");
8430 ndr->depth++;
8431 ndr_print_netr_OneDomainInfo(ndr, "primary_domain", &r->primary_domain);
8432 ndr_print_uint32(ndr, "trusted_domain_count", r->trusted_domain_count);
8433 ndr_print_ptr(ndr, "trusted_domains", r->trusted_domains);
8434 ndr->depth++;
8435 if (r->trusted_domains) {
8436 ndr->print(ndr, "%s: ARRAY(%d)", "trusted_domains", (int)r->trusted_domain_count);
8437 ndr->depth++;
8438 for (cntr_trusted_domains_1=0;cntr_trusted_domains_1<r->trusted_domain_count;cntr_trusted_domains_1++) {
8439 char *idx_1=NULL;
8440 if (asprintf(&idx_1, "[%d]", cntr_trusted_domains_1) != -1) {
8441 ndr_print_netr_OneDomainInfo(ndr, "trusted_domains", &r->trusted_domains[cntr_trusted_domains_1]);
8442 free(idx_1);
8445 ndr->depth--;
8447 ndr->depth--;
8448 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy", &r->lsa_policy);
8449 ndr_print_lsa_StringLarge(ndr, "dns_hostname", &r->dns_hostname);
8450 ndr_print_lsa_StringLarge(ndr, "dummy_string2", &r->dummy_string2);
8451 ndr_print_lsa_StringLarge(ndr, "dummy_string3", &r->dummy_string3);
8452 ndr_print_lsa_StringLarge(ndr, "dummy_string4", &r->dummy_string4);
8453 ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags);
8454 ndr_print_netr_SupportedEncTypes(ndr, "supported_enc_types", r->supported_enc_types);
8455 ndr_print_uint32(ndr, "dummy_long3", r->dummy_long3);
8456 ndr_print_uint32(ndr, "dummy_long4", r->dummy_long4);
8457 ndr->depth--;
8460 static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r)
8462 if (ndr_flags & NDR_SCALARS) {
8463 int level = ndr_push_get_switch_value(ndr, r);
8464 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
8465 NDR_CHECK(ndr_push_union_align(ndr, 5));
8466 switch (level) {
8467 case 1: {
8468 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_info));
8469 break; }
8471 case 2: {
8472 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lsa_policy_info));
8473 break; }
8475 default:
8476 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8479 if (ndr_flags & NDR_BUFFERS) {
8480 int level = ndr_push_get_switch_value(ndr, r);
8481 switch (level) {
8482 case 1:
8483 if (r->domain_info) {
8484 NDR_CHECK(ndr_push_netr_DomainInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_info));
8486 break;
8488 case 2:
8489 if (r->lsa_policy_info) {
8490 NDR_CHECK(ndr_push_netr_LsaPolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8492 break;
8494 default:
8495 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8498 return NDR_ERR_SUCCESS;
8501 static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r)
8503 int level;
8504 uint32_t _level;
8505 TALLOC_CTX *_mem_save_domain_info_0;
8506 TALLOC_CTX *_mem_save_lsa_policy_info_0;
8507 level = ndr_pull_get_switch_value(ndr, r);
8508 if (ndr_flags & NDR_SCALARS) {
8509 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8510 if (_level != level) {
8511 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8513 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8514 switch (level) {
8515 case 1: {
8516 uint32_t _ptr_domain_info;
8517 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_info));
8518 if (_ptr_domain_info) {
8519 NDR_PULL_ALLOC(ndr, r->domain_info);
8520 } else {
8521 r->domain_info = NULL;
8523 break; }
8525 case 2: {
8526 uint32_t _ptr_lsa_policy_info;
8527 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lsa_policy_info));
8528 if (_ptr_lsa_policy_info) {
8529 NDR_PULL_ALLOC(ndr, r->lsa_policy_info);
8530 } else {
8531 r->lsa_policy_info = NULL;
8533 break; }
8535 default:
8536 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8539 if (ndr_flags & NDR_BUFFERS) {
8540 switch (level) {
8541 case 1:
8542 if (r->domain_info) {
8543 _mem_save_domain_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8544 NDR_PULL_SET_MEM_CTX(ndr, r->domain_info, 0);
8545 NDR_CHECK(ndr_pull_netr_DomainInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_info));
8546 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_info_0, 0);
8548 break;
8550 case 2:
8551 if (r->lsa_policy_info) {
8552 _mem_save_lsa_policy_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8553 NDR_PULL_SET_MEM_CTX(ndr, r->lsa_policy_info, 0);
8554 NDR_CHECK(ndr_pull_netr_LsaPolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->lsa_policy_info));
8555 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lsa_policy_info_0, 0);
8557 break;
8559 default:
8560 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8563 return NDR_ERR_SUCCESS;
8566 _PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r)
8568 int level;
8569 level = ndr_print_get_switch_value(ndr, r);
8570 ndr_print_union(ndr, name, level, "netr_DomainInfo");
8571 switch (level) {
8572 case 1:
8573 ndr_print_ptr(ndr, "domain_info", r->domain_info);
8574 ndr->depth++;
8575 if (r->domain_info) {
8576 ndr_print_netr_DomainInformation(ndr, "domain_info", r->domain_info);
8578 ndr->depth--;
8579 break;
8581 case 2:
8582 ndr_print_ptr(ndr, "lsa_policy_info", r->lsa_policy_info);
8583 ndr->depth++;
8584 if (r->lsa_policy_info) {
8585 ndr_print_netr_LsaPolicyInformation(ndr, "lsa_policy_info", r->lsa_policy_info);
8587 ndr->depth--;
8588 break;
8590 default:
8591 ndr_print_bad_level(ndr, name, level);
8595 static enum ndr_err_code ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r)
8598 uint32_t _flags_save_STRUCT = ndr->flags;
8599 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8600 if (ndr_flags & NDR_SCALARS) {
8601 NDR_CHECK(ndr_push_align(ndr, 4));
8602 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 512));
8603 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
8604 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
8606 if (ndr_flags & NDR_BUFFERS) {
8608 ndr->flags = _flags_save_STRUCT;
8610 return NDR_ERR_SUCCESS;
8613 static enum ndr_err_code ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r)
8616 uint32_t _flags_save_STRUCT = ndr->flags;
8617 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8618 if (ndr_flags & NDR_SCALARS) {
8619 NDR_CHECK(ndr_pull_align(ndr, 4));
8620 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 512));
8621 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
8622 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
8624 if (ndr_flags & NDR_BUFFERS) {
8626 ndr->flags = _flags_save_STRUCT;
8628 return NDR_ERR_SUCCESS;
8631 _PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r)
8633 ndr_print_struct(ndr, name, "netr_CryptPassword");
8635 uint32_t _flags_save_STRUCT = ndr->flags;
8636 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
8637 ndr->depth++;
8638 ndr_print_array_uint8(ndr, "data", r->data, 512);
8639 ndr_print_uint32(ndr, "length", r->length);
8640 ndr->depth--;
8641 ndr->flags = _flags_save_STRUCT;
8645 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r)
8647 uint32_t cntr_sitename_1;
8648 if (ndr_flags & NDR_SCALARS) {
8649 NDR_CHECK(ndr_push_align(ndr, 5));
8650 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8651 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
8652 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8654 if (ndr_flags & NDR_BUFFERS) {
8655 if (r->sitename) {
8656 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
8657 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8658 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
8660 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8661 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
8665 return NDR_ERR_SUCCESS;
8668 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r)
8670 uint32_t _ptr_sitename;
8671 uint32_t cntr_sitename_1;
8672 TALLOC_CTX *_mem_save_sitename_0;
8673 TALLOC_CTX *_mem_save_sitename_1;
8674 if (ndr_flags & NDR_SCALARS) {
8675 NDR_CHECK(ndr_pull_align(ndr, 5));
8676 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8677 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
8678 if (_ptr_sitename) {
8679 NDR_PULL_ALLOC(ndr, r->sitename);
8680 } else {
8681 r->sitename = NULL;
8683 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8685 if (ndr_flags & NDR_BUFFERS) {
8686 if (r->sitename) {
8687 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
8688 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
8689 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
8690 NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename));
8691 _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
8692 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
8693 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8694 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
8696 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
8697 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
8699 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
8700 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
8702 if (r->sitename) {
8703 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
8706 return NDR_ERR_SUCCESS;
8709 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r)
8711 uint32_t cntr_sitename_1;
8712 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr");
8713 ndr->depth++;
8714 ndr_print_uint32(ndr, "count", r->count);
8715 ndr_print_ptr(ndr, "sitename", r->sitename);
8716 ndr->depth++;
8717 if (r->sitename) {
8718 ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count);
8719 ndr->depth++;
8720 for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
8721 char *idx_1=NULL;
8722 if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) {
8723 ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
8724 free(idx_1);
8727 ndr->depth--;
8729 ndr->depth--;
8730 ndr->depth--;
8733 static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r)
8735 if (ndr_flags & NDR_SCALARS) {
8736 NDR_CHECK(ndr_push_align(ndr, 5));
8737 NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
8738 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
8739 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8741 if (ndr_flags & NDR_BUFFERS) {
8742 if (r->buffer) {
8743 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->size));
8744 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size));
8747 return NDR_ERR_SUCCESS;
8750 static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *r)
8752 uint32_t _ptr_buffer;
8753 TALLOC_CTX *_mem_save_buffer_0;
8754 if (ndr_flags & NDR_SCALARS) {
8755 NDR_CHECK(ndr_pull_align(ndr, 5));
8756 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
8757 if (_ptr_buffer) {
8758 NDR_PULL_ALLOC(ndr, r->buffer);
8759 } else {
8760 r->buffer = NULL;
8762 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
8763 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8765 if (ndr_flags & NDR_BUFFERS) {
8766 if (r->buffer) {
8767 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
8768 NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0);
8769 NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer));
8770 NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer));
8771 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer)));
8772 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
8774 if (r->buffer) {
8775 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size));
8778 return NDR_ERR_SUCCESS;
8781 _PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r)
8783 ndr_print_struct(ndr, name, "netr_DsRAddress");
8784 ndr->depth++;
8785 ndr_print_ptr(ndr, "buffer", r->buffer);
8786 ndr->depth++;
8787 if (r->buffer) {
8788 ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size);
8790 ndr->depth--;
8791 ndr_print_uint32(ndr, "size", r->size);
8792 ndr->depth--;
8795 static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r)
8797 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
8798 return NDR_ERR_SUCCESS;
8801 static enum ndr_err_code ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r)
8803 uint32_t v;
8804 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
8805 *r = v;
8806 return NDR_ERR_SUCCESS;
8809 _PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r)
8811 const char *val = NULL;
8813 switch (r) {
8814 case NETR_TRUST_TYPE_DOWNLEVEL: val = "NETR_TRUST_TYPE_DOWNLEVEL"; break;
8815 case NETR_TRUST_TYPE_UPLEVEL: val = "NETR_TRUST_TYPE_UPLEVEL"; break;
8816 case NETR_TRUST_TYPE_MIT: val = "NETR_TRUST_TYPE_MIT"; break;
8817 case NETR_TRUST_TYPE_DCE: val = "NETR_TRUST_TYPE_DCE"; break;
8819 ndr_print_enum(ndr, name, "ENUM", val, r);
8822 static enum ndr_err_code ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
8824 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8825 return NDR_ERR_SUCCESS;
8828 static enum ndr_err_code ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
8830 uint32_t v;
8831 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8832 *r = v;
8833 return NDR_ERR_SUCCESS;
8836 _PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
8838 ndr_print_uint32(ndr, name, r);
8839 ndr->depth++;
8840 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE, r);
8841 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r);
8842 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r);
8843 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r);
8844 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r);
8845 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST, r);
8846 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r);
8847 ndr->depth--;
8850 static enum ndr_err_code ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r)
8852 if (ndr_flags & NDR_SCALARS) {
8853 NDR_CHECK(ndr_push_align(ndr, 5));
8854 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
8855 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
8856 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->trust_flags));
8857 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index));
8858 NDR_CHECK(ndr_push_netr_TrustType(ndr, NDR_SCALARS, r->trust_type));
8859 NDR_CHECK(ndr_push_netr_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes));
8860 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
8861 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
8862 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8864 if (ndr_flags & NDR_BUFFERS) {
8865 if (r->netbios_name) {
8866 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
8867 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
8868 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
8869 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8871 if (r->dns_name) {
8872 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
8873 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
8874 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
8875 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8877 if (r->sid) {
8878 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
8881 return NDR_ERR_SUCCESS;
8884 static enum ndr_err_code ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r)
8886 uint32_t _ptr_netbios_name;
8887 TALLOC_CTX *_mem_save_netbios_name_0;
8888 uint32_t _ptr_dns_name;
8889 TALLOC_CTX *_mem_save_dns_name_0;
8890 uint32_t _ptr_sid;
8891 TALLOC_CTX *_mem_save_sid_0;
8892 if (ndr_flags & NDR_SCALARS) {
8893 NDR_CHECK(ndr_pull_align(ndr, 5));
8894 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
8895 if (_ptr_netbios_name) {
8896 NDR_PULL_ALLOC(ndr, r->netbios_name);
8897 } else {
8898 r->netbios_name = NULL;
8900 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
8901 if (_ptr_dns_name) {
8902 NDR_PULL_ALLOC(ndr, r->dns_name);
8903 } else {
8904 r->dns_name = NULL;
8906 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->trust_flags));
8907 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index));
8908 NDR_CHECK(ndr_pull_netr_TrustType(ndr, NDR_SCALARS, &r->trust_type));
8909 NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes));
8910 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
8911 if (_ptr_sid) {
8912 NDR_PULL_ALLOC(ndr, r->sid);
8913 } else {
8914 r->sid = NULL;
8916 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
8917 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
8919 if (ndr_flags & NDR_BUFFERS) {
8920 if (r->netbios_name) {
8921 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
8922 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
8923 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
8924 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
8925 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
8926 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name));
8928 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
8929 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
8930 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
8932 if (r->dns_name) {
8933 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
8934 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
8935 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
8936 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
8937 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
8938 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name));
8940 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
8941 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
8942 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
8944 if (r->sid) {
8945 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
8946 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
8947 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
8948 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
8951 return NDR_ERR_SUCCESS;
8954 _PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r)
8956 ndr_print_struct(ndr, name, "netr_DomainTrust");
8957 ndr->depth++;
8958 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
8959 ndr->depth++;
8960 if (r->netbios_name) {
8961 ndr_print_string(ndr, "netbios_name", r->netbios_name);
8963 ndr->depth--;
8964 ndr_print_ptr(ndr, "dns_name", r->dns_name);
8965 ndr->depth++;
8966 if (r->dns_name) {
8967 ndr_print_string(ndr, "dns_name", r->dns_name);
8969 ndr->depth--;
8970 ndr_print_netr_TrustFlags(ndr, "trust_flags", r->trust_flags);
8971 ndr_print_uint32(ndr, "parent_index", r->parent_index);
8972 ndr_print_netr_TrustType(ndr, "trust_type", r->trust_type);
8973 ndr_print_netr_TrustAttributes(ndr, "trust_attributes", r->trust_attributes);
8974 ndr_print_ptr(ndr, "sid", r->sid);
8975 ndr->depth++;
8976 if (r->sid) {
8977 ndr_print_dom_sid2(ndr, "sid", r->sid);
8979 ndr->depth--;
8980 ndr_print_GUID(ndr, "guid", &r->guid);
8981 ndr->depth--;
8984 static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r)
8986 uint32_t cntr_array_1;
8987 if (ndr_flags & NDR_SCALARS) {
8988 NDR_CHECK(ndr_push_align(ndr, 5));
8989 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8990 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
8991 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
8993 if (ndr_flags & NDR_BUFFERS) {
8994 if (r->array) {
8995 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
8996 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
8997 NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
8999 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
9000 NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
9004 return NDR_ERR_SUCCESS;
9007 static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r)
9009 uint32_t _ptr_array;
9010 uint32_t cntr_array_1;
9011 TALLOC_CTX *_mem_save_array_0;
9012 TALLOC_CTX *_mem_save_array_1;
9013 if (ndr_flags & NDR_SCALARS) {
9014 NDR_CHECK(ndr_pull_align(ndr, 5));
9015 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9016 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
9017 if (_ptr_array) {
9018 NDR_PULL_ALLOC(ndr, r->array);
9019 } else {
9020 r->array = NULL;
9022 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9024 if (ndr_flags & NDR_BUFFERS) {
9025 if (r->array) {
9026 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9027 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9028 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9029 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9030 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
9031 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9032 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
9033 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
9035 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
9036 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
9038 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
9039 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9041 if (r->array) {
9042 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9045 return NDR_ERR_SUCCESS;
9048 _PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r)
9050 uint32_t cntr_array_1;
9051 ndr_print_struct(ndr, name, "netr_DomainTrustList");
9052 ndr->depth++;
9053 ndr_print_uint32(ndr, "count", r->count);
9054 ndr_print_ptr(ndr, "array", r->array);
9055 ndr->depth++;
9056 if (r->array) {
9057 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9058 ndr->depth++;
9059 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
9060 char *idx_1=NULL;
9061 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
9062 ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]);
9063 free(idx_1);
9066 ndr->depth--;
9068 ndr->depth--;
9069 ndr->depth--;
9072 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r)
9074 uint32_t cntr_sitename_1;
9075 uint32_t cntr_subnetname_1;
9076 if (ndr_flags & NDR_SCALARS) {
9077 NDR_CHECK(ndr_push_align(ndr, 5));
9078 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9079 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
9080 NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname));
9081 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9083 if (ndr_flags & NDR_BUFFERS) {
9084 if (r->sitename) {
9085 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9086 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9087 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
9089 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9090 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
9093 if (r->subnetname) {
9094 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9095 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9096 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
9098 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9099 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
9103 return NDR_ERR_SUCCESS;
9106 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r)
9108 uint32_t _ptr_sitename;
9109 uint32_t cntr_sitename_1;
9110 TALLOC_CTX *_mem_save_sitename_0;
9111 TALLOC_CTX *_mem_save_sitename_1;
9112 uint32_t _ptr_subnetname;
9113 uint32_t cntr_subnetname_1;
9114 TALLOC_CTX *_mem_save_subnetname_0;
9115 TALLOC_CTX *_mem_save_subnetname_1;
9116 if (ndr_flags & NDR_SCALARS) {
9117 NDR_CHECK(ndr_pull_align(ndr, 5));
9118 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9119 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
9120 if (_ptr_sitename) {
9121 NDR_PULL_ALLOC(ndr, r->sitename);
9122 } else {
9123 r->sitename = NULL;
9125 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname));
9126 if (_ptr_subnetname) {
9127 NDR_PULL_ALLOC(ndr, r->subnetname);
9128 } else {
9129 r->subnetname = NULL;
9131 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9133 if (ndr_flags & NDR_BUFFERS) {
9134 if (r->sitename) {
9135 _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
9136 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
9137 NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
9138 NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename));
9139 _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
9140 NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
9141 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9142 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
9144 for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
9145 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
9147 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
9148 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
9150 if (r->subnetname) {
9151 _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr);
9152 NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
9153 NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname));
9154 NDR_PULL_ALLOC_N(ndr, r->subnetname, ndr_get_array_size(ndr, &r->subnetname));
9155 _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr);
9156 NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
9157 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9158 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
9160 for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
9161 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
9163 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0);
9164 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0);
9166 if (r->sitename) {
9167 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
9169 if (r->subnetname) {
9170 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count));
9173 return NDR_ERR_SUCCESS;
9176 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r)
9178 uint32_t cntr_sitename_1;
9179 uint32_t cntr_subnetname_1;
9180 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr");
9181 ndr->depth++;
9182 ndr_print_uint32(ndr, "count", r->count);
9183 ndr_print_ptr(ndr, "sitename", r->sitename);
9184 ndr->depth++;
9185 if (r->sitename) {
9186 ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count);
9187 ndr->depth++;
9188 for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
9189 char *idx_1=NULL;
9190 if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) {
9191 ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
9192 free(idx_1);
9195 ndr->depth--;
9197 ndr->depth--;
9198 ndr_print_ptr(ndr, "subnetname", r->subnetname);
9199 ndr->depth++;
9200 if (r->subnetname) {
9201 ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", (int)r->count);
9202 ndr->depth++;
9203 for (cntr_subnetname_1=0;cntr_subnetname_1<r->count;cntr_subnetname_1++) {
9204 char *idx_1=NULL;
9205 if (asprintf(&idx_1, "[%d]", cntr_subnetname_1) != -1) {
9206 ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]);
9207 free(idx_1);
9210 ndr->depth--;
9212 ndr->depth--;
9213 ndr->depth--;
9216 static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r)
9218 uint32_t cntr_sites_1;
9219 if (ndr_flags & NDR_SCALARS) {
9220 NDR_CHECK(ndr_push_align(ndr, 5));
9221 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites));
9222 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites));
9223 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9225 if (ndr_flags & NDR_BUFFERS) {
9226 if (r->sites) {
9227 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_sites));
9228 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9229 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
9231 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9232 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
9236 return NDR_ERR_SUCCESS;
9239 static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r)
9241 uint32_t _ptr_sites;
9242 uint32_t cntr_sites_1;
9243 TALLOC_CTX *_mem_save_sites_0;
9244 TALLOC_CTX *_mem_save_sites_1;
9245 if (ndr_flags & NDR_SCALARS) {
9246 NDR_CHECK(ndr_pull_align(ndr, 5));
9247 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites));
9248 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites));
9249 if (_ptr_sites) {
9250 NDR_PULL_ALLOC(ndr, r->sites);
9251 } else {
9252 r->sites = NULL;
9254 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9256 if (ndr_flags & NDR_BUFFERS) {
9257 if (r->sites) {
9258 _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr);
9259 NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
9260 NDR_CHECK(ndr_pull_array_size(ndr, &r->sites));
9261 NDR_PULL_ALLOC_N(ndr, r->sites, ndr_get_array_size(ndr, &r->sites));
9262 _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr);
9263 NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
9264 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9265 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
9267 for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
9268 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
9270 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0);
9271 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0);
9273 if (r->sites) {
9274 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites));
9277 return NDR_ERR_SUCCESS;
9280 _PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r)
9282 uint32_t cntr_sites_1;
9283 ndr_print_struct(ndr, name, "DcSitesCtr");
9284 ndr->depth++;
9285 ndr_print_uint32(ndr, "num_sites", r->num_sites);
9286 ndr_print_ptr(ndr, "sites", r->sites);
9287 ndr->depth++;
9288 if (r->sites) {
9289 ndr->print(ndr, "%s: ARRAY(%d)", "sites", (int)r->num_sites);
9290 ndr->depth++;
9291 for (cntr_sites_1=0;cntr_sites_1<r->num_sites;cntr_sites_1++) {
9292 char *idx_1=NULL;
9293 if (asprintf(&idx_1, "[%d]", cntr_sites_1) != -1) {
9294 ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]);
9295 free(idx_1);
9298 ndr->depth--;
9300 ndr->depth--;
9301 ndr->depth--;
9304 static enum ndr_err_code ndr_push_netr_TrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_TrustInfo *r)
9306 uint32_t cntr_data_1;
9307 uint32_t cntr_entries_1;
9308 if (ndr_flags & NDR_SCALARS) {
9309 NDR_CHECK(ndr_push_align(ndr, 5));
9310 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9311 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
9312 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entry_count));
9313 NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries));
9314 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
9316 if (ndr_flags & NDR_BUFFERS) {
9317 if (r->data) {
9318 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9319 for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) {
9320 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data[cntr_data_1]));
9323 if (r->entries) {
9324 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9325 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9326 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
9328 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9329 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
9333 return NDR_ERR_SUCCESS;
9336 static enum ndr_err_code ndr_pull_netr_TrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_TrustInfo *r)
9338 uint32_t _ptr_data;
9339 uint32_t cntr_data_1;
9340 TALLOC_CTX *_mem_save_data_0;
9341 TALLOC_CTX *_mem_save_data_1;
9342 uint32_t _ptr_entries;
9343 uint32_t cntr_entries_1;
9344 TALLOC_CTX *_mem_save_entries_0;
9345 TALLOC_CTX *_mem_save_entries_1;
9346 if (ndr_flags & NDR_SCALARS) {
9347 NDR_CHECK(ndr_pull_align(ndr, 5));
9348 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9349 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
9350 if (_ptr_data) {
9351 NDR_PULL_ALLOC(ndr, r->data);
9352 } else {
9353 r->data = NULL;
9355 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entry_count));
9356 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries));
9357 if (_ptr_entries) {
9358 NDR_PULL_ALLOC(ndr, r->entries);
9359 } else {
9360 r->entries = NULL;
9362 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
9364 if (ndr_flags & NDR_BUFFERS) {
9365 if (r->data) {
9366 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
9367 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
9368 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
9369 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
9370 _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
9371 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
9372 for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) {
9373 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data[cntr_data_1]));
9375 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
9376 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
9378 if (r->entries) {
9379 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
9380 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
9381 NDR_CHECK(ndr_pull_array_size(ndr, &r->entries));
9382 NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries));
9383 _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr);
9384 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
9385 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9386 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
9388 for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
9389 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
9391 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0);
9392 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
9394 if (r->data) {
9395 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->count));
9397 if (r->entries) {
9398 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count));
9401 return NDR_ERR_SUCCESS;
9404 _PUBLIC_ void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r)
9406 uint32_t cntr_data_1;
9407 uint32_t cntr_entries_1;
9408 ndr_print_struct(ndr, name, "netr_TrustInfo");
9409 ndr->depth++;
9410 ndr_print_uint32(ndr, "count", r->count);
9411 ndr_print_ptr(ndr, "data", r->data);
9412 ndr->depth++;
9413 if (r->data) {
9414 ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->count);
9415 ndr->depth++;
9416 for (cntr_data_1=0;cntr_data_1<r->count;cntr_data_1++) {
9417 char *idx_1=NULL;
9418 if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) {
9419 ndr_print_uint32(ndr, "data", r->data[cntr_data_1]);
9420 free(idx_1);
9423 ndr->depth--;
9425 ndr->depth--;
9426 ndr_print_uint32(ndr, "entry_count", r->entry_count);
9427 ndr_print_ptr(ndr, "entries", r->entries);
9428 ndr->depth++;
9429 if (r->entries) {
9430 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count);
9431 ndr->depth++;
9432 for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) {
9433 char *idx_1=NULL;
9434 if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) {
9435 ndr_print_lsa_String(ndr, "entries", &r->entries[cntr_entries_1]);
9436 free(idx_1);
9439 ndr->depth--;
9441 ndr->depth--;
9442 ndr->depth--;
9445 static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r)
9447 if (flags & NDR_IN) {
9448 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9449 if (r->in.server_name) {
9450 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9451 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9452 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9453 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));
9455 if (r->in.account_name == NULL) {
9456 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9458 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9459 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9460 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9461 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));
9462 if (r->in.workstation == NULL) {
9463 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9465 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9466 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9467 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9468 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9470 if (flags & NDR_OUT) {
9471 if (r->out.info == NULL) {
9472 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9474 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
9475 if (*r->out.info) {
9476 NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
9478 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
9480 return NDR_ERR_SUCCESS;
9483 static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r)
9485 uint32_t _ptr_server_name;
9486 uint32_t _ptr_info;
9487 TALLOC_CTX *_mem_save_server_name_0;
9488 TALLOC_CTX *_mem_save_info_0;
9489 TALLOC_CTX *_mem_save_info_1;
9490 if (flags & NDR_IN) {
9491 ZERO_STRUCT(r->out);
9493 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
9494 if (_ptr_server_name) {
9495 NDR_PULL_ALLOC(ndr, r->in.server_name);
9496 } else {
9497 r->in.server_name = NULL;
9499 if (r->in.server_name) {
9500 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9501 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
9502 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
9503 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
9504 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
9505 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
9507 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
9508 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
9509 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
9511 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
9512 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
9513 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
9514 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
9516 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
9517 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
9518 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation));
9519 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation));
9520 if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) {
9521 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation));
9523 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t)));
9524 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16));
9525 NDR_PULL_ALLOC(ndr, r->out.info);
9526 ZERO_STRUCTP(r->out.info);
9528 if (flags & NDR_OUT) {
9529 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9530 NDR_PULL_ALLOC(ndr, r->out.info);
9532 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
9533 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
9534 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
9535 if (_ptr_info) {
9536 NDR_PULL_ALLOC(ndr, *r->out.info);
9537 } else {
9538 *r->out.info = NULL;
9540 if (*r->out.info) {
9541 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
9542 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
9543 NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
9544 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
9546 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
9547 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
9549 return NDR_ERR_SUCCESS;
9552 _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r)
9554 ndr_print_struct(ndr, name, "netr_LogonUasLogon");
9555 ndr->depth++;
9556 if (flags & NDR_SET_VALUES) {
9557 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
9559 if (flags & NDR_IN) {
9560 ndr_print_struct(ndr, "in", "netr_LogonUasLogon");
9561 ndr->depth++;
9562 ndr_print_ptr(ndr, "server_name", r->in.server_name);
9563 ndr->depth++;
9564 if (r->in.server_name) {
9565 ndr_print_string(ndr, "server_name", r->in.server_name);
9567 ndr->depth--;
9568 ndr_print_ptr(ndr, "account_name", r->in.account_name);
9569 ndr->depth++;
9570 ndr_print_string(ndr, "account_name", r->in.account_name);
9571 ndr->depth--;
9572 ndr_print_ptr(ndr, "workstation", r->in.workstation);
9573 ndr->depth++;
9574 ndr_print_string(ndr, "workstation", r->in.workstation);
9575 ndr->depth--;
9576 ndr->depth--;
9578 if (flags & NDR_OUT) {
9579 ndr_print_struct(ndr, "out", "netr_LogonUasLogon");
9580 ndr->depth++;
9581 ndr_print_ptr(ndr, "info", r->out.info);
9582 ndr->depth++;
9583 ndr_print_ptr(ndr, "info", *r->out.info);
9584 ndr->depth++;
9585 if (*r->out.info) {
9586 ndr_print_netr_UasInfo(ndr, "info", *r->out.info);
9588 ndr->depth--;
9589 ndr->depth--;
9590 ndr_print_WERROR(ndr, "result", r->out.result);
9591 ndr->depth--;
9593 ndr->depth--;
9596 static enum ndr_err_code ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r)
9598 if (flags & NDR_IN) {
9599 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9600 if (r->in.server_name) {
9601 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9602 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9603 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9604 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));
9606 if (r->in.account_name == NULL) {
9607 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9609 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9610 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9611 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
9612 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));
9613 if (r->in.workstation == NULL) {
9614 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9616 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9617 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9618 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16)));
9619 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9621 if (flags & NDR_OUT) {
9622 if (r->out.info == NULL) {
9623 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9625 NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info));
9626 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
9628 return NDR_ERR_SUCCESS;
9631 static enum ndr_err_code ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r)
9633 uint32_t _ptr_server_name;
9634 TALLOC_CTX *_mem_save_server_name_0;
9635 TALLOC_CTX *_mem_save_info_0;
9636 if (flags & NDR_IN) {
9637 ZERO_STRUCT(r->out);
9639 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
9640 if (_ptr_server_name) {
9641 NDR_PULL_ALLOC(ndr, r->in.server_name);
9642 } else {
9643 r->in.server_name = NULL;
9645 if (r->in.server_name) {
9646 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9647 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
9648 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
9649 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
9650 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
9651 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
9653 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
9654 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
9655 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
9657 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
9658 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
9659 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
9660 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
9662 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
9663 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
9664 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation));
9665 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation));
9666 if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) {
9667 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation));
9669 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t)));
9670 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16));
9671 NDR_PULL_ALLOC(ndr, r->out.info);
9672 ZERO_STRUCTP(r->out.info);
9674 if (flags & NDR_OUT) {
9675 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9676 NDR_PULL_ALLOC(ndr, r->out.info);
9678 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
9679 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
9680 NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info));
9681 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
9682 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
9684 return NDR_ERR_SUCCESS;
9687 _PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r)
9689 ndr_print_struct(ndr, name, "netr_LogonUasLogoff");
9690 ndr->depth++;
9691 if (flags & NDR_SET_VALUES) {
9692 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
9694 if (flags & NDR_IN) {
9695 ndr_print_struct(ndr, "in", "netr_LogonUasLogoff");
9696 ndr->depth++;
9697 ndr_print_ptr(ndr, "server_name", r->in.server_name);
9698 ndr->depth++;
9699 if (r->in.server_name) {
9700 ndr_print_string(ndr, "server_name", r->in.server_name);
9702 ndr->depth--;
9703 ndr_print_ptr(ndr, "account_name", r->in.account_name);
9704 ndr->depth++;
9705 ndr_print_string(ndr, "account_name", r->in.account_name);
9706 ndr->depth--;
9707 ndr_print_ptr(ndr, "workstation", r->in.workstation);
9708 ndr->depth++;
9709 ndr_print_string(ndr, "workstation", r->in.workstation);
9710 ndr->depth--;
9711 ndr->depth--;
9713 if (flags & NDR_OUT) {
9714 ndr_print_struct(ndr, "out", "netr_LogonUasLogoff");
9715 ndr->depth++;
9716 ndr_print_ptr(ndr, "info", r->out.info);
9717 ndr->depth++;
9718 ndr_print_netr_UasLogoffInfo(ndr, "info", r->out.info);
9719 ndr->depth--;
9720 ndr_print_WERROR(ndr, "result", r->out.result);
9721 ndr->depth--;
9723 ndr->depth--;
9726 static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r)
9728 if (flags & NDR_IN) {
9729 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9730 if (r->in.server_name) {
9731 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9732 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9733 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9734 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));
9736 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
9737 if (r->in.computer_name) {
9738 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9739 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9740 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9741 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));
9743 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
9744 if (r->in.credential) {
9745 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
9747 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
9748 if (r->in.return_authenticator) {
9749 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
9751 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
9752 if (r->in.logon == NULL) {
9753 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9755 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
9756 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
9757 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
9759 if (flags & NDR_OUT) {
9760 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
9761 if (r->out.return_authenticator) {
9762 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
9764 if (r->out.validation == NULL) {
9765 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9767 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
9768 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
9769 if (r->out.authoritative == NULL) {
9770 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
9772 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
9773 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
9775 return NDR_ERR_SUCCESS;
9778 static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r)
9780 uint32_t _ptr_server_name;
9781 uint32_t _ptr_computer_name;
9782 uint32_t _ptr_credential;
9783 uint32_t _ptr_return_authenticator;
9784 TALLOC_CTX *_mem_save_server_name_0;
9785 TALLOC_CTX *_mem_save_computer_name_0;
9786 TALLOC_CTX *_mem_save_credential_0;
9787 TALLOC_CTX *_mem_save_return_authenticator_0;
9788 TALLOC_CTX *_mem_save_logon_0;
9789 TALLOC_CTX *_mem_save_validation_0;
9790 TALLOC_CTX *_mem_save_authoritative_0;
9791 if (flags & NDR_IN) {
9792 ZERO_STRUCT(r->out);
9794 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
9795 if (_ptr_server_name) {
9796 NDR_PULL_ALLOC(ndr, r->in.server_name);
9797 } else {
9798 r->in.server_name = NULL;
9800 if (r->in.server_name) {
9801 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9802 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
9803 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
9804 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
9805 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
9806 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
9808 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
9809 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
9810 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
9812 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
9813 if (_ptr_computer_name) {
9814 NDR_PULL_ALLOC(ndr, r->in.computer_name);
9815 } else {
9816 r->in.computer_name = NULL;
9818 if (r->in.computer_name) {
9819 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9820 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
9821 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
9822 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
9823 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
9824 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
9826 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
9827 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
9828 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
9830 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
9831 if (_ptr_credential) {
9832 NDR_PULL_ALLOC(ndr, r->in.credential);
9833 } else {
9834 r->in.credential = NULL;
9836 if (r->in.credential) {
9837 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
9838 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
9839 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
9840 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
9842 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
9843 if (_ptr_return_authenticator) {
9844 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
9845 } else {
9846 r->in.return_authenticator = NULL;
9848 if (r->in.return_authenticator) {
9849 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
9850 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
9851 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
9852 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
9854 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
9855 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9856 NDR_PULL_ALLOC(ndr, r->in.logon);
9858 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
9859 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
9860 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
9861 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
9862 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
9863 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
9864 NDR_PULL_ALLOC(ndr, r->out.validation);
9865 ZERO_STRUCTP(r->out.validation);
9866 NDR_PULL_ALLOC(ndr, r->out.authoritative);
9867 ZERO_STRUCTP(r->out.authoritative);
9869 if (flags & NDR_OUT) {
9870 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
9871 if (_ptr_return_authenticator) {
9872 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
9873 } else {
9874 r->out.return_authenticator = NULL;
9876 if (r->out.return_authenticator) {
9877 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
9878 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
9879 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
9880 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
9882 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9883 NDR_PULL_ALLOC(ndr, r->out.validation);
9885 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
9886 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
9887 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
9888 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
9889 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
9890 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
9891 NDR_PULL_ALLOC(ndr, r->out.authoritative);
9893 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
9894 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
9895 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
9896 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
9897 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
9899 return NDR_ERR_SUCCESS;
9902 _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r)
9904 ndr_print_struct(ndr, name, "netr_LogonSamLogon");
9905 ndr->depth++;
9906 if (flags & NDR_SET_VALUES) {
9907 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
9909 if (flags & NDR_IN) {
9910 ndr_print_struct(ndr, "in", "netr_LogonSamLogon");
9911 ndr->depth++;
9912 ndr_print_ptr(ndr, "server_name", r->in.server_name);
9913 ndr->depth++;
9914 if (r->in.server_name) {
9915 ndr_print_string(ndr, "server_name", r->in.server_name);
9917 ndr->depth--;
9918 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
9919 ndr->depth++;
9920 if (r->in.computer_name) {
9921 ndr_print_string(ndr, "computer_name", r->in.computer_name);
9923 ndr->depth--;
9924 ndr_print_ptr(ndr, "credential", r->in.credential);
9925 ndr->depth++;
9926 if (r->in.credential) {
9927 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
9929 ndr->depth--;
9930 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
9931 ndr->depth++;
9932 if (r->in.return_authenticator) {
9933 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
9935 ndr->depth--;
9936 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
9937 ndr_print_ptr(ndr, "logon", r->in.logon);
9938 ndr->depth++;
9939 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
9940 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
9941 ndr->depth--;
9942 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
9943 ndr->depth--;
9945 if (flags & NDR_OUT) {
9946 ndr_print_struct(ndr, "out", "netr_LogonSamLogon");
9947 ndr->depth++;
9948 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
9949 ndr->depth++;
9950 if (r->out.return_authenticator) {
9951 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
9953 ndr->depth--;
9954 ndr_print_ptr(ndr, "validation", r->out.validation);
9955 ndr->depth++;
9956 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
9957 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
9958 ndr->depth--;
9959 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
9960 ndr->depth++;
9961 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
9962 ndr->depth--;
9963 ndr_print_NTSTATUS(ndr, "result", r->out.result);
9964 ndr->depth--;
9966 ndr->depth--;
9969 static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r)
9971 if (flags & NDR_IN) {
9972 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
9973 if (r->in.server_name) {
9974 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9975 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9976 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
9977 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));
9979 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
9980 if (r->in.computer_name) {
9981 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9982 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9983 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
9984 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));
9986 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
9987 if (r->in.credential) {
9988 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
9990 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
9991 if (r->in.return_authenticator) {
9992 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
9994 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
9995 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
9996 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
9998 if (flags & NDR_OUT) {
9999 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
10000 if (r->out.return_authenticator) {
10001 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10003 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10005 return NDR_ERR_SUCCESS;
10008 static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r)
10010 uint32_t _ptr_server_name;
10011 uint32_t _ptr_computer_name;
10012 uint32_t _ptr_credential;
10013 uint32_t _ptr_return_authenticator;
10014 TALLOC_CTX *_mem_save_server_name_0;
10015 TALLOC_CTX *_mem_save_computer_name_0;
10016 TALLOC_CTX *_mem_save_credential_0;
10017 TALLOC_CTX *_mem_save_return_authenticator_0;
10018 if (flags & NDR_IN) {
10019 ZERO_STRUCT(r->out);
10021 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10022 if (_ptr_server_name) {
10023 NDR_PULL_ALLOC(ndr, r->in.server_name);
10024 } else {
10025 r->in.server_name = NULL;
10027 if (r->in.server_name) {
10028 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10029 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10030 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10031 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10032 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
10033 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
10035 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
10036 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
10037 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10039 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
10040 if (_ptr_computer_name) {
10041 NDR_PULL_ALLOC(ndr, r->in.computer_name);
10042 } else {
10043 r->in.computer_name = NULL;
10045 if (r->in.computer_name) {
10046 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10047 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
10048 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10049 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10050 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
10051 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
10053 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
10054 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
10055 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
10057 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
10058 if (_ptr_credential) {
10059 NDR_PULL_ALLOC(ndr, r->in.credential);
10060 } else {
10061 r->in.credential = NULL;
10063 if (r->in.credential) {
10064 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10065 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
10066 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10067 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
10069 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10070 if (_ptr_return_authenticator) {
10071 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10072 } else {
10073 r->in.return_authenticator = NULL;
10075 if (r->in.return_authenticator) {
10076 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10077 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
10078 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10079 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10081 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
10082 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
10083 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
10085 if (flags & NDR_OUT) {
10086 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
10087 if (_ptr_return_authenticator) {
10088 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10089 } else {
10090 r->out.return_authenticator = NULL;
10092 if (r->out.return_authenticator) {
10093 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10094 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
10095 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10096 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
10098 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10100 return NDR_ERR_SUCCESS;
10103 _PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r)
10105 ndr_print_struct(ndr, name, "netr_LogonSamLogoff");
10106 ndr->depth++;
10107 if (flags & NDR_SET_VALUES) {
10108 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10110 if (flags & NDR_IN) {
10111 ndr_print_struct(ndr, "in", "netr_LogonSamLogoff");
10112 ndr->depth++;
10113 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10114 ndr->depth++;
10115 if (r->in.server_name) {
10116 ndr_print_string(ndr, "server_name", r->in.server_name);
10118 ndr->depth--;
10119 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10120 ndr->depth++;
10121 if (r->in.computer_name) {
10122 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10124 ndr->depth--;
10125 ndr_print_ptr(ndr, "credential", r->in.credential);
10126 ndr->depth++;
10127 if (r->in.credential) {
10128 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10130 ndr->depth--;
10131 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
10132 ndr->depth++;
10133 if (r->in.return_authenticator) {
10134 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
10136 ndr->depth--;
10137 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
10138 ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
10139 ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
10140 ndr->depth--;
10142 if (flags & NDR_OUT) {
10143 ndr_print_struct(ndr, "out", "netr_LogonSamLogoff");
10144 ndr->depth++;
10145 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10146 ndr->depth++;
10147 if (r->out.return_authenticator) {
10148 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10150 ndr->depth--;
10151 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10152 ndr->depth--;
10154 ndr->depth--;
10157 _PUBLIC_ enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r)
10159 if (flags & NDR_IN) {
10160 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10161 if (r->in.server_name) {
10162 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10163 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10164 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10165 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));
10167 if (r->in.computer_name == NULL) {
10168 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10170 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10171 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10172 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10173 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));
10174 if (r->in.credentials == NULL) {
10175 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10177 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10179 if (flags & NDR_OUT) {
10180 if (r->out.return_credentials == NULL) {
10181 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10183 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10184 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10186 return NDR_ERR_SUCCESS;
10189 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r)
10191 uint32_t _ptr_server_name;
10192 TALLOC_CTX *_mem_save_server_name_0;
10193 TALLOC_CTX *_mem_save_credentials_0;
10194 TALLOC_CTX *_mem_save_return_credentials_0;
10195 if (flags & NDR_IN) {
10196 ZERO_STRUCT(r->out);
10198 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10199 if (_ptr_server_name) {
10200 NDR_PULL_ALLOC(ndr, r->in.server_name);
10201 } else {
10202 r->in.server_name = NULL;
10204 if (r->in.server_name) {
10205 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10206 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10207 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10208 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10209 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
10210 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
10212 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
10213 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
10214 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10216 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10217 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10218 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
10219 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
10221 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
10222 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
10223 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10224 NDR_PULL_ALLOC(ndr, r->in.credentials);
10226 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10227 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
10228 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10229 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10230 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10231 ZERO_STRUCTP(r->out.return_credentials);
10233 if (flags & NDR_OUT) {
10234 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10235 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10237 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10238 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
10239 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10240 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10241 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10243 return NDR_ERR_SUCCESS;
10246 _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r)
10248 ndr_print_struct(ndr, name, "netr_ServerReqChallenge");
10249 ndr->depth++;
10250 if (flags & NDR_SET_VALUES) {
10251 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10253 if (flags & NDR_IN) {
10254 ndr_print_struct(ndr, "in", "netr_ServerReqChallenge");
10255 ndr->depth++;
10256 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10257 ndr->depth++;
10258 if (r->in.server_name) {
10259 ndr_print_string(ndr, "server_name", r->in.server_name);
10261 ndr->depth--;
10262 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10263 ndr->depth++;
10264 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10265 ndr->depth--;
10266 ndr_print_ptr(ndr, "credentials", r->in.credentials);
10267 ndr->depth++;
10268 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
10269 ndr->depth--;
10270 ndr->depth--;
10272 if (flags & NDR_OUT) {
10273 ndr_print_struct(ndr, "out", "netr_ServerReqChallenge");
10274 ndr->depth++;
10275 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
10276 ndr->depth++;
10277 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
10278 ndr->depth--;
10279 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10280 ndr->depth--;
10282 ndr->depth--;
10285 static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r)
10287 if (flags & NDR_IN) {
10288 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10289 if (r->in.server_name) {
10290 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10291 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10292 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10293 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));
10295 if (r->in.account_name == NULL) {
10296 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10298 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10299 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10300 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10301 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));
10302 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
10303 if (r->in.computer_name == NULL) {
10304 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10306 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10307 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10308 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10309 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));
10310 if (r->in.credentials == NULL) {
10311 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10313 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10315 if (flags & NDR_OUT) {
10316 if (r->out.return_credentials == NULL) {
10317 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10319 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10320 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10322 return NDR_ERR_SUCCESS;
10325 static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r)
10327 uint32_t _ptr_server_name;
10328 TALLOC_CTX *_mem_save_server_name_0;
10329 TALLOC_CTX *_mem_save_credentials_0;
10330 TALLOC_CTX *_mem_save_return_credentials_0;
10331 if (flags & NDR_IN) {
10332 ZERO_STRUCT(r->out);
10334 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10335 if (_ptr_server_name) {
10336 NDR_PULL_ALLOC(ndr, r->in.server_name);
10337 } else {
10338 r->in.server_name = NULL;
10340 if (r->in.server_name) {
10341 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10342 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10343 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10344 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10345 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
10346 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
10348 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
10349 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
10350 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10352 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
10353 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
10354 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
10355 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
10357 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
10358 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
10359 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
10360 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10361 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10362 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
10363 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
10365 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
10366 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
10367 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10368 NDR_PULL_ALLOC(ndr, r->in.credentials);
10370 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10371 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
10372 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
10373 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10374 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10375 ZERO_STRUCTP(r->out.return_credentials);
10377 if (flags & NDR_OUT) {
10378 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10379 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
10381 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
10382 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
10383 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
10384 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
10385 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10387 return NDR_ERR_SUCCESS;
10390 _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r)
10392 ndr_print_struct(ndr, name, "netr_ServerAuthenticate");
10393 ndr->depth++;
10394 if (flags & NDR_SET_VALUES) {
10395 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10397 if (flags & NDR_IN) {
10398 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate");
10399 ndr->depth++;
10400 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10401 ndr->depth++;
10402 if (r->in.server_name) {
10403 ndr_print_string(ndr, "server_name", r->in.server_name);
10405 ndr->depth--;
10406 ndr_print_ptr(ndr, "account_name", r->in.account_name);
10407 ndr->depth++;
10408 ndr_print_string(ndr, "account_name", r->in.account_name);
10409 ndr->depth--;
10410 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
10411 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10412 ndr->depth++;
10413 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10414 ndr->depth--;
10415 ndr_print_ptr(ndr, "credentials", r->in.credentials);
10416 ndr->depth++;
10417 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
10418 ndr->depth--;
10419 ndr->depth--;
10421 if (flags & NDR_OUT) {
10422 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate");
10423 ndr->depth++;
10424 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
10425 ndr->depth++;
10426 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
10427 ndr->depth--;
10428 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10429 ndr->depth--;
10431 ndr->depth--;
10434 static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r)
10436 if (flags & NDR_IN) {
10437 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
10438 if (r->in.server_name) {
10439 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10440 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10441 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
10442 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));
10444 if (r->in.account_name == NULL) {
10445 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10447 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10448 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10449 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
10450 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));
10451 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
10452 if (r->in.computer_name == NULL) {
10453 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10455 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10456 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10457 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
10458 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));
10459 if (r->in.credential == NULL) {
10460 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10462 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10463 if (r->in.new_password == NULL) {
10464 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10466 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_password));
10468 if (flags & NDR_OUT) {
10469 if (r->out.return_authenticator == NULL) {
10470 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10472 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10473 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10475 return NDR_ERR_SUCCESS;
10478 static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r)
10480 uint32_t _ptr_server_name;
10481 TALLOC_CTX *_mem_save_server_name_0;
10482 TALLOC_CTX *_mem_save_credential_0;
10483 TALLOC_CTX *_mem_save_return_authenticator_0;
10484 TALLOC_CTX *_mem_save_new_password_0;
10485 if (flags & NDR_IN) {
10486 ZERO_STRUCT(r->out);
10488 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
10489 if (_ptr_server_name) {
10490 NDR_PULL_ALLOC(ndr, r->in.server_name);
10491 } else {
10492 r->in.server_name = NULL;
10494 if (r->in.server_name) {
10495 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10496 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
10497 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
10498 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
10499 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
10500 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
10502 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
10503 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
10504 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
10506 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
10507 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
10508 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
10509 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
10511 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
10512 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
10513 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
10514 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
10515 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
10516 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
10517 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
10519 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
10520 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
10521 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10522 NDR_PULL_ALLOC(ndr, r->in.credential);
10524 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10525 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
10526 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10527 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
10528 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10529 NDR_PULL_ALLOC(ndr, r->in.new_password);
10531 _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
10532 NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
10533 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_password));
10534 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
10535 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10536 ZERO_STRUCTP(r->out.return_authenticator);
10538 if (flags & NDR_OUT) {
10539 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10540 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10542 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10543 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10544 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10545 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10546 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10548 return NDR_ERR_SUCCESS;
10551 _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r)
10553 ndr_print_struct(ndr, name, "netr_ServerPasswordSet");
10554 ndr->depth++;
10555 if (flags & NDR_SET_VALUES) {
10556 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10558 if (flags & NDR_IN) {
10559 ndr_print_struct(ndr, "in", "netr_ServerPasswordSet");
10560 ndr->depth++;
10561 ndr_print_ptr(ndr, "server_name", r->in.server_name);
10562 ndr->depth++;
10563 if (r->in.server_name) {
10564 ndr_print_string(ndr, "server_name", r->in.server_name);
10566 ndr->depth--;
10567 ndr_print_ptr(ndr, "account_name", r->in.account_name);
10568 ndr->depth++;
10569 ndr_print_string(ndr, "account_name", r->in.account_name);
10570 ndr->depth--;
10571 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
10572 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
10573 ndr->depth++;
10574 ndr_print_string(ndr, "computer_name", r->in.computer_name);
10575 ndr->depth--;
10576 ndr_print_ptr(ndr, "credential", r->in.credential);
10577 ndr->depth++;
10578 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10579 ndr->depth--;
10580 ndr_print_ptr(ndr, "new_password", r->in.new_password);
10581 ndr->depth++;
10582 ndr_print_samr_Password(ndr, "new_password", r->in.new_password);
10583 ndr->depth--;
10584 ndr->depth--;
10586 if (flags & NDR_OUT) {
10587 ndr_print_struct(ndr, "out", "netr_ServerPasswordSet");
10588 ndr->depth++;
10589 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10590 ndr->depth++;
10591 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10592 ndr->depth--;
10593 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10594 ndr->depth--;
10596 ndr->depth--;
10599 static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r)
10601 if (flags & NDR_IN) {
10602 if (r->in.logon_server == NULL) {
10603 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10605 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10606 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10607 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10608 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));
10609 if (r->in.computername == NULL) {
10610 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10612 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10613 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10614 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10615 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10616 if (r->in.credential == NULL) {
10617 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10619 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10620 if (r->in.return_authenticator == NULL) {
10621 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10623 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10624 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
10625 if (r->in.sequence_num == NULL) {
10626 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10628 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->in.sequence_num));
10629 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
10631 if (flags & NDR_OUT) {
10632 if (r->out.return_authenticator == NULL) {
10633 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10635 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10636 if (r->out.sequence_num == NULL) {
10637 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10639 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num));
10640 if (r->out.delta_enum_array == NULL) {
10641 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10643 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
10644 if (*r->out.delta_enum_array) {
10645 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10647 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10649 return NDR_ERR_SUCCESS;
10652 static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r)
10654 uint32_t _ptr_delta_enum_array;
10655 TALLOC_CTX *_mem_save_credential_0;
10656 TALLOC_CTX *_mem_save_return_authenticator_0;
10657 TALLOC_CTX *_mem_save_sequence_num_0;
10658 TALLOC_CTX *_mem_save_delta_enum_array_0;
10659 TALLOC_CTX *_mem_save_delta_enum_array_1;
10660 if (flags & NDR_IN) {
10661 ZERO_STRUCT(r->out);
10663 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
10664 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
10665 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
10666 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
10668 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
10669 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
10670 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
10671 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
10672 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
10673 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
10675 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
10676 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
10677 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10678 NDR_PULL_ALLOC(ndr, r->in.credential);
10680 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10681 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
10682 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10683 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
10684 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10685 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10687 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10688 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10689 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10690 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10691 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
10692 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10693 NDR_PULL_ALLOC(ndr, r->in.sequence_num);
10695 _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr);
10696 NDR_PULL_SET_MEM_CTX(ndr, r->in.sequence_num, LIBNDR_FLAG_REF_ALLOC);
10697 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->in.sequence_num));
10698 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC);
10699 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
10700 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10701 *r->out.return_authenticator = *r->in.return_authenticator;
10702 NDR_PULL_ALLOC(ndr, r->out.sequence_num);
10703 *r->out.sequence_num = *r->in.sequence_num;
10704 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10705 ZERO_STRUCTP(r->out.delta_enum_array);
10707 if (flags & NDR_OUT) {
10708 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10709 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10711 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10712 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10713 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10714 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10715 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10716 NDR_PULL_ALLOC(ndr, r->out.sequence_num);
10718 _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr);
10719 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC);
10720 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num));
10721 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC);
10722 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10723 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10725 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10726 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
10727 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
10728 if (_ptr_delta_enum_array) {
10729 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
10730 } else {
10731 *r->out.delta_enum_array = NULL;
10733 if (*r->out.delta_enum_array) {
10734 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
10735 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
10736 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10737 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
10739 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
10740 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10742 return NDR_ERR_SUCCESS;
10745 _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r)
10747 ndr_print_struct(ndr, name, "netr_DatabaseDeltas");
10748 ndr->depth++;
10749 if (flags & NDR_SET_VALUES) {
10750 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10752 if (flags & NDR_IN) {
10753 ndr_print_struct(ndr, "in", "netr_DatabaseDeltas");
10754 ndr->depth++;
10755 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
10756 ndr->depth++;
10757 ndr_print_string(ndr, "logon_server", r->in.logon_server);
10758 ndr->depth--;
10759 ndr_print_ptr(ndr, "computername", r->in.computername);
10760 ndr->depth++;
10761 ndr_print_string(ndr, "computername", r->in.computername);
10762 ndr->depth--;
10763 ndr_print_ptr(ndr, "credential", r->in.credential);
10764 ndr->depth++;
10765 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10766 ndr->depth--;
10767 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
10768 ndr->depth++;
10769 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
10770 ndr->depth--;
10771 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
10772 ndr_print_ptr(ndr, "sequence_num", r->in.sequence_num);
10773 ndr->depth++;
10774 ndr_print_udlong(ndr, "sequence_num", *r->in.sequence_num);
10775 ndr->depth--;
10776 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
10777 ndr->depth--;
10779 if (flags & NDR_OUT) {
10780 ndr_print_struct(ndr, "out", "netr_DatabaseDeltas");
10781 ndr->depth++;
10782 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10783 ndr->depth++;
10784 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10785 ndr->depth--;
10786 ndr_print_ptr(ndr, "sequence_num", r->out.sequence_num);
10787 ndr->depth++;
10788 ndr_print_udlong(ndr, "sequence_num", *r->out.sequence_num);
10789 ndr->depth--;
10790 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
10791 ndr->depth++;
10792 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
10793 ndr->depth++;
10794 if (*r->out.delta_enum_array) {
10795 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
10797 ndr->depth--;
10798 ndr->depth--;
10799 ndr_print_NTSTATUS(ndr, "result", r->out.result);
10800 ndr->depth--;
10802 ndr->depth--;
10805 static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r)
10807 if (flags & NDR_IN) {
10808 if (r->in.logon_server == NULL) {
10809 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10811 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10812 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10813 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
10814 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));
10815 if (r->in.computername == NULL) {
10816 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10818 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10819 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10820 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
10821 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10822 if (r->in.credential == NULL) {
10823 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10825 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10826 if (r->in.return_authenticator == NULL) {
10827 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10829 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10830 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
10831 if (r->in.sync_context == NULL) {
10832 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10834 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context));
10835 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
10837 if (flags & NDR_OUT) {
10838 if (r->out.return_authenticator == NULL) {
10839 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10841 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10842 if (r->out.sync_context == NULL) {
10843 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10845 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
10846 if (r->out.delta_enum_array == NULL) {
10847 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
10849 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
10850 if (*r->out.delta_enum_array) {
10851 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10853 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
10855 return NDR_ERR_SUCCESS;
10858 static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r)
10860 uint32_t _ptr_delta_enum_array;
10861 TALLOC_CTX *_mem_save_credential_0;
10862 TALLOC_CTX *_mem_save_return_authenticator_0;
10863 TALLOC_CTX *_mem_save_sync_context_0;
10864 TALLOC_CTX *_mem_save_delta_enum_array_0;
10865 TALLOC_CTX *_mem_save_delta_enum_array_1;
10866 if (flags & NDR_IN) {
10867 ZERO_STRUCT(r->out);
10869 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
10870 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
10871 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
10872 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
10874 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
10875 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
10876 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
10877 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
10878 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
10879 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
10881 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
10882 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
10883 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10884 NDR_PULL_ALLOC(ndr, r->in.credential);
10886 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
10887 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
10888 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
10889 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
10890 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10891 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
10893 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10894 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10895 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
10896 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10897 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
10898 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10899 NDR_PULL_ALLOC(ndr, r->in.sync_context);
10901 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
10902 NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC);
10903 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context));
10904 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
10905 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
10906 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10907 *r->out.return_authenticator = *r->in.return_authenticator;
10908 NDR_PULL_ALLOC(ndr, r->out.sync_context);
10909 *r->out.sync_context = *r->in.sync_context;
10910 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10911 ZERO_STRUCTP(r->out.delta_enum_array);
10913 if (flags & NDR_OUT) {
10914 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10915 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
10917 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
10918 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
10919 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
10920 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
10921 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10922 NDR_PULL_ALLOC(ndr, r->out.sync_context);
10924 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
10925 NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
10926 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
10927 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
10928 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
10929 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
10931 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10932 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
10933 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
10934 if (_ptr_delta_enum_array) {
10935 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
10936 } else {
10937 *r->out.delta_enum_array = NULL;
10939 if (*r->out.delta_enum_array) {
10940 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
10941 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
10942 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
10943 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
10945 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
10946 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
10948 return NDR_ERR_SUCCESS;
10951 _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r)
10953 ndr_print_struct(ndr, name, "netr_DatabaseSync");
10954 ndr->depth++;
10955 if (flags & NDR_SET_VALUES) {
10956 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
10958 if (flags & NDR_IN) {
10959 ndr_print_struct(ndr, "in", "netr_DatabaseSync");
10960 ndr->depth++;
10961 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
10962 ndr->depth++;
10963 ndr_print_string(ndr, "logon_server", r->in.logon_server);
10964 ndr->depth--;
10965 ndr_print_ptr(ndr, "computername", r->in.computername);
10966 ndr->depth++;
10967 ndr_print_string(ndr, "computername", r->in.computername);
10968 ndr->depth--;
10969 ndr_print_ptr(ndr, "credential", r->in.credential);
10970 ndr->depth++;
10971 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
10972 ndr->depth--;
10973 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
10974 ndr->depth++;
10975 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
10976 ndr->depth--;
10977 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
10978 ndr_print_ptr(ndr, "sync_context", r->in.sync_context);
10979 ndr->depth++;
10980 ndr_print_uint32(ndr, "sync_context", *r->in.sync_context);
10981 ndr->depth--;
10982 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
10983 ndr->depth--;
10985 if (flags & NDR_OUT) {
10986 ndr_print_struct(ndr, "out", "netr_DatabaseSync");
10987 ndr->depth++;
10988 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
10989 ndr->depth++;
10990 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
10991 ndr->depth--;
10992 ndr_print_ptr(ndr, "sync_context", r->out.sync_context);
10993 ndr->depth++;
10994 ndr_print_uint32(ndr, "sync_context", *r->out.sync_context);
10995 ndr->depth--;
10996 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
10997 ndr->depth++;
10998 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
10999 ndr->depth++;
11000 if (*r->out.delta_enum_array) {
11001 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
11003 ndr->depth--;
11004 ndr->depth--;
11005 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11006 ndr->depth--;
11008 ndr->depth--;
11011 static enum ndr_err_code ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r)
11013 if (flags & NDR_IN) {
11014 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11015 if (r->in.logon_server) {
11016 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11017 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11018 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11019 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));
11021 if (r->in.computername == NULL) {
11022 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11024 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11025 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11026 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11027 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11028 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11029 if (r->in.return_authenticator == NULL) {
11030 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11032 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11033 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas));
11034 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
11035 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11036 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize));
11038 if (flags & NDR_OUT) {
11039 if (r->out.return_authenticator == NULL) {
11040 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11042 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11043 if (r->out.buffer == NULL) {
11044 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11047 struct ndr_push *_ndr_buffer;
11048 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11049 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11050 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1));
11052 if (r->out.count_returned == NULL) {
11053 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11055 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned));
11056 if (r->out.total_entries == NULL) {
11057 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11059 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries));
11060 if (r->out.recordid == NULL) {
11061 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11063 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11064 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
11066 return NDR_ERR_SUCCESS;
11069 static enum ndr_err_code ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r)
11071 uint32_t _ptr_logon_server;
11072 TALLOC_CTX *_mem_save_logon_server_0;
11073 TALLOC_CTX *_mem_save_return_authenticator_0;
11074 TALLOC_CTX *_mem_save_buffer_0;
11075 TALLOC_CTX *_mem_save_count_returned_0;
11076 TALLOC_CTX *_mem_save_total_entries_0;
11077 TALLOC_CTX *_mem_save_recordid_0;
11078 if (flags & NDR_IN) {
11079 ZERO_STRUCT(r->out);
11081 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11082 if (_ptr_logon_server) {
11083 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11084 } else {
11085 r->in.logon_server = NULL;
11087 if (r->in.logon_server) {
11088 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11089 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11090 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11091 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11092 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11093 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11095 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11096 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11097 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11099 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
11100 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
11101 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
11102 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
11104 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
11105 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
11106 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11107 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11108 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
11110 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11111 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11112 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11113 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11114 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas));
11115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
11116 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11117 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize));
11118 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11119 *r->out.return_authenticator = *r->in.return_authenticator;
11120 NDR_PULL_ALLOC(ndr, r->out.buffer);
11121 ZERO_STRUCTP(r->out.buffer);
11122 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11123 ZERO_STRUCTP(r->out.count_returned);
11124 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11125 ZERO_STRUCTP(r->out.total_entries);
11126 NDR_PULL_ALLOC(ndr, r->out.recordid);
11127 ZERO_STRUCTP(r->out.recordid);
11129 if (flags & NDR_OUT) {
11130 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11131 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11133 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11134 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11135 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11136 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11137 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11138 NDR_PULL_ALLOC(ndr, r->out.buffer);
11140 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
11141 NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC);
11143 struct ndr_pull *_ndr_buffer;
11144 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11145 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11146 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1));
11148 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC);
11149 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11150 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11152 _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
11153 NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC);
11154 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned));
11155 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC);
11156 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11157 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11159 _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
11160 NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC);
11161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries));
11162 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC);
11163 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11164 NDR_PULL_ALLOC(ndr, r->out.recordid);
11166 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11167 NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC);
11168 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11169 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11170 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
11172 return NDR_ERR_SUCCESS;
11175 _PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r)
11177 ndr_print_struct(ndr, name, "netr_AccountDeltas");
11178 ndr->depth++;
11179 if (flags & NDR_SET_VALUES) {
11180 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11182 if (flags & NDR_IN) {
11183 ndr_print_struct(ndr, "in", "netr_AccountDeltas");
11184 ndr->depth++;
11185 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11186 ndr->depth++;
11187 if (r->in.logon_server) {
11188 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11190 ndr->depth--;
11191 ndr_print_ptr(ndr, "computername", r->in.computername);
11192 ndr->depth++;
11193 ndr_print_string(ndr, "computername", r->in.computername);
11194 ndr->depth--;
11195 ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
11196 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11197 ndr->depth++;
11198 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11199 ndr->depth--;
11200 ndr_print_netr_UAS_INFO_0(ndr, "uas", &r->in.uas);
11201 ndr_print_uint32(ndr, "count", r->in.count);
11202 ndr_print_uint32(ndr, "level", r->in.level);
11203 ndr_print_uint32(ndr, "buffersize", r->in.buffersize);
11204 ndr->depth--;
11206 if (flags & NDR_OUT) {
11207 ndr_print_struct(ndr, "out", "netr_AccountDeltas");
11208 ndr->depth++;
11209 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11210 ndr->depth++;
11211 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11212 ndr->depth--;
11213 ndr_print_ptr(ndr, "buffer", r->out.buffer);
11214 ndr->depth++;
11215 ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer);
11216 ndr->depth--;
11217 ndr_print_ptr(ndr, "count_returned", r->out.count_returned);
11218 ndr->depth++;
11219 ndr_print_uint32(ndr, "count_returned", *r->out.count_returned);
11220 ndr->depth--;
11221 ndr_print_ptr(ndr, "total_entries", r->out.total_entries);
11222 ndr->depth++;
11223 ndr_print_uint32(ndr, "total_entries", *r->out.total_entries);
11224 ndr->depth--;
11225 ndr_print_ptr(ndr, "recordid", r->out.recordid);
11226 ndr->depth++;
11227 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid);
11228 ndr->depth--;
11229 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11230 ndr->depth--;
11232 ndr->depth--;
11235 static enum ndr_err_code ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r)
11237 if (flags & NDR_IN) {
11238 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11239 if (r->in.logon_server) {
11240 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11241 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11242 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11243 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));
11245 if (r->in.computername == NULL) {
11246 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11248 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11249 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11250 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
11251 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11252 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11253 if (r->in.return_authenticator == NULL) {
11254 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11256 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11257 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reference));
11258 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11259 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize));
11260 if (r->in.recordid == NULL) {
11261 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11263 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid));
11265 if (flags & NDR_OUT) {
11266 if (r->out.return_authenticator == NULL) {
11267 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11269 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11270 if (r->out.buffer == NULL) {
11271 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11274 struct ndr_push *_ndr_buffer;
11275 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11276 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11277 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_buffer, 4, -1));
11279 if (r->out.count_returned == NULL) {
11280 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11282 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count_returned));
11283 if (r->out.total_entries == NULL) {
11284 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11286 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_entries));
11287 if (r->out.next_reference == NULL) {
11288 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11290 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.next_reference));
11291 if (r->out.recordid == NULL) {
11292 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11294 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11295 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
11297 return NDR_ERR_SUCCESS;
11300 static enum ndr_err_code ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r)
11302 uint32_t _ptr_logon_server;
11303 TALLOC_CTX *_mem_save_logon_server_0;
11304 TALLOC_CTX *_mem_save_return_authenticator_0;
11305 TALLOC_CTX *_mem_save_buffer_0;
11306 TALLOC_CTX *_mem_save_count_returned_0;
11307 TALLOC_CTX *_mem_save_total_entries_0;
11308 TALLOC_CTX *_mem_save_next_reference_0;
11309 TALLOC_CTX *_mem_save_recordid_0;
11310 if (flags & NDR_IN) {
11311 ZERO_STRUCT(r->out);
11313 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11314 if (_ptr_logon_server) {
11315 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11316 } else {
11317 r->in.logon_server = NULL;
11319 if (r->in.logon_server) {
11320 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11321 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11322 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11323 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11324 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11325 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11327 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11328 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11329 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11331 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
11332 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
11333 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
11334 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
11336 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
11337 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
11338 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
11339 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11340 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
11342 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11343 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11344 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
11345 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11346 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reference));
11347 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11348 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize));
11349 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11350 NDR_PULL_ALLOC(ndr, r->in.recordid);
11352 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11353 NDR_PULL_SET_MEM_CTX(ndr, r->in.recordid, LIBNDR_FLAG_REF_ALLOC);
11354 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid));
11355 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11356 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11357 *r->out.return_authenticator = *r->in.return_authenticator;
11358 NDR_PULL_ALLOC(ndr, r->out.buffer);
11359 ZERO_STRUCTP(r->out.buffer);
11360 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11361 ZERO_STRUCTP(r->out.count_returned);
11362 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11363 ZERO_STRUCTP(r->out.total_entries);
11364 NDR_PULL_ALLOC(ndr, r->out.next_reference);
11365 ZERO_STRUCTP(r->out.next_reference);
11366 NDR_PULL_ALLOC(ndr, r->out.recordid);
11367 *r->out.recordid = *r->in.recordid;
11369 if (flags & NDR_OUT) {
11370 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11371 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
11373 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
11374 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
11375 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
11376 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
11377 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11378 NDR_PULL_ALLOC(ndr, r->out.buffer);
11380 _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
11381 NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC);
11383 struct ndr_pull *_ndr_buffer;
11384 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1));
11385 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer));
11386 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1));
11388 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC);
11389 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11390 NDR_PULL_ALLOC(ndr, r->out.count_returned);
11392 _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
11393 NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC);
11394 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned));
11395 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC);
11396 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11397 NDR_PULL_ALLOC(ndr, r->out.total_entries);
11399 _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
11400 NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC);
11401 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries));
11402 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC);
11403 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11404 NDR_PULL_ALLOC(ndr, r->out.next_reference);
11406 _mem_save_next_reference_0 = NDR_PULL_GET_MEM_CTX(ndr);
11407 NDR_PULL_SET_MEM_CTX(ndr, r->out.next_reference, LIBNDR_FLAG_REF_ALLOC);
11408 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.next_reference));
11409 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_reference_0, LIBNDR_FLAG_REF_ALLOC);
11410 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11411 NDR_PULL_ALLOC(ndr, r->out.recordid);
11413 _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr);
11414 NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC);
11415 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
11416 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
11417 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
11419 return NDR_ERR_SUCCESS;
11422 _PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r)
11424 ndr_print_struct(ndr, name, "netr_AccountSync");
11425 ndr->depth++;
11426 if (flags & NDR_SET_VALUES) {
11427 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11429 if (flags & NDR_IN) {
11430 ndr_print_struct(ndr, "in", "netr_AccountSync");
11431 ndr->depth++;
11432 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11433 ndr->depth++;
11434 if (r->in.logon_server) {
11435 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11437 ndr->depth--;
11438 ndr_print_ptr(ndr, "computername", r->in.computername);
11439 ndr->depth++;
11440 ndr_print_string(ndr, "computername", r->in.computername);
11441 ndr->depth--;
11442 ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
11443 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
11444 ndr->depth++;
11445 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
11446 ndr->depth--;
11447 ndr_print_uint32(ndr, "reference", r->in.reference);
11448 ndr_print_uint32(ndr, "level", r->in.level);
11449 ndr_print_uint32(ndr, "buffersize", r->in.buffersize);
11450 ndr_print_ptr(ndr, "recordid", r->in.recordid);
11451 ndr->depth++;
11452 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->in.recordid);
11453 ndr->depth--;
11454 ndr->depth--;
11456 if (flags & NDR_OUT) {
11457 ndr_print_struct(ndr, "out", "netr_AccountSync");
11458 ndr->depth++;
11459 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
11460 ndr->depth++;
11461 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
11462 ndr->depth--;
11463 ndr_print_ptr(ndr, "buffer", r->out.buffer);
11464 ndr->depth++;
11465 ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer);
11466 ndr->depth--;
11467 ndr_print_ptr(ndr, "count_returned", r->out.count_returned);
11468 ndr->depth++;
11469 ndr_print_uint32(ndr, "count_returned", *r->out.count_returned);
11470 ndr->depth--;
11471 ndr_print_ptr(ndr, "total_entries", r->out.total_entries);
11472 ndr->depth++;
11473 ndr_print_uint32(ndr, "total_entries", *r->out.total_entries);
11474 ndr->depth--;
11475 ndr_print_ptr(ndr, "next_reference", r->out.next_reference);
11476 ndr->depth++;
11477 ndr_print_uint32(ndr, "next_reference", *r->out.next_reference);
11478 ndr->depth--;
11479 ndr_print_ptr(ndr, "recordid", r->out.recordid);
11480 ndr->depth++;
11481 ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid);
11482 ndr->depth--;
11483 ndr_print_NTSTATUS(ndr, "result", r->out.result);
11484 ndr->depth--;
11486 ndr->depth--;
11489 static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r)
11491 if (flags & NDR_IN) {
11492 if (r->in.logon_server == NULL) {
11493 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11495 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11496 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11497 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11498 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));
11499 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname));
11500 if (r->in.domainname) {
11501 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11502 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11503 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11504 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11507 if (flags & NDR_OUT) {
11508 if (r->out.dcname == NULL) {
11509 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11511 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
11512 if (*r->out.dcname) {
11513 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, 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->out.dcname, CH_UTF16)));
11516 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11518 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11520 return NDR_ERR_SUCCESS;
11523 static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r)
11525 uint32_t _ptr_domainname;
11526 uint32_t _ptr_dcname;
11527 TALLOC_CTX *_mem_save_domainname_0;
11528 TALLOC_CTX *_mem_save_dcname_0;
11529 TALLOC_CTX *_mem_save_dcname_1;
11530 if (flags & NDR_IN) {
11531 ZERO_STRUCT(r->out);
11533 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11534 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11535 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11536 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11538 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11539 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11540 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname));
11541 if (_ptr_domainname) {
11542 NDR_PULL_ALLOC(ndr, r->in.domainname);
11543 } else {
11544 r->in.domainname = NULL;
11546 if (r->in.domainname) {
11547 _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11548 NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0);
11549 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname));
11550 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname));
11551 if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) {
11552 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname));
11554 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t)));
11555 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16));
11556 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0);
11558 NDR_PULL_ALLOC(ndr, r->out.dcname);
11559 ZERO_STRUCTP(r->out.dcname);
11561 if (flags & NDR_OUT) {
11562 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11563 NDR_PULL_ALLOC(ndr, r->out.dcname);
11565 _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11566 NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
11567 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
11568 if (_ptr_dcname) {
11569 NDR_PULL_ALLOC(ndr, *r->out.dcname);
11570 } else {
11571 *r->out.dcname = NULL;
11573 if (*r->out.dcname) {
11574 _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
11575 NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
11576 NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
11577 NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
11578 if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
11579 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
11581 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
11582 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
11583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
11585 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
11586 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11588 return NDR_ERR_SUCCESS;
11591 _PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r)
11593 ndr_print_struct(ndr, name, "netr_GetDcName");
11594 ndr->depth++;
11595 if (flags & NDR_SET_VALUES) {
11596 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11598 if (flags & NDR_IN) {
11599 ndr_print_struct(ndr, "in", "netr_GetDcName");
11600 ndr->depth++;
11601 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11602 ndr->depth++;
11603 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11604 ndr->depth--;
11605 ndr_print_ptr(ndr, "domainname", r->in.domainname);
11606 ndr->depth++;
11607 if (r->in.domainname) {
11608 ndr_print_string(ndr, "domainname", r->in.domainname);
11610 ndr->depth--;
11611 ndr->depth--;
11613 if (flags & NDR_OUT) {
11614 ndr_print_struct(ndr, "out", "netr_GetDcName");
11615 ndr->depth++;
11616 ndr_print_ptr(ndr, "dcname", r->out.dcname);
11617 ndr->depth++;
11618 ndr_print_ptr(ndr, "dcname", *r->out.dcname);
11619 ndr->depth++;
11620 if (*r->out.dcname) {
11621 ndr_print_string(ndr, "dcname", *r->out.dcname);
11623 ndr->depth--;
11624 ndr->depth--;
11625 ndr_print_WERROR(ndr, "result", r->out.result);
11626 ndr->depth--;
11628 ndr->depth--;
11631 static enum ndr_err_code ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r)
11633 if (flags & NDR_IN) {
11634 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11635 if (r->in.logon_server) {
11636 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11637 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11638 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11639 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));
11641 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
11642 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11644 if (flags & NDR_OUT) {
11645 if (r->out.query == NULL) {
11646 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11648 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
11649 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11650 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11652 return NDR_ERR_SUCCESS;
11655 static enum ndr_err_code ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r)
11657 uint32_t _ptr_logon_server;
11658 TALLOC_CTX *_mem_save_logon_server_0;
11659 TALLOC_CTX *_mem_save_query_0;
11660 if (flags & NDR_IN) {
11661 ZERO_STRUCT(r->out);
11663 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11664 if (_ptr_logon_server) {
11665 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11666 } else {
11667 r->in.logon_server = NULL;
11669 if (r->in.logon_server) {
11670 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11671 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11672 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11673 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11674 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11675 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11677 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11678 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11679 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11681 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
11682 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11683 NDR_PULL_ALLOC(ndr, r->out.query);
11684 ZERO_STRUCTP(r->out.query);
11686 if (flags & NDR_OUT) {
11687 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11688 NDR_PULL_ALLOC(ndr, r->out.query);
11690 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
11691 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
11692 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
11693 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11694 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
11695 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11697 return NDR_ERR_SUCCESS;
11700 _PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r)
11702 ndr_print_struct(ndr, name, "netr_LogonControl");
11703 ndr->depth++;
11704 if (flags & NDR_SET_VALUES) {
11705 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11707 if (flags & NDR_IN) {
11708 ndr_print_struct(ndr, "in", "netr_LogonControl");
11709 ndr->depth++;
11710 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11711 ndr->depth++;
11712 if (r->in.logon_server) {
11713 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11715 ndr->depth--;
11716 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
11717 ndr_print_uint32(ndr, "level", r->in.level);
11718 ndr->depth--;
11720 if (flags & NDR_OUT) {
11721 ndr_print_struct(ndr, "out", "netr_LogonControl");
11722 ndr->depth++;
11723 ndr_print_ptr(ndr, "query", r->out.query);
11724 ndr->depth++;
11725 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
11726 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
11727 ndr->depth--;
11728 ndr_print_WERROR(ndr, "result", r->out.result);
11729 ndr->depth--;
11731 ndr->depth--;
11734 static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r)
11736 if (flags & NDR_IN) {
11737 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11738 if (r->in.logon_server) {
11739 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11740 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11741 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11742 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));
11744 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname));
11745 if (r->in.domainname) {
11746 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11747 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11748 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16)));
11749 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11752 if (flags & NDR_OUT) {
11753 if (r->out.dcname == NULL) {
11754 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11756 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
11757 if (*r->out.dcname) {
11758 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
11759 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11760 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
11761 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11763 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11765 return NDR_ERR_SUCCESS;
11768 static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r)
11770 uint32_t _ptr_logon_server;
11771 uint32_t _ptr_domainname;
11772 uint32_t _ptr_dcname;
11773 TALLOC_CTX *_mem_save_logon_server_0;
11774 TALLOC_CTX *_mem_save_domainname_0;
11775 TALLOC_CTX *_mem_save_dcname_0;
11776 TALLOC_CTX *_mem_save_dcname_1;
11777 if (flags & NDR_IN) {
11778 ZERO_STRUCT(r->out);
11780 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11781 if (_ptr_logon_server) {
11782 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11783 } else {
11784 r->in.logon_server = NULL;
11786 if (r->in.logon_server) {
11787 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11788 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11789 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11790 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11791 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11792 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11794 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11795 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11796 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11798 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname));
11799 if (_ptr_domainname) {
11800 NDR_PULL_ALLOC(ndr, r->in.domainname);
11801 } else {
11802 r->in.domainname = NULL;
11804 if (r->in.domainname) {
11805 _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11806 NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0);
11807 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname));
11808 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname));
11809 if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) {
11810 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname));
11812 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t)));
11813 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16));
11814 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0);
11816 NDR_PULL_ALLOC(ndr, r->out.dcname);
11817 ZERO_STRUCTP(r->out.dcname);
11819 if (flags & NDR_OUT) {
11820 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11821 NDR_PULL_ALLOC(ndr, r->out.dcname);
11823 _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
11824 NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
11825 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
11826 if (_ptr_dcname) {
11827 NDR_PULL_ALLOC(ndr, *r->out.dcname);
11828 } else {
11829 *r->out.dcname = NULL;
11831 if (*r->out.dcname) {
11832 _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
11833 NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
11834 NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
11835 NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
11836 if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
11837 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
11839 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
11840 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
11841 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
11843 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
11844 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11846 return NDR_ERR_SUCCESS;
11849 _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r)
11851 ndr_print_struct(ndr, name, "netr_GetAnyDCName");
11852 ndr->depth++;
11853 if (flags & NDR_SET_VALUES) {
11854 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11856 if (flags & NDR_IN) {
11857 ndr_print_struct(ndr, "in", "netr_GetAnyDCName");
11858 ndr->depth++;
11859 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11860 ndr->depth++;
11861 if (r->in.logon_server) {
11862 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11864 ndr->depth--;
11865 ndr_print_ptr(ndr, "domainname", r->in.domainname);
11866 ndr->depth++;
11867 if (r->in.domainname) {
11868 ndr_print_string(ndr, "domainname", r->in.domainname);
11870 ndr->depth--;
11871 ndr->depth--;
11873 if (flags & NDR_OUT) {
11874 ndr_print_struct(ndr, "out", "netr_GetAnyDCName");
11875 ndr->depth++;
11876 ndr_print_ptr(ndr, "dcname", r->out.dcname);
11877 ndr->depth++;
11878 ndr_print_ptr(ndr, "dcname", *r->out.dcname);
11879 ndr->depth++;
11880 if (*r->out.dcname) {
11881 ndr_print_string(ndr, "dcname", *r->out.dcname);
11883 ndr->depth--;
11884 ndr->depth--;
11885 ndr_print_WERROR(ndr, "result", r->out.result);
11886 ndr->depth--;
11888 ndr->depth--;
11891 static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r)
11893 if (flags & NDR_IN) {
11894 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
11895 if (r->in.logon_server) {
11896 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11897 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11898 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
11899 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));
11901 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
11902 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
11903 if (r->in.data == NULL) {
11904 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11906 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code));
11907 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
11909 if (flags & NDR_OUT) {
11910 if (r->out.query == NULL) {
11911 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
11913 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
11914 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11915 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
11917 return NDR_ERR_SUCCESS;
11920 static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r)
11922 uint32_t _ptr_logon_server;
11923 TALLOC_CTX *_mem_save_logon_server_0;
11924 TALLOC_CTX *_mem_save_data_0;
11925 TALLOC_CTX *_mem_save_query_0;
11926 if (flags & NDR_IN) {
11927 ZERO_STRUCT(r->out);
11929 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
11930 if (_ptr_logon_server) {
11931 NDR_PULL_ALLOC(ndr, r->in.logon_server);
11932 } else {
11933 r->in.logon_server = NULL;
11935 if (r->in.logon_server) {
11936 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
11937 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
11938 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
11939 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
11940 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
11941 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
11943 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
11944 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
11945 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
11947 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
11948 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
11949 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11950 NDR_PULL_ALLOC(ndr, r->in.data);
11952 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
11953 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
11954 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code));
11955 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
11956 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
11957 NDR_PULL_ALLOC(ndr, r->out.query);
11958 ZERO_STRUCTP(r->out.query);
11960 if (flags & NDR_OUT) {
11961 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
11962 NDR_PULL_ALLOC(ndr, r->out.query);
11964 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
11965 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
11966 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
11967 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
11968 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
11969 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
11971 return NDR_ERR_SUCCESS;
11974 _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r)
11976 ndr_print_struct(ndr, name, "netr_LogonControl2");
11977 ndr->depth++;
11978 if (flags & NDR_SET_VALUES) {
11979 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
11981 if (flags & NDR_IN) {
11982 ndr_print_struct(ndr, "in", "netr_LogonControl2");
11983 ndr->depth++;
11984 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
11985 ndr->depth++;
11986 if (r->in.logon_server) {
11987 ndr_print_string(ndr, "logon_server", r->in.logon_server);
11989 ndr->depth--;
11990 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
11991 ndr_print_uint32(ndr, "level", r->in.level);
11992 ndr_print_ptr(ndr, "data", r->in.data);
11993 ndr->depth++;
11994 ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code);
11995 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data);
11996 ndr->depth--;
11997 ndr->depth--;
11999 if (flags & NDR_OUT) {
12000 ndr_print_struct(ndr, "out", "netr_LogonControl2");
12001 ndr->depth++;
12002 ndr_print_ptr(ndr, "query", r->out.query);
12003 ndr->depth++;
12004 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
12005 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
12006 ndr->depth--;
12007 ndr_print_WERROR(ndr, "result", r->out.result);
12008 ndr->depth--;
12010 ndr->depth--;
12013 static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r)
12015 if (flags & NDR_IN) {
12016 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
12017 if (r->in.server_name) {
12018 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12019 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12020 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12021 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));
12023 if (r->in.account_name == NULL) {
12024 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12026 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
12027 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12028 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
12029 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));
12030 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
12031 if (r->in.computer_name == NULL) {
12032 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12034 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
12035 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12036 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
12037 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));
12038 if (r->in.credentials == NULL) {
12039 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12041 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
12042 if (r->in.negotiate_flags == NULL) {
12043 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12045 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags));
12047 if (flags & NDR_OUT) {
12048 if (r->out.return_credentials == NULL) {
12049 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12051 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
12052 if (r->out.negotiate_flags == NULL) {
12053 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12055 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags));
12056 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12058 return NDR_ERR_SUCCESS;
12061 static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r)
12063 uint32_t _ptr_server_name;
12064 TALLOC_CTX *_mem_save_server_name_0;
12065 TALLOC_CTX *_mem_save_credentials_0;
12066 TALLOC_CTX *_mem_save_return_credentials_0;
12067 TALLOC_CTX *_mem_save_negotiate_flags_0;
12068 if (flags & NDR_IN) {
12069 ZERO_STRUCT(r->out);
12071 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
12072 if (_ptr_server_name) {
12073 NDR_PULL_ALLOC(ndr, r->in.server_name);
12074 } else {
12075 r->in.server_name = NULL;
12077 if (r->in.server_name) {
12078 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
12079 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
12080 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
12081 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
12082 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
12083 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
12085 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
12086 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
12087 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
12089 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
12090 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
12091 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
12092 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
12094 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
12095 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
12096 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
12097 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
12098 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
12099 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
12100 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
12102 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
12103 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
12104 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12105 NDR_PULL_ALLOC(ndr, r->in.credentials);
12107 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
12108 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
12109 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
12110 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
12111 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12112 NDR_PULL_ALLOC(ndr, r->in.negotiate_flags);
12114 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
12115 NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
12116 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags));
12117 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
12118 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
12119 ZERO_STRUCTP(r->out.return_credentials);
12120 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
12121 *r->out.negotiate_flags = *r->in.negotiate_flags;
12123 if (flags & NDR_OUT) {
12124 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12125 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
12127 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
12128 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
12129 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
12130 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
12131 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12132 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
12134 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
12135 NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
12136 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags));
12137 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
12138 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12140 return NDR_ERR_SUCCESS;
12143 _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r)
12145 ndr_print_struct(ndr, name, "netr_ServerAuthenticate2");
12146 ndr->depth++;
12147 if (flags & NDR_SET_VALUES) {
12148 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12150 if (flags & NDR_IN) {
12151 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate2");
12152 ndr->depth++;
12153 ndr_print_ptr(ndr, "server_name", r->in.server_name);
12154 ndr->depth++;
12155 if (r->in.server_name) {
12156 ndr_print_string(ndr, "server_name", r->in.server_name);
12158 ndr->depth--;
12159 ndr_print_ptr(ndr, "account_name", r->in.account_name);
12160 ndr->depth++;
12161 ndr_print_string(ndr, "account_name", r->in.account_name);
12162 ndr->depth--;
12163 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
12164 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
12165 ndr->depth++;
12166 ndr_print_string(ndr, "computer_name", r->in.computer_name);
12167 ndr->depth--;
12168 ndr_print_ptr(ndr, "credentials", r->in.credentials);
12169 ndr->depth++;
12170 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
12171 ndr->depth--;
12172 ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags);
12173 ndr->depth++;
12174 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags);
12175 ndr->depth--;
12176 ndr->depth--;
12178 if (flags & NDR_OUT) {
12179 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2");
12180 ndr->depth++;
12181 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
12182 ndr->depth++;
12183 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
12184 ndr->depth--;
12185 ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags);
12186 ndr->depth++;
12187 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags);
12188 ndr->depth--;
12189 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12190 ndr->depth--;
12192 ndr->depth--;
12195 static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r)
12197 if (flags & NDR_IN) {
12198 if (r->in.logon_server == NULL) {
12199 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12201 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12202 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12203 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12204 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));
12205 if (r->in.computername == NULL) {
12206 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12208 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12209 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12210 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12211 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12212 if (r->in.credential == NULL) {
12213 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12215 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12216 if (r->in.return_authenticator == NULL) {
12217 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12219 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12220 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->in.database_id));
12221 NDR_CHECK(ndr_push_SyncStateEnum(ndr, NDR_SCALARS, r->in.restart_state));
12222 if (r->in.sync_context == NULL) {
12223 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12225 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.sync_context));
12226 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.preferredmaximumlength));
12228 if (flags & NDR_OUT) {
12229 if (r->out.return_authenticator == NULL) {
12230 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12232 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12233 if (r->out.sync_context == NULL) {
12234 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12236 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
12237 if (r->out.delta_enum_array == NULL) {
12238 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12240 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
12241 if (*r->out.delta_enum_array) {
12242 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12244 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12246 return NDR_ERR_SUCCESS;
12249 static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r)
12251 uint32_t _ptr_delta_enum_array;
12252 TALLOC_CTX *_mem_save_credential_0;
12253 TALLOC_CTX *_mem_save_return_authenticator_0;
12254 TALLOC_CTX *_mem_save_sync_context_0;
12255 TALLOC_CTX *_mem_save_delta_enum_array_0;
12256 TALLOC_CTX *_mem_save_delta_enum_array_1;
12257 if (flags & NDR_IN) {
12258 ZERO_STRUCT(r->out);
12260 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12261 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12262 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
12263 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
12265 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
12266 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
12267 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
12268 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
12269 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
12270 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
12272 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
12273 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
12274 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12275 NDR_PULL_ALLOC(ndr, r->in.credential);
12277 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
12278 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
12279 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12280 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
12281 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12282 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
12284 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12285 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12286 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12287 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12288 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id));
12289 NDR_CHECK(ndr_pull_SyncStateEnum(ndr, NDR_SCALARS, &r->in.restart_state));
12290 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12291 NDR_PULL_ALLOC(ndr, r->in.sync_context);
12293 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
12294 NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC);
12295 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context));
12296 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
12297 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength));
12298 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12299 *r->out.return_authenticator = *r->in.return_authenticator;
12300 NDR_PULL_ALLOC(ndr, r->out.sync_context);
12301 *r->out.sync_context = *r->in.sync_context;
12302 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12303 ZERO_STRUCTP(r->out.delta_enum_array);
12305 if (flags & NDR_OUT) {
12306 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12307 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12309 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12310 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12311 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12312 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12313 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12314 NDR_PULL_ALLOC(ndr, r->out.sync_context);
12316 _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
12317 NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
12318 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
12319 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
12320 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12321 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12323 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
12324 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
12325 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
12326 if (_ptr_delta_enum_array) {
12327 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
12328 } else {
12329 *r->out.delta_enum_array = NULL;
12331 if (*r->out.delta_enum_array) {
12332 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
12333 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
12334 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12335 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
12337 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
12338 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12340 return NDR_ERR_SUCCESS;
12343 _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r)
12345 ndr_print_struct(ndr, name, "netr_DatabaseSync2");
12346 ndr->depth++;
12347 if (flags & NDR_SET_VALUES) {
12348 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12350 if (flags & NDR_IN) {
12351 ndr_print_struct(ndr, "in", "netr_DatabaseSync2");
12352 ndr->depth++;
12353 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12354 ndr->depth++;
12355 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12356 ndr->depth--;
12357 ndr_print_ptr(ndr, "computername", r->in.computername);
12358 ndr->depth++;
12359 ndr_print_string(ndr, "computername", r->in.computername);
12360 ndr->depth--;
12361 ndr_print_ptr(ndr, "credential", r->in.credential);
12362 ndr->depth++;
12363 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
12364 ndr->depth--;
12365 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
12366 ndr->depth++;
12367 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
12368 ndr->depth--;
12369 ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id);
12370 ndr_print_SyncStateEnum(ndr, "restart_state", r->in.restart_state);
12371 ndr_print_ptr(ndr, "sync_context", r->in.sync_context);
12372 ndr->depth++;
12373 ndr_print_uint32(ndr, "sync_context", *r->in.sync_context);
12374 ndr->depth--;
12375 ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength);
12376 ndr->depth--;
12378 if (flags & NDR_OUT) {
12379 ndr_print_struct(ndr, "out", "netr_DatabaseSync2");
12380 ndr->depth++;
12381 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
12382 ndr->depth++;
12383 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
12384 ndr->depth--;
12385 ndr_print_ptr(ndr, "sync_context", r->out.sync_context);
12386 ndr->depth++;
12387 ndr_print_uint32(ndr, "sync_context", *r->out.sync_context);
12388 ndr->depth--;
12389 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
12390 ndr->depth++;
12391 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
12392 ndr->depth++;
12393 if (*r->out.delta_enum_array) {
12394 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
12396 ndr->depth--;
12397 ndr->depth--;
12398 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12399 ndr->depth--;
12401 ndr->depth--;
12404 static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r)
12406 if (flags & NDR_IN) {
12407 if (r->in.logon_server == NULL) {
12408 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12410 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12411 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12412 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12413 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));
12414 if (r->in.computername == NULL) {
12415 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12417 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12418 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12419 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
12420 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12421 if (r->in.credential == NULL) {
12422 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12424 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12425 if (r->in.return_authenticator == NULL) {
12426 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12428 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12430 struct ndr_push *_ndr_change_log_entry;
12431 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_change_log_entry, 4, -1));
12432 NDR_CHECK(ndr_push_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry));
12433 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_change_log_entry, 4, -1));
12435 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->iconv_convenience, ndr->flags)));
12437 if (flags & NDR_OUT) {
12438 if (r->out.return_authenticator == NULL) {
12439 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12441 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12442 if (r->out.delta_enum_array == NULL) {
12443 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12445 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
12446 if (*r->out.delta_enum_array) {
12447 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12449 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
12451 return NDR_ERR_SUCCESS;
12454 static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r)
12456 uint32_t _ptr_delta_enum_array;
12457 TALLOC_CTX *_mem_save_credential_0;
12458 TALLOC_CTX *_mem_save_return_authenticator_0;
12459 TALLOC_CTX *_mem_save_delta_enum_array_0;
12460 TALLOC_CTX *_mem_save_delta_enum_array_1;
12461 if (flags & NDR_IN) {
12462 ZERO_STRUCT(r->out);
12464 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12465 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12466 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
12467 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
12469 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
12470 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
12471 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername));
12472 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername));
12473 if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) {
12474 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername));
12476 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
12477 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
12478 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12479 NDR_PULL_ALLOC(ndr, r->in.credential);
12481 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
12482 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
12483 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
12484 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
12485 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12486 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
12488 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12489 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12490 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
12491 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12493 struct ndr_pull *_ndr_change_log_entry;
12494 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_change_log_entry, 4, -1));
12495 NDR_CHECK(ndr_pull_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry));
12496 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_change_log_entry, 4, -1));
12498 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size));
12499 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12500 *r->out.return_authenticator = *r->in.return_authenticator;
12501 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12502 ZERO_STRUCTP(r->out.delta_enum_array);
12504 if (flags & NDR_OUT) {
12505 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12506 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
12508 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
12509 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
12510 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
12511 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
12512 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12513 NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
12515 _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
12516 NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
12517 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
12518 if (_ptr_delta_enum_array) {
12519 NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
12520 } else {
12521 *r->out.delta_enum_array = NULL;
12523 if (*r->out.delta_enum_array) {
12524 _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
12525 NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
12526 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
12527 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
12529 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
12530 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
12532 return NDR_ERR_SUCCESS;
12535 _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r)
12537 ndr_print_struct(ndr, name, "netr_DatabaseRedo");
12538 ndr->depth++;
12539 if (flags & NDR_SET_VALUES) {
12540 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12542 if (flags & NDR_IN) {
12543 ndr_print_struct(ndr, "in", "netr_DatabaseRedo");
12544 ndr->depth++;
12545 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12546 ndr->depth++;
12547 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12548 ndr->depth--;
12549 ndr_print_ptr(ndr, "computername", r->in.computername);
12550 ndr->depth++;
12551 ndr_print_string(ndr, "computername", r->in.computername);
12552 ndr->depth--;
12553 ndr_print_ptr(ndr, "credential", r->in.credential);
12554 ndr->depth++;
12555 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
12556 ndr->depth--;
12557 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
12558 ndr->depth++;
12559 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
12560 ndr->depth--;
12561 ndr_print_netr_ChangeLogEntry(ndr, "change_log_entry", &r->in.change_log_entry);
12562 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);
12563 ndr->depth--;
12565 if (flags & NDR_OUT) {
12566 ndr_print_struct(ndr, "out", "netr_DatabaseRedo");
12567 ndr->depth++;
12568 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
12569 ndr->depth++;
12570 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
12571 ndr->depth--;
12572 ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
12573 ndr->depth++;
12574 ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
12575 ndr->depth++;
12576 if (*r->out.delta_enum_array) {
12577 ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
12579 ndr->depth--;
12580 ndr->depth--;
12581 ndr_print_NTSTATUS(ndr, "result", r->out.result);
12582 ndr->depth--;
12584 ndr->depth--;
12587 static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r)
12589 if (flags & NDR_IN) {
12590 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
12591 if (r->in.logon_server) {
12592 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12593 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12594 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
12595 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));
12597 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code));
12598 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
12599 if (r->in.data == NULL) {
12600 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12602 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code));
12603 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12605 if (flags & NDR_OUT) {
12606 if (r->out.query == NULL) {
12607 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12609 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.query, r->in.level));
12610 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
12611 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12613 return NDR_ERR_SUCCESS;
12616 static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r)
12618 uint32_t _ptr_logon_server;
12619 TALLOC_CTX *_mem_save_logon_server_0;
12620 TALLOC_CTX *_mem_save_data_0;
12621 TALLOC_CTX *_mem_save_query_0;
12622 if (flags & NDR_IN) {
12623 ZERO_STRUCT(r->out);
12625 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server));
12626 if (_ptr_logon_server) {
12627 NDR_PULL_ALLOC(ndr, r->in.logon_server);
12628 } else {
12629 r->in.logon_server = NULL;
12631 if (r->in.logon_server) {
12632 _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
12633 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0);
12634 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server));
12635 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server));
12636 if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) {
12637 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server));
12639 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t)));
12640 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16));
12641 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0);
12643 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code));
12644 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
12645 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12646 NDR_PULL_ALLOC(ndr, r->in.data);
12648 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
12649 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
12650 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code));
12651 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
12652 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
12653 NDR_PULL_ALLOC(ndr, r->out.query);
12654 ZERO_STRUCTP(r->out.query);
12656 if (flags & NDR_OUT) {
12657 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12658 NDR_PULL_ALLOC(ndr, r->out.query);
12660 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
12661 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
12662 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level));
12663 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
12664 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
12665 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12667 return NDR_ERR_SUCCESS;
12670 _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r)
12672 ndr_print_struct(ndr, name, "netr_LogonControl2Ex");
12673 ndr->depth++;
12674 if (flags & NDR_SET_VALUES) {
12675 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12677 if (flags & NDR_IN) {
12678 ndr_print_struct(ndr, "in", "netr_LogonControl2Ex");
12679 ndr->depth++;
12680 ndr_print_ptr(ndr, "logon_server", r->in.logon_server);
12681 ndr->depth++;
12682 if (r->in.logon_server) {
12683 ndr_print_string(ndr, "logon_server", r->in.logon_server);
12685 ndr->depth--;
12686 ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code);
12687 ndr_print_uint32(ndr, "level", r->in.level);
12688 ndr_print_ptr(ndr, "data", r->in.data);
12689 ndr->depth++;
12690 ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code);
12691 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data);
12692 ndr->depth--;
12693 ndr->depth--;
12695 if (flags & NDR_OUT) {
12696 ndr_print_struct(ndr, "out", "netr_LogonControl2Ex");
12697 ndr->depth++;
12698 ndr_print_ptr(ndr, "query", r->out.query);
12699 ndr->depth++;
12700 ndr_print_set_switch_value(ndr, r->out.query, r->in.level);
12701 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query);
12702 ndr->depth--;
12703 ndr_print_WERROR(ndr, "result", r->out.result);
12704 ndr->depth--;
12706 ndr->depth--;
12709 static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
12711 if (flags & NDR_IN) {
12712 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
12713 if (r->in.server_name) {
12714 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12715 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12716 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
12717 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));
12720 if (flags & NDR_OUT) {
12721 if (r->out.trusted_domains_blob == NULL) {
12722 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12724 NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
12725 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12727 return NDR_ERR_SUCCESS;
12730 static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r)
12732 uint32_t _ptr_server_name;
12733 TALLOC_CTX *_mem_save_server_name_0;
12734 TALLOC_CTX *_mem_save_trusted_domains_blob_0;
12735 if (flags & NDR_IN) {
12736 ZERO_STRUCT(r->out);
12738 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
12739 if (_ptr_server_name) {
12740 NDR_PULL_ALLOC(ndr, r->in.server_name);
12741 } else {
12742 r->in.server_name = NULL;
12744 if (r->in.server_name) {
12745 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
12746 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
12747 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
12748 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
12749 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
12750 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
12752 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
12753 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
12754 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
12756 NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
12757 ZERO_STRUCTP(r->out.trusted_domains_blob);
12759 if (flags & NDR_OUT) {
12760 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12761 NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
12763 _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
12764 NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC);
12765 NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
12766 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC);
12767 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12769 return NDR_ERR_SUCCESS;
12772 _PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
12774 ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains");
12775 ndr->depth++;
12776 if (flags & NDR_SET_VALUES) {
12777 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12779 if (flags & NDR_IN) {
12780 ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains");
12781 ndr->depth++;
12782 ndr_print_ptr(ndr, "server_name", r->in.server_name);
12783 ndr->depth++;
12784 if (r->in.server_name) {
12785 ndr_print_string(ndr, "server_name", r->in.server_name);
12787 ndr->depth--;
12788 ndr->depth--;
12790 if (flags & NDR_OUT) {
12791 ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains");
12792 ndr->depth++;
12793 ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
12794 ndr->depth++;
12795 ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
12796 ndr->depth--;
12797 ndr_print_WERROR(ndr, "result", r->out.result);
12798 ndr->depth--;
12800 ndr->depth--;
12803 static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r)
12805 if (flags & NDR_IN) {
12806 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
12807 if (r->in.server_unc) {
12808 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
12809 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12810 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
12811 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));
12813 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
12814 if (r->in.domain_name) {
12815 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
12816 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
12817 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
12818 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));
12820 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
12821 if (r->in.domain_guid) {
12822 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
12824 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_guid));
12825 if (r->in.site_guid) {
12826 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.site_guid));
12828 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
12830 if (flags & NDR_OUT) {
12831 if (r->out.info == NULL) {
12832 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12834 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
12835 if (*r->out.info) {
12836 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
12838 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12840 return NDR_ERR_SUCCESS;
12843 static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r)
12845 uint32_t _ptr_server_unc;
12846 uint32_t _ptr_domain_name;
12847 uint32_t _ptr_domain_guid;
12848 uint32_t _ptr_site_guid;
12849 uint32_t _ptr_info;
12850 TALLOC_CTX *_mem_save_server_unc_0;
12851 TALLOC_CTX *_mem_save_domain_name_0;
12852 TALLOC_CTX *_mem_save_domain_guid_0;
12853 TALLOC_CTX *_mem_save_site_guid_0;
12854 TALLOC_CTX *_mem_save_info_0;
12855 TALLOC_CTX *_mem_save_info_1;
12856 if (flags & NDR_IN) {
12857 ZERO_STRUCT(r->out);
12859 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
12860 if (_ptr_server_unc) {
12861 NDR_PULL_ALLOC(ndr, r->in.server_unc);
12862 } else {
12863 r->in.server_unc = NULL;
12865 if (r->in.server_unc) {
12866 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
12867 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
12868 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
12869 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
12870 if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) {
12871 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc));
12873 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t)));
12874 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16));
12875 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
12877 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
12878 if (_ptr_domain_name) {
12879 NDR_PULL_ALLOC(ndr, r->in.domain_name);
12880 } else {
12881 r->in.domain_name = NULL;
12883 if (r->in.domain_name) {
12884 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
12885 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
12886 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
12887 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
12888 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
12889 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
12891 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t)));
12892 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16));
12893 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
12895 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
12896 if (_ptr_domain_guid) {
12897 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
12898 } else {
12899 r->in.domain_guid = NULL;
12901 if (r->in.domain_guid) {
12902 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
12903 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
12904 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
12905 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
12907 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_guid));
12908 if (_ptr_site_guid) {
12909 NDR_PULL_ALLOC(ndr, r->in.site_guid);
12910 } else {
12911 r->in.site_guid = NULL;
12913 if (r->in.site_guid) {
12914 _mem_save_site_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
12915 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_guid, 0);
12916 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.site_guid));
12917 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0);
12919 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
12920 NDR_PULL_ALLOC(ndr, r->out.info);
12921 ZERO_STRUCTP(r->out.info);
12923 if (flags & NDR_OUT) {
12924 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12925 NDR_PULL_ALLOC(ndr, r->out.info);
12927 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
12928 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
12929 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
12930 if (_ptr_info) {
12931 NDR_PULL_ALLOC(ndr, *r->out.info);
12932 } else {
12933 *r->out.info = NULL;
12935 if (*r->out.info) {
12936 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
12937 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
12938 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
12939 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
12941 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
12942 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12944 return NDR_ERR_SUCCESS;
12947 _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r)
12949 ndr_print_struct(ndr, name, "netr_DsRGetDCName");
12950 ndr->depth++;
12951 if (flags & NDR_SET_VALUES) {
12952 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12954 if (flags & NDR_IN) {
12955 ndr_print_struct(ndr, "in", "netr_DsRGetDCName");
12956 ndr->depth++;
12957 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
12958 ndr->depth++;
12959 if (r->in.server_unc) {
12960 ndr_print_string(ndr, "server_unc", r->in.server_unc);
12962 ndr->depth--;
12963 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
12964 ndr->depth++;
12965 if (r->in.domain_name) {
12966 ndr_print_string(ndr, "domain_name", r->in.domain_name);
12968 ndr->depth--;
12969 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
12970 ndr->depth++;
12971 if (r->in.domain_guid) {
12972 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
12974 ndr->depth--;
12975 ndr_print_ptr(ndr, "site_guid", r->in.site_guid);
12976 ndr->depth++;
12977 if (r->in.site_guid) {
12978 ndr_print_GUID(ndr, "site_guid", r->in.site_guid);
12980 ndr->depth--;
12981 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
12982 ndr->depth--;
12984 if (flags & NDR_OUT) {
12985 ndr_print_struct(ndr, "out", "netr_DsRGetDCName");
12986 ndr->depth++;
12987 ndr_print_ptr(ndr, "info", r->out.info);
12988 ndr->depth++;
12989 ndr_print_ptr(ndr, "info", *r->out.info);
12990 ndr->depth++;
12991 if (*r->out.info) {
12992 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
12994 ndr->depth--;
12995 ndr->depth--;
12996 ndr_print_WERROR(ndr, "result", r->out.result);
12997 ndr->depth--;
12999 ndr->depth--;
13002 static enum ndr_err_code ndr_push_netr_LogonGetCapabilities(struct ndr_push *ndr, int flags, const struct netr_LogonGetCapabilities *r)
13004 if (flags & NDR_IN) {
13005 if (r->in.server_name == NULL) {
13006 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13008 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13009 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13010 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13011 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));
13012 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
13013 if (r->in.computer_name) {
13014 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13015 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13016 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13017 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));
13019 if (r->in.credential == NULL) {
13020 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13022 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
13023 if (r->in.return_authenticator == NULL) {
13024 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13026 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
13027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.query_level));
13029 if (flags & NDR_OUT) {
13030 if (r->out.return_authenticator == NULL) {
13031 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13033 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
13034 if (r->out.capabilities == NULL) {
13035 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13037 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.capabilities, r->in.query_level));
13038 NDR_CHECK(ndr_push_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities));
13039 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
13041 return NDR_ERR_SUCCESS;
13044 static enum ndr_err_code ndr_pull_netr_LogonGetCapabilities(struct ndr_pull *ndr, int flags, struct netr_LogonGetCapabilities *r)
13046 uint32_t _ptr_computer_name;
13047 TALLOC_CTX *_mem_save_computer_name_0;
13048 TALLOC_CTX *_mem_save_credential_0;
13049 TALLOC_CTX *_mem_save_return_authenticator_0;
13050 TALLOC_CTX *_mem_save_capabilities_0;
13051 if (flags & NDR_IN) {
13052 ZERO_STRUCT(r->out);
13054 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13055 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13056 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
13057 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
13059 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
13060 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
13061 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
13062 if (_ptr_computer_name) {
13063 NDR_PULL_ALLOC(ndr, r->in.computer_name);
13064 } else {
13065 r->in.computer_name = NULL;
13067 if (r->in.computer_name) {
13068 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13069 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
13070 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
13071 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
13072 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
13073 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
13075 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
13076 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
13077 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
13079 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13080 NDR_PULL_ALLOC(ndr, r->in.credential);
13082 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
13083 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
13084 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
13085 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
13086 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13087 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
13089 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
13090 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
13091 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
13092 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
13093 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.query_level));
13094 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
13095 *r->out.return_authenticator = *r->in.return_authenticator;
13096 NDR_PULL_ALLOC(ndr, r->out.capabilities);
13097 ZERO_STRUCTP(r->out.capabilities);
13099 if (flags & NDR_OUT) {
13100 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13101 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
13103 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
13104 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
13105 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
13106 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
13107 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13108 NDR_PULL_ALLOC(ndr, r->out.capabilities);
13110 _mem_save_capabilities_0 = NDR_PULL_GET_MEM_CTX(ndr);
13111 NDR_PULL_SET_MEM_CTX(ndr, r->out.capabilities, LIBNDR_FLAG_REF_ALLOC);
13112 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.capabilities, r->in.query_level));
13113 NDR_CHECK(ndr_pull_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities));
13114 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_capabilities_0, LIBNDR_FLAG_REF_ALLOC);
13115 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
13117 return NDR_ERR_SUCCESS;
13120 _PUBLIC_ void ndr_print_netr_LogonGetCapabilities(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetCapabilities *r)
13122 ndr_print_struct(ndr, name, "netr_LogonGetCapabilities");
13123 ndr->depth++;
13124 if (flags & NDR_SET_VALUES) {
13125 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13127 if (flags & NDR_IN) {
13128 ndr_print_struct(ndr, "in", "netr_LogonGetCapabilities");
13129 ndr->depth++;
13130 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13131 ndr->depth++;
13132 ndr_print_string(ndr, "server_name", r->in.server_name);
13133 ndr->depth--;
13134 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
13135 ndr->depth++;
13136 if (r->in.computer_name) {
13137 ndr_print_string(ndr, "computer_name", r->in.computer_name);
13139 ndr->depth--;
13140 ndr_print_ptr(ndr, "credential", r->in.credential);
13141 ndr->depth++;
13142 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
13143 ndr->depth--;
13144 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
13145 ndr->depth++;
13146 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
13147 ndr->depth--;
13148 ndr_print_uint32(ndr, "query_level", r->in.query_level);
13149 ndr->depth--;
13151 if (flags & NDR_OUT) {
13152 ndr_print_struct(ndr, "out", "netr_LogonGetCapabilities");
13153 ndr->depth++;
13154 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
13155 ndr->depth++;
13156 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
13157 ndr->depth--;
13158 ndr_print_ptr(ndr, "capabilities", r->out.capabilities);
13159 ndr->depth++;
13160 ndr_print_set_switch_value(ndr, r->out.capabilities, r->in.query_level);
13161 ndr_print_netr_Capabilities(ndr, "capabilities", r->out.capabilities);
13162 ndr->depth--;
13163 ndr_print_NTSTATUS(ndr, "result", r->out.result);
13164 ndr->depth--;
13166 ndr->depth--;
13169 static enum ndr_err_code ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
13171 if (flags & NDR_IN) {
13173 if (flags & NDR_OUT) {
13174 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13176 return NDR_ERR_SUCCESS;
13179 static enum ndr_err_code ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r)
13181 if (flags & NDR_IN) {
13183 if (flags & NDR_OUT) {
13184 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13186 return NDR_ERR_SUCCESS;
13189 _PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
13191 ndr_print_struct(ndr, name, "netr_NETRLOGONSETSERVICEBITS");
13192 ndr->depth++;
13193 if (flags & NDR_SET_VALUES) {
13194 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13196 if (flags & NDR_IN) {
13197 ndr_print_struct(ndr, "in", "netr_NETRLOGONSETSERVICEBITS");
13198 ndr->depth++;
13199 ndr->depth--;
13201 if (flags & NDR_OUT) {
13202 ndr_print_struct(ndr, "out", "netr_NETRLOGONSETSERVICEBITS");
13203 ndr->depth++;
13204 ndr_print_WERROR(ndr, "result", r->out.result);
13205 ndr->depth--;
13207 ndr->depth--;
13210 static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r)
13212 if (flags & NDR_IN) {
13213 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
13214 if (r->in.server_name) {
13215 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13216 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13217 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13218 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));
13220 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
13221 if (r->in.domain_name) {
13222 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13223 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13224 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13225 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));
13228 if (flags & NDR_OUT) {
13229 if (r->out.rid == NULL) {
13230 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13232 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
13233 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13235 return NDR_ERR_SUCCESS;
13238 static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r)
13240 uint32_t _ptr_server_name;
13241 uint32_t _ptr_domain_name;
13242 TALLOC_CTX *_mem_save_server_name_0;
13243 TALLOC_CTX *_mem_save_domain_name_0;
13244 TALLOC_CTX *_mem_save_rid_0;
13245 if (flags & NDR_IN) {
13246 ZERO_STRUCT(r->out);
13248 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
13249 if (_ptr_server_name) {
13250 NDR_PULL_ALLOC(ndr, r->in.server_name);
13251 } else {
13252 r->in.server_name = NULL;
13254 if (r->in.server_name) {
13255 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13256 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
13257 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13258 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13259 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
13260 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
13262 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
13263 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
13264 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
13266 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
13267 if (_ptr_domain_name) {
13268 NDR_PULL_ALLOC(ndr, r->in.domain_name);
13269 } else {
13270 r->in.domain_name = NULL;
13272 if (r->in.domain_name) {
13273 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13274 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
13275 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
13276 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
13277 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
13278 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
13280 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t)));
13281 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16));
13282 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
13284 NDR_PULL_ALLOC(ndr, r->out.rid);
13285 ZERO_STRUCTP(r->out.rid);
13287 if (flags & NDR_OUT) {
13288 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13289 NDR_PULL_ALLOC(ndr, r->out.rid);
13291 _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13292 NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC);
13293 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid));
13294 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
13295 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13297 return NDR_ERR_SUCCESS;
13300 _PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r)
13302 ndr_print_struct(ndr, name, "netr_LogonGetTrustRid");
13303 ndr->depth++;
13304 if (flags & NDR_SET_VALUES) {
13305 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13307 if (flags & NDR_IN) {
13308 ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid");
13309 ndr->depth++;
13310 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13311 ndr->depth++;
13312 if (r->in.server_name) {
13313 ndr_print_string(ndr, "server_name", r->in.server_name);
13315 ndr->depth--;
13316 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
13317 ndr->depth++;
13318 if (r->in.domain_name) {
13319 ndr_print_string(ndr, "domain_name", r->in.domain_name);
13321 ndr->depth--;
13322 ndr->depth--;
13324 if (flags & NDR_OUT) {
13325 ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid");
13326 ndr->depth++;
13327 ndr_print_ptr(ndr, "rid", r->out.rid);
13328 ndr->depth++;
13329 ndr_print_uint32(ndr, "rid", *r->out.rid);
13330 ndr->depth--;
13331 ndr_print_WERROR(ndr, "result", r->out.result);
13332 ndr->depth--;
13334 ndr->depth--;
13337 static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13339 if (flags & NDR_IN) {
13341 if (flags & NDR_OUT) {
13342 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13344 return NDR_ERR_SUCCESS;
13347 static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13349 if (flags & NDR_IN) {
13351 if (flags & NDR_OUT) {
13352 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13354 return NDR_ERR_SUCCESS;
13357 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
13359 ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTESERVERDIGEST");
13360 ndr->depth++;
13361 if (flags & NDR_SET_VALUES) {
13362 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13364 if (flags & NDR_IN) {
13365 ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST");
13366 ndr->depth++;
13367 ndr->depth--;
13369 if (flags & NDR_OUT) {
13370 ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST");
13371 ndr->depth++;
13372 ndr_print_WERROR(ndr, "result", r->out.result);
13373 ndr->depth--;
13375 ndr->depth--;
13378 static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13380 if (flags & NDR_IN) {
13382 if (flags & NDR_OUT) {
13383 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13385 return NDR_ERR_SUCCESS;
13388 static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13390 if (flags & NDR_IN) {
13392 if (flags & NDR_OUT) {
13393 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13395 return NDR_ERR_SUCCESS;
13398 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
13400 ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13401 ndr->depth++;
13402 if (flags & NDR_SET_VALUES) {
13403 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13405 if (flags & NDR_IN) {
13406 ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13407 ndr->depth++;
13408 ndr->depth--;
13410 if (flags & NDR_OUT) {
13411 ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
13412 ndr->depth++;
13413 ndr_print_WERROR(ndr, "result", r->out.result);
13414 ndr->depth--;
13416 ndr->depth--;
13419 _PUBLIC_ enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r)
13421 if (flags & NDR_IN) {
13422 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
13423 if (r->in.server_name) {
13424 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13425 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13426 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13427 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));
13429 if (r->in.account_name == NULL) {
13430 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13432 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
13433 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13434 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
13435 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));
13436 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
13437 if (r->in.computer_name == NULL) {
13438 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13440 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13441 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13442 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13443 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));
13444 if (r->in.credentials == NULL) {
13445 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13447 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
13448 if (r->in.negotiate_flags == NULL) {
13449 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13451 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags));
13453 if (flags & NDR_OUT) {
13454 if (r->out.return_credentials == NULL) {
13455 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13457 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
13458 if (r->out.negotiate_flags == NULL) {
13459 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13461 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags));
13462 if (r->out.rid == NULL) {
13463 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13465 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
13466 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
13468 return NDR_ERR_SUCCESS;
13471 _PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r)
13473 uint32_t _ptr_server_name;
13474 TALLOC_CTX *_mem_save_server_name_0;
13475 TALLOC_CTX *_mem_save_credentials_0;
13476 TALLOC_CTX *_mem_save_return_credentials_0;
13477 TALLOC_CTX *_mem_save_negotiate_flags_0;
13478 TALLOC_CTX *_mem_save_rid_0;
13479 if (flags & NDR_IN) {
13480 ZERO_STRUCT(r->out);
13482 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
13483 if (_ptr_server_name) {
13484 NDR_PULL_ALLOC(ndr, r->in.server_name);
13485 } else {
13486 r->in.server_name = NULL;
13488 if (r->in.server_name) {
13489 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13490 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
13491 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
13492 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
13493 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
13494 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
13496 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
13497 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
13498 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
13500 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
13501 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
13502 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
13503 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
13505 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
13506 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
13507 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
13508 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
13509 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
13510 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
13511 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
13513 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
13514 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
13515 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13516 NDR_PULL_ALLOC(ndr, r->in.credentials);
13518 _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
13519 NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
13520 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
13521 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
13522 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13523 NDR_PULL_ALLOC(ndr, r->in.negotiate_flags);
13525 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
13526 NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
13527 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags));
13528 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
13529 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
13530 ZERO_STRUCTP(r->out.return_credentials);
13531 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
13532 *r->out.negotiate_flags = *r->in.negotiate_flags;
13533 NDR_PULL_ALLOC(ndr, r->out.rid);
13534 ZERO_STRUCTP(r->out.rid);
13536 if (flags & NDR_OUT) {
13537 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13538 NDR_PULL_ALLOC(ndr, r->out.return_credentials);
13540 _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
13541 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
13542 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
13543 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
13544 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13545 NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
13547 _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
13548 NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
13549 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags));
13550 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
13551 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13552 NDR_PULL_ALLOC(ndr, r->out.rid);
13554 _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13555 NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC);
13556 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid));
13557 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
13558 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
13560 return NDR_ERR_SUCCESS;
13563 _PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r)
13565 ndr_print_struct(ndr, name, "netr_ServerAuthenticate3");
13566 ndr->depth++;
13567 if (flags & NDR_SET_VALUES) {
13568 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13570 if (flags & NDR_IN) {
13571 ndr_print_struct(ndr, "in", "netr_ServerAuthenticate3");
13572 ndr->depth++;
13573 ndr_print_ptr(ndr, "server_name", r->in.server_name);
13574 ndr->depth++;
13575 if (r->in.server_name) {
13576 ndr_print_string(ndr, "server_name", r->in.server_name);
13578 ndr->depth--;
13579 ndr_print_ptr(ndr, "account_name", r->in.account_name);
13580 ndr->depth++;
13581 ndr_print_string(ndr, "account_name", r->in.account_name);
13582 ndr->depth--;
13583 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
13584 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
13585 ndr->depth++;
13586 ndr_print_string(ndr, "computer_name", r->in.computer_name);
13587 ndr->depth--;
13588 ndr_print_ptr(ndr, "credentials", r->in.credentials);
13589 ndr->depth++;
13590 ndr_print_netr_Credential(ndr, "credentials", r->in.credentials);
13591 ndr->depth--;
13592 ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags);
13593 ndr->depth++;
13594 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags);
13595 ndr->depth--;
13596 ndr->depth--;
13598 if (flags & NDR_OUT) {
13599 ndr_print_struct(ndr, "out", "netr_ServerAuthenticate3");
13600 ndr->depth++;
13601 ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
13602 ndr->depth++;
13603 ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
13604 ndr->depth--;
13605 ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags);
13606 ndr->depth++;
13607 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags);
13608 ndr->depth--;
13609 ndr_print_ptr(ndr, "rid", r->out.rid);
13610 ndr->depth++;
13611 ndr_print_uint32(ndr, "rid", *r->out.rid);
13612 ndr->depth--;
13613 ndr_print_NTSTATUS(ndr, "result", r->out.result);
13614 ndr->depth--;
13616 ndr->depth--;
13619 static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r)
13621 if (flags & NDR_IN) {
13622 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
13623 if (r->in.server_unc) {
13624 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
13625 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13626 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
13627 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));
13629 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
13630 if (r->in.domain_name) {
13631 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13632 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13633 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
13634 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));
13636 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
13637 if (r->in.domain_guid) {
13638 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
13640 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
13641 if (r->in.site_name) {
13642 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
13643 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13644 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
13645 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));
13647 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
13649 if (flags & NDR_OUT) {
13650 if (r->out.info == NULL) {
13651 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13653 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
13654 if (*r->out.info) {
13655 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
13657 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13659 return NDR_ERR_SUCCESS;
13662 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r)
13664 uint32_t _ptr_server_unc;
13665 uint32_t _ptr_domain_name;
13666 uint32_t _ptr_domain_guid;
13667 uint32_t _ptr_site_name;
13668 uint32_t _ptr_info;
13669 TALLOC_CTX *_mem_save_server_unc_0;
13670 TALLOC_CTX *_mem_save_domain_name_0;
13671 TALLOC_CTX *_mem_save_domain_guid_0;
13672 TALLOC_CTX *_mem_save_site_name_0;
13673 TALLOC_CTX *_mem_save_info_0;
13674 TALLOC_CTX *_mem_save_info_1;
13675 if (flags & NDR_IN) {
13676 ZERO_STRUCT(r->out);
13678 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
13679 if (_ptr_server_unc) {
13680 NDR_PULL_ALLOC(ndr, r->in.server_unc);
13681 } else {
13682 r->in.server_unc = NULL;
13684 if (r->in.server_unc) {
13685 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
13686 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
13687 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
13688 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
13689 if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) {
13690 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc));
13692 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t)));
13693 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16));
13694 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
13696 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
13697 if (_ptr_domain_name) {
13698 NDR_PULL_ALLOC(ndr, r->in.domain_name);
13699 } else {
13700 r->in.domain_name = NULL;
13702 if (r->in.domain_name) {
13703 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13704 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
13705 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
13706 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
13707 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
13708 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
13710 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t)));
13711 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16));
13712 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
13714 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
13715 if (_ptr_domain_guid) {
13716 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
13717 } else {
13718 r->in.domain_guid = NULL;
13720 if (r->in.domain_guid) {
13721 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13722 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
13723 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
13724 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
13726 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
13727 if (_ptr_site_name) {
13728 NDR_PULL_ALLOC(ndr, r->in.site_name);
13729 } else {
13730 r->in.site_name = NULL;
13732 if (r->in.site_name) {
13733 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13734 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
13735 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
13736 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
13737 if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) {
13738 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name));
13740 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t)));
13741 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16));
13742 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
13744 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
13745 NDR_PULL_ALLOC(ndr, r->out.info);
13746 ZERO_STRUCTP(r->out.info);
13748 if (flags & NDR_OUT) {
13749 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13750 NDR_PULL_ALLOC(ndr, r->out.info);
13752 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13753 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
13754 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
13755 if (_ptr_info) {
13756 NDR_PULL_ALLOC(ndr, *r->out.info);
13757 } else {
13758 *r->out.info = NULL;
13760 if (*r->out.info) {
13761 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
13762 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
13763 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
13764 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
13766 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
13767 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13769 return NDR_ERR_SUCCESS;
13772 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r)
13774 ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx");
13775 ndr->depth++;
13776 if (flags & NDR_SET_VALUES) {
13777 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13779 if (flags & NDR_IN) {
13780 ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx");
13781 ndr->depth++;
13782 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
13783 ndr->depth++;
13784 if (r->in.server_unc) {
13785 ndr_print_string(ndr, "server_unc", r->in.server_unc);
13787 ndr->depth--;
13788 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
13789 ndr->depth++;
13790 if (r->in.domain_name) {
13791 ndr_print_string(ndr, "domain_name", r->in.domain_name);
13793 ndr->depth--;
13794 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
13795 ndr->depth++;
13796 if (r->in.domain_guid) {
13797 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
13799 ndr->depth--;
13800 ndr_print_ptr(ndr, "site_name", r->in.site_name);
13801 ndr->depth++;
13802 if (r->in.site_name) {
13803 ndr_print_string(ndr, "site_name", r->in.site_name);
13805 ndr->depth--;
13806 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
13807 ndr->depth--;
13809 if (flags & NDR_OUT) {
13810 ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx");
13811 ndr->depth++;
13812 ndr_print_ptr(ndr, "info", r->out.info);
13813 ndr->depth++;
13814 ndr_print_ptr(ndr, "info", *r->out.info);
13815 ndr->depth++;
13816 if (*r->out.info) {
13817 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
13819 ndr->depth--;
13820 ndr->depth--;
13821 ndr_print_WERROR(ndr, "result", r->out.result);
13822 ndr->depth--;
13824 ndr->depth--;
13827 static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r)
13829 if (flags & NDR_IN) {
13830 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
13831 if (r->in.computer_name) {
13832 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13833 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13834 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13835 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));
13838 if (flags & NDR_OUT) {
13839 if (r->out.site == NULL) {
13840 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13842 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site));
13843 if (*r->out.site) {
13844 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
13845 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13846 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
13847 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16));
13849 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13851 return NDR_ERR_SUCCESS;
13854 static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r)
13856 uint32_t _ptr_computer_name;
13857 uint32_t _ptr_site;
13858 TALLOC_CTX *_mem_save_computer_name_0;
13859 TALLOC_CTX *_mem_save_site_0;
13860 TALLOC_CTX *_mem_save_site_1;
13861 if (flags & NDR_IN) {
13862 ZERO_STRUCT(r->out);
13864 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
13865 if (_ptr_computer_name) {
13866 NDR_PULL_ALLOC(ndr, r->in.computer_name);
13867 } else {
13868 r->in.computer_name = NULL;
13870 if (r->in.computer_name) {
13871 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
13872 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
13873 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
13874 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
13875 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
13876 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
13878 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
13879 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
13880 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
13882 NDR_PULL_ALLOC(ndr, r->out.site);
13883 ZERO_STRUCTP(r->out.site);
13885 if (flags & NDR_OUT) {
13886 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13887 NDR_PULL_ALLOC(ndr, r->out.site);
13889 _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr);
13890 NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC);
13891 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site));
13892 if (_ptr_site) {
13893 NDR_PULL_ALLOC(ndr, *r->out.site);
13894 } else {
13895 *r->out.site = NULL;
13897 if (*r->out.site) {
13898 _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr);
13899 NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0);
13900 NDR_CHECK(ndr_pull_array_size(ndr, r->out.site));
13901 NDR_CHECK(ndr_pull_array_length(ndr, r->out.site));
13902 if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) {
13903 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site));
13905 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t)));
13906 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16));
13907 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0);
13909 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC);
13910 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13912 return NDR_ERR_SUCCESS;
13915 _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r)
13917 ndr_print_struct(ndr, name, "netr_DsRGetSiteName");
13918 ndr->depth++;
13919 if (flags & NDR_SET_VALUES) {
13920 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13922 if (flags & NDR_IN) {
13923 ndr_print_struct(ndr, "in", "netr_DsRGetSiteName");
13924 ndr->depth++;
13925 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
13926 ndr->depth++;
13927 if (r->in.computer_name) {
13928 ndr_print_string(ndr, "computer_name", r->in.computer_name);
13930 ndr->depth--;
13931 ndr->depth--;
13933 if (flags & NDR_OUT) {
13934 ndr_print_struct(ndr, "out", "netr_DsRGetSiteName");
13935 ndr->depth++;
13936 ndr_print_ptr(ndr, "site", r->out.site);
13937 ndr->depth++;
13938 ndr_print_ptr(ndr, "site", *r->out.site);
13939 ndr->depth++;
13940 if (*r->out.site) {
13941 ndr_print_string(ndr, "site", *r->out.site);
13943 ndr->depth--;
13944 ndr->depth--;
13945 ndr_print_WERROR(ndr, "result", r->out.result);
13946 ndr->depth--;
13948 ndr->depth--;
13951 static enum ndr_err_code ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r)
13953 if (flags & NDR_IN) {
13954 if (r->in.server_name == NULL) {
13955 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13957 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13958 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13959 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
13960 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));
13961 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
13962 if (r->in.computer_name) {
13963 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13964 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13965 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
13966 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));
13968 if (r->in.credential == NULL) {
13969 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13971 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
13972 if (r->in.return_authenticator == NULL) {
13973 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13975 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
13976 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
13977 if (r->in.query == NULL) {
13978 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13980 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.query, r->in.level));
13981 NDR_CHECK(ndr_push_netr_WorkstationInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.query));
13983 if (flags & NDR_OUT) {
13984 if (r->out.return_authenticator == NULL) {
13985 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13987 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
13988 if (r->out.info == NULL) {
13989 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13991 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
13992 NDR_CHECK(ndr_push_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
13993 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
13995 return NDR_ERR_SUCCESS;
13998 static enum ndr_err_code ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r)
14000 uint32_t _ptr_computer_name;
14001 TALLOC_CTX *_mem_save_computer_name_0;
14002 TALLOC_CTX *_mem_save_credential_0;
14003 TALLOC_CTX *_mem_save_return_authenticator_0;
14004 TALLOC_CTX *_mem_save_query_0;
14005 TALLOC_CTX *_mem_save_info_0;
14006 if (flags & NDR_IN) {
14007 ZERO_STRUCT(r->out);
14009 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14010 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14011 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
14012 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
14014 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
14015 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
14016 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
14017 if (_ptr_computer_name) {
14018 NDR_PULL_ALLOC(ndr, r->in.computer_name);
14019 } else {
14020 r->in.computer_name = NULL;
14022 if (r->in.computer_name) {
14023 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14024 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
14025 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14026 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14027 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
14028 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
14030 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
14031 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
14032 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
14034 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14035 NDR_PULL_ALLOC(ndr, r->in.credential);
14037 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14038 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14039 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14040 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14041 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14042 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
14044 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14045 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14046 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
14047 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14048 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
14049 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14050 NDR_PULL_ALLOC(ndr, r->in.query);
14052 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
14053 NDR_PULL_SET_MEM_CTX(ndr, r->in.query, LIBNDR_FLAG_REF_ALLOC);
14054 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.query, r->in.level));
14055 NDR_CHECK(ndr_pull_netr_WorkstationInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.query));
14056 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
14057 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14058 *r->out.return_authenticator = *r->in.return_authenticator;
14059 NDR_PULL_ALLOC(ndr, r->out.info);
14060 ZERO_STRUCTP(r->out.info);
14062 if (flags & NDR_OUT) {
14063 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14064 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14066 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14067 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14068 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14069 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14070 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14071 NDR_PULL_ALLOC(ndr, r->out.info);
14073 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
14074 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
14075 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
14076 NDR_CHECK(ndr_pull_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14077 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
14078 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
14080 return NDR_ERR_SUCCESS;
14083 _PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r)
14085 ndr_print_struct(ndr, name, "netr_LogonGetDomainInfo");
14086 ndr->depth++;
14087 if (flags & NDR_SET_VALUES) {
14088 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14090 if (flags & NDR_IN) {
14091 ndr_print_struct(ndr, "in", "netr_LogonGetDomainInfo");
14092 ndr->depth++;
14093 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14094 ndr->depth++;
14095 ndr_print_string(ndr, "server_name", r->in.server_name);
14096 ndr->depth--;
14097 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14098 ndr->depth++;
14099 if (r->in.computer_name) {
14100 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14102 ndr->depth--;
14103 ndr_print_ptr(ndr, "credential", r->in.credential);
14104 ndr->depth++;
14105 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14106 ndr->depth--;
14107 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
14108 ndr->depth++;
14109 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
14110 ndr->depth--;
14111 ndr_print_uint32(ndr, "level", r->in.level);
14112 ndr_print_ptr(ndr, "query", r->in.query);
14113 ndr->depth++;
14114 ndr_print_set_switch_value(ndr, r->in.query, r->in.level);
14115 ndr_print_netr_WorkstationInfo(ndr, "query", r->in.query);
14116 ndr->depth--;
14117 ndr->depth--;
14119 if (flags & NDR_OUT) {
14120 ndr_print_struct(ndr, "out", "netr_LogonGetDomainInfo");
14121 ndr->depth++;
14122 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14123 ndr->depth++;
14124 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14125 ndr->depth--;
14126 ndr_print_ptr(ndr, "info", r->out.info);
14127 ndr->depth++;
14128 ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
14129 ndr_print_netr_DomainInfo(ndr, "info", r->out.info);
14130 ndr->depth--;
14131 ndr_print_NTSTATUS(ndr, "result", r->out.result);
14132 ndr->depth--;
14134 ndr->depth--;
14137 static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r)
14139 if (flags & NDR_IN) {
14140 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14141 if (r->in.server_name) {
14142 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14143 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14144 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14145 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));
14147 if (r->in.account_name == NULL) {
14148 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14150 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14151 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14152 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14153 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));
14154 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
14155 if (r->in.computer_name == NULL) {
14156 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14158 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14159 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14160 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14161 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));
14162 if (r->in.credential == NULL) {
14163 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14165 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14166 if (r->in.new_password == NULL) {
14167 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14169 NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
14171 if (flags & NDR_OUT) {
14172 if (r->out.return_authenticator == NULL) {
14173 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14175 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14176 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
14178 return NDR_ERR_SUCCESS;
14181 static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r)
14183 uint32_t _ptr_server_name;
14184 TALLOC_CTX *_mem_save_server_name_0;
14185 TALLOC_CTX *_mem_save_credential_0;
14186 TALLOC_CTX *_mem_save_return_authenticator_0;
14187 TALLOC_CTX *_mem_save_new_password_0;
14188 if (flags & NDR_IN) {
14189 ZERO_STRUCT(r->out);
14191 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14192 if (_ptr_server_name) {
14193 NDR_PULL_ALLOC(ndr, r->in.server_name);
14194 } else {
14195 r->in.server_name = NULL;
14197 if (r->in.server_name) {
14198 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14199 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14200 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14201 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14202 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
14203 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
14205 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
14206 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
14207 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
14209 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
14210 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
14211 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
14212 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
14214 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
14215 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
14216 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
14217 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14218 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14219 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
14220 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
14222 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
14223 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
14224 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14225 NDR_PULL_ALLOC(ndr, r->in.credential);
14227 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14228 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14229 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14230 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14231 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14232 NDR_PULL_ALLOC(ndr, r->in.new_password);
14234 _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
14235 NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
14236 NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
14237 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
14238 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14239 ZERO_STRUCTP(r->out.return_authenticator);
14241 if (flags & NDR_OUT) {
14242 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14243 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14245 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14246 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14247 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14248 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14249 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
14251 return NDR_ERR_SUCCESS;
14254 _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r)
14256 ndr_print_struct(ndr, name, "netr_ServerPasswordSet2");
14257 ndr->depth++;
14258 if (flags & NDR_SET_VALUES) {
14259 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14261 if (flags & NDR_IN) {
14262 ndr_print_struct(ndr, "in", "netr_ServerPasswordSet2");
14263 ndr->depth++;
14264 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14265 ndr->depth++;
14266 if (r->in.server_name) {
14267 ndr_print_string(ndr, "server_name", r->in.server_name);
14269 ndr->depth--;
14270 ndr_print_ptr(ndr, "account_name", r->in.account_name);
14271 ndr->depth++;
14272 ndr_print_string(ndr, "account_name", r->in.account_name);
14273 ndr->depth--;
14274 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
14275 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14276 ndr->depth++;
14277 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14278 ndr->depth--;
14279 ndr_print_ptr(ndr, "credential", r->in.credential);
14280 ndr->depth++;
14281 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14282 ndr->depth--;
14283 ndr_print_ptr(ndr, "new_password", r->in.new_password);
14284 ndr->depth++;
14285 ndr_print_netr_CryptPassword(ndr, "new_password", r->in.new_password);
14286 ndr->depth--;
14287 ndr->depth--;
14289 if (flags & NDR_OUT) {
14290 ndr_print_struct(ndr, "out", "netr_ServerPasswordSet2");
14291 ndr->depth++;
14292 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14293 ndr->depth++;
14294 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14295 ndr->depth--;
14296 ndr_print_NTSTATUS(ndr, "result", r->out.result);
14297 ndr->depth--;
14299 ndr->depth--;
14302 static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r)
14304 if (flags & NDR_IN) {
14305 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14306 if (r->in.server_name) {
14307 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14308 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14309 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14310 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));
14312 if (r->in.account_name == NULL) {
14313 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14315 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14316 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14317 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
14318 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));
14319 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
14320 if (r->in.computer_name == NULL) {
14321 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14323 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14324 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14325 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
14326 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));
14327 if (r->in.credential == NULL) {
14328 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14330 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14332 if (flags & NDR_OUT) {
14333 if (r->out.return_authenticator == NULL) {
14334 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14336 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14337 if (r->out.password == NULL) {
14338 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14340 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password));
14341 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14343 return NDR_ERR_SUCCESS;
14346 static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r)
14348 uint32_t _ptr_server_name;
14349 TALLOC_CTX *_mem_save_server_name_0;
14350 TALLOC_CTX *_mem_save_credential_0;
14351 TALLOC_CTX *_mem_save_return_authenticator_0;
14352 TALLOC_CTX *_mem_save_password_0;
14353 if (flags & NDR_IN) {
14354 ZERO_STRUCT(r->out);
14356 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14357 if (_ptr_server_name) {
14358 NDR_PULL_ALLOC(ndr, r->in.server_name);
14359 } else {
14360 r->in.server_name = NULL;
14362 if (r->in.server_name) {
14363 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14364 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14365 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14366 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14367 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
14368 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
14370 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
14371 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
14372 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
14374 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
14375 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
14376 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
14377 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
14379 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
14380 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
14381 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
14382 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
14383 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
14384 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
14385 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
14387 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
14388 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
14389 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14390 NDR_PULL_ALLOC(ndr, r->in.credential);
14392 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
14393 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
14394 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
14395 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
14396 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14397 ZERO_STRUCTP(r->out.return_authenticator);
14398 NDR_PULL_ALLOC(ndr, r->out.password);
14399 ZERO_STRUCTP(r->out.password);
14401 if (flags & NDR_OUT) {
14402 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14403 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
14405 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
14406 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
14407 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
14408 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
14409 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14410 NDR_PULL_ALLOC(ndr, r->out.password);
14412 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
14413 NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
14414 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password));
14415 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
14416 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14418 return NDR_ERR_SUCCESS;
14421 _PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r)
14423 ndr_print_struct(ndr, name, "netr_ServerPasswordGet");
14424 ndr->depth++;
14425 if (flags & NDR_SET_VALUES) {
14426 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14428 if (flags & NDR_IN) {
14429 ndr_print_struct(ndr, "in", "netr_ServerPasswordGet");
14430 ndr->depth++;
14431 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14432 ndr->depth++;
14433 if (r->in.server_name) {
14434 ndr_print_string(ndr, "server_name", r->in.server_name);
14436 ndr->depth--;
14437 ndr_print_ptr(ndr, "account_name", r->in.account_name);
14438 ndr->depth++;
14439 ndr_print_string(ndr, "account_name", r->in.account_name);
14440 ndr->depth--;
14441 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
14442 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
14443 ndr->depth++;
14444 ndr_print_string(ndr, "computer_name", r->in.computer_name);
14445 ndr->depth--;
14446 ndr_print_ptr(ndr, "credential", r->in.credential);
14447 ndr->depth++;
14448 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
14449 ndr->depth--;
14450 ndr->depth--;
14452 if (flags & NDR_OUT) {
14453 ndr_print_struct(ndr, "out", "netr_ServerPasswordGet");
14454 ndr->depth++;
14455 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
14456 ndr->depth++;
14457 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
14458 ndr->depth--;
14459 ndr_print_ptr(ndr, "password", r->out.password);
14460 ndr->depth++;
14461 ndr_print_samr_Password(ndr, "password", r->out.password);
14462 ndr->depth--;
14463 ndr_print_WERROR(ndr, "result", r->out.result);
14464 ndr->depth--;
14466 ndr->depth--;
14469 static enum ndr_err_code ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
14471 if (flags & NDR_IN) {
14473 if (flags & NDR_OUT) {
14474 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14476 return NDR_ERR_SUCCESS;
14479 static enum ndr_err_code ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r)
14481 if (flags & NDR_IN) {
14483 if (flags & NDR_OUT) {
14484 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14486 return NDR_ERR_SUCCESS;
14489 _PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
14491 ndr_print_struct(ndr, name, "netr_NETRLOGONSENDTOSAM");
14492 ndr->depth++;
14493 if (flags & NDR_SET_VALUES) {
14494 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14496 if (flags & NDR_IN) {
14497 ndr_print_struct(ndr, "in", "netr_NETRLOGONSENDTOSAM");
14498 ndr->depth++;
14499 ndr->depth--;
14501 if (flags & NDR_OUT) {
14502 ndr_print_struct(ndr, "out", "netr_NETRLOGONSENDTOSAM");
14503 ndr->depth++;
14504 ndr_print_WERROR(ndr, "result", r->out.result);
14505 ndr->depth--;
14507 ndr->depth--;
14510 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r)
14512 uint32_t cntr_addresses_1;
14513 if (flags & NDR_IN) {
14514 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14515 if (r->in.server_name) {
14516 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14517 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14518 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14519 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));
14521 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
14522 if (r->in.addresses == NULL) {
14523 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14525 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.count));
14526 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14527 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
14529 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14530 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
14533 if (flags & NDR_OUT) {
14534 if (r->out.ctr == NULL) {
14535 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14537 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
14538 if (*r->out.ctr) {
14539 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
14541 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14543 return NDR_ERR_SUCCESS;
14546 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r)
14548 uint32_t _ptr_server_name;
14549 uint32_t cntr_addresses_1;
14550 uint32_t _ptr_ctr;
14551 TALLOC_CTX *_mem_save_server_name_0;
14552 TALLOC_CTX *_mem_save_addresses_1;
14553 TALLOC_CTX *_mem_save_ctr_0;
14554 TALLOC_CTX *_mem_save_ctr_1;
14555 if (flags & NDR_IN) {
14556 ZERO_STRUCT(r->out);
14558 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14559 if (_ptr_server_name) {
14560 NDR_PULL_ALLOC(ndr, r->in.server_name);
14561 } else {
14562 r->in.server_name = NULL;
14564 if (r->in.server_name) {
14565 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14566 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14567 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14568 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14569 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
14570 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
14572 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
14573 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
14574 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
14576 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
14577 if (r->in.count > 32000) {
14578 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
14580 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
14581 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14582 NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses));
14584 _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
14585 NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
14586 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14587 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
14589 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
14590 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
14592 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
14593 NDR_PULL_ALLOC(ndr, r->out.ctr);
14594 ZERO_STRUCTP(r->out.ctr);
14595 if (r->in.addresses) {
14596 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
14599 if (flags & NDR_OUT) {
14600 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14601 NDR_PULL_ALLOC(ndr, r->out.ctr);
14603 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14604 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14605 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
14606 if (_ptr_ctr) {
14607 NDR_PULL_ALLOC(ndr, *r->out.ctr);
14608 } else {
14609 *r->out.ctr = NULL;
14611 if (*r->out.ctr) {
14612 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
14613 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
14614 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
14615 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
14617 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14618 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14620 return NDR_ERR_SUCCESS;
14623 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r)
14625 uint32_t cntr_addresses_1;
14626 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW");
14627 ndr->depth++;
14628 if (flags & NDR_SET_VALUES) {
14629 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14631 if (flags & NDR_IN) {
14632 ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW");
14633 ndr->depth++;
14634 ndr_print_ptr(ndr, "server_name", r->in.server_name);
14635 ndr->depth++;
14636 if (r->in.server_name) {
14637 ndr_print_string(ndr, "server_name", r->in.server_name);
14639 ndr->depth--;
14640 ndr_print_uint32(ndr, "count", r->in.count);
14641 ndr_print_ptr(ndr, "addresses", r->in.addresses);
14642 ndr->depth++;
14643 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count);
14644 ndr->depth++;
14645 for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
14646 char *idx_1=NULL;
14647 if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) {
14648 ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
14649 free(idx_1);
14652 ndr->depth--;
14653 ndr->depth--;
14654 ndr->depth--;
14656 if (flags & NDR_OUT) {
14657 ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW");
14658 ndr->depth++;
14659 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14660 ndr->depth++;
14661 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
14662 ndr->depth++;
14663 if (*r->out.ctr) {
14664 ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr);
14666 ndr->depth--;
14667 ndr->depth--;
14668 ndr_print_WERROR(ndr, "result", r->out.result);
14669 ndr->depth--;
14671 ndr->depth--;
14674 static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r)
14676 if (flags & NDR_IN) {
14677 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
14678 if (r->in.server_unc) {
14679 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
14680 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14681 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, CH_UTF16)));
14682 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));
14684 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_account));
14685 if (r->in.client_account) {
14686 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16)));
14687 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14688 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16)));
14689 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));
14691 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask));
14692 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
14693 if (r->in.domain_name) {
14694 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
14695 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14696 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
14697 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));
14699 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
14700 if (r->in.domain_guid) {
14701 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
14703 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
14704 if (r->in.site_name) {
14705 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
14706 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14707 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
14708 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));
14710 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
14712 if (flags & NDR_OUT) {
14713 if (r->out.info == NULL) {
14714 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14716 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
14717 if (*r->out.info) {
14718 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
14720 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14722 return NDR_ERR_SUCCESS;
14725 static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r)
14727 uint32_t _ptr_server_unc;
14728 uint32_t _ptr_client_account;
14729 uint32_t _ptr_domain_name;
14730 uint32_t _ptr_domain_guid;
14731 uint32_t _ptr_site_name;
14732 uint32_t _ptr_info;
14733 TALLOC_CTX *_mem_save_server_unc_0;
14734 TALLOC_CTX *_mem_save_client_account_0;
14735 TALLOC_CTX *_mem_save_domain_name_0;
14736 TALLOC_CTX *_mem_save_domain_guid_0;
14737 TALLOC_CTX *_mem_save_site_name_0;
14738 TALLOC_CTX *_mem_save_info_0;
14739 TALLOC_CTX *_mem_save_info_1;
14740 if (flags & NDR_IN) {
14741 ZERO_STRUCT(r->out);
14743 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc));
14744 if (_ptr_server_unc) {
14745 NDR_PULL_ALLOC(ndr, r->in.server_unc);
14746 } else {
14747 r->in.server_unc = NULL;
14749 if (r->in.server_unc) {
14750 _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr);
14751 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0);
14752 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc));
14753 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc));
14754 if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) {
14755 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc));
14757 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t)));
14758 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16));
14759 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0);
14761 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account));
14762 if (_ptr_client_account) {
14763 NDR_PULL_ALLOC(ndr, r->in.client_account);
14764 } else {
14765 r->in.client_account = NULL;
14767 if (r->in.client_account) {
14768 _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
14769 NDR_PULL_SET_MEM_CTX(ndr, r->in.client_account, 0);
14770 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_account));
14771 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_account));
14772 if (ndr_get_array_length(ndr, &r->in.client_account) > ndr_get_array_size(ndr, &r->in.client_account)) {
14773 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client_account), ndr_get_array_length(ndr, &r->in.client_account));
14775 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t)));
14776 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t), CH_UTF16));
14777 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0);
14779 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask));
14780 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
14781 if (_ptr_domain_name) {
14782 NDR_PULL_ALLOC(ndr, r->in.domain_name);
14783 } else {
14784 r->in.domain_name = NULL;
14786 if (r->in.domain_name) {
14787 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14788 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
14789 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
14790 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
14791 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
14792 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
14794 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t)));
14795 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16));
14796 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
14798 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
14799 if (_ptr_domain_guid) {
14800 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
14801 } else {
14802 r->in.domain_guid = NULL;
14804 if (r->in.domain_guid) {
14805 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
14806 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
14807 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
14808 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
14810 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
14811 if (_ptr_site_name) {
14812 NDR_PULL_ALLOC(ndr, r->in.site_name);
14813 } else {
14814 r->in.site_name = NULL;
14816 if (r->in.site_name) {
14817 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14818 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
14819 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
14820 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
14821 if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) {
14822 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name));
14824 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t)));
14825 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16));
14826 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
14828 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
14829 NDR_PULL_ALLOC(ndr, r->out.info);
14830 ZERO_STRUCTP(r->out.info);
14832 if (flags & NDR_OUT) {
14833 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14834 NDR_PULL_ALLOC(ndr, r->out.info);
14836 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
14837 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
14838 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
14839 if (_ptr_info) {
14840 NDR_PULL_ALLOC(ndr, *r->out.info);
14841 } else {
14842 *r->out.info = NULL;
14844 if (*r->out.info) {
14845 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
14846 NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
14847 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
14848 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
14850 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
14851 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14853 return NDR_ERR_SUCCESS;
14856 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r)
14858 ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx2");
14859 ndr->depth++;
14860 if (flags & NDR_SET_VALUES) {
14861 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14863 if (flags & NDR_IN) {
14864 ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx2");
14865 ndr->depth++;
14866 ndr_print_ptr(ndr, "server_unc", r->in.server_unc);
14867 ndr->depth++;
14868 if (r->in.server_unc) {
14869 ndr_print_string(ndr, "server_unc", r->in.server_unc);
14871 ndr->depth--;
14872 ndr_print_ptr(ndr, "client_account", r->in.client_account);
14873 ndr->depth++;
14874 if (r->in.client_account) {
14875 ndr_print_string(ndr, "client_account", r->in.client_account);
14877 ndr->depth--;
14878 ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask);
14879 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
14880 ndr->depth++;
14881 if (r->in.domain_name) {
14882 ndr_print_string(ndr, "domain_name", r->in.domain_name);
14884 ndr->depth--;
14885 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
14886 ndr->depth++;
14887 if (r->in.domain_guid) {
14888 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
14890 ndr->depth--;
14891 ndr_print_ptr(ndr, "site_name", r->in.site_name);
14892 ndr->depth++;
14893 if (r->in.site_name) {
14894 ndr_print_string(ndr, "site_name", r->in.site_name);
14896 ndr->depth--;
14897 ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
14898 ndr->depth--;
14900 if (flags & NDR_OUT) {
14901 ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx2");
14902 ndr->depth++;
14903 ndr_print_ptr(ndr, "info", r->out.info);
14904 ndr->depth++;
14905 ndr_print_ptr(ndr, "info", *r->out.info);
14906 ndr->depth++;
14907 if (*r->out.info) {
14908 ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
14910 ndr->depth--;
14911 ndr->depth--;
14912 ndr_print_WERROR(ndr, "result", r->out.result);
14913 ndr->depth--;
14915 ndr->depth--;
14918 static enum ndr_err_code ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
14920 if (flags & NDR_IN) {
14922 if (flags & NDR_OUT) {
14923 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14925 return NDR_ERR_SUCCESS;
14928 static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
14930 if (flags & NDR_IN) {
14932 if (flags & NDR_OUT) {
14933 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14935 return NDR_ERR_SUCCESS;
14938 _PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
14940 ndr_print_struct(ndr, name, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14941 ndr->depth++;
14942 if (flags & NDR_SET_VALUES) {
14943 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14945 if (flags & NDR_IN) {
14946 ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14947 ndr->depth++;
14948 ndr->depth--;
14950 if (flags & NDR_OUT) {
14951 ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14952 ndr->depth++;
14953 ndr_print_WERROR(ndr, "result", r->out.result);
14954 ndr->depth--;
14956 ndr->depth--;
14959 static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
14961 if (flags & NDR_IN) {
14962 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
14963 if (r->in.server_name) {
14964 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14965 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
14966 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
14967 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));
14970 if (flags & NDR_OUT) {
14971 if (r->out.dom_trust_list == NULL) {
14972 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14974 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
14975 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14977 return NDR_ERR_SUCCESS;
14980 static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r)
14982 uint32_t _ptr_server_name;
14983 TALLOC_CTX *_mem_save_server_name_0;
14984 TALLOC_CTX *_mem_save_dom_trust_list_0;
14985 if (flags & NDR_IN) {
14986 ZERO_STRUCT(r->out);
14988 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
14989 if (_ptr_server_name) {
14990 NDR_PULL_ALLOC(ndr, r->in.server_name);
14991 } else {
14992 r->in.server_name = NULL;
14994 if (r->in.server_name) {
14995 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
14996 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
14997 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
14998 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
14999 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15000 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15002 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15003 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15004 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15006 NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
15007 ZERO_STRUCTP(r->out.dom_trust_list);
15009 if (flags & NDR_OUT) {
15010 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15011 NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
15013 _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
15014 NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC);
15015 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
15016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC);
15017 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15019 return NDR_ERR_SUCCESS;
15022 _PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
15024 ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx");
15025 ndr->depth++;
15026 if (flags & NDR_SET_VALUES) {
15027 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15029 if (flags & NDR_IN) {
15030 ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx");
15031 ndr->depth++;
15032 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15033 ndr->depth++;
15034 if (r->in.server_name) {
15035 ndr_print_string(ndr, "server_name", r->in.server_name);
15037 ndr->depth--;
15038 ndr->depth--;
15040 if (flags & NDR_OUT) {
15041 ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx");
15042 ndr->depth++;
15043 ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list);
15044 ndr->depth++;
15045 ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list);
15046 ndr->depth--;
15047 ndr_print_WERROR(ndr, "result", r->out.result);
15048 ndr->depth--;
15050 ndr->depth--;
15053 static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r)
15055 uint32_t cntr_addresses_1;
15056 if (flags & NDR_IN) {
15057 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15058 if (r->in.server_name) {
15059 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15060 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15061 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15062 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));
15064 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
15065 if (r->in.addresses == NULL) {
15066 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15068 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.count));
15069 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15070 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
15072 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15073 NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
15076 if (flags & NDR_OUT) {
15077 if (r->out.ctr == NULL) {
15078 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15080 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
15081 if (*r->out.ctr) {
15082 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15084 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15086 return NDR_ERR_SUCCESS;
15089 static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r)
15091 uint32_t _ptr_server_name;
15092 uint32_t cntr_addresses_1;
15093 uint32_t _ptr_ctr;
15094 TALLOC_CTX *_mem_save_server_name_0;
15095 TALLOC_CTX *_mem_save_addresses_1;
15096 TALLOC_CTX *_mem_save_ctr_0;
15097 TALLOC_CTX *_mem_save_ctr_1;
15098 if (flags & NDR_IN) {
15099 ZERO_STRUCT(r->out);
15101 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15102 if (_ptr_server_name) {
15103 NDR_PULL_ALLOC(ndr, r->in.server_name);
15104 } else {
15105 r->in.server_name = NULL;
15107 if (r->in.server_name) {
15108 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15109 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15110 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15111 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15112 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15113 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15115 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15116 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15117 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15119 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
15120 if (r->in.count > 32000) {
15121 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
15123 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
15124 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15125 NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses));
15127 _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
15128 NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
15129 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15130 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
15132 for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
15133 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
15135 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
15136 NDR_PULL_ALLOC(ndr, r->out.ctr);
15137 ZERO_STRUCTP(r->out.ctr);
15138 if (r->in.addresses) {
15139 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
15142 if (flags & NDR_OUT) {
15143 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15144 NDR_PULL_ALLOC(ndr, r->out.ctr);
15146 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15147 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15148 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
15149 if (_ptr_ctr) {
15150 NDR_PULL_ALLOC(ndr, *r->out.ctr);
15151 } else {
15152 *r->out.ctr = NULL;
15154 if (*r->out.ctr) {
15155 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
15156 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
15157 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15158 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
15160 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15161 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15163 return NDR_ERR_SUCCESS;
15166 _PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r)
15168 uint32_t cntr_addresses_1;
15169 ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW");
15170 ndr->depth++;
15171 if (flags & NDR_SET_VALUES) {
15172 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15174 if (flags & NDR_IN) {
15175 ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW");
15176 ndr->depth++;
15177 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15178 ndr->depth++;
15179 if (r->in.server_name) {
15180 ndr_print_string(ndr, "server_name", r->in.server_name);
15182 ndr->depth--;
15183 ndr_print_uint32(ndr, "count", r->in.count);
15184 ndr_print_ptr(ndr, "addresses", r->in.addresses);
15185 ndr->depth++;
15186 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count);
15187 ndr->depth++;
15188 for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
15189 char *idx_1=NULL;
15190 if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) {
15191 ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
15192 free(idx_1);
15195 ndr->depth--;
15196 ndr->depth--;
15197 ndr->depth--;
15199 if (flags & NDR_OUT) {
15200 ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW");
15201 ndr->depth++;
15202 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15203 ndr->depth++;
15204 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
15205 ndr->depth++;
15206 if (*r->out.ctr) {
15207 ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr);
15209 ndr->depth--;
15210 ndr->depth--;
15211 ndr_print_WERROR(ndr, "result", r->out.result);
15212 ndr->depth--;
15214 ndr->depth--;
15217 static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
15219 if (flags & NDR_IN) {
15220 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15221 if (r->in.server_name) {
15222 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15223 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15224 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15225 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));
15228 if (flags & NDR_OUT) {
15229 if (r->out.ctr == NULL) {
15230 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15232 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
15233 if (*r->out.ctr) {
15234 NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15236 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15238 return NDR_ERR_SUCCESS;
15241 static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r)
15243 uint32_t _ptr_server_name;
15244 uint32_t _ptr_ctr;
15245 TALLOC_CTX *_mem_save_server_name_0;
15246 TALLOC_CTX *_mem_save_ctr_0;
15247 TALLOC_CTX *_mem_save_ctr_1;
15248 if (flags & NDR_IN) {
15249 ZERO_STRUCT(r->out);
15251 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15252 if (_ptr_server_name) {
15253 NDR_PULL_ALLOC(ndr, r->in.server_name);
15254 } else {
15255 r->in.server_name = NULL;
15257 if (r->in.server_name) {
15258 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15259 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15260 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15261 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15262 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15263 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15265 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15266 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15267 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15269 NDR_PULL_ALLOC(ndr, r->out.ctr);
15270 ZERO_STRUCTP(r->out.ctr);
15272 if (flags & NDR_OUT) {
15273 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15274 NDR_PULL_ALLOC(ndr, r->out.ctr);
15276 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15277 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15278 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
15279 if (_ptr_ctr) {
15280 NDR_PULL_ALLOC(ndr, *r->out.ctr);
15281 } else {
15282 *r->out.ctr = NULL;
15284 if (*r->out.ctr) {
15285 _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
15286 NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
15287 NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
15288 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
15290 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15291 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15293 return NDR_ERR_SUCCESS;
15296 _PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
15298 ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW");
15299 ndr->depth++;
15300 if (flags & NDR_SET_VALUES) {
15301 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15303 if (flags & NDR_IN) {
15304 ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW");
15305 ndr->depth++;
15306 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15307 ndr->depth++;
15308 if (r->in.server_name) {
15309 ndr_print_string(ndr, "server_name", r->in.server_name);
15311 ndr->depth--;
15312 ndr->depth--;
15314 if (flags & NDR_OUT) {
15315 ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW");
15316 ndr->depth++;
15317 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15318 ndr->depth++;
15319 ndr_print_ptr(ndr, "ctr", *r->out.ctr);
15320 ndr->depth++;
15321 if (*r->out.ctr) {
15322 ndr_print_DcSitesCtr(ndr, "ctr", *r->out.ctr);
15324 ndr->depth--;
15325 ndr->depth--;
15326 ndr_print_WERROR(ndr, "result", r->out.result);
15327 ndr->depth--;
15329 ndr->depth--;
15332 static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r)
15334 if (flags & NDR_IN) {
15335 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15336 if (r->in.server_name) {
15337 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15338 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15339 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15340 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));
15342 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
15343 if (r->in.computer_name) {
15344 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15345 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15346 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15347 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));
15349 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
15350 if (r->in.logon == NULL) {
15351 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15353 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
15354 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
15355 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
15356 if (r->in.flags == NULL) {
15357 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15359 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags));
15361 if (flags & NDR_OUT) {
15362 if (r->out.validation == NULL) {
15363 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15365 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
15366 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
15367 if (r->out.authoritative == NULL) {
15368 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15370 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
15371 if (r->out.flags == NULL) {
15372 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15374 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
15375 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
15377 return NDR_ERR_SUCCESS;
15380 static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r)
15382 uint32_t _ptr_server_name;
15383 uint32_t _ptr_computer_name;
15384 TALLOC_CTX *_mem_save_server_name_0;
15385 TALLOC_CTX *_mem_save_computer_name_0;
15386 TALLOC_CTX *_mem_save_logon_0;
15387 TALLOC_CTX *_mem_save_validation_0;
15388 TALLOC_CTX *_mem_save_authoritative_0;
15389 TALLOC_CTX *_mem_save_flags_0;
15390 if (flags & NDR_IN) {
15391 ZERO_STRUCT(r->out);
15393 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15394 if (_ptr_server_name) {
15395 NDR_PULL_ALLOC(ndr, r->in.server_name);
15396 } else {
15397 r->in.server_name = NULL;
15399 if (r->in.server_name) {
15400 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15401 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15402 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15403 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15404 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15405 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15407 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15408 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15409 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15411 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
15412 if (_ptr_computer_name) {
15413 NDR_PULL_ALLOC(ndr, r->in.computer_name);
15414 } else {
15415 r->in.computer_name = NULL;
15417 if (r->in.computer_name) {
15418 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15419 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
15420 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
15421 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
15422 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
15423 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
15425 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
15426 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
15427 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
15429 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
15430 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15431 NDR_PULL_ALLOC(ndr, r->in.logon);
15433 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
15434 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
15435 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
15436 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
15437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
15438 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
15439 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15440 NDR_PULL_ALLOC(ndr, r->in.flags);
15442 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
15443 NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC);
15444 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags));
15445 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
15446 NDR_PULL_ALLOC(ndr, r->out.validation);
15447 ZERO_STRUCTP(r->out.validation);
15448 NDR_PULL_ALLOC(ndr, r->out.authoritative);
15449 ZERO_STRUCTP(r->out.authoritative);
15450 NDR_PULL_ALLOC(ndr, r->out.flags);
15451 *r->out.flags = *r->in.flags;
15453 if (flags & NDR_OUT) {
15454 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15455 NDR_PULL_ALLOC(ndr, r->out.validation);
15457 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
15458 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
15459 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
15460 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
15461 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
15462 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15463 NDR_PULL_ALLOC(ndr, r->out.authoritative);
15465 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
15466 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
15467 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
15468 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
15469 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15470 NDR_PULL_ALLOC(ndr, r->out.flags);
15472 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
15473 NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC);
15474 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags));
15475 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
15476 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
15478 return NDR_ERR_SUCCESS;
15481 _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r)
15483 ndr_print_struct(ndr, name, "netr_LogonSamLogonEx");
15484 ndr->depth++;
15485 if (flags & NDR_SET_VALUES) {
15486 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15488 if (flags & NDR_IN) {
15489 ndr_print_struct(ndr, "in", "netr_LogonSamLogonEx");
15490 ndr->depth++;
15491 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15492 ndr->depth++;
15493 if (r->in.server_name) {
15494 ndr_print_string(ndr, "server_name", r->in.server_name);
15496 ndr->depth--;
15497 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
15498 ndr->depth++;
15499 if (r->in.computer_name) {
15500 ndr_print_string(ndr, "computer_name", r->in.computer_name);
15502 ndr->depth--;
15503 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
15504 ndr_print_ptr(ndr, "logon", r->in.logon);
15505 ndr->depth++;
15506 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
15507 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
15508 ndr->depth--;
15509 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
15510 ndr_print_ptr(ndr, "flags", r->in.flags);
15511 ndr->depth++;
15512 ndr_print_uint32(ndr, "flags", *r->in.flags);
15513 ndr->depth--;
15514 ndr->depth--;
15516 if (flags & NDR_OUT) {
15517 ndr_print_struct(ndr, "out", "netr_LogonSamLogonEx");
15518 ndr->depth++;
15519 ndr_print_ptr(ndr, "validation", r->out.validation);
15520 ndr->depth++;
15521 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
15522 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
15523 ndr->depth--;
15524 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
15525 ndr->depth++;
15526 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
15527 ndr->depth--;
15528 ndr_print_ptr(ndr, "flags", r->out.flags);
15529 ndr->depth++;
15530 ndr_print_uint32(ndr, "flags", *r->out.flags);
15531 ndr->depth--;
15532 ndr_print_NTSTATUS(ndr, "result", r->out.result);
15533 ndr->depth--;
15535 ndr->depth--;
15538 static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
15540 if (flags & NDR_IN) {
15541 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15542 if (r->in.server_name) {
15543 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15544 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15545 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15546 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));
15548 NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags));
15550 if (flags & NDR_OUT) {
15551 if (r->out.trusts == NULL) {
15552 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15554 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
15555 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15557 return NDR_ERR_SUCCESS;
15560 static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r)
15562 uint32_t _ptr_server_name;
15563 TALLOC_CTX *_mem_save_server_name_0;
15564 TALLOC_CTX *_mem_save_trusts_0;
15565 if (flags & NDR_IN) {
15566 ZERO_STRUCT(r->out);
15568 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15569 if (_ptr_server_name) {
15570 NDR_PULL_ALLOC(ndr, r->in.server_name);
15571 } else {
15572 r->in.server_name = NULL;
15574 if (r->in.server_name) {
15575 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15576 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15577 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15578 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15579 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15580 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15582 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15583 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15584 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15586 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags));
15587 NDR_PULL_ALLOC(ndr, r->out.trusts);
15588 ZERO_STRUCTP(r->out.trusts);
15590 if (flags & NDR_OUT) {
15591 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15592 NDR_PULL_ALLOC(ndr, r->out.trusts);
15594 _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr);
15595 NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC);
15596 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
15597 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC);
15598 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15600 return NDR_ERR_SUCCESS;
15603 _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
15605 ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts");
15606 ndr->depth++;
15607 if (flags & NDR_SET_VALUES) {
15608 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15610 if (flags & NDR_IN) {
15611 ndr_print_struct(ndr, "in", "netr_DsrEnumerateDomainTrusts");
15612 ndr->depth++;
15613 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15614 ndr->depth++;
15615 if (r->in.server_name) {
15616 ndr_print_string(ndr, "server_name", r->in.server_name);
15618 ndr->depth--;
15619 ndr_print_netr_TrustFlags(ndr, "trust_flags", r->in.trust_flags);
15620 ndr->depth--;
15622 if (flags & NDR_OUT) {
15623 ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts");
15624 ndr->depth++;
15625 ndr_print_ptr(ndr, "trusts", r->out.trusts);
15626 ndr->depth++;
15627 ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts);
15628 ndr->depth--;
15629 ndr_print_WERROR(ndr, "result", r->out.result);
15630 ndr->depth--;
15632 ndr->depth--;
15635 static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
15637 if (flags & NDR_IN) {
15638 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15639 if (r->in.server_name) {
15640 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15641 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15642 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15643 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));
15645 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain));
15646 if (r->in.domain) {
15647 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
15648 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15649 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
15650 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
15652 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
15653 if (r->in.domain_guid) {
15654 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
15656 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid));
15657 if (r->in.dsa_guid) {
15658 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.dsa_guid));
15660 if (r->in.dns_host == NULL) {
15661 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15663 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
15664 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15665 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
15666 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));
15668 if (flags & NDR_OUT) {
15669 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15671 return NDR_ERR_SUCCESS;
15674 static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r)
15676 uint32_t _ptr_server_name;
15677 uint32_t _ptr_domain;
15678 uint32_t _ptr_domain_guid;
15679 uint32_t _ptr_dsa_guid;
15680 TALLOC_CTX *_mem_save_server_name_0;
15681 TALLOC_CTX *_mem_save_domain_0;
15682 TALLOC_CTX *_mem_save_domain_guid_0;
15683 TALLOC_CTX *_mem_save_dsa_guid_0;
15684 if (flags & NDR_IN) {
15685 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15686 if (_ptr_server_name) {
15687 NDR_PULL_ALLOC(ndr, r->in.server_name);
15688 } else {
15689 r->in.server_name = NULL;
15691 if (r->in.server_name) {
15692 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15693 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15694 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15695 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15696 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15697 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15699 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15700 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15701 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15703 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
15704 if (_ptr_domain) {
15705 NDR_PULL_ALLOC(ndr, r->in.domain);
15706 } else {
15707 r->in.domain = NULL;
15709 if (r->in.domain) {
15710 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
15711 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0);
15712 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
15713 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
15714 if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) {
15715 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain));
15717 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t)));
15718 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t), CH_UTF16));
15719 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
15721 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
15722 if (_ptr_domain_guid) {
15723 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
15724 } else {
15725 r->in.domain_guid = NULL;
15727 if (r->in.domain_guid) {
15728 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
15729 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
15730 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
15731 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
15733 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid));
15734 if (_ptr_dsa_guid) {
15735 NDR_PULL_ALLOC(ndr, r->in.dsa_guid);
15736 } else {
15737 r->in.dsa_guid = NULL;
15739 if (r->in.dsa_guid) {
15740 _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
15741 NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0);
15742 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.dsa_guid));
15743 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0);
15745 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host));
15746 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host));
15747 if (ndr_get_array_length(ndr, &r->in.dns_host) > ndr_get_array_size(ndr, &r->in.dns_host)) {
15748 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_host), ndr_get_array_length(ndr, &r->in.dns_host));
15750 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t)));
15751 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t), CH_UTF16));
15753 if (flags & NDR_OUT) {
15754 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15756 return NDR_ERR_SUCCESS;
15759 _PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
15761 ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords");
15762 ndr->depth++;
15763 if (flags & NDR_SET_VALUES) {
15764 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15766 if (flags & NDR_IN) {
15767 ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords");
15768 ndr->depth++;
15769 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15770 ndr->depth++;
15771 if (r->in.server_name) {
15772 ndr_print_string(ndr, "server_name", r->in.server_name);
15774 ndr->depth--;
15775 ndr_print_ptr(ndr, "domain", r->in.domain);
15776 ndr->depth++;
15777 if (r->in.domain) {
15778 ndr_print_string(ndr, "domain", r->in.domain);
15780 ndr->depth--;
15781 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
15782 ndr->depth++;
15783 if (r->in.domain_guid) {
15784 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
15786 ndr->depth--;
15787 ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid);
15788 ndr->depth++;
15789 if (r->in.dsa_guid) {
15790 ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid);
15792 ndr->depth--;
15793 ndr_print_ptr(ndr, "dns_host", r->in.dns_host);
15794 ndr->depth++;
15795 ndr_print_string(ndr, "dns_host", r->in.dns_host);
15796 ndr->depth--;
15797 ndr->depth--;
15799 if (flags & NDR_OUT) {
15800 ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords");
15801 ndr->depth++;
15802 ndr_print_WERROR(ndr, "result", r->out.result);
15803 ndr->depth--;
15805 ndr->depth--;
15808 static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r)
15810 if (flags & NDR_IN) {
15811 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15812 if (r->in.server_name) {
15813 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15814 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15815 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15816 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));
15818 if (r->in.account_name == NULL) {
15819 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15821 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
15822 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15823 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
15824 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));
15825 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
15826 if (r->in.computer_name == NULL) {
15827 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15829 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15830 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
15831 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
15832 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));
15833 if (r->in.credential == NULL) {
15834 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15836 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
15838 if (flags & NDR_OUT) {
15839 if (r->out.return_authenticator == NULL) {
15840 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15842 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
15843 if (r->out.password == NULL) {
15844 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15846 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password));
15847 if (r->out.password2 == NULL) {
15848 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15850 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password2));
15851 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
15853 return NDR_ERR_SUCCESS;
15856 static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r)
15858 uint32_t _ptr_server_name;
15859 TALLOC_CTX *_mem_save_server_name_0;
15860 TALLOC_CTX *_mem_save_credential_0;
15861 TALLOC_CTX *_mem_save_return_authenticator_0;
15862 TALLOC_CTX *_mem_save_password_0;
15863 TALLOC_CTX *_mem_save_password2_0;
15864 if (flags & NDR_IN) {
15865 ZERO_STRUCT(r->out);
15867 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
15868 if (_ptr_server_name) {
15869 NDR_PULL_ALLOC(ndr, r->in.server_name);
15870 } else {
15871 r->in.server_name = NULL;
15873 if (r->in.server_name) {
15874 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
15875 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
15876 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
15877 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
15878 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
15879 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
15881 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
15882 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
15883 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
15885 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
15886 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
15887 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
15888 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
15890 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
15891 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
15892 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
15893 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
15894 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
15895 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
15896 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
15898 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
15899 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
15900 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15901 NDR_PULL_ALLOC(ndr, r->in.credential);
15903 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
15904 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
15905 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
15906 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
15907 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
15908 ZERO_STRUCTP(r->out.return_authenticator);
15909 NDR_PULL_ALLOC(ndr, r->out.password);
15910 ZERO_STRUCTP(r->out.password);
15911 NDR_PULL_ALLOC(ndr, r->out.password2);
15912 ZERO_STRUCTP(r->out.password2);
15914 if (flags & NDR_OUT) {
15915 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15916 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
15918 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
15919 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
15920 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
15921 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
15922 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15923 NDR_PULL_ALLOC(ndr, r->out.password);
15925 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
15926 NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
15927 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password));
15928 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
15929 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15930 NDR_PULL_ALLOC(ndr, r->out.password2);
15932 _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr);
15933 NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC);
15934 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password2));
15935 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC);
15936 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
15938 return NDR_ERR_SUCCESS;
15941 _PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r)
15943 ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet");
15944 ndr->depth++;
15945 if (flags & NDR_SET_VALUES) {
15946 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15948 if (flags & NDR_IN) {
15949 ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet");
15950 ndr->depth++;
15951 ndr_print_ptr(ndr, "server_name", r->in.server_name);
15952 ndr->depth++;
15953 if (r->in.server_name) {
15954 ndr_print_string(ndr, "server_name", r->in.server_name);
15956 ndr->depth--;
15957 ndr_print_ptr(ndr, "account_name", r->in.account_name);
15958 ndr->depth++;
15959 ndr_print_string(ndr, "account_name", r->in.account_name);
15960 ndr->depth--;
15961 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
15962 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
15963 ndr->depth++;
15964 ndr_print_string(ndr, "computer_name", r->in.computer_name);
15965 ndr->depth--;
15966 ndr_print_ptr(ndr, "credential", r->in.credential);
15967 ndr->depth++;
15968 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
15969 ndr->depth--;
15970 ndr->depth--;
15972 if (flags & NDR_OUT) {
15973 ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet");
15974 ndr->depth++;
15975 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
15976 ndr->depth++;
15977 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
15978 ndr->depth--;
15979 ndr_print_ptr(ndr, "password", r->out.password);
15980 ndr->depth++;
15981 ndr_print_samr_Password(ndr, "password", r->out.password);
15982 ndr->depth--;
15983 ndr_print_ptr(ndr, "password2", r->out.password2);
15984 ndr->depth++;
15985 ndr_print_samr_Password(ndr, "password2", r->out.password2);
15986 ndr->depth--;
15987 ndr_print_NTSTATUS(ndr, "result", r->out.result);
15988 ndr->depth--;
15990 ndr->depth--;
15993 static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r)
15995 if (flags & NDR_IN) {
15996 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
15997 if (r->in.server_name) {
15998 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
15999 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16000 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16001 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));
16003 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name));
16004 if (r->in.trusted_domain_name) {
16005 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16006 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16007 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16008 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));
16010 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
16012 if (flags & NDR_OUT) {
16013 if (r->out.forest_trust_info == NULL) {
16014 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16016 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
16017 if (*r->out.forest_trust_info) {
16018 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16020 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16022 return NDR_ERR_SUCCESS;
16025 static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r)
16027 uint32_t _ptr_server_name;
16028 uint32_t _ptr_trusted_domain_name;
16029 uint32_t _ptr_forest_trust_info;
16030 TALLOC_CTX *_mem_save_server_name_0;
16031 TALLOC_CTX *_mem_save_trusted_domain_name_0;
16032 TALLOC_CTX *_mem_save_forest_trust_info_0;
16033 TALLOC_CTX *_mem_save_forest_trust_info_1;
16034 if (flags & NDR_IN) {
16035 ZERO_STRUCT(r->out);
16037 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16038 if (_ptr_server_name) {
16039 NDR_PULL_ALLOC(ndr, r->in.server_name);
16040 } else {
16041 r->in.server_name = NULL;
16043 if (r->in.server_name) {
16044 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16045 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16046 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16047 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16048 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
16049 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
16051 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
16052 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
16053 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16055 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name));
16056 if (_ptr_trusted_domain_name) {
16057 NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name);
16058 } else {
16059 r->in.trusted_domain_name = NULL;
16061 if (r->in.trusted_domain_name) {
16062 _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16063 NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0);
16064 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
16065 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
16066 if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) {
16067 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name));
16069 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t)));
16070 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16));
16071 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0);
16073 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
16074 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16075 ZERO_STRUCTP(r->out.forest_trust_info);
16077 if (flags & NDR_OUT) {
16078 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16079 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16081 _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
16082 NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
16083 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
16084 if (_ptr_forest_trust_info) {
16085 NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
16086 } else {
16087 *r->out.forest_trust_info = NULL;
16089 if (*r->out.forest_trust_info) {
16090 _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
16091 NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
16092 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16093 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
16095 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
16096 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16098 return NDR_ERR_SUCCESS;
16101 _PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r)
16103 ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation");
16104 ndr->depth++;
16105 if (flags & NDR_SET_VALUES) {
16106 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16108 if (flags & NDR_IN) {
16109 ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation");
16110 ndr->depth++;
16111 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16112 ndr->depth++;
16113 if (r->in.server_name) {
16114 ndr_print_string(ndr, "server_name", r->in.server_name);
16116 ndr->depth--;
16117 ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16118 ndr->depth++;
16119 if (r->in.trusted_domain_name) {
16120 ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16122 ndr->depth--;
16123 ndr_print_uint32(ndr, "flags", r->in.flags);
16124 ndr->depth--;
16126 if (flags & NDR_OUT) {
16127 ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation");
16128 ndr->depth++;
16129 ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
16130 ndr->depth++;
16131 ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
16132 ndr->depth++;
16133 if (*r->out.forest_trust_info) {
16134 ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
16136 ndr->depth--;
16137 ndr->depth--;
16138 ndr_print_WERROR(ndr, "result", r->out.result);
16139 ndr->depth--;
16141 ndr->depth--;
16144 static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r)
16146 if (flags & NDR_IN) {
16147 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16148 if (r->in.server_name) {
16149 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16150 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16151 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16152 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));
16154 if (r->in.trusted_domain_name == NULL) {
16155 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16157 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16158 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16159 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
16160 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));
16161 if (r->in.credential == NULL) {
16162 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16164 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16165 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
16167 if (flags & NDR_OUT) {
16168 if (r->out.return_authenticator == NULL) {
16169 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16171 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16172 if (r->out.forest_trust_info == NULL) {
16173 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16175 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
16176 if (*r->out.forest_trust_info) {
16177 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16179 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
16181 return NDR_ERR_SUCCESS;
16184 static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r)
16186 uint32_t _ptr_server_name;
16187 uint32_t _ptr_forest_trust_info;
16188 TALLOC_CTX *_mem_save_server_name_0;
16189 TALLOC_CTX *_mem_save_credential_0;
16190 TALLOC_CTX *_mem_save_return_authenticator_0;
16191 TALLOC_CTX *_mem_save_forest_trust_info_0;
16192 TALLOC_CTX *_mem_save_forest_trust_info_1;
16193 if (flags & NDR_IN) {
16194 ZERO_STRUCT(r->out);
16196 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16197 if (_ptr_server_name) {
16198 NDR_PULL_ALLOC(ndr, r->in.server_name);
16199 } else {
16200 r->in.server_name = NULL;
16202 if (r->in.server_name) {
16203 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16204 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16205 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16206 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16207 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
16208 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
16210 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
16211 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
16212 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16214 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
16215 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
16216 if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) {
16217 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name));
16219 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t)));
16220 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16));
16221 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16222 NDR_PULL_ALLOC(ndr, r->in.credential);
16224 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16225 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
16226 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16227 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
16228 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
16229 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16230 ZERO_STRUCTP(r->out.return_authenticator);
16231 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16232 ZERO_STRUCTP(r->out.forest_trust_info);
16234 if (flags & NDR_OUT) {
16235 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16236 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16238 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16239 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
16240 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16241 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
16242 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16243 NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
16245 _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
16246 NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
16247 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
16248 if (_ptr_forest_trust_info) {
16249 NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
16250 } else {
16251 *r->out.forest_trust_info = NULL;
16253 if (*r->out.forest_trust_info) {
16254 _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
16255 NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
16256 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
16257 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
16259 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
16260 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
16262 return NDR_ERR_SUCCESS;
16265 _PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r)
16267 ndr_print_struct(ndr, name, "netr_GetForestTrustInformation");
16268 ndr->depth++;
16269 if (flags & NDR_SET_VALUES) {
16270 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16272 if (flags & NDR_IN) {
16273 ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation");
16274 ndr->depth++;
16275 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16276 ndr->depth++;
16277 if (r->in.server_name) {
16278 ndr_print_string(ndr, "server_name", r->in.server_name);
16280 ndr->depth--;
16281 ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16282 ndr->depth++;
16283 ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
16284 ndr->depth--;
16285 ndr_print_ptr(ndr, "credential", r->in.credential);
16286 ndr->depth++;
16287 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
16288 ndr->depth--;
16289 ndr_print_uint32(ndr, "flags", r->in.flags);
16290 ndr->depth--;
16292 if (flags & NDR_OUT) {
16293 ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation");
16294 ndr->depth++;
16295 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
16296 ndr->depth++;
16297 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
16298 ndr->depth--;
16299 ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
16300 ndr->depth++;
16301 ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
16302 ndr->depth++;
16303 if (*r->out.forest_trust_info) {
16304 ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
16306 ndr->depth--;
16307 ndr->depth--;
16308 ndr_print_WERROR(ndr, "result", r->out.result);
16309 ndr->depth--;
16311 ndr->depth--;
16314 static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r)
16316 if (flags & NDR_IN) {
16317 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16318 if (r->in.server_name) {
16319 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16320 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16321 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16322 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));
16324 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
16325 if (r->in.computer_name) {
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));
16331 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential));
16332 if (r->in.credential) {
16333 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16335 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator));
16336 if (r->in.return_authenticator) {
16337 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
16339 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
16340 if (r->in.logon == NULL) {
16341 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16343 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
16344 NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
16345 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
16346 if (r->in.flags == NULL) {
16347 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16349 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.flags));
16351 if (flags & NDR_OUT) {
16352 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
16353 if (r->out.return_authenticator) {
16354 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16356 if (r->out.validation == NULL) {
16357 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16359 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.validation, r->in.validation_level));
16360 NDR_CHECK(ndr_push_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
16361 if (r->out.authoritative == NULL) {
16362 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16364 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
16365 if (r->out.flags == NULL) {
16366 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16368 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
16369 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
16371 return NDR_ERR_SUCCESS;
16374 static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r)
16376 uint32_t _ptr_server_name;
16377 uint32_t _ptr_computer_name;
16378 uint32_t _ptr_credential;
16379 uint32_t _ptr_return_authenticator;
16380 TALLOC_CTX *_mem_save_server_name_0;
16381 TALLOC_CTX *_mem_save_computer_name_0;
16382 TALLOC_CTX *_mem_save_credential_0;
16383 TALLOC_CTX *_mem_save_return_authenticator_0;
16384 TALLOC_CTX *_mem_save_logon_0;
16385 TALLOC_CTX *_mem_save_validation_0;
16386 TALLOC_CTX *_mem_save_authoritative_0;
16387 TALLOC_CTX *_mem_save_flags_0;
16388 if (flags & NDR_IN) {
16389 ZERO_STRUCT(r->out);
16391 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16392 if (_ptr_server_name) {
16393 NDR_PULL_ALLOC(ndr, r->in.server_name);
16394 } else {
16395 r->in.server_name = NULL;
16397 if (r->in.server_name) {
16398 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16399 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16400 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16401 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16402 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
16403 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
16405 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
16406 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
16407 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16409 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name));
16410 if (_ptr_computer_name) {
16411 NDR_PULL_ALLOC(ndr, r->in.computer_name);
16412 } else {
16413 r->in.computer_name = NULL;
16415 if (r->in.computer_name) {
16416 _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16417 NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0);
16418 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
16419 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
16420 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
16421 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
16423 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
16424 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
16425 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
16427 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential));
16428 if (_ptr_credential) {
16429 NDR_PULL_ALLOC(ndr, r->in.credential);
16430 } else {
16431 r->in.credential = NULL;
16433 if (r->in.credential) {
16434 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16435 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0);
16436 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0);
16439 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
16440 if (_ptr_return_authenticator) {
16441 NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
16442 } else {
16443 r->in.return_authenticator = NULL;
16445 if (r->in.return_authenticator) {
16446 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16447 NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0);
16448 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
16449 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
16451 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
16452 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16453 NDR_PULL_ALLOC(ndr, r->in.logon);
16455 _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
16456 NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
16457 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
16458 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
16459 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
16460 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
16461 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16462 NDR_PULL_ALLOC(ndr, r->in.flags);
16464 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
16465 NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC);
16466 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags));
16467 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
16468 NDR_PULL_ALLOC(ndr, r->out.validation);
16469 ZERO_STRUCTP(r->out.validation);
16470 NDR_PULL_ALLOC(ndr, r->out.authoritative);
16471 ZERO_STRUCTP(r->out.authoritative);
16472 NDR_PULL_ALLOC(ndr, r->out.flags);
16473 *r->out.flags = *r->in.flags;
16475 if (flags & NDR_OUT) {
16476 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
16477 if (_ptr_return_authenticator) {
16478 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16479 } else {
16480 r->out.return_authenticator = NULL;
16482 if (r->out.return_authenticator) {
16483 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16484 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0);
16485 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16486 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
16488 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16489 NDR_PULL_ALLOC(ndr, r->out.validation);
16491 _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr);
16492 NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC);
16493 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level));
16494 NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation));
16495 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC);
16496 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16497 NDR_PULL_ALLOC(ndr, r->out.authoritative);
16499 _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr);
16500 NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC);
16501 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative));
16502 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
16503 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16504 NDR_PULL_ALLOC(ndr, r->out.flags);
16506 _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr);
16507 NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC);
16508 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags));
16509 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
16510 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
16512 return NDR_ERR_SUCCESS;
16515 _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r)
16517 ndr_print_struct(ndr, name, "netr_LogonSamLogonWithFlags");
16518 ndr->depth++;
16519 if (flags & NDR_SET_VALUES) {
16520 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16522 if (flags & NDR_IN) {
16523 ndr_print_struct(ndr, "in", "netr_LogonSamLogonWithFlags");
16524 ndr->depth++;
16525 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16526 ndr->depth++;
16527 if (r->in.server_name) {
16528 ndr_print_string(ndr, "server_name", r->in.server_name);
16530 ndr->depth--;
16531 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
16532 ndr->depth++;
16533 if (r->in.computer_name) {
16534 ndr_print_string(ndr, "computer_name", r->in.computer_name);
16536 ndr->depth--;
16537 ndr_print_ptr(ndr, "credential", r->in.credential);
16538 ndr->depth++;
16539 if (r->in.credential) {
16540 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
16542 ndr->depth--;
16543 ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
16544 ndr->depth++;
16545 if (r->in.return_authenticator) {
16546 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
16548 ndr->depth--;
16549 ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
16550 ndr_print_ptr(ndr, "logon", r->in.logon);
16551 ndr->depth++;
16552 ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
16553 ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
16554 ndr->depth--;
16555 ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
16556 ndr_print_ptr(ndr, "flags", r->in.flags);
16557 ndr->depth++;
16558 ndr_print_uint32(ndr, "flags", *r->in.flags);
16559 ndr->depth--;
16560 ndr->depth--;
16562 if (flags & NDR_OUT) {
16563 ndr_print_struct(ndr, "out", "netr_LogonSamLogonWithFlags");
16564 ndr->depth++;
16565 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
16566 ndr->depth++;
16567 if (r->out.return_authenticator) {
16568 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
16570 ndr->depth--;
16571 ndr_print_ptr(ndr, "validation", r->out.validation);
16572 ndr->depth++;
16573 ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level);
16574 ndr_print_netr_Validation(ndr, "validation", r->out.validation);
16575 ndr->depth--;
16576 ndr_print_ptr(ndr, "authoritative", r->out.authoritative);
16577 ndr->depth++;
16578 ndr_print_uint8(ndr, "authoritative", *r->out.authoritative);
16579 ndr->depth--;
16580 ndr_print_ptr(ndr, "flags", r->out.flags);
16581 ndr->depth++;
16582 ndr_print_uint32(ndr, "flags", *r->out.flags);
16583 ndr->depth--;
16584 ndr_print_NTSTATUS(ndr, "result", r->out.result);
16585 ndr->depth--;
16587 ndr->depth--;
16590 static enum ndr_err_code ndr_push_netr_ServerGetTrustInfo(struct ndr_push *ndr, int flags, const struct netr_ServerGetTrustInfo *r)
16592 if (flags & NDR_IN) {
16593 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
16594 if (r->in.server_name) {
16595 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16596 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16597 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
16598 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));
16600 if (r->in.account_name == NULL) {
16601 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16603 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
16604 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16605 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
16606 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));
16607 NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
16608 if (r->in.computer_name == NULL) {
16609 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16611 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16612 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16613 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
16614 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));
16615 if (r->in.credential == NULL) {
16616 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16618 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16620 if (flags & NDR_OUT) {
16621 if (r->out.return_authenticator == NULL) {
16622 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16624 NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16625 if (r->out.new_owf_password == NULL) {
16626 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16628 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
16629 if (r->out.old_owf_password == NULL) {
16630 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16632 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
16633 if (r->out.trust_info == NULL) {
16634 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
16636 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.trust_info));
16637 if (*r->out.trust_info) {
16638 NDR_CHECK(ndr_push_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
16640 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
16642 return NDR_ERR_SUCCESS;
16645 static enum ndr_err_code ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull *ndr, int flags, struct netr_ServerGetTrustInfo *r)
16647 uint32_t _ptr_server_name;
16648 uint32_t _ptr_trust_info;
16649 TALLOC_CTX *_mem_save_server_name_0;
16650 TALLOC_CTX *_mem_save_credential_0;
16651 TALLOC_CTX *_mem_save_return_authenticator_0;
16652 TALLOC_CTX *_mem_save_new_owf_password_0;
16653 TALLOC_CTX *_mem_save_old_owf_password_0;
16654 TALLOC_CTX *_mem_save_trust_info_0;
16655 TALLOC_CTX *_mem_save_trust_info_1;
16656 if (flags & NDR_IN) {
16657 ZERO_STRUCT(r->out);
16659 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
16660 if (_ptr_server_name) {
16661 NDR_PULL_ALLOC(ndr, r->in.server_name);
16662 } else {
16663 r->in.server_name = NULL;
16665 if (r->in.server_name) {
16666 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
16667 NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
16668 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
16669 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
16670 if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
16671 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
16673 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
16674 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
16675 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
16677 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
16678 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
16679 if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
16680 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
16682 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
16683 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
16684 NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
16685 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
16686 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
16687 if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
16688 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
16690 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
16691 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
16692 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16693 NDR_PULL_ALLOC(ndr, r->in.credential);
16695 _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
16696 NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
16697 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
16698 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
16699 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16700 ZERO_STRUCTP(r->out.return_authenticator);
16701 NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
16702 ZERO_STRUCTP(r->out.new_owf_password);
16703 NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
16704 ZERO_STRUCTP(r->out.old_owf_password);
16705 NDR_PULL_ALLOC(ndr, r->out.trust_info);
16706 ZERO_STRUCTP(r->out.trust_info);
16708 if (flags & NDR_OUT) {
16709 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16710 NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
16712 _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
16713 NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
16714 NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
16715 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
16716 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16717 NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
16719 _mem_save_new_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
16720 NDR_PULL_SET_MEM_CTX(ndr, r->out.new_owf_password, LIBNDR_FLAG_REF_ALLOC);
16721 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
16722 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
16723 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16724 NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
16726 _mem_save_old_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
16727 NDR_PULL_SET_MEM_CTX(ndr, r->out.old_owf_password, LIBNDR_FLAG_REF_ALLOC);
16728 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
16729 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
16730 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
16731 NDR_PULL_ALLOC(ndr, r->out.trust_info);
16733 _mem_save_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
16734 NDR_PULL_SET_MEM_CTX(ndr, r->out.trust_info, LIBNDR_FLAG_REF_ALLOC);
16735 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trust_info));
16736 if (_ptr_trust_info) {
16737 NDR_PULL_ALLOC(ndr, *r->out.trust_info);
16738 } else {
16739 *r->out.trust_info = NULL;
16741 if (*r->out.trust_info) {
16742 _mem_save_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
16743 NDR_PULL_SET_MEM_CTX(ndr, *r->out.trust_info, 0);
16744 NDR_CHECK(ndr_pull_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
16745 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_1, 0);
16747 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
16748 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
16750 return NDR_ERR_SUCCESS;
16753 _PUBLIC_ void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r)
16755 ndr_print_struct(ndr, name, "netr_ServerGetTrustInfo");
16756 ndr->depth++;
16757 if (flags & NDR_SET_VALUES) {
16758 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
16760 if (flags & NDR_IN) {
16761 ndr_print_struct(ndr, "in", "netr_ServerGetTrustInfo");
16762 ndr->depth++;
16763 ndr_print_ptr(ndr, "server_name", r->in.server_name);
16764 ndr->depth++;
16765 if (r->in.server_name) {
16766 ndr_print_string(ndr, "server_name", r->in.server_name);
16768 ndr->depth--;
16769 ndr_print_ptr(ndr, "account_name", r->in.account_name);
16770 ndr->depth++;
16771 ndr_print_string(ndr, "account_name", r->in.account_name);
16772 ndr->depth--;
16773 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
16774 ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
16775 ndr->depth++;
16776 ndr_print_string(ndr, "computer_name", r->in.computer_name);
16777 ndr->depth--;
16778 ndr_print_ptr(ndr, "credential", r->in.credential);
16779 ndr->depth++;
16780 ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
16781 ndr->depth--;
16782 ndr->depth--;
16784 if (flags & NDR_OUT) {
16785 ndr_print_struct(ndr, "out", "netr_ServerGetTrustInfo");
16786 ndr->depth++;
16787 ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
16788 ndr->depth++;
16789 ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
16790 ndr->depth--;
16791 ndr_print_ptr(ndr, "new_owf_password", r->out.new_owf_password);
16792 ndr->depth++;
16793 ndr_print_samr_Password(ndr, "new_owf_password", r->out.new_owf_password);
16794 ndr->depth--;
16795 ndr_print_ptr(ndr, "old_owf_password", r->out.old_owf_password);
16796 ndr->depth++;
16797 ndr_print_samr_Password(ndr, "old_owf_password", r->out.old_owf_password);
16798 ndr->depth--;
16799 ndr_print_ptr(ndr, "trust_info", r->out.trust_info);
16800 ndr->depth++;
16801 ndr_print_ptr(ndr, "trust_info", *r->out.trust_info);
16802 ndr->depth++;
16803 if (*r->out.trust_info) {
16804 ndr_print_netr_TrustInfo(ndr, "trust_info", *r->out.trust_info);
16806 ndr->depth--;
16807 ndr->depth--;
16808 ndr_print_NTSTATUS(ndr, "result", r->out.result);
16809 ndr->depth--;
16811 ndr->depth--;
16814 static const struct ndr_interface_call netlogon_calls[] = {
16816 "netr_LogonUasLogon",
16817 sizeof(struct netr_LogonUasLogon),
16818 (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogon,
16819 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogon,
16820 (ndr_print_function_t) ndr_print_netr_LogonUasLogon,
16821 false,
16824 "netr_LogonUasLogoff",
16825 sizeof(struct netr_LogonUasLogoff),
16826 (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogoff,
16827 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogoff,
16828 (ndr_print_function_t) ndr_print_netr_LogonUasLogoff,
16829 false,
16832 "netr_LogonSamLogon",
16833 sizeof(struct netr_LogonSamLogon),
16834 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogon,
16835 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogon,
16836 (ndr_print_function_t) ndr_print_netr_LogonSamLogon,
16837 false,
16840 "netr_LogonSamLogoff",
16841 sizeof(struct netr_LogonSamLogoff),
16842 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogoff,
16843 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogoff,
16844 (ndr_print_function_t) ndr_print_netr_LogonSamLogoff,
16845 false,
16848 "netr_ServerReqChallenge",
16849 sizeof(struct netr_ServerReqChallenge),
16850 (ndr_push_flags_fn_t) ndr_push_netr_ServerReqChallenge,
16851 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerReqChallenge,
16852 (ndr_print_function_t) ndr_print_netr_ServerReqChallenge,
16853 false,
16856 "netr_ServerAuthenticate",
16857 sizeof(struct netr_ServerAuthenticate),
16858 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate,
16859 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate,
16860 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate,
16861 false,
16864 "netr_ServerPasswordSet",
16865 sizeof(struct netr_ServerPasswordSet),
16866 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet,
16867 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet,
16868 (ndr_print_function_t) ndr_print_netr_ServerPasswordSet,
16869 false,
16872 "netr_DatabaseDeltas",
16873 sizeof(struct netr_DatabaseDeltas),
16874 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseDeltas,
16875 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseDeltas,
16876 (ndr_print_function_t) ndr_print_netr_DatabaseDeltas,
16877 false,
16880 "netr_DatabaseSync",
16881 sizeof(struct netr_DatabaseSync),
16882 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync,
16883 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync,
16884 (ndr_print_function_t) ndr_print_netr_DatabaseSync,
16885 false,
16888 "netr_AccountDeltas",
16889 sizeof(struct netr_AccountDeltas),
16890 (ndr_push_flags_fn_t) ndr_push_netr_AccountDeltas,
16891 (ndr_pull_flags_fn_t) ndr_pull_netr_AccountDeltas,
16892 (ndr_print_function_t) ndr_print_netr_AccountDeltas,
16893 false,
16896 "netr_AccountSync",
16897 sizeof(struct netr_AccountSync),
16898 (ndr_push_flags_fn_t) ndr_push_netr_AccountSync,
16899 (ndr_pull_flags_fn_t) ndr_pull_netr_AccountSync,
16900 (ndr_print_function_t) ndr_print_netr_AccountSync,
16901 false,
16904 "netr_GetDcName",
16905 sizeof(struct netr_GetDcName),
16906 (ndr_push_flags_fn_t) ndr_push_netr_GetDcName,
16907 (ndr_pull_flags_fn_t) ndr_pull_netr_GetDcName,
16908 (ndr_print_function_t) ndr_print_netr_GetDcName,
16909 false,
16912 "netr_LogonControl",
16913 sizeof(struct netr_LogonControl),
16914 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl,
16915 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl,
16916 (ndr_print_function_t) ndr_print_netr_LogonControl,
16917 false,
16920 "netr_GetAnyDCName",
16921 sizeof(struct netr_GetAnyDCName),
16922 (ndr_push_flags_fn_t) ndr_push_netr_GetAnyDCName,
16923 (ndr_pull_flags_fn_t) ndr_pull_netr_GetAnyDCName,
16924 (ndr_print_function_t) ndr_print_netr_GetAnyDCName,
16925 false,
16928 "netr_LogonControl2",
16929 sizeof(struct netr_LogonControl2),
16930 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2,
16931 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2,
16932 (ndr_print_function_t) ndr_print_netr_LogonControl2,
16933 false,
16936 "netr_ServerAuthenticate2",
16937 sizeof(struct netr_ServerAuthenticate2),
16938 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate2,
16939 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate2,
16940 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate2,
16941 false,
16944 "netr_DatabaseSync2",
16945 sizeof(struct netr_DatabaseSync2),
16946 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync2,
16947 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync2,
16948 (ndr_print_function_t) ndr_print_netr_DatabaseSync2,
16949 false,
16952 "netr_DatabaseRedo",
16953 sizeof(struct netr_DatabaseRedo),
16954 (ndr_push_flags_fn_t) ndr_push_netr_DatabaseRedo,
16955 (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseRedo,
16956 (ndr_print_function_t) ndr_print_netr_DatabaseRedo,
16957 false,
16960 "netr_LogonControl2Ex",
16961 sizeof(struct netr_LogonControl2Ex),
16962 (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2Ex,
16963 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2Ex,
16964 (ndr_print_function_t) ndr_print_netr_LogonControl2Ex,
16965 false,
16968 "netr_NetrEnumerateTrustedDomains",
16969 sizeof(struct netr_NetrEnumerateTrustedDomains),
16970 (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains,
16971 (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains,
16972 (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains,
16973 false,
16976 "netr_DsRGetDCName",
16977 sizeof(struct netr_DsRGetDCName),
16978 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCName,
16979 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCName,
16980 (ndr_print_function_t) ndr_print_netr_DsRGetDCName,
16981 false,
16984 "netr_LogonGetCapabilities",
16985 sizeof(struct netr_LogonGetCapabilities),
16986 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetCapabilities,
16987 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetCapabilities,
16988 (ndr_print_function_t) ndr_print_netr_LogonGetCapabilities,
16989 false,
16992 "netr_NETRLOGONSETSERVICEBITS",
16993 sizeof(struct netr_NETRLOGONSETSERVICEBITS),
16994 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSETSERVICEBITS,
16995 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSETSERVICEBITS,
16996 (ndr_print_function_t) ndr_print_netr_NETRLOGONSETSERVICEBITS,
16997 false,
17000 "netr_LogonGetTrustRid",
17001 sizeof(struct netr_LogonGetTrustRid),
17002 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid,
17003 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid,
17004 (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid,
17005 false,
17008 "netr_NETRLOGONCOMPUTESERVERDIGEST",
17009 sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST),
17010 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST,
17011 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST,
17012 (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST,
17013 false,
17016 "netr_NETRLOGONCOMPUTECLIENTDIGEST",
17017 sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST),
17018 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17019 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17020 (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST,
17021 false,
17024 "netr_ServerAuthenticate3",
17025 sizeof(struct netr_ServerAuthenticate3),
17026 (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate3,
17027 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate3,
17028 (ndr_print_function_t) ndr_print_netr_ServerAuthenticate3,
17029 false,
17032 "netr_DsRGetDCNameEx",
17033 sizeof(struct netr_DsRGetDCNameEx),
17034 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx,
17035 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx,
17036 (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx,
17037 false,
17040 "netr_DsRGetSiteName",
17041 sizeof(struct netr_DsRGetSiteName),
17042 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetSiteName,
17043 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetSiteName,
17044 (ndr_print_function_t) ndr_print_netr_DsRGetSiteName,
17045 false,
17048 "netr_LogonGetDomainInfo",
17049 sizeof(struct netr_LogonGetDomainInfo),
17050 (ndr_push_flags_fn_t) ndr_push_netr_LogonGetDomainInfo,
17051 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetDomainInfo,
17052 (ndr_print_function_t) ndr_print_netr_LogonGetDomainInfo,
17053 false,
17056 "netr_ServerPasswordSet2",
17057 sizeof(struct netr_ServerPasswordSet2),
17058 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet2,
17059 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet2,
17060 (ndr_print_function_t) ndr_print_netr_ServerPasswordSet2,
17061 false,
17064 "netr_ServerPasswordGet",
17065 sizeof(struct netr_ServerPasswordGet),
17066 (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet,
17067 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet,
17068 (ndr_print_function_t) ndr_print_netr_ServerPasswordGet,
17069 false,
17072 "netr_NETRLOGONSENDTOSAM",
17073 sizeof(struct netr_NETRLOGONSENDTOSAM),
17074 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSENDTOSAM,
17075 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSENDTOSAM,
17076 (ndr_print_function_t) ndr_print_netr_NETRLOGONSENDTOSAM,
17077 false,
17080 "netr_DsRAddressToSitenamesW",
17081 sizeof(struct netr_DsRAddressToSitenamesW),
17082 (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW,
17083 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW,
17084 (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW,
17085 false,
17088 "netr_DsRGetDCNameEx2",
17089 sizeof(struct netr_DsRGetDCNameEx2),
17090 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx2,
17091 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx2,
17092 (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx2,
17093 false,
17096 "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN",
17097 sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN),
17098 (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17099 (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17100 (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
17101 false,
17104 "netr_NetrEnumerateTrustedDomainsEx",
17105 sizeof(struct netr_NetrEnumerateTrustedDomainsEx),
17106 (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx,
17107 (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx,
17108 (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx,
17109 false,
17112 "netr_DsRAddressToSitenamesExW",
17113 sizeof(struct netr_DsRAddressToSitenamesExW),
17114 (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW,
17115 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW,
17116 (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW,
17117 false,
17120 "netr_DsrGetDcSiteCoverageW",
17121 sizeof(struct netr_DsrGetDcSiteCoverageW),
17122 (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW,
17123 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW,
17124 (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW,
17125 false,
17128 "netr_LogonSamLogonEx",
17129 sizeof(struct netr_LogonSamLogonEx),
17130 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonEx,
17131 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonEx,
17132 (ndr_print_function_t) ndr_print_netr_LogonSamLogonEx,
17133 false,
17136 "netr_DsrEnumerateDomainTrusts",
17137 sizeof(struct netr_DsrEnumerateDomainTrusts),
17138 (ndr_push_flags_fn_t) ndr_push_netr_DsrEnumerateDomainTrusts,
17139 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrEnumerateDomainTrusts,
17140 (ndr_print_function_t) ndr_print_netr_DsrEnumerateDomainTrusts,
17141 false,
17144 "netr_DsrDeregisterDNSHostRecords",
17145 sizeof(struct netr_DsrDeregisterDNSHostRecords),
17146 (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords,
17147 (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords,
17148 (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords,
17149 false,
17152 "netr_ServerTrustPasswordsGet",
17153 sizeof(struct netr_ServerTrustPasswordsGet),
17154 (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet,
17155 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet,
17156 (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet,
17157 false,
17160 "netr_DsRGetForestTrustInformation",
17161 sizeof(struct netr_DsRGetForestTrustInformation),
17162 (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation,
17163 (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation,
17164 (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation,
17165 false,
17168 "netr_GetForestTrustInformation",
17169 sizeof(struct netr_GetForestTrustInformation),
17170 (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation,
17171 (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation,
17172 (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation,
17173 false,
17176 "netr_LogonSamLogonWithFlags",
17177 sizeof(struct netr_LogonSamLogonWithFlags),
17178 (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonWithFlags,
17179 (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonWithFlags,
17180 (ndr_print_function_t) ndr_print_netr_LogonSamLogonWithFlags,
17181 false,
17184 "netr_ServerGetTrustInfo",
17185 sizeof(struct netr_ServerGetTrustInfo),
17186 (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo,
17187 (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo,
17188 (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo,
17189 false,
17191 { NULL, 0, NULL, NULL, NULL, false }
17194 static const char * const netlogon_endpoint_strings[] = {
17195 "ncacn_np:[\\pipe\\netlogon]",
17196 "ncacn_ip_tcp:",
17197 "ncalrpc:",
17200 static const struct ndr_interface_string_array netlogon_endpoints = {
17201 .count = 3,
17202 .names = netlogon_endpoint_strings
17205 static const char * const netlogon_authservice_strings[] = {
17206 "host",
17209 static const struct ndr_interface_string_array netlogon_authservices = {
17210 .count = 1,
17211 .names = netlogon_authservice_strings
17215 const struct ndr_interface_table ndr_table_netlogon = {
17216 .name = "netlogon",
17217 .syntax_id = {
17218 {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},
17219 NDR_NETLOGON_VERSION
17221 .helpstring = NDR_NETLOGON_HELPSTRING,
17222 .num_calls = 47,
17223 .calls = netlogon_calls,
17224 .endpoints = &netlogon_endpoints,
17225 .authservices = &netlogon_authservices