1 /* parser auto-generated by pidl */
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
, 4));
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
));
32 if (ndr_flags
& NDR_BUFFERS
) {
33 if (r
->account_name
) {
34 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
35 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
36 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
37 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 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer
, CH_UTF16
)));
41 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
42 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer
, CH_UTF16
)));
43 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->computer
, ndr_charset_length(r
->computer
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
46 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
47 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
48 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
49 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
52 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->script_path
, CH_UTF16
)));
53 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
54 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->script_path
, CH_UTF16
)));
55 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->script_path
, ndr_charset_length(r
->script_path
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
58 return NDR_ERR_SUCCESS
;
61 static enum ndr_err_code
ndr_pull_netr_UasInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UasInfo
*r
)
63 uint32_t _ptr_account_name
;
64 TALLOC_CTX
*_mem_save_account_name_0
;
65 uint32_t _ptr_computer
;
66 TALLOC_CTX
*_mem_save_computer_0
;
68 TALLOC_CTX
*_mem_save_domain_0
;
69 uint32_t _ptr_script_path
;
70 TALLOC_CTX
*_mem_save_script_path_0
;
71 if (ndr_flags
& NDR_SCALARS
) {
72 NDR_CHECK(ndr_pull_align(ndr
, 4));
73 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account_name
));
74 if (_ptr_account_name
) {
75 NDR_PULL_ALLOC(ndr
, r
->account_name
);
77 r
->account_name
= NULL
;
79 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->priv
));
80 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->auth_flags
));
81 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_count
));
82 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->bad_pw_count
));
83 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->last_logon
));
84 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->last_logoff
));
85 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->logoff_time
));
86 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->kickoff_time
));
87 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->password_age
));
88 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->pw_can_change
));
89 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->pw_must_change
));
90 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer
));
92 NDR_PULL_ALLOC(ndr
, r
->computer
);
96 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
98 NDR_PULL_ALLOC(ndr
, r
->domain
);
102 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_script_path
));
103 if (_ptr_script_path
) {
104 NDR_PULL_ALLOC(ndr
, r
->script_path
);
106 r
->script_path
= NULL
;
108 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
));
110 if (ndr_flags
& NDR_BUFFERS
) {
111 if (r
->account_name
) {
112 _mem_save_account_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
113 NDR_PULL_SET_MEM_CTX(ndr
, r
->account_name
, 0);
114 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->account_name
));
115 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->account_name
));
116 if (ndr_get_array_length(ndr
, &r
->account_name
) > ndr_get_array_size(ndr
, &r
->account_name
)) {
117 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
));
119 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t)));
120 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->account_name
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t), CH_UTF16
));
121 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_name_0
, 0);
124 _mem_save_computer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
125 NDR_PULL_SET_MEM_CTX(ndr
, r
->computer
, 0);
126 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->computer
));
127 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->computer
));
128 if (ndr_get_array_length(ndr
, &r
->computer
) > ndr_get_array_size(ndr
, &r
->computer
)) {
129 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
));
131 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->computer
), sizeof(uint16_t)));
132 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->computer
, ndr_get_array_length(ndr
, &r
->computer
), sizeof(uint16_t), CH_UTF16
));
133 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_0
, 0);
136 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
137 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
138 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
139 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
140 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
141 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
));
143 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
144 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
145 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
147 if (r
->script_path
) {
148 _mem_save_script_path_0
= NDR_PULL_GET_MEM_CTX(ndr
);
149 NDR_PULL_SET_MEM_CTX(ndr
, r
->script_path
, 0);
150 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->script_path
));
151 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->script_path
));
152 if (ndr_get_array_length(ndr
, &r
->script_path
) > ndr_get_array_size(ndr
, &r
->script_path
)) {
153 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
));
155 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->script_path
), sizeof(uint16_t)));
156 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->script_path
, ndr_get_array_length(ndr
, &r
->script_path
), sizeof(uint16_t), CH_UTF16
));
157 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_script_path_0
, 0);
160 return NDR_ERR_SUCCESS
;
163 _PUBLIC_
void ndr_print_netr_UasInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_UasInfo
*r
)
165 ndr_print_struct(ndr
, name
, "netr_UasInfo");
167 ndr_print_ptr(ndr
, "account_name", r
->account_name
);
169 if (r
->account_name
) {
170 ndr_print_string(ndr
, "account_name", r
->account_name
);
173 ndr_print_uint32(ndr
, "priv", r
->priv
);
174 ndr_print_uint32(ndr
, "auth_flags", r
->auth_flags
);
175 ndr_print_uint32(ndr
, "logon_count", r
->logon_count
);
176 ndr_print_uint32(ndr
, "bad_pw_count", r
->bad_pw_count
);
177 ndr_print_time_t(ndr
, "last_logon", r
->last_logon
);
178 ndr_print_time_t(ndr
, "last_logoff", r
->last_logoff
);
179 ndr_print_time_t(ndr
, "logoff_time", r
->logoff_time
);
180 ndr_print_time_t(ndr
, "kickoff_time", r
->kickoff_time
);
181 ndr_print_uint32(ndr
, "password_age", r
->password_age
);
182 ndr_print_time_t(ndr
, "pw_can_change", r
->pw_can_change
);
183 ndr_print_time_t(ndr
, "pw_must_change", r
->pw_must_change
);
184 ndr_print_ptr(ndr
, "computer", r
->computer
);
187 ndr_print_string(ndr
, "computer", r
->computer
);
190 ndr_print_ptr(ndr
, "domain", r
->domain
);
193 ndr_print_string(ndr
, "domain", r
->domain
);
196 ndr_print_ptr(ndr
, "script_path", r
->script_path
);
198 if (r
->script_path
) {
199 ndr_print_string(ndr
, "script_path", r
->script_path
);
202 ndr_print_uint32(ndr
, "unknown", r
->unknown
);
206 static enum ndr_err_code
ndr_push_netr_UasLogoffInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UasLogoffInfo
*r
)
208 if (ndr_flags
& NDR_SCALARS
) {
209 NDR_CHECK(ndr_push_align(ndr
, 4));
210 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->duration
));
211 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
213 if (ndr_flags
& NDR_BUFFERS
) {
215 return NDR_ERR_SUCCESS
;
218 static enum ndr_err_code
ndr_pull_netr_UasLogoffInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UasLogoffInfo
*r
)
220 if (ndr_flags
& NDR_SCALARS
) {
221 NDR_CHECK(ndr_pull_align(ndr
, 4));
222 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->duration
));
223 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
225 if (ndr_flags
& NDR_BUFFERS
) {
227 return NDR_ERR_SUCCESS
;
230 _PUBLIC_
void ndr_print_netr_UasLogoffInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_UasLogoffInfo
*r
)
232 ndr_print_struct(ndr
, name
, "netr_UasLogoffInfo");
234 ndr_print_uint32(ndr
, "duration", r
->duration
);
235 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
239 _PUBLIC_
enum ndr_err_code
ndr_push_netr_AcctLockStr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_AcctLockStr
*r
)
241 if (ndr_flags
& NDR_SCALARS
) {
242 NDR_CHECK(ndr_push_align(ndr
, 4));
243 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->lockout_duration
));
244 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->reset_count
));
245 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->bad_attempt_lockout
));
246 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->dummy
));
248 if (ndr_flags
& NDR_BUFFERS
) {
250 return NDR_ERR_SUCCESS
;
253 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_AcctLockStr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_AcctLockStr
*r
)
255 if (ndr_flags
& NDR_SCALARS
) {
256 NDR_CHECK(ndr_pull_align(ndr
, 4));
257 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->lockout_duration
));
258 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->reset_count
));
259 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->bad_attempt_lockout
));
260 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->dummy
));
262 if (ndr_flags
& NDR_BUFFERS
) {
264 return NDR_ERR_SUCCESS
;
267 _PUBLIC_
void ndr_print_netr_AcctLockStr(struct ndr_print
*ndr
, const char *name
, const struct netr_AcctLockStr
*r
)
269 ndr_print_struct(ndr
, name
, "netr_AcctLockStr");
271 ndr_print_dlong(ndr
, "lockout_duration", r
->lockout_duration
);
272 ndr_print_udlong(ndr
, "reset_count", r
->reset_count
);
273 ndr_print_uint32(ndr
, "bad_attempt_lockout", r
->bad_attempt_lockout
);
274 ndr_print_uint32(ndr
, "dummy", r
->dummy
);
278 _PUBLIC_
enum ndr_err_code
ndr_push_netr_LogonParameterControl(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
280 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
281 return NDR_ERR_SUCCESS
;
284 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_LogonParameterControl(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
287 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
289 return NDR_ERR_SUCCESS
;
292 _PUBLIC_
void ndr_print_netr_LogonParameterControl(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
294 ndr_print_uint32(ndr
, name
, r
);
296 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED
, r
);
297 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS
, r
);
298 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS
, r
);
299 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
, r
);
300 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH
, r
);
301 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT
, r
);
305 static enum ndr_err_code
ndr_push_netr_IdentityInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_IdentityInfo
*r
)
307 if (ndr_flags
& NDR_SCALARS
) {
308 NDR_CHECK(ndr_push_align(ndr
, 4));
309 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
310 NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr
, NDR_SCALARS
, r
->parameter_control
));
311 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_id_low
));
312 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_id_high
));
313 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
314 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->workstation
));
316 if (ndr_flags
& NDR_BUFFERS
) {
317 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
318 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
319 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstation
));
321 return NDR_ERR_SUCCESS
;
324 static enum ndr_err_code
ndr_pull_netr_IdentityInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_IdentityInfo
*r
)
326 if (ndr_flags
& NDR_SCALARS
) {
327 NDR_CHECK(ndr_pull_align(ndr
, 4));
328 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
329 NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr
, NDR_SCALARS
, &r
->parameter_control
));
330 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_id_low
));
331 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_id_high
));
332 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
333 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->workstation
));
335 if (ndr_flags
& NDR_BUFFERS
) {
336 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
337 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
338 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstation
));
340 return NDR_ERR_SUCCESS
;
343 _PUBLIC_
void ndr_print_netr_IdentityInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_IdentityInfo
*r
)
345 ndr_print_struct(ndr
, name
, "netr_IdentityInfo");
347 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
348 ndr_print_netr_LogonParameterControl(ndr
, "parameter_control", r
->parameter_control
);
349 ndr_print_uint32(ndr
, "logon_id_low", r
->logon_id_low
);
350 ndr_print_uint32(ndr
, "logon_id_high", r
->logon_id_high
);
351 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
352 ndr_print_lsa_String(ndr
, "workstation", &r
->workstation
);
356 static enum ndr_err_code
ndr_push_netr_PasswordInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PasswordInfo
*r
)
358 if (ndr_flags
& NDR_SCALARS
) {
359 NDR_CHECK(ndr_push_align(ndr
, 4));
360 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
361 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
362 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
364 if (ndr_flags
& NDR_BUFFERS
) {
365 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
367 return NDR_ERR_SUCCESS
;
370 static enum ndr_err_code
ndr_pull_netr_PasswordInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PasswordInfo
*r
)
372 if (ndr_flags
& NDR_SCALARS
) {
373 NDR_CHECK(ndr_pull_align(ndr
, 4));
374 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
375 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
376 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
378 if (ndr_flags
& NDR_BUFFERS
) {
379 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
381 return NDR_ERR_SUCCESS
;
384 _PUBLIC_
void ndr_print_netr_PasswordInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_PasswordInfo
*r
)
386 ndr_print_struct(ndr
, name
, "netr_PasswordInfo");
388 ndr_print_netr_IdentityInfo(ndr
, "identity_info", &r
->identity_info
);
389 ndr_print_samr_Password(ndr
, "lmpassword", &r
->lmpassword
);
390 ndr_print_samr_Password(ndr
, "ntpassword", &r
->ntpassword
);
394 static enum ndr_err_code
ndr_push_netr_ChallengeResponse(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_ChallengeResponse
*r
)
397 uint32_t _flags_save_STRUCT
= ndr
->flags
;
398 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
399 if (ndr_flags
& NDR_SCALARS
) {
400 NDR_CHECK(ndr_push_align(ndr
, 4));
401 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
402 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
403 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
405 if (ndr_flags
& NDR_BUFFERS
) {
407 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
408 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
409 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
410 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
413 ndr
->flags
= _flags_save_STRUCT
;
415 return NDR_ERR_SUCCESS
;
418 static enum ndr_err_code
ndr_pull_netr_ChallengeResponse(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_ChallengeResponse
*r
)
421 TALLOC_CTX
*_mem_save_data_0
;
423 uint32_t _flags_save_STRUCT
= ndr
->flags
;
424 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
425 if (ndr_flags
& NDR_SCALARS
) {
426 NDR_CHECK(ndr_pull_align(ndr
, 4));
427 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
428 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
429 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
431 NDR_PULL_ALLOC(ndr
, r
->data
);
436 if (ndr_flags
& NDR_BUFFERS
) {
438 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
439 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
440 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
441 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->data
));
442 if (ndr_get_array_length(ndr
, &r
->data
) > ndr_get_array_size(ndr
, &r
->data
)) {
443 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
));
445 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
446 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_length(ndr
, &r
->data
)));
447 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
450 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
453 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->data
, r
->length
));
456 ndr
->flags
= _flags_save_STRUCT
;
458 return NDR_ERR_SUCCESS
;
461 _PUBLIC_
void ndr_print_netr_ChallengeResponse(struct ndr_print
*ndr
, const char *name
, const struct netr_ChallengeResponse
*r
)
463 ndr_print_struct(ndr
, name
, "netr_ChallengeResponse");
465 uint32_t _flags_save_STRUCT
= ndr
->flags
;
466 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
468 ndr_print_uint16(ndr
, "length", r
->length
);
469 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->length
:r
->size
);
470 ndr_print_ptr(ndr
, "data", r
->data
);
473 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
477 ndr
->flags
= _flags_save_STRUCT
;
481 static enum ndr_err_code
ndr_push_netr_NetworkInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_NetworkInfo
*r
)
484 uint32_t _flags_save_STRUCT
= ndr
->flags
;
485 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
486 if (ndr_flags
& NDR_SCALARS
) {
487 NDR_CHECK(ndr_push_align(ndr
, 4));
488 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
489 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->challenge
, 8));
490 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->nt
));
491 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->lm
));
493 if (ndr_flags
& NDR_BUFFERS
) {
494 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
495 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->nt
));
496 NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->lm
));
498 ndr
->flags
= _flags_save_STRUCT
;
500 return NDR_ERR_SUCCESS
;
503 static enum ndr_err_code
ndr_pull_netr_NetworkInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NetworkInfo
*r
)
506 uint32_t _flags_save_STRUCT
= ndr
->flags
;
507 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
508 if (ndr_flags
& NDR_SCALARS
) {
509 NDR_CHECK(ndr_pull_align(ndr
, 4));
510 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
511 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->challenge
, 8));
512 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->nt
));
513 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_SCALARS
, &r
->lm
));
515 if (ndr_flags
& NDR_BUFFERS
) {
516 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
517 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->nt
));
518 NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr
, NDR_BUFFERS
, &r
->lm
));
520 ndr
->flags
= _flags_save_STRUCT
;
522 return NDR_ERR_SUCCESS
;
525 _PUBLIC_
void ndr_print_netr_NetworkInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_NetworkInfo
*r
)
527 ndr_print_struct(ndr
, name
, "netr_NetworkInfo");
529 uint32_t _flags_save_STRUCT
= ndr
->flags
;
530 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
532 ndr_print_netr_IdentityInfo(ndr
, "identity_info", &r
->identity_info
);
533 ndr_print_array_uint8(ndr
, "challenge", r
->challenge
, 8);
534 ndr_print_netr_ChallengeResponse(ndr
, "nt", &r
->nt
);
535 ndr_print_netr_ChallengeResponse(ndr
, "lm", &r
->lm
);
537 ndr
->flags
= _flags_save_STRUCT
;
541 static enum ndr_err_code
ndr_push_netr_GenericInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_GenericInfo
*r
)
544 uint32_t _flags_save_STRUCT
= ndr
->flags
;
545 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
546 if (ndr_flags
& NDR_SCALARS
) {
547 NDR_CHECK(ndr_push_align(ndr
, 4));
548 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
549 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->package_name
));
550 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
551 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
553 if (ndr_flags
& NDR_BUFFERS
) {
554 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
555 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->package_name
));
557 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
558 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
561 ndr
->flags
= _flags_save_STRUCT
;
563 return NDR_ERR_SUCCESS
;
566 static enum ndr_err_code
ndr_pull_netr_GenericInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_GenericInfo
*r
)
569 TALLOC_CTX
*_mem_save_data_0
;
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_pull_align(ndr
, 4));
575 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_SCALARS
, &r
->identity_info
));
576 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->package_name
));
577 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
578 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
580 NDR_PULL_ALLOC(ndr
, r
->data
);
585 if (ndr_flags
& NDR_BUFFERS
) {
586 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr
, NDR_BUFFERS
, &r
->identity_info
));
587 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->package_name
));
589 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
590 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
591 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
592 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
593 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_size(ndr
, &r
->data
)));
594 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
597 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
600 ndr
->flags
= _flags_save_STRUCT
;
602 return NDR_ERR_SUCCESS
;
605 _PUBLIC_
void ndr_print_netr_GenericInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_GenericInfo
*r
)
607 ndr_print_struct(ndr
, name
, "netr_GenericInfo");
609 uint32_t _flags_save_STRUCT
= ndr
->flags
;
610 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
612 ndr_print_netr_IdentityInfo(ndr
, "identity_info", &r
->identity_info
);
613 ndr_print_lsa_String(ndr
, "package_name", &r
->package_name
);
614 ndr_print_uint32(ndr
, "length", r
->length
);
615 ndr_print_ptr(ndr
, "data", r
->data
);
618 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
622 ndr
->flags
= _flags_save_STRUCT
;
626 static enum ndr_err_code
ndr_push_netr_LogonInfoClass(struct ndr_push
*ndr
, int ndr_flags
, enum netr_LogonInfoClass r
)
628 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
));
629 return NDR_ERR_SUCCESS
;
632 static enum ndr_err_code
ndr_pull_netr_LogonInfoClass(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_LogonInfoClass
*r
)
635 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &v
));
637 return NDR_ERR_SUCCESS
;
640 _PUBLIC_
void ndr_print_netr_LogonInfoClass(struct ndr_print
*ndr
, const char *name
, enum netr_LogonInfoClass r
)
642 const char *val
= NULL
;
645 case NetlogonInteractiveInformation
: val
= "NetlogonInteractiveInformation"; break;
646 case NetlogonNetworkInformation
: val
= "NetlogonNetworkInformation"; break;
647 case NetlogonServiceInformation
: val
= "NetlogonServiceInformation"; break;
648 case NetlogonGenericInformation
: val
= "NetlogonGenericInformation"; break;
649 case NetlogonInteractiveTransitiveInformation
: val
= "NetlogonInteractiveTransitiveInformation"; break;
650 case NetlogonNetworkTransitiveInformation
: val
= "NetlogonNetworkTransitiveInformation"; break;
651 case NetlogonServiceTransitiveInformation
: val
= "NetlogonServiceTransitiveInformation"; break;
653 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
656 _PUBLIC_
enum ndr_err_code
ndr_push_netr_LogonLevel(struct ndr_push
*ndr
, int ndr_flags
, const union netr_LogonLevel
*r
)
658 if (ndr_flags
& NDR_SCALARS
) {
659 int level
= ndr_push_get_switch_value(ndr
, r
);
660 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr
, NDR_SCALARS
, level
));
662 case NetlogonInteractiveInformation
: {
663 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
666 case NetlogonNetworkInformation
: {
667 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->network
));
670 case NetlogonServiceInformation
: {
671 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
674 case NetlogonGenericInformation
: {
675 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->generic
));
678 case NetlogonInteractiveTransitiveInformation
: {
679 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
682 case NetlogonNetworkTransitiveInformation
: {
683 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->network
));
686 case NetlogonServiceTransitiveInformation
: {
687 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->password
));
691 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
694 if (ndr_flags
& NDR_BUFFERS
) {
695 int level
= ndr_push_get_switch_value(ndr
, r
);
697 case NetlogonInteractiveInformation
:
699 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
703 case NetlogonNetworkInformation
:
705 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
709 case NetlogonServiceInformation
:
711 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
715 case NetlogonGenericInformation
:
717 NDR_CHECK(ndr_push_netr_GenericInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->generic
));
721 case NetlogonInteractiveTransitiveInformation
:
723 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
727 case NetlogonNetworkTransitiveInformation
:
729 NDR_CHECK(ndr_push_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
733 case NetlogonServiceTransitiveInformation
:
735 NDR_CHECK(ndr_push_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
740 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
743 return NDR_ERR_SUCCESS
;
746 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_LogonLevel(struct ndr_pull
*ndr
, int ndr_flags
, union netr_LogonLevel
*r
)
750 TALLOC_CTX
*_mem_save_password_0
;
751 TALLOC_CTX
*_mem_save_network_0
;
752 TALLOC_CTX
*_mem_save_generic_0
;
753 level
= ndr_pull_get_switch_value(ndr
, r
);
754 if (ndr_flags
& NDR_SCALARS
) {
755 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
756 if (_level
!= level
) {
757 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
760 case NetlogonInteractiveInformation
: {
761 uint32_t _ptr_password
;
762 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
764 NDR_PULL_ALLOC(ndr
, r
->password
);
770 case NetlogonNetworkInformation
: {
771 uint32_t _ptr_network
;
772 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_network
));
774 NDR_PULL_ALLOC(ndr
, r
->network
);
780 case NetlogonServiceInformation
: {
781 uint32_t _ptr_password
;
782 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
784 NDR_PULL_ALLOC(ndr
, r
->password
);
790 case NetlogonGenericInformation
: {
791 uint32_t _ptr_generic
;
792 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_generic
));
794 NDR_PULL_ALLOC(ndr
, r
->generic
);
800 case NetlogonInteractiveTransitiveInformation
: {
801 uint32_t _ptr_password
;
802 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
804 NDR_PULL_ALLOC(ndr
, r
->password
);
810 case NetlogonNetworkTransitiveInformation
: {
811 uint32_t _ptr_network
;
812 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_network
));
814 NDR_PULL_ALLOC(ndr
, r
->network
);
820 case NetlogonServiceTransitiveInformation
: {
821 uint32_t _ptr_password
;
822 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_password
));
824 NDR_PULL_ALLOC(ndr
, r
->password
);
831 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
834 if (ndr_flags
& NDR_BUFFERS
) {
836 case NetlogonInteractiveInformation
:
838 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
839 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
840 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
841 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
845 case NetlogonNetworkInformation
:
847 _mem_save_network_0
= NDR_PULL_GET_MEM_CTX(ndr
);
848 NDR_PULL_SET_MEM_CTX(ndr
, r
->network
, 0);
849 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
850 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_network_0
, 0);
854 case NetlogonServiceInformation
:
856 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
857 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
858 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
859 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
863 case NetlogonGenericInformation
:
865 _mem_save_generic_0
= NDR_PULL_GET_MEM_CTX(ndr
);
866 NDR_PULL_SET_MEM_CTX(ndr
, r
->generic
, 0);
867 NDR_CHECK(ndr_pull_netr_GenericInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->generic
));
868 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_generic_0
, 0);
872 case NetlogonInteractiveTransitiveInformation
:
874 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
875 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
876 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
877 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
881 case NetlogonNetworkTransitiveInformation
:
883 _mem_save_network_0
= NDR_PULL_GET_MEM_CTX(ndr
);
884 NDR_PULL_SET_MEM_CTX(ndr
, r
->network
, 0);
885 NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->network
));
886 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_network_0
, 0);
890 case NetlogonServiceTransitiveInformation
:
892 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
893 NDR_PULL_SET_MEM_CTX(ndr
, r
->password
, 0);
894 NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->password
));
895 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, 0);
900 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
903 return NDR_ERR_SUCCESS
;
906 _PUBLIC_
void ndr_print_netr_LogonLevel(struct ndr_print
*ndr
, const char *name
, const union netr_LogonLevel
*r
)
909 level
= ndr_print_get_switch_value(ndr
, r
);
910 ndr_print_union(ndr
, name
, level
, "netr_LogonLevel");
912 case NetlogonInteractiveInformation
:
913 ndr_print_ptr(ndr
, "password", r
->password
);
916 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
921 case NetlogonNetworkInformation
:
922 ndr_print_ptr(ndr
, "network", r
->network
);
925 ndr_print_netr_NetworkInfo(ndr
, "network", r
->network
);
930 case NetlogonServiceInformation
:
931 ndr_print_ptr(ndr
, "password", r
->password
);
934 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
939 case NetlogonGenericInformation
:
940 ndr_print_ptr(ndr
, "generic", r
->generic
);
943 ndr_print_netr_GenericInfo(ndr
, "generic", r
->generic
);
948 case NetlogonInteractiveTransitiveInformation
:
949 ndr_print_ptr(ndr
, "password", r
->password
);
952 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
957 case NetlogonNetworkTransitiveInformation
:
958 ndr_print_ptr(ndr
, "network", r
->network
);
961 ndr_print_netr_NetworkInfo(ndr
, "network", r
->network
);
966 case NetlogonServiceTransitiveInformation
:
967 ndr_print_ptr(ndr
, "password", r
->password
);
970 ndr_print_netr_PasswordInfo(ndr
, "password", r
->password
);
976 ndr_print_bad_level(ndr
, name
, level
);
980 _PUBLIC_
enum ndr_err_code
ndr_push_netr_UserSessionKey(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_UserSessionKey
*r
)
983 uint32_t _flags_save_STRUCT
= ndr
->flags
;
984 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
985 if (ndr_flags
& NDR_SCALARS
) {
986 NDR_CHECK(ndr_push_align(ndr
, 1));
987 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 16));
989 if (ndr_flags
& NDR_BUFFERS
) {
991 ndr
->flags
= _flags_save_STRUCT
;
993 return NDR_ERR_SUCCESS
;
996 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_UserSessionKey(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UserSessionKey
*r
)
999 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1000 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1001 if (ndr_flags
& NDR_SCALARS
) {
1002 NDR_CHECK(ndr_pull_align(ndr
, 1));
1003 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 16));
1005 if (ndr_flags
& NDR_BUFFERS
) {
1007 ndr
->flags
= _flags_save_STRUCT
;
1009 return NDR_ERR_SUCCESS
;
1012 _PUBLIC_
void ndr_print_netr_UserSessionKey(struct ndr_print
*ndr
, const char *name
, const struct netr_UserSessionKey
*r
)
1014 ndr_print_struct(ndr
, name
, "netr_UserSessionKey");
1016 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1017 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1019 ndr_print_array_uint8(ndr
, "key", r
->key
, 16);
1021 ndr
->flags
= _flags_save_STRUCT
;
1025 _PUBLIC_
enum ndr_err_code
ndr_push_netr_LMSessionKey(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_LMSessionKey
*r
)
1028 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1029 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1030 if (ndr_flags
& NDR_SCALARS
) {
1031 NDR_CHECK(ndr_push_align(ndr
, 1));
1032 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 8));
1034 if (ndr_flags
& NDR_BUFFERS
) {
1036 ndr
->flags
= _flags_save_STRUCT
;
1038 return NDR_ERR_SUCCESS
;
1041 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_LMSessionKey(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_LMSessionKey
*r
)
1044 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1045 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1046 if (ndr_flags
& NDR_SCALARS
) {
1047 NDR_CHECK(ndr_pull_align(ndr
, 1));
1048 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->key
, 8));
1050 if (ndr_flags
& NDR_BUFFERS
) {
1052 ndr
->flags
= _flags_save_STRUCT
;
1054 return NDR_ERR_SUCCESS
;
1057 _PUBLIC_
void ndr_print_netr_LMSessionKey(struct ndr_print
*ndr
, const char *name
, const struct netr_LMSessionKey
*r
)
1059 ndr_print_struct(ndr
, name
, "netr_LMSessionKey");
1061 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1062 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1064 ndr_print_array_uint8(ndr
, "key", r
->key
, 8);
1066 ndr
->flags
= _flags_save_STRUCT
;
1070 _PUBLIC_
enum ndr_err_code
ndr_push_netr_UserFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
1072 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
1073 return NDR_ERR_SUCCESS
;
1076 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_UserFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
1079 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
1081 return NDR_ERR_SUCCESS
;
1084 _PUBLIC_
void ndr_print_netr_UserFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
1086 ndr_print_uint32(ndr
, name
, r
);
1088 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST
, r
);
1089 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION
, r
);
1090 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT
, r
);
1091 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD
, r
);
1092 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS
, r
);
1093 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY
, r
);
1094 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT
, r
);
1095 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED
, r
);
1096 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS
, r
);
1097 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED
, r
);
1098 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON
, r
);
1102 static enum ndr_err_code
ndr_push_netr_SamBaseInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamBaseInfo
*r
)
1104 uint32_t cntr_unknown_0
;
1105 if (ndr_flags
& NDR_SCALARS
) {
1106 NDR_CHECK(ndr_push_align(ndr
, 4));
1107 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logon
));
1108 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logoff
));
1109 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->acct_expiry
));
1110 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_password_change
));
1111 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->allow_password_change
));
1112 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->force_password_change
));
1113 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
1114 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
1115 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
1116 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
1117 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
1118 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
1119 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
1120 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->bad_password_count
));
1121 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
1122 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->primary_gid
));
1123 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr
, NDR_SCALARS
, &r
->groups
));
1124 NDR_CHECK(ndr_push_netr_UserFlags(ndr
, NDR_SCALARS
, r
->user_flags
));
1125 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->key
));
1126 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->logon_server
));
1127 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->domain
));
1128 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain_sid
));
1129 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr
, NDR_SCALARS
, &r
->LMSessKey
));
1130 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->acct_flags
));
1131 for (cntr_unknown_0
= 0; cntr_unknown_0
< 7; cntr_unknown_0
++) {
1132 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown
[cntr_unknown_0
]));
1135 if (ndr_flags
& NDR_BUFFERS
) {
1136 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
1137 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
1138 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
1139 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
1140 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
1141 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
1142 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr
, NDR_BUFFERS
, &r
->groups
));
1143 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1144 NDR_CHECK(ndr_push_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->domain
));
1145 if (r
->domain_sid
) {
1146 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain_sid
));
1149 return NDR_ERR_SUCCESS
;
1152 static enum ndr_err_code
ndr_pull_netr_SamBaseInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamBaseInfo
*r
)
1154 uint32_t _ptr_domain_sid
;
1155 TALLOC_CTX
*_mem_save_domain_sid_0
;
1156 uint32_t cntr_unknown_0
;
1157 if (ndr_flags
& NDR_SCALARS
) {
1158 NDR_CHECK(ndr_pull_align(ndr
, 4));
1159 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logon
));
1160 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logoff
));
1161 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->acct_expiry
));
1162 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_password_change
));
1163 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->allow_password_change
));
1164 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->force_password_change
));
1165 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
1166 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
1167 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
1168 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
1169 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
1170 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
1171 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
1172 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->bad_password_count
));
1173 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
1174 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->primary_gid
));
1175 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr
, NDR_SCALARS
, &r
->groups
));
1176 NDR_CHECK(ndr_pull_netr_UserFlags(ndr
, NDR_SCALARS
, &r
->user_flags
));
1177 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->key
));
1178 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->logon_server
));
1179 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_SCALARS
, &r
->domain
));
1180 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_sid
));
1181 if (_ptr_domain_sid
) {
1182 NDR_PULL_ALLOC(ndr
, r
->domain_sid
);
1184 r
->domain_sid
= NULL
;
1186 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr
, NDR_SCALARS
, &r
->LMSessKey
));
1187 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->acct_flags
));
1188 for (cntr_unknown_0
= 0; cntr_unknown_0
< 7; cntr_unknown_0
++) {
1189 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown
[cntr_unknown_0
]));
1192 if (ndr_flags
& NDR_BUFFERS
) {
1193 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
1194 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
1195 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
1196 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
1197 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
1198 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
1199 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr
, NDR_BUFFERS
, &r
->groups
));
1200 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1201 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr
, NDR_BUFFERS
, &r
->domain
));
1202 if (r
->domain_sid
) {
1203 _mem_save_domain_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1204 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain_sid
, 0);
1205 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain_sid
));
1206 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_sid_0
, 0);
1209 return NDR_ERR_SUCCESS
;
1212 _PUBLIC_
void ndr_print_netr_SamBaseInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_SamBaseInfo
*r
)
1214 uint32_t cntr_unknown_0
;
1215 ndr_print_struct(ndr
, name
, "netr_SamBaseInfo");
1217 ndr_print_NTTIME(ndr
, "last_logon", r
->last_logon
);
1218 ndr_print_NTTIME(ndr
, "last_logoff", r
->last_logoff
);
1219 ndr_print_NTTIME(ndr
, "acct_expiry", r
->acct_expiry
);
1220 ndr_print_NTTIME(ndr
, "last_password_change", r
->last_password_change
);
1221 ndr_print_NTTIME(ndr
, "allow_password_change", r
->allow_password_change
);
1222 ndr_print_NTTIME(ndr
, "force_password_change", r
->force_password_change
);
1223 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
1224 ndr_print_lsa_String(ndr
, "full_name", &r
->full_name
);
1225 ndr_print_lsa_String(ndr
, "logon_script", &r
->logon_script
);
1226 ndr_print_lsa_String(ndr
, "profile_path", &r
->profile_path
);
1227 ndr_print_lsa_String(ndr
, "home_directory", &r
->home_directory
);
1228 ndr_print_lsa_String(ndr
, "home_drive", &r
->home_drive
);
1229 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
1230 ndr_print_uint16(ndr
, "bad_password_count", r
->bad_password_count
);
1231 ndr_print_uint32(ndr
, "rid", r
->rid
);
1232 ndr_print_uint32(ndr
, "primary_gid", r
->primary_gid
);
1233 ndr_print_samr_RidWithAttributeArray(ndr
, "groups", &r
->groups
);
1234 ndr_print_netr_UserFlags(ndr
, "user_flags", r
->user_flags
);
1235 ndr_print_netr_UserSessionKey(ndr
, "key", &r
->key
);
1236 ndr_print_lsa_StringLarge(ndr
, "logon_server", &r
->logon_server
);
1237 ndr_print_lsa_StringLarge(ndr
, "domain", &r
->domain
);
1238 ndr_print_ptr(ndr
, "domain_sid", r
->domain_sid
);
1240 if (r
->domain_sid
) {
1241 ndr_print_dom_sid2(ndr
, "domain_sid", r
->domain_sid
);
1244 ndr_print_netr_LMSessionKey(ndr
, "LMSessKey", &r
->LMSessKey
);
1245 ndr_print_samr_AcctFlags(ndr
, "acct_flags", r
->acct_flags
);
1246 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown", (int)7);
1248 for (cntr_unknown_0
=0;cntr_unknown_0
<7;cntr_unknown_0
++) {
1250 if (asprintf(&idx_0
, "[%d]", cntr_unknown_0
) != -1) {
1251 ndr_print_uint32(ndr
, "unknown", r
->unknown
[cntr_unknown_0
]);
1259 static enum ndr_err_code
ndr_push_netr_SamInfo2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo2
*r
)
1261 if (ndr_flags
& NDR_SCALARS
) {
1262 NDR_CHECK(ndr_push_align(ndr
, 4));
1263 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1265 if (ndr_flags
& NDR_BUFFERS
) {
1266 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1268 return NDR_ERR_SUCCESS
;
1271 static enum ndr_err_code
ndr_pull_netr_SamInfo2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo2
*r
)
1273 if (ndr_flags
& NDR_SCALARS
) {
1274 NDR_CHECK(ndr_pull_align(ndr
, 4));
1275 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1277 if (ndr_flags
& NDR_BUFFERS
) {
1278 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1280 return NDR_ERR_SUCCESS
;
1283 _PUBLIC_
void ndr_print_netr_SamInfo2(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo2
*r
)
1285 ndr_print_struct(ndr
, name
, "netr_SamInfo2");
1287 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1291 static enum ndr_err_code
ndr_push_netr_SidAttr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SidAttr
*r
)
1293 if (ndr_flags
& NDR_SCALARS
) {
1294 NDR_CHECK(ndr_push_align(ndr
, 4));
1295 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
1296 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr
, NDR_SCALARS
, r
->attributes
));
1298 if (ndr_flags
& NDR_BUFFERS
) {
1300 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
1303 return NDR_ERR_SUCCESS
;
1306 static enum ndr_err_code
ndr_pull_netr_SidAttr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SidAttr
*r
)
1309 TALLOC_CTX
*_mem_save_sid_0
;
1310 if (ndr_flags
& NDR_SCALARS
) {
1311 NDR_CHECK(ndr_pull_align(ndr
, 4));
1312 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
1314 NDR_PULL_ALLOC(ndr
, r
->sid
);
1318 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr
, NDR_SCALARS
, &r
->attributes
));
1320 if (ndr_flags
& NDR_BUFFERS
) {
1322 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1323 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
1324 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
1325 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
1328 return NDR_ERR_SUCCESS
;
1331 _PUBLIC_
void ndr_print_netr_SidAttr(struct ndr_print
*ndr
, const char *name
, const struct netr_SidAttr
*r
)
1333 ndr_print_struct(ndr
, name
, "netr_SidAttr");
1335 ndr_print_ptr(ndr
, "sid", r
->sid
);
1338 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
1341 ndr_print_samr_GroupAttrs(ndr
, "attributes", r
->attributes
);
1345 _PUBLIC_
enum ndr_err_code
ndr_push_netr_SamInfo3(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo3
*r
)
1347 uint32_t cntr_sids_1
;
1348 if (ndr_flags
& NDR_SCALARS
) {
1349 NDR_CHECK(ndr_push_align(ndr
, 4));
1350 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1351 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1352 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sids
));
1354 if (ndr_flags
& NDR_BUFFERS
) {
1355 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1357 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1358 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1359 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1361 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1362 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1366 return NDR_ERR_SUCCESS
;
1369 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_SamInfo3(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo3
*r
)
1372 uint32_t cntr_sids_1
;
1373 TALLOC_CTX
*_mem_save_sids_0
;
1374 TALLOC_CTX
*_mem_save_sids_1
;
1375 if (ndr_flags
& NDR_SCALARS
) {
1376 NDR_CHECK(ndr_pull_align(ndr
, 4));
1377 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1378 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sidcount
));
1379 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sids
));
1381 NDR_PULL_ALLOC(ndr
, r
->sids
);
1386 if (ndr_flags
& NDR_BUFFERS
) {
1387 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1389 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1390 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1391 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sids
));
1392 NDR_PULL_ALLOC_N(ndr
, r
->sids
, ndr_get_array_size(ndr
, &r
->sids
));
1393 _mem_save_sids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
1394 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1395 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1396 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1398 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1399 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1401 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_1
, 0);
1402 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
1405 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sids
, r
->sidcount
));
1408 return NDR_ERR_SUCCESS
;
1411 _PUBLIC_
void ndr_print_netr_SamInfo3(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo3
*r
)
1413 uint32_t cntr_sids_1
;
1414 ndr_print_struct(ndr
, name
, "netr_SamInfo3");
1416 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1417 ndr_print_uint32(ndr
, "sidcount", r
->sidcount
);
1418 ndr_print_ptr(ndr
, "sids", r
->sids
);
1421 ndr
->print(ndr
, "%s: ARRAY(%d)", "sids", (int)r
->sidcount
);
1423 for (cntr_sids_1
=0;cntr_sids_1
<r
->sidcount
;cntr_sids_1
++) {
1425 if (asprintf(&idx_1
, "[%d]", cntr_sids_1
) != -1) {
1426 ndr_print_netr_SidAttr(ndr
, "sids", &r
->sids
[cntr_sids_1
]);
1436 static enum ndr_err_code
ndr_push_netr_SamInfo6(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_SamInfo6
*r
)
1438 uint32_t cntr_sids_1
;
1439 uint32_t cntr_unknown4_0
;
1440 if (ndr_flags
& NDR_SCALARS
) {
1441 NDR_CHECK(ndr_push_align(ndr
, 4));
1442 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1443 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1444 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sids
));
1445 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
1446 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->principle
));
1447 for (cntr_unknown4_0
= 0; cntr_unknown4_0
< 20; cntr_unknown4_0
++) {
1448 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
[cntr_unknown4_0
]));
1451 if (ndr_flags
& NDR_BUFFERS
) {
1452 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1454 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sidcount
));
1455 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1456 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1458 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1459 NDR_CHECK(ndr_push_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1462 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
1463 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->principle
));
1465 return NDR_ERR_SUCCESS
;
1468 static enum ndr_err_code
ndr_pull_netr_SamInfo6(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_SamInfo6
*r
)
1471 uint32_t cntr_sids_1
;
1472 TALLOC_CTX
*_mem_save_sids_0
;
1473 TALLOC_CTX
*_mem_save_sids_1
;
1474 uint32_t cntr_unknown4_0
;
1475 if (ndr_flags
& NDR_SCALARS
) {
1476 NDR_CHECK(ndr_pull_align(ndr
, 4));
1477 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_SCALARS
, &r
->base
));
1478 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sidcount
));
1479 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sids
));
1481 NDR_PULL_ALLOC(ndr
, r
->sids
);
1485 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
1486 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->principle
));
1487 for (cntr_unknown4_0
= 0; cntr_unknown4_0
< 20; cntr_unknown4_0
++) {
1488 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
[cntr_unknown4_0
]));
1491 if (ndr_flags
& NDR_BUFFERS
) {
1492 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr
, NDR_BUFFERS
, &r
->base
));
1494 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1495 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1496 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sids
));
1497 NDR_PULL_ALLOC_N(ndr
, r
->sids
, ndr_get_array_size(ndr
, &r
->sids
));
1498 _mem_save_sids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
1499 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
1500 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1501 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_SCALARS
, &r
->sids
[cntr_sids_1
]));
1503 for (cntr_sids_1
= 0; cntr_sids_1
< r
->sidcount
; cntr_sids_1
++) {
1504 NDR_CHECK(ndr_pull_netr_SidAttr(ndr
, NDR_BUFFERS
, &r
->sids
[cntr_sids_1
]));
1506 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_1
, 0);
1507 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
1509 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
1510 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->principle
));
1512 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sids
, r
->sidcount
));
1515 return NDR_ERR_SUCCESS
;
1518 _PUBLIC_
void ndr_print_netr_SamInfo6(struct ndr_print
*ndr
, const char *name
, const struct netr_SamInfo6
*r
)
1520 uint32_t cntr_sids_1
;
1521 uint32_t cntr_unknown4_0
;
1522 ndr_print_struct(ndr
, name
, "netr_SamInfo6");
1524 ndr_print_netr_SamBaseInfo(ndr
, "base", &r
->base
);
1525 ndr_print_uint32(ndr
, "sidcount", r
->sidcount
);
1526 ndr_print_ptr(ndr
, "sids", r
->sids
);
1529 ndr
->print(ndr
, "%s: ARRAY(%d)", "sids", (int)r
->sidcount
);
1531 for (cntr_sids_1
=0;cntr_sids_1
<r
->sidcount
;cntr_sids_1
++) {
1533 if (asprintf(&idx_1
, "[%d]", cntr_sids_1
) != -1) {
1534 ndr_print_netr_SidAttr(ndr
, "sids", &r
->sids
[cntr_sids_1
]);
1541 ndr_print_lsa_String(ndr
, "forest", &r
->forest
);
1542 ndr_print_lsa_String(ndr
, "principle", &r
->principle
);
1543 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown4", (int)20);
1545 for (cntr_unknown4_0
=0;cntr_unknown4_0
<20;cntr_unknown4_0
++) {
1547 if (asprintf(&idx_0
, "[%d]", cntr_unknown4_0
) != -1) {
1548 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
[cntr_unknown4_0
]);
1556 static enum ndr_err_code
ndr_push_netr_PacInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PacInfo
*r
)
1558 uint32_t cntr_expansionroom_0
;
1559 if (ndr_flags
& NDR_SCALARS
) {
1560 NDR_CHECK(ndr_push_align(ndr
, 4));
1561 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pac_size
));
1562 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->pac
));
1563 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_domain
));
1564 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_server
));
1565 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->principal_name
));
1566 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->auth_size
));
1567 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->auth
));
1568 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->user_session_key
));
1569 for (cntr_expansionroom_0
= 0; cntr_expansionroom_0
< 10; cntr_expansionroom_0
++) {
1570 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->expansionroom
[cntr_expansionroom_0
]));
1572 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1573 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1574 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1575 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1577 if (ndr_flags
& NDR_BUFFERS
) {
1579 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pac_size
));
1580 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->pac
, r
->pac_size
));
1582 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_domain
));
1583 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1584 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->principal_name
));
1586 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->auth_size
));
1587 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->auth
, r
->auth_size
));
1589 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1590 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1591 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1592 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1594 return NDR_ERR_SUCCESS
;
1597 static enum ndr_err_code
ndr_pull_netr_PacInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PacInfo
*r
)
1600 TALLOC_CTX
*_mem_save_pac_0
;
1602 TALLOC_CTX
*_mem_save_auth_0
;
1603 uint32_t cntr_expansionroom_0
;
1604 if (ndr_flags
& NDR_SCALARS
) {
1605 NDR_CHECK(ndr_pull_align(ndr
, 4));
1606 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pac_size
));
1607 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_pac
));
1609 NDR_PULL_ALLOC(ndr
, r
->pac
);
1613 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_domain
));
1614 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_server
));
1615 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->principal_name
));
1616 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->auth_size
));
1617 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_auth
));
1619 NDR_PULL_ALLOC(ndr
, r
->auth
);
1623 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr
, NDR_SCALARS
, &r
->user_session_key
));
1624 for (cntr_expansionroom_0
= 0; cntr_expansionroom_0
< 10; cntr_expansionroom_0
++) {
1625 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->expansionroom
[cntr_expansionroom_0
]));
1627 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
1628 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
1629 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
1630 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
1632 if (ndr_flags
& NDR_BUFFERS
) {
1634 _mem_save_pac_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1635 NDR_PULL_SET_MEM_CTX(ndr
, r
->pac
, 0);
1636 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->pac
));
1637 NDR_PULL_ALLOC_N(ndr
, r
->pac
, ndr_get_array_size(ndr
, &r
->pac
));
1638 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->pac
, ndr_get_array_size(ndr
, &r
->pac
)));
1639 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_pac_0
, 0);
1641 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_domain
));
1642 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_server
));
1643 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->principal_name
));
1645 _mem_save_auth_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1646 NDR_PULL_SET_MEM_CTX(ndr
, r
->auth
, 0);
1647 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->auth
));
1648 NDR_PULL_ALLOC_N(ndr
, r
->auth
, ndr_get_array_size(ndr
, &r
->auth
));
1649 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->auth
, ndr_get_array_size(ndr
, &r
->auth
)));
1650 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_auth_0
, 0);
1652 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
1653 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
1654 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
1655 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
1657 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->pac
, r
->pac_size
));
1660 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->auth
, r
->auth_size
));
1663 return NDR_ERR_SUCCESS
;
1666 _PUBLIC_
void ndr_print_netr_PacInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_PacInfo
*r
)
1668 uint32_t cntr_expansionroom_0
;
1669 ndr_print_struct(ndr
, name
, "netr_PacInfo");
1671 ndr_print_uint32(ndr
, "pac_size", r
->pac_size
);
1672 ndr_print_ptr(ndr
, "pac", r
->pac
);
1675 ndr_print_array_uint8(ndr
, "pac", r
->pac
, r
->pac_size
);
1678 ndr_print_lsa_String(ndr
, "logon_domain", &r
->logon_domain
);
1679 ndr_print_lsa_String(ndr
, "logon_server", &r
->logon_server
);
1680 ndr_print_lsa_String(ndr
, "principal_name", &r
->principal_name
);
1681 ndr_print_uint32(ndr
, "auth_size", r
->auth_size
);
1682 ndr_print_ptr(ndr
, "auth", r
->auth
);
1685 ndr_print_array_uint8(ndr
, "auth", r
->auth
, r
->auth_size
);
1688 ndr_print_netr_UserSessionKey(ndr
, "user_session_key", &r
->user_session_key
);
1689 ndr
->print(ndr
, "%s: ARRAY(%d)", "expansionroom", (int)10);
1691 for (cntr_expansionroom_0
=0;cntr_expansionroom_0
<10;cntr_expansionroom_0
++) {
1693 if (asprintf(&idx_0
, "[%d]", cntr_expansionroom_0
) != -1) {
1694 ndr_print_uint32(ndr
, "expansionroom", r
->expansionroom
[cntr_expansionroom_0
]);
1699 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
1700 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
1701 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
1702 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
1706 static enum ndr_err_code
ndr_push_netr_GenericInfo2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_GenericInfo2
*r
)
1709 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1710 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1711 if (ndr_flags
& NDR_SCALARS
) {
1712 NDR_CHECK(ndr_push_align(ndr
, 4));
1713 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
1714 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
1716 if (ndr_flags
& NDR_BUFFERS
) {
1718 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
1719 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
1722 ndr
->flags
= _flags_save_STRUCT
;
1724 return NDR_ERR_SUCCESS
;
1727 static enum ndr_err_code
ndr_pull_netr_GenericInfo2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_GenericInfo2
*r
)
1730 TALLOC_CTX
*_mem_save_data_0
;
1732 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1733 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1734 if (ndr_flags
& NDR_SCALARS
) {
1735 NDR_CHECK(ndr_pull_align(ndr
, 4));
1736 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
1737 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
1739 NDR_PULL_ALLOC(ndr
, r
->data
);
1744 if (ndr_flags
& NDR_BUFFERS
) {
1746 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1747 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
1748 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
1749 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
1750 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_size(ndr
, &r
->data
)));
1751 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
1754 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
1757 ndr
->flags
= _flags_save_STRUCT
;
1759 return NDR_ERR_SUCCESS
;
1762 _PUBLIC_
void ndr_print_netr_GenericInfo2(struct ndr_print
*ndr
, const char *name
, const struct netr_GenericInfo2
*r
)
1764 ndr_print_struct(ndr
, name
, "netr_GenericInfo2");
1766 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1767 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1769 ndr_print_uint32(ndr
, "length", r
->length
);
1770 ndr_print_ptr(ndr
, "data", r
->data
);
1773 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
1777 ndr
->flags
= _flags_save_STRUCT
;
1781 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Validation(struct ndr_push
*ndr
, int ndr_flags
, const union netr_Validation
*r
)
1783 if (ndr_flags
& NDR_SCALARS
) {
1784 int level
= ndr_push_get_switch_value(ndr
, r
);
1785 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, level
));
1787 case NetlogonValidationSamInfo
: {
1788 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam2
));
1791 case NetlogonValidationSamInfo2
: {
1792 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam3
));
1796 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->pac
));
1799 case NetlogonValidationGenericInfo2
: {
1800 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->generic
));
1803 case NetlogonValidationSamInfo4
: {
1804 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sam6
));
1808 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1811 if (ndr_flags
& NDR_BUFFERS
) {
1812 int level
= ndr_push_get_switch_value(ndr
, r
);
1814 case NetlogonValidationSamInfo
:
1816 NDR_CHECK(ndr_push_netr_SamInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam2
));
1820 case NetlogonValidationSamInfo2
:
1822 NDR_CHECK(ndr_push_netr_SamInfo3(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam3
));
1828 NDR_CHECK(ndr_push_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1832 case NetlogonValidationGenericInfo2
:
1834 NDR_CHECK(ndr_push_netr_GenericInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->generic
));
1838 case NetlogonValidationSamInfo4
:
1840 NDR_CHECK(ndr_push_netr_SamInfo6(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam6
));
1845 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1848 return NDR_ERR_SUCCESS
;
1851 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Validation(struct ndr_pull
*ndr
, int ndr_flags
, union netr_Validation
*r
)
1855 TALLOC_CTX
*_mem_save_sam2_0
;
1856 TALLOC_CTX
*_mem_save_sam3_0
;
1857 TALLOC_CTX
*_mem_save_pac_0
;
1858 TALLOC_CTX
*_mem_save_generic_0
;
1859 TALLOC_CTX
*_mem_save_sam6_0
;
1860 level
= ndr_pull_get_switch_value(ndr
, r
);
1861 if (ndr_flags
& NDR_SCALARS
) {
1862 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
1863 if (_level
!= level
) {
1864 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
1867 case NetlogonValidationSamInfo
: {
1869 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam2
));
1871 NDR_PULL_ALLOC(ndr
, r
->sam2
);
1877 case NetlogonValidationSamInfo2
: {
1879 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam3
));
1881 NDR_PULL_ALLOC(ndr
, r
->sam3
);
1889 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_pac
));
1891 NDR_PULL_ALLOC(ndr
, r
->pac
);
1897 case NetlogonValidationGenericInfo2
: {
1898 uint32_t _ptr_generic
;
1899 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_generic
));
1901 NDR_PULL_ALLOC(ndr
, r
->generic
);
1907 case NetlogonValidationSamInfo4
: {
1909 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sam6
));
1911 NDR_PULL_ALLOC(ndr
, r
->sam6
);
1918 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1921 if (ndr_flags
& NDR_BUFFERS
) {
1923 case NetlogonValidationSamInfo
:
1925 _mem_save_sam2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1926 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam2
, 0);
1927 NDR_CHECK(ndr_pull_netr_SamInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam2
));
1928 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam2_0
, 0);
1932 case NetlogonValidationSamInfo2
:
1934 _mem_save_sam3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1935 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam3
, 0);
1936 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam3
));
1937 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam3_0
, 0);
1943 _mem_save_pac_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1944 NDR_PULL_SET_MEM_CTX(ndr
, r
->pac
, 0);
1945 NDR_CHECK(ndr_pull_netr_PacInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->pac
));
1946 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_pac_0
, 0);
1950 case NetlogonValidationGenericInfo2
:
1952 _mem_save_generic_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1953 NDR_PULL_SET_MEM_CTX(ndr
, r
->generic
, 0);
1954 NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->generic
));
1955 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_generic_0
, 0);
1959 case NetlogonValidationSamInfo4
:
1961 _mem_save_sam6_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1962 NDR_PULL_SET_MEM_CTX(ndr
, r
->sam6
, 0);
1963 NDR_CHECK(ndr_pull_netr_SamInfo6(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sam6
));
1964 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sam6_0
, 0);
1969 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
1972 return NDR_ERR_SUCCESS
;
1975 _PUBLIC_
void ndr_print_netr_Validation(struct ndr_print
*ndr
, const char *name
, const union netr_Validation
*r
)
1978 level
= ndr_print_get_switch_value(ndr
, r
);
1979 ndr_print_union(ndr
, name
, level
, "netr_Validation");
1981 case NetlogonValidationSamInfo
:
1982 ndr_print_ptr(ndr
, "sam2", r
->sam2
);
1985 ndr_print_netr_SamInfo2(ndr
, "sam2", r
->sam2
);
1990 case NetlogonValidationSamInfo2
:
1991 ndr_print_ptr(ndr
, "sam3", r
->sam3
);
1994 ndr_print_netr_SamInfo3(ndr
, "sam3", r
->sam3
);
2000 ndr_print_ptr(ndr
, "pac", r
->pac
);
2003 ndr_print_netr_PacInfo(ndr
, "pac", r
->pac
);
2008 case NetlogonValidationGenericInfo2
:
2009 ndr_print_ptr(ndr
, "generic", r
->generic
);
2012 ndr_print_netr_GenericInfo2(ndr
, "generic", r
->generic
);
2017 case NetlogonValidationSamInfo4
:
2018 ndr_print_ptr(ndr
, "sam6", r
->sam6
);
2021 ndr_print_netr_SamInfo6(ndr
, "sam6", r
->sam6
);
2027 ndr_print_bad_level(ndr
, name
, level
);
2031 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Credential(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Credential
*r
)
2034 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2035 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2036 if (ndr_flags
& NDR_SCALARS
) {
2037 NDR_CHECK(ndr_push_align(ndr
, 1));
2038 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 8));
2040 if (ndr_flags
& NDR_BUFFERS
) {
2042 ndr
->flags
= _flags_save_STRUCT
;
2044 return NDR_ERR_SUCCESS
;
2047 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Credential(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Credential
*r
)
2050 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2051 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2052 if (ndr_flags
& NDR_SCALARS
) {
2053 NDR_CHECK(ndr_pull_align(ndr
, 1));
2054 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 8));
2056 if (ndr_flags
& NDR_BUFFERS
) {
2058 ndr
->flags
= _flags_save_STRUCT
;
2060 return NDR_ERR_SUCCESS
;
2063 _PUBLIC_
void ndr_print_netr_Credential(struct ndr_print
*ndr
, const char *name
, const struct netr_Credential
*r
)
2065 ndr_print_struct(ndr
, name
, "netr_Credential");
2067 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2068 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2070 ndr_print_array_uint8(ndr
, "data", r
->data
, 8);
2072 ndr
->flags
= _flags_save_STRUCT
;
2076 _PUBLIC_
enum ndr_err_code
ndr_push_netr_Authenticator(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Authenticator
*r
)
2078 if (ndr_flags
& NDR_SCALARS
) {
2079 NDR_CHECK(ndr_push_align(ndr
, 4));
2080 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, &r
->cred
));
2081 NDR_CHECK(ndr_push_time_t(ndr
, NDR_SCALARS
, r
->timestamp
));
2083 if (ndr_flags
& NDR_BUFFERS
) {
2085 return NDR_ERR_SUCCESS
;
2088 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_Authenticator(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Authenticator
*r
)
2090 if (ndr_flags
& NDR_SCALARS
) {
2091 NDR_CHECK(ndr_pull_align(ndr
, 4));
2092 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, &r
->cred
));
2093 NDR_CHECK(ndr_pull_time_t(ndr
, NDR_SCALARS
, &r
->timestamp
));
2095 if (ndr_flags
& NDR_BUFFERS
) {
2097 return NDR_ERR_SUCCESS
;
2100 _PUBLIC_
void ndr_print_netr_Authenticator(struct ndr_print
*ndr
, const char *name
, const struct netr_Authenticator
*r
)
2102 ndr_print_struct(ndr
, name
, "netr_Authenticator");
2104 ndr_print_netr_Credential(ndr
, "cred", &r
->cred
);
2105 ndr_print_time_t(ndr
, "timestamp", r
->timestamp
);
2109 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
)
2111 if (ndr_flags
& NDR_SCALARS
) {
2112 NDR_CHECK(ndr_push_align(ndr
, 4));
2113 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->account_name
));
2114 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2115 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2116 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2117 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2118 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2119 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2120 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2121 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2123 if (ndr_flags
& NDR_BUFFERS
) {
2124 if (r
->account_name
) {
2125 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
2126 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
2127 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF16
)));
2128 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->account_name
, ndr_charset_length(r
->account_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
2130 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2131 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2132 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2133 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2135 return NDR_ERR_SUCCESS
;
2138 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_USER
*r
)
2140 uint32_t _ptr_account_name
;
2141 TALLOC_CTX
*_mem_save_account_name_0
;
2142 if (ndr_flags
& NDR_SCALARS
) {
2143 NDR_CHECK(ndr_pull_align(ndr
, 4));
2144 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account_name
));
2145 if (_ptr_account_name
) {
2146 NDR_PULL_ALLOC(ndr
, r
->account_name
);
2148 r
->account_name
= NULL
;
2150 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2151 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2152 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2153 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2154 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2155 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2156 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2157 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2159 if (ndr_flags
& NDR_BUFFERS
) {
2160 if (r
->account_name
) {
2161 _mem_save_account_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2162 NDR_PULL_SET_MEM_CTX(ndr
, r
->account_name
, 0);
2163 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->account_name
));
2164 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->account_name
));
2165 if (ndr_get_array_length(ndr
, &r
->account_name
) > ndr_get_array_size(ndr
, &r
->account_name
)) {
2166 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
));
2168 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t)));
2169 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->account_name
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint16_t), CH_UTF16
));
2170 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_name_0
, 0);
2172 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2173 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2174 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2175 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2177 return NDR_ERR_SUCCESS
;
2180 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_USER
*r
)
2182 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_USER");
2184 ndr_print_ptr(ndr
, "account_name", r
->account_name
);
2186 if (r
->account_name
) {
2187 ndr_print_string(ndr
, "account_name", r
->account_name
);
2190 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
2191 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2192 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2193 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2194 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2195 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2196 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2197 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2201 static enum ndr_err_code
ndr_push_netr_USER_KEY16(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEY16
*r
)
2203 if (ndr_flags
& NDR_SCALARS
) {
2204 NDR_CHECK(ndr_push_align(ndr
, 4));
2205 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
2206 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
2207 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
2208 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->pwd
));
2210 if (ndr_flags
& NDR_BUFFERS
) {
2212 return NDR_ERR_SUCCESS
;
2215 static enum ndr_err_code
ndr_pull_netr_USER_KEY16(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEY16
*r
)
2217 if (ndr_flags
& NDR_SCALARS
) {
2218 NDR_CHECK(ndr_pull_align(ndr
, 4));
2219 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
2220 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
2221 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
2222 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->pwd
));
2224 if (ndr_flags
& NDR_BUFFERS
) {
2226 return NDR_ERR_SUCCESS
;
2229 _PUBLIC_
void ndr_print_netr_USER_KEY16(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEY16
*r
)
2231 ndr_print_struct(ndr
, name
, "netr_USER_KEY16");
2233 ndr_print_uint16(ndr
, "length", r
->length
);
2234 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->length
:r
->size
);
2235 ndr_print_uint32(ndr
, "flags", r
->flags
);
2236 ndr_print_samr_Password(ndr
, "pwd", &r
->pwd
);
2240 static enum ndr_err_code
ndr_push_netr_PasswordHistory(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_PasswordHistory
*r
)
2242 if (ndr_flags
& NDR_SCALARS
) {
2243 NDR_CHECK(ndr_push_align(ndr
, 4));
2244 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->nt_length
));
2245 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->nt_length
));
2246 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->nt_flags
));
2247 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->lm_length
));
2248 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->lm_length
));
2249 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->lm_flags
));
2250 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->nt_history
, r
->nt_length
));
2251 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->lm_history
, r
->lm_length
));
2253 if (ndr_flags
& NDR_BUFFERS
) {
2255 return NDR_ERR_SUCCESS
;
2258 static enum ndr_err_code
ndr_pull_netr_PasswordHistory(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_PasswordHistory
*r
)
2260 if (ndr_flags
& NDR_SCALARS
) {
2261 NDR_CHECK(ndr_pull_align(ndr
, 4));
2262 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->nt_length
));
2263 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->nt_size
));
2264 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->nt_flags
));
2265 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->lm_length
));
2266 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->lm_size
));
2267 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->lm_flags
));
2268 NDR_PULL_ALLOC_N(ndr
, r
->nt_history
, r
->nt_length
);
2269 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->nt_history
, r
->nt_length
));
2270 NDR_PULL_ALLOC_N(ndr
, r
->lm_history
, r
->lm_length
);
2271 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->lm_history
, r
->lm_length
));
2273 if (ndr_flags
& NDR_BUFFERS
) {
2275 return NDR_ERR_SUCCESS
;
2278 _PUBLIC_
void ndr_print_netr_PasswordHistory(struct ndr_print
*ndr
, const char *name
, const struct netr_PasswordHistory
*r
)
2280 ndr_print_struct(ndr
, name
, "netr_PasswordHistory");
2282 ndr_print_uint16(ndr
, "nt_length", r
->nt_length
);
2283 ndr_print_uint16(ndr
, "nt_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->nt_length
:r
->nt_size
);
2284 ndr_print_uint32(ndr
, "nt_flags", r
->nt_flags
);
2285 ndr_print_uint16(ndr
, "lm_length", r
->lm_length
);
2286 ndr_print_uint16(ndr
, "lm_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->lm_length
:r
->lm_size
);
2287 ndr_print_uint32(ndr
, "lm_flags", r
->lm_flags
);
2288 ndr_print_array_uint8(ndr
, "nt_history", r
->nt_history
, r
->nt_length
);
2289 ndr_print_array_uint8(ndr
, "lm_history", r
->lm_history
, r
->lm_length
);
2293 static enum ndr_err_code
ndr_push_netr_USER_KEYS2(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEYS2
*r
)
2295 if (ndr_flags
& NDR_SCALARS
) {
2296 NDR_CHECK(ndr_push_align(ndr
, 4));
2297 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2298 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2299 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr
, NDR_SCALARS
, &r
->history
));
2301 if (ndr_flags
& NDR_BUFFERS
) {
2303 return NDR_ERR_SUCCESS
;
2306 static enum ndr_err_code
ndr_pull_netr_USER_KEYS2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEYS2
*r
)
2308 if (ndr_flags
& NDR_SCALARS
) {
2309 NDR_CHECK(ndr_pull_align(ndr
, 4));
2310 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2311 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2312 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr
, NDR_SCALARS
, &r
->history
));
2314 if (ndr_flags
& NDR_BUFFERS
) {
2316 return NDR_ERR_SUCCESS
;
2319 _PUBLIC_
void ndr_print_netr_USER_KEYS2(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEYS2
*r
)
2321 ndr_print_struct(ndr
, name
, "netr_USER_KEYS2");
2323 ndr_print_netr_USER_KEY16(ndr
, "lmpassword", &r
->lmpassword
);
2324 ndr_print_netr_USER_KEY16(ndr
, "ntpassword", &r
->ntpassword
);
2325 ndr_print_netr_PasswordHistory(ndr
, "history", &r
->history
);
2329 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
)
2331 if (ndr_flags
& NDR_SCALARS
) {
2332 NDR_CHECK(ndr_push_align(ndr
, 4));
2333 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr
, NDR_SCALARS
, &r
->keys2
));
2335 if (ndr_flags
& NDR_BUFFERS
) {
2337 return NDR_ERR_SUCCESS
;
2340 static enum ndr_err_code
ndr_pull_netr_USER_KEY_UNION(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEY_UNION
*r
)
2342 if (ndr_flags
& NDR_SCALARS
) {
2343 NDR_CHECK(ndr_pull_align(ndr
, 4));
2344 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr
, NDR_SCALARS
, &r
->keys2
));
2346 if (ndr_flags
& NDR_BUFFERS
) {
2348 return NDR_ERR_SUCCESS
;
2351 _PUBLIC_
void ndr_print_netr_USER_KEY_UNION(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEY_UNION
*r
)
2353 ndr_print_struct(ndr
, name
, "netr_USER_KEY_UNION");
2355 ndr_print_netr_USER_KEYS2(ndr
, "keys2", &r
->keys2
);
2359 _PUBLIC_
enum ndr_err_code
ndr_push_netr_USER_KEYS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_USER_KEYS
*r
)
2361 if (ndr_flags
& NDR_SCALARS
) {
2362 NDR_CHECK(ndr_push_align(ndr
, 4));
2363 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->version
));
2364 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr
, NDR_SCALARS
, &r
->keys
));
2366 if (ndr_flags
& NDR_BUFFERS
) {
2368 return NDR_ERR_SUCCESS
;
2371 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_USER_KEYS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_KEYS
*r
)
2373 if (ndr_flags
& NDR_SCALARS
) {
2374 NDR_CHECK(ndr_pull_align(ndr
, 4));
2375 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->version
));
2376 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr
, NDR_SCALARS
, &r
->keys
));
2378 if (ndr_flags
& NDR_BUFFERS
) {
2380 return NDR_ERR_SUCCESS
;
2383 _PUBLIC_
void ndr_print_netr_USER_KEYS(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_KEYS
*r
)
2385 ndr_print_struct(ndr
, name
, "netr_USER_KEYS");
2387 ndr_print_uint32(ndr
, "version", r
->version
);
2388 ndr_print_netr_USER_KEY_UNION(ndr
, "keys", &r
->keys
);
2392 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
)
2394 if (ndr_flags
& NDR_SCALARS
) {
2395 NDR_CHECK(ndr_push_align(ndr
, 4));
2396 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->SensitiveDataFlag
));
2397 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->DataLength
));
2399 uint32_t _flags_save_uint8
= ndr
->flags
;
2400 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2401 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->SensitiveData
));
2402 ndr
->flags
= _flags_save_uint8
;
2405 if (ndr_flags
& NDR_BUFFERS
) {
2407 uint32_t _flags_save_uint8
= ndr
->flags
;
2408 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2409 if (r
->SensitiveData
) {
2410 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->DataLength
));
2411 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->SensitiveData
, r
->DataLength
));
2413 ndr
->flags
= _flags_save_uint8
;
2416 return NDR_ERR_SUCCESS
;
2419 static enum ndr_err_code
ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_USER_PRIVATE_INFO
*r
)
2421 uint32_t _ptr_SensitiveData
;
2422 TALLOC_CTX
*_mem_save_SensitiveData_0
;
2423 if (ndr_flags
& NDR_SCALARS
) {
2424 NDR_CHECK(ndr_pull_align(ndr
, 4));
2425 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->SensitiveDataFlag
));
2426 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->DataLength
));
2428 uint32_t _flags_save_uint8
= ndr
->flags
;
2429 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2430 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_SensitiveData
));
2431 if (_ptr_SensitiveData
) {
2432 NDR_PULL_ALLOC(ndr
, r
->SensitiveData
);
2434 r
->SensitiveData
= NULL
;
2436 ndr
->flags
= _flags_save_uint8
;
2439 if (ndr_flags
& NDR_BUFFERS
) {
2441 uint32_t _flags_save_uint8
= ndr
->flags
;
2442 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2443 if (r
->SensitiveData
) {
2444 _mem_save_SensitiveData_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2445 NDR_PULL_SET_MEM_CTX(ndr
, r
->SensitiveData
, 0);
2446 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->SensitiveData
));
2447 NDR_PULL_ALLOC_N(ndr
, r
->SensitiveData
, ndr_get_array_size(ndr
, &r
->SensitiveData
));
2448 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->SensitiveData
, ndr_get_array_size(ndr
, &r
->SensitiveData
)));
2449 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_SensitiveData_0
, 0);
2451 ndr
->flags
= _flags_save_uint8
;
2453 if (r
->SensitiveData
) {
2454 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->SensitiveData
, r
->DataLength
));
2457 return NDR_ERR_SUCCESS
;
2460 _PUBLIC_
void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print
*ndr
, const char *name
, const struct netr_USER_PRIVATE_INFO
*r
)
2462 ndr_print_struct(ndr
, name
, "netr_USER_PRIVATE_INFO");
2464 ndr_print_uint8(ndr
, "SensitiveDataFlag", r
->SensitiveDataFlag
);
2465 ndr_print_uint32(ndr
, "DataLength", r
->DataLength
);
2466 ndr_print_ptr(ndr
, "SensitiveData", r
->SensitiveData
);
2468 if (r
->SensitiveData
) {
2469 ndr_print_array_uint8(ndr
, "SensitiveData", r
->SensitiveData
, r
->DataLength
);
2475 static enum ndr_err_code
ndr_push_netr_DELTA_USER(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_USER
*r
)
2477 if (ndr_flags
& NDR_SCALARS
) {
2478 NDR_CHECK(ndr_push_align(ndr
, 4));
2479 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
2480 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
2481 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
2482 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->primary_gid
));
2483 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
2484 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
2485 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
2486 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2487 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->workstations
));
2488 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logon
));
2489 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_logoff
));
2490 NDR_CHECK(ndr_push_samr_LogonHours(ndr
, NDR_SCALARS
, &r
->logon_hours
));
2491 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->bad_password_count
));
2492 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->logon_count
));
2493 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->last_password_change
));
2494 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->acct_expiry
));
2495 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->acct_flags
));
2496 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2497 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2498 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->nt_password_present
));
2499 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->lm_password_present
));
2500 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->password_expired
));
2501 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2502 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->parameters
));
2503 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->country_code
));
2504 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->code_page
));
2505 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr
, NDR_SCALARS
, &r
->user_private_info
));
2506 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2507 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2508 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
2509 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2510 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2511 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2512 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2513 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2514 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2515 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2517 if (ndr_flags
& NDR_BUFFERS
) {
2518 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
2519 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
2520 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
2521 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
2522 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
2523 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2524 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstations
));
2525 NDR_CHECK(ndr_push_samr_LogonHours(ndr
, NDR_BUFFERS
, &r
->logon_hours
));
2526 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2527 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->parameters
));
2528 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr
, NDR_BUFFERS
, &r
->user_private_info
));
2529 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2530 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
2531 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2532 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2533 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2535 return NDR_ERR_SUCCESS
;
2538 static enum ndr_err_code
ndr_pull_netr_DELTA_USER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_USER
*r
)
2540 if (ndr_flags
& NDR_SCALARS
) {
2541 NDR_CHECK(ndr_pull_align(ndr
, 4));
2542 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->account_name
));
2543 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->full_name
));
2544 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
2545 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->primary_gid
));
2546 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_directory
));
2547 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->home_drive
));
2548 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->logon_script
));
2549 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2550 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->workstations
));
2551 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logon
));
2552 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_logoff
));
2553 NDR_CHECK(ndr_pull_samr_LogonHours(ndr
, NDR_SCALARS
, &r
->logon_hours
));
2554 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->bad_password_count
));
2555 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->logon_count
));
2556 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->last_password_change
));
2557 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->acct_expiry
));
2558 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->acct_flags
));
2559 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->lmpassword
));
2560 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, &r
->ntpassword
));
2561 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->nt_password_present
));
2562 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->lm_password_present
));
2563 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->password_expired
));
2564 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->comment
));
2565 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->parameters
));
2566 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->country_code
));
2567 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->code_page
));
2568 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr
, NDR_SCALARS
, &r
->user_private_info
));
2569 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2570 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2571 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->profile_path
));
2572 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2573 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2574 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2575 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2576 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2577 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2578 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2580 if (ndr_flags
& NDR_BUFFERS
) {
2581 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->account_name
));
2582 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->full_name
));
2583 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_directory
));
2584 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->home_drive
));
2585 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->logon_script
));
2586 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2587 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->workstations
));
2588 NDR_CHECK(ndr_pull_samr_LogonHours(ndr
, NDR_BUFFERS
, &r
->logon_hours
));
2589 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->comment
));
2590 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->parameters
));
2591 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr
, NDR_BUFFERS
, &r
->user_private_info
));
2592 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2593 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->profile_path
));
2594 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2595 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2596 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2598 return NDR_ERR_SUCCESS
;
2601 _PUBLIC_
void ndr_print_netr_DELTA_USER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_USER
*r
)
2603 ndr_print_struct(ndr
, name
, "netr_DELTA_USER");
2605 ndr_print_lsa_String(ndr
, "account_name", &r
->account_name
);
2606 ndr_print_lsa_String(ndr
, "full_name", &r
->full_name
);
2607 ndr_print_uint32(ndr
, "rid", r
->rid
);
2608 ndr_print_uint32(ndr
, "primary_gid", r
->primary_gid
);
2609 ndr_print_lsa_String(ndr
, "home_directory", &r
->home_directory
);
2610 ndr_print_lsa_String(ndr
, "home_drive", &r
->home_drive
);
2611 ndr_print_lsa_String(ndr
, "logon_script", &r
->logon_script
);
2612 ndr_print_lsa_String(ndr
, "description", &r
->description
);
2613 ndr_print_lsa_String(ndr
, "workstations", &r
->workstations
);
2614 ndr_print_NTTIME(ndr
, "last_logon", r
->last_logon
);
2615 ndr_print_NTTIME(ndr
, "last_logoff", r
->last_logoff
);
2616 ndr_print_samr_LogonHours(ndr
, "logon_hours", &r
->logon_hours
);
2617 ndr_print_uint16(ndr
, "bad_password_count", r
->bad_password_count
);
2618 ndr_print_uint16(ndr
, "logon_count", r
->logon_count
);
2619 ndr_print_NTTIME(ndr
, "last_password_change", r
->last_password_change
);
2620 ndr_print_NTTIME(ndr
, "acct_expiry", r
->acct_expiry
);
2621 ndr_print_samr_AcctFlags(ndr
, "acct_flags", r
->acct_flags
);
2622 ndr_print_samr_Password(ndr
, "lmpassword", &r
->lmpassword
);
2623 ndr_print_samr_Password(ndr
, "ntpassword", &r
->ntpassword
);
2624 ndr_print_uint8(ndr
, "nt_password_present", r
->nt_password_present
);
2625 ndr_print_uint8(ndr
, "lm_password_present", r
->lm_password_present
);
2626 ndr_print_uint8(ndr
, "password_expired", r
->password_expired
);
2627 ndr_print_lsa_String(ndr
, "comment", &r
->comment
);
2628 ndr_print_lsa_BinaryString(ndr
, "parameters", &r
->parameters
);
2629 ndr_print_uint16(ndr
, "country_code", r
->country_code
);
2630 ndr_print_uint16(ndr
, "code_page", r
->code_page
);
2631 ndr_print_netr_USER_PRIVATE_INFO(ndr
, "user_private_info", &r
->user_private_info
);
2632 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2633 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2634 ndr_print_lsa_String(ndr
, "profile_path", &r
->profile_path
);
2635 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2636 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2637 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2638 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2639 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2640 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2641 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2645 static enum ndr_err_code
ndr_push_netr_DELTA_DOMAIN(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_DOMAIN
*r
)
2647 if (ndr_flags
& NDR_SCALARS
) {
2648 NDR_CHECK(ndr_push_align(ndr
, 4));
2649 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
2650 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->oem_information
));
2651 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->force_logoff_time
));
2652 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->min_password_length
));
2653 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->password_history_length
));
2654 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->max_password_age
));
2655 NDR_CHECK(ndr_push_dlong(ndr
, NDR_SCALARS
, r
->min_password_age
));
2656 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->sequence_num
));
2657 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->domain_create_time
));
2658 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2659 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2660 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->account_lockout
));
2661 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2662 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2663 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2664 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_to_chgpass
));
2665 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2666 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2667 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2669 if (ndr_flags
& NDR_BUFFERS
) {
2670 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
2671 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->oem_information
));
2672 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2673 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->account_lockout
));
2674 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2675 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2676 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2678 return NDR_ERR_SUCCESS
;
2681 static enum ndr_err_code
ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DOMAIN
*r
)
2683 if (ndr_flags
& NDR_SCALARS
) {
2684 NDR_CHECK(ndr_pull_align(ndr
, 4));
2685 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
2686 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->oem_information
));
2687 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->force_logoff_time
));
2688 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->min_password_length
));
2689 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->password_history_length
));
2690 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->max_password_age
));
2691 NDR_CHECK(ndr_pull_dlong(ndr
, NDR_SCALARS
, &r
->min_password_age
));
2692 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->sequence_num
));
2693 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->domain_create_time
));
2694 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2695 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2696 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->account_lockout
));
2697 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2698 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2699 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2700 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_to_chgpass
));
2701 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2702 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2703 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2705 if (ndr_flags
& NDR_BUFFERS
) {
2706 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
2707 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->oem_information
));
2708 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2709 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->account_lockout
));
2710 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2711 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2712 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2714 return NDR_ERR_SUCCESS
;
2717 _PUBLIC_
void ndr_print_netr_DELTA_DOMAIN(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DOMAIN
*r
)
2719 ndr_print_struct(ndr
, name
, "netr_DELTA_DOMAIN");
2721 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
2722 ndr_print_lsa_String(ndr
, "oem_information", &r
->oem_information
);
2723 ndr_print_dlong(ndr
, "force_logoff_time", r
->force_logoff_time
);
2724 ndr_print_uint16(ndr
, "min_password_length", r
->min_password_length
);
2725 ndr_print_uint16(ndr
, "password_history_length", r
->password_history_length
);
2726 ndr_print_dlong(ndr
, "max_password_age", r
->max_password_age
);
2727 ndr_print_dlong(ndr
, "min_password_age", r
->min_password_age
);
2728 ndr_print_udlong(ndr
, "sequence_num", r
->sequence_num
);
2729 ndr_print_NTTIME(ndr
, "domain_create_time", r
->domain_create_time
);
2730 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2731 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2732 ndr_print_lsa_BinaryString(ndr
, "account_lockout", &r
->account_lockout
);
2733 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2734 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2735 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2736 ndr_print_uint32(ndr
, "logon_to_chgpass", r
->logon_to_chgpass
);
2737 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2738 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2739 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2743 static enum ndr_err_code
ndr_push_netr_DELTA_GROUP(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_GROUP
*r
)
2745 if (ndr_flags
& NDR_SCALARS
) {
2746 NDR_CHECK(ndr_push_align(ndr
, 4));
2747 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->group_name
));
2748 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
2749 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attributes
));
2750 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2751 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
2752 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2753 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2754 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2755 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2756 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2757 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2758 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2759 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2760 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2762 if (ndr_flags
& NDR_BUFFERS
) {
2763 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->group_name
));
2764 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2765 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2766 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2767 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2768 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2769 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2771 return NDR_ERR_SUCCESS
;
2774 static enum ndr_err_code
ndr_pull_netr_DELTA_GROUP(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_GROUP
*r
)
2776 if (ndr_flags
& NDR_SCALARS
) {
2777 NDR_CHECK(ndr_pull_align(ndr
, 4));
2778 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->group_name
));
2779 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
2780 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attributes
));
2781 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
2782 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
2783 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
2784 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2785 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2786 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2787 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2788 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
2789 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
2790 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
2791 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
2793 if (ndr_flags
& NDR_BUFFERS
) {
2794 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->group_name
));
2795 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
2796 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
2797 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2798 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2799 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2800 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2802 return NDR_ERR_SUCCESS
;
2805 _PUBLIC_
void ndr_print_netr_DELTA_GROUP(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_GROUP
*r
)
2807 ndr_print_struct(ndr
, name
, "netr_DELTA_GROUP");
2809 ndr_print_lsa_String(ndr
, "group_name", &r
->group_name
);
2810 ndr_print_uint32(ndr
, "rid", r
->rid
);
2811 ndr_print_uint32(ndr
, "attributes", r
->attributes
);
2812 ndr_print_lsa_String(ndr
, "description", &r
->description
);
2813 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
2814 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
2815 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
2816 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2817 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2818 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2819 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2820 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2821 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2822 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2826 static enum ndr_err_code
ndr_push_netr_DELTA_RENAME(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_RENAME
*r
)
2828 if (ndr_flags
& NDR_SCALARS
) {
2829 NDR_CHECK(ndr_push_align(ndr
, 4));
2830 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->OldName
));
2831 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->NewName
));
2832 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
2833 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
2834 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
2835 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
2836 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
2837 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
2838 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
2839 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
2841 if (ndr_flags
& NDR_BUFFERS
) {
2842 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->OldName
));
2843 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->NewName
));
2844 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2845 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2846 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2847 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2849 return NDR_ERR_SUCCESS
;
2852 static enum ndr_err_code
ndr_pull_netr_DELTA_RENAME(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_RENAME
*r
)
2854 if (ndr_flags
& NDR_SCALARS
) {
2855 NDR_CHECK(ndr_pull_align(ndr
, 4));
2856 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->OldName
));
2857 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->NewName
));
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
));
2867 if (ndr_flags
& NDR_BUFFERS
) {
2868 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->OldName
));
2869 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->NewName
));
2870 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
2871 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
2872 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
2873 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
2875 return NDR_ERR_SUCCESS
;
2878 _PUBLIC_
void ndr_print_netr_DELTA_RENAME(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_RENAME
*r
)
2880 ndr_print_struct(ndr
, name
, "netr_DELTA_RENAME");
2882 ndr_print_lsa_String(ndr
, "OldName", &r
->OldName
);
2883 ndr_print_lsa_String(ndr
, "NewName", &r
->NewName
);
2884 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
2885 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
2886 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
2887 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
2888 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
2889 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
2890 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
2891 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
2895 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
)
2897 uint32_t cntr_rids_1
;
2898 uint32_t cntr_attribs_1
;
2899 if (ndr_flags
& NDR_SCALARS
) {
2900 NDR_CHECK(ndr_push_align(ndr
, 4));
2901 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rids
));
2902 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->attribs
));
2903 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2904 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
2905 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
2906 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
2907 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
2909 if (ndr_flags
& NDR_BUFFERS
) {
2911 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2912 for (cntr_rids_1
= 0; cntr_rids_1
< r
->num_rids
; cntr_rids_1
++) {
2913 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rids
[cntr_rids_1
]));
2917 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_rids
));
2918 for (cntr_attribs_1
= 0; cntr_attribs_1
< r
->num_rids
; cntr_attribs_1
++) {
2919 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attribs
[cntr_attribs_1
]));
2923 return NDR_ERR_SUCCESS
;
2926 static enum ndr_err_code
ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_GROUP_MEMBER
*r
)
2929 uint32_t cntr_rids_1
;
2930 TALLOC_CTX
*_mem_save_rids_0
;
2931 TALLOC_CTX
*_mem_save_rids_1
;
2932 uint32_t _ptr_attribs
;
2933 uint32_t cntr_attribs_1
;
2934 TALLOC_CTX
*_mem_save_attribs_0
;
2935 TALLOC_CTX
*_mem_save_attribs_1
;
2936 if (ndr_flags
& NDR_SCALARS
) {
2937 NDR_CHECK(ndr_pull_align(ndr
, 4));
2938 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rids
));
2940 NDR_PULL_ALLOC(ndr
, r
->rids
);
2944 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_attribs
));
2946 NDR_PULL_ALLOC(ndr
, r
->attribs
);
2950 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_rids
));
2951 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
2952 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
2953 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
2954 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
2956 if (ndr_flags
& NDR_BUFFERS
) {
2958 _mem_save_rids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2959 NDR_PULL_SET_MEM_CTX(ndr
, r
->rids
, 0);
2960 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->rids
));
2961 NDR_PULL_ALLOC_N(ndr
, r
->rids
, ndr_get_array_size(ndr
, &r
->rids
));
2962 _mem_save_rids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
2963 NDR_PULL_SET_MEM_CTX(ndr
, r
->rids
, 0);
2964 for (cntr_rids_1
= 0; cntr_rids_1
< r
->num_rids
; cntr_rids_1
++) {
2965 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rids
[cntr_rids_1
]));
2967 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rids_1
, 0);
2968 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rids_0
, 0);
2971 _mem_save_attribs_0
= NDR_PULL_GET_MEM_CTX(ndr
);
2972 NDR_PULL_SET_MEM_CTX(ndr
, r
->attribs
, 0);
2973 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->attribs
));
2974 NDR_PULL_ALLOC_N(ndr
, r
->attribs
, ndr_get_array_size(ndr
, &r
->attribs
));
2975 _mem_save_attribs_1
= NDR_PULL_GET_MEM_CTX(ndr
);
2976 NDR_PULL_SET_MEM_CTX(ndr
, r
->attribs
, 0);
2977 for (cntr_attribs_1
= 0; cntr_attribs_1
< r
->num_rids
; cntr_attribs_1
++) {
2978 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attribs
[cntr_attribs_1
]));
2980 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_attribs_1
, 0);
2981 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_attribs_0
, 0);
2984 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->rids
, r
->num_rids
));
2987 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->attribs
, r
->num_rids
));
2990 return NDR_ERR_SUCCESS
;
2993 _PUBLIC_
void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_GROUP_MEMBER
*r
)
2995 uint32_t cntr_rids_1
;
2996 uint32_t cntr_attribs_1
;
2997 ndr_print_struct(ndr
, name
, "netr_DELTA_GROUP_MEMBER");
2999 ndr_print_ptr(ndr
, "rids", r
->rids
);
3002 ndr
->print(ndr
, "%s: ARRAY(%d)", "rids", (int)r
->num_rids
);
3004 for (cntr_rids_1
=0;cntr_rids_1
<r
->num_rids
;cntr_rids_1
++) {
3006 if (asprintf(&idx_1
, "[%d]", cntr_rids_1
) != -1) {
3007 ndr_print_uint32(ndr
, "rids", r
->rids
[cntr_rids_1
]);
3014 ndr_print_ptr(ndr
, "attribs", r
->attribs
);
3017 ndr
->print(ndr
, "%s: ARRAY(%d)", "attribs", (int)r
->num_rids
);
3019 for (cntr_attribs_1
=0;cntr_attribs_1
<r
->num_rids
;cntr_attribs_1
++) {
3021 if (asprintf(&idx_1
, "[%d]", cntr_attribs_1
) != -1) {
3022 ndr_print_uint32(ndr
, "attribs", r
->attribs
[cntr_attribs_1
]);
3029 ndr_print_uint32(ndr
, "num_rids", r
->num_rids
);
3030 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
3031 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
3032 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
3033 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
3037 static enum ndr_err_code
ndr_push_netr_DELTA_ALIAS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ALIAS
*r
)
3039 if (ndr_flags
& NDR_SCALARS
) {
3040 NDR_CHECK(ndr_push_align(ndr
, 4));
3041 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->alias_name
));
3042 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
3043 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3044 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3045 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
3046 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3047 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3048 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3049 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3050 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3051 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3052 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3054 if (ndr_flags
& NDR_BUFFERS
) {
3055 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->alias_name
));
3056 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3057 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
3058 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3059 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3060 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3062 return NDR_ERR_SUCCESS
;
3065 static enum ndr_err_code
ndr_pull_netr_DELTA_ALIAS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ALIAS
*r
)
3067 if (ndr_flags
& NDR_SCALARS
) {
3068 NDR_CHECK(ndr_pull_align(ndr
, 4));
3069 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->alias_name
));
3070 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
3071 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3072 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3073 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->description
));
3074 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3075 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3076 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3077 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3078 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3079 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3080 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3082 if (ndr_flags
& NDR_BUFFERS
) {
3083 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->alias_name
));
3084 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3085 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->description
));
3086 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3087 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3088 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3090 return NDR_ERR_SUCCESS
;
3093 _PUBLIC_
void ndr_print_netr_DELTA_ALIAS(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ALIAS
*r
)
3095 ndr_print_struct(ndr
, name
, "netr_DELTA_ALIAS");
3097 ndr_print_lsa_String(ndr
, "alias_name", &r
->alias_name
);
3098 ndr_print_uint32(ndr
, "rid", r
->rid
);
3099 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3100 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3101 ndr_print_lsa_String(ndr
, "description", &r
->description
);
3102 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3103 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3104 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3105 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3106 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3107 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3108 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3112 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
)
3114 if (ndr_flags
& NDR_SCALARS
) {
3115 NDR_CHECK(ndr_push_align(ndr
, 4));
3116 NDR_CHECK(ndr_push_lsa_SidArray(ndr
, NDR_SCALARS
, &r
->sids
));
3117 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
3118 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
3119 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
3120 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
3122 if (ndr_flags
& NDR_BUFFERS
) {
3123 NDR_CHECK(ndr_push_lsa_SidArray(ndr
, NDR_BUFFERS
, &r
->sids
));
3125 return NDR_ERR_SUCCESS
;
3128 static enum ndr_err_code
ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ALIAS_MEMBER
*r
)
3130 if (ndr_flags
& NDR_SCALARS
) {
3131 NDR_CHECK(ndr_pull_align(ndr
, 4));
3132 NDR_CHECK(ndr_pull_lsa_SidArray(ndr
, NDR_SCALARS
, &r
->sids
));
3133 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
3134 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
3135 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
3136 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
3138 if (ndr_flags
& NDR_BUFFERS
) {
3139 NDR_CHECK(ndr_pull_lsa_SidArray(ndr
, NDR_BUFFERS
, &r
->sids
));
3141 return NDR_ERR_SUCCESS
;
3144 _PUBLIC_
void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ALIAS_MEMBER
*r
)
3146 ndr_print_struct(ndr
, name
, "netr_DELTA_ALIAS_MEMBER");
3148 ndr_print_lsa_SidArray(ndr
, "sids", &r
->sids
);
3149 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
3150 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
3151 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
3152 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
3156 static enum ndr_err_code
ndr_push_netr_QUOTA_LIMITS(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_QUOTA_LIMITS
*r
)
3158 if (ndr_flags
& NDR_SCALARS
) {
3159 NDR_CHECK(ndr_push_align(ndr
, 4));
3160 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pagedpoollimit
));
3161 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->nonpagedpoollimit
));
3162 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->minimumworkingsetsize
));
3163 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maximumworkingsetsize
));
3164 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pagefilelimit
));
3165 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->timelimit
));
3167 if (ndr_flags
& NDR_BUFFERS
) {
3169 return NDR_ERR_SUCCESS
;
3172 static enum ndr_err_code
ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_QUOTA_LIMITS
*r
)
3174 if (ndr_flags
& NDR_SCALARS
) {
3175 NDR_CHECK(ndr_pull_align(ndr
, 4));
3176 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pagedpoollimit
));
3177 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->nonpagedpoollimit
));
3178 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->minimumworkingsetsize
));
3179 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maximumworkingsetsize
));
3180 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pagefilelimit
));
3181 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->timelimit
));
3183 if (ndr_flags
& NDR_BUFFERS
) {
3185 return NDR_ERR_SUCCESS
;
3188 _PUBLIC_
void ndr_print_netr_QUOTA_LIMITS(struct ndr_print
*ndr
, const char *name
, const struct netr_QUOTA_LIMITS
*r
)
3190 ndr_print_struct(ndr
, name
, "netr_QUOTA_LIMITS");
3192 ndr_print_uint32(ndr
, "pagedpoollimit", r
->pagedpoollimit
);
3193 ndr_print_uint32(ndr
, "nonpagedpoollimit", r
->nonpagedpoollimit
);
3194 ndr_print_uint32(ndr
, "minimumworkingsetsize", r
->minimumworkingsetsize
);
3195 ndr_print_uint32(ndr
, "maximumworkingsetsize", r
->maximumworkingsetsize
);
3196 ndr_print_uint32(ndr
, "pagefilelimit", r
->pagefilelimit
);
3197 ndr_print_NTTIME(ndr
, "timelimit", r
->timelimit
);
3201 static enum ndr_err_code
ndr_push_netr_DELTA_POLICY(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_POLICY
*r
)
3203 uint32_t cntr_eventauditoptions_1
;
3204 if (ndr_flags
& NDR_SCALARS
) {
3205 NDR_CHECK(ndr_push_align(ndr
, 4));
3206 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlogsize
));
3207 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->auditretentionperiod
));
3208 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->auditingmode
));
3209 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxauditeventcount
));
3210 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->eventauditoptions
));
3211 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->primary_domain_name
));
3212 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
3213 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quota_limits
));
3214 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->sequence_num
));
3215 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->db_create_time
));
3216 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3217 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3218 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3219 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3220 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3221 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3222 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3223 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3224 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3225 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3227 if (ndr_flags
& NDR_BUFFERS
) {
3228 if (r
->eventauditoptions
) {
3229 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxauditeventcount
+ 1));
3230 for (cntr_eventauditoptions_1
= 0; cntr_eventauditoptions_1
< r
->maxauditeventcount
+ 1; cntr_eventauditoptions_1
++) {
3231 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->eventauditoptions
[cntr_eventauditoptions_1
]));
3234 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->primary_domain_name
));
3236 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
3238 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3239 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3240 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3241 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3242 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3244 return NDR_ERR_SUCCESS
;
3247 static enum ndr_err_code
ndr_pull_netr_DELTA_POLICY(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_POLICY
*r
)
3249 uint32_t _ptr_eventauditoptions
;
3250 uint32_t cntr_eventauditoptions_1
;
3251 TALLOC_CTX
*_mem_save_eventauditoptions_0
;
3252 TALLOC_CTX
*_mem_save_eventauditoptions_1
;
3254 TALLOC_CTX
*_mem_save_sid_0
;
3255 if (ndr_flags
& NDR_SCALARS
) {
3256 NDR_CHECK(ndr_pull_align(ndr
, 4));
3257 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxlogsize
));
3258 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->auditretentionperiod
));
3259 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->auditingmode
));
3260 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxauditeventcount
));
3261 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_eventauditoptions
));
3262 if (_ptr_eventauditoptions
) {
3263 NDR_PULL_ALLOC(ndr
, r
->eventauditoptions
);
3265 r
->eventauditoptions
= NULL
;
3267 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->primary_domain_name
));
3268 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
3270 NDR_PULL_ALLOC(ndr
, r
->sid
);
3274 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quota_limits
));
3275 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->sequence_num
));
3276 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->db_create_time
));
3277 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3278 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3279 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3280 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3281 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3282 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3283 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3284 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3285 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3286 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3288 if (ndr_flags
& NDR_BUFFERS
) {
3289 if (r
->eventauditoptions
) {
3290 _mem_save_eventauditoptions_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3291 NDR_PULL_SET_MEM_CTX(ndr
, r
->eventauditoptions
, 0);
3292 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->eventauditoptions
));
3293 NDR_PULL_ALLOC_N(ndr
, r
->eventauditoptions
, ndr_get_array_size(ndr
, &r
->eventauditoptions
));
3294 _mem_save_eventauditoptions_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3295 NDR_PULL_SET_MEM_CTX(ndr
, r
->eventauditoptions
, 0);
3296 for (cntr_eventauditoptions_1
= 0; cntr_eventauditoptions_1
< r
->maxauditeventcount
+ 1; cntr_eventauditoptions_1
++) {
3297 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->eventauditoptions
[cntr_eventauditoptions_1
]));
3299 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eventauditoptions_1
, 0);
3300 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eventauditoptions_0
, 0);
3302 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->primary_domain_name
));
3304 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3305 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
3306 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
3307 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
3309 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3310 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3311 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3312 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3313 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3314 if (r
->eventauditoptions
) {
3315 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->eventauditoptions
, r
->maxauditeventcount
+ 1));
3318 return NDR_ERR_SUCCESS
;
3321 _PUBLIC_
void ndr_print_netr_DELTA_POLICY(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_POLICY
*r
)
3323 uint32_t cntr_eventauditoptions_1
;
3324 ndr_print_struct(ndr
, name
, "netr_DELTA_POLICY");
3326 ndr_print_uint32(ndr
, "maxlogsize", r
->maxlogsize
);
3327 ndr_print_NTTIME(ndr
, "auditretentionperiod", r
->auditretentionperiod
);
3328 ndr_print_uint8(ndr
, "auditingmode", r
->auditingmode
);
3329 ndr_print_uint32(ndr
, "maxauditeventcount", r
->maxauditeventcount
);
3330 ndr_print_ptr(ndr
, "eventauditoptions", r
->eventauditoptions
);
3332 if (r
->eventauditoptions
) {
3333 ndr
->print(ndr
, "%s: ARRAY(%d)", "eventauditoptions", (int)r
->maxauditeventcount
+ 1);
3335 for (cntr_eventauditoptions_1
=0;cntr_eventauditoptions_1
<r
->maxauditeventcount
+ 1;cntr_eventauditoptions_1
++) {
3337 if (asprintf(&idx_1
, "[%d]", cntr_eventauditoptions_1
) != -1) {
3338 ndr_print_uint32(ndr
, "eventauditoptions", r
->eventauditoptions
[cntr_eventauditoptions_1
]);
3345 ndr_print_lsa_String(ndr
, "primary_domain_name", &r
->primary_domain_name
);
3346 ndr_print_ptr(ndr
, "sid", r
->sid
);
3349 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
3352 ndr_print_netr_QUOTA_LIMITS(ndr
, "quota_limits", &r
->quota_limits
);
3353 ndr_print_udlong(ndr
, "sequence_num", r
->sequence_num
);
3354 ndr_print_NTTIME(ndr
, "db_create_time", r
->db_create_time
);
3355 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3356 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3357 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3358 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3359 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3360 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3361 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3362 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3363 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3364 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3368 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
)
3370 uint32_t cntr_controller_names_1
;
3371 if (ndr_flags
& NDR_SCALARS
) {
3372 NDR_CHECK(ndr_push_align(ndr
, 4));
3373 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
3374 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_controllers
));
3375 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->controller_names
));
3376 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3377 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3378 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3379 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3380 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3381 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3382 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->posix_offset
));
3383 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3384 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3385 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3387 if (ndr_flags
& NDR_BUFFERS
) {
3388 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
3389 if (r
->controller_names
) {
3390 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_controllers
));
3391 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3392 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->controller_names
[cntr_controller_names_1
]));
3394 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3395 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->controller_names
[cntr_controller_names_1
]));
3398 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3399 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3400 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3401 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3402 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3404 return NDR_ERR_SUCCESS
;
3407 static enum ndr_err_code
ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_TRUSTED_DOMAIN
*r
)
3409 uint32_t _ptr_controller_names
;
3410 uint32_t cntr_controller_names_1
;
3411 TALLOC_CTX
*_mem_save_controller_names_0
;
3412 TALLOC_CTX
*_mem_save_controller_names_1
;
3413 if (ndr_flags
& NDR_SCALARS
) {
3414 NDR_CHECK(ndr_pull_align(ndr
, 4));
3415 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domain_name
));
3416 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_controllers
));
3417 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_controller_names
));
3418 if (_ptr_controller_names
) {
3419 NDR_PULL_ALLOC(ndr
, r
->controller_names
);
3421 r
->controller_names
= NULL
;
3423 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3424 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3425 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3426 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3427 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3428 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3429 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->posix_offset
));
3430 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3431 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3432 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3434 if (ndr_flags
& NDR_BUFFERS
) {
3435 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domain_name
));
3436 if (r
->controller_names
) {
3437 _mem_save_controller_names_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3438 NDR_PULL_SET_MEM_CTX(ndr
, r
->controller_names
, 0);
3439 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->controller_names
));
3440 NDR_PULL_ALLOC_N(ndr
, r
->controller_names
, ndr_get_array_size(ndr
, &r
->controller_names
));
3441 _mem_save_controller_names_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3442 NDR_PULL_SET_MEM_CTX(ndr
, r
->controller_names
, 0);
3443 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3444 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->controller_names
[cntr_controller_names_1
]));
3446 for (cntr_controller_names_1
= 0; cntr_controller_names_1
< r
->num_controllers
; cntr_controller_names_1
++) {
3447 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->controller_names
[cntr_controller_names_1
]));
3449 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_controller_names_1
, 0);
3450 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_controller_names_0
, 0);
3452 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3453 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3454 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3455 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3456 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3457 if (r
->controller_names
) {
3458 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->controller_names
, r
->num_controllers
));
3461 return NDR_ERR_SUCCESS
;
3464 _PUBLIC_
void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_TRUSTED_DOMAIN
*r
)
3466 uint32_t cntr_controller_names_1
;
3467 ndr_print_struct(ndr
, name
, "netr_DELTA_TRUSTED_DOMAIN");
3469 ndr_print_lsa_String(ndr
, "domain_name", &r
->domain_name
);
3470 ndr_print_uint32(ndr
, "num_controllers", r
->num_controllers
);
3471 ndr_print_ptr(ndr
, "controller_names", r
->controller_names
);
3473 if (r
->controller_names
) {
3474 ndr
->print(ndr
, "%s: ARRAY(%d)", "controller_names", (int)r
->num_controllers
);
3476 for (cntr_controller_names_1
=0;cntr_controller_names_1
<r
->num_controllers
;cntr_controller_names_1
++) {
3478 if (asprintf(&idx_1
, "[%d]", cntr_controller_names_1
) != -1) {
3479 ndr_print_lsa_String(ndr
, "controller_names", &r
->controller_names
[cntr_controller_names_1
]);
3486 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3487 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3488 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3489 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3490 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3491 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3492 ndr_print_uint32(ndr
, "posix_offset", r
->posix_offset
);
3493 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3494 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3495 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3499 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
)
3501 if (ndr_flags
& NDR_SCALARS
) {
3502 NDR_CHECK(ndr_push_align(ndr
, 2));
3503 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3505 if (ndr_flags
& NDR_BUFFERS
) {
3507 return NDR_ERR_SUCCESS
;
3510 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_TRUST
*r
)
3512 if (ndr_flags
& NDR_SCALARS
) {
3513 NDR_CHECK(ndr_pull_align(ndr
, 2));
3514 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3516 if (ndr_flags
& NDR_BUFFERS
) {
3518 return NDR_ERR_SUCCESS
;
3521 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_TRUST
*r
)
3523 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_TRUST");
3525 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3529 static enum ndr_err_code
ndr_push_netr_DELTA_ACCOUNT(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ACCOUNT
*r
)
3531 uint32_t cntr_privilege_attrib_1
;
3532 uint32_t cntr_privilege_name_1
;
3533 if (ndr_flags
& NDR_SCALARS
) {
3534 NDR_CHECK(ndr_push_align(ndr
, 4));
3535 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3536 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_control
));
3537 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->privilege_attrib
));
3538 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->privilege_name
));
3539 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quotalimits
));
3540 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->system_flags
));
3541 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3542 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3543 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3544 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3545 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3546 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3547 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3548 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3549 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3550 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3552 if (ndr_flags
& NDR_BUFFERS
) {
3553 if (r
->privilege_attrib
) {
3554 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3555 for (cntr_privilege_attrib_1
= 0; cntr_privilege_attrib_1
< r
->privilege_entries
; cntr_privilege_attrib_1
++) {
3556 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_attrib
[cntr_privilege_attrib_1
]));
3559 if (r
->privilege_name
) {
3560 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->privilege_entries
));
3561 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3562 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3564 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3565 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3568 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3569 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3570 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3571 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3572 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3574 return NDR_ERR_SUCCESS
;
3577 static enum ndr_err_code
ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ACCOUNT
*r
)
3579 uint32_t _ptr_privilege_attrib
;
3580 uint32_t cntr_privilege_attrib_1
;
3581 TALLOC_CTX
*_mem_save_privilege_attrib_0
;
3582 TALLOC_CTX
*_mem_save_privilege_attrib_1
;
3583 uint32_t _ptr_privilege_name
;
3584 uint32_t cntr_privilege_name_1
;
3585 TALLOC_CTX
*_mem_save_privilege_name_0
;
3586 TALLOC_CTX
*_mem_save_privilege_name_1
;
3587 if (ndr_flags
& NDR_SCALARS
) {
3588 NDR_CHECK(ndr_pull_align(ndr
, 4));
3589 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_entries
));
3590 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_control
));
3591 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_privilege_attrib
));
3592 if (_ptr_privilege_attrib
) {
3593 NDR_PULL_ALLOC(ndr
, r
->privilege_attrib
);
3595 r
->privilege_attrib
= NULL
;
3597 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_privilege_name
));
3598 if (_ptr_privilege_name
) {
3599 NDR_PULL_ALLOC(ndr
, r
->privilege_name
);
3601 r
->privilege_name
= NULL
;
3603 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr
, NDR_SCALARS
, &r
->quotalimits
));
3604 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->system_flags
));
3605 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3606 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3607 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3608 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3609 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3610 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3611 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3612 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3613 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3614 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3616 if (ndr_flags
& NDR_BUFFERS
) {
3617 if (r
->privilege_attrib
) {
3618 _mem_save_privilege_attrib_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3619 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_attrib
, 0);
3620 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->privilege_attrib
));
3621 NDR_PULL_ALLOC_N(ndr
, r
->privilege_attrib
, ndr_get_array_size(ndr
, &r
->privilege_attrib
));
3622 _mem_save_privilege_attrib_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3623 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_attrib
, 0);
3624 for (cntr_privilege_attrib_1
= 0; cntr_privilege_attrib_1
< r
->privilege_entries
; cntr_privilege_attrib_1
++) {
3625 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->privilege_attrib
[cntr_privilege_attrib_1
]));
3627 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_attrib_1
, 0);
3628 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_attrib_0
, 0);
3630 if (r
->privilege_name
) {
3631 _mem_save_privilege_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3632 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_name
, 0);
3633 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->privilege_name
));
3634 NDR_PULL_ALLOC_N(ndr
, r
->privilege_name
, ndr_get_array_size(ndr
, &r
->privilege_name
));
3635 _mem_save_privilege_name_1
= NDR_PULL_GET_MEM_CTX(ndr
);
3636 NDR_PULL_SET_MEM_CTX(ndr
, r
->privilege_name
, 0);
3637 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3638 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3640 for (cntr_privilege_name_1
= 0; cntr_privilege_name_1
< r
->privilege_entries
; cntr_privilege_name_1
++) {
3641 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->privilege_name
[cntr_privilege_name_1
]));
3643 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_name_1
, 0);
3644 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_privilege_name_0
, 0);
3646 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3647 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3648 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3649 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3650 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3651 if (r
->privilege_attrib
) {
3652 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->privilege_attrib
, r
->privilege_entries
));
3654 if (r
->privilege_name
) {
3655 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->privilege_name
, r
->privilege_entries
));
3658 return NDR_ERR_SUCCESS
;
3661 _PUBLIC_
void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ACCOUNT
*r
)
3663 uint32_t cntr_privilege_attrib_1
;
3664 uint32_t cntr_privilege_name_1
;
3665 ndr_print_struct(ndr
, name
, "netr_DELTA_ACCOUNT");
3667 ndr_print_uint32(ndr
, "privilege_entries", r
->privilege_entries
);
3668 ndr_print_uint32(ndr
, "privilege_control", r
->privilege_control
);
3669 ndr_print_ptr(ndr
, "privilege_attrib", r
->privilege_attrib
);
3671 if (r
->privilege_attrib
) {
3672 ndr
->print(ndr
, "%s: ARRAY(%d)", "privilege_attrib", (int)r
->privilege_entries
);
3674 for (cntr_privilege_attrib_1
=0;cntr_privilege_attrib_1
<r
->privilege_entries
;cntr_privilege_attrib_1
++) {
3676 if (asprintf(&idx_1
, "[%d]", cntr_privilege_attrib_1
) != -1) {
3677 ndr_print_uint32(ndr
, "privilege_attrib", r
->privilege_attrib
[cntr_privilege_attrib_1
]);
3684 ndr_print_ptr(ndr
, "privilege_name", r
->privilege_name
);
3686 if (r
->privilege_name
) {
3687 ndr
->print(ndr
, "%s: ARRAY(%d)", "privilege_name", (int)r
->privilege_entries
);
3689 for (cntr_privilege_name_1
=0;cntr_privilege_name_1
<r
->privilege_entries
;cntr_privilege_name_1
++) {
3691 if (asprintf(&idx_1
, "[%d]", cntr_privilege_name_1
) != -1) {
3692 ndr_print_lsa_String(ndr
, "privilege_name", &r
->privilege_name
[cntr_privilege_name_1
]);
3699 ndr_print_netr_QUOTA_LIMITS(ndr
, "quotalimits", &r
->quotalimits
);
3700 ndr_print_uint32(ndr
, "system_flags", r
->system_flags
);
3701 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3702 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3703 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3704 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3705 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3706 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3707 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3708 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3709 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3710 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3714 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
)
3716 if (ndr_flags
& NDR_SCALARS
) {
3717 NDR_CHECK(ndr_push_align(ndr
, 2));
3718 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3720 if (ndr_flags
& NDR_BUFFERS
) {
3722 return NDR_ERR_SUCCESS
;
3725 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_ACCOUNT
*r
)
3727 if (ndr_flags
& NDR_SCALARS
) {
3728 NDR_CHECK(ndr_pull_align(ndr
, 2));
3729 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3731 if (ndr_flags
& NDR_BUFFERS
) {
3733 return NDR_ERR_SUCCESS
;
3736 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_ACCOUNT
*r
)
3738 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_ACCOUNT");
3740 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3744 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
)
3746 if (ndr_flags
& NDR_SCALARS
) {
3747 NDR_CHECK(ndr_push_align(ndr
, 2));
3748 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->unknown
));
3750 if (ndr_flags
& NDR_BUFFERS
) {
3752 return NDR_ERR_SUCCESS
;
3755 static enum ndr_err_code
ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_DELETE_SECRET
*r
)
3757 if (ndr_flags
& NDR_SCALARS
) {
3758 NDR_CHECK(ndr_pull_align(ndr
, 2));
3759 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->unknown
));
3761 if (ndr_flags
& NDR_BUFFERS
) {
3763 return NDR_ERR_SUCCESS
;
3766 _PUBLIC_
void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_DELETE_SECRET
*r
)
3768 ndr_print_struct(ndr
, name
, "netr_DELTA_DELETE_SECRET");
3770 ndr_print_uint16(ndr
, "unknown", r
->unknown
);
3774 static enum ndr_err_code
ndr_push_netr_CIPHER_VALUE(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_CIPHER_VALUE
*r
)
3776 if (ndr_flags
& NDR_SCALARS
) {
3777 NDR_CHECK(ndr_push_align(ndr
, 4));
3778 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->len
));
3779 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlen
));
3780 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->cipher_data
));
3782 if (ndr_flags
& NDR_BUFFERS
) {
3783 if (r
->cipher_data
) {
3784 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->maxlen
));
3785 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
3786 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->len
));
3787 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->cipher_data
, r
->len
));
3790 return NDR_ERR_SUCCESS
;
3793 static enum ndr_err_code
ndr_pull_netr_CIPHER_VALUE(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_CIPHER_VALUE
*r
)
3795 uint32_t _ptr_cipher_data
;
3796 TALLOC_CTX
*_mem_save_cipher_data_0
;
3797 if (ndr_flags
& NDR_SCALARS
) {
3798 NDR_CHECK(ndr_pull_align(ndr
, 4));
3799 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->len
));
3800 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->maxlen
));
3801 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_cipher_data
));
3802 if (_ptr_cipher_data
) {
3803 NDR_PULL_ALLOC(ndr
, r
->cipher_data
);
3805 r
->cipher_data
= NULL
;
3808 if (ndr_flags
& NDR_BUFFERS
) {
3809 if (r
->cipher_data
) {
3810 _mem_save_cipher_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
3811 NDR_PULL_SET_MEM_CTX(ndr
, r
->cipher_data
, 0);
3812 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->cipher_data
));
3813 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->cipher_data
));
3814 if (ndr_get_array_length(ndr
, &r
->cipher_data
) > ndr_get_array_size(ndr
, &r
->cipher_data
)) {
3815 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
));
3817 NDR_PULL_ALLOC_N(ndr
, r
->cipher_data
, ndr_get_array_size(ndr
, &r
->cipher_data
));
3818 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->cipher_data
, ndr_get_array_length(ndr
, &r
->cipher_data
)));
3819 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_cipher_data_0
, 0);
3821 if (r
->cipher_data
) {
3822 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->cipher_data
, r
->maxlen
));
3824 if (r
->cipher_data
) {
3825 NDR_CHECK(ndr_check_array_length(ndr
, (void*)&r
->cipher_data
, r
->len
));
3828 return NDR_ERR_SUCCESS
;
3831 _PUBLIC_
void ndr_print_netr_CIPHER_VALUE(struct ndr_print
*ndr
, const char *name
, const struct netr_CIPHER_VALUE
*r
)
3833 ndr_print_struct(ndr
, name
, "netr_CIPHER_VALUE");
3835 ndr_print_uint32(ndr
, "len", r
->len
);
3836 ndr_print_uint32(ndr
, "maxlen", r
->maxlen
);
3837 ndr_print_ptr(ndr
, "cipher_data", r
->cipher_data
);
3839 if (r
->cipher_data
) {
3840 ndr_print_array_uint8(ndr
, "cipher_data", r
->cipher_data
, r
->len
);
3846 static enum ndr_err_code
ndr_push_netr_DELTA_SECRET(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_SECRET
*r
)
3848 if (ndr_flags
& NDR_SCALARS
) {
3849 NDR_CHECK(ndr_push_align(ndr
, 4));
3850 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->current_cipher
));
3851 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->current_cipher_set_time
));
3852 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->old_cipher
));
3853 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->old_cipher_set_time
));
3854 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SecurityInformation
));
3855 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3856 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3857 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3858 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3859 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3860 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
3861 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown6
));
3862 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
));
3863 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown8
));
3865 if (ndr_flags
& NDR_BUFFERS
) {
3866 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->current_cipher
));
3867 NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->old_cipher
));
3868 NDR_CHECK(ndr_push_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3869 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3870 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3871 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3872 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3874 return NDR_ERR_SUCCESS
;
3877 static enum ndr_err_code
ndr_pull_netr_DELTA_SECRET(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_SECRET
*r
)
3879 if (ndr_flags
& NDR_SCALARS
) {
3880 NDR_CHECK(ndr_pull_align(ndr
, 4));
3881 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->current_cipher
));
3882 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->current_cipher_set_time
));
3883 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_SCALARS
, &r
->old_cipher
));
3884 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->old_cipher_set_time
));
3885 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SecurityInformation
));
3886 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_SCALARS
, &r
->sdbuf
));
3887 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown1
));
3888 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown2
));
3889 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown3
));
3890 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown4
));
3891 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
3892 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown6
));
3893 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
));
3894 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown8
));
3896 if (ndr_flags
& NDR_BUFFERS
) {
3897 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->current_cipher
));
3898 NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr
, NDR_BUFFERS
, &r
->old_cipher
));
3899 NDR_CHECK(ndr_pull_sec_desc_buf(ndr
, NDR_BUFFERS
, &r
->sdbuf
));
3900 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown1
));
3901 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown2
));
3902 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown3
));
3903 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown4
));
3905 return NDR_ERR_SUCCESS
;
3908 _PUBLIC_
void ndr_print_netr_DELTA_SECRET(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_SECRET
*r
)
3910 ndr_print_struct(ndr
, name
, "netr_DELTA_SECRET");
3912 ndr_print_netr_CIPHER_VALUE(ndr
, "current_cipher", &r
->current_cipher
);
3913 ndr_print_NTTIME(ndr
, "current_cipher_set_time", r
->current_cipher_set_time
);
3914 ndr_print_netr_CIPHER_VALUE(ndr
, "old_cipher", &r
->old_cipher
);
3915 ndr_print_NTTIME(ndr
, "old_cipher_set_time", r
->old_cipher_set_time
);
3916 ndr_print_uint32(ndr
, "SecurityInformation", r
->SecurityInformation
);
3917 ndr_print_sec_desc_buf(ndr
, "sdbuf", &r
->sdbuf
);
3918 ndr_print_lsa_String(ndr
, "unknown1", &r
->unknown1
);
3919 ndr_print_lsa_String(ndr
, "unknown2", &r
->unknown2
);
3920 ndr_print_lsa_String(ndr
, "unknown3", &r
->unknown3
);
3921 ndr_print_lsa_String(ndr
, "unknown4", &r
->unknown4
);
3922 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
3923 ndr_print_uint32(ndr
, "unknown6", r
->unknown6
);
3924 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
);
3925 ndr_print_uint32(ndr
, "unknown8", r
->unknown8
);
3929 static enum ndr_err_code
ndr_push_netr_DeltaEnum(struct ndr_push
*ndr
, int ndr_flags
, enum netr_DeltaEnum r
)
3931 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
));
3932 return NDR_ERR_SUCCESS
;
3935 static enum ndr_err_code
ndr_pull_netr_DeltaEnum(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_DeltaEnum
*r
)
3938 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &v
));
3940 return NDR_ERR_SUCCESS
;
3943 _PUBLIC_
void ndr_print_netr_DeltaEnum(struct ndr_print
*ndr
, const char *name
, enum netr_DeltaEnum r
)
3945 const char *val
= NULL
;
3948 case NETR_DELTA_DOMAIN
: val
= "NETR_DELTA_DOMAIN"; break;
3949 case NETR_DELTA_GROUP
: val
= "NETR_DELTA_GROUP"; break;
3950 case NETR_DELTA_DELETE_GROUP
: val
= "NETR_DELTA_DELETE_GROUP"; break;
3951 case NETR_DELTA_RENAME_GROUP
: val
= "NETR_DELTA_RENAME_GROUP"; break;
3952 case NETR_DELTA_USER
: val
= "NETR_DELTA_USER"; break;
3953 case NETR_DELTA_DELETE_USER
: val
= "NETR_DELTA_DELETE_USER"; break;
3954 case NETR_DELTA_RENAME_USER
: val
= "NETR_DELTA_RENAME_USER"; break;
3955 case NETR_DELTA_GROUP_MEMBER
: val
= "NETR_DELTA_GROUP_MEMBER"; break;
3956 case NETR_DELTA_ALIAS
: val
= "NETR_DELTA_ALIAS"; break;
3957 case NETR_DELTA_DELETE_ALIAS
: val
= "NETR_DELTA_DELETE_ALIAS"; break;
3958 case NETR_DELTA_RENAME_ALIAS
: val
= "NETR_DELTA_RENAME_ALIAS"; break;
3959 case NETR_DELTA_ALIAS_MEMBER
: val
= "NETR_DELTA_ALIAS_MEMBER"; break;
3960 case NETR_DELTA_POLICY
: val
= "NETR_DELTA_POLICY"; break;
3961 case NETR_DELTA_TRUSTED_DOMAIN
: val
= "NETR_DELTA_TRUSTED_DOMAIN"; break;
3962 case NETR_DELTA_DELETE_TRUST
: val
= "NETR_DELTA_DELETE_TRUST"; break;
3963 case NETR_DELTA_ACCOUNT
: val
= "NETR_DELTA_ACCOUNT"; break;
3964 case NETR_DELTA_DELETE_ACCOUNT
: val
= "NETR_DELTA_DELETE_ACCOUNT"; break;
3965 case NETR_DELTA_SECRET
: val
= "NETR_DELTA_SECRET"; break;
3966 case NETR_DELTA_DELETE_SECRET
: val
= "NETR_DELTA_DELETE_SECRET"; break;
3967 case NETR_DELTA_DELETE_GROUP2
: val
= "NETR_DELTA_DELETE_GROUP2"; break;
3968 case NETR_DELTA_DELETE_USER2
: val
= "NETR_DELTA_DELETE_USER2"; break;
3969 case NETR_DELTA_MODIFY_COUNT
: val
= "NETR_DELTA_MODIFY_COUNT"; break;
3971 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
3974 static enum ndr_err_code
ndr_push_netr_DELTA_UNION(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DELTA_UNION
*r
)
3976 if (ndr_flags
& NDR_SCALARS
) {
3977 int level
= ndr_push_get_switch_value(ndr
, r
);
3978 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, level
));
3980 case NETR_DELTA_DOMAIN
: {
3981 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
3984 case NETR_DELTA_GROUP
: {
3985 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->group
));
3988 case NETR_DELTA_DELETE_GROUP
: {
3991 case NETR_DELTA_RENAME_GROUP
: {
3992 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_group
));
3995 case NETR_DELTA_USER
: {
3996 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->user
));
3999 case NETR_DELTA_DELETE_USER
: {
4002 case NETR_DELTA_RENAME_USER
: {
4003 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_user
));
4006 case NETR_DELTA_GROUP_MEMBER
: {
4007 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->group_member
));
4010 case NETR_DELTA_ALIAS
: {
4011 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->alias
));
4014 case NETR_DELTA_DELETE_ALIAS
: {
4017 case NETR_DELTA_RENAME_ALIAS
: {
4018 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->rename_alias
));
4021 case NETR_DELTA_ALIAS_MEMBER
: {
4022 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->alias_member
));
4025 case NETR_DELTA_POLICY
: {
4026 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->policy
));
4029 case NETR_DELTA_TRUSTED_DOMAIN
: {
4030 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusted_domain
));
4033 case NETR_DELTA_DELETE_TRUST
: {
4034 NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr
, NDR_SCALARS
, &r
->delete_trust
));
4037 case NETR_DELTA_ACCOUNT
: {
4038 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->account
));
4041 case NETR_DELTA_DELETE_ACCOUNT
: {
4042 NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr
, NDR_SCALARS
, &r
->delete_account
));
4045 case NETR_DELTA_SECRET
: {
4046 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->secret
));
4049 case NETR_DELTA_DELETE_SECRET
: {
4050 NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr
, NDR_SCALARS
, &r
->delete_secret
));
4053 case NETR_DELTA_DELETE_GROUP2
: {
4054 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delete_group
));
4057 case NETR_DELTA_DELETE_USER2
: {
4058 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delete_user
));
4061 case NETR_DELTA_MODIFY_COUNT
: {
4062 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->modified_count
));
4066 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4069 if (ndr_flags
& NDR_BUFFERS
) {
4070 int level
= ndr_push_get_switch_value(ndr
, r
);
4072 case NETR_DELTA_DOMAIN
:
4074 NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain
));
4078 case NETR_DELTA_GROUP
:
4080 NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group
));
4084 case NETR_DELTA_DELETE_GROUP
:
4087 case NETR_DELTA_RENAME_GROUP
:
4088 if (r
->rename_group
) {
4089 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_group
));
4093 case NETR_DELTA_USER
:
4095 NDR_CHECK(ndr_push_netr_DELTA_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->user
));
4099 case NETR_DELTA_DELETE_USER
:
4102 case NETR_DELTA_RENAME_USER
:
4103 if (r
->rename_user
) {
4104 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_user
));
4108 case NETR_DELTA_GROUP_MEMBER
:
4109 if (r
->group_member
) {
4110 NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group_member
));
4114 case NETR_DELTA_ALIAS
:
4116 NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias
));
4120 case NETR_DELTA_DELETE_ALIAS
:
4123 case NETR_DELTA_RENAME_ALIAS
:
4124 if (r
->rename_alias
) {
4125 NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_alias
));
4129 case NETR_DELTA_ALIAS_MEMBER
:
4130 if (r
->alias_member
) {
4131 NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias_member
));
4135 case NETR_DELTA_POLICY
:
4137 NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->policy
));
4141 case NETR_DELTA_TRUSTED_DOMAIN
:
4142 if (r
->trusted_domain
) {
4143 NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->trusted_domain
));
4147 case NETR_DELTA_DELETE_TRUST
:
4150 case NETR_DELTA_ACCOUNT
:
4152 NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->account
));
4156 case NETR_DELTA_DELETE_ACCOUNT
:
4159 case NETR_DELTA_SECRET
:
4161 NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->secret
));
4165 case NETR_DELTA_DELETE_SECRET
:
4168 case NETR_DELTA_DELETE_GROUP2
:
4169 if (r
->delete_group
) {
4170 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_group
));
4174 case NETR_DELTA_DELETE_USER2
:
4175 if (r
->delete_user
) {
4176 NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_user
));
4180 case NETR_DELTA_MODIFY_COUNT
:
4181 if (r
->modified_count
) {
4182 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->modified_count
));
4187 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4190 return NDR_ERR_SUCCESS
;
4193 static enum ndr_err_code
ndr_pull_netr_DELTA_UNION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DELTA_UNION
*r
)
4197 TALLOC_CTX
*_mem_save_domain_0
;
4198 TALLOC_CTX
*_mem_save_group_0
;
4199 TALLOC_CTX
*_mem_save_rename_group_0
;
4200 TALLOC_CTX
*_mem_save_user_0
;
4201 TALLOC_CTX
*_mem_save_rename_user_0
;
4202 TALLOC_CTX
*_mem_save_group_member_0
;
4203 TALLOC_CTX
*_mem_save_alias_0
;
4204 TALLOC_CTX
*_mem_save_rename_alias_0
;
4205 TALLOC_CTX
*_mem_save_alias_member_0
;
4206 TALLOC_CTX
*_mem_save_policy_0
;
4207 TALLOC_CTX
*_mem_save_trusted_domain_0
;
4208 TALLOC_CTX
*_mem_save_account_0
;
4209 TALLOC_CTX
*_mem_save_secret_0
;
4210 TALLOC_CTX
*_mem_save_delete_group_0
;
4211 TALLOC_CTX
*_mem_save_delete_user_0
;
4212 TALLOC_CTX
*_mem_save_modified_count_0
;
4213 level
= ndr_pull_get_switch_value(ndr
, r
);
4214 if (ndr_flags
& NDR_SCALARS
) {
4215 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
4216 if (_level
!= level
) {
4217 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
4220 case NETR_DELTA_DOMAIN
: {
4221 uint32_t _ptr_domain
;
4222 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
4224 NDR_PULL_ALLOC(ndr
, r
->domain
);
4230 case NETR_DELTA_GROUP
: {
4231 uint32_t _ptr_group
;
4232 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group
));
4234 NDR_PULL_ALLOC(ndr
, r
->group
);
4240 case NETR_DELTA_DELETE_GROUP
: {
4243 case NETR_DELTA_RENAME_GROUP
: {
4244 uint32_t _ptr_rename_group
;
4245 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_group
));
4246 if (_ptr_rename_group
) {
4247 NDR_PULL_ALLOC(ndr
, r
->rename_group
);
4249 r
->rename_group
= NULL
;
4253 case NETR_DELTA_USER
: {
4255 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_user
));
4257 NDR_PULL_ALLOC(ndr
, r
->user
);
4263 case NETR_DELTA_DELETE_USER
: {
4266 case NETR_DELTA_RENAME_USER
: {
4267 uint32_t _ptr_rename_user
;
4268 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_user
));
4269 if (_ptr_rename_user
) {
4270 NDR_PULL_ALLOC(ndr
, r
->rename_user
);
4272 r
->rename_user
= NULL
;
4276 case NETR_DELTA_GROUP_MEMBER
: {
4277 uint32_t _ptr_group_member
;
4278 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group_member
));
4279 if (_ptr_group_member
) {
4280 NDR_PULL_ALLOC(ndr
, r
->group_member
);
4282 r
->group_member
= NULL
;
4286 case NETR_DELTA_ALIAS
: {
4287 uint32_t _ptr_alias
;
4288 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_alias
));
4290 NDR_PULL_ALLOC(ndr
, r
->alias
);
4296 case NETR_DELTA_DELETE_ALIAS
: {
4299 case NETR_DELTA_RENAME_ALIAS
: {
4300 uint32_t _ptr_rename_alias
;
4301 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_rename_alias
));
4302 if (_ptr_rename_alias
) {
4303 NDR_PULL_ALLOC(ndr
, r
->rename_alias
);
4305 r
->rename_alias
= NULL
;
4309 case NETR_DELTA_ALIAS_MEMBER
: {
4310 uint32_t _ptr_alias_member
;
4311 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_alias_member
));
4312 if (_ptr_alias_member
) {
4313 NDR_PULL_ALLOC(ndr
, r
->alias_member
);
4315 r
->alias_member
= NULL
;
4319 case NETR_DELTA_POLICY
: {
4320 uint32_t _ptr_policy
;
4321 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_policy
));
4323 NDR_PULL_ALLOC(ndr
, r
->policy
);
4329 case NETR_DELTA_TRUSTED_DOMAIN
: {
4330 uint32_t _ptr_trusted_domain
;
4331 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_domain
));
4332 if (_ptr_trusted_domain
) {
4333 NDR_PULL_ALLOC(ndr
, r
->trusted_domain
);
4335 r
->trusted_domain
= NULL
;
4339 case NETR_DELTA_DELETE_TRUST
: {
4340 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr
, NDR_SCALARS
, &r
->delete_trust
));
4343 case NETR_DELTA_ACCOUNT
: {
4344 uint32_t _ptr_account
;
4345 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_account
));
4347 NDR_PULL_ALLOC(ndr
, r
->account
);
4353 case NETR_DELTA_DELETE_ACCOUNT
: {
4354 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr
, NDR_SCALARS
, &r
->delete_account
));
4357 case NETR_DELTA_SECRET
: {
4358 uint32_t _ptr_secret
;
4359 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_secret
));
4361 NDR_PULL_ALLOC(ndr
, r
->secret
);
4367 case NETR_DELTA_DELETE_SECRET
: {
4368 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr
, NDR_SCALARS
, &r
->delete_secret
));
4371 case NETR_DELTA_DELETE_GROUP2
: {
4372 uint32_t _ptr_delete_group
;
4373 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delete_group
));
4374 if (_ptr_delete_group
) {
4375 NDR_PULL_ALLOC(ndr
, r
->delete_group
);
4377 r
->delete_group
= NULL
;
4381 case NETR_DELTA_DELETE_USER2
: {
4382 uint32_t _ptr_delete_user
;
4383 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delete_user
));
4384 if (_ptr_delete_user
) {
4385 NDR_PULL_ALLOC(ndr
, r
->delete_user
);
4387 r
->delete_user
= NULL
;
4391 case NETR_DELTA_MODIFY_COUNT
: {
4392 uint32_t _ptr_modified_count
;
4393 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_modified_count
));
4394 if (_ptr_modified_count
) {
4395 NDR_PULL_ALLOC(ndr
, r
->modified_count
);
4397 r
->modified_count
= NULL
;
4402 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4405 if (ndr_flags
& NDR_BUFFERS
) {
4407 case NETR_DELTA_DOMAIN
:
4409 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4410 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
4411 NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->domain
));
4412 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
4416 case NETR_DELTA_GROUP
:
4418 _mem_save_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4419 NDR_PULL_SET_MEM_CTX(ndr
, r
->group
, 0);
4420 NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group
));
4421 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_0
, 0);
4425 case NETR_DELTA_DELETE_GROUP
:
4428 case NETR_DELTA_RENAME_GROUP
:
4429 if (r
->rename_group
) {
4430 _mem_save_rename_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4431 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_group
, 0);
4432 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_group
));
4433 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_group_0
, 0);
4437 case NETR_DELTA_USER
:
4439 _mem_save_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4440 NDR_PULL_SET_MEM_CTX(ndr
, r
->user
, 0);
4441 NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->user
));
4442 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_user_0
, 0);
4446 case NETR_DELTA_DELETE_USER
:
4449 case NETR_DELTA_RENAME_USER
:
4450 if (r
->rename_user
) {
4451 _mem_save_rename_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4452 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_user
, 0);
4453 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_user
));
4454 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_user_0
, 0);
4458 case NETR_DELTA_GROUP_MEMBER
:
4459 if (r
->group_member
) {
4460 _mem_save_group_member_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4461 NDR_PULL_SET_MEM_CTX(ndr
, r
->group_member
, 0);
4462 NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->group_member
));
4463 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_member_0
, 0);
4467 case NETR_DELTA_ALIAS
:
4469 _mem_save_alias_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4470 NDR_PULL_SET_MEM_CTX(ndr
, r
->alias
, 0);
4471 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias
));
4472 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_alias_0
, 0);
4476 case NETR_DELTA_DELETE_ALIAS
:
4479 case NETR_DELTA_RENAME_ALIAS
:
4480 if (r
->rename_alias
) {
4481 _mem_save_rename_alias_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4482 NDR_PULL_SET_MEM_CTX(ndr
, r
->rename_alias
, 0);
4483 NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->rename_alias
));
4484 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rename_alias_0
, 0);
4488 case NETR_DELTA_ALIAS_MEMBER
:
4489 if (r
->alias_member
) {
4490 _mem_save_alias_member_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4491 NDR_PULL_SET_MEM_CTX(ndr
, r
->alias_member
, 0);
4492 NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->alias_member
));
4493 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_alias_member_0
, 0);
4497 case NETR_DELTA_POLICY
:
4499 _mem_save_policy_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4500 NDR_PULL_SET_MEM_CTX(ndr
, r
->policy
, 0);
4501 NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->policy
));
4502 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_policy_0
, 0);
4506 case NETR_DELTA_TRUSTED_DOMAIN
:
4507 if (r
->trusted_domain
) {
4508 _mem_save_trusted_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4509 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusted_domain
, 0);
4510 NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->trusted_domain
));
4511 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domain_0
, 0);
4515 case NETR_DELTA_DELETE_TRUST
:
4518 case NETR_DELTA_ACCOUNT
:
4520 _mem_save_account_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4521 NDR_PULL_SET_MEM_CTX(ndr
, r
->account
, 0);
4522 NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->account
));
4523 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_account_0
, 0);
4527 case NETR_DELTA_DELETE_ACCOUNT
:
4530 case NETR_DELTA_SECRET
:
4532 _mem_save_secret_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4533 NDR_PULL_SET_MEM_CTX(ndr
, r
->secret
, 0);
4534 NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->secret
));
4535 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_secret_0
, 0);
4539 case NETR_DELTA_DELETE_SECRET
:
4542 case NETR_DELTA_DELETE_GROUP2
:
4543 if (r
->delete_group
) {
4544 _mem_save_delete_group_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4545 NDR_PULL_SET_MEM_CTX(ndr
, r
->delete_group
, 0);
4546 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_group
));
4547 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delete_group_0
, 0);
4551 case NETR_DELTA_DELETE_USER2
:
4552 if (r
->delete_user
) {
4553 _mem_save_delete_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4554 NDR_PULL_SET_MEM_CTX(ndr
, r
->delete_user
, 0);
4555 NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->delete_user
));
4556 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delete_user_0
, 0);
4560 case NETR_DELTA_MODIFY_COUNT
:
4561 if (r
->modified_count
) {
4562 _mem_save_modified_count_0
= NDR_PULL_GET_MEM_CTX(ndr
);
4563 NDR_PULL_SET_MEM_CTX(ndr
, r
->modified_count
, 0);
4564 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->modified_count
));
4565 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_modified_count_0
, 0);
4570 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4573 return NDR_ERR_SUCCESS
;
4576 _PUBLIC_
void ndr_print_netr_DELTA_UNION(struct ndr_print
*ndr
, const char *name
, const union netr_DELTA_UNION
*r
)
4579 level
= ndr_print_get_switch_value(ndr
, r
);
4580 ndr_print_union(ndr
, name
, level
, "netr_DELTA_UNION");
4582 case NETR_DELTA_DOMAIN
:
4583 ndr_print_ptr(ndr
, "domain", r
->domain
);
4586 ndr_print_netr_DELTA_DOMAIN(ndr
, "domain", r
->domain
);
4591 case NETR_DELTA_GROUP
:
4592 ndr_print_ptr(ndr
, "group", r
->group
);
4595 ndr_print_netr_DELTA_GROUP(ndr
, "group", r
->group
);
4600 case NETR_DELTA_DELETE_GROUP
:
4603 case NETR_DELTA_RENAME_GROUP
:
4604 ndr_print_ptr(ndr
, "rename_group", r
->rename_group
);
4606 if (r
->rename_group
) {
4607 ndr_print_netr_DELTA_RENAME(ndr
, "rename_group", r
->rename_group
);
4612 case NETR_DELTA_USER
:
4613 ndr_print_ptr(ndr
, "user", r
->user
);
4616 ndr_print_netr_DELTA_USER(ndr
, "user", r
->user
);
4621 case NETR_DELTA_DELETE_USER
:
4624 case NETR_DELTA_RENAME_USER
:
4625 ndr_print_ptr(ndr
, "rename_user", r
->rename_user
);
4627 if (r
->rename_user
) {
4628 ndr_print_netr_DELTA_RENAME(ndr
, "rename_user", r
->rename_user
);
4633 case NETR_DELTA_GROUP_MEMBER
:
4634 ndr_print_ptr(ndr
, "group_member", r
->group_member
);
4636 if (r
->group_member
) {
4637 ndr_print_netr_DELTA_GROUP_MEMBER(ndr
, "group_member", r
->group_member
);
4642 case NETR_DELTA_ALIAS
:
4643 ndr_print_ptr(ndr
, "alias", r
->alias
);
4646 ndr_print_netr_DELTA_ALIAS(ndr
, "alias", r
->alias
);
4651 case NETR_DELTA_DELETE_ALIAS
:
4654 case NETR_DELTA_RENAME_ALIAS
:
4655 ndr_print_ptr(ndr
, "rename_alias", r
->rename_alias
);
4657 if (r
->rename_alias
) {
4658 ndr_print_netr_DELTA_RENAME(ndr
, "rename_alias", r
->rename_alias
);
4663 case NETR_DELTA_ALIAS_MEMBER
:
4664 ndr_print_ptr(ndr
, "alias_member", r
->alias_member
);
4666 if (r
->alias_member
) {
4667 ndr_print_netr_DELTA_ALIAS_MEMBER(ndr
, "alias_member", r
->alias_member
);
4672 case NETR_DELTA_POLICY
:
4673 ndr_print_ptr(ndr
, "policy", r
->policy
);
4676 ndr_print_netr_DELTA_POLICY(ndr
, "policy", r
->policy
);
4681 case NETR_DELTA_TRUSTED_DOMAIN
:
4682 ndr_print_ptr(ndr
, "trusted_domain", r
->trusted_domain
);
4684 if (r
->trusted_domain
) {
4685 ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr
, "trusted_domain", r
->trusted_domain
);
4690 case NETR_DELTA_DELETE_TRUST
:
4691 ndr_print_netr_DELTA_DELETE_TRUST(ndr
, "delete_trust", &r
->delete_trust
);
4694 case NETR_DELTA_ACCOUNT
:
4695 ndr_print_ptr(ndr
, "account", r
->account
);
4698 ndr_print_netr_DELTA_ACCOUNT(ndr
, "account", r
->account
);
4703 case NETR_DELTA_DELETE_ACCOUNT
:
4704 ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr
, "delete_account", &r
->delete_account
);
4707 case NETR_DELTA_SECRET
:
4708 ndr_print_ptr(ndr
, "secret", r
->secret
);
4711 ndr_print_netr_DELTA_SECRET(ndr
, "secret", r
->secret
);
4716 case NETR_DELTA_DELETE_SECRET
:
4717 ndr_print_netr_DELTA_DELETE_SECRET(ndr
, "delete_secret", &r
->delete_secret
);
4720 case NETR_DELTA_DELETE_GROUP2
:
4721 ndr_print_ptr(ndr
, "delete_group", r
->delete_group
);
4723 if (r
->delete_group
) {
4724 ndr_print_netr_DELTA_DELETE_USER(ndr
, "delete_group", r
->delete_group
);
4729 case NETR_DELTA_DELETE_USER2
:
4730 ndr_print_ptr(ndr
, "delete_user", r
->delete_user
);
4732 if (r
->delete_user
) {
4733 ndr_print_netr_DELTA_DELETE_USER(ndr
, "delete_user", r
->delete_user
);
4738 case NETR_DELTA_MODIFY_COUNT
:
4739 ndr_print_ptr(ndr
, "modified_count", r
->modified_count
);
4741 if (r
->modified_count
) {
4742 ndr_print_udlong(ndr
, "modified_count", *r
->modified_count
);
4748 ndr_print_bad_level(ndr
, name
, level
);
4752 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
)
4754 if (ndr_flags
& NDR_SCALARS
) {
4755 int level
= ndr_push_get_switch_value(ndr
, r
);
4756 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, level
));
4758 case NETR_DELTA_DOMAIN
: {
4759 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4762 case NETR_DELTA_GROUP
: {
4763 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4766 case NETR_DELTA_DELETE_GROUP
: {
4767 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4770 case NETR_DELTA_RENAME_GROUP
: {
4771 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4774 case NETR_DELTA_USER
: {
4775 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4778 case NETR_DELTA_DELETE_USER
: {
4779 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4782 case NETR_DELTA_RENAME_USER
: {
4783 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4786 case NETR_DELTA_GROUP_MEMBER
: {
4787 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4790 case NETR_DELTA_ALIAS
: {
4791 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4794 case NETR_DELTA_DELETE_ALIAS
: {
4795 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4798 case NETR_DELTA_RENAME_ALIAS
: {
4799 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4802 case NETR_DELTA_ALIAS_MEMBER
: {
4803 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4806 case NETR_DELTA_POLICY
: {
4807 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4810 case NETR_DELTA_TRUSTED_DOMAIN
: {
4811 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4814 case NETR_DELTA_DELETE_TRUST
: {
4815 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4818 case NETR_DELTA_ACCOUNT
: {
4819 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4822 case NETR_DELTA_DELETE_ACCOUNT
: {
4823 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
4826 case NETR_DELTA_SECRET
: {
4827 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->name
));
4830 case NETR_DELTA_DELETE_SECRET
: {
4831 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->name
));
4834 case NETR_DELTA_DELETE_GROUP2
: {
4835 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4838 case NETR_DELTA_DELETE_USER2
: {
4839 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->rid
));
4842 case NETR_DELTA_MODIFY_COUNT
: {
4846 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4849 if (ndr_flags
& NDR_BUFFERS
) {
4850 int level
= ndr_push_get_switch_value(ndr
, r
);
4852 case NETR_DELTA_DOMAIN
:
4855 case NETR_DELTA_GROUP
:
4858 case NETR_DELTA_DELETE_GROUP
:
4861 case NETR_DELTA_RENAME_GROUP
:
4864 case NETR_DELTA_USER
:
4867 case NETR_DELTA_DELETE_USER
:
4870 case NETR_DELTA_RENAME_USER
:
4873 case NETR_DELTA_GROUP_MEMBER
:
4876 case NETR_DELTA_ALIAS
:
4879 case NETR_DELTA_DELETE_ALIAS
:
4882 case NETR_DELTA_RENAME_ALIAS
:
4885 case NETR_DELTA_ALIAS_MEMBER
:
4888 case NETR_DELTA_POLICY
:
4890 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4894 case NETR_DELTA_TRUSTED_DOMAIN
:
4896 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4900 case NETR_DELTA_DELETE_TRUST
:
4902 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4906 case NETR_DELTA_ACCOUNT
:
4908 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4912 case NETR_DELTA_DELETE_ACCOUNT
:
4914 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
4918 case NETR_DELTA_SECRET
:
4920 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4921 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
4922 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4923 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->name
, ndr_charset_length(r
->name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
4927 case NETR_DELTA_DELETE_SECRET
:
4929 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4930 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
4931 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->name
, CH_UTF16
)));
4932 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->name
, ndr_charset_length(r
->name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
4936 case NETR_DELTA_DELETE_GROUP2
:
4939 case NETR_DELTA_DELETE_USER2
:
4942 case NETR_DELTA_MODIFY_COUNT
:
4946 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
4949 return NDR_ERR_SUCCESS
;
4952 static enum ndr_err_code
ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DELTA_ID_UNION
*r
)
4956 TALLOC_CTX
*_mem_save_sid_0
;
4957 TALLOC_CTX
*_mem_save_name_0
;
4958 level
= ndr_pull_get_switch_value(ndr
, r
);
4959 if (ndr_flags
& NDR_SCALARS
) {
4960 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
4961 if (_level
!= level
) {
4962 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
4965 case NETR_DELTA_DOMAIN
: {
4966 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4969 case NETR_DELTA_GROUP
: {
4970 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4973 case NETR_DELTA_DELETE_GROUP
: {
4974 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4977 case NETR_DELTA_RENAME_GROUP
: {
4978 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4981 case NETR_DELTA_USER
: {
4982 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4985 case NETR_DELTA_DELETE_USER
: {
4986 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4989 case NETR_DELTA_RENAME_USER
: {
4990 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4993 case NETR_DELTA_GROUP_MEMBER
: {
4994 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
4997 case NETR_DELTA_ALIAS
: {
4998 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5001 case NETR_DELTA_DELETE_ALIAS
: {
5002 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5005 case NETR_DELTA_RENAME_ALIAS
: {
5006 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5009 case NETR_DELTA_ALIAS_MEMBER
: {
5010 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5013 case NETR_DELTA_POLICY
: {
5015 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
5017 NDR_PULL_ALLOC(ndr
, r
->sid
);
5023 case NETR_DELTA_TRUSTED_DOMAIN
: {
5025 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
5027 NDR_PULL_ALLOC(ndr
, r
->sid
);
5033 case NETR_DELTA_DELETE_TRUST
: {
5035 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
5037 NDR_PULL_ALLOC(ndr
, r
->sid
);
5043 case NETR_DELTA_ACCOUNT
: {
5045 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
5047 NDR_PULL_ALLOC(ndr
, r
->sid
);
5053 case NETR_DELTA_DELETE_ACCOUNT
: {
5055 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
5057 NDR_PULL_ALLOC(ndr
, r
->sid
);
5063 case NETR_DELTA_SECRET
: {
5065 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_name
));
5067 NDR_PULL_ALLOC(ndr
, r
->name
);
5073 case NETR_DELTA_DELETE_SECRET
: {
5075 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_name
));
5077 NDR_PULL_ALLOC(ndr
, r
->name
);
5083 case NETR_DELTA_DELETE_GROUP2
: {
5084 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5087 case NETR_DELTA_DELETE_USER2
: {
5088 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->rid
));
5091 case NETR_DELTA_MODIFY_COUNT
: {
5095 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5098 if (ndr_flags
& NDR_BUFFERS
) {
5100 case NETR_DELTA_DOMAIN
:
5103 case NETR_DELTA_GROUP
:
5106 case NETR_DELTA_DELETE_GROUP
:
5109 case NETR_DELTA_RENAME_GROUP
:
5112 case NETR_DELTA_USER
:
5115 case NETR_DELTA_DELETE_USER
:
5118 case NETR_DELTA_RENAME_USER
:
5121 case NETR_DELTA_GROUP_MEMBER
:
5124 case NETR_DELTA_ALIAS
:
5127 case NETR_DELTA_DELETE_ALIAS
:
5130 case NETR_DELTA_RENAME_ALIAS
:
5133 case NETR_DELTA_ALIAS_MEMBER
:
5136 case NETR_DELTA_POLICY
:
5138 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5139 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
5140 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
5141 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
5145 case NETR_DELTA_TRUSTED_DOMAIN
:
5147 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5148 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
5149 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
5150 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
5154 case NETR_DELTA_DELETE_TRUST
:
5156 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5157 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
5158 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
5159 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
5163 case NETR_DELTA_ACCOUNT
:
5165 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5166 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
5167 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
5168 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
5172 case NETR_DELTA_DELETE_ACCOUNT
:
5174 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5175 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
5176 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
5177 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
5181 case NETR_DELTA_SECRET
:
5183 _mem_save_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5184 NDR_PULL_SET_MEM_CTX(ndr
, r
->name
, 0);
5185 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->name
));
5186 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->name
));
5187 if (ndr_get_array_length(ndr
, &r
->name
) > ndr_get_array_size(ndr
, &r
->name
)) {
5188 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
));
5190 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t)));
5191 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->name
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t), CH_UTF16
));
5192 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_name_0
, 0);
5196 case NETR_DELTA_DELETE_SECRET
:
5198 _mem_save_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5199 NDR_PULL_SET_MEM_CTX(ndr
, r
->name
, 0);
5200 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->name
));
5201 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->name
));
5202 if (ndr_get_array_length(ndr
, &r
->name
) > ndr_get_array_size(ndr
, &r
->name
)) {
5203 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
));
5205 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t)));
5206 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->name
, ndr_get_array_length(ndr
, &r
->name
), sizeof(uint16_t), CH_UTF16
));
5207 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_name_0
, 0);
5211 case NETR_DELTA_DELETE_GROUP2
:
5214 case NETR_DELTA_DELETE_USER2
:
5217 case NETR_DELTA_MODIFY_COUNT
:
5221 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5224 return NDR_ERR_SUCCESS
;
5227 _PUBLIC_
void ndr_print_netr_DELTA_ID_UNION(struct ndr_print
*ndr
, const char *name
, const union netr_DELTA_ID_UNION
*r
)
5230 level
= ndr_print_get_switch_value(ndr
, r
);
5231 ndr_print_union(ndr
, name
, level
, "netr_DELTA_ID_UNION");
5233 case NETR_DELTA_DOMAIN
:
5234 ndr_print_uint32(ndr
, "rid", r
->rid
);
5237 case NETR_DELTA_GROUP
:
5238 ndr_print_uint32(ndr
, "rid", r
->rid
);
5241 case NETR_DELTA_DELETE_GROUP
:
5242 ndr_print_uint32(ndr
, "rid", r
->rid
);
5245 case NETR_DELTA_RENAME_GROUP
:
5246 ndr_print_uint32(ndr
, "rid", r
->rid
);
5249 case NETR_DELTA_USER
:
5250 ndr_print_uint32(ndr
, "rid", r
->rid
);
5253 case NETR_DELTA_DELETE_USER
:
5254 ndr_print_uint32(ndr
, "rid", r
->rid
);
5257 case NETR_DELTA_RENAME_USER
:
5258 ndr_print_uint32(ndr
, "rid", r
->rid
);
5261 case NETR_DELTA_GROUP_MEMBER
:
5262 ndr_print_uint32(ndr
, "rid", r
->rid
);
5265 case NETR_DELTA_ALIAS
:
5266 ndr_print_uint32(ndr
, "rid", r
->rid
);
5269 case NETR_DELTA_DELETE_ALIAS
:
5270 ndr_print_uint32(ndr
, "rid", r
->rid
);
5273 case NETR_DELTA_RENAME_ALIAS
:
5274 ndr_print_uint32(ndr
, "rid", r
->rid
);
5277 case NETR_DELTA_ALIAS_MEMBER
:
5278 ndr_print_uint32(ndr
, "rid", r
->rid
);
5281 case NETR_DELTA_POLICY
:
5282 ndr_print_ptr(ndr
, "sid", r
->sid
);
5285 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5290 case NETR_DELTA_TRUSTED_DOMAIN
:
5291 ndr_print_ptr(ndr
, "sid", r
->sid
);
5294 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5299 case NETR_DELTA_DELETE_TRUST
:
5300 ndr_print_ptr(ndr
, "sid", r
->sid
);
5303 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5308 case NETR_DELTA_ACCOUNT
:
5309 ndr_print_ptr(ndr
, "sid", r
->sid
);
5312 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5317 case NETR_DELTA_DELETE_ACCOUNT
:
5318 ndr_print_ptr(ndr
, "sid", r
->sid
);
5321 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
5326 case NETR_DELTA_SECRET
:
5327 ndr_print_ptr(ndr
, "name", r
->name
);
5330 ndr_print_string(ndr
, "name", r
->name
);
5335 case NETR_DELTA_DELETE_SECRET
:
5336 ndr_print_ptr(ndr
, "name", r
->name
);
5339 ndr_print_string(ndr
, "name", r
->name
);
5344 case NETR_DELTA_DELETE_GROUP2
:
5345 ndr_print_uint32(ndr
, "rid", r
->rid
);
5348 case NETR_DELTA_DELETE_USER2
:
5349 ndr_print_uint32(ndr
, "rid", r
->rid
);
5352 case NETR_DELTA_MODIFY_COUNT
:
5356 ndr_print_bad_level(ndr
, name
, level
);
5360 static enum ndr_err_code
ndr_push_netr_DELTA_ENUM(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DELTA_ENUM
*r
)
5362 if (ndr_flags
& NDR_SCALARS
) {
5363 NDR_CHECK(ndr_push_align(ndr
, 4));
5364 NDR_CHECK(ndr_push_netr_DeltaEnum(ndr
, NDR_SCALARS
, r
->delta_type
));
5365 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
));
5366 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr
, NDR_SCALARS
, &r
->delta_id_union
));
5367 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
));
5368 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr
, NDR_SCALARS
, &r
->delta_union
));
5370 if (ndr_flags
& NDR_BUFFERS
) {
5371 NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr
, NDR_BUFFERS
, &r
->delta_id_union
));
5372 NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr
, NDR_BUFFERS
, &r
->delta_union
));
5374 return NDR_ERR_SUCCESS
;
5377 static enum ndr_err_code
ndr_pull_netr_DELTA_ENUM(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ENUM
*r
)
5379 if (ndr_flags
& NDR_SCALARS
) {
5380 NDR_CHECK(ndr_pull_align(ndr
, 4));
5381 NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr
, NDR_SCALARS
, &r
->delta_type
));
5382 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
));
5383 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr
, NDR_SCALARS
, &r
->delta_id_union
));
5384 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
));
5385 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr
, NDR_SCALARS
, &r
->delta_union
));
5387 if (ndr_flags
& NDR_BUFFERS
) {
5388 NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr
, NDR_BUFFERS
, &r
->delta_id_union
));
5389 NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr
, NDR_BUFFERS
, &r
->delta_union
));
5391 return NDR_ERR_SUCCESS
;
5394 _PUBLIC_
void ndr_print_netr_DELTA_ENUM(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ENUM
*r
)
5396 ndr_print_struct(ndr
, name
, "netr_DELTA_ENUM");
5398 ndr_print_netr_DeltaEnum(ndr
, "delta_type", r
->delta_type
);
5399 ndr_print_set_switch_value(ndr
, &r
->delta_id_union
, r
->delta_type
);
5400 ndr_print_netr_DELTA_ID_UNION(ndr
, "delta_id_union", &r
->delta_id_union
);
5401 ndr_print_set_switch_value(ndr
, &r
->delta_union
, r
->delta_type
);
5402 ndr_print_netr_DELTA_UNION(ndr
, "delta_union", &r
->delta_union
);
5406 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
)
5408 uint32_t cntr_delta_enum_1
;
5409 if (ndr_flags
& NDR_SCALARS
) {
5410 NDR_CHECK(ndr_push_align(ndr
, 4));
5411 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_deltas
));
5412 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->delta_enum
));
5414 if (ndr_flags
& NDR_BUFFERS
) {
5415 if (r
->delta_enum
) {
5416 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_deltas
));
5417 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5418 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr
, NDR_SCALARS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5420 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5421 NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr
, NDR_BUFFERS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5425 return NDR_ERR_SUCCESS
;
5428 static enum ndr_err_code
ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DELTA_ENUM_ARRAY
*r
)
5430 uint32_t _ptr_delta_enum
;
5431 uint32_t cntr_delta_enum_1
;
5432 TALLOC_CTX
*_mem_save_delta_enum_0
;
5433 TALLOC_CTX
*_mem_save_delta_enum_1
;
5434 if (ndr_flags
& NDR_SCALARS
) {
5435 NDR_CHECK(ndr_pull_align(ndr
, 4));
5436 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_deltas
));
5437 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum
));
5438 if (_ptr_delta_enum
) {
5439 NDR_PULL_ALLOC(ndr
, r
->delta_enum
);
5441 r
->delta_enum
= NULL
;
5444 if (ndr_flags
& NDR_BUFFERS
) {
5445 if (r
->delta_enum
) {
5446 _mem_save_delta_enum_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5447 NDR_PULL_SET_MEM_CTX(ndr
, r
->delta_enum
, 0);
5448 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->delta_enum
));
5449 NDR_PULL_ALLOC_N(ndr
, r
->delta_enum
, ndr_get_array_size(ndr
, &r
->delta_enum
));
5450 _mem_save_delta_enum_1
= NDR_PULL_GET_MEM_CTX(ndr
);
5451 NDR_PULL_SET_MEM_CTX(ndr
, r
->delta_enum
, 0);
5452 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5453 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr
, NDR_SCALARS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5455 for (cntr_delta_enum_1
= 0; cntr_delta_enum_1
< r
->num_deltas
; cntr_delta_enum_1
++) {
5456 NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr
, NDR_BUFFERS
, &r
->delta_enum
[cntr_delta_enum_1
]));
5458 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_1
, 0);
5459 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_0
, 0);
5461 if (r
->delta_enum
) {
5462 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->delta_enum
, r
->num_deltas
));
5465 return NDR_ERR_SUCCESS
;
5468 _PUBLIC_
void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print
*ndr
, const char *name
, const struct netr_DELTA_ENUM_ARRAY
*r
)
5470 uint32_t cntr_delta_enum_1
;
5471 ndr_print_struct(ndr
, name
, "netr_DELTA_ENUM_ARRAY");
5473 ndr_print_uint32(ndr
, "num_deltas", r
->num_deltas
);
5474 ndr_print_ptr(ndr
, "delta_enum", r
->delta_enum
);
5476 if (r
->delta_enum
) {
5477 ndr
->print(ndr
, "%s: ARRAY(%d)", "delta_enum", (int)r
->num_deltas
);
5479 for (cntr_delta_enum_1
=0;cntr_delta_enum_1
<r
->num_deltas
;cntr_delta_enum_1
++) {
5481 if (asprintf(&idx_1
, "[%d]", cntr_delta_enum_1
) != -1) {
5482 ndr_print_netr_DELTA_ENUM(ndr
, "delta_enum", &r
->delta_enum
[cntr_delta_enum_1
]);
5492 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
)
5495 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5496 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5497 if (ndr_flags
& NDR_SCALARS
) {
5498 NDR_CHECK(ndr_push_align(ndr
, 4));
5499 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->computer_name
, 16));
5500 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->timecreated
));
5501 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->serial_number
));
5503 if (ndr_flags
& NDR_BUFFERS
) {
5505 ndr
->flags
= _flags_save_STRUCT
;
5507 return NDR_ERR_SUCCESS
;
5510 static enum ndr_err_code
ndr_pull_netr_UAS_INFO_0(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_UAS_INFO_0
*r
)
5513 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5514 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5515 if (ndr_flags
& NDR_SCALARS
) {
5516 NDR_CHECK(ndr_pull_align(ndr
, 4));
5517 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->computer_name
, 16));
5518 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->timecreated
));
5519 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->serial_number
));
5521 if (ndr_flags
& NDR_BUFFERS
) {
5523 ndr
->flags
= _flags_save_STRUCT
;
5525 return NDR_ERR_SUCCESS
;
5528 _PUBLIC_
void ndr_print_netr_UAS_INFO_0(struct ndr_print
*ndr
, const char *name
, const struct netr_UAS_INFO_0
*r
)
5530 ndr_print_struct(ndr
, name
, "netr_UAS_INFO_0");
5532 uint32_t _flags_save_STRUCT
= ndr
->flags
;
5533 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
5535 ndr_print_array_uint8(ndr
, "computer_name", r
->computer_name
, 16);
5536 ndr_print_uint32(ndr
, "timecreated", r
->timecreated
);
5537 ndr_print_uint32(ndr
, "serial_number", r
->serial_number
);
5539 ndr
->flags
= _flags_save_STRUCT
;
5543 static enum ndr_err_code
ndr_push_netr_AccountBuffer(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_AccountBuffer
*r
)
5545 if (ndr_flags
& NDR_SCALARS
) {
5546 NDR_CHECK(ndr_push_align(ndr
, 4));
5548 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
5549 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
5550 NDR_CHECK(ndr_push_DATA_BLOB(ndr
, NDR_SCALARS
, r
->blob
));
5551 ndr
->flags
= _flags_save_DATA_BLOB
;
5554 if (ndr_flags
& NDR_BUFFERS
) {
5556 return NDR_ERR_SUCCESS
;
5559 static enum ndr_err_code
ndr_pull_netr_AccountBuffer(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_AccountBuffer
*r
)
5561 if (ndr_flags
& NDR_SCALARS
) {
5562 NDR_CHECK(ndr_pull_align(ndr
, 4));
5564 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
5565 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
5566 NDR_CHECK(ndr_pull_DATA_BLOB(ndr
, NDR_SCALARS
, &r
->blob
));
5567 ndr
->flags
= _flags_save_DATA_BLOB
;
5570 if (ndr_flags
& NDR_BUFFERS
) {
5572 return NDR_ERR_SUCCESS
;
5575 _PUBLIC_
void ndr_print_netr_AccountBuffer(struct ndr_print
*ndr
, const char *name
, const struct netr_AccountBuffer
*r
)
5577 ndr_print_struct(ndr
, name
, "netr_AccountBuffer");
5579 ndr_print_DATA_BLOB(ndr
, "blob", r
->blob
);
5583 static enum ndr_err_code
ndr_push_netr_InfoFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
5585 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
5586 return NDR_ERR_SUCCESS
;
5589 static enum ndr_err_code
ndr_pull_netr_InfoFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
5592 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
5594 return NDR_ERR_SUCCESS
;
5597 _PUBLIC_
void ndr_print_netr_InfoFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
5599 ndr_print_uint32(ndr
, name
, r
);
5601 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_CTRL_REPL_NEEDED", NETLOGON_CTRL_REPL_NEEDED
, r
);
5602 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_CTRL_REPL_IN_PROGRESS", NETLOGON_CTRL_REPL_IN_PROGRESS
, r
);
5603 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_CTRL_REPL_FULL_SYNC", NETLOGON_CTRL_REPL_FULL_SYNC
, r
);
5607 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
)
5609 if (ndr_flags
& NDR_SCALARS
) {
5610 NDR_CHECK(ndr_push_align(ndr
, 4));
5611 NDR_CHECK(ndr_push_netr_InfoFlags(ndr
, NDR_SCALARS
, r
->flags
));
5612 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pdc_connection_status
));
5614 if (ndr_flags
& NDR_BUFFERS
) {
5616 return NDR_ERR_SUCCESS
;
5619 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_1
*r
)
5621 if (ndr_flags
& NDR_SCALARS
) {
5622 NDR_CHECK(ndr_pull_align(ndr
, 4));
5623 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr
, NDR_SCALARS
, &r
->flags
));
5624 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pdc_connection_status
));
5626 if (ndr_flags
& NDR_BUFFERS
) {
5628 return NDR_ERR_SUCCESS
;
5631 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_1
*r
)
5633 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_1");
5635 ndr_print_netr_InfoFlags(ndr
, "flags", r
->flags
);
5636 ndr_print_uint32(ndr
, "pdc_connection_status", r
->pdc_connection_status
);
5640 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
)
5642 if (ndr_flags
& NDR_SCALARS
) {
5643 NDR_CHECK(ndr_push_align(ndr
, 4));
5644 NDR_CHECK(ndr_push_netr_InfoFlags(ndr
, NDR_SCALARS
, r
->flags
));
5645 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->pdc_connection_status
));
5646 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusted_dc_name
));
5647 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->tc_connection_status
));
5649 if (ndr_flags
& NDR_BUFFERS
) {
5650 if (r
->trusted_dc_name
) {
5651 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5652 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5653 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5654 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
));
5657 return NDR_ERR_SUCCESS
;
5660 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_2
*r
)
5662 uint32_t _ptr_trusted_dc_name
;
5663 TALLOC_CTX
*_mem_save_trusted_dc_name_0
;
5664 if (ndr_flags
& NDR_SCALARS
) {
5665 NDR_CHECK(ndr_pull_align(ndr
, 4));
5666 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr
, NDR_SCALARS
, &r
->flags
));
5667 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->pdc_connection_status
));
5668 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_dc_name
));
5669 if (_ptr_trusted_dc_name
) {
5670 NDR_PULL_ALLOC(ndr
, r
->trusted_dc_name
);
5672 r
->trusted_dc_name
= NULL
;
5674 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->tc_connection_status
));
5676 if (ndr_flags
& NDR_BUFFERS
) {
5677 if (r
->trusted_dc_name
) {
5678 _mem_save_trusted_dc_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5679 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusted_dc_name
, 0);
5680 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusted_dc_name
));
5681 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->trusted_dc_name
));
5682 if (ndr_get_array_length(ndr
, &r
->trusted_dc_name
) > ndr_get_array_size(ndr
, &r
->trusted_dc_name
)) {
5683 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
));
5685 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->trusted_dc_name
), sizeof(uint16_t)));
5686 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
));
5687 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_dc_name_0
, 0);
5690 return NDR_ERR_SUCCESS
;
5693 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_2
*r
)
5695 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_2");
5697 ndr_print_netr_InfoFlags(ndr
, "flags", r
->flags
);
5698 ndr_print_uint32(ndr
, "pdc_connection_status", r
->pdc_connection_status
);
5699 ndr_print_ptr(ndr
, "trusted_dc_name", r
->trusted_dc_name
);
5701 if (r
->trusted_dc_name
) {
5702 ndr_print_string(ndr
, "trusted_dc_name", r
->trusted_dc_name
);
5705 ndr_print_uint32(ndr
, "tc_connection_status", r
->tc_connection_status
);
5709 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
)
5711 if (ndr_flags
& NDR_SCALARS
) {
5712 NDR_CHECK(ndr_push_align(ndr
, 4));
5713 NDR_CHECK(ndr_push_netr_InfoFlags(ndr
, NDR_SCALARS
, r
->flags
));
5714 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->logon_attempts
));
5715 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown1
));
5716 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown2
));
5717 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown3
));
5718 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown4
));
5719 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown5
));
5721 if (ndr_flags
& NDR_BUFFERS
) {
5723 return NDR_ERR_SUCCESS
;
5726 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_3
*r
)
5728 if (ndr_flags
& NDR_SCALARS
) {
5729 NDR_CHECK(ndr_pull_align(ndr
, 4));
5730 NDR_CHECK(ndr_pull_netr_InfoFlags(ndr
, NDR_SCALARS
, &r
->flags
));
5731 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->logon_attempts
));
5732 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown1
));
5733 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown2
));
5734 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown3
));
5735 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown4
));
5736 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown5
));
5738 if (ndr_flags
& NDR_BUFFERS
) {
5740 return NDR_ERR_SUCCESS
;
5743 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_3
*r
)
5745 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_3");
5747 ndr_print_netr_InfoFlags(ndr
, "flags", r
->flags
);
5748 ndr_print_uint32(ndr
, "logon_attempts", r
->logon_attempts
);
5749 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
5750 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
5751 ndr_print_uint32(ndr
, "unknown3", r
->unknown3
);
5752 ndr_print_uint32(ndr
, "unknown4", r
->unknown4
);
5753 ndr_print_uint32(ndr
, "unknown5", r
->unknown5
);
5757 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
)
5759 if (ndr_flags
& NDR_SCALARS
) {
5760 NDR_CHECK(ndr_push_align(ndr
, 4));
5761 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusted_dc_name
));
5762 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusted_domain_name
));
5764 if (ndr_flags
& NDR_BUFFERS
) {
5765 if (r
->trusted_dc_name
) {
5766 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5767 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5768 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_dc_name
, CH_UTF16
)));
5769 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
));
5771 if (r
->trusted_domain_name
) {
5772 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_domain_name
, CH_UTF16
)));
5773 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
5774 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->trusted_domain_name
, CH_UTF16
)));
5775 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
));
5778 return NDR_ERR_SUCCESS
;
5781 static enum ndr_err_code
ndr_pull_netr_NETLOGON_INFO_4(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_NETLOGON_INFO_4
*r
)
5783 uint32_t _ptr_trusted_dc_name
;
5784 TALLOC_CTX
*_mem_save_trusted_dc_name_0
;
5785 uint32_t _ptr_trusted_domain_name
;
5786 TALLOC_CTX
*_mem_save_trusted_domain_name_0
;
5787 if (ndr_flags
& NDR_SCALARS
) {
5788 NDR_CHECK(ndr_pull_align(ndr
, 4));
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
);
5793 r
->trusted_dc_name
= NULL
;
5795 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_domain_name
));
5796 if (_ptr_trusted_domain_name
) {
5797 NDR_PULL_ALLOC(ndr
, r
->trusted_domain_name
);
5799 r
->trusted_domain_name
= NULL
;
5802 if (ndr_flags
& NDR_BUFFERS
) {
5803 if (r
->trusted_dc_name
) {
5804 _mem_save_trusted_dc_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5805 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusted_dc_name
, 0);
5806 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusted_dc_name
));
5807 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->trusted_dc_name
));
5808 if (ndr_get_array_length(ndr
, &r
->trusted_dc_name
) > ndr_get_array_size(ndr
, &r
->trusted_dc_name
)) {
5809 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
));
5811 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->trusted_dc_name
), sizeof(uint16_t)));
5812 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
));
5813 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_dc_name_0
, 0);
5815 if (r
->trusted_domain_name
) {
5816 _mem_save_trusted_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5817 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusted_domain_name
, 0);
5818 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusted_domain_name
));
5819 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->trusted_domain_name
));
5820 if (ndr_get_array_length(ndr
, &r
->trusted_domain_name
) > ndr_get_array_size(ndr
, &r
->trusted_domain_name
)) {
5821 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
));
5823 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->trusted_domain_name
), sizeof(uint16_t)));
5824 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
));
5825 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domain_name_0
, 0);
5828 return NDR_ERR_SUCCESS
;
5831 _PUBLIC_
void ndr_print_netr_NETLOGON_INFO_4(struct ndr_print
*ndr
, const char *name
, const struct netr_NETLOGON_INFO_4
*r
)
5833 ndr_print_struct(ndr
, name
, "netr_NETLOGON_INFO_4");
5835 ndr_print_ptr(ndr
, "trusted_dc_name", r
->trusted_dc_name
);
5837 if (r
->trusted_dc_name
) {
5838 ndr_print_string(ndr
, "trusted_dc_name", r
->trusted_dc_name
);
5841 ndr_print_ptr(ndr
, "trusted_domain_name", r
->trusted_domain_name
);
5843 if (r
->trusted_domain_name
) {
5844 ndr_print_string(ndr
, "trusted_domain_name", r
->trusted_domain_name
);
5850 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
)
5852 if (ndr_flags
& NDR_SCALARS
) {
5853 int level
= ndr_push_get_switch_value(ndr
, r
);
5854 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
5857 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info1
));
5861 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info2
));
5865 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info3
));
5869 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info4
));
5873 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5876 if (ndr_flags
& NDR_BUFFERS
) {
5877 int level
= ndr_push_get_switch_value(ndr
, r
);
5881 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr
, NDR_SCALARS
, r
->info1
));
5887 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info2
));
5893 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr
, NDR_SCALARS
, r
->info3
));
5899 NDR_CHECK(ndr_push_netr_NETLOGON_INFO_4(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info4
));
5904 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5907 return NDR_ERR_SUCCESS
;
5910 static enum ndr_err_code
ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_CONTROL_QUERY_INFORMATION
*r
)
5914 TALLOC_CTX
*_mem_save_info1_0
;
5915 TALLOC_CTX
*_mem_save_info2_0
;
5916 TALLOC_CTX
*_mem_save_info3_0
;
5917 TALLOC_CTX
*_mem_save_info4_0
;
5918 level
= ndr_pull_get_switch_value(ndr
, r
);
5919 if (ndr_flags
& NDR_SCALARS
) {
5920 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
5921 if (_level
!= level
) {
5922 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
5926 uint32_t _ptr_info1
;
5927 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info1
));
5929 NDR_PULL_ALLOC(ndr
, r
->info1
);
5936 uint32_t _ptr_info2
;
5937 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info2
));
5939 NDR_PULL_ALLOC(ndr
, r
->info2
);
5946 uint32_t _ptr_info3
;
5947 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info3
));
5949 NDR_PULL_ALLOC(ndr
, r
->info3
);
5956 uint32_t _ptr_info4
;
5957 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info4
));
5959 NDR_PULL_ALLOC(ndr
, r
->info4
);
5966 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
5969 if (ndr_flags
& NDR_BUFFERS
) {
5973 _mem_save_info1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5974 NDR_PULL_SET_MEM_CTX(ndr
, r
->info1
, 0);
5975 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr
, NDR_SCALARS
, r
->info1
));
5976 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info1_0
, 0);
5982 _mem_save_info2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5983 NDR_PULL_SET_MEM_CTX(ndr
, r
->info2
, 0);
5984 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info2
));
5985 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info2_0
, 0);
5991 _mem_save_info3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
5992 NDR_PULL_SET_MEM_CTX(ndr
, r
->info3
, 0);
5993 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr
, NDR_SCALARS
, r
->info3
));
5994 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info3_0
, 0);
6000 _mem_save_info4_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6001 NDR_PULL_SET_MEM_CTX(ndr
, r
->info4
, 0);
6002 NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_4(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info4
));
6003 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info4_0
, 0);
6008 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6011 return NDR_ERR_SUCCESS
;
6014 _PUBLIC_
void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print
*ndr
, const char *name
, const union netr_CONTROL_QUERY_INFORMATION
*r
)
6017 level
= ndr_print_get_switch_value(ndr
, r
);
6018 ndr_print_union(ndr
, name
, level
, "netr_CONTROL_QUERY_INFORMATION");
6021 ndr_print_ptr(ndr
, "info1", r
->info1
);
6024 ndr_print_netr_NETLOGON_INFO_1(ndr
, "info1", r
->info1
);
6030 ndr_print_ptr(ndr
, "info2", r
->info2
);
6033 ndr_print_netr_NETLOGON_INFO_2(ndr
, "info2", r
->info2
);
6039 ndr_print_ptr(ndr
, "info3", r
->info3
);
6042 ndr_print_netr_NETLOGON_INFO_3(ndr
, "info3", r
->info3
);
6048 ndr_print_ptr(ndr
, "info4", r
->info4
);
6051 ndr_print_netr_NETLOGON_INFO_4(ndr
, "info4", r
->info4
);
6057 ndr_print_bad_level(ndr
, name
, level
);
6061 static enum ndr_err_code
ndr_push_netr_LogonControlCode(struct ndr_push
*ndr
, int ndr_flags
, enum netr_LogonControlCode r
)
6063 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6064 return NDR_ERR_SUCCESS
;
6067 static enum ndr_err_code
ndr_pull_netr_LogonControlCode(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_LogonControlCode
*r
)
6070 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6072 return NDR_ERR_SUCCESS
;
6075 _PUBLIC_
void ndr_print_netr_LogonControlCode(struct ndr_print
*ndr
, const char *name
, enum netr_LogonControlCode r
)
6077 const char *val
= NULL
;
6080 case NETLOGON_CONTROL_QUERY
: val
= "NETLOGON_CONTROL_QUERY"; break;
6081 case NETLOGON_CONTROL_REPLICATE
: val
= "NETLOGON_CONTROL_REPLICATE"; break;
6082 case NETLOGON_CONTROL_SYNCHRONIZE
: val
= "NETLOGON_CONTROL_SYNCHRONIZE"; break;
6083 case NETLOGON_CONTROL_PDC_REPLICATE
: val
= "NETLOGON_CONTROL_PDC_REPLICATE"; break;
6084 case NETLOGON_CONTROL_REDISCOVER
: val
= "NETLOGON_CONTROL_REDISCOVER"; break;
6085 case NETLOGON_CONTROL_TC_QUERY
: val
= "NETLOGON_CONTROL_TC_QUERY"; break;
6086 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
: val
= "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break;
6087 case NETLOGON_CONTROL_FIND_USER
: val
= "NETLOGON_CONTROL_FIND_USER"; break;
6088 case NETLOGON_CONTROL_CHANGE_PASSWORD
: val
= "NETLOGON_CONTROL_CHANGE_PASSWORD"; break;
6089 case NETLOGON_CONTROL_TC_VERIFY
: val
= "NETLOGON_CONTROL_TC_VERIFY"; break;
6090 case NETLOGON_CONTROL_FORCE_DNS_REG
: val
= "NETLOGON_CONTROL_FORCE_DNS_REG"; break;
6091 case NETLOGON_CONTROL_QUERY_DNS_REG
: val
= "NETLOGON_CONTROL_QUERY_DNS_REG"; break;
6092 case NETLOGON_CONTROL_BACKUP_CHANGE_LOG
: val
= "NETLOGON_CONTROL_BACKUP_CHANGE_LOG"; break;
6093 case NETLOGON_CONTROL_TRUNCATE_LOG
: val
= "NETLOGON_CONTROL_TRUNCATE_LOG"; break;
6094 case NETLOGON_CONTROL_SET_DBFLAG
: val
= "NETLOGON_CONTROL_SET_DBFLAG"; break;
6095 case NETLOGON_CONTROL_BREAKPOINT
: val
= "NETLOGON_CONTROL_BREAKPOINT"; break;
6097 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
6100 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
)
6102 if (ndr_flags
& NDR_SCALARS
) {
6103 int level
= ndr_push_get_switch_value(ndr
, r
);
6104 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
6106 case NETLOGON_CONTROL_REDISCOVER
: {
6107 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
6110 case NETLOGON_CONTROL_TC_QUERY
: {
6111 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
6114 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
: {
6115 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
6118 case NETLOGON_CONTROL_CHANGE_PASSWORD
: {
6119 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
6122 case NETLOGON_CONTROL_TC_VERIFY
: {
6123 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain
));
6126 case NETLOGON_CONTROL_FIND_USER
: {
6127 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->user
));
6130 case NETLOGON_CONTROL_SET_DBFLAG
: {
6131 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->debug_level
));
6135 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6138 if (ndr_flags
& NDR_BUFFERS
) {
6139 int level
= ndr_push_get_switch_value(ndr
, r
);
6141 case NETLOGON_CONTROL_REDISCOVER
:
6143 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6144 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6145 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6146 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6150 case NETLOGON_CONTROL_TC_QUERY
:
6152 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6153 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6154 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6155 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6159 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
6161 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6162 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6163 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6164 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6168 case NETLOGON_CONTROL_CHANGE_PASSWORD
:
6170 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6171 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6172 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6173 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6177 case NETLOGON_CONTROL_TC_VERIFY
:
6179 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6180 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6181 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain
, CH_UTF16
)));
6182 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain
, ndr_charset_length(r
->domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6186 case NETLOGON_CONTROL_FIND_USER
:
6188 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->user
, CH_UTF16
)));
6189 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6190 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->user
, CH_UTF16
)));
6191 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->user
, ndr_charset_length(r
->user
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6195 case NETLOGON_CONTROL_SET_DBFLAG
:
6199 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6202 return NDR_ERR_SUCCESS
;
6205 static enum ndr_err_code
ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull
*ndr
, int ndr_flags
, union netr_CONTROL_DATA_INFORMATION
*r
)
6209 TALLOC_CTX
*_mem_save_domain_0
;
6210 TALLOC_CTX
*_mem_save_user_0
;
6211 level
= ndr_pull_get_switch_value(ndr
, r
);
6212 if (ndr_flags
& NDR_SCALARS
) {
6213 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
6214 if (_level
!= level
) {
6215 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
6218 case NETLOGON_CONTROL_REDISCOVER
: {
6219 uint32_t _ptr_domain
;
6220 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
6222 NDR_PULL_ALLOC(ndr
, r
->domain
);
6228 case NETLOGON_CONTROL_TC_QUERY
: {
6229 uint32_t _ptr_domain
;
6230 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
6232 NDR_PULL_ALLOC(ndr
, r
->domain
);
6238 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
: {
6239 uint32_t _ptr_domain
;
6240 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
6242 NDR_PULL_ALLOC(ndr
, r
->domain
);
6248 case NETLOGON_CONTROL_CHANGE_PASSWORD
: {
6249 uint32_t _ptr_domain
;
6250 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
6252 NDR_PULL_ALLOC(ndr
, r
->domain
);
6258 case NETLOGON_CONTROL_TC_VERIFY
: {
6259 uint32_t _ptr_domain
;
6260 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
6262 NDR_PULL_ALLOC(ndr
, r
->domain
);
6268 case NETLOGON_CONTROL_FIND_USER
: {
6270 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_user
));
6272 NDR_PULL_ALLOC(ndr
, r
->user
);
6278 case NETLOGON_CONTROL_SET_DBFLAG
: {
6279 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->debug_level
));
6283 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6286 if (ndr_flags
& NDR_BUFFERS
) {
6288 case NETLOGON_CONTROL_REDISCOVER
:
6290 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6291 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
6292 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
6293 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
6294 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
6295 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
));
6297 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
6298 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
6299 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
6303 case NETLOGON_CONTROL_TC_QUERY
:
6305 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6306 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
6307 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
6308 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
6309 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
6310 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
));
6312 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
6313 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
6314 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
6318 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
6320 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6321 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
6322 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
6323 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
6324 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
6325 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
));
6327 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
6328 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
6329 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
6333 case NETLOGON_CONTROL_CHANGE_PASSWORD
:
6335 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6336 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
6337 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
6338 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
6339 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
6340 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
));
6342 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
6343 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
6344 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
6348 case NETLOGON_CONTROL_TC_VERIFY
:
6350 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6351 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain
, 0);
6352 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain
));
6353 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain
));
6354 if (ndr_get_array_length(ndr
, &r
->domain
) > ndr_get_array_size(ndr
, &r
->domain
)) {
6355 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
));
6357 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t)));
6358 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain
, ndr_get_array_length(ndr
, &r
->domain
), sizeof(uint16_t), CH_UTF16
));
6359 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
6363 case NETLOGON_CONTROL_FIND_USER
:
6365 _mem_save_user_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6366 NDR_PULL_SET_MEM_CTX(ndr
, r
->user
, 0);
6367 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->user
));
6368 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->user
));
6369 if (ndr_get_array_length(ndr
, &r
->user
) > ndr_get_array_size(ndr
, &r
->user
)) {
6370 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
));
6372 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->user
), sizeof(uint16_t)));
6373 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->user
, ndr_get_array_length(ndr
, &r
->user
), sizeof(uint16_t), CH_UTF16
));
6374 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_user_0
, 0);
6378 case NETLOGON_CONTROL_SET_DBFLAG
:
6382 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
6385 return NDR_ERR_SUCCESS
;
6388 _PUBLIC_
void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print
*ndr
, const char *name
, const union netr_CONTROL_DATA_INFORMATION
*r
)
6391 level
= ndr_print_get_switch_value(ndr
, r
);
6392 ndr_print_union(ndr
, name
, level
, "netr_CONTROL_DATA_INFORMATION");
6394 case NETLOGON_CONTROL_REDISCOVER
:
6395 ndr_print_ptr(ndr
, "domain", r
->domain
);
6398 ndr_print_string(ndr
, "domain", r
->domain
);
6403 case NETLOGON_CONTROL_TC_QUERY
:
6404 ndr_print_ptr(ndr
, "domain", r
->domain
);
6407 ndr_print_string(ndr
, "domain", r
->domain
);
6412 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
6413 ndr_print_ptr(ndr
, "domain", r
->domain
);
6416 ndr_print_string(ndr
, "domain", r
->domain
);
6421 case NETLOGON_CONTROL_CHANGE_PASSWORD
:
6422 ndr_print_ptr(ndr
, "domain", r
->domain
);
6425 ndr_print_string(ndr
, "domain", r
->domain
);
6430 case NETLOGON_CONTROL_TC_VERIFY
:
6431 ndr_print_ptr(ndr
, "domain", r
->domain
);
6434 ndr_print_string(ndr
, "domain", r
->domain
);
6439 case NETLOGON_CONTROL_FIND_USER
:
6440 ndr_print_ptr(ndr
, "user", r
->user
);
6443 ndr_print_string(ndr
, "user", r
->user
);
6448 case NETLOGON_CONTROL_SET_DBFLAG
:
6449 ndr_print_uint32(ndr
, "debug_level", r
->debug_level
);
6453 ndr_print_bad_level(ndr
, name
, level
);
6457 static enum ndr_err_code
ndr_push_netr_NegotiateFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
6459 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6460 return NDR_ERR_SUCCESS
;
6463 static enum ndr_err_code
ndr_pull_netr_NegotiateFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
6466 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6468 return NDR_ERR_SUCCESS
;
6471 _PUBLIC_
void ndr_print_netr_NegotiateFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
6473 ndr_print_uint32(ndr
, name
, r
);
6475 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_ACCOUNT_LOCKOUT", NETLOGON_NEG_ACCOUNT_LOCKOUT
, r
);
6476 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_PERSISTENT_SAMREPL", NETLOGON_NEG_PERSISTENT_SAMREPL
, r
);
6477 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_ARCFOUR", NETLOGON_NEG_ARCFOUR
, r
);
6478 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_PROMOTION_COUNT", NETLOGON_NEG_PROMOTION_COUNT
, r
);
6479 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_CHANGELOG_BDC", NETLOGON_NEG_CHANGELOG_BDC
, r
);
6480 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_FULL_SYNC_REPL", NETLOGON_NEG_FULL_SYNC_REPL
, r
);
6481 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_MULTIPLE_SIDS", NETLOGON_NEG_MULTIPLE_SIDS
, r
);
6482 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_REDO", NETLOGON_NEG_REDO
, r
);
6483 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL
, r
);
6484 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", NETLOGON_NEG_SEND_PASSWORD_INFO_PDC
, r
);
6485 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_GENERIC_PASSTHROUGH", NETLOGON_NEG_GENERIC_PASSTHROUGH
, r
);
6486 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_CONCURRENT_RPC", NETLOGON_NEG_CONCURRENT_RPC
, r
);
6487 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL
, r
);
6488 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL
, r
);
6489 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_STRONG_KEYS", NETLOGON_NEG_STRONG_KEYS
, r
);
6490 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_TRANSITIVE_TRUSTS", NETLOGON_NEG_TRANSITIVE_TRUSTS
, r
);
6491 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", NETLOGON_NEG_DNS_DOMAIN_TRUSTS
, r
);
6492 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_SET2", NETLOGON_NEG_PASSWORD_SET2
, r
);
6493 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_GETDOMAININFO", NETLOGON_NEG_GETDOMAININFO
, r
);
6494 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_CROSS_FOREST_TRUSTS", NETLOGON_NEG_CROSS_FOREST_TRUSTS
, r
);
6495 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION
, r
);
6496 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_RODC_PASSTHROUGH", NETLOGON_NEG_RODC_PASSTHROUGH
, r
);
6497 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_SUPPORTS_AES_SHA2", NETLOGON_NEG_SUPPORTS_AES_SHA2
, r
);
6498 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", NETLOGON_NEG_AUTHENTICATED_RPC_LSASS
, r
);
6499 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC", NETLOGON_NEG_AUTHENTICATED_RPC
, r
);
6503 static enum ndr_err_code
ndr_push_netr_ChangeLogFlags(struct ndr_push
*ndr
, int ndr_flags
, uint16_t r
)
6505 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
));
6506 return NDR_ERR_SUCCESS
;
6509 static enum ndr_err_code
ndr_pull_netr_ChangeLogFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint16_t *r
)
6512 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &v
));
6514 return NDR_ERR_SUCCESS
;
6517 _PUBLIC_
void ndr_print_netr_ChangeLogFlags(struct ndr_print
*ndr
, const char *name
, uint16_t r
)
6519 ndr_print_uint16(ndr
, name
, r
);
6521 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED
, r
);
6522 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "NETR_CHANGELOG_CHANGED_PASSWORD", NETR_CHANGELOG_CHANGED_PASSWORD
, r
);
6523 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "NETR_CHANGELOG_SID_INCLUDED", NETR_CHANGELOG_SID_INCLUDED
, r
);
6524 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "NETR_CHANGELOG_NAME_INCLUDED", NETR_CHANGELOG_NAME_INCLUDED
, r
);
6525 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", NETR_CHANGELOG_FIRST_PROMOTION_OBJ
, r
);
6529 static enum ndr_err_code
ndr_push_netr_ChangeLogObject(struct ndr_push
*ndr
, int ndr_flags
, const union netr_ChangeLogObject
*r
)
6531 if (ndr_flags
& NDR_SCALARS
) {
6532 int level
= ndr_push_get_switch_value(ndr
, r
);
6534 case NETR_CHANGELOG_SID_INCLUDED
: {
6535 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, &r
->object_sid
));
6538 case NETR_CHANGELOG_NAME_INCLUDED
: {
6540 uint32_t _flags_save_string
= ndr
->flags
;
6541 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_NULLTERM
);
6542 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->object_name
));
6543 ndr
->flags
= _flags_save_string
;
6552 if (ndr_flags
& NDR_BUFFERS
) {
6553 int level
= ndr_push_get_switch_value(ndr
, r
);
6555 case NETR_CHANGELOG_SID_INCLUDED
:
6558 case NETR_CHANGELOG_NAME_INCLUDED
:
6566 return NDR_ERR_SUCCESS
;
6569 static enum ndr_err_code
ndr_pull_netr_ChangeLogObject(struct ndr_pull
*ndr
, int ndr_flags
, union netr_ChangeLogObject
*r
)
6572 level
= ndr_pull_get_switch_value(ndr
, r
);
6573 if (ndr_flags
& NDR_SCALARS
) {
6575 case NETR_CHANGELOG_SID_INCLUDED
: {
6576 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, &r
->object_sid
));
6579 case NETR_CHANGELOG_NAME_INCLUDED
: {
6581 uint32_t _flags_save_string
= ndr
->flags
;
6582 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_NULLTERM
);
6583 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->object_name
));
6584 ndr
->flags
= _flags_save_string
;
6593 if (ndr_flags
& NDR_BUFFERS
) {
6595 case NETR_CHANGELOG_SID_INCLUDED
:
6598 case NETR_CHANGELOG_NAME_INCLUDED
:
6606 return NDR_ERR_SUCCESS
;
6609 _PUBLIC_
void ndr_print_netr_ChangeLogObject(struct ndr_print
*ndr
, const char *name
, const union netr_ChangeLogObject
*r
)
6612 level
= ndr_print_get_switch_value(ndr
, r
);
6613 ndr_print_union(ndr
, name
, level
, "netr_ChangeLogObject");
6615 case NETR_CHANGELOG_SID_INCLUDED
:
6616 ndr_print_dom_sid(ndr
, "object_sid", &r
->object_sid
);
6619 case NETR_CHANGELOG_NAME_INCLUDED
:
6620 ndr_print_string(ndr
, "object_name", r
->object_name
);
6629 _PUBLIC_
enum ndr_err_code
ndr_push_netr_ChangeLogEntry(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_ChangeLogEntry
*r
)
6631 if (ndr_flags
& NDR_SCALARS
) {
6632 NDR_CHECK(ndr_push_align(ndr
, 4));
6633 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->serial_number1
));
6634 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->serial_number2
));
6635 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->object_rid
));
6636 NDR_CHECK(ndr_push_netr_ChangeLogFlags(ndr
, NDR_SCALARS
, r
->flags
));
6637 NDR_CHECK(ndr_push_netr_SamDatabaseID8Bit(ndr
, NDR_SCALARS
, r
->db_index
));
6638 NDR_CHECK(ndr_push_netr_DeltaEnum8Bit(ndr
, NDR_SCALARS
, r
->delta_type
));
6639 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->object
, r
->flags
& (NETR_CHANGELOG_SID_INCLUDED
| NETR_CHANGELOG_NAME_INCLUDED
)));
6640 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr
, NDR_SCALARS
, &r
->object
));
6642 if (ndr_flags
& NDR_BUFFERS
) {
6643 NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr
, NDR_BUFFERS
, &r
->object
));
6645 return NDR_ERR_SUCCESS
;
6648 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_ChangeLogEntry(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_ChangeLogEntry
*r
)
6650 if (ndr_flags
& NDR_SCALARS
) {
6651 NDR_CHECK(ndr_pull_align(ndr
, 4));
6652 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->serial_number1
));
6653 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->serial_number2
));
6654 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->object_rid
));
6655 NDR_CHECK(ndr_pull_netr_ChangeLogFlags(ndr
, NDR_SCALARS
, &r
->flags
));
6656 NDR_CHECK(ndr_pull_netr_SamDatabaseID8Bit(ndr
, NDR_SCALARS
, &r
->db_index
));
6657 NDR_CHECK(ndr_pull_netr_DeltaEnum8Bit(ndr
, NDR_SCALARS
, &r
->delta_type
));
6658 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->object
, r
->flags
& (NETR_CHANGELOG_SID_INCLUDED
| NETR_CHANGELOG_NAME_INCLUDED
)));
6659 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr
, NDR_SCALARS
, &r
->object
));
6661 if (ndr_flags
& NDR_BUFFERS
) {
6662 NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr
, NDR_BUFFERS
, &r
->object
));
6664 return NDR_ERR_SUCCESS
;
6667 _PUBLIC_
void ndr_print_netr_ChangeLogEntry(struct ndr_print
*ndr
, const char *name
, const struct netr_ChangeLogEntry
*r
)
6669 ndr_print_struct(ndr
, name
, "netr_ChangeLogEntry");
6671 ndr_print_uint32(ndr
, "serial_number1", r
->serial_number1
);
6672 ndr_print_uint32(ndr
, "serial_number2", r
->serial_number2
);
6673 ndr_print_uint32(ndr
, "object_rid", r
->object_rid
);
6674 ndr_print_netr_ChangeLogFlags(ndr
, "flags", r
->flags
);
6675 ndr_print_netr_SamDatabaseID8Bit(ndr
, "db_index", r
->db_index
);
6676 ndr_print_netr_DeltaEnum8Bit(ndr
, "delta_type", r
->delta_type
);
6677 ndr_print_set_switch_value(ndr
, &r
->object
, r
->flags
& (NETR_CHANGELOG_SID_INCLUDED
| NETR_CHANGELOG_NAME_INCLUDED
));
6678 ndr_print_netr_ChangeLogObject(ndr
, "object", &r
->object
);
6682 _PUBLIC_
size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry
*r
, struct smb_iconv_convenience
*ic
, int flags
)
6684 return ndr_size_struct(r
, flags
, (ndr_push_flags_fn_t
)ndr_push_netr_ChangeLogEntry
, ic
);
6687 static enum ndr_err_code
ndr_push_netr_Blob(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_Blob
*r
)
6689 if (ndr_flags
& NDR_SCALARS
) {
6690 NDR_CHECK(ndr_push_align(ndr
, 4));
6691 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
6692 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
6694 if (ndr_flags
& NDR_BUFFERS
) {
6696 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
6697 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, r
->length
));
6700 return NDR_ERR_SUCCESS
;
6703 static enum ndr_err_code
ndr_pull_netr_Blob(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_Blob
*r
)
6706 TALLOC_CTX
*_mem_save_data_0
;
6707 if (ndr_flags
& NDR_SCALARS
) {
6708 NDR_CHECK(ndr_pull_align(ndr
, 4));
6709 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
6710 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
6712 NDR_PULL_ALLOC(ndr
, r
->data
);
6717 if (ndr_flags
& NDR_BUFFERS
) {
6719 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6720 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
6721 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
6722 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
6723 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, ndr_get_array_size(ndr
, &r
->data
)));
6724 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
6727 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->length
));
6730 return NDR_ERR_SUCCESS
;
6733 _PUBLIC_
void ndr_print_netr_Blob(struct ndr_print
*ndr
, const char *name
, const struct netr_Blob
*r
)
6735 ndr_print_struct(ndr
, name
, "netr_Blob");
6737 ndr_print_uint32(ndr
, "length", r
->length
);
6738 ndr_print_ptr(ndr
, "data", r
->data
);
6741 ndr_print_array_uint8(ndr
, "data", r
->data
, r
->length
);
6747 static enum ndr_err_code
ndr_push_netr_DsRGetDCName_flags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
6749 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6750 return NDR_ERR_SUCCESS
;
6753 static enum ndr_err_code
ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
6756 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6758 return NDR_ERR_SUCCESS
;
6761 _PUBLIC_
void ndr_print_netr_DsRGetDCName_flags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
6763 ndr_print_uint32(ndr
, name
, r
);
6765 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY
, r
);
6766 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED
, r
);
6767 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED
, r
);
6768 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED
, r
);
6769 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED
, r
);
6770 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY
, r
);
6771 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED
, r
);
6772 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED
, r
);
6773 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED
, r
);
6774 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED
, r
);
6775 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED
, r
);
6776 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF
, r
);
6777 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED
, r
);
6778 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME
, r
);
6779 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME
, r
);
6780 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE
, r
);
6781 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED
, r
);
6782 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME
, r
);
6783 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME
, r
);
6787 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push
*ndr
, int ndr_flags
, enum netr_DsRGetDCNameInfo_AddressType r
)
6789 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6790 return NDR_ERR_SUCCESS
;
6793 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_DsRGetDCNameInfo_AddressType
*r
)
6796 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6798 return NDR_ERR_SUCCESS
;
6801 _PUBLIC_
void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print
*ndr
, const char *name
, enum netr_DsRGetDCNameInfo_AddressType r
)
6803 const char *val
= NULL
;
6806 case DS_ADDRESS_TYPE_INET
: val
= "DS_ADDRESS_TYPE_INET"; break;
6807 case DS_ADDRESS_TYPE_NETBIOS
: val
= "DS_ADDRESS_TYPE_NETBIOS"; break;
6809 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
6812 static enum ndr_err_code
ndr_push_netr_DsR_DcFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
6814 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
6815 return NDR_ERR_SUCCESS
;
6818 static enum ndr_err_code
ndr_pull_netr_DsR_DcFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
6821 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
6823 return NDR_ERR_SUCCESS
;
6826 _PUBLIC_
void ndr_print_netr_DsR_DcFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
6828 ndr_print_uint32(ndr
, name
, r
);
6830 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC
, r
);
6831 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC
, r
);
6832 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP
, r
);
6833 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS
, r
);
6834 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC
, r
);
6835 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV
, r
);
6836 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST
, r
);
6837 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE
, r
);
6838 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV
, r
);
6839 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC
, r
);
6840 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6
, r
);
6841 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6
, r
);
6842 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER
, r
);
6843 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN
, r
);
6844 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST
, r
);
6848 _PUBLIC_
enum ndr_err_code
ndr_push_netr_DsRGetDCNameInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRGetDCNameInfo
*r
)
6850 if (ndr_flags
& NDR_SCALARS
) {
6851 NDR_CHECK(ndr_push_align(ndr
, 4));
6852 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_unc
));
6853 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_address
));
6854 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr
, NDR_SCALARS
, r
->dc_address_type
));
6855 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->domain_guid
));
6856 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->domain_name
));
6857 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->forest_name
));
6858 NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr
, NDR_SCALARS
, r
->dc_flags
));
6859 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dc_site_name
));
6860 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->client_site_name
));
6862 if (ndr_flags
& NDR_BUFFERS
) {
6864 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_unc
, CH_UTF16
)));
6865 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6866 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_unc
, CH_UTF16
)));
6867 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dc_unc
, ndr_charset_length(r
->dc_unc
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6869 if (r
->dc_address
) {
6870 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_address
, CH_UTF16
)));
6871 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6872 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_address
, CH_UTF16
)));
6873 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dc_address
, ndr_charset_length(r
->dc_address
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6875 if (r
->domain_name
) {
6876 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain_name
, CH_UTF16
)));
6877 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6878 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->domain_name
, CH_UTF16
)));
6879 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->domain_name
, ndr_charset_length(r
->domain_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6881 if (r
->forest_name
) {
6882 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->forest_name
, CH_UTF16
)));
6883 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6884 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->forest_name
, CH_UTF16
)));
6885 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->forest_name
, ndr_charset_length(r
->forest_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
6887 if (r
->dc_site_name
) {
6888 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_site_name
, CH_UTF16
)));
6889 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6890 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dc_site_name
, CH_UTF16
)));
6891 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
));
6893 if (r
->client_site_name
) {
6894 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->client_site_name
, CH_UTF16
)));
6895 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
6896 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->client_site_name
, CH_UTF16
)));
6897 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
));
6900 return NDR_ERR_SUCCESS
;
6903 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRGetDCNameInfo
*r
)
6905 uint32_t _ptr_dc_unc
;
6906 TALLOC_CTX
*_mem_save_dc_unc_0
;
6907 uint32_t _ptr_dc_address
;
6908 TALLOC_CTX
*_mem_save_dc_address_0
;
6909 uint32_t _ptr_domain_name
;
6910 TALLOC_CTX
*_mem_save_domain_name_0
;
6911 uint32_t _ptr_forest_name
;
6912 TALLOC_CTX
*_mem_save_forest_name_0
;
6913 uint32_t _ptr_dc_site_name
;
6914 TALLOC_CTX
*_mem_save_dc_site_name_0
;
6915 uint32_t _ptr_client_site_name
;
6916 TALLOC_CTX
*_mem_save_client_site_name_0
;
6917 if (ndr_flags
& NDR_SCALARS
) {
6918 NDR_CHECK(ndr_pull_align(ndr
, 4));
6919 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_unc
));
6921 NDR_PULL_ALLOC(ndr
, r
->dc_unc
);
6925 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_address
));
6926 if (_ptr_dc_address
) {
6927 NDR_PULL_ALLOC(ndr
, r
->dc_address
);
6929 r
->dc_address
= NULL
;
6931 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr
, NDR_SCALARS
, &r
->dc_address_type
));
6932 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->domain_guid
));
6933 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
6934 if (_ptr_domain_name
) {
6935 NDR_PULL_ALLOC(ndr
, r
->domain_name
);
6937 r
->domain_name
= NULL
;
6939 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_forest_name
));
6940 if (_ptr_forest_name
) {
6941 NDR_PULL_ALLOC(ndr
, r
->forest_name
);
6943 r
->forest_name
= NULL
;
6945 NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr
, NDR_SCALARS
, &r
->dc_flags
));
6946 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dc_site_name
));
6947 if (_ptr_dc_site_name
) {
6948 NDR_PULL_ALLOC(ndr
, r
->dc_site_name
);
6950 r
->dc_site_name
= NULL
;
6952 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_client_site_name
));
6953 if (_ptr_client_site_name
) {
6954 NDR_PULL_ALLOC(ndr
, r
->client_site_name
);
6956 r
->client_site_name
= NULL
;
6959 if (ndr_flags
& NDR_BUFFERS
) {
6961 _mem_save_dc_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6962 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_unc
, 0);
6963 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_unc
));
6964 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_unc
));
6965 if (ndr_get_array_length(ndr
, &r
->dc_unc
) > ndr_get_array_size(ndr
, &r
->dc_unc
)) {
6966 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
));
6968 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_unc
), sizeof(uint16_t)));
6969 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dc_unc
, ndr_get_array_length(ndr
, &r
->dc_unc
), sizeof(uint16_t), CH_UTF16
));
6970 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_unc_0
, 0);
6972 if (r
->dc_address
) {
6973 _mem_save_dc_address_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6974 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_address
, 0);
6975 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_address
));
6976 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_address
));
6977 if (ndr_get_array_length(ndr
, &r
->dc_address
) > ndr_get_array_size(ndr
, &r
->dc_address
)) {
6978 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
));
6980 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_address
), sizeof(uint16_t)));
6981 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dc_address
, ndr_get_array_length(ndr
, &r
->dc_address
), sizeof(uint16_t), CH_UTF16
));
6982 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_address_0
, 0);
6984 if (r
->domain_name
) {
6985 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6986 NDR_PULL_SET_MEM_CTX(ndr
, r
->domain_name
, 0);
6987 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->domain_name
));
6988 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->domain_name
));
6989 if (ndr_get_array_length(ndr
, &r
->domain_name
) > ndr_get_array_size(ndr
, &r
->domain_name
)) {
6990 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
));
6992 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->domain_name
), sizeof(uint16_t)));
6993 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->domain_name
, ndr_get_array_length(ndr
, &r
->domain_name
), sizeof(uint16_t), CH_UTF16
));
6994 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
6996 if (r
->forest_name
) {
6997 _mem_save_forest_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
6998 NDR_PULL_SET_MEM_CTX(ndr
, r
->forest_name
, 0);
6999 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->forest_name
));
7000 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->forest_name
));
7001 if (ndr_get_array_length(ndr
, &r
->forest_name
) > ndr_get_array_size(ndr
, &r
->forest_name
)) {
7002 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
));
7004 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->forest_name
), sizeof(uint16_t)));
7005 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->forest_name
, ndr_get_array_length(ndr
, &r
->forest_name
), sizeof(uint16_t), CH_UTF16
));
7006 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_name_0
, 0);
7008 if (r
->dc_site_name
) {
7009 _mem_save_dc_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7010 NDR_PULL_SET_MEM_CTX(ndr
, r
->dc_site_name
, 0);
7011 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dc_site_name
));
7012 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dc_site_name
));
7013 if (ndr_get_array_length(ndr
, &r
->dc_site_name
) > ndr_get_array_size(ndr
, &r
->dc_site_name
)) {
7014 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
));
7016 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dc_site_name
), sizeof(uint16_t)));
7017 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
));
7018 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dc_site_name_0
, 0);
7020 if (r
->client_site_name
) {
7021 _mem_save_client_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7022 NDR_PULL_SET_MEM_CTX(ndr
, r
->client_site_name
, 0);
7023 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->client_site_name
));
7024 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->client_site_name
));
7025 if (ndr_get_array_length(ndr
, &r
->client_site_name
) > ndr_get_array_size(ndr
, &r
->client_site_name
)) {
7026 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
));
7028 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->client_site_name
), sizeof(uint16_t)));
7029 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
));
7030 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_client_site_name_0
, 0);
7033 return NDR_ERR_SUCCESS
;
7036 _PUBLIC_
void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRGetDCNameInfo
*r
)
7038 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameInfo");
7040 ndr_print_ptr(ndr
, "dc_unc", r
->dc_unc
);
7043 ndr_print_string(ndr
, "dc_unc", r
->dc_unc
);
7046 ndr_print_ptr(ndr
, "dc_address", r
->dc_address
);
7048 if (r
->dc_address
) {
7049 ndr_print_string(ndr
, "dc_address", r
->dc_address
);
7052 ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr
, "dc_address_type", r
->dc_address_type
);
7053 ndr_print_GUID(ndr
, "domain_guid", &r
->domain_guid
);
7054 ndr_print_ptr(ndr
, "domain_name", r
->domain_name
);
7056 if (r
->domain_name
) {
7057 ndr_print_string(ndr
, "domain_name", r
->domain_name
);
7060 ndr_print_ptr(ndr
, "forest_name", r
->forest_name
);
7062 if (r
->forest_name
) {
7063 ndr_print_string(ndr
, "forest_name", r
->forest_name
);
7066 ndr_print_netr_DsR_DcFlags(ndr
, "dc_flags", r
->dc_flags
);
7067 ndr_print_ptr(ndr
, "dc_site_name", r
->dc_site_name
);
7069 if (r
->dc_site_name
) {
7070 ndr_print_string(ndr
, "dc_site_name", r
->dc_site_name
);
7073 ndr_print_ptr(ndr
, "client_site_name", r
->client_site_name
);
7075 if (r
->client_site_name
) {
7076 ndr_print_string(ndr
, "client_site_name", r
->client_site_name
);
7082 static enum ndr_err_code
ndr_push_netr_Capabilities(struct ndr_push
*ndr
, int ndr_flags
, const union netr_Capabilities
*r
)
7084 if (ndr_flags
& NDR_SCALARS
) {
7085 int level
= ndr_push_get_switch_value(ndr
, r
);
7086 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
7089 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->server_capabilities
));
7093 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7096 if (ndr_flags
& NDR_BUFFERS
) {
7097 int level
= ndr_push_get_switch_value(ndr
, r
);
7103 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7106 return NDR_ERR_SUCCESS
;
7109 static enum ndr_err_code
ndr_pull_netr_Capabilities(struct ndr_pull
*ndr
, int ndr_flags
, union netr_Capabilities
*r
)
7113 level
= ndr_pull_get_switch_value(ndr
, r
);
7114 if (ndr_flags
& NDR_SCALARS
) {
7115 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
7116 if (_level
!= level
) {
7117 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
7121 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, &r
->server_capabilities
));
7125 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7128 if (ndr_flags
& NDR_BUFFERS
) {
7134 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7137 return NDR_ERR_SUCCESS
;
7140 _PUBLIC_
void ndr_print_netr_Capabilities(struct ndr_print
*ndr
, const char *name
, const union netr_Capabilities
*r
)
7143 level
= ndr_print_get_switch_value(ndr
, r
);
7144 ndr_print_union(ndr
, name
, level
, "netr_Capabilities");
7147 ndr_print_netr_NegotiateFlags(ndr
, "server_capabilities", r
->server_capabilities
);
7151 ndr_print_bad_level(ndr
, name
, level
);
7155 static enum ndr_err_code
ndr_push_netr_TrustFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
7157 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
7158 return NDR_ERR_SUCCESS
;
7161 static enum ndr_err_code
ndr_pull_netr_TrustFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
7164 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
7166 return NDR_ERR_SUCCESS
;
7169 _PUBLIC_
void ndr_print_netr_TrustFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
7171 ndr_print_uint32(ndr
, name
, r
);
7173 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST
, r
);
7174 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND
, r
);
7175 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT
, r
);
7176 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY
, r
);
7177 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE
, r
);
7178 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND
, r
);
7179 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5
, r
);
7180 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES
, r
);
7184 static enum ndr_err_code
ndr_push_netr_DomainQuery1(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainQuery1
*r
)
7186 uint32_t cntr_unknown7_0
;
7187 if (ndr_flags
& NDR_SCALARS
) {
7188 NDR_CHECK(ndr_push_align(ndr
, 4));
7189 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_SCALARS
, &r
->blob
));
7190 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->workstation_domain
));
7191 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->workstation_site
));
7192 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown1
));
7193 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown2
));
7194 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown3
));
7195 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->unknown4
));
7196 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->blob2
));
7197 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->product
));
7198 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown5
));
7199 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown6
));
7200 for (cntr_unknown7_0
= 0; cntr_unknown7_0
< 4; cntr_unknown7_0
++) {
7201 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->unknown7
[cntr_unknown7_0
]));
7204 if (ndr_flags
& NDR_BUFFERS
) {
7205 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_BUFFERS
, &r
->blob
));
7206 if (r
->workstation_domain
) {
7207 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
)));
7208 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7209 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
)));
7210 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->workstation_domain
, ndr_charset_length(r
->workstation_domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7212 if (r
->workstation_site
) {
7213 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_site
, CH_UTF16
)));
7214 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7215 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->workstation_site
, CH_UTF16
)));
7216 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->workstation_site
, ndr_charset_length(r
->workstation_site
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7219 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown1
, CH_UTF16
)));
7220 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7221 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown1
, CH_UTF16
)));
7222 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown1
, ndr_charset_length(r
->unknown1
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7225 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown2
, CH_UTF16
)));
7226 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7227 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown2
, CH_UTF16
)));
7228 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown2
, ndr_charset_length(r
->unknown2
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7231 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown3
, CH_UTF16
)));
7232 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7233 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown3
, CH_UTF16
)));
7234 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown3
, ndr_charset_length(r
->unknown3
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7237 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown4
, CH_UTF16
)));
7238 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7239 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->unknown4
, CH_UTF16
)));
7240 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->unknown4
, ndr_charset_length(r
->unknown4
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
7242 NDR_CHECK(ndr_push_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->blob2
));
7243 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->product
));
7244 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown5
));
7245 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown6
));
7247 return NDR_ERR_SUCCESS
;
7250 static enum ndr_err_code
ndr_pull_netr_DomainQuery1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainQuery1
*r
)
7252 uint32_t _ptr_workstation_domain
;
7253 TALLOC_CTX
*_mem_save_workstation_domain_0
;
7254 uint32_t _ptr_workstation_site
;
7255 TALLOC_CTX
*_mem_save_workstation_site_0
;
7256 uint32_t _ptr_unknown1
;
7257 TALLOC_CTX
*_mem_save_unknown1_0
;
7258 uint32_t _ptr_unknown2
;
7259 TALLOC_CTX
*_mem_save_unknown2_0
;
7260 uint32_t _ptr_unknown3
;
7261 TALLOC_CTX
*_mem_save_unknown3_0
;
7262 uint32_t _ptr_unknown4
;
7263 TALLOC_CTX
*_mem_save_unknown4_0
;
7264 uint32_t cntr_unknown7_0
;
7265 if (ndr_flags
& NDR_SCALARS
) {
7266 NDR_CHECK(ndr_pull_align(ndr
, 4));
7267 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_SCALARS
, &r
->blob
));
7268 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_workstation_domain
));
7269 if (_ptr_workstation_domain
) {
7270 NDR_PULL_ALLOC(ndr
, r
->workstation_domain
);
7272 r
->workstation_domain
= NULL
;
7274 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_workstation_site
));
7275 if (_ptr_workstation_site
) {
7276 NDR_PULL_ALLOC(ndr
, r
->workstation_site
);
7278 r
->workstation_site
= NULL
;
7280 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown1
));
7281 if (_ptr_unknown1
) {
7282 NDR_PULL_ALLOC(ndr
, r
->unknown1
);
7286 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown2
));
7287 if (_ptr_unknown2
) {
7288 NDR_PULL_ALLOC(ndr
, r
->unknown2
);
7292 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown3
));
7293 if (_ptr_unknown3
) {
7294 NDR_PULL_ALLOC(ndr
, r
->unknown3
);
7298 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_unknown4
));
7299 if (_ptr_unknown4
) {
7300 NDR_PULL_ALLOC(ndr
, r
->unknown4
);
7304 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_SCALARS
, &r
->blob2
));
7305 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->product
));
7306 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown5
));
7307 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->unknown6
));
7308 for (cntr_unknown7_0
= 0; cntr_unknown7_0
< 4; cntr_unknown7_0
++) {
7309 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->unknown7
[cntr_unknown7_0
]));
7312 if (ndr_flags
& NDR_BUFFERS
) {
7313 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_BUFFERS
, &r
->blob
));
7314 if (r
->workstation_domain
) {
7315 _mem_save_workstation_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7316 NDR_PULL_SET_MEM_CTX(ndr
, r
->workstation_domain
, 0);
7317 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->workstation_domain
));
7318 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->workstation_domain
));
7319 if (ndr_get_array_length(ndr
, &r
->workstation_domain
) > ndr_get_array_size(ndr
, &r
->workstation_domain
)) {
7320 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->workstation_domain
), ndr_get_array_length(ndr
, &r
->workstation_domain
));
7322 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->workstation_domain
), sizeof(uint16_t)));
7323 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->workstation_domain
, ndr_get_array_length(ndr
, &r
->workstation_domain
), sizeof(uint16_t), CH_UTF16
));
7324 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_workstation_domain_0
, 0);
7326 if (r
->workstation_site
) {
7327 _mem_save_workstation_site_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7328 NDR_PULL_SET_MEM_CTX(ndr
, r
->workstation_site
, 0);
7329 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->workstation_site
));
7330 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->workstation_site
));
7331 if (ndr_get_array_length(ndr
, &r
->workstation_site
) > ndr_get_array_size(ndr
, &r
->workstation_site
)) {
7332 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->workstation_site
), ndr_get_array_length(ndr
, &r
->workstation_site
));
7334 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->workstation_site
), sizeof(uint16_t)));
7335 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->workstation_site
, ndr_get_array_length(ndr
, &r
->workstation_site
), sizeof(uint16_t), CH_UTF16
));
7336 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_workstation_site_0
, 0);
7339 _mem_save_unknown1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7340 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown1
, 0);
7341 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown1
));
7342 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown1
));
7343 if (ndr_get_array_length(ndr
, &r
->unknown1
) > ndr_get_array_size(ndr
, &r
->unknown1
)) {
7344 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown1
), ndr_get_array_length(ndr
, &r
->unknown1
));
7346 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown1
), sizeof(uint16_t)));
7347 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown1
, ndr_get_array_length(ndr
, &r
->unknown1
), sizeof(uint16_t), CH_UTF16
));
7348 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown1_0
, 0);
7351 _mem_save_unknown2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7352 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown2
, 0);
7353 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown2
));
7354 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown2
));
7355 if (ndr_get_array_length(ndr
, &r
->unknown2
) > ndr_get_array_size(ndr
, &r
->unknown2
)) {
7356 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown2
), ndr_get_array_length(ndr
, &r
->unknown2
));
7358 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown2
), sizeof(uint16_t)));
7359 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown2
, ndr_get_array_length(ndr
, &r
->unknown2
), sizeof(uint16_t), CH_UTF16
));
7360 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown2_0
, 0);
7363 _mem_save_unknown3_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7364 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown3
, 0);
7365 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown3
));
7366 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown3
));
7367 if (ndr_get_array_length(ndr
, &r
->unknown3
) > ndr_get_array_size(ndr
, &r
->unknown3
)) {
7368 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown3
), ndr_get_array_length(ndr
, &r
->unknown3
));
7370 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown3
), sizeof(uint16_t)));
7371 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown3
, ndr_get_array_length(ndr
, &r
->unknown3
), sizeof(uint16_t), CH_UTF16
));
7372 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown3_0
, 0);
7375 _mem_save_unknown4_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7376 NDR_PULL_SET_MEM_CTX(ndr
, r
->unknown4
, 0);
7377 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->unknown4
));
7378 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->unknown4
));
7379 if (ndr_get_array_length(ndr
, &r
->unknown4
) > ndr_get_array_size(ndr
, &r
->unknown4
)) {
7380 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->unknown4
), ndr_get_array_length(ndr
, &r
->unknown4
));
7382 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->unknown4
), sizeof(uint16_t)));
7383 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->unknown4
, ndr_get_array_length(ndr
, &r
->unknown4
), sizeof(uint16_t), CH_UTF16
));
7384 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_unknown4_0
, 0);
7386 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr
, NDR_BUFFERS
, &r
->blob2
));
7387 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->product
));
7388 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown5
));
7389 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->unknown6
));
7391 return NDR_ERR_SUCCESS
;
7394 _PUBLIC_
void ndr_print_netr_DomainQuery1(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainQuery1
*r
)
7396 uint32_t cntr_unknown7_0
;
7397 ndr_print_struct(ndr
, name
, "netr_DomainQuery1");
7399 ndr_print_netr_Blob(ndr
, "blob", &r
->blob
);
7400 ndr_print_ptr(ndr
, "workstation_domain", r
->workstation_domain
);
7402 if (r
->workstation_domain
) {
7403 ndr_print_string(ndr
, "workstation_domain", r
->workstation_domain
);
7406 ndr_print_ptr(ndr
, "workstation_site", r
->workstation_site
);
7408 if (r
->workstation_site
) {
7409 ndr_print_string(ndr
, "workstation_site", r
->workstation_site
);
7412 ndr_print_ptr(ndr
, "unknown1", r
->unknown1
);
7415 ndr_print_string(ndr
, "unknown1", r
->unknown1
);
7418 ndr_print_ptr(ndr
, "unknown2", r
->unknown2
);
7421 ndr_print_string(ndr
, "unknown2", r
->unknown2
);
7424 ndr_print_ptr(ndr
, "unknown3", r
->unknown3
);
7427 ndr_print_string(ndr
, "unknown3", r
->unknown3
);
7430 ndr_print_ptr(ndr
, "unknown4", r
->unknown4
);
7433 ndr_print_string(ndr
, "unknown4", r
->unknown4
);
7436 ndr_print_lsa_BinaryString(ndr
, "blob2", &r
->blob2
);
7437 ndr_print_lsa_String(ndr
, "product", &r
->product
);
7438 ndr_print_lsa_String(ndr
, "unknown5", &r
->unknown5
);
7439 ndr_print_lsa_String(ndr
, "unknown6", &r
->unknown6
);
7440 ndr
->print(ndr
, "%s: ARRAY(%d)", "unknown7", (int)4);
7442 for (cntr_unknown7_0
=0;cntr_unknown7_0
<4;cntr_unknown7_0
++) {
7444 if (asprintf(&idx_0
, "[%d]", cntr_unknown7_0
) != -1) {
7445 ndr_print_uint32(ndr
, "unknown7", r
->unknown7
[cntr_unknown7_0
]);
7453 static enum ndr_err_code
ndr_push_netr_DomainQuery(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DomainQuery
*r
)
7455 if (ndr_flags
& NDR_SCALARS
) {
7456 int level
= ndr_push_get_switch_value(ndr
, r
);
7457 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
7460 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->query1
));
7464 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->query1
));
7468 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7471 if (ndr_flags
& NDR_BUFFERS
) {
7472 int level
= ndr_push_get_switch_value(ndr
, r
);
7476 NDR_CHECK(ndr_push_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
7482 NDR_CHECK(ndr_push_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
7487 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7490 return NDR_ERR_SUCCESS
;
7493 static enum ndr_err_code
ndr_pull_netr_DomainQuery(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DomainQuery
*r
)
7497 TALLOC_CTX
*_mem_save_query1_0
;
7498 level
= ndr_pull_get_switch_value(ndr
, r
);
7499 if (ndr_flags
& NDR_SCALARS
) {
7500 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
7501 if (_level
!= level
) {
7502 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
7506 uint32_t _ptr_query1
;
7507 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_query1
));
7509 NDR_PULL_ALLOC(ndr
, r
->query1
);
7516 uint32_t _ptr_query1
;
7517 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_query1
));
7519 NDR_PULL_ALLOC(ndr
, r
->query1
);
7526 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7529 if (ndr_flags
& NDR_BUFFERS
) {
7533 _mem_save_query1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7534 NDR_PULL_SET_MEM_CTX(ndr
, r
->query1
, 0);
7535 NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
7536 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query1_0
, 0);
7542 _mem_save_query1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7543 NDR_PULL_SET_MEM_CTX(ndr
, r
->query1
, 0);
7544 NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->query1
));
7545 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query1_0
, 0);
7550 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
7553 return NDR_ERR_SUCCESS
;
7556 _PUBLIC_
void ndr_print_netr_DomainQuery(struct ndr_print
*ndr
, const char *name
, const union netr_DomainQuery
*r
)
7559 level
= ndr_print_get_switch_value(ndr
, r
);
7560 ndr_print_union(ndr
, name
, level
, "netr_DomainQuery");
7563 ndr_print_ptr(ndr
, "query1", r
->query1
);
7566 ndr_print_netr_DomainQuery1(ndr
, "query1", r
->query1
);
7572 ndr_print_ptr(ndr
, "query1", r
->query1
);
7575 ndr_print_netr_DomainQuery1(ndr
, "query1", r
->query1
);
7581 ndr_print_bad_level(ndr
, name
, level
);
7585 static enum ndr_err_code
ndr_push_netr_trust_extension(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_trust_extension
*r
)
7587 if (ndr_flags
& NDR_SCALARS
) {
7588 NDR_CHECK(ndr_push_align(ndr
, 4));
7589 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 8));
7590 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
7591 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 8));
7592 NDR_CHECK(ndr_push_netr_TrustFlags(ndr
, NDR_SCALARS
, r
->flags
));
7593 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->parent_index
));
7594 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->trust_type
));
7595 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->trust_attributes
));
7597 if (ndr_flags
& NDR_BUFFERS
) {
7599 return NDR_ERR_SUCCESS
;
7602 static enum ndr_err_code
ndr_pull_netr_trust_extension(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_trust_extension
*r
)
7604 if (ndr_flags
& NDR_SCALARS
) {
7605 NDR_CHECK(ndr_pull_align(ndr
, 4));
7606 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
7607 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->dummy
));
7608 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->size
));
7609 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr
, NDR_SCALARS
, &r
->flags
));
7610 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->parent_index
));
7611 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->trust_type
));
7612 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->trust_attributes
));
7614 if (ndr_flags
& NDR_BUFFERS
) {
7616 return NDR_ERR_SUCCESS
;
7619 _PUBLIC_
void ndr_print_netr_trust_extension(struct ndr_print
*ndr
, const char *name
, const struct netr_trust_extension
*r
)
7621 ndr_print_struct(ndr
, name
, "netr_trust_extension");
7623 ndr_print_uint32(ndr
, "length", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?8:r
->length
);
7624 ndr_print_uint32(ndr
, "dummy", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?0:r
->dummy
);
7625 ndr_print_uint32(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?8:r
->size
);
7626 ndr_print_netr_TrustFlags(ndr
, "flags", r
->flags
);
7627 ndr_print_uint32(ndr
, "parent_index", r
->parent_index
);
7628 ndr_print_uint32(ndr
, "trust_type", r
->trust_type
);
7629 ndr_print_uint32(ndr
, "trust_attributes", r
->trust_attributes
);
7633 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
)
7635 if (ndr_flags
& NDR_SCALARS
) {
7636 NDR_CHECK(ndr_push_align(ndr
, 4));
7637 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
7638 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->length
));
7639 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info
));
7641 if (ndr_flags
& NDR_BUFFERS
) {
7643 NDR_CHECK(ndr_push_netr_trust_extension(ndr
, NDR_SCALARS
, r
->info
));
7646 return NDR_ERR_SUCCESS
;
7649 static enum ndr_err_code
ndr_pull_netr_trust_extension_container(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_trust_extension_container
*r
)
7652 TALLOC_CTX
*_mem_save_info_0
;
7653 if (ndr_flags
& NDR_SCALARS
) {
7654 NDR_CHECK(ndr_pull_align(ndr
, 4));
7655 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->length
));
7656 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
7657 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info
));
7659 NDR_PULL_ALLOC(ndr
, r
->info
);
7664 if (ndr_flags
& NDR_BUFFERS
) {
7666 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7667 NDR_PULL_SET_MEM_CTX(ndr
, r
->info
, 0);
7668 NDR_CHECK(ndr_pull_netr_trust_extension(ndr
, NDR_SCALARS
, r
->info
));
7669 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, 0);
7672 return NDR_ERR_SUCCESS
;
7675 _PUBLIC_
void ndr_print_netr_trust_extension_container(struct ndr_print
*ndr
, const char *name
, const struct netr_trust_extension_container
*r
)
7677 ndr_print_struct(ndr
, name
, "netr_trust_extension_container");
7679 ndr_print_uint16(ndr
, "length", r
->length
);
7680 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->length
:r
->size
);
7681 ndr_print_ptr(ndr
, "info", r
->info
);
7684 ndr_print_netr_trust_extension(ndr
, "info", r
->info
);
7690 static enum ndr_err_code
ndr_push_netr_DomainTrustInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrustInfo
*r
)
7692 uint32_t cntr_dummystring_0
;
7693 uint32_t cntr_dummy_0
;
7694 if (ndr_flags
& NDR_SCALARS
) {
7695 NDR_CHECK(ndr_push_align(ndr
, 4));
7696 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->domainname
));
7697 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->fulldomainname
));
7698 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
7699 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
7700 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
7701 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr
, NDR_SCALARS
, &r
->trust_extension
));
7702 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7703 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->dummystring
[cntr_dummystring_0
]));
7705 for (cntr_dummy_0
= 0; cntr_dummy_0
< 4; cntr_dummy_0
++) {
7706 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->dummy
[cntr_dummy_0
]));
7709 if (ndr_flags
& NDR_BUFFERS
) {
7710 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->domainname
));
7711 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->fulldomainname
));
7712 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
7714 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
7716 NDR_CHECK(ndr_push_netr_trust_extension_container(ndr
, NDR_BUFFERS
, &r
->trust_extension
));
7717 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7718 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->dummystring
[cntr_dummystring_0
]));
7721 return NDR_ERR_SUCCESS
;
7724 static enum ndr_err_code
ndr_pull_netr_DomainTrustInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrustInfo
*r
)
7727 TALLOC_CTX
*_mem_save_sid_0
;
7728 uint32_t cntr_dummystring_0
;
7729 uint32_t cntr_dummy_0
;
7730 if (ndr_flags
& NDR_SCALARS
) {
7731 NDR_CHECK(ndr_pull_align(ndr
, 4));
7732 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->domainname
));
7733 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->fulldomainname
));
7734 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->forest
));
7735 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
7736 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
7738 NDR_PULL_ALLOC(ndr
, r
->sid
);
7742 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr
, NDR_SCALARS
, &r
->trust_extension
));
7743 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7744 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->dummystring
[cntr_dummystring_0
]));
7746 for (cntr_dummy_0
= 0; cntr_dummy_0
< 4; cntr_dummy_0
++) {
7747 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->dummy
[cntr_dummy_0
]));
7750 if (ndr_flags
& NDR_BUFFERS
) {
7751 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->domainname
));
7752 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->fulldomainname
));
7753 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->forest
));
7755 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7756 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
7757 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
7758 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
7760 NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr
, NDR_BUFFERS
, &r
->trust_extension
));
7761 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7762 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->dummystring
[cntr_dummystring_0
]));
7765 return NDR_ERR_SUCCESS
;
7768 _PUBLIC_
void ndr_print_netr_DomainTrustInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrustInfo
*r
)
7770 uint32_t cntr_dummystring_0
;
7771 uint32_t cntr_dummy_0
;
7772 ndr_print_struct(ndr
, name
, "netr_DomainTrustInfo");
7774 ndr_print_lsa_String(ndr
, "domainname", &r
->domainname
);
7775 ndr_print_lsa_String(ndr
, "fulldomainname", &r
->fulldomainname
);
7776 ndr_print_lsa_String(ndr
, "forest", &r
->forest
);
7777 ndr_print_GUID(ndr
, "guid", &r
->guid
);
7778 ndr_print_ptr(ndr
, "sid", r
->sid
);
7781 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
7784 ndr_print_netr_trust_extension_container(ndr
, "trust_extension", &r
->trust_extension
);
7785 ndr
->print(ndr
, "%s: ARRAY(%d)", "dummystring", (int)3);
7787 for (cntr_dummystring_0
=0;cntr_dummystring_0
<3;cntr_dummystring_0
++) {
7789 if (asprintf(&idx_0
, "[%d]", cntr_dummystring_0
) != -1) {
7790 ndr_print_lsa_String(ndr
, "dummystring", &r
->dummystring
[cntr_dummystring_0
]);
7795 ndr
->print(ndr
, "%s: ARRAY(%d)", "dummy", (int)4);
7797 for (cntr_dummy_0
=0;cntr_dummy_0
<4;cntr_dummy_0
++) {
7799 if (asprintf(&idx_0
, "[%d]", cntr_dummy_0
) != -1) {
7800 ndr_print_uint32(ndr
, "dummy", r
->dummy
[cntr_dummy_0
]);
7808 static enum ndr_err_code
ndr_push_netr_LsaPolicyInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_LsaPolicyInfo
*r
)
7810 if (ndr_flags
& NDR_SCALARS
) {
7811 NDR_CHECK(ndr_push_align(ndr
, 4));
7812 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->policy_size
));
7813 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->policy
));
7815 if (ndr_flags
& NDR_BUFFERS
) {
7817 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->policy_size
));
7818 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->policy
, r
->policy_size
));
7821 return NDR_ERR_SUCCESS
;
7824 static enum ndr_err_code
ndr_pull_netr_LsaPolicyInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_LsaPolicyInfo
*r
)
7826 uint32_t _ptr_policy
;
7827 TALLOC_CTX
*_mem_save_policy_0
;
7828 if (ndr_flags
& NDR_SCALARS
) {
7829 NDR_CHECK(ndr_pull_align(ndr
, 4));
7830 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->policy_size
));
7831 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_policy
));
7833 NDR_PULL_ALLOC(ndr
, r
->policy
);
7838 if (ndr_flags
& NDR_BUFFERS
) {
7840 _mem_save_policy_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7841 NDR_PULL_SET_MEM_CTX(ndr
, r
->policy
, 0);
7842 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->policy
));
7843 NDR_PULL_ALLOC_N(ndr
, r
->policy
, ndr_get_array_size(ndr
, &r
->policy
));
7844 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->policy
, ndr_get_array_size(ndr
, &r
->policy
)));
7845 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_policy_0
, 0);
7848 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->policy
, r
->policy_size
));
7851 return NDR_ERR_SUCCESS
;
7854 _PUBLIC_
void ndr_print_netr_LsaPolicyInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_LsaPolicyInfo
*r
)
7856 ndr_print_struct(ndr
, name
, "netr_LsaPolicyInfo");
7858 ndr_print_uint32(ndr
, "policy_size", r
->policy_size
);
7859 ndr_print_ptr(ndr
, "policy", r
->policy
);
7862 ndr_print_array_uint8(ndr
, "policy", r
->policy
, r
->policy_size
);
7868 _PUBLIC_
enum ndr_err_code
ndr_push_netr_WorkstationFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
7870 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
7871 return NDR_ERR_SUCCESS
;
7874 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_WorkstationFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
7877 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
7879 return NDR_ERR_SUCCESS
;
7882 _PUBLIC_
void ndr_print_netr_WorkstationFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
7884 ndr_print_uint32(ndr
, name
, r
);
7886 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS
, r
);
7887 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE
, r
);
7891 static enum ndr_err_code
ndr_push_netr_DomainInfo1(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainInfo1
*r
)
7893 uint32_t cntr_trusts_1
;
7894 uint32_t cntr_dummystring_0
;
7895 uint32_t cntr_dummy_0
;
7896 if (ndr_flags
& NDR_SCALARS
) {
7897 NDR_CHECK(ndr_push_align(ndr
, 4));
7898 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->domaininfo
));
7899 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_trusts
));
7900 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->trusts
));
7901 NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr
, NDR_SCALARS
, &r
->lsa_policy
));
7902 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->dns_hostname
));
7903 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7904 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->dummystring
[cntr_dummystring_0
]));
7906 NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr
, NDR_SCALARS
, r
->workstation_flags
));
7907 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->supported_enc_types
));
7908 for (cntr_dummy_0
= 0; cntr_dummy_0
< 2; cntr_dummy_0
++) {
7909 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->dummy
[cntr_dummy_0
]));
7912 if (ndr_flags
& NDR_BUFFERS
) {
7913 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->domaininfo
));
7915 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_trusts
));
7916 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7917 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->trusts
[cntr_trusts_1
]));
7919 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7920 NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->trusts
[cntr_trusts_1
]));
7923 NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr
, NDR_BUFFERS
, &r
->lsa_policy
));
7924 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->dns_hostname
));
7925 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7926 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->dummystring
[cntr_dummystring_0
]));
7929 return NDR_ERR_SUCCESS
;
7932 static enum ndr_err_code
ndr_pull_netr_DomainInfo1(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainInfo1
*r
)
7934 uint32_t _ptr_trusts
;
7935 uint32_t cntr_trusts_1
;
7936 TALLOC_CTX
*_mem_save_trusts_0
;
7937 TALLOC_CTX
*_mem_save_trusts_1
;
7938 uint32_t cntr_dummystring_0
;
7939 uint32_t cntr_dummy_0
;
7940 if (ndr_flags
& NDR_SCALARS
) {
7941 NDR_CHECK(ndr_pull_align(ndr
, 4));
7942 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->domaininfo
));
7943 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_trusts
));
7944 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusts
));
7946 NDR_PULL_ALLOC(ndr
, r
->trusts
);
7950 NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr
, NDR_SCALARS
, &r
->lsa_policy
));
7951 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->dns_hostname
));
7952 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7953 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->dummystring
[cntr_dummystring_0
]));
7955 NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr
, NDR_SCALARS
, &r
->workstation_flags
));
7956 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->supported_enc_types
));
7957 for (cntr_dummy_0
= 0; cntr_dummy_0
< 2; cntr_dummy_0
++) {
7958 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->dummy
[cntr_dummy_0
]));
7961 if (ndr_flags
& NDR_BUFFERS
) {
7962 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->domaininfo
));
7964 _mem_save_trusts_0
= NDR_PULL_GET_MEM_CTX(ndr
);
7965 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusts
, 0);
7966 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->trusts
));
7967 NDR_PULL_ALLOC_N(ndr
, r
->trusts
, ndr_get_array_size(ndr
, &r
->trusts
));
7968 _mem_save_trusts_1
= NDR_PULL_GET_MEM_CTX(ndr
);
7969 NDR_PULL_SET_MEM_CTX(ndr
, r
->trusts
, 0);
7970 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7971 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_SCALARS
, &r
->trusts
[cntr_trusts_1
]));
7973 for (cntr_trusts_1
= 0; cntr_trusts_1
< r
->num_trusts
; cntr_trusts_1
++) {
7974 NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr
, NDR_BUFFERS
, &r
->trusts
[cntr_trusts_1
]));
7976 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_1
, 0);
7977 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_0
, 0);
7979 NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr
, NDR_BUFFERS
, &r
->lsa_policy
));
7980 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->dns_hostname
));
7981 for (cntr_dummystring_0
= 0; cntr_dummystring_0
< 3; cntr_dummystring_0
++) {
7982 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->dummystring
[cntr_dummystring_0
]));
7985 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->trusts
, r
->num_trusts
));
7988 return NDR_ERR_SUCCESS
;
7991 _PUBLIC_
void ndr_print_netr_DomainInfo1(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainInfo1
*r
)
7993 uint32_t cntr_trusts_1
;
7994 uint32_t cntr_dummystring_0
;
7995 uint32_t cntr_dummy_0
;
7996 ndr_print_struct(ndr
, name
, "netr_DomainInfo1");
7998 ndr_print_netr_DomainTrustInfo(ndr
, "domaininfo", &r
->domaininfo
);
7999 ndr_print_uint32(ndr
, "num_trusts", r
->num_trusts
);
8000 ndr_print_ptr(ndr
, "trusts", r
->trusts
);
8003 ndr
->print(ndr
, "%s: ARRAY(%d)", "trusts", (int)r
->num_trusts
);
8005 for (cntr_trusts_1
=0;cntr_trusts_1
<r
->num_trusts
;cntr_trusts_1
++) {
8007 if (asprintf(&idx_1
, "[%d]", cntr_trusts_1
) != -1) {
8008 ndr_print_netr_DomainTrustInfo(ndr
, "trusts", &r
->trusts
[cntr_trusts_1
]);
8015 ndr_print_netr_LsaPolicyInfo(ndr
, "lsa_policy", &r
->lsa_policy
);
8016 ndr_print_lsa_String(ndr
, "dns_hostname", &r
->dns_hostname
);
8017 ndr
->print(ndr
, "%s: ARRAY(%d)", "dummystring", (int)3);
8019 for (cntr_dummystring_0
=0;cntr_dummystring_0
<3;cntr_dummystring_0
++) {
8021 if (asprintf(&idx_0
, "[%d]", cntr_dummystring_0
) != -1) {
8022 ndr_print_lsa_String(ndr
, "dummystring", &r
->dummystring
[cntr_dummystring_0
]);
8027 ndr_print_netr_WorkstationFlags(ndr
, "workstation_flags", r
->workstation_flags
);
8028 ndr_print_uint32(ndr
, "supported_enc_types", r
->supported_enc_types
);
8029 ndr
->print(ndr
, "%s: ARRAY(%d)", "dummy", (int)2);
8031 for (cntr_dummy_0
=0;cntr_dummy_0
<2;cntr_dummy_0
++) {
8033 if (asprintf(&idx_0
, "[%d]", cntr_dummy_0
) != -1) {
8034 ndr_print_uint32(ndr
, "dummy", r
->dummy
[cntr_dummy_0
]);
8042 static enum ndr_err_code
ndr_push_netr_DomainInfo(struct ndr_push
*ndr
, int ndr_flags
, const union netr_DomainInfo
*r
)
8044 if (ndr_flags
& NDR_SCALARS
) {
8045 int level
= ndr_push_get_switch_value(ndr
, r
);
8046 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, level
));
8049 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info1
));
8053 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->info2
));
8057 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
8060 if (ndr_flags
& NDR_BUFFERS
) {
8061 int level
= ndr_push_get_switch_value(ndr
, r
);
8065 NDR_CHECK(ndr_push_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
8071 NDR_CHECK(ndr_push_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info2
));
8076 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
8079 return NDR_ERR_SUCCESS
;
8082 static enum ndr_err_code
ndr_pull_netr_DomainInfo(struct ndr_pull
*ndr
, int ndr_flags
, union netr_DomainInfo
*r
)
8086 TALLOC_CTX
*_mem_save_info1_0
;
8087 TALLOC_CTX
*_mem_save_info2_0
;
8088 level
= ndr_pull_get_switch_value(ndr
, r
);
8089 if (ndr_flags
& NDR_SCALARS
) {
8090 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &_level
));
8091 if (_level
!= level
) {
8092 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
8096 uint32_t _ptr_info1
;
8097 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info1
));
8099 NDR_PULL_ALLOC(ndr
, r
->info1
);
8106 uint32_t _ptr_info2
;
8107 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info2
));
8109 NDR_PULL_ALLOC(ndr
, r
->info2
);
8116 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
8119 if (ndr_flags
& NDR_BUFFERS
) {
8123 _mem_save_info1_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8124 NDR_PULL_SET_MEM_CTX(ndr
, r
->info1
, 0);
8125 NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info1
));
8126 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info1_0
, 0);
8132 _mem_save_info2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8133 NDR_PULL_SET_MEM_CTX(ndr
, r
->info2
, 0);
8134 NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->info2
));
8135 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info2_0
, 0);
8140 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
8143 return NDR_ERR_SUCCESS
;
8146 _PUBLIC_
void ndr_print_netr_DomainInfo(struct ndr_print
*ndr
, const char *name
, const union netr_DomainInfo
*r
)
8149 level
= ndr_print_get_switch_value(ndr
, r
);
8150 ndr_print_union(ndr
, name
, level
, "netr_DomainInfo");
8153 ndr_print_ptr(ndr
, "info1", r
->info1
);
8156 ndr_print_netr_DomainInfo1(ndr
, "info1", r
->info1
);
8162 ndr_print_ptr(ndr
, "info2", r
->info2
);
8165 ndr_print_netr_DomainInfo1(ndr
, "info2", r
->info2
);
8171 ndr_print_bad_level(ndr
, name
, level
);
8175 static enum ndr_err_code
ndr_push_netr_CryptPassword(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_CryptPassword
*r
)
8178 uint32_t _flags_save_STRUCT
= ndr
->flags
;
8179 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
8180 if (ndr_flags
& NDR_SCALARS
) {
8181 NDR_CHECK(ndr_push_align(ndr
, 4));
8182 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 512));
8183 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->length
));
8185 if (ndr_flags
& NDR_BUFFERS
) {
8187 ndr
->flags
= _flags_save_STRUCT
;
8189 return NDR_ERR_SUCCESS
;
8192 static enum ndr_err_code
ndr_pull_netr_CryptPassword(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_CryptPassword
*r
)
8195 uint32_t _flags_save_STRUCT
= ndr
->flags
;
8196 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
8197 if (ndr_flags
& NDR_SCALARS
) {
8198 NDR_CHECK(ndr_pull_align(ndr
, 4));
8199 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->data
, 512));
8200 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->length
));
8202 if (ndr_flags
& NDR_BUFFERS
) {
8204 ndr
->flags
= _flags_save_STRUCT
;
8206 return NDR_ERR_SUCCESS
;
8209 _PUBLIC_
void ndr_print_netr_CryptPassword(struct ndr_print
*ndr
, const char *name
, const struct netr_CryptPassword
*r
)
8211 ndr_print_struct(ndr
, name
, "netr_CryptPassword");
8213 uint32_t _flags_save_STRUCT
= ndr
->flags
;
8214 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
8216 ndr_print_array_uint8(ndr
, "data", r
->data
, 512);
8217 ndr_print_uint32(ndr
, "length", r
->length
);
8219 ndr
->flags
= _flags_save_STRUCT
;
8223 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddressToSitenamesWCtr
*r
)
8225 uint32_t cntr_sitename_1
;
8226 if (ndr_flags
& NDR_SCALARS
) {
8227 NDR_CHECK(ndr_push_align(ndr
, 4));
8228 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8229 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sitename
));
8231 if (ndr_flags
& NDR_BUFFERS
) {
8233 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8234 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8235 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
8237 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8238 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
8242 return NDR_ERR_SUCCESS
;
8245 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddressToSitenamesWCtr
*r
)
8247 uint32_t _ptr_sitename
;
8248 uint32_t cntr_sitename_1
;
8249 TALLOC_CTX
*_mem_save_sitename_0
;
8250 TALLOC_CTX
*_mem_save_sitename_1
;
8251 if (ndr_flags
& NDR_SCALARS
) {
8252 NDR_CHECK(ndr_pull_align(ndr
, 4));
8253 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
8254 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sitename
));
8255 if (_ptr_sitename
) {
8256 NDR_PULL_ALLOC(ndr
, r
->sitename
);
8261 if (ndr_flags
& NDR_BUFFERS
) {
8263 _mem_save_sitename_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8264 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
8265 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sitename
));
8266 NDR_PULL_ALLOC_N(ndr
, r
->sitename
, ndr_get_array_size(ndr
, &r
->sitename
));
8267 _mem_save_sitename_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8268 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
8269 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8270 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
8272 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8273 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
8275 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_1
, 0);
8276 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_0
, 0);
8279 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sitename
, r
->count
));
8282 return NDR_ERR_SUCCESS
;
8285 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddressToSitenamesWCtr
*r
)
8287 uint32_t cntr_sitename_1
;
8288 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesWCtr");
8290 ndr_print_uint32(ndr
, "count", r
->count
);
8291 ndr_print_ptr(ndr
, "sitename", r
->sitename
);
8294 ndr
->print(ndr
, "%s: ARRAY(%d)", "sitename", (int)r
->count
);
8296 for (cntr_sitename_1
=0;cntr_sitename_1
<r
->count
;cntr_sitename_1
++) {
8298 if (asprintf(&idx_1
, "[%d]", cntr_sitename_1
) != -1) {
8299 ndr_print_lsa_String(ndr
, "sitename", &r
->sitename
[cntr_sitename_1
]);
8309 static enum ndr_err_code
ndr_push_netr_DsRAddress(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddress
*r
)
8311 if (ndr_flags
& NDR_SCALARS
) {
8312 NDR_CHECK(ndr_push_align(ndr
, 4));
8313 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->buffer
));
8314 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
));
8316 if (ndr_flags
& NDR_BUFFERS
) {
8318 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->size
));
8319 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->buffer
, r
->size
));
8322 return NDR_ERR_SUCCESS
;
8325 static enum ndr_err_code
ndr_pull_netr_DsRAddress(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddress
*r
)
8327 uint32_t _ptr_buffer
;
8328 TALLOC_CTX
*_mem_save_buffer_0
;
8329 if (ndr_flags
& NDR_SCALARS
) {
8330 NDR_CHECK(ndr_pull_align(ndr
, 4));
8331 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_buffer
));
8333 NDR_PULL_ALLOC(ndr
, r
->buffer
);
8337 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->size
));
8339 if (ndr_flags
& NDR_BUFFERS
) {
8341 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8342 NDR_PULL_SET_MEM_CTX(ndr
, r
->buffer
, 0);
8343 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->buffer
));
8344 NDR_PULL_ALLOC_N(ndr
, r
->buffer
, ndr_get_array_size(ndr
, &r
->buffer
));
8345 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->buffer
, ndr_get_array_size(ndr
, &r
->buffer
)));
8346 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, 0);
8349 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->buffer
, r
->size
));
8352 return NDR_ERR_SUCCESS
;
8355 _PUBLIC_
void ndr_print_netr_DsRAddress(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddress
*r
)
8357 ndr_print_struct(ndr
, name
, "netr_DsRAddress");
8359 ndr_print_ptr(ndr
, "buffer", r
->buffer
);
8362 ndr_print_array_uint8(ndr
, "buffer", r
->buffer
, r
->size
);
8365 ndr_print_uint32(ndr
, "size", r
->size
);
8369 static enum ndr_err_code
ndr_push_netr_TrustType(struct ndr_push
*ndr
, int ndr_flags
, enum netr_TrustType r
)
8371 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
8372 return NDR_ERR_SUCCESS
;
8375 static enum ndr_err_code
ndr_pull_netr_TrustType(struct ndr_pull
*ndr
, int ndr_flags
, enum netr_TrustType
*r
)
8378 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
8380 return NDR_ERR_SUCCESS
;
8383 _PUBLIC_
void ndr_print_netr_TrustType(struct ndr_print
*ndr
, const char *name
, enum netr_TrustType r
)
8385 const char *val
= NULL
;
8388 case NETR_TRUST_TYPE_DOWNLEVEL
: val
= "NETR_TRUST_TYPE_DOWNLEVEL"; break;
8389 case NETR_TRUST_TYPE_UPLEVEL
: val
= "NETR_TRUST_TYPE_UPLEVEL"; break;
8390 case NETR_TRUST_TYPE_MIT
: val
= "NETR_TRUST_TYPE_MIT"; break;
8391 case NETR_TRUST_TYPE_DCE
: val
= "NETR_TRUST_TYPE_DCE"; break;
8393 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
8396 static enum ndr_err_code
ndr_push_netr_TrustAttributes(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
8398 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
8399 return NDR_ERR_SUCCESS
;
8402 static enum ndr_err_code
ndr_pull_netr_TrustAttributes(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
8405 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
8407 return NDR_ERR_SUCCESS
;
8410 _PUBLIC_
void ndr_print_netr_TrustAttributes(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
8412 ndr_print_uint32(ndr
, name
, r
);
8414 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE
, r
);
8415 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY
, r
);
8416 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
, r
);
8417 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
, r
);
8418 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
, r
);
8419 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST
, r
);
8420 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
, r
);
8424 static enum ndr_err_code
ndr_push_netr_DomainTrust(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrust
*r
)
8426 if (ndr_flags
& NDR_SCALARS
) {
8427 NDR_CHECK(ndr_push_align(ndr
, 4));
8428 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->netbios_name
));
8429 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->dns_name
));
8430 NDR_CHECK(ndr_push_netr_TrustFlags(ndr
, NDR_SCALARS
, r
->trust_flags
));
8431 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->parent_index
));
8432 NDR_CHECK(ndr_push_netr_TrustType(ndr
, NDR_SCALARS
, r
->trust_type
));
8433 NDR_CHECK(ndr_push_netr_TrustAttributes(ndr
, NDR_SCALARS
, r
->trust_attributes
));
8434 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
8435 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
8437 if (ndr_flags
& NDR_BUFFERS
) {
8438 if (r
->netbios_name
) {
8439 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->netbios_name
, CH_UTF16
)));
8440 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8441 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->netbios_name
, CH_UTF16
)));
8442 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->netbios_name
, ndr_charset_length(r
->netbios_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8445 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dns_name
, CH_UTF16
)));
8446 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
8447 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->dns_name
, CH_UTF16
)));
8448 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->dns_name
, ndr_charset_length(r
->dns_name
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
8451 NDR_CHECK(ndr_push_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
8454 return NDR_ERR_SUCCESS
;
8457 static enum ndr_err_code
ndr_pull_netr_DomainTrust(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrust
*r
)
8459 uint32_t _ptr_netbios_name
;
8460 TALLOC_CTX
*_mem_save_netbios_name_0
;
8461 uint32_t _ptr_dns_name
;
8462 TALLOC_CTX
*_mem_save_dns_name_0
;
8464 TALLOC_CTX
*_mem_save_sid_0
;
8465 if (ndr_flags
& NDR_SCALARS
) {
8466 NDR_CHECK(ndr_pull_align(ndr
, 4));
8467 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_netbios_name
));
8468 if (_ptr_netbios_name
) {
8469 NDR_PULL_ALLOC(ndr
, r
->netbios_name
);
8471 r
->netbios_name
= NULL
;
8473 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dns_name
));
8474 if (_ptr_dns_name
) {
8475 NDR_PULL_ALLOC(ndr
, r
->dns_name
);
8479 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr
, NDR_SCALARS
, &r
->trust_flags
));
8480 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->parent_index
));
8481 NDR_CHECK(ndr_pull_netr_TrustType(ndr
, NDR_SCALARS
, &r
->trust_type
));
8482 NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr
, NDR_SCALARS
, &r
->trust_attributes
));
8483 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
8485 NDR_PULL_ALLOC(ndr
, r
->sid
);
8489 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->guid
));
8491 if (ndr_flags
& NDR_BUFFERS
) {
8492 if (r
->netbios_name
) {
8493 _mem_save_netbios_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8494 NDR_PULL_SET_MEM_CTX(ndr
, r
->netbios_name
, 0);
8495 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->netbios_name
));
8496 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->netbios_name
));
8497 if (ndr_get_array_length(ndr
, &r
->netbios_name
) > ndr_get_array_size(ndr
, &r
->netbios_name
)) {
8498 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
));
8500 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->netbios_name
), sizeof(uint16_t)));
8501 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->netbios_name
, ndr_get_array_length(ndr
, &r
->netbios_name
), sizeof(uint16_t), CH_UTF16
));
8502 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_netbios_name_0
, 0);
8505 _mem_save_dns_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8506 NDR_PULL_SET_MEM_CTX(ndr
, r
->dns_name
, 0);
8507 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->dns_name
));
8508 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->dns_name
));
8509 if (ndr_get_array_length(ndr
, &r
->dns_name
) > ndr_get_array_size(ndr
, &r
->dns_name
)) {
8510 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
));
8512 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->dns_name
), sizeof(uint16_t)));
8513 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->dns_name
, ndr_get_array_length(ndr
, &r
->dns_name
), sizeof(uint16_t), CH_UTF16
));
8514 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dns_name_0
, 0);
8517 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8518 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
8519 NDR_CHECK(ndr_pull_dom_sid2(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sid
));
8520 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
8523 return NDR_ERR_SUCCESS
;
8526 _PUBLIC_
void ndr_print_netr_DomainTrust(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrust
*r
)
8528 ndr_print_struct(ndr
, name
, "netr_DomainTrust");
8530 ndr_print_ptr(ndr
, "netbios_name", r
->netbios_name
);
8532 if (r
->netbios_name
) {
8533 ndr_print_string(ndr
, "netbios_name", r
->netbios_name
);
8536 ndr_print_ptr(ndr
, "dns_name", r
->dns_name
);
8539 ndr_print_string(ndr
, "dns_name", r
->dns_name
);
8542 ndr_print_netr_TrustFlags(ndr
, "trust_flags", r
->trust_flags
);
8543 ndr_print_uint32(ndr
, "parent_index", r
->parent_index
);
8544 ndr_print_netr_TrustType(ndr
, "trust_type", r
->trust_type
);
8545 ndr_print_netr_TrustAttributes(ndr
, "trust_attributes", r
->trust_attributes
);
8546 ndr_print_ptr(ndr
, "sid", r
->sid
);
8549 ndr_print_dom_sid2(ndr
, "sid", r
->sid
);
8552 ndr_print_GUID(ndr
, "guid", &r
->guid
);
8556 static enum ndr_err_code
ndr_push_netr_DomainTrustList(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DomainTrustList
*r
)
8558 uint32_t cntr_array_1
;
8559 if (ndr_flags
& NDR_SCALARS
) {
8560 NDR_CHECK(ndr_push_align(ndr
, 4));
8561 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8562 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->array
));
8564 if (ndr_flags
& NDR_BUFFERS
) {
8566 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8567 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
8568 NDR_CHECK(ndr_push_netr_DomainTrust(ndr
, NDR_SCALARS
, &r
->array
[cntr_array_1
]));
8570 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
8571 NDR_CHECK(ndr_push_netr_DomainTrust(ndr
, NDR_BUFFERS
, &r
->array
[cntr_array_1
]));
8575 return NDR_ERR_SUCCESS
;
8578 static enum ndr_err_code
ndr_pull_netr_DomainTrustList(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DomainTrustList
*r
)
8580 uint32_t _ptr_array
;
8581 uint32_t cntr_array_1
;
8582 TALLOC_CTX
*_mem_save_array_0
;
8583 TALLOC_CTX
*_mem_save_array_1
;
8584 if (ndr_flags
& NDR_SCALARS
) {
8585 NDR_CHECK(ndr_pull_align(ndr
, 4));
8586 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
8587 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_array
));
8589 NDR_PULL_ALLOC(ndr
, r
->array
);
8594 if (ndr_flags
& NDR_BUFFERS
) {
8596 _mem_save_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8597 NDR_PULL_SET_MEM_CTX(ndr
, r
->array
, 0);
8598 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->array
));
8599 NDR_PULL_ALLOC_N(ndr
, r
->array
, ndr_get_array_size(ndr
, &r
->array
));
8600 _mem_save_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8601 NDR_PULL_SET_MEM_CTX(ndr
, r
->array
, 0);
8602 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
8603 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr
, NDR_SCALARS
, &r
->array
[cntr_array_1
]));
8605 for (cntr_array_1
= 0; cntr_array_1
< r
->count
; cntr_array_1
++) {
8606 NDR_CHECK(ndr_pull_netr_DomainTrust(ndr
, NDR_BUFFERS
, &r
->array
[cntr_array_1
]));
8608 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_array_1
, 0);
8609 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_array_0
, 0);
8612 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->array
, r
->count
));
8615 return NDR_ERR_SUCCESS
;
8618 _PUBLIC_
void ndr_print_netr_DomainTrustList(struct ndr_print
*ndr
, const char *name
, const struct netr_DomainTrustList
*r
)
8620 uint32_t cntr_array_1
;
8621 ndr_print_struct(ndr
, name
, "netr_DomainTrustList");
8623 ndr_print_uint32(ndr
, "count", r
->count
);
8624 ndr_print_ptr(ndr
, "array", r
->array
);
8627 ndr
->print(ndr
, "%s: ARRAY(%d)", "array", (int)r
->count
);
8629 for (cntr_array_1
=0;cntr_array_1
<r
->count
;cntr_array_1
++) {
8631 if (asprintf(&idx_1
, "[%d]", cntr_array_1
) != -1) {
8632 ndr_print_netr_DomainTrust(ndr
, "array", &r
->array
[cntr_array_1
]);
8642 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_DsRAddressToSitenamesExWCtr
*r
)
8644 uint32_t cntr_sitename_1
;
8645 uint32_t cntr_subnetname_1
;
8646 if (ndr_flags
& NDR_SCALARS
) {
8647 NDR_CHECK(ndr_push_align(ndr
, 4));
8648 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8649 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sitename
));
8650 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->subnetname
));
8652 if (ndr_flags
& NDR_BUFFERS
) {
8654 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8655 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8656 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
8658 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8659 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
8662 if (r
->subnetname
) {
8663 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8664 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
8665 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->subnetname
[cntr_subnetname_1
]));
8667 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
8668 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->subnetname
[cntr_subnetname_1
]));
8672 return NDR_ERR_SUCCESS
;
8675 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_DsRAddressToSitenamesExWCtr
*r
)
8677 uint32_t _ptr_sitename
;
8678 uint32_t cntr_sitename_1
;
8679 TALLOC_CTX
*_mem_save_sitename_0
;
8680 TALLOC_CTX
*_mem_save_sitename_1
;
8681 uint32_t _ptr_subnetname
;
8682 uint32_t cntr_subnetname_1
;
8683 TALLOC_CTX
*_mem_save_subnetname_0
;
8684 TALLOC_CTX
*_mem_save_subnetname_1
;
8685 if (ndr_flags
& NDR_SCALARS
) {
8686 NDR_CHECK(ndr_pull_align(ndr
, 4));
8687 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
8688 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sitename
));
8689 if (_ptr_sitename
) {
8690 NDR_PULL_ALLOC(ndr
, r
->sitename
);
8694 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_subnetname
));
8695 if (_ptr_subnetname
) {
8696 NDR_PULL_ALLOC(ndr
, r
->subnetname
);
8698 r
->subnetname
= NULL
;
8701 if (ndr_flags
& NDR_BUFFERS
) {
8703 _mem_save_sitename_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8704 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
8705 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sitename
));
8706 NDR_PULL_ALLOC_N(ndr
, r
->sitename
, ndr_get_array_size(ndr
, &r
->sitename
));
8707 _mem_save_sitename_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8708 NDR_PULL_SET_MEM_CTX(ndr
, r
->sitename
, 0);
8709 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8710 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sitename
[cntr_sitename_1
]));
8712 for (cntr_sitename_1
= 0; cntr_sitename_1
< r
->count
; cntr_sitename_1
++) {
8713 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sitename
[cntr_sitename_1
]));
8715 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_1
, 0);
8716 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sitename_0
, 0);
8718 if (r
->subnetname
) {
8719 _mem_save_subnetname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8720 NDR_PULL_SET_MEM_CTX(ndr
, r
->subnetname
, 0);
8721 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->subnetname
));
8722 NDR_PULL_ALLOC_N(ndr
, r
->subnetname
, ndr_get_array_size(ndr
, &r
->subnetname
));
8723 _mem_save_subnetname_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8724 NDR_PULL_SET_MEM_CTX(ndr
, r
->subnetname
, 0);
8725 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
8726 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->subnetname
[cntr_subnetname_1
]));
8728 for (cntr_subnetname_1
= 0; cntr_subnetname_1
< r
->count
; cntr_subnetname_1
++) {
8729 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->subnetname
[cntr_subnetname_1
]));
8731 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_subnetname_1
, 0);
8732 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_subnetname_0
, 0);
8735 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sitename
, r
->count
));
8737 if (r
->subnetname
) {
8738 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->subnetname
, r
->count
));
8741 return NDR_ERR_SUCCESS
;
8744 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print
*ndr
, const char *name
, const struct netr_DsRAddressToSitenamesExWCtr
*r
)
8746 uint32_t cntr_sitename_1
;
8747 uint32_t cntr_subnetname_1
;
8748 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesExWCtr");
8750 ndr_print_uint32(ndr
, "count", r
->count
);
8751 ndr_print_ptr(ndr
, "sitename", r
->sitename
);
8754 ndr
->print(ndr
, "%s: ARRAY(%d)", "sitename", (int)r
->count
);
8756 for (cntr_sitename_1
=0;cntr_sitename_1
<r
->count
;cntr_sitename_1
++) {
8758 if (asprintf(&idx_1
, "[%d]", cntr_sitename_1
) != -1) {
8759 ndr_print_lsa_String(ndr
, "sitename", &r
->sitename
[cntr_sitename_1
]);
8766 ndr_print_ptr(ndr
, "subnetname", r
->subnetname
);
8768 if (r
->subnetname
) {
8769 ndr
->print(ndr
, "%s: ARRAY(%d)", "subnetname", (int)r
->count
);
8771 for (cntr_subnetname_1
=0;cntr_subnetname_1
<r
->count
;cntr_subnetname_1
++) {
8773 if (asprintf(&idx_1
, "[%d]", cntr_subnetname_1
) != -1) {
8774 ndr_print_lsa_String(ndr
, "subnetname", &r
->subnetname
[cntr_subnetname_1
]);
8784 static enum ndr_err_code
ndr_push_DcSitesCtr(struct ndr_push
*ndr
, int ndr_flags
, const struct DcSitesCtr
*r
)
8786 uint32_t cntr_sites_1
;
8787 if (ndr_flags
& NDR_SCALARS
) {
8788 NDR_CHECK(ndr_push_align(ndr
, 4));
8789 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_sites
));
8790 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sites
));
8792 if (ndr_flags
& NDR_BUFFERS
) {
8794 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_sites
));
8795 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
8796 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->sites
[cntr_sites_1
]));
8798 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
8799 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->sites
[cntr_sites_1
]));
8803 return NDR_ERR_SUCCESS
;
8806 static enum ndr_err_code
ndr_pull_DcSitesCtr(struct ndr_pull
*ndr
, int ndr_flags
, struct DcSitesCtr
*r
)
8808 uint32_t _ptr_sites
;
8809 uint32_t cntr_sites_1
;
8810 TALLOC_CTX
*_mem_save_sites_0
;
8811 TALLOC_CTX
*_mem_save_sites_1
;
8812 if (ndr_flags
& NDR_SCALARS
) {
8813 NDR_CHECK(ndr_pull_align(ndr
, 4));
8814 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_sites
));
8815 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sites
));
8817 NDR_PULL_ALLOC(ndr
, r
->sites
);
8822 if (ndr_flags
& NDR_BUFFERS
) {
8824 _mem_save_sites_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8825 NDR_PULL_SET_MEM_CTX(ndr
, r
->sites
, 0);
8826 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sites
));
8827 NDR_PULL_ALLOC_N(ndr
, r
->sites
, ndr_get_array_size(ndr
, &r
->sites
));
8828 _mem_save_sites_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8829 NDR_PULL_SET_MEM_CTX(ndr
, r
->sites
, 0);
8830 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
8831 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->sites
[cntr_sites_1
]));
8833 for (cntr_sites_1
= 0; cntr_sites_1
< r
->num_sites
; cntr_sites_1
++) {
8834 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->sites
[cntr_sites_1
]));
8836 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sites_1
, 0);
8837 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sites_0
, 0);
8840 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sites
, r
->num_sites
));
8843 return NDR_ERR_SUCCESS
;
8846 _PUBLIC_
void ndr_print_DcSitesCtr(struct ndr_print
*ndr
, const char *name
, const struct DcSitesCtr
*r
)
8848 uint32_t cntr_sites_1
;
8849 ndr_print_struct(ndr
, name
, "DcSitesCtr");
8851 ndr_print_uint32(ndr
, "num_sites", r
->num_sites
);
8852 ndr_print_ptr(ndr
, "sites", r
->sites
);
8855 ndr
->print(ndr
, "%s: ARRAY(%d)", "sites", (int)r
->num_sites
);
8857 for (cntr_sites_1
=0;cntr_sites_1
<r
->num_sites
;cntr_sites_1
++) {
8859 if (asprintf(&idx_1
, "[%d]", cntr_sites_1
) != -1) {
8860 ndr_print_lsa_String(ndr
, "sites", &r
->sites
[cntr_sites_1
]);
8870 static enum ndr_err_code
ndr_push_netr_TrustInfo(struct ndr_push
*ndr
, int ndr_flags
, const struct netr_TrustInfo
*r
)
8872 uint32_t cntr_data_1
;
8873 uint32_t cntr_entries_1
;
8874 if (ndr_flags
& NDR_SCALARS
) {
8875 NDR_CHECK(ndr_push_align(ndr
, 4));
8876 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8877 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->data
));
8878 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->entry_count
));
8879 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->entries
));
8881 if (ndr_flags
& NDR_BUFFERS
) {
8883 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8884 for (cntr_data_1
= 0; cntr_data_1
< r
->count
; cntr_data_1
++) {
8885 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->data
[cntr_data_1
]));
8889 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->count
));
8890 for (cntr_entries_1
= 0; cntr_entries_1
< r
->count
; cntr_entries_1
++) {
8891 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_SCALARS
, &r
->entries
[cntr_entries_1
]));
8893 for (cntr_entries_1
= 0; cntr_entries_1
< r
->count
; cntr_entries_1
++) {
8894 NDR_CHECK(ndr_push_lsa_String(ndr
, NDR_BUFFERS
, &r
->entries
[cntr_entries_1
]));
8898 return NDR_ERR_SUCCESS
;
8901 static enum ndr_err_code
ndr_pull_netr_TrustInfo(struct ndr_pull
*ndr
, int ndr_flags
, struct netr_TrustInfo
*r
)
8904 uint32_t cntr_data_1
;
8905 TALLOC_CTX
*_mem_save_data_0
;
8906 TALLOC_CTX
*_mem_save_data_1
;
8907 uint32_t _ptr_entries
;
8908 uint32_t cntr_entries_1
;
8909 TALLOC_CTX
*_mem_save_entries_0
;
8910 TALLOC_CTX
*_mem_save_entries_1
;
8911 if (ndr_flags
& NDR_SCALARS
) {
8912 NDR_CHECK(ndr_pull_align(ndr
, 4));
8913 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->count
));
8914 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_data
));
8916 NDR_PULL_ALLOC(ndr
, r
->data
);
8920 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->entry_count
));
8921 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_entries
));
8923 NDR_PULL_ALLOC(ndr
, r
->entries
);
8928 if (ndr_flags
& NDR_BUFFERS
) {
8930 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8931 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
8932 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->data
));
8933 NDR_PULL_ALLOC_N(ndr
, r
->data
, ndr_get_array_size(ndr
, &r
->data
));
8934 _mem_save_data_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8935 NDR_PULL_SET_MEM_CTX(ndr
, r
->data
, 0);
8936 for (cntr_data_1
= 0; cntr_data_1
< r
->count
; cntr_data_1
++) {
8937 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->data
[cntr_data_1
]));
8939 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_1
, 0);
8940 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, 0);
8943 _mem_save_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
8944 NDR_PULL_SET_MEM_CTX(ndr
, r
->entries
, 0);
8945 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->entries
));
8946 NDR_PULL_ALLOC_N(ndr
, r
->entries
, ndr_get_array_size(ndr
, &r
->entries
));
8947 _mem_save_entries_1
= NDR_PULL_GET_MEM_CTX(ndr
);
8948 NDR_PULL_SET_MEM_CTX(ndr
, r
->entries
, 0);
8949 for (cntr_entries_1
= 0; cntr_entries_1
< r
->count
; cntr_entries_1
++) {
8950 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_SCALARS
, &r
->entries
[cntr_entries_1
]));
8952 for (cntr_entries_1
= 0; cntr_entries_1
< r
->count
; cntr_entries_1
++) {
8953 NDR_CHECK(ndr_pull_lsa_String(ndr
, NDR_BUFFERS
, &r
->entries
[cntr_entries_1
]));
8955 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_entries_1
, 0);
8956 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_entries_0
, 0);
8959 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->data
, r
->count
));
8962 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->entries
, r
->count
));
8965 return NDR_ERR_SUCCESS
;
8968 _PUBLIC_
void ndr_print_netr_TrustInfo(struct ndr_print
*ndr
, const char *name
, const struct netr_TrustInfo
*r
)
8970 uint32_t cntr_data_1
;
8971 uint32_t cntr_entries_1
;
8972 ndr_print_struct(ndr
, name
, "netr_TrustInfo");
8974 ndr_print_uint32(ndr
, "count", r
->count
);
8975 ndr_print_ptr(ndr
, "data", r
->data
);
8978 ndr
->print(ndr
, "%s: ARRAY(%d)", "data", (int)r
->count
);
8980 for (cntr_data_1
=0;cntr_data_1
<r
->count
;cntr_data_1
++) {
8982 if (asprintf(&idx_1
, "[%d]", cntr_data_1
) != -1) {
8983 ndr_print_uint32(ndr
, "data", r
->data
[cntr_data_1
]);
8990 ndr_print_uint32(ndr
, "entry_count", r
->entry_count
);
8991 ndr_print_ptr(ndr
, "entries", r
->entries
);
8994 ndr
->print(ndr
, "%s: ARRAY(%d)", "entries", (int)r
->count
);
8996 for (cntr_entries_1
=0;cntr_entries_1
<r
->count
;cntr_entries_1
++) {
8998 if (asprintf(&idx_1
, "[%d]", cntr_entries_1
) != -1) {
8999 ndr_print_lsa_String(ndr
, "entries", &r
->entries
[cntr_entries_1
]);
9009 static enum ndr_err_code
ndr_push_netr_LogonUasLogon(struct ndr_push
*ndr
, int flags
, const struct netr_LogonUasLogon
*r
)
9011 if (flags
& NDR_IN
) {
9012 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9013 if (r
->in
.server_name
) {
9014 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9015 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9016 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9017 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
));
9019 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9020 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9021 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9022 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
));
9023 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
9024 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9025 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
9026 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.workstation
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9028 if (flags
& NDR_OUT
) {
9029 if (r
->out
.info
== NULL
) {
9030 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9032 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.info
));
9034 NDR_CHECK(ndr_push_netr_UasInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
9036 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
9038 return NDR_ERR_SUCCESS
;
9041 static enum ndr_err_code
ndr_pull_netr_LogonUasLogon(struct ndr_pull
*ndr
, int flags
, struct netr_LogonUasLogon
*r
)
9043 uint32_t _ptr_server_name
;
9045 TALLOC_CTX
*_mem_save_server_name_0
;
9046 TALLOC_CTX
*_mem_save_info_0
;
9047 TALLOC_CTX
*_mem_save_info_1
;
9048 if (flags
& NDR_IN
) {
9049 ZERO_STRUCT(r
->out
);
9051 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9052 if (_ptr_server_name
) {
9053 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9055 r
->in
.server_name
= NULL
;
9057 if (r
->in
.server_name
) {
9058 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9059 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9060 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9061 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9062 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9063 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
));
9065 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9066 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
));
9067 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9069 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
9070 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
9071 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
9072 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
));
9074 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
9075 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
));
9076 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.workstation
));
9077 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.workstation
));
9078 if (ndr_get_array_length(ndr
, &r
->in
.workstation
) > ndr_get_array_size(ndr
, &r
->in
.workstation
)) {
9079 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
));
9081 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t)));
9082 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.workstation
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t), CH_UTF16
));
9083 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9084 ZERO_STRUCTP(r
->out
.info
);
9086 if (flags
& NDR_OUT
) {
9087 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9088 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9090 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9091 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
9092 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info
));
9094 NDR_PULL_ALLOC(ndr
, *r
->out
.info
);
9096 *r
->out
.info
= NULL
;
9099 _mem_save_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
9100 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.info
, 0);
9101 NDR_CHECK(ndr_pull_netr_UasInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
9102 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_1
, 0);
9104 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
9105 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
9107 return NDR_ERR_SUCCESS
;
9110 _PUBLIC_
void ndr_print_netr_LogonUasLogon(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonUasLogon
*r
)
9112 ndr_print_struct(ndr
, name
, "netr_LogonUasLogon");
9114 if (flags
& NDR_SET_VALUES
) {
9115 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9117 if (flags
& NDR_IN
) {
9118 ndr_print_struct(ndr
, "in", "netr_LogonUasLogon");
9120 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9122 if (r
->in
.server_name
) {
9123 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9126 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
9127 ndr_print_string(ndr
, "workstation", r
->in
.workstation
);
9130 if (flags
& NDR_OUT
) {
9131 ndr_print_struct(ndr
, "out", "netr_LogonUasLogon");
9133 ndr_print_ptr(ndr
, "info", r
->out
.info
);
9135 ndr_print_ptr(ndr
, "info", *r
->out
.info
);
9138 ndr_print_netr_UasInfo(ndr
, "info", *r
->out
.info
);
9142 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
9148 static enum ndr_err_code
ndr_push_netr_LogonUasLogoff(struct ndr_push
*ndr
, int flags
, const struct netr_LogonUasLogoff
*r
)
9150 if (flags
& NDR_IN
) {
9151 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9152 if (r
->in
.server_name
) {
9153 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9154 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9155 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9156 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
));
9158 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9159 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9160 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9161 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
));
9162 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
9163 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9164 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
)));
9165 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.workstation
, ndr_charset_length(r
->in
.workstation
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
9167 if (flags
& NDR_OUT
) {
9168 if (r
->out
.info
== NULL
) {
9169 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9171 NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr
, NDR_SCALARS
, r
->out
.info
));
9172 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
9174 return NDR_ERR_SUCCESS
;
9177 static enum ndr_err_code
ndr_pull_netr_LogonUasLogoff(struct ndr_pull
*ndr
, int flags
, struct netr_LogonUasLogoff
*r
)
9179 uint32_t _ptr_server_name
;
9180 TALLOC_CTX
*_mem_save_server_name_0
;
9181 TALLOC_CTX
*_mem_save_info_0
;
9182 if (flags
& NDR_IN
) {
9183 ZERO_STRUCT(r
->out
);
9185 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9186 if (_ptr_server_name
) {
9187 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9189 r
->in
.server_name
= NULL
;
9191 if (r
->in
.server_name
) {
9192 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9193 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9194 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9195 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9196 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9197 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
));
9199 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9200 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
));
9201 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9203 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
9204 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
9205 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
9206 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
));
9208 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
9209 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
));
9210 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.workstation
));
9211 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.workstation
));
9212 if (ndr_get_array_length(ndr
, &r
->in
.workstation
) > ndr_get_array_size(ndr
, &r
->in
.workstation
)) {
9213 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
));
9215 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t)));
9216 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.workstation
, ndr_get_array_length(ndr
, &r
->in
.workstation
), sizeof(uint16_t), CH_UTF16
));
9217 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9218 ZERO_STRUCTP(r
->out
.info
);
9220 if (flags
& NDR_OUT
) {
9221 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9222 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
9224 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9225 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
9226 NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr
, NDR_SCALARS
, r
->out
.info
));
9227 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
9228 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
9230 return NDR_ERR_SUCCESS
;
9233 _PUBLIC_
void ndr_print_netr_LogonUasLogoff(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonUasLogoff
*r
)
9235 ndr_print_struct(ndr
, name
, "netr_LogonUasLogoff");
9237 if (flags
& NDR_SET_VALUES
) {
9238 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9240 if (flags
& NDR_IN
) {
9241 ndr_print_struct(ndr
, "in", "netr_LogonUasLogoff");
9243 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9245 if (r
->in
.server_name
) {
9246 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9249 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
9250 ndr_print_string(ndr
, "workstation", r
->in
.workstation
);
9253 if (flags
& NDR_OUT
) {
9254 ndr_print_struct(ndr
, "out", "netr_LogonUasLogoff");
9256 ndr_print_ptr(ndr
, "info", r
->out
.info
);
9258 ndr_print_netr_UasLogoffInfo(ndr
, "info", r
->out
.info
);
9260 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
9266 static enum ndr_err_code
ndr_push_netr_LogonSamLogon(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogon
*r
)
9268 if (flags
& NDR_IN
) {
9269 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9270 if (r
->in
.server_name
) {
9271 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9272 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9273 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9274 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
));
9276 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
9277 if (r
->in
.computer_name
) {
9278 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9279 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9280 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9281 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
));
9283 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
9284 if (r
->in
.credential
) {
9285 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
9287 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
9288 if (r
->in
.return_authenticator
) {
9289 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9291 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
9292 if (r
->in
.logon
== NULL
) {
9293 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9295 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
9296 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
9297 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
9299 if (flags
& NDR_OUT
) {
9300 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
9301 if (r
->out
.return_authenticator
) {
9302 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9304 if (r
->out
.validation
== NULL
) {
9305 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9307 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
9308 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
9309 if (r
->out
.authoritative
== NULL
) {
9310 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9312 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
9313 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9315 return NDR_ERR_SUCCESS
;
9318 static enum ndr_err_code
ndr_pull_netr_LogonSamLogon(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogon
*r
)
9320 uint32_t _ptr_server_name
;
9321 uint32_t _ptr_computer_name
;
9322 uint32_t _ptr_credential
;
9323 uint32_t _ptr_return_authenticator
;
9324 TALLOC_CTX
*_mem_save_server_name_0
;
9325 TALLOC_CTX
*_mem_save_computer_name_0
;
9326 TALLOC_CTX
*_mem_save_credential_0
;
9327 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9328 TALLOC_CTX
*_mem_save_logon_0
;
9329 TALLOC_CTX
*_mem_save_validation_0
;
9330 TALLOC_CTX
*_mem_save_authoritative_0
;
9331 if (flags
& NDR_IN
) {
9332 ZERO_STRUCT(r
->out
);
9334 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9335 if (_ptr_server_name
) {
9336 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9338 r
->in
.server_name
= NULL
;
9340 if (r
->in
.server_name
) {
9341 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9342 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9343 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9344 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9345 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9346 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
));
9348 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9349 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
));
9350 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9352 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
9353 if (_ptr_computer_name
) {
9354 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
9356 r
->in
.computer_name
= NULL
;
9358 if (r
->in
.computer_name
) {
9359 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9360 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
9361 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
9362 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
9363 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
9364 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
));
9366 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
9367 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
));
9368 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
9370 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
9371 if (_ptr_credential
) {
9372 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
9374 r
->in
.credential
= NULL
;
9376 if (r
->in
.credential
) {
9377 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9378 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
9379 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
9380 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
9382 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
9383 if (_ptr_return_authenticator
) {
9384 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9386 r
->in
.return_authenticator
= NULL
;
9388 if (r
->in
.return_authenticator
) {
9389 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9390 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
9391 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9392 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
9394 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
9395 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9396 NDR_PULL_ALLOC(ndr
, r
->in
.logon
);
9398 _mem_save_logon_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9399 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon
, LIBNDR_FLAG_REF_ALLOC
);
9400 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
9401 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
9402 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_0
, LIBNDR_FLAG_REF_ALLOC
);
9403 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
9404 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
9405 ZERO_STRUCTP(r
->out
.validation
);
9406 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
9407 ZERO_STRUCTP(r
->out
.authoritative
);
9409 if (flags
& NDR_OUT
) {
9410 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
9411 if (_ptr_return_authenticator
) {
9412 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9414 r
->out
.return_authenticator
= NULL
;
9416 if (r
->out
.return_authenticator
) {
9417 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9418 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
9419 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9420 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
9422 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9423 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
9425 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9426 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
9427 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
9428 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
9429 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
9430 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9431 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
9433 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9434 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
9435 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
9436 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
9437 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9439 return NDR_ERR_SUCCESS
;
9442 _PUBLIC_
void ndr_print_netr_LogonSamLogon(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogon
*r
)
9444 ndr_print_struct(ndr
, name
, "netr_LogonSamLogon");
9446 if (flags
& NDR_SET_VALUES
) {
9447 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9449 if (flags
& NDR_IN
) {
9450 ndr_print_struct(ndr
, "in", "netr_LogonSamLogon");
9452 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9454 if (r
->in
.server_name
) {
9455 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9458 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
9460 if (r
->in
.computer_name
) {
9461 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
9464 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
9466 if (r
->in
.credential
) {
9467 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
9470 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9472 if (r
->in
.return_authenticator
) {
9473 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9476 ndr_print_netr_LogonInfoClass(ndr
, "logon_level", r
->in
.logon_level
);
9477 ndr_print_ptr(ndr
, "logon", r
->in
.logon
);
9479 ndr_print_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
);
9480 ndr_print_netr_LogonLevel(ndr
, "logon", r
->in
.logon
);
9482 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
9485 if (flags
& NDR_OUT
) {
9486 ndr_print_struct(ndr
, "out", "netr_LogonSamLogon");
9488 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9490 if (r
->out
.return_authenticator
) {
9491 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9494 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
9496 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
9497 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
9499 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
9501 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
9503 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9509 static enum ndr_err_code
ndr_push_netr_LogonSamLogoff(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogoff
*r
)
9511 if (flags
& NDR_IN
) {
9512 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9513 if (r
->in
.server_name
) {
9514 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9515 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9516 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9517 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
));
9519 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
9520 if (r
->in
.computer_name
) {
9521 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9522 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9523 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9524 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
));
9526 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
9527 if (r
->in
.credential
) {
9528 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
9530 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
9531 if (r
->in
.return_authenticator
) {
9532 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9534 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
9535 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
9536 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
9538 if (flags
& NDR_OUT
) {
9539 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
9540 if (r
->out
.return_authenticator
) {
9541 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9543 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9545 return NDR_ERR_SUCCESS
;
9548 static enum ndr_err_code
ndr_pull_netr_LogonSamLogoff(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogoff
*r
)
9550 uint32_t _ptr_server_name
;
9551 uint32_t _ptr_computer_name
;
9552 uint32_t _ptr_credential
;
9553 uint32_t _ptr_return_authenticator
;
9554 TALLOC_CTX
*_mem_save_server_name_0
;
9555 TALLOC_CTX
*_mem_save_computer_name_0
;
9556 TALLOC_CTX
*_mem_save_credential_0
;
9557 TALLOC_CTX
*_mem_save_return_authenticator_0
;
9558 if (flags
& NDR_IN
) {
9559 ZERO_STRUCT(r
->out
);
9561 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9562 if (_ptr_server_name
) {
9563 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9565 r
->in
.server_name
= NULL
;
9567 if (r
->in
.server_name
) {
9568 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9569 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9570 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9571 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9572 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9573 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
));
9575 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9576 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
));
9577 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9579 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
9580 if (_ptr_computer_name
) {
9581 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
9583 r
->in
.computer_name
= NULL
;
9585 if (r
->in
.computer_name
) {
9586 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9587 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
9588 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
9589 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
9590 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
9591 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
));
9593 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
9594 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
));
9595 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
9597 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
9598 if (_ptr_credential
) {
9599 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
9601 r
->in
.credential
= NULL
;
9603 if (r
->in
.credential
) {
9604 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9605 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
9606 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
9607 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
9609 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
9610 if (_ptr_return_authenticator
) {
9611 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
9613 r
->in
.return_authenticator
= NULL
;
9615 if (r
->in
.return_authenticator
) {
9616 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9617 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
9618 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
9619 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
9621 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
9622 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
));
9623 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.logon
));
9625 if (flags
& NDR_OUT
) {
9626 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
9627 if (_ptr_return_authenticator
) {
9628 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
9630 r
->out
.return_authenticator
= NULL
;
9632 if (r
->out
.return_authenticator
) {
9633 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9634 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
9635 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9636 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
9638 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9640 return NDR_ERR_SUCCESS
;
9643 _PUBLIC_
void ndr_print_netr_LogonSamLogoff(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogoff
*r
)
9645 ndr_print_struct(ndr
, name
, "netr_LogonSamLogoff");
9647 if (flags
& NDR_SET_VALUES
) {
9648 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9650 if (flags
& NDR_IN
) {
9651 ndr_print_struct(ndr
, "in", "netr_LogonSamLogoff");
9653 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9655 if (r
->in
.server_name
) {
9656 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9659 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
9661 if (r
->in
.computer_name
) {
9662 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
9665 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
9667 if (r
->in
.credential
) {
9668 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
9671 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9673 if (r
->in
.return_authenticator
) {
9674 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
9677 ndr_print_netr_LogonInfoClass(ndr
, "logon_level", r
->in
.logon_level
);
9678 ndr_print_set_switch_value(ndr
, &r
->in
.logon
, r
->in
.logon_level
);
9679 ndr_print_netr_LogonLevel(ndr
, "logon", &r
->in
.logon
);
9682 if (flags
& NDR_OUT
) {
9683 ndr_print_struct(ndr
, "out", "netr_LogonSamLogoff");
9685 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9687 if (r
->out
.return_authenticator
) {
9688 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
9691 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9697 _PUBLIC_
enum ndr_err_code
ndr_push_netr_ServerReqChallenge(struct ndr_push
*ndr
, int flags
, const struct netr_ServerReqChallenge
*r
)
9699 if (flags
& NDR_IN
) {
9700 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9701 if (r
->in
.server_name
) {
9702 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9703 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9704 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9705 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
));
9707 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9708 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9709 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9710 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
));
9711 if (r
->in
.credentials
== NULL
) {
9712 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9714 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
9716 if (flags
& NDR_OUT
) {
9717 if (r
->out
.return_credentials
== NULL
) {
9718 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9720 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
9721 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9723 return NDR_ERR_SUCCESS
;
9726 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_ServerReqChallenge(struct ndr_pull
*ndr
, int flags
, struct netr_ServerReqChallenge
*r
)
9728 uint32_t _ptr_server_name
;
9729 TALLOC_CTX
*_mem_save_server_name_0
;
9730 TALLOC_CTX
*_mem_save_credentials_0
;
9731 TALLOC_CTX
*_mem_save_return_credentials_0
;
9732 if (flags
& NDR_IN
) {
9733 ZERO_STRUCT(r
->out
);
9735 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9736 if (_ptr_server_name
) {
9737 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9739 r
->in
.server_name
= NULL
;
9741 if (r
->in
.server_name
) {
9742 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9743 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9744 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9745 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9746 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9747 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
));
9749 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9750 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
));
9751 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9753 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
9754 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
9755 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
9756 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
));
9758 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
9759 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
));
9760 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9761 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
9763 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9764 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
9765 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
9766 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
9767 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
9768 ZERO_STRUCTP(r
->out
.return_credentials
);
9770 if (flags
& NDR_OUT
) {
9771 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9772 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
9774 _mem_save_return_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9775 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_credentials
, LIBNDR_FLAG_REF_ALLOC
);
9776 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
9777 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
9778 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9780 return NDR_ERR_SUCCESS
;
9783 _PUBLIC_
void ndr_print_netr_ServerReqChallenge(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerReqChallenge
*r
)
9785 ndr_print_struct(ndr
, name
, "netr_ServerReqChallenge");
9787 if (flags
& NDR_SET_VALUES
) {
9788 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9790 if (flags
& NDR_IN
) {
9791 ndr_print_struct(ndr
, "in", "netr_ServerReqChallenge");
9793 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9795 if (r
->in
.server_name
) {
9796 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9799 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
9800 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
9802 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
9806 if (flags
& NDR_OUT
) {
9807 ndr_print_struct(ndr
, "out", "netr_ServerReqChallenge");
9809 ndr_print_ptr(ndr
, "return_credentials", r
->out
.return_credentials
);
9811 ndr_print_netr_Credential(ndr
, "return_credentials", r
->out
.return_credentials
);
9813 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9819 static enum ndr_err_code
ndr_push_netr_ServerAuthenticate(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate
*r
)
9821 if (flags
& NDR_IN
) {
9822 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9823 if (r
->in
.server_name
) {
9824 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9825 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9826 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9827 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
));
9829 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9830 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9831 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9832 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
));
9833 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
9834 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9835 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9836 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9837 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
));
9838 if (r
->in
.credentials
== NULL
) {
9839 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9841 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
9843 if (flags
& NDR_OUT
) {
9844 if (r
->out
.return_credentials
== NULL
) {
9845 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9847 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
9848 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9850 return NDR_ERR_SUCCESS
;
9853 static enum ndr_err_code
ndr_pull_netr_ServerAuthenticate(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate
*r
)
9855 uint32_t _ptr_server_name
;
9856 TALLOC_CTX
*_mem_save_server_name_0
;
9857 TALLOC_CTX
*_mem_save_credentials_0
;
9858 TALLOC_CTX
*_mem_save_return_credentials_0
;
9859 if (flags
& NDR_IN
) {
9860 ZERO_STRUCT(r
->out
);
9862 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
9863 if (_ptr_server_name
) {
9864 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
9866 r
->in
.server_name
= NULL
;
9868 if (r
->in
.server_name
) {
9869 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9870 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
9871 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
9872 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
9873 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
9874 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
));
9876 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
9877 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
));
9878 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
9880 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
9881 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
9882 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
9883 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
));
9885 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
9886 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
));
9887 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
9888 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
9889 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
9890 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
9891 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
));
9893 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
9894 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
));
9895 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9896 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
9898 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9899 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
9900 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
9901 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
9902 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
9903 ZERO_STRUCTP(r
->out
.return_credentials
);
9905 if (flags
& NDR_OUT
) {
9906 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
9907 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
9909 _mem_save_return_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
9910 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_credentials
, LIBNDR_FLAG_REF_ALLOC
);
9911 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
9912 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
9913 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
9915 return NDR_ERR_SUCCESS
;
9918 _PUBLIC_
void ndr_print_netr_ServerAuthenticate(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate
*r
)
9920 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate");
9922 if (flags
& NDR_SET_VALUES
) {
9923 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
9925 if (flags
& NDR_IN
) {
9926 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate");
9928 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
9930 if (r
->in
.server_name
) {
9931 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
9934 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
9935 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
9936 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
9937 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
9939 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
9943 if (flags
& NDR_OUT
) {
9944 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate");
9946 ndr_print_ptr(ndr
, "return_credentials", r
->out
.return_credentials
);
9948 ndr_print_netr_Credential(ndr
, "return_credentials", r
->out
.return_credentials
);
9950 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
9956 static enum ndr_err_code
ndr_push_netr_ServerPasswordSet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordSet
*r
)
9958 if (flags
& NDR_IN
) {
9959 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
9960 if (r
->in
.server_name
) {
9961 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9962 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9963 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
9964 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
));
9966 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9967 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9968 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
9969 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
));
9970 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
9971 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9972 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
9973 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
9974 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
));
9975 if (r
->in
.credential
== NULL
) {
9976 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9978 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
9979 if (r
->in
.new_password
== NULL
) {
9980 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9982 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->in
.new_password
));
9984 if (flags
& NDR_OUT
) {
9985 if (r
->out
.return_authenticator
== NULL
) {
9986 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
9988 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
9989 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
9991 return NDR_ERR_SUCCESS
;
9994 static enum ndr_err_code
ndr_pull_netr_ServerPasswordSet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordSet
*r
)
9996 uint32_t _ptr_server_name
;
9997 TALLOC_CTX
*_mem_save_server_name_0
;
9998 TALLOC_CTX
*_mem_save_credential_0
;
9999 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10000 TALLOC_CTX
*_mem_save_new_password_0
;
10001 if (flags
& NDR_IN
) {
10002 ZERO_STRUCT(r
->out
);
10004 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
10005 if (_ptr_server_name
) {
10006 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
10008 r
->in
.server_name
= NULL
;
10010 if (r
->in
.server_name
) {
10011 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10012 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
10013 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
10014 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
10015 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
10016 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
));
10018 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
10019 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
));
10020 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
10022 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
10023 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
10024 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
10025 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
));
10027 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
10028 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
));
10029 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
10030 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
10031 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
10032 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_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
.computer_name
), ndr_get_array_length(ndr
, &r
->in
.computer_name
));
10035 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
10036 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
));
10037 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10038 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
10040 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10041 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
10042 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
10043 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
10044 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10045 NDR_PULL_ALLOC(ndr
, r
->in
.new_password
);
10047 _mem_save_new_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10048 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.new_password
, LIBNDR_FLAG_REF_ALLOC
);
10049 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->in
.new_password
));
10050 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_new_password_0
, LIBNDR_FLAG_REF_ALLOC
);
10051 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10052 ZERO_STRUCTP(r
->out
.return_authenticator
);
10054 if (flags
& NDR_OUT
) {
10055 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10056 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10058 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10059 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10060 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10061 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10062 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10064 return NDR_ERR_SUCCESS
;
10067 _PUBLIC_
void ndr_print_netr_ServerPasswordSet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordSet
*r
)
10069 ndr_print_struct(ndr
, name
, "netr_ServerPasswordSet");
10071 if (flags
& NDR_SET_VALUES
) {
10072 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10074 if (flags
& NDR_IN
) {
10075 ndr_print_struct(ndr
, "in", "netr_ServerPasswordSet");
10077 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
10079 if (r
->in
.server_name
) {
10080 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
10083 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
10084 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
10085 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
10086 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
10088 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
10090 ndr_print_ptr(ndr
, "new_password", r
->in
.new_password
);
10092 ndr_print_samr_Password(ndr
, "new_password", r
->in
.new_password
);
10096 if (flags
& NDR_OUT
) {
10097 ndr_print_struct(ndr
, "out", "netr_ServerPasswordSet");
10099 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10101 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10103 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10109 static enum ndr_err_code
ndr_push_netr_DatabaseDeltas(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseDeltas
*r
)
10111 if (flags
& NDR_IN
) {
10112 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10113 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10114 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10115 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
));
10116 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10117 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10118 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10119 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10120 if (r
->in
.credential
== NULL
) {
10121 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10123 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
10124 if (r
->in
.return_authenticator
== NULL
) {
10125 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10127 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10128 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
10129 if (r
->in
.sequence_num
== NULL
) {
10130 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10132 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->in
.sequence_num
));
10133 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
10135 if (flags
& NDR_OUT
) {
10136 if (r
->out
.return_authenticator
== NULL
) {
10137 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10139 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10140 if (r
->out
.sequence_num
== NULL
) {
10141 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10143 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, *r
->out
.sequence_num
));
10144 if (r
->out
.delta_enum_array
== NULL
) {
10145 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10147 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.delta_enum_array
));
10148 if (*r
->out
.delta_enum_array
) {
10149 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
10151 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10153 return NDR_ERR_SUCCESS
;
10156 static enum ndr_err_code
ndr_pull_netr_DatabaseDeltas(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseDeltas
*r
)
10158 uint32_t _ptr_delta_enum_array
;
10159 TALLOC_CTX
*_mem_save_credential_0
;
10160 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10161 TALLOC_CTX
*_mem_save_sequence_num_0
;
10162 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
10163 TALLOC_CTX
*_mem_save_delta_enum_array_1
;
10164 if (flags
& NDR_IN
) {
10165 ZERO_STRUCT(r
->out
);
10167 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10168 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10169 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10170 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
));
10172 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10173 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
));
10174 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10175 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10176 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10177 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
));
10179 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10180 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10181 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10182 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
10184 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10185 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
10186 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
10187 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
10188 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10189 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10191 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10192 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10193 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10194 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10195 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
10196 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10197 NDR_PULL_ALLOC(ndr
, r
->in
.sequence_num
);
10199 _mem_save_sequence_num_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10200 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sequence_num
, LIBNDR_FLAG_REF_ALLOC
);
10201 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->in
.sequence_num
));
10202 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sequence_num_0
, LIBNDR_FLAG_REF_ALLOC
);
10203 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
10204 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10205 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10206 NDR_PULL_ALLOC(ndr
, r
->out
.sequence_num
);
10207 *r
->out
.sequence_num
= *r
->in
.sequence_num
;
10208 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10209 ZERO_STRUCTP(r
->out
.delta_enum_array
);
10211 if (flags
& NDR_OUT
) {
10212 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10213 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10215 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10216 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10217 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10218 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10219 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10220 NDR_PULL_ALLOC(ndr
, r
->out
.sequence_num
);
10222 _mem_save_sequence_num_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10223 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sequence_num
, LIBNDR_FLAG_REF_ALLOC
);
10224 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, r
->out
.sequence_num
));
10225 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sequence_num_0
, LIBNDR_FLAG_REF_ALLOC
);
10226 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10227 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10229 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10230 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
10231 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum_array
));
10232 if (_ptr_delta_enum_array
) {
10233 NDR_PULL_ALLOC(ndr
, *r
->out
.delta_enum_array
);
10235 *r
->out
.delta_enum_array
= NULL
;
10237 if (*r
->out
.delta_enum_array
) {
10238 _mem_save_delta_enum_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
10239 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.delta_enum_array
, 0);
10240 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
10241 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_1
, 0);
10243 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
10244 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10246 return NDR_ERR_SUCCESS
;
10249 _PUBLIC_
void ndr_print_netr_DatabaseDeltas(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseDeltas
*r
)
10251 ndr_print_struct(ndr
, name
, "netr_DatabaseDeltas");
10253 if (flags
& NDR_SET_VALUES
) {
10254 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10256 if (flags
& NDR_IN
) {
10257 ndr_print_struct(ndr
, "in", "netr_DatabaseDeltas");
10259 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10260 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10261 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
10263 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
10265 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10267 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10269 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
10270 ndr_print_ptr(ndr
, "sequence_num", r
->in
.sequence_num
);
10272 ndr_print_udlong(ndr
, "sequence_num", *r
->in
.sequence_num
);
10274 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
10277 if (flags
& NDR_OUT
) {
10278 ndr_print_struct(ndr
, "out", "netr_DatabaseDeltas");
10280 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10282 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10284 ndr_print_ptr(ndr
, "sequence_num", r
->out
.sequence_num
);
10286 ndr_print_udlong(ndr
, "sequence_num", *r
->out
.sequence_num
);
10288 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10290 ndr_print_ptr(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
10292 if (*r
->out
.delta_enum_array
) {
10293 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
10297 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10303 static enum ndr_err_code
ndr_push_netr_DatabaseSync(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseSync
*r
)
10305 if (flags
& NDR_IN
) {
10306 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10307 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10308 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10309 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
));
10310 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10311 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10312 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10313 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10314 if (r
->in
.credential
== NULL
) {
10315 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10317 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
10318 if (r
->in
.return_authenticator
== NULL
) {
10319 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10321 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10322 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
10323 if (r
->in
.sync_context
== NULL
) {
10324 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10326 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.sync_context
));
10327 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
10329 if (flags
& NDR_OUT
) {
10330 if (r
->out
.return_authenticator
== NULL
) {
10331 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10333 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10334 if (r
->out
.sync_context
== NULL
) {
10335 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10337 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.sync_context
));
10338 if (r
->out
.delta_enum_array
== NULL
) {
10339 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10341 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.delta_enum_array
));
10342 if (*r
->out
.delta_enum_array
) {
10343 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
10345 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10347 return NDR_ERR_SUCCESS
;
10350 static enum ndr_err_code
ndr_pull_netr_DatabaseSync(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseSync
*r
)
10352 uint32_t _ptr_delta_enum_array
;
10353 TALLOC_CTX
*_mem_save_credential_0
;
10354 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10355 TALLOC_CTX
*_mem_save_sync_context_0
;
10356 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
10357 TALLOC_CTX
*_mem_save_delta_enum_array_1
;
10358 if (flags
& NDR_IN
) {
10359 ZERO_STRUCT(r
->out
);
10361 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10362 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10363 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10364 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
));
10366 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10367 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
));
10368 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10369 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10370 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10371 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
));
10373 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10374 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10375 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10376 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
10378 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10379 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
10380 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
10381 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
10382 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10383 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10385 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10386 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10387 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10388 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10389 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
10390 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10391 NDR_PULL_ALLOC(ndr
, r
->in
.sync_context
);
10393 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10394 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
10395 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.sync_context
));
10396 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
10397 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
10398 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10399 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10400 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
10401 *r
->out
.sync_context
= *r
->in
.sync_context
;
10402 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10403 ZERO_STRUCTP(r
->out
.delta_enum_array
);
10405 if (flags
& NDR_OUT
) {
10406 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10407 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10409 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10410 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10411 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10412 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10413 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10414 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
10416 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10417 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
10418 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.sync_context
));
10419 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
10420 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10421 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
10423 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10424 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
10425 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum_array
));
10426 if (_ptr_delta_enum_array
) {
10427 NDR_PULL_ALLOC(ndr
, *r
->out
.delta_enum_array
);
10429 *r
->out
.delta_enum_array
= NULL
;
10431 if (*r
->out
.delta_enum_array
) {
10432 _mem_save_delta_enum_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
10433 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.delta_enum_array
, 0);
10434 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
10435 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_1
, 0);
10437 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
10438 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10440 return NDR_ERR_SUCCESS
;
10443 _PUBLIC_
void ndr_print_netr_DatabaseSync(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseSync
*r
)
10445 ndr_print_struct(ndr
, name
, "netr_DatabaseSync");
10447 if (flags
& NDR_SET_VALUES
) {
10448 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10450 if (flags
& NDR_IN
) {
10451 ndr_print_struct(ndr
, "in", "netr_DatabaseSync");
10453 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10454 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10455 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
10457 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
10459 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10461 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10463 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
10464 ndr_print_ptr(ndr
, "sync_context", r
->in
.sync_context
);
10466 ndr_print_uint32(ndr
, "sync_context", *r
->in
.sync_context
);
10468 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
10471 if (flags
& NDR_OUT
) {
10472 ndr_print_struct(ndr
, "out", "netr_DatabaseSync");
10474 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10476 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10478 ndr_print_ptr(ndr
, "sync_context", r
->out
.sync_context
);
10480 ndr_print_uint32(ndr
, "sync_context", *r
->out
.sync_context
);
10482 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
10484 ndr_print_ptr(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
10486 if (*r
->out
.delta_enum_array
) {
10487 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
10491 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10497 static enum ndr_err_code
ndr_push_netr_AccountDeltas(struct ndr_push
*ndr
, int flags
, const struct netr_AccountDeltas
*r
)
10499 if (flags
& NDR_IN
) {
10500 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
10501 if (r
->in
.logon_server
) {
10502 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10503 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10504 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10505 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
));
10507 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10508 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10509 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10510 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10511 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10512 if (r
->in
.return_authenticator
== NULL
) {
10513 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10515 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10516 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, &r
->in
.uas
));
10517 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
10518 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
10519 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.buffersize
));
10521 if (flags
& NDR_OUT
) {
10522 if (r
->out
.return_authenticator
== NULL
) {
10523 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10525 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10526 if (r
->out
.buffer
== NULL
) {
10527 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10530 struct ndr_push
*_ndr_buffer
;
10531 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
10532 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
10533 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
10535 if (r
->out
.count_returned
== NULL
) {
10536 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10538 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.count_returned
));
10539 if (r
->out
.total_entries
== NULL
) {
10540 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10542 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.total_entries
));
10543 if (r
->out
.recordid
== NULL
) {
10544 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10546 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
10547 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10549 return NDR_ERR_SUCCESS
;
10552 static enum ndr_err_code
ndr_pull_netr_AccountDeltas(struct ndr_pull
*ndr
, int flags
, struct netr_AccountDeltas
*r
)
10554 uint32_t _ptr_logon_server
;
10555 TALLOC_CTX
*_mem_save_logon_server_0
;
10556 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10557 TALLOC_CTX
*_mem_save_buffer_0
;
10558 TALLOC_CTX
*_mem_save_count_returned_0
;
10559 TALLOC_CTX
*_mem_save_total_entries_0
;
10560 TALLOC_CTX
*_mem_save_recordid_0
;
10561 if (flags
& NDR_IN
) {
10562 ZERO_STRUCT(r
->out
);
10564 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
10565 if (_ptr_logon_server
) {
10566 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
10568 r
->in
.logon_server
= NULL
;
10570 if (r
->in
.logon_server
) {
10571 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10572 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
10573 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10574 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10575 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10576 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
));
10578 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10579 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
));
10580 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
10582 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10583 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10584 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10585 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
));
10587 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10588 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10589 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10590 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10591 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10593 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10594 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10595 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10596 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10597 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, &r
->in
.uas
));
10598 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
10599 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
10600 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.buffersize
));
10601 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10602 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10603 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
10604 ZERO_STRUCTP(r
->out
.buffer
);
10605 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
10606 ZERO_STRUCTP(r
->out
.count_returned
);
10607 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
10608 ZERO_STRUCTP(r
->out
.total_entries
);
10609 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
10610 ZERO_STRUCTP(r
->out
.recordid
);
10612 if (flags
& NDR_OUT
) {
10613 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10614 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10616 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10617 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10618 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10619 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10620 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10621 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
10623 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10624 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.buffer
, LIBNDR_FLAG_REF_ALLOC
);
10626 struct ndr_pull
*_ndr_buffer
;
10627 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
10628 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
10629 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
10631 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, LIBNDR_FLAG_REF_ALLOC
);
10632 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10633 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
10635 _mem_save_count_returned_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10636 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.count_returned
, LIBNDR_FLAG_REF_ALLOC
);
10637 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.count_returned
));
10638 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_count_returned_0
, LIBNDR_FLAG_REF_ALLOC
);
10639 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10640 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
10642 _mem_save_total_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10643 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.total_entries
, LIBNDR_FLAG_REF_ALLOC
);
10644 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.total_entries
));
10645 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_total_entries_0
, LIBNDR_FLAG_REF_ALLOC
);
10646 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10647 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
10649 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10650 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
10651 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
10652 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
10653 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10655 return NDR_ERR_SUCCESS
;
10658 _PUBLIC_
void ndr_print_netr_AccountDeltas(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_AccountDeltas
*r
)
10660 ndr_print_struct(ndr
, name
, "netr_AccountDeltas");
10662 if (flags
& NDR_SET_VALUES
) {
10663 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10665 if (flags
& NDR_IN
) {
10666 ndr_print_struct(ndr
, "in", "netr_AccountDeltas");
10668 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
10670 if (r
->in
.logon_server
) {
10671 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10674 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10675 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
10676 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10678 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10680 ndr_print_netr_UAS_INFO_0(ndr
, "uas", &r
->in
.uas
);
10681 ndr_print_uint32(ndr
, "count", r
->in
.count
);
10682 ndr_print_uint32(ndr
, "level", r
->in
.level
);
10683 ndr_print_uint32(ndr
, "buffersize", r
->in
.buffersize
);
10686 if (flags
& NDR_OUT
) {
10687 ndr_print_struct(ndr
, "out", "netr_AccountDeltas");
10689 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10691 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10693 ndr_print_ptr(ndr
, "buffer", r
->out
.buffer
);
10695 ndr_print_netr_AccountBuffer(ndr
, "buffer", r
->out
.buffer
);
10697 ndr_print_ptr(ndr
, "count_returned", r
->out
.count_returned
);
10699 ndr_print_uint32(ndr
, "count_returned", *r
->out
.count_returned
);
10701 ndr_print_ptr(ndr
, "total_entries", r
->out
.total_entries
);
10703 ndr_print_uint32(ndr
, "total_entries", *r
->out
.total_entries
);
10705 ndr_print_ptr(ndr
, "recordid", r
->out
.recordid
);
10707 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->out
.recordid
);
10709 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10715 static enum ndr_err_code
ndr_push_netr_AccountSync(struct ndr_push
*ndr
, int flags
, const struct netr_AccountSync
*r
)
10717 if (flags
& NDR_IN
) {
10718 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
10719 if (r
->in
.logon_server
) {
10720 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10721 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10722 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10723 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
));
10725 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10726 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10727 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
10728 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10729 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10730 if (r
->in
.return_authenticator
== NULL
) {
10731 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10733 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10734 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.reference
));
10735 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
10736 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.buffersize
));
10737 if (r
->in
.recordid
== NULL
) {
10738 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10740 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->in
.recordid
));
10742 if (flags
& NDR_OUT
) {
10743 if (r
->out
.return_authenticator
== NULL
) {
10744 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10746 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10747 if (r
->out
.buffer
== NULL
) {
10748 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10751 struct ndr_push
*_ndr_buffer
;
10752 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
10753 NDR_CHECK(ndr_push_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
10754 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
10756 if (r
->out
.count_returned
== NULL
) {
10757 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10759 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.count_returned
));
10760 if (r
->out
.total_entries
== NULL
) {
10761 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10763 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.total_entries
));
10764 if (r
->out
.next_reference
== NULL
) {
10765 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10767 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.next_reference
));
10768 if (r
->out
.recordid
== NULL
) {
10769 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10771 NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
10772 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
10774 return NDR_ERR_SUCCESS
;
10777 static enum ndr_err_code
ndr_pull_netr_AccountSync(struct ndr_pull
*ndr
, int flags
, struct netr_AccountSync
*r
)
10779 uint32_t _ptr_logon_server
;
10780 TALLOC_CTX
*_mem_save_logon_server_0
;
10781 TALLOC_CTX
*_mem_save_return_authenticator_0
;
10782 TALLOC_CTX
*_mem_save_buffer_0
;
10783 TALLOC_CTX
*_mem_save_count_returned_0
;
10784 TALLOC_CTX
*_mem_save_total_entries_0
;
10785 TALLOC_CTX
*_mem_save_next_reference_0
;
10786 TALLOC_CTX
*_mem_save_recordid_0
;
10787 if (flags
& NDR_IN
) {
10788 ZERO_STRUCT(r
->out
);
10790 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
10791 if (_ptr_logon_server
) {
10792 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
10794 r
->in
.logon_server
= NULL
;
10796 if (r
->in
.logon_server
) {
10797 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10798 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
10799 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
10800 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
10801 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
10802 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
));
10804 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
10805 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
));
10806 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
10808 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
10809 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
10810 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
10811 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
));
10813 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
10814 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
10815 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, &r
->in
.credential
));
10816 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10817 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
10819 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10820 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10821 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
10822 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10823 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.reference
));
10824 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
10825 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.buffersize
));
10826 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10827 NDR_PULL_ALLOC(ndr
, r
->in
.recordid
);
10829 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10830 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
10831 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->in
.recordid
));
10832 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
10833 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10834 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
10835 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
10836 ZERO_STRUCTP(r
->out
.buffer
);
10837 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
10838 ZERO_STRUCTP(r
->out
.count_returned
);
10839 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
10840 ZERO_STRUCTP(r
->out
.total_entries
);
10841 NDR_PULL_ALLOC(ndr
, r
->out
.next_reference
);
10842 ZERO_STRUCTP(r
->out
.next_reference
);
10843 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
10844 *r
->out
.recordid
= *r
->in
.recordid
;
10846 if (flags
& NDR_OUT
) {
10847 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10848 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
10850 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10851 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
10852 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
10853 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
10854 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10855 NDR_PULL_ALLOC(ndr
, r
->out
.buffer
);
10857 _mem_save_buffer_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10858 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.buffer
, LIBNDR_FLAG_REF_ALLOC
);
10860 struct ndr_pull
*_ndr_buffer
;
10861 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_buffer
, 4, -1));
10862 NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer
, NDR_SCALARS
, r
->out
.buffer
));
10863 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_buffer
, 4, -1));
10865 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_buffer_0
, LIBNDR_FLAG_REF_ALLOC
);
10866 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10867 NDR_PULL_ALLOC(ndr
, r
->out
.count_returned
);
10869 _mem_save_count_returned_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10870 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.count_returned
, LIBNDR_FLAG_REF_ALLOC
);
10871 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.count_returned
));
10872 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_count_returned_0
, LIBNDR_FLAG_REF_ALLOC
);
10873 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10874 NDR_PULL_ALLOC(ndr
, r
->out
.total_entries
);
10876 _mem_save_total_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10877 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.total_entries
, LIBNDR_FLAG_REF_ALLOC
);
10878 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.total_entries
));
10879 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_total_entries_0
, LIBNDR_FLAG_REF_ALLOC
);
10880 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10881 NDR_PULL_ALLOC(ndr
, r
->out
.next_reference
);
10883 _mem_save_next_reference_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10884 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.next_reference
, LIBNDR_FLAG_REF_ALLOC
);
10885 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.next_reference
));
10886 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_next_reference_0
, LIBNDR_FLAG_REF_ALLOC
);
10887 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
10888 NDR_PULL_ALLOC(ndr
, r
->out
.recordid
);
10890 _mem_save_recordid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
10891 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.recordid
, LIBNDR_FLAG_REF_ALLOC
);
10892 NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr
, NDR_SCALARS
, r
->out
.recordid
));
10893 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_recordid_0
, LIBNDR_FLAG_REF_ALLOC
);
10894 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
10896 return NDR_ERR_SUCCESS
;
10899 _PUBLIC_
void ndr_print_netr_AccountSync(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_AccountSync
*r
)
10901 ndr_print_struct(ndr
, name
, "netr_AccountSync");
10903 if (flags
& NDR_SET_VALUES
) {
10904 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
10906 if (flags
& NDR_IN
) {
10907 ndr_print_struct(ndr
, "in", "netr_AccountSync");
10909 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
10911 if (r
->in
.logon_server
) {
10912 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
10915 ndr_print_string(ndr
, "computername", r
->in
.computername
);
10916 ndr_print_netr_Authenticator(ndr
, "credential", &r
->in
.credential
);
10917 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10919 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
10921 ndr_print_uint32(ndr
, "reference", r
->in
.reference
);
10922 ndr_print_uint32(ndr
, "level", r
->in
.level
);
10923 ndr_print_uint32(ndr
, "buffersize", r
->in
.buffersize
);
10924 ndr_print_ptr(ndr
, "recordid", r
->in
.recordid
);
10926 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->in
.recordid
);
10930 if (flags
& NDR_OUT
) {
10931 ndr_print_struct(ndr
, "out", "netr_AccountSync");
10933 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10935 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
10937 ndr_print_ptr(ndr
, "buffer", r
->out
.buffer
);
10939 ndr_print_netr_AccountBuffer(ndr
, "buffer", r
->out
.buffer
);
10941 ndr_print_ptr(ndr
, "count_returned", r
->out
.count_returned
);
10943 ndr_print_uint32(ndr
, "count_returned", *r
->out
.count_returned
);
10945 ndr_print_ptr(ndr
, "total_entries", r
->out
.total_entries
);
10947 ndr_print_uint32(ndr
, "total_entries", *r
->out
.total_entries
);
10949 ndr_print_ptr(ndr
, "next_reference", r
->out
.next_reference
);
10951 ndr_print_uint32(ndr
, "next_reference", *r
->out
.next_reference
);
10953 ndr_print_ptr(ndr
, "recordid", r
->out
.recordid
);
10955 ndr_print_netr_UAS_INFO_0(ndr
, "recordid", r
->out
.recordid
);
10957 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
10963 static enum ndr_err_code
ndr_push_netr_GetDcName(struct ndr_push
*ndr
, int flags
, const struct netr_GetDcName
*r
)
10965 if (flags
& NDR_IN
) {
10966 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10967 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10968 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
10969 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
));
10970 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domainname
));
10971 if (r
->in
.domainname
) {
10972 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
10973 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10974 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
10975 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domainname
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10978 if (flags
& NDR_OUT
) {
10979 if (r
->out
.dcname
== NULL
) {
10980 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
10982 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.dcname
));
10983 if (*r
->out
.dcname
) {
10984 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
10985 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
10986 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
10987 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.dcname
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
10989 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
10991 return NDR_ERR_SUCCESS
;
10994 static enum ndr_err_code
ndr_pull_netr_GetDcName(struct ndr_pull
*ndr
, int flags
, struct netr_GetDcName
*r
)
10996 uint32_t _ptr_domainname
;
10997 uint32_t _ptr_dcname
;
10998 TALLOC_CTX
*_mem_save_domainname_0
;
10999 TALLOC_CTX
*_mem_save_dcname_0
;
11000 TALLOC_CTX
*_mem_save_dcname_1
;
11001 if (flags
& NDR_IN
) {
11002 ZERO_STRUCT(r
->out
);
11004 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11005 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11006 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11007 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
));
11009 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11010 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
));
11011 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domainname
));
11012 if (_ptr_domainname
) {
11013 NDR_PULL_ALLOC(ndr
, r
->in
.domainname
);
11015 r
->in
.domainname
= NULL
;
11017 if (r
->in
.domainname
) {
11018 _mem_save_domainname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11019 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domainname
, 0);
11020 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domainname
));
11021 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domainname
));
11022 if (ndr_get_array_length(ndr
, &r
->in
.domainname
) > ndr_get_array_size(ndr
, &r
->in
.domainname
)) {
11023 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
));
11025 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t)));
11026 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domainname
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t), CH_UTF16
));
11027 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domainname_0
, 0);
11029 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
11030 ZERO_STRUCTP(r
->out
.dcname
);
11032 if (flags
& NDR_OUT
) {
11033 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11034 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
11036 _mem_save_dcname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11037 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dcname
, LIBNDR_FLAG_REF_ALLOC
);
11038 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dcname
));
11040 NDR_PULL_ALLOC(ndr
, *r
->out
.dcname
);
11042 *r
->out
.dcname
= NULL
;
11044 if (*r
->out
.dcname
) {
11045 _mem_save_dcname_1
= NDR_PULL_GET_MEM_CTX(ndr
);
11046 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.dcname
, 0);
11047 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.dcname
));
11048 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.dcname
));
11049 if (ndr_get_array_length(ndr
, r
->out
.dcname
) > ndr_get_array_size(ndr
, r
->out
.dcname
)) {
11050 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
));
11052 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t)));
11053 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.dcname
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t), CH_UTF16
));
11054 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_1
, 0);
11056 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_0
, LIBNDR_FLAG_REF_ALLOC
);
11057 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11059 return NDR_ERR_SUCCESS
;
11062 _PUBLIC_
void ndr_print_netr_GetDcName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetDcName
*r
)
11064 ndr_print_struct(ndr
, name
, "netr_GetDcName");
11066 if (flags
& NDR_SET_VALUES
) {
11067 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11069 if (flags
& NDR_IN
) {
11070 ndr_print_struct(ndr
, "in", "netr_GetDcName");
11072 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11073 ndr_print_ptr(ndr
, "domainname", r
->in
.domainname
);
11075 if (r
->in
.domainname
) {
11076 ndr_print_string(ndr
, "domainname", r
->in
.domainname
);
11081 if (flags
& NDR_OUT
) {
11082 ndr_print_struct(ndr
, "out", "netr_GetDcName");
11084 ndr_print_ptr(ndr
, "dcname", r
->out
.dcname
);
11086 ndr_print_ptr(ndr
, "dcname", *r
->out
.dcname
);
11088 if (*r
->out
.dcname
) {
11089 ndr_print_string(ndr
, "dcname", *r
->out
.dcname
);
11093 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11099 static enum ndr_err_code
ndr_push_netr_LogonControl(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl
*r
)
11101 if (flags
& NDR_IN
) {
11102 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
11103 if (r
->in
.logon_server
) {
11104 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11105 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11106 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11107 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
));
11109 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr
, NDR_SCALARS
, r
->in
.function_code
));
11110 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
11112 if (flags
& NDR_OUT
) {
11113 if (r
->out
.info
== NULL
) {
11114 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11116 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
11117 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11118 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11120 return NDR_ERR_SUCCESS
;
11123 static enum ndr_err_code
ndr_pull_netr_LogonControl(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl
*r
)
11125 uint32_t _ptr_logon_server
;
11126 TALLOC_CTX
*_mem_save_logon_server_0
;
11127 TALLOC_CTX
*_mem_save_info_0
;
11128 if (flags
& NDR_IN
) {
11129 ZERO_STRUCT(r
->out
);
11131 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
11132 if (_ptr_logon_server
) {
11133 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
11135 r
->in
.logon_server
= NULL
;
11137 if (r
->in
.logon_server
) {
11138 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11139 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
11140 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11141 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11142 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11143 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
));
11145 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11146 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
));
11147 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
11149 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
11150 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
11151 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11152 ZERO_STRUCTP(r
->out
.info
);
11154 if (flags
& NDR_OUT
) {
11155 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11156 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
11158 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11159 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
11160 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
11161 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
11162 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
11163 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11165 return NDR_ERR_SUCCESS
;
11168 _PUBLIC_
void ndr_print_netr_LogonControl(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl
*r
)
11170 ndr_print_struct(ndr
, name
, "netr_LogonControl");
11172 if (flags
& NDR_SET_VALUES
) {
11173 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11175 if (flags
& NDR_IN
) {
11176 ndr_print_struct(ndr
, "in", "netr_LogonControl");
11178 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
11180 if (r
->in
.logon_server
) {
11181 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11184 ndr_print_netr_LogonControlCode(ndr
, "function_code", r
->in
.function_code
);
11185 ndr_print_uint32(ndr
, "level", r
->in
.level
);
11188 if (flags
& NDR_OUT
) {
11189 ndr_print_struct(ndr
, "out", "netr_LogonControl");
11191 ndr_print_ptr(ndr
, "info", r
->out
.info
);
11193 ndr_print_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
);
11194 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "info", r
->out
.info
);
11196 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11202 static enum ndr_err_code
ndr_push_netr_GetAnyDCName(struct ndr_push
*ndr
, int flags
, const struct netr_GetAnyDCName
*r
)
11204 if (flags
& NDR_IN
) {
11205 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
11206 if (r
->in
.logon_server
) {
11207 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11208 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11209 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11210 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
));
11212 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domainname
));
11213 if (r
->in
.domainname
) {
11214 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
11215 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11216 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
)));
11217 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domainname
, ndr_charset_length(r
->in
.domainname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11220 if (flags
& NDR_OUT
) {
11221 if (r
->out
.dcname
== NULL
) {
11222 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11224 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.dcname
));
11225 if (*r
->out
.dcname
) {
11226 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
11227 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11228 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
)));
11229 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.dcname
, ndr_charset_length(*r
->out
.dcname
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11231 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11233 return NDR_ERR_SUCCESS
;
11236 static enum ndr_err_code
ndr_pull_netr_GetAnyDCName(struct ndr_pull
*ndr
, int flags
, struct netr_GetAnyDCName
*r
)
11238 uint32_t _ptr_logon_server
;
11239 uint32_t _ptr_domainname
;
11240 uint32_t _ptr_dcname
;
11241 TALLOC_CTX
*_mem_save_logon_server_0
;
11242 TALLOC_CTX
*_mem_save_domainname_0
;
11243 TALLOC_CTX
*_mem_save_dcname_0
;
11244 TALLOC_CTX
*_mem_save_dcname_1
;
11245 if (flags
& NDR_IN
) {
11246 ZERO_STRUCT(r
->out
);
11248 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
11249 if (_ptr_logon_server
) {
11250 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
11252 r
->in
.logon_server
= NULL
;
11254 if (r
->in
.logon_server
) {
11255 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11256 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
11257 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11258 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11259 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11260 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
));
11262 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11263 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
));
11264 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
11266 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domainname
));
11267 if (_ptr_domainname
) {
11268 NDR_PULL_ALLOC(ndr
, r
->in
.domainname
);
11270 r
->in
.domainname
= NULL
;
11272 if (r
->in
.domainname
) {
11273 _mem_save_domainname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11274 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domainname
, 0);
11275 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domainname
));
11276 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domainname
));
11277 if (ndr_get_array_length(ndr
, &r
->in
.domainname
) > ndr_get_array_size(ndr
, &r
->in
.domainname
)) {
11278 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
));
11280 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t)));
11281 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domainname
, ndr_get_array_length(ndr
, &r
->in
.domainname
), sizeof(uint16_t), CH_UTF16
));
11282 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domainname_0
, 0);
11284 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
11285 ZERO_STRUCTP(r
->out
.dcname
);
11287 if (flags
& NDR_OUT
) {
11288 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11289 NDR_PULL_ALLOC(ndr
, r
->out
.dcname
);
11291 _mem_save_dcname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11292 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dcname
, LIBNDR_FLAG_REF_ALLOC
);
11293 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dcname
));
11295 NDR_PULL_ALLOC(ndr
, *r
->out
.dcname
);
11297 *r
->out
.dcname
= NULL
;
11299 if (*r
->out
.dcname
) {
11300 _mem_save_dcname_1
= NDR_PULL_GET_MEM_CTX(ndr
);
11301 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.dcname
, 0);
11302 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.dcname
));
11303 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.dcname
));
11304 if (ndr_get_array_length(ndr
, r
->out
.dcname
) > ndr_get_array_size(ndr
, r
->out
.dcname
)) {
11305 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
));
11307 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t)));
11308 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.dcname
, ndr_get_array_length(ndr
, r
->out
.dcname
), sizeof(uint16_t), CH_UTF16
));
11309 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_1
, 0);
11311 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dcname_0
, LIBNDR_FLAG_REF_ALLOC
);
11312 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11314 return NDR_ERR_SUCCESS
;
11317 _PUBLIC_
void ndr_print_netr_GetAnyDCName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetAnyDCName
*r
)
11319 ndr_print_struct(ndr
, name
, "netr_GetAnyDCName");
11321 if (flags
& NDR_SET_VALUES
) {
11322 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11324 if (flags
& NDR_IN
) {
11325 ndr_print_struct(ndr
, "in", "netr_GetAnyDCName");
11327 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
11329 if (r
->in
.logon_server
) {
11330 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11333 ndr_print_ptr(ndr
, "domainname", r
->in
.domainname
);
11335 if (r
->in
.domainname
) {
11336 ndr_print_string(ndr
, "domainname", r
->in
.domainname
);
11341 if (flags
& NDR_OUT
) {
11342 ndr_print_struct(ndr
, "out", "netr_GetAnyDCName");
11344 ndr_print_ptr(ndr
, "dcname", r
->out
.dcname
);
11346 ndr_print_ptr(ndr
, "dcname", *r
->out
.dcname
);
11348 if (*r
->out
.dcname
) {
11349 ndr_print_string(ndr
, "dcname", *r
->out
.dcname
);
11353 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11359 static enum ndr_err_code
ndr_push_netr_LogonControl2(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl2
*r
)
11361 if (flags
& NDR_IN
) {
11362 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
11363 if (r
->in
.logon_server
) {
11364 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11365 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11366 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11367 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
));
11369 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr
, NDR_SCALARS
, r
->in
.function_code
));
11370 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
11371 if (r
->in
.data
== NULL
) {
11372 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11374 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
));
11375 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.data
));
11377 if (flags
& NDR_OUT
) {
11378 if (r
->out
.query
== NULL
) {
11379 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11381 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
11382 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
11383 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
11385 return NDR_ERR_SUCCESS
;
11388 static enum ndr_err_code
ndr_pull_netr_LogonControl2(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl2
*r
)
11390 uint32_t _ptr_logon_server
;
11391 TALLOC_CTX
*_mem_save_logon_server_0
;
11392 TALLOC_CTX
*_mem_save_data_0
;
11393 TALLOC_CTX
*_mem_save_query_0
;
11394 if (flags
& NDR_IN
) {
11395 ZERO_STRUCT(r
->out
);
11397 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
11398 if (_ptr_logon_server
) {
11399 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
11401 r
->in
.logon_server
= NULL
;
11403 if (r
->in
.logon_server
) {
11404 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11405 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
11406 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11407 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11408 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11409 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
));
11411 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11412 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
));
11413 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
11415 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
11416 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
11417 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11418 NDR_PULL_ALLOC(ndr
, r
->in
.data
);
11420 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11421 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.data
, LIBNDR_FLAG_REF_ALLOC
);
11422 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
));
11423 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.data
));
11424 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, LIBNDR_FLAG_REF_ALLOC
);
11425 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
11426 ZERO_STRUCTP(r
->out
.query
);
11428 if (flags
& NDR_OUT
) {
11429 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11430 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
11432 _mem_save_query_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11433 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.query
, LIBNDR_FLAG_REF_ALLOC
);
11434 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
11435 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
11436 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query_0
, LIBNDR_FLAG_REF_ALLOC
);
11437 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
11439 return NDR_ERR_SUCCESS
;
11442 _PUBLIC_
void ndr_print_netr_LogonControl2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl2
*r
)
11444 ndr_print_struct(ndr
, name
, "netr_LogonControl2");
11446 if (flags
& NDR_SET_VALUES
) {
11447 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11449 if (flags
& NDR_IN
) {
11450 ndr_print_struct(ndr
, "in", "netr_LogonControl2");
11452 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
11454 if (r
->in
.logon_server
) {
11455 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11458 ndr_print_netr_LogonControlCode(ndr
, "function_code", r
->in
.function_code
);
11459 ndr_print_uint32(ndr
, "level", r
->in
.level
);
11460 ndr_print_ptr(ndr
, "data", r
->in
.data
);
11462 ndr_print_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
);
11463 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr
, "data", r
->in
.data
);
11467 if (flags
& NDR_OUT
) {
11468 ndr_print_struct(ndr
, "out", "netr_LogonControl2");
11470 ndr_print_ptr(ndr
, "query", r
->out
.query
);
11472 ndr_print_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
);
11473 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "query", r
->out
.query
);
11475 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
11481 static enum ndr_err_code
ndr_push_netr_ServerAuthenticate2(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate2
*r
)
11483 if (flags
& NDR_IN
) {
11484 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
11485 if (r
->in
.server_name
) {
11486 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11487 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11488 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
11489 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
));
11491 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11492 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11493 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
11494 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
));
11495 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
11496 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11497 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11498 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
11499 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
));
11500 if (r
->in
.credentials
== NULL
) {
11501 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11503 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
11504 if (r
->in
.negotiate_flags
== NULL
) {
11505 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11507 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, *r
->in
.negotiate_flags
));
11509 if (flags
& NDR_OUT
) {
11510 if (r
->out
.return_credentials
== NULL
) {
11511 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11513 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
11514 if (r
->out
.negotiate_flags
== NULL
) {
11515 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11517 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, *r
->out
.negotiate_flags
));
11518 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11520 return NDR_ERR_SUCCESS
;
11523 static enum ndr_err_code
ndr_pull_netr_ServerAuthenticate2(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate2
*r
)
11525 uint32_t _ptr_server_name
;
11526 TALLOC_CTX
*_mem_save_server_name_0
;
11527 TALLOC_CTX
*_mem_save_credentials_0
;
11528 TALLOC_CTX
*_mem_save_return_credentials_0
;
11529 TALLOC_CTX
*_mem_save_negotiate_flags_0
;
11530 if (flags
& NDR_IN
) {
11531 ZERO_STRUCT(r
->out
);
11533 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
11534 if (_ptr_server_name
) {
11535 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
11537 r
->in
.server_name
= NULL
;
11539 if (r
->in
.server_name
) {
11540 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11541 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
11542 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
11543 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
11544 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
11545 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
));
11547 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
11548 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
));
11549 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
11551 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
11552 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
11553 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
11554 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
));
11556 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
11557 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
));
11558 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
11559 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
11560 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
11561 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
11562 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
));
11564 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
11565 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
));
11566 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11567 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
11569 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11570 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
11571 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
11572 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
11573 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11574 NDR_PULL_ALLOC(ndr
, r
->in
.negotiate_flags
);
11576 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11577 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
11578 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->in
.negotiate_flags
));
11579 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
11580 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
11581 ZERO_STRUCTP(r
->out
.return_credentials
);
11582 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
11583 *r
->out
.negotiate_flags
= *r
->in
.negotiate_flags
;
11585 if (flags
& NDR_OUT
) {
11586 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11587 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
11589 _mem_save_return_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11590 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_credentials
, LIBNDR_FLAG_REF_ALLOC
);
11591 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
11592 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
11593 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11594 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
11596 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11597 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
11598 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->out
.negotiate_flags
));
11599 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
11600 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
11602 return NDR_ERR_SUCCESS
;
11605 _PUBLIC_
void ndr_print_netr_ServerAuthenticate2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate2
*r
)
11607 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate2");
11609 if (flags
& NDR_SET_VALUES
) {
11610 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11612 if (flags
& NDR_IN
) {
11613 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate2");
11615 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
11617 if (r
->in
.server_name
) {
11618 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
11621 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
11622 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
11623 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
11624 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
11626 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
11628 ndr_print_ptr(ndr
, "negotiate_flags", r
->in
.negotiate_flags
);
11630 ndr_print_netr_NegotiateFlags(ndr
, "negotiate_flags", *r
->in
.negotiate_flags
);
11634 if (flags
& NDR_OUT
) {
11635 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate2");
11637 ndr_print_ptr(ndr
, "return_credentials", r
->out
.return_credentials
);
11639 ndr_print_netr_Credential(ndr
, "return_credentials", r
->out
.return_credentials
);
11641 ndr_print_ptr(ndr
, "negotiate_flags", r
->out
.negotiate_flags
);
11643 ndr_print_netr_NegotiateFlags(ndr
, "negotiate_flags", *r
->out
.negotiate_flags
);
11645 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
11651 static enum ndr_err_code
ndr_push_netr_DatabaseSync2(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseSync2
*r
)
11653 if (flags
& NDR_IN
) {
11654 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11655 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11656 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11657 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
));
11658 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
11659 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11660 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
11661 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11662 if (r
->in
.credential
== NULL
) {
11663 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11665 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11666 if (r
->in
.return_authenticator
== NULL
) {
11667 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11669 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11670 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr
, NDR_SCALARS
, r
->in
.database_id
));
11671 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.restart_state
));
11672 if (r
->in
.sync_context
== NULL
) {
11673 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11675 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.sync_context
));
11676 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.preferredmaximumlength
));
11678 if (flags
& NDR_OUT
) {
11679 if (r
->out
.return_authenticator
== NULL
) {
11680 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11682 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11683 if (r
->out
.sync_context
== NULL
) {
11684 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11686 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.sync_context
));
11687 if (r
->out
.delta_enum_array
== NULL
) {
11688 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11690 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.delta_enum_array
));
11691 if (*r
->out
.delta_enum_array
) {
11692 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
11694 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11696 return NDR_ERR_SUCCESS
;
11699 static enum ndr_err_code
ndr_pull_netr_DatabaseSync2(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseSync2
*r
)
11701 uint32_t _ptr_delta_enum_array
;
11702 TALLOC_CTX
*_mem_save_credential_0
;
11703 TALLOC_CTX
*_mem_save_return_authenticator_0
;
11704 TALLOC_CTX
*_mem_save_sync_context_0
;
11705 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
11706 TALLOC_CTX
*_mem_save_delta_enum_array_1
;
11707 if (flags
& NDR_IN
) {
11708 ZERO_STRUCT(r
->out
);
11710 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11711 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11712 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11713 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
));
11715 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11716 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
));
11717 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
11718 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
11719 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
11720 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
));
11722 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
11723 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
11724 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11725 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
11727 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11728 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
11729 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11730 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
11731 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11732 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
11734 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11735 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11736 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11737 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11738 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr
, NDR_SCALARS
, &r
->in
.database_id
));
11739 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.restart_state
));
11740 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11741 NDR_PULL_ALLOC(ndr
, r
->in
.sync_context
);
11743 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11744 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
11745 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.sync_context
));
11746 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
11747 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.preferredmaximumlength
));
11748 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11749 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
11750 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
11751 *r
->out
.sync_context
= *r
->in
.sync_context
;
11752 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
11753 ZERO_STRUCTP(r
->out
.delta_enum_array
);
11755 if (flags
& NDR_OUT
) {
11756 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11757 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11759 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11760 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11761 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11762 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11763 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11764 NDR_PULL_ALLOC(ndr
, r
->out
.sync_context
);
11766 _mem_save_sync_context_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11767 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.sync_context
, LIBNDR_FLAG_REF_ALLOC
);
11768 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.sync_context
));
11769 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sync_context_0
, LIBNDR_FLAG_REF_ALLOC
);
11770 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11771 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
11773 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11774 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
11775 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum_array
));
11776 if (_ptr_delta_enum_array
) {
11777 NDR_PULL_ALLOC(ndr
, *r
->out
.delta_enum_array
);
11779 *r
->out
.delta_enum_array
= NULL
;
11781 if (*r
->out
.delta_enum_array
) {
11782 _mem_save_delta_enum_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
11783 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.delta_enum_array
, 0);
11784 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
11785 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_1
, 0);
11787 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
11788 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
11790 return NDR_ERR_SUCCESS
;
11793 _PUBLIC_
void ndr_print_netr_DatabaseSync2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseSync2
*r
)
11795 ndr_print_struct(ndr
, name
, "netr_DatabaseSync2");
11797 if (flags
& NDR_SET_VALUES
) {
11798 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11800 if (flags
& NDR_IN
) {
11801 ndr_print_struct(ndr
, "in", "netr_DatabaseSync2");
11803 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11804 ndr_print_string(ndr
, "computername", r
->in
.computername
);
11805 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
11807 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
11809 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11811 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11813 ndr_print_netr_SamDatabaseID(ndr
, "database_id", r
->in
.database_id
);
11814 ndr_print_uint16(ndr
, "restart_state", r
->in
.restart_state
);
11815 ndr_print_ptr(ndr
, "sync_context", r
->in
.sync_context
);
11817 ndr_print_uint32(ndr
, "sync_context", *r
->in
.sync_context
);
11819 ndr_print_uint32(ndr
, "preferredmaximumlength", r
->in
.preferredmaximumlength
);
11822 if (flags
& NDR_OUT
) {
11823 ndr_print_struct(ndr
, "out", "netr_DatabaseSync2");
11825 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
11827 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
11829 ndr_print_ptr(ndr
, "sync_context", r
->out
.sync_context
);
11831 ndr_print_uint32(ndr
, "sync_context", *r
->out
.sync_context
);
11833 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
11835 ndr_print_ptr(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
11837 if (*r
->out
.delta_enum_array
) {
11838 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
11842 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
11848 static enum ndr_err_code
ndr_push_netr_DatabaseRedo(struct ndr_push
*ndr
, int flags
, const struct netr_DatabaseRedo
*r
)
11850 if (flags
& NDR_IN
) {
11851 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11852 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11853 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
11854 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
));
11855 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
11856 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
11857 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computername
, CH_UTF16
)));
11858 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.computername
, ndr_charset_length(r
->in
.computername
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
11859 if (r
->in
.credential
== NULL
) {
11860 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11862 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11863 if (r
->in
.return_authenticator
== NULL
) {
11864 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11866 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11868 struct ndr_push
*_ndr_change_log_entry
;
11869 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_change_log_entry
, 4, ndr_size_netr_ChangeLogEntry(&r
->in
.change_log_entry
, ndr
->iconv_convenience
, ndr
->flags
)));
11870 NDR_CHECK(ndr_push_netr_ChangeLogEntry(_ndr_change_log_entry
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.change_log_entry
));
11871 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_change_log_entry
, 4, ndr_size_netr_ChangeLogEntry(&r
->in
.change_log_entry
, ndr
->iconv_convenience
, ndr
->flags
)));
11873 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_size_netr_ChangeLogEntry(&r
->in
.change_log_entry
, ndr
->iconv_convenience
, ndr
->flags
)));
11875 if (flags
& NDR_OUT
) {
11876 if (r
->out
.return_authenticator
== NULL
) {
11877 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11879 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11880 if (r
->out
.delta_enum_array
== NULL
) {
11881 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
11883 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.delta_enum_array
));
11884 if (*r
->out
.delta_enum_array
) {
11885 NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
11887 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
11889 return NDR_ERR_SUCCESS
;
11892 static enum ndr_err_code
ndr_pull_netr_DatabaseRedo(struct ndr_pull
*ndr
, int flags
, struct netr_DatabaseRedo
*r
)
11894 uint32_t _ptr_delta_enum_array
;
11895 TALLOC_CTX
*_mem_save_credential_0
;
11896 TALLOC_CTX
*_mem_save_return_authenticator_0
;
11897 TALLOC_CTX
*_mem_save_delta_enum_array_0
;
11898 TALLOC_CTX
*_mem_save_delta_enum_array_1
;
11899 if (flags
& NDR_IN
) {
11900 ZERO_STRUCT(r
->out
);
11902 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
11903 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
11904 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
11905 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
));
11907 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
11908 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
));
11909 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computername
));
11910 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computername
));
11911 if (ndr_get_array_length(ndr
, &r
->in
.computername
) > ndr_get_array_size(ndr
, &r
->in
.computername
)) {
11912 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
));
11914 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t)));
11915 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.computername
, ndr_get_array_length(ndr
, &r
->in
.computername
), sizeof(uint16_t), CH_UTF16
));
11916 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11917 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
11919 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11920 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
11921 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
11922 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
11923 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11924 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
11926 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11927 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11928 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
11929 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11931 struct ndr_pull
*_ndr_change_log_entry
;
11932 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_change_log_entry
, 4, r
->in
.change_log_entry_size
));
11933 NDR_CHECK(ndr_pull_netr_ChangeLogEntry(_ndr_change_log_entry
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.change_log_entry
));
11934 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_change_log_entry
, 4, r
->in
.change_log_entry_size
));
11936 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.change_log_entry_size
));
11937 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11938 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
11939 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
11940 ZERO_STRUCTP(r
->out
.delta_enum_array
);
11942 if (flags
& NDR_OUT
) {
11943 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11944 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
11946 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11947 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
11948 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
11949 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
11950 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
11951 NDR_PULL_ALLOC(ndr
, r
->out
.delta_enum_array
);
11953 _mem_save_delta_enum_array_0
= NDR_PULL_GET_MEM_CTX(ndr
);
11954 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.delta_enum_array
, LIBNDR_FLAG_REF_ALLOC
);
11955 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_delta_enum_array
));
11956 if (_ptr_delta_enum_array
) {
11957 NDR_PULL_ALLOC(ndr
, *r
->out
.delta_enum_array
);
11959 *r
->out
.delta_enum_array
= NULL
;
11961 if (*r
->out
.delta_enum_array
) {
11962 _mem_save_delta_enum_array_1
= NDR_PULL_GET_MEM_CTX(ndr
);
11963 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.delta_enum_array
, 0);
11964 NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.delta_enum_array
));
11965 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_1
, 0);
11967 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_delta_enum_array_0
, LIBNDR_FLAG_REF_ALLOC
);
11968 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
11970 return NDR_ERR_SUCCESS
;
11973 _PUBLIC_
void ndr_print_netr_DatabaseRedo(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DatabaseRedo
*r
)
11975 ndr_print_struct(ndr
, name
, "netr_DatabaseRedo");
11977 if (flags
& NDR_SET_VALUES
) {
11978 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
11980 if (flags
& NDR_IN
) {
11981 ndr_print_struct(ndr
, "in", "netr_DatabaseRedo");
11983 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
11984 ndr_print_string(ndr
, "computername", r
->in
.computername
);
11985 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
11987 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
11989 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11991 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
11993 ndr_print_netr_ChangeLogEntry(ndr
, "change_log_entry", &r
->in
.change_log_entry
);
11994 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
);
11997 if (flags
& NDR_OUT
) {
11998 ndr_print_struct(ndr
, "out", "netr_DatabaseRedo");
12000 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12002 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12004 ndr_print_ptr(ndr
, "delta_enum_array", r
->out
.delta_enum_array
);
12006 ndr_print_ptr(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
12008 if (*r
->out
.delta_enum_array
) {
12009 ndr_print_netr_DELTA_ENUM_ARRAY(ndr
, "delta_enum_array", *r
->out
.delta_enum_array
);
12013 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
12019 static enum ndr_err_code
ndr_push_netr_LogonControl2Ex(struct ndr_push
*ndr
, int flags
, const struct netr_LogonControl2Ex
*r
)
12021 if (flags
& NDR_IN
) {
12022 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.logon_server
));
12023 if (r
->in
.logon_server
) {
12024 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
12025 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12026 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.logon_server
, CH_UTF16
)));
12027 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
));
12029 NDR_CHECK(ndr_push_netr_LogonControlCode(ndr
, NDR_SCALARS
, r
->in
.function_code
));
12030 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
12031 if (r
->in
.data
== NULL
) {
12032 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12034 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
));
12035 NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.data
));
12037 if (flags
& NDR_OUT
) {
12038 if (r
->out
.query
== NULL
) {
12039 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12041 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
12042 NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
12043 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12045 return NDR_ERR_SUCCESS
;
12048 static enum ndr_err_code
ndr_pull_netr_LogonControl2Ex(struct ndr_pull
*ndr
, int flags
, struct netr_LogonControl2Ex
*r
)
12050 uint32_t _ptr_logon_server
;
12051 TALLOC_CTX
*_mem_save_logon_server_0
;
12052 TALLOC_CTX
*_mem_save_data_0
;
12053 TALLOC_CTX
*_mem_save_query_0
;
12054 if (flags
& NDR_IN
) {
12055 ZERO_STRUCT(r
->out
);
12057 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_logon_server
));
12058 if (_ptr_logon_server
) {
12059 NDR_PULL_ALLOC(ndr
, r
->in
.logon_server
);
12061 r
->in
.logon_server
= NULL
;
12063 if (r
->in
.logon_server
) {
12064 _mem_save_logon_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12065 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon_server
, 0);
12066 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.logon_server
));
12067 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.logon_server
));
12068 if (ndr_get_array_length(ndr
, &r
->in
.logon_server
) > ndr_get_array_size(ndr
, &r
->in
.logon_server
)) {
12069 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
));
12071 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.logon_server
), sizeof(uint16_t)));
12072 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
));
12073 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_server_0
, 0);
12075 NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr
, NDR_SCALARS
, &r
->in
.function_code
));
12076 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
12077 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12078 NDR_PULL_ALLOC(ndr
, r
->in
.data
);
12080 _mem_save_data_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12081 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.data
, LIBNDR_FLAG_REF_ALLOC
);
12082 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
));
12083 NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.data
));
12084 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_data_0
, LIBNDR_FLAG_REF_ALLOC
);
12085 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
12086 ZERO_STRUCTP(r
->out
.query
);
12088 if (flags
& NDR_OUT
) {
12089 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12090 NDR_PULL_ALLOC(ndr
, r
->out
.query
);
12092 _mem_save_query_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12093 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.query
, LIBNDR_FLAG_REF_ALLOC
);
12094 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
));
12095 NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.query
));
12096 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_query_0
, LIBNDR_FLAG_REF_ALLOC
);
12097 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12099 return NDR_ERR_SUCCESS
;
12102 _PUBLIC_
void ndr_print_netr_LogonControl2Ex(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonControl2Ex
*r
)
12104 ndr_print_struct(ndr
, name
, "netr_LogonControl2Ex");
12106 if (flags
& NDR_SET_VALUES
) {
12107 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12109 if (flags
& NDR_IN
) {
12110 ndr_print_struct(ndr
, "in", "netr_LogonControl2Ex");
12112 ndr_print_ptr(ndr
, "logon_server", r
->in
.logon_server
);
12114 if (r
->in
.logon_server
) {
12115 ndr_print_string(ndr
, "logon_server", r
->in
.logon_server
);
12118 ndr_print_netr_LogonControlCode(ndr
, "function_code", r
->in
.function_code
);
12119 ndr_print_uint32(ndr
, "level", r
->in
.level
);
12120 ndr_print_ptr(ndr
, "data", r
->in
.data
);
12122 ndr_print_set_switch_value(ndr
, r
->in
.data
, r
->in
.function_code
);
12123 ndr_print_netr_CONTROL_DATA_INFORMATION(ndr
, "data", r
->in
.data
);
12127 if (flags
& NDR_OUT
) {
12128 ndr_print_struct(ndr
, "out", "netr_LogonControl2Ex");
12130 ndr_print_ptr(ndr
, "query", r
->out
.query
);
12132 ndr_print_set_switch_value(ndr
, r
->out
.query
, r
->in
.level
);
12133 ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr
, "query", r
->out
.query
);
12135 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12141 static enum ndr_err_code
ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push
*ndr
, int flags
, const struct netr_NetrEnumerateTrustedDomains
*r
)
12143 if (flags
& NDR_IN
) {
12144 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12145 if (r
->in
.server_name
) {
12146 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12147 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12148 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12149 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
));
12152 if (flags
& NDR_OUT
) {
12153 if (r
->out
.trusted_domains_blob
== NULL
) {
12154 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12156 NDR_CHECK(ndr_push_netr_Blob(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusted_domains_blob
));
12157 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12159 return NDR_ERR_SUCCESS
;
12162 static enum ndr_err_code
ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull
*ndr
, int flags
, struct netr_NetrEnumerateTrustedDomains
*r
)
12164 uint32_t _ptr_server_name
;
12165 TALLOC_CTX
*_mem_save_server_name_0
;
12166 TALLOC_CTX
*_mem_save_trusted_domains_blob_0
;
12167 if (flags
& NDR_IN
) {
12168 ZERO_STRUCT(r
->out
);
12170 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12171 if (_ptr_server_name
) {
12172 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12174 r
->in
.server_name
= NULL
;
12176 if (r
->in
.server_name
) {
12177 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12178 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12179 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12180 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12181 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12182 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
));
12184 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12185 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
));
12186 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12188 NDR_PULL_ALLOC(ndr
, r
->out
.trusted_domains_blob
);
12189 ZERO_STRUCTP(r
->out
.trusted_domains_blob
);
12191 if (flags
& NDR_OUT
) {
12192 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12193 NDR_PULL_ALLOC(ndr
, r
->out
.trusted_domains_blob
);
12195 _mem_save_trusted_domains_blob_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12196 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.trusted_domains_blob
, LIBNDR_FLAG_REF_ALLOC
);
12197 NDR_CHECK(ndr_pull_netr_Blob(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusted_domains_blob
));
12198 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domains_blob_0
, LIBNDR_FLAG_REF_ALLOC
);
12199 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12201 return NDR_ERR_SUCCESS
;
12204 _PUBLIC_
void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NetrEnumerateTrustedDomains
*r
)
12206 ndr_print_struct(ndr
, name
, "netr_NetrEnumerateTrustedDomains");
12208 if (flags
& NDR_SET_VALUES
) {
12209 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12211 if (flags
& NDR_IN
) {
12212 ndr_print_struct(ndr
, "in", "netr_NetrEnumerateTrustedDomains");
12214 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12216 if (r
->in
.server_name
) {
12217 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12222 if (flags
& NDR_OUT
) {
12223 ndr_print_struct(ndr
, "out", "netr_NetrEnumerateTrustedDomains");
12225 ndr_print_ptr(ndr
, "trusted_domains_blob", r
->out
.trusted_domains_blob
);
12227 ndr_print_netr_Blob(ndr
, "trusted_domains_blob", r
->out
.trusted_domains_blob
);
12229 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12235 static enum ndr_err_code
ndr_push_netr_DsRGetDCName(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCName
*r
)
12237 if (flags
& NDR_IN
) {
12238 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
12239 if (r
->in
.server_unc
) {
12240 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
12241 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12242 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
12243 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
));
12245 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
12246 if (r
->in
.domain_name
) {
12247 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12248 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12249 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12250 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
));
12252 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
12253 if (r
->in
.domain_guid
) {
12254 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
12256 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_guid
));
12257 if (r
->in
.site_guid
) {
12258 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.site_guid
));
12260 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
12262 if (flags
& NDR_OUT
) {
12263 if (r
->out
.info
== NULL
) {
12264 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12266 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.info
));
12267 if (*r
->out
.info
) {
12268 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
12270 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12272 return NDR_ERR_SUCCESS
;
12275 static enum ndr_err_code
ndr_pull_netr_DsRGetDCName(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCName
*r
)
12277 uint32_t _ptr_server_unc
;
12278 uint32_t _ptr_domain_name
;
12279 uint32_t _ptr_domain_guid
;
12280 uint32_t _ptr_site_guid
;
12281 uint32_t _ptr_info
;
12282 TALLOC_CTX
*_mem_save_server_unc_0
;
12283 TALLOC_CTX
*_mem_save_domain_name_0
;
12284 TALLOC_CTX
*_mem_save_domain_guid_0
;
12285 TALLOC_CTX
*_mem_save_site_guid_0
;
12286 TALLOC_CTX
*_mem_save_info_0
;
12287 TALLOC_CTX
*_mem_save_info_1
;
12288 if (flags
& NDR_IN
) {
12289 ZERO_STRUCT(r
->out
);
12291 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
12292 if (_ptr_server_unc
) {
12293 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
12295 r
->in
.server_unc
= NULL
;
12297 if (r
->in
.server_unc
) {
12298 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12299 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
12300 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
12301 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
12302 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
12303 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
));
12305 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
12306 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
));
12307 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
12309 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
12310 if (_ptr_domain_name
) {
12311 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
12313 r
->in
.domain_name
= NULL
;
12315 if (r
->in
.domain_name
) {
12316 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12317 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
12318 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
12319 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
12320 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
12321 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
));
12323 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
12324 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
));
12325 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
12327 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
12328 if (_ptr_domain_guid
) {
12329 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
12331 r
->in
.domain_guid
= NULL
;
12333 if (r
->in
.domain_guid
) {
12334 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12335 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
12336 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
12337 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
12339 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_guid
));
12340 if (_ptr_site_guid
) {
12341 NDR_PULL_ALLOC(ndr
, r
->in
.site_guid
);
12343 r
->in
.site_guid
= NULL
;
12345 if (r
->in
.site_guid
) {
12346 _mem_save_site_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12347 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_guid
, 0);
12348 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.site_guid
));
12349 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_guid_0
, 0);
12351 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
12352 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
12353 ZERO_STRUCTP(r
->out
.info
);
12355 if (flags
& NDR_OUT
) {
12356 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12357 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
12359 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12360 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
12361 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info
));
12363 NDR_PULL_ALLOC(ndr
, *r
->out
.info
);
12365 *r
->out
.info
= NULL
;
12367 if (*r
->out
.info
) {
12368 _mem_save_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
12369 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.info
, 0);
12370 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
12371 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_1
, 0);
12373 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
12374 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12376 return NDR_ERR_SUCCESS
;
12379 _PUBLIC_
void ndr_print_netr_DsRGetDCName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCName
*r
)
12381 ndr_print_struct(ndr
, name
, "netr_DsRGetDCName");
12383 if (flags
& NDR_SET_VALUES
) {
12384 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12386 if (flags
& NDR_IN
) {
12387 ndr_print_struct(ndr
, "in", "netr_DsRGetDCName");
12389 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
12391 if (r
->in
.server_unc
) {
12392 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
12395 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
12397 if (r
->in
.domain_name
) {
12398 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
12401 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
12403 if (r
->in
.domain_guid
) {
12404 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
12407 ndr_print_ptr(ndr
, "site_guid", r
->in
.site_guid
);
12409 if (r
->in
.site_guid
) {
12410 ndr_print_GUID(ndr
, "site_guid", r
->in
.site_guid
);
12413 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
12416 if (flags
& NDR_OUT
) {
12417 ndr_print_struct(ndr
, "out", "netr_DsRGetDCName");
12419 ndr_print_ptr(ndr
, "info", r
->out
.info
);
12421 ndr_print_ptr(ndr
, "info", *r
->out
.info
);
12423 if (*r
->out
.info
) {
12424 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", *r
->out
.info
);
12428 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12434 static enum ndr_err_code
ndr_push_netr_LogonGetCapabilities(struct ndr_push
*ndr
, int flags
, const struct netr_LogonGetCapabilities
*r
)
12436 if (flags
& NDR_IN
) {
12437 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12438 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12439 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12440 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
));
12441 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
12442 if (r
->in
.computer_name
) {
12443 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12444 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12445 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12446 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
));
12448 if (r
->in
.credential
== NULL
) {
12449 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12451 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
12452 if (r
->in
.return_authenticator
== NULL
) {
12453 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12455 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
12456 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.query_level
));
12458 if (flags
& NDR_OUT
) {
12459 if (r
->out
.return_authenticator
== NULL
) {
12460 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12462 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
12463 if (r
->out
.capabilities
== NULL
) {
12464 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12466 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.capabilities
, r
->in
.query_level
));
12467 NDR_CHECK(ndr_push_netr_Capabilities(ndr
, NDR_SCALARS
, r
->out
.capabilities
));
12468 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
12470 return NDR_ERR_SUCCESS
;
12473 static enum ndr_err_code
ndr_pull_netr_LogonGetCapabilities(struct ndr_pull
*ndr
, int flags
, struct netr_LogonGetCapabilities
*r
)
12475 uint32_t _ptr_computer_name
;
12476 TALLOC_CTX
*_mem_save_computer_name_0
;
12477 TALLOC_CTX
*_mem_save_credential_0
;
12478 TALLOC_CTX
*_mem_save_return_authenticator_0
;
12479 TALLOC_CTX
*_mem_save_capabilities_0
;
12480 if (flags
& NDR_IN
) {
12481 ZERO_STRUCT(r
->out
);
12483 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12484 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12485 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12486 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
));
12488 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12489 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
));
12490 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
12491 if (_ptr_computer_name
) {
12492 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
12494 r
->in
.computer_name
= NULL
;
12496 if (r
->in
.computer_name
) {
12497 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12498 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
12499 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
12500 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
12501 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
12502 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
));
12504 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
12505 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
));
12506 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
12508 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12509 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
12511 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12512 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
12513 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
12514 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
12515 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12516 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
12518 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12519 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
12520 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
12521 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
12522 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.query_level
));
12523 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12524 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
12525 NDR_PULL_ALLOC(ndr
, r
->out
.capabilities
);
12526 ZERO_STRUCTP(r
->out
.capabilities
);
12528 if (flags
& NDR_OUT
) {
12529 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12530 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
12532 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12533 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
12534 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
12535 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
12536 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12537 NDR_PULL_ALLOC(ndr
, r
->out
.capabilities
);
12539 _mem_save_capabilities_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12540 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.capabilities
, LIBNDR_FLAG_REF_ALLOC
);
12541 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.capabilities
, r
->in
.query_level
));
12542 NDR_CHECK(ndr_pull_netr_Capabilities(ndr
, NDR_SCALARS
, r
->out
.capabilities
));
12543 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_capabilities_0
, LIBNDR_FLAG_REF_ALLOC
);
12544 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
12546 return NDR_ERR_SUCCESS
;
12549 _PUBLIC_
void ndr_print_netr_LogonGetCapabilities(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonGetCapabilities
*r
)
12551 ndr_print_struct(ndr
, name
, "netr_LogonGetCapabilities");
12553 if (flags
& NDR_SET_VALUES
) {
12554 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12556 if (flags
& NDR_IN
) {
12557 ndr_print_struct(ndr
, "in", "netr_LogonGetCapabilities");
12559 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12560 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
12562 if (r
->in
.computer_name
) {
12563 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
12566 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
12568 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
12570 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
12572 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
12574 ndr_print_uint32(ndr
, "query_level", r
->in
.query_level
);
12577 if (flags
& NDR_OUT
) {
12578 ndr_print_struct(ndr
, "out", "netr_LogonGetCapabilities");
12580 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12582 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
12584 ndr_print_ptr(ndr
, "capabilities", r
->out
.capabilities
);
12586 ndr_print_set_switch_value(ndr
, r
->out
.capabilities
, r
->in
.query_level
);
12587 ndr_print_netr_Capabilities(ndr
, "capabilities", r
->out
.capabilities
);
12589 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
12595 static enum ndr_err_code
ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONSETSERVICEBITS
*r
)
12597 if (flags
& NDR_IN
) {
12599 if (flags
& NDR_OUT
) {
12600 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12602 return NDR_ERR_SUCCESS
;
12605 static enum ndr_err_code
ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONSETSERVICEBITS
*r
)
12607 if (flags
& NDR_IN
) {
12609 if (flags
& NDR_OUT
) {
12610 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12612 return NDR_ERR_SUCCESS
;
12615 _PUBLIC_
void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONSETSERVICEBITS
*r
)
12617 ndr_print_struct(ndr
, name
, "netr_NETRLOGONSETSERVICEBITS");
12619 if (flags
& NDR_SET_VALUES
) {
12620 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12622 if (flags
& NDR_IN
) {
12623 ndr_print_struct(ndr
, "in", "netr_NETRLOGONSETSERVICEBITS");
12627 if (flags
& NDR_OUT
) {
12628 ndr_print_struct(ndr
, "out", "netr_NETRLOGONSETSERVICEBITS");
12630 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12636 static enum ndr_err_code
ndr_push_netr_LogonGetTrustRid(struct ndr_push
*ndr
, int flags
, const struct netr_LogonGetTrustRid
*r
)
12638 if (flags
& NDR_IN
) {
12639 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12640 if (r
->in
.server_name
) {
12641 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12642 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12643 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12644 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
));
12646 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
12647 if (r
->in
.domain_name
) {
12648 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12649 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12650 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
12651 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
));
12654 if (flags
& NDR_OUT
) {
12655 if (r
->out
.rid
== NULL
) {
12656 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12658 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.rid
));
12659 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12661 return NDR_ERR_SUCCESS
;
12664 static enum ndr_err_code
ndr_pull_netr_LogonGetTrustRid(struct ndr_pull
*ndr
, int flags
, struct netr_LogonGetTrustRid
*r
)
12666 uint32_t _ptr_server_name
;
12667 uint32_t _ptr_domain_name
;
12668 TALLOC_CTX
*_mem_save_server_name_0
;
12669 TALLOC_CTX
*_mem_save_domain_name_0
;
12670 TALLOC_CTX
*_mem_save_rid_0
;
12671 if (flags
& NDR_IN
) {
12672 ZERO_STRUCT(r
->out
);
12674 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12675 if (_ptr_server_name
) {
12676 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12678 r
->in
.server_name
= NULL
;
12680 if (r
->in
.server_name
) {
12681 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12682 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12683 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12684 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12685 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12686 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
));
12688 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12689 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
));
12690 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12692 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
12693 if (_ptr_domain_name
) {
12694 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
12696 r
->in
.domain_name
= NULL
;
12698 if (r
->in
.domain_name
) {
12699 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12700 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
12701 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
12702 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
12703 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
12704 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
));
12706 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
12707 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
));
12708 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
12710 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
12711 ZERO_STRUCTP(r
->out
.rid
);
12713 if (flags
& NDR_OUT
) {
12714 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12715 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
12717 _mem_save_rid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12718 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.rid
, LIBNDR_FLAG_REF_ALLOC
);
12719 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.rid
));
12720 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rid_0
, LIBNDR_FLAG_REF_ALLOC
);
12721 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12723 return NDR_ERR_SUCCESS
;
12726 _PUBLIC_
void ndr_print_netr_LogonGetTrustRid(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonGetTrustRid
*r
)
12728 ndr_print_struct(ndr
, name
, "netr_LogonGetTrustRid");
12730 if (flags
& NDR_SET_VALUES
) {
12731 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12733 if (flags
& NDR_IN
) {
12734 ndr_print_struct(ndr
, "in", "netr_LogonGetTrustRid");
12736 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12738 if (r
->in
.server_name
) {
12739 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12742 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
12744 if (r
->in
.domain_name
) {
12745 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
12750 if (flags
& NDR_OUT
) {
12751 ndr_print_struct(ndr
, "out", "netr_LogonGetTrustRid");
12753 ndr_print_ptr(ndr
, "rid", r
->out
.rid
);
12755 ndr_print_uint32(ndr
, "rid", *r
->out
.rid
);
12757 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12763 static enum ndr_err_code
ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
12765 if (flags
& NDR_IN
) {
12767 if (flags
& NDR_OUT
) {
12768 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12770 return NDR_ERR_SUCCESS
;
12773 static enum ndr_err_code
ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
12775 if (flags
& NDR_IN
) {
12777 if (flags
& NDR_OUT
) {
12778 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12780 return NDR_ERR_SUCCESS
;
12783 _PUBLIC_
void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONCOMPUTESERVERDIGEST
*r
)
12785 ndr_print_struct(ndr
, name
, "netr_NETRLOGONCOMPUTESERVERDIGEST");
12787 if (flags
& NDR_SET_VALUES
) {
12788 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12790 if (flags
& NDR_IN
) {
12791 ndr_print_struct(ndr
, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST");
12795 if (flags
& NDR_OUT
) {
12796 ndr_print_struct(ndr
, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST");
12798 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12804 static enum ndr_err_code
ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
12806 if (flags
& NDR_IN
) {
12808 if (flags
& NDR_OUT
) {
12809 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
12811 return NDR_ERR_SUCCESS
;
12814 static enum ndr_err_code
ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
12816 if (flags
& NDR_IN
) {
12818 if (flags
& NDR_OUT
) {
12819 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
12821 return NDR_ERR_SUCCESS
;
12824 _PUBLIC_
void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST
*r
)
12826 ndr_print_struct(ndr
, name
, "netr_NETRLOGONCOMPUTECLIENTDIGEST");
12828 if (flags
& NDR_SET_VALUES
) {
12829 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12831 if (flags
& NDR_IN
) {
12832 ndr_print_struct(ndr
, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
12836 if (flags
& NDR_OUT
) {
12837 ndr_print_struct(ndr
, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST");
12839 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
12845 _PUBLIC_
enum ndr_err_code
ndr_push_netr_ServerAuthenticate3(struct ndr_push
*ndr
, int flags
, const struct netr_ServerAuthenticate3
*r
)
12847 if (flags
& NDR_IN
) {
12848 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
12849 if (r
->in
.server_name
) {
12850 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12851 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12852 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
12853 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
));
12855 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
12856 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12857 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
12858 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
));
12859 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
12860 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12861 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
12862 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
12863 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
));
12864 if (r
->in
.credentials
== NULL
) {
12865 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12867 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
12868 if (r
->in
.negotiate_flags
== NULL
) {
12869 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12871 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, *r
->in
.negotiate_flags
));
12873 if (flags
& NDR_OUT
) {
12874 if (r
->out
.return_credentials
== NULL
) {
12875 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12877 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
12878 if (r
->out
.negotiate_flags
== NULL
) {
12879 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12881 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, *r
->out
.negotiate_flags
));
12882 if (r
->out
.rid
== NULL
) {
12883 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
12885 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.rid
));
12886 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
12888 return NDR_ERR_SUCCESS
;
12891 _PUBLIC_
enum ndr_err_code
ndr_pull_netr_ServerAuthenticate3(struct ndr_pull
*ndr
, int flags
, struct netr_ServerAuthenticate3
*r
)
12893 uint32_t _ptr_server_name
;
12894 TALLOC_CTX
*_mem_save_server_name_0
;
12895 TALLOC_CTX
*_mem_save_credentials_0
;
12896 TALLOC_CTX
*_mem_save_return_credentials_0
;
12897 TALLOC_CTX
*_mem_save_negotiate_flags_0
;
12898 TALLOC_CTX
*_mem_save_rid_0
;
12899 if (flags
& NDR_IN
) {
12900 ZERO_STRUCT(r
->out
);
12902 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
12903 if (_ptr_server_name
) {
12904 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
12906 r
->in
.server_name
= NULL
;
12908 if (r
->in
.server_name
) {
12909 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12910 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
12911 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
12912 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
12913 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
12914 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
));
12916 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
12917 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
));
12918 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
12920 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
12921 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
12922 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
12923 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
));
12925 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
12926 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
));
12927 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
12928 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
12929 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
12930 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
12931 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
));
12933 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
12934 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
));
12935 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12936 NDR_PULL_ALLOC(ndr
, r
->in
.credentials
);
12938 _mem_save_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12939 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credentials
, LIBNDR_FLAG_REF_ALLOC
);
12940 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->in
.credentials
));
12941 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
12942 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12943 NDR_PULL_ALLOC(ndr
, r
->in
.negotiate_flags
);
12945 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12946 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
12947 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->in
.negotiate_flags
));
12948 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
12949 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
12950 ZERO_STRUCTP(r
->out
.return_credentials
);
12951 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
12952 *r
->out
.negotiate_flags
= *r
->in
.negotiate_flags
;
12953 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
12954 ZERO_STRUCTP(r
->out
.rid
);
12956 if (flags
& NDR_OUT
) {
12957 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12958 NDR_PULL_ALLOC(ndr
, r
->out
.return_credentials
);
12960 _mem_save_return_credentials_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12961 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_credentials
, LIBNDR_FLAG_REF_ALLOC
);
12962 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, r
->out
.return_credentials
));
12963 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_credentials_0
, LIBNDR_FLAG_REF_ALLOC
);
12964 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12965 NDR_PULL_ALLOC(ndr
, r
->out
.negotiate_flags
);
12967 _mem_save_negotiate_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12968 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.negotiate_flags
, LIBNDR_FLAG_REF_ALLOC
);
12969 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->out
.negotiate_flags
));
12970 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_negotiate_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
12971 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
12972 NDR_PULL_ALLOC(ndr
, r
->out
.rid
);
12974 _mem_save_rid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
12975 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.rid
, LIBNDR_FLAG_REF_ALLOC
);
12976 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.rid
));
12977 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_rid_0
, LIBNDR_FLAG_REF_ALLOC
);
12978 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
12980 return NDR_ERR_SUCCESS
;
12983 _PUBLIC_
void ndr_print_netr_ServerAuthenticate3(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerAuthenticate3
*r
)
12985 ndr_print_struct(ndr
, name
, "netr_ServerAuthenticate3");
12987 if (flags
& NDR_SET_VALUES
) {
12988 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
12990 if (flags
& NDR_IN
) {
12991 ndr_print_struct(ndr
, "in", "netr_ServerAuthenticate3");
12993 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
12995 if (r
->in
.server_name
) {
12996 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
12999 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
13000 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
13001 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13002 ndr_print_ptr(ndr
, "credentials", r
->in
.credentials
);
13004 ndr_print_netr_Credential(ndr
, "credentials", r
->in
.credentials
);
13006 ndr_print_ptr(ndr
, "negotiate_flags", r
->in
.negotiate_flags
);
13008 ndr_print_netr_NegotiateFlags(ndr
, "negotiate_flags", *r
->in
.negotiate_flags
);
13012 if (flags
& NDR_OUT
) {
13013 ndr_print_struct(ndr
, "out", "netr_ServerAuthenticate3");
13015 ndr_print_ptr(ndr
, "return_credentials", r
->out
.return_credentials
);
13017 ndr_print_netr_Credential(ndr
, "return_credentials", r
->out
.return_credentials
);
13019 ndr_print_ptr(ndr
, "negotiate_flags", r
->out
.negotiate_flags
);
13021 ndr_print_netr_NegotiateFlags(ndr
, "negotiate_flags", *r
->out
.negotiate_flags
);
13023 ndr_print_ptr(ndr
, "rid", r
->out
.rid
);
13025 ndr_print_uint32(ndr
, "rid", *r
->out
.rid
);
13027 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
13033 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameEx(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCNameEx
*r
)
13035 if (flags
& NDR_IN
) {
13036 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
13037 if (r
->in
.server_unc
) {
13038 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
13039 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13040 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
13041 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
));
13043 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
13044 if (r
->in
.domain_name
) {
13045 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
13046 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13047 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
13048 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
));
13050 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
13051 if (r
->in
.domain_guid
) {
13052 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
13054 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_name
));
13055 if (r
->in
.site_name
) {
13056 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
13057 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13058 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
13059 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
));
13061 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
13063 if (flags
& NDR_OUT
) {
13064 if (r
->out
.info
== NULL
) {
13065 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13067 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.info
));
13068 if (*r
->out
.info
) {
13069 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
13071 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13073 return NDR_ERR_SUCCESS
;
13076 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCNameEx
*r
)
13078 uint32_t _ptr_server_unc
;
13079 uint32_t _ptr_domain_name
;
13080 uint32_t _ptr_domain_guid
;
13081 uint32_t _ptr_site_name
;
13082 uint32_t _ptr_info
;
13083 TALLOC_CTX
*_mem_save_server_unc_0
;
13084 TALLOC_CTX
*_mem_save_domain_name_0
;
13085 TALLOC_CTX
*_mem_save_domain_guid_0
;
13086 TALLOC_CTX
*_mem_save_site_name_0
;
13087 TALLOC_CTX
*_mem_save_info_0
;
13088 TALLOC_CTX
*_mem_save_info_1
;
13089 if (flags
& NDR_IN
) {
13090 ZERO_STRUCT(r
->out
);
13092 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
13093 if (_ptr_server_unc
) {
13094 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
13096 r
->in
.server_unc
= NULL
;
13098 if (r
->in
.server_unc
) {
13099 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13100 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
13101 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
13102 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
13103 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
13104 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
));
13106 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
13107 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
));
13108 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
13110 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
13111 if (_ptr_domain_name
) {
13112 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
13114 r
->in
.domain_name
= NULL
;
13116 if (r
->in
.domain_name
) {
13117 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13118 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
13119 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
13120 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
13121 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
13122 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
));
13124 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
13125 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
));
13126 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
13128 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
13129 if (_ptr_domain_guid
) {
13130 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
13132 r
->in
.domain_guid
= NULL
;
13134 if (r
->in
.domain_guid
) {
13135 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13136 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
13137 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
13138 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
13140 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_name
));
13141 if (_ptr_site_name
) {
13142 NDR_PULL_ALLOC(ndr
, r
->in
.site_name
);
13144 r
->in
.site_name
= NULL
;
13146 if (r
->in
.site_name
) {
13147 _mem_save_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13148 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_name
, 0);
13149 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.site_name
));
13150 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.site_name
));
13151 if (ndr_get_array_length(ndr
, &r
->in
.site_name
) > ndr_get_array_size(ndr
, &r
->in
.site_name
)) {
13152 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
));
13154 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t)));
13155 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
));
13156 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_name_0
, 0);
13158 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
13159 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
13160 ZERO_STRUCTP(r
->out
.info
);
13162 if (flags
& NDR_OUT
) {
13163 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13164 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
13166 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13167 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
13168 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info
));
13170 NDR_PULL_ALLOC(ndr
, *r
->out
.info
);
13172 *r
->out
.info
= NULL
;
13174 if (*r
->out
.info
) {
13175 _mem_save_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13176 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.info
, 0);
13177 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
13178 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_1
, 0);
13180 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
13181 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13183 return NDR_ERR_SUCCESS
;
13186 _PUBLIC_
void ndr_print_netr_DsRGetDCNameEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCNameEx
*r
)
13188 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameEx");
13190 if (flags
& NDR_SET_VALUES
) {
13191 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13193 if (flags
& NDR_IN
) {
13194 ndr_print_struct(ndr
, "in", "netr_DsRGetDCNameEx");
13196 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
13198 if (r
->in
.server_unc
) {
13199 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
13202 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
13204 if (r
->in
.domain_name
) {
13205 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
13208 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
13210 if (r
->in
.domain_guid
) {
13211 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
13214 ndr_print_ptr(ndr
, "site_name", r
->in
.site_name
);
13216 if (r
->in
.site_name
) {
13217 ndr_print_string(ndr
, "site_name", r
->in
.site_name
);
13220 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
13223 if (flags
& NDR_OUT
) {
13224 ndr_print_struct(ndr
, "out", "netr_DsRGetDCNameEx");
13226 ndr_print_ptr(ndr
, "info", r
->out
.info
);
13228 ndr_print_ptr(ndr
, "info", *r
->out
.info
);
13230 if (*r
->out
.info
) {
13231 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", *r
->out
.info
);
13235 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13241 static enum ndr_err_code
ndr_push_netr_DsRGetSiteName(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetSiteName
*r
)
13243 if (flags
& NDR_IN
) {
13244 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
13245 if (r
->in
.computer_name
) {
13246 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13247 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13248 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13249 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
));
13252 if (flags
& NDR_OUT
) {
13253 if (r
->out
.site
== NULL
) {
13254 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13256 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.site
));
13257 if (*r
->out
.site
) {
13258 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.site
, CH_UTF16
)));
13259 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13260 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(*r
->out
.site
, CH_UTF16
)));
13261 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, *r
->out
.site
, ndr_charset_length(*r
->out
.site
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
13263 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13265 return NDR_ERR_SUCCESS
;
13268 static enum ndr_err_code
ndr_pull_netr_DsRGetSiteName(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetSiteName
*r
)
13270 uint32_t _ptr_computer_name
;
13271 uint32_t _ptr_site
;
13272 TALLOC_CTX
*_mem_save_computer_name_0
;
13273 TALLOC_CTX
*_mem_save_site_0
;
13274 TALLOC_CTX
*_mem_save_site_1
;
13275 if (flags
& NDR_IN
) {
13276 ZERO_STRUCT(r
->out
);
13278 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
13279 if (_ptr_computer_name
) {
13280 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
13282 r
->in
.computer_name
= NULL
;
13284 if (r
->in
.computer_name
) {
13285 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13286 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
13287 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13288 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13289 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13290 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
));
13292 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13293 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
));
13294 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
13296 NDR_PULL_ALLOC(ndr
, r
->out
.site
);
13297 ZERO_STRUCTP(r
->out
.site
);
13299 if (flags
& NDR_OUT
) {
13300 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13301 NDR_PULL_ALLOC(ndr
, r
->out
.site
);
13303 _mem_save_site_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13304 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.site
, LIBNDR_FLAG_REF_ALLOC
);
13305 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site
));
13307 NDR_PULL_ALLOC(ndr
, *r
->out
.site
);
13309 *r
->out
.site
= NULL
;
13311 if (*r
->out
.site
) {
13312 _mem_save_site_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13313 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.site
, 0);
13314 NDR_CHECK(ndr_pull_array_size(ndr
, r
->out
.site
));
13315 NDR_CHECK(ndr_pull_array_length(ndr
, r
->out
.site
));
13316 if (ndr_get_array_length(ndr
, r
->out
.site
) > ndr_get_array_size(ndr
, r
->out
.site
)) {
13317 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
));
13319 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, r
->out
.site
), sizeof(uint16_t)));
13320 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, r
->out
.site
, ndr_get_array_length(ndr
, r
->out
.site
), sizeof(uint16_t), CH_UTF16
));
13321 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_1
, 0);
13323 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_0
, LIBNDR_FLAG_REF_ALLOC
);
13324 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13326 return NDR_ERR_SUCCESS
;
13329 _PUBLIC_
void ndr_print_netr_DsRGetSiteName(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetSiteName
*r
)
13331 ndr_print_struct(ndr
, name
, "netr_DsRGetSiteName");
13333 if (flags
& NDR_SET_VALUES
) {
13334 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13336 if (flags
& NDR_IN
) {
13337 ndr_print_struct(ndr
, "in", "netr_DsRGetSiteName");
13339 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
13341 if (r
->in
.computer_name
) {
13342 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13347 if (flags
& NDR_OUT
) {
13348 ndr_print_struct(ndr
, "out", "netr_DsRGetSiteName");
13350 ndr_print_ptr(ndr
, "site", r
->out
.site
);
13352 ndr_print_ptr(ndr
, "site", *r
->out
.site
);
13354 if (*r
->out
.site
) {
13355 ndr_print_string(ndr
, "site", *r
->out
.site
);
13359 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13365 static enum ndr_err_code
ndr_push_netr_LogonGetDomainInfo(struct ndr_push
*ndr
, int flags
, const struct netr_LogonGetDomainInfo
*r
)
13367 if (flags
& NDR_IN
) {
13368 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13369 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13370 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13371 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
));
13372 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
13373 if (r
->in
.computer_name
) {
13374 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13375 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13376 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13377 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
));
13379 if (r
->in
.credential
== NULL
) {
13380 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13382 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13383 if (r
->in
.return_authenticator
== NULL
) {
13384 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13386 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
13387 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.level
));
13388 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
));
13389 NDR_CHECK(ndr_push_netr_DomainQuery(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.query
));
13391 if (flags
& NDR_OUT
) {
13392 if (r
->out
.return_authenticator
== NULL
) {
13393 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13395 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13396 if (r
->out
.info
== NULL
) {
13397 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13399 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
13400 NDR_CHECK(ndr_push_netr_DomainInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
13401 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
13403 return NDR_ERR_SUCCESS
;
13406 static enum ndr_err_code
ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull
*ndr
, int flags
, struct netr_LogonGetDomainInfo
*r
)
13408 uint32_t _ptr_computer_name
;
13409 TALLOC_CTX
*_mem_save_computer_name_0
;
13410 TALLOC_CTX
*_mem_save_credential_0
;
13411 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13412 TALLOC_CTX
*_mem_save_info_0
;
13413 if (flags
& NDR_IN
) {
13414 ZERO_STRUCT(r
->out
);
13416 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13417 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13418 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13419 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
));
13421 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13422 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
));
13423 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
13424 if (_ptr_computer_name
) {
13425 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
13427 r
->in
.computer_name
= NULL
;
13429 if (r
->in
.computer_name
) {
13430 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13431 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
13432 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13433 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13434 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13435 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
));
13437 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13438 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
));
13439 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
13441 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13442 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
13444 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13445 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
13446 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13447 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
13448 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13449 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
13451 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13452 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13453 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
13454 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13455 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.level
));
13456 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
));
13457 NDR_CHECK(ndr_pull_netr_DomainQuery(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.query
));
13458 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13459 *r
->out
.return_authenticator
= *r
->in
.return_authenticator
;
13460 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
13461 ZERO_STRUCTP(r
->out
.info
);
13463 if (flags
& NDR_OUT
) {
13464 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13465 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13467 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13468 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13469 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13470 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13471 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13472 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
13474 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13475 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
13476 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
));
13477 NDR_CHECK(ndr_pull_netr_DomainInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.info
));
13478 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
13479 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
13481 return NDR_ERR_SUCCESS
;
13484 _PUBLIC_
void ndr_print_netr_LogonGetDomainInfo(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonGetDomainInfo
*r
)
13486 ndr_print_struct(ndr
, name
, "netr_LogonGetDomainInfo");
13488 if (flags
& NDR_SET_VALUES
) {
13489 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13491 if (flags
& NDR_IN
) {
13492 ndr_print_struct(ndr
, "in", "netr_LogonGetDomainInfo");
13494 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13495 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
13497 if (r
->in
.computer_name
) {
13498 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13501 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
13503 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
13505 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
13507 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
13509 ndr_print_uint32(ndr
, "level", r
->in
.level
);
13510 ndr_print_set_switch_value(ndr
, &r
->in
.query
, r
->in
.level
);
13511 ndr_print_netr_DomainQuery(ndr
, "query", &r
->in
.query
);
13514 if (flags
& NDR_OUT
) {
13515 ndr_print_struct(ndr
, "out", "netr_LogonGetDomainInfo");
13517 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13519 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13521 ndr_print_ptr(ndr
, "info", r
->out
.info
);
13523 ndr_print_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
);
13524 ndr_print_netr_DomainInfo(ndr
, "info", r
->out
.info
);
13526 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
13532 static enum ndr_err_code
ndr_push_netr_ServerPasswordSet2(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordSet2
*r
)
13534 if (flags
& NDR_IN
) {
13535 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13536 if (r
->in
.server_name
) {
13537 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13538 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13539 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13540 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
));
13542 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13543 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13544 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13545 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
));
13546 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
13547 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13548 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13549 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13550 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
));
13551 if (r
->in
.credential
== NULL
) {
13552 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13554 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13555 if (r
->in
.new_password
== NULL
) {
13556 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13558 NDR_CHECK(ndr_push_netr_CryptPassword(ndr
, NDR_SCALARS
, r
->in
.new_password
));
13560 if (flags
& NDR_OUT
) {
13561 if (r
->out
.return_authenticator
== NULL
) {
13562 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13564 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13565 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
13567 return NDR_ERR_SUCCESS
;
13570 static enum ndr_err_code
ndr_pull_netr_ServerPasswordSet2(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordSet2
*r
)
13572 uint32_t _ptr_server_name
;
13573 TALLOC_CTX
*_mem_save_server_name_0
;
13574 TALLOC_CTX
*_mem_save_credential_0
;
13575 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13576 TALLOC_CTX
*_mem_save_new_password_0
;
13577 if (flags
& NDR_IN
) {
13578 ZERO_STRUCT(r
->out
);
13580 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13581 if (_ptr_server_name
) {
13582 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13584 r
->in
.server_name
= NULL
;
13586 if (r
->in
.server_name
) {
13587 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13588 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13589 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13590 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13591 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13592 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
));
13594 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13595 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
));
13596 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13598 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
13599 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
13600 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
13601 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
));
13603 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
13604 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
));
13605 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
13606 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13607 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13608 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13609 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
));
13611 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13612 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
));
13613 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13614 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
13616 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13617 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
13618 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13619 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
13620 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13621 NDR_PULL_ALLOC(ndr
, r
->in
.new_password
);
13623 _mem_save_new_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13624 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.new_password
, LIBNDR_FLAG_REF_ALLOC
);
13625 NDR_CHECK(ndr_pull_netr_CryptPassword(ndr
, NDR_SCALARS
, r
->in
.new_password
));
13626 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_new_password_0
, LIBNDR_FLAG_REF_ALLOC
);
13627 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13628 ZERO_STRUCTP(r
->out
.return_authenticator
);
13630 if (flags
& NDR_OUT
) {
13631 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13632 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13634 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13635 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13636 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13637 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13638 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
13640 return NDR_ERR_SUCCESS
;
13643 _PUBLIC_
void ndr_print_netr_ServerPasswordSet2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordSet2
*r
)
13645 ndr_print_struct(ndr
, name
, "netr_ServerPasswordSet2");
13647 if (flags
& NDR_SET_VALUES
) {
13648 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13650 if (flags
& NDR_IN
) {
13651 ndr_print_struct(ndr
, "in", "netr_ServerPasswordSet2");
13653 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13655 if (r
->in
.server_name
) {
13656 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13659 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
13660 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
13661 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13662 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
13664 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
13666 ndr_print_ptr(ndr
, "new_password", r
->in
.new_password
);
13668 ndr_print_netr_CryptPassword(ndr
, "new_password", r
->in
.new_password
);
13672 if (flags
& NDR_OUT
) {
13673 ndr_print_struct(ndr
, "out", "netr_ServerPasswordSet2");
13675 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13677 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13679 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
13685 static enum ndr_err_code
ndr_push_netr_ServerPasswordGet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerPasswordGet
*r
)
13687 if (flags
& NDR_IN
) {
13688 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13689 if (r
->in
.server_name
) {
13690 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13691 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13692 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13693 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
));
13695 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13696 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13697 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
13698 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
));
13699 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
13700 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13701 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13702 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
13703 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
));
13704 if (r
->in
.credential
== NULL
) {
13705 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13707 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13709 if (flags
& NDR_OUT
) {
13710 if (r
->out
.return_authenticator
== NULL
) {
13711 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13713 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13714 if (r
->out
.password
== NULL
) {
13715 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13717 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password
));
13718 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13720 return NDR_ERR_SUCCESS
;
13723 static enum ndr_err_code
ndr_pull_netr_ServerPasswordGet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerPasswordGet
*r
)
13725 uint32_t _ptr_server_name
;
13726 TALLOC_CTX
*_mem_save_server_name_0
;
13727 TALLOC_CTX
*_mem_save_credential_0
;
13728 TALLOC_CTX
*_mem_save_return_authenticator_0
;
13729 TALLOC_CTX
*_mem_save_password_0
;
13730 if (flags
& NDR_IN
) {
13731 ZERO_STRUCT(r
->out
);
13733 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13734 if (_ptr_server_name
) {
13735 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13737 r
->in
.server_name
= NULL
;
13739 if (r
->in
.server_name
) {
13740 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13741 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13742 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13743 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13744 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13745 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
));
13747 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13748 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
));
13749 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13751 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
13752 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
13753 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
13754 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
));
13756 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
13757 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
));
13758 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
13759 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
13760 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
13761 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
13762 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
));
13764 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
13765 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
));
13766 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13767 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
13769 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13770 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
13771 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
13772 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
13773 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13774 ZERO_STRUCTP(r
->out
.return_authenticator
);
13775 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
13776 ZERO_STRUCTP(r
->out
.password
);
13778 if (flags
& NDR_OUT
) {
13779 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13780 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
13782 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13783 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
13784 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
13785 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
13786 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13787 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
13789 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13790 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password
, LIBNDR_FLAG_REF_ALLOC
);
13791 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password
));
13792 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, LIBNDR_FLAG_REF_ALLOC
);
13793 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13795 return NDR_ERR_SUCCESS
;
13798 _PUBLIC_
void ndr_print_netr_ServerPasswordGet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerPasswordGet
*r
)
13800 ndr_print_struct(ndr
, name
, "netr_ServerPasswordGet");
13802 if (flags
& NDR_SET_VALUES
) {
13803 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13805 if (flags
& NDR_IN
) {
13806 ndr_print_struct(ndr
, "in", "netr_ServerPasswordGet");
13808 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
13810 if (r
->in
.server_name
) {
13811 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
13814 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
13815 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
13816 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
13817 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
13819 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
13823 if (flags
& NDR_OUT
) {
13824 ndr_print_struct(ndr
, "out", "netr_ServerPasswordGet");
13826 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13828 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
13830 ndr_print_ptr(ndr
, "password", r
->out
.password
);
13832 ndr_print_samr_Password(ndr
, "password", r
->out
.password
);
13834 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13840 static enum ndr_err_code
ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONSENDTOSAM
*r
)
13842 if (flags
& NDR_IN
) {
13844 if (flags
& NDR_OUT
) {
13845 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13847 return NDR_ERR_SUCCESS
;
13850 static enum ndr_err_code
ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONSENDTOSAM
*r
)
13852 if (flags
& NDR_IN
) {
13854 if (flags
& NDR_OUT
) {
13855 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13857 return NDR_ERR_SUCCESS
;
13860 _PUBLIC_
void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONSENDTOSAM
*r
)
13862 ndr_print_struct(ndr
, name
, "netr_NETRLOGONSENDTOSAM");
13864 if (flags
& NDR_SET_VALUES
) {
13865 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
13867 if (flags
& NDR_IN
) {
13868 ndr_print_struct(ndr
, "in", "netr_NETRLOGONSENDTOSAM");
13872 if (flags
& NDR_OUT
) {
13873 ndr_print_struct(ndr
, "out", "netr_NETRLOGONSENDTOSAM");
13875 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
13881 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push
*ndr
, int flags
, const struct netr_DsRAddressToSitenamesW
*r
)
13883 uint32_t cntr_addresses_1
;
13884 if (flags
& NDR_IN
) {
13885 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
13886 if (r
->in
.server_name
) {
13887 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13888 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
13889 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
13890 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
));
13892 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
13893 if (r
->in
.addresses
== NULL
) {
13894 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13896 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
13897 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
13898 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
13900 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
13901 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
13904 if (flags
& NDR_OUT
) {
13905 if (r
->out
.ctr
== NULL
) {
13906 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
13908 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.ctr
));
13910 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
13912 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
13914 return NDR_ERR_SUCCESS
;
13917 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull
*ndr
, int flags
, struct netr_DsRAddressToSitenamesW
*r
)
13919 uint32_t _ptr_server_name
;
13920 uint32_t cntr_addresses_1
;
13922 TALLOC_CTX
*_mem_save_server_name_0
;
13923 TALLOC_CTX
*_mem_save_addresses_1
;
13924 TALLOC_CTX
*_mem_save_ctr_0
;
13925 TALLOC_CTX
*_mem_save_ctr_1
;
13926 if (flags
& NDR_IN
) {
13927 ZERO_STRUCT(r
->out
);
13929 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
13930 if (_ptr_server_name
) {
13931 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
13933 r
->in
.server_name
= NULL
;
13935 if (r
->in
.server_name
) {
13936 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13937 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
13938 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
13939 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
13940 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
13941 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
));
13943 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
13944 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
));
13945 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
13947 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
13948 if (r
->in
.count
> 32000) {
13949 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
13951 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.addresses
));
13952 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13953 NDR_PULL_ALLOC_N(ndr
, r
->in
.addresses
, ndr_get_array_size(ndr
, &r
->in
.addresses
));
13955 _mem_save_addresses_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13956 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.addresses
, 0);
13957 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
13958 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
13960 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
13961 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
13963 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_addresses_1
, 0);
13964 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
13965 ZERO_STRUCTP(r
->out
.ctr
);
13966 if (r
->in
.addresses
) {
13967 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->in
.addresses
, r
->in
.count
));
13970 if (flags
& NDR_OUT
) {
13971 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
13972 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
13974 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
13975 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
13976 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_ctr
));
13978 NDR_PULL_ALLOC(ndr
, *r
->out
.ctr
);
13980 *r
->out
.ctr
= NULL
;
13983 _mem_save_ctr_1
= NDR_PULL_GET_MEM_CTX(ndr
);
13984 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.ctr
, 0);
13985 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
13986 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_1
, 0);
13988 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
13989 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
13991 return NDR_ERR_SUCCESS
;
13994 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRAddressToSitenamesW
*r
)
13996 uint32_t cntr_addresses_1
;
13997 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesW");
13999 if (flags
& NDR_SET_VALUES
) {
14000 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14002 if (flags
& NDR_IN
) {
14003 ndr_print_struct(ndr
, "in", "netr_DsRAddressToSitenamesW");
14005 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14007 if (r
->in
.server_name
) {
14008 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14011 ndr_print_uint32(ndr
, "count", r
->in
.count
);
14012 ndr_print_ptr(ndr
, "addresses", r
->in
.addresses
);
14014 ndr
->print(ndr
, "%s: ARRAY(%d)", "addresses", (int)r
->in
.count
);
14016 for (cntr_addresses_1
=0;cntr_addresses_1
<r
->in
.count
;cntr_addresses_1
++) {
14018 if (asprintf(&idx_1
, "[%d]", cntr_addresses_1
) != -1) {
14019 ndr_print_netr_DsRAddress(ndr
, "addresses", &r
->in
.addresses
[cntr_addresses_1
]);
14027 if (flags
& NDR_OUT
) {
14028 ndr_print_struct(ndr
, "out", "netr_DsRAddressToSitenamesW");
14030 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
14032 ndr_print_ptr(ndr
, "ctr", *r
->out
.ctr
);
14035 ndr_print_netr_DsRAddressToSitenamesWCtr(ndr
, "ctr", *r
->out
.ctr
);
14039 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14045 static enum ndr_err_code
ndr_push_netr_DsRGetDCNameEx2(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetDCNameEx2
*r
)
14047 if (flags
& NDR_IN
) {
14048 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_unc
));
14049 if (r
->in
.server_unc
) {
14050 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
14051 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14052 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_unc
, CH_UTF16
)));
14053 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
));
14055 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.client_account
));
14056 if (r
->in
.client_account
) {
14057 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.client_account
, CH_UTF16
)));
14058 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14059 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.client_account
, CH_UTF16
)));
14060 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
));
14062 NDR_CHECK(ndr_push_samr_AcctFlags(ndr
, NDR_SCALARS
, r
->in
.mask
));
14063 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_name
));
14064 if (r
->in
.domain_name
) {
14065 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
14066 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14067 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain_name
, CH_UTF16
)));
14068 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
));
14070 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
14071 if (r
->in
.domain_guid
) {
14072 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
14074 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.site_name
));
14075 if (r
->in
.site_name
) {
14076 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
14077 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14078 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.site_name
, CH_UTF16
)));
14079 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
));
14081 NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, r
->in
.flags
));
14083 if (flags
& NDR_OUT
) {
14084 if (r
->out
.info
== NULL
) {
14085 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14087 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.info
));
14088 if (*r
->out
.info
) {
14089 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
14091 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14093 return NDR_ERR_SUCCESS
;
14096 static enum ndr_err_code
ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetDCNameEx2
*r
)
14098 uint32_t _ptr_server_unc
;
14099 uint32_t _ptr_client_account
;
14100 uint32_t _ptr_domain_name
;
14101 uint32_t _ptr_domain_guid
;
14102 uint32_t _ptr_site_name
;
14103 uint32_t _ptr_info
;
14104 TALLOC_CTX
*_mem_save_server_unc_0
;
14105 TALLOC_CTX
*_mem_save_client_account_0
;
14106 TALLOC_CTX
*_mem_save_domain_name_0
;
14107 TALLOC_CTX
*_mem_save_domain_guid_0
;
14108 TALLOC_CTX
*_mem_save_site_name_0
;
14109 TALLOC_CTX
*_mem_save_info_0
;
14110 TALLOC_CTX
*_mem_save_info_1
;
14111 if (flags
& NDR_IN
) {
14112 ZERO_STRUCT(r
->out
);
14114 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_unc
));
14115 if (_ptr_server_unc
) {
14116 NDR_PULL_ALLOC(ndr
, r
->in
.server_unc
);
14118 r
->in
.server_unc
= NULL
;
14120 if (r
->in
.server_unc
) {
14121 _mem_save_server_unc_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14122 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_unc
, 0);
14123 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_unc
));
14124 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_unc
));
14125 if (ndr_get_array_length(ndr
, &r
->in
.server_unc
) > ndr_get_array_size(ndr
, &r
->in
.server_unc
)) {
14126 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
));
14128 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_unc
), sizeof(uint16_t)));
14129 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
));
14130 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_unc_0
, 0);
14132 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_client_account
));
14133 if (_ptr_client_account
) {
14134 NDR_PULL_ALLOC(ndr
, r
->in
.client_account
);
14136 r
->in
.client_account
= NULL
;
14138 if (r
->in
.client_account
) {
14139 _mem_save_client_account_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14140 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.client_account
, 0);
14141 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.client_account
));
14142 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.client_account
));
14143 if (ndr_get_array_length(ndr
, &r
->in
.client_account
) > ndr_get_array_size(ndr
, &r
->in
.client_account
)) {
14144 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
));
14146 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.client_account
), sizeof(uint16_t)));
14147 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
));
14148 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_client_account_0
, 0);
14150 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr
, NDR_SCALARS
, &r
->in
.mask
));
14151 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_name
));
14152 if (_ptr_domain_name
) {
14153 NDR_PULL_ALLOC(ndr
, r
->in
.domain_name
);
14155 r
->in
.domain_name
= NULL
;
14157 if (r
->in
.domain_name
) {
14158 _mem_save_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14159 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_name
, 0);
14160 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain_name
));
14161 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain_name
));
14162 if (ndr_get_array_length(ndr
, &r
->in
.domain_name
) > ndr_get_array_size(ndr
, &r
->in
.domain_name
)) {
14163 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
));
14165 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain_name
), sizeof(uint16_t)));
14166 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
));
14167 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_name_0
, 0);
14169 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
14170 if (_ptr_domain_guid
) {
14171 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
14173 r
->in
.domain_guid
= NULL
;
14175 if (r
->in
.domain_guid
) {
14176 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14177 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
14178 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
14179 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
14181 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_site_name
));
14182 if (_ptr_site_name
) {
14183 NDR_PULL_ALLOC(ndr
, r
->in
.site_name
);
14185 r
->in
.site_name
= NULL
;
14187 if (r
->in
.site_name
) {
14188 _mem_save_site_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14189 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.site_name
, 0);
14190 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.site_name
));
14191 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.site_name
));
14192 if (ndr_get_array_length(ndr
, &r
->in
.site_name
) > ndr_get_array_size(ndr
, &r
->in
.site_name
)) {
14193 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
));
14195 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.site_name
), sizeof(uint16_t)));
14196 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
));
14197 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_site_name_0
, 0);
14199 NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr
, NDR_SCALARS
, &r
->in
.flags
));
14200 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
14201 ZERO_STRUCTP(r
->out
.info
);
14203 if (flags
& NDR_OUT
) {
14204 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14205 NDR_PULL_ALLOC(ndr
, r
->out
.info
);
14207 _mem_save_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14208 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.info
, LIBNDR_FLAG_REF_ALLOC
);
14209 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_info
));
14211 NDR_PULL_ALLOC(ndr
, *r
->out
.info
);
14213 *r
->out
.info
= NULL
;
14215 if (*r
->out
.info
) {
14216 _mem_save_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
14217 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.info
, 0);
14218 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.info
));
14219 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_1
, 0);
14221 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_info_0
, LIBNDR_FLAG_REF_ALLOC
);
14222 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14224 return NDR_ERR_SUCCESS
;
14227 _PUBLIC_
void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetDCNameEx2
*r
)
14229 ndr_print_struct(ndr
, name
, "netr_DsRGetDCNameEx2");
14231 if (flags
& NDR_SET_VALUES
) {
14232 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14234 if (flags
& NDR_IN
) {
14235 ndr_print_struct(ndr
, "in", "netr_DsRGetDCNameEx2");
14237 ndr_print_ptr(ndr
, "server_unc", r
->in
.server_unc
);
14239 if (r
->in
.server_unc
) {
14240 ndr_print_string(ndr
, "server_unc", r
->in
.server_unc
);
14243 ndr_print_ptr(ndr
, "client_account", r
->in
.client_account
);
14245 if (r
->in
.client_account
) {
14246 ndr_print_string(ndr
, "client_account", r
->in
.client_account
);
14249 ndr_print_samr_AcctFlags(ndr
, "mask", r
->in
.mask
);
14250 ndr_print_ptr(ndr
, "domain_name", r
->in
.domain_name
);
14252 if (r
->in
.domain_name
) {
14253 ndr_print_string(ndr
, "domain_name", r
->in
.domain_name
);
14256 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
14258 if (r
->in
.domain_guid
) {
14259 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
14262 ndr_print_ptr(ndr
, "site_name", r
->in
.site_name
);
14264 if (r
->in
.site_name
) {
14265 ndr_print_string(ndr
, "site_name", r
->in
.site_name
);
14268 ndr_print_netr_DsRGetDCName_flags(ndr
, "flags", r
->in
.flags
);
14271 if (flags
& NDR_OUT
) {
14272 ndr_print_struct(ndr
, "out", "netr_DsRGetDCNameEx2");
14274 ndr_print_ptr(ndr
, "info", r
->out
.info
);
14276 ndr_print_ptr(ndr
, "info", *r
->out
.info
);
14278 if (*r
->out
.info
) {
14279 ndr_print_netr_DsRGetDCNameInfo(ndr
, "info", *r
->out
.info
);
14283 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14289 static enum ndr_err_code
ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push
*ndr
, int flags
, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
14291 if (flags
& NDR_IN
) {
14293 if (flags
& NDR_OUT
) {
14294 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14296 return NDR_ERR_SUCCESS
;
14299 static enum ndr_err_code
ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull
*ndr
, int flags
, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
14301 if (flags
& NDR_IN
) {
14303 if (flags
& NDR_OUT
) {
14304 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14306 return NDR_ERR_SUCCESS
;
14309 _PUBLIC_
void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*r
)
14311 ndr_print_struct(ndr
, name
, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14313 if (flags
& NDR_SET_VALUES
) {
14314 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14316 if (flags
& NDR_IN
) {
14317 ndr_print_struct(ndr
, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14321 if (flags
& NDR_OUT
) {
14322 ndr_print_struct(ndr
, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
14324 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14330 static enum ndr_err_code
ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push
*ndr
, int flags
, const struct netr_NetrEnumerateTrustedDomainsEx
*r
)
14332 if (flags
& NDR_IN
) {
14333 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
14334 if (r
->in
.server_name
) {
14335 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14336 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14337 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14338 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
));
14341 if (flags
& NDR_OUT
) {
14342 if (r
->out
.dom_trust_list
== NULL
) {
14343 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14345 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.dom_trust_list
));
14346 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14348 return NDR_ERR_SUCCESS
;
14351 static enum ndr_err_code
ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull
*ndr
, int flags
, struct netr_NetrEnumerateTrustedDomainsEx
*r
)
14353 uint32_t _ptr_server_name
;
14354 TALLOC_CTX
*_mem_save_server_name_0
;
14355 TALLOC_CTX
*_mem_save_dom_trust_list_0
;
14356 if (flags
& NDR_IN
) {
14357 ZERO_STRUCT(r
->out
);
14359 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
14360 if (_ptr_server_name
) {
14361 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
14363 r
->in
.server_name
= NULL
;
14365 if (r
->in
.server_name
) {
14366 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14367 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
14368 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
14369 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
14370 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
14371 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
));
14373 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
14374 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
));
14375 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
14377 NDR_PULL_ALLOC(ndr
, r
->out
.dom_trust_list
);
14378 ZERO_STRUCTP(r
->out
.dom_trust_list
);
14380 if (flags
& NDR_OUT
) {
14381 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14382 NDR_PULL_ALLOC(ndr
, r
->out
.dom_trust_list
);
14384 _mem_save_dom_trust_list_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14385 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.dom_trust_list
, LIBNDR_FLAG_REF_ALLOC
);
14386 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.dom_trust_list
));
14387 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dom_trust_list_0
, LIBNDR_FLAG_REF_ALLOC
);
14388 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14390 return NDR_ERR_SUCCESS
;
14393 _PUBLIC_
void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_NetrEnumerateTrustedDomainsEx
*r
)
14395 ndr_print_struct(ndr
, name
, "netr_NetrEnumerateTrustedDomainsEx");
14397 if (flags
& NDR_SET_VALUES
) {
14398 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14400 if (flags
& NDR_IN
) {
14401 ndr_print_struct(ndr
, "in", "netr_NetrEnumerateTrustedDomainsEx");
14403 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14405 if (r
->in
.server_name
) {
14406 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14411 if (flags
& NDR_OUT
) {
14412 ndr_print_struct(ndr
, "out", "netr_NetrEnumerateTrustedDomainsEx");
14414 ndr_print_ptr(ndr
, "dom_trust_list", r
->out
.dom_trust_list
);
14416 ndr_print_netr_DomainTrustList(ndr
, "dom_trust_list", r
->out
.dom_trust_list
);
14418 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14424 static enum ndr_err_code
ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push
*ndr
, int flags
, const struct netr_DsRAddressToSitenamesExW
*r
)
14426 uint32_t cntr_addresses_1
;
14427 if (flags
& NDR_IN
) {
14428 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
14429 if (r
->in
.server_name
) {
14430 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14431 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14432 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14433 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
));
14435 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
14436 if (r
->in
.addresses
== NULL
) {
14437 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14439 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.count
));
14440 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
14441 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
14443 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
14444 NDR_CHECK(ndr_push_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
14447 if (flags
& NDR_OUT
) {
14448 if (r
->out
.ctr
== NULL
) {
14449 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14451 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.ctr
));
14453 NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
14455 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14457 return NDR_ERR_SUCCESS
;
14460 static enum ndr_err_code
ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull
*ndr
, int flags
, struct netr_DsRAddressToSitenamesExW
*r
)
14462 uint32_t _ptr_server_name
;
14463 uint32_t cntr_addresses_1
;
14465 TALLOC_CTX
*_mem_save_server_name_0
;
14466 TALLOC_CTX
*_mem_save_addresses_1
;
14467 TALLOC_CTX
*_mem_save_ctr_0
;
14468 TALLOC_CTX
*_mem_save_ctr_1
;
14469 if (flags
& NDR_IN
) {
14470 ZERO_STRUCT(r
->out
);
14472 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
14473 if (_ptr_server_name
) {
14474 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
14476 r
->in
.server_name
= NULL
;
14478 if (r
->in
.server_name
) {
14479 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14480 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
14481 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
14482 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
14483 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
14484 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
));
14486 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
14487 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
));
14488 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
14490 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.count
));
14491 if (r
->in
.count
> 32000) {
14492 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
14494 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.addresses
));
14495 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14496 NDR_PULL_ALLOC_N(ndr
, r
->in
.addresses
, ndr_get_array_size(ndr
, &r
->in
.addresses
));
14498 _mem_save_addresses_1
= NDR_PULL_GET_MEM_CTX(ndr
);
14499 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.addresses
, 0);
14500 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
14501 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_SCALARS
, &r
->in
.addresses
[cntr_addresses_1
]));
14503 for (cntr_addresses_1
= 0; cntr_addresses_1
< r
->in
.count
; cntr_addresses_1
++) {
14504 NDR_CHECK(ndr_pull_netr_DsRAddress(ndr
, NDR_BUFFERS
, &r
->in
.addresses
[cntr_addresses_1
]));
14506 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_addresses_1
, 0);
14507 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
14508 ZERO_STRUCTP(r
->out
.ctr
);
14509 if (r
->in
.addresses
) {
14510 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->in
.addresses
, r
->in
.count
));
14513 if (flags
& NDR_OUT
) {
14514 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14515 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
14517 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14518 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
14519 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_ctr
));
14521 NDR_PULL_ALLOC(ndr
, *r
->out
.ctr
);
14523 *r
->out
.ctr
= NULL
;
14526 _mem_save_ctr_1
= NDR_PULL_GET_MEM_CTX(ndr
);
14527 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.ctr
, 0);
14528 NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
14529 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_1
, 0);
14531 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
14532 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14534 return NDR_ERR_SUCCESS
;
14537 _PUBLIC_
void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRAddressToSitenamesExW
*r
)
14539 uint32_t cntr_addresses_1
;
14540 ndr_print_struct(ndr
, name
, "netr_DsRAddressToSitenamesExW");
14542 if (flags
& NDR_SET_VALUES
) {
14543 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14545 if (flags
& NDR_IN
) {
14546 ndr_print_struct(ndr
, "in", "netr_DsRAddressToSitenamesExW");
14548 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14550 if (r
->in
.server_name
) {
14551 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14554 ndr_print_uint32(ndr
, "count", r
->in
.count
);
14555 ndr_print_ptr(ndr
, "addresses", r
->in
.addresses
);
14557 ndr
->print(ndr
, "%s: ARRAY(%d)", "addresses", (int)r
->in
.count
);
14559 for (cntr_addresses_1
=0;cntr_addresses_1
<r
->in
.count
;cntr_addresses_1
++) {
14561 if (asprintf(&idx_1
, "[%d]", cntr_addresses_1
) != -1) {
14562 ndr_print_netr_DsRAddress(ndr
, "addresses", &r
->in
.addresses
[cntr_addresses_1
]);
14570 if (flags
& NDR_OUT
) {
14571 ndr_print_struct(ndr
, "out", "netr_DsRAddressToSitenamesExW");
14573 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
14575 ndr_print_ptr(ndr
, "ctr", *r
->out
.ctr
);
14578 ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr
, "ctr", *r
->out
.ctr
);
14582 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14588 static enum ndr_err_code
ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push
*ndr
, int flags
, const struct netr_DsrGetDcSiteCoverageW
*r
)
14590 if (flags
& NDR_IN
) {
14591 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
14592 if (r
->in
.server_name
) {
14593 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14594 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14595 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14596 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
));
14599 if (flags
& NDR_OUT
) {
14600 if (r
->out
.ctr
== NULL
) {
14601 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14603 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.ctr
));
14605 NDR_CHECK(ndr_push_DcSitesCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
14607 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14609 return NDR_ERR_SUCCESS
;
14612 static enum ndr_err_code
ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull
*ndr
, int flags
, struct netr_DsrGetDcSiteCoverageW
*r
)
14614 uint32_t _ptr_server_name
;
14616 TALLOC_CTX
*_mem_save_server_name_0
;
14617 TALLOC_CTX
*_mem_save_ctr_0
;
14618 TALLOC_CTX
*_mem_save_ctr_1
;
14619 if (flags
& NDR_IN
) {
14620 ZERO_STRUCT(r
->out
);
14622 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
14623 if (_ptr_server_name
) {
14624 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
14626 r
->in
.server_name
= NULL
;
14628 if (r
->in
.server_name
) {
14629 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14630 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
14631 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
14632 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
14633 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
14634 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
));
14636 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
14637 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
));
14638 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
14640 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
14641 ZERO_STRUCTP(r
->out
.ctr
);
14643 if (flags
& NDR_OUT
) {
14644 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14645 NDR_PULL_ALLOC(ndr
, r
->out
.ctr
);
14647 _mem_save_ctr_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14648 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.ctr
, LIBNDR_FLAG_REF_ALLOC
);
14649 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_ctr
));
14651 NDR_PULL_ALLOC(ndr
, *r
->out
.ctr
);
14653 *r
->out
.ctr
= NULL
;
14656 _mem_save_ctr_1
= NDR_PULL_GET_MEM_CTX(ndr
);
14657 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.ctr
, 0);
14658 NDR_CHECK(ndr_pull_DcSitesCtr(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.ctr
));
14659 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_1
, 0);
14661 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_ctr_0
, LIBNDR_FLAG_REF_ALLOC
);
14662 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14664 return NDR_ERR_SUCCESS
;
14667 _PUBLIC_
void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsrGetDcSiteCoverageW
*r
)
14669 ndr_print_struct(ndr
, name
, "netr_DsrGetDcSiteCoverageW");
14671 if (flags
& NDR_SET_VALUES
) {
14672 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14674 if (flags
& NDR_IN
) {
14675 ndr_print_struct(ndr
, "in", "netr_DsrGetDcSiteCoverageW");
14677 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14679 if (r
->in
.server_name
) {
14680 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14685 if (flags
& NDR_OUT
) {
14686 ndr_print_struct(ndr
, "out", "netr_DsrGetDcSiteCoverageW");
14688 ndr_print_ptr(ndr
, "ctr", r
->out
.ctr
);
14690 ndr_print_ptr(ndr
, "ctr", *r
->out
.ctr
);
14693 ndr_print_DcSitesCtr(ndr
, "ctr", *r
->out
.ctr
);
14697 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
14703 static enum ndr_err_code
ndr_push_netr_LogonSamLogonEx(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogonEx
*r
)
14705 if (flags
& NDR_IN
) {
14706 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
14707 if (r
->in
.server_name
) {
14708 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14709 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14710 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14711 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
));
14713 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
14714 if (r
->in
.computer_name
) {
14715 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
14716 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14717 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
14718 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
));
14720 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
14721 if (r
->in
.logon
== NULL
) {
14722 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14724 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
14725 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
14726 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
14727 if (r
->in
.flags
== NULL
) {
14728 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14730 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.flags
));
14732 if (flags
& NDR_OUT
) {
14733 if (r
->out
.validation
== NULL
) {
14734 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14736 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
14737 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
14738 if (r
->out
.authoritative
== NULL
) {
14739 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14741 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
14742 if (r
->out
.flags
== NULL
) {
14743 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14745 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.flags
));
14746 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
14748 return NDR_ERR_SUCCESS
;
14751 static enum ndr_err_code
ndr_pull_netr_LogonSamLogonEx(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogonEx
*r
)
14753 uint32_t _ptr_server_name
;
14754 uint32_t _ptr_computer_name
;
14755 TALLOC_CTX
*_mem_save_server_name_0
;
14756 TALLOC_CTX
*_mem_save_computer_name_0
;
14757 TALLOC_CTX
*_mem_save_logon_0
;
14758 TALLOC_CTX
*_mem_save_validation_0
;
14759 TALLOC_CTX
*_mem_save_authoritative_0
;
14760 TALLOC_CTX
*_mem_save_flags_0
;
14761 if (flags
& NDR_IN
) {
14762 ZERO_STRUCT(r
->out
);
14764 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
14765 if (_ptr_server_name
) {
14766 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
14768 r
->in
.server_name
= NULL
;
14770 if (r
->in
.server_name
) {
14771 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14772 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
14773 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
14774 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
14775 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
14776 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
));
14778 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
14779 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
));
14780 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
14782 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
14783 if (_ptr_computer_name
) {
14784 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
14786 r
->in
.computer_name
= NULL
;
14788 if (r
->in
.computer_name
) {
14789 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14790 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
14791 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
14792 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
14793 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
14794 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
));
14796 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
14797 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
));
14798 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
14800 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
14801 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14802 NDR_PULL_ALLOC(ndr
, r
->in
.logon
);
14804 _mem_save_logon_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14805 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon
, LIBNDR_FLAG_REF_ALLOC
);
14806 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
14807 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
14808 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_0
, LIBNDR_FLAG_REF_ALLOC
);
14809 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
14810 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14811 NDR_PULL_ALLOC(ndr
, r
->in
.flags
);
14813 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14814 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.flags
, LIBNDR_FLAG_REF_ALLOC
);
14815 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
14816 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
14817 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
14818 ZERO_STRUCTP(r
->out
.validation
);
14819 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
14820 ZERO_STRUCTP(r
->out
.authoritative
);
14821 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
14822 *r
->out
.flags
= *r
->in
.flags
;
14824 if (flags
& NDR_OUT
) {
14825 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14826 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
14828 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14829 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
14830 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
14831 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
14832 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
14833 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14834 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
14836 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14837 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
14838 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
14839 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
14840 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14841 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
14843 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14844 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.flags
, LIBNDR_FLAG_REF_ALLOC
);
14845 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.flags
));
14846 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
14847 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
14849 return NDR_ERR_SUCCESS
;
14852 _PUBLIC_
void ndr_print_netr_LogonSamLogonEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogonEx
*r
)
14854 ndr_print_struct(ndr
, name
, "netr_LogonSamLogonEx");
14856 if (flags
& NDR_SET_VALUES
) {
14857 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14859 if (flags
& NDR_IN
) {
14860 ndr_print_struct(ndr
, "in", "netr_LogonSamLogonEx");
14862 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14864 if (r
->in
.server_name
) {
14865 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14868 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
14870 if (r
->in
.computer_name
) {
14871 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
14874 ndr_print_netr_LogonInfoClass(ndr
, "logon_level", r
->in
.logon_level
);
14875 ndr_print_ptr(ndr
, "logon", r
->in
.logon
);
14877 ndr_print_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
);
14878 ndr_print_netr_LogonLevel(ndr
, "logon", r
->in
.logon
);
14880 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
14881 ndr_print_ptr(ndr
, "flags", r
->in
.flags
);
14883 ndr_print_uint32(ndr
, "flags", *r
->in
.flags
);
14887 if (flags
& NDR_OUT
) {
14888 ndr_print_struct(ndr
, "out", "netr_LogonSamLogonEx");
14890 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
14892 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
14893 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
14895 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
14897 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
14899 ndr_print_ptr(ndr
, "flags", r
->out
.flags
);
14901 ndr_print_uint32(ndr
, "flags", *r
->out
.flags
);
14903 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
14909 static enum ndr_err_code
ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push
*ndr
, int flags
, const struct netr_DsrEnumerateDomainTrusts
*r
)
14911 if (flags
& NDR_IN
) {
14912 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
14913 if (r
->in
.server_name
) {
14914 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14915 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
14916 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
14917 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
));
14919 NDR_CHECK(ndr_push_netr_TrustFlags(ndr
, NDR_SCALARS
, r
->in
.trust_flags
));
14921 if (flags
& NDR_OUT
) {
14922 if (r
->out
.trusts
== NULL
) {
14923 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
14925 NDR_CHECK(ndr_push_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusts
));
14926 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
14928 return NDR_ERR_SUCCESS
;
14931 static enum ndr_err_code
ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull
*ndr
, int flags
, struct netr_DsrEnumerateDomainTrusts
*r
)
14933 uint32_t _ptr_server_name
;
14934 TALLOC_CTX
*_mem_save_server_name_0
;
14935 TALLOC_CTX
*_mem_save_trusts_0
;
14936 if (flags
& NDR_IN
) {
14937 ZERO_STRUCT(r
->out
);
14939 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
14940 if (_ptr_server_name
) {
14941 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
14943 r
->in
.server_name
= NULL
;
14945 if (r
->in
.server_name
) {
14946 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14947 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
14948 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
14949 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
14950 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
14951 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
));
14953 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
14954 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
));
14955 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
14957 NDR_CHECK(ndr_pull_netr_TrustFlags(ndr
, NDR_SCALARS
, &r
->in
.trust_flags
));
14958 NDR_PULL_ALLOC(ndr
, r
->out
.trusts
);
14959 ZERO_STRUCTP(r
->out
.trusts
);
14961 if (flags
& NDR_OUT
) {
14962 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
14963 NDR_PULL_ALLOC(ndr
, r
->out
.trusts
);
14965 _mem_save_trusts_0
= NDR_PULL_GET_MEM_CTX(ndr
);
14966 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.trusts
, LIBNDR_FLAG_REF_ALLOC
);
14967 NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.trusts
));
14968 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusts_0
, LIBNDR_FLAG_REF_ALLOC
);
14969 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
14971 return NDR_ERR_SUCCESS
;
14974 _PUBLIC_
void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsrEnumerateDomainTrusts
*r
)
14976 ndr_print_struct(ndr
, name
, "netr_DsrEnumerateDomainTrusts");
14978 if (flags
& NDR_SET_VALUES
) {
14979 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
14981 if (flags
& NDR_IN
) {
14982 ndr_print_struct(ndr
, "in", "netr_DsrEnumerateDomainTrusts");
14984 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
14986 if (r
->in
.server_name
) {
14987 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
14990 ndr_print_netr_TrustFlags(ndr
, "trust_flags", r
->in
.trust_flags
);
14993 if (flags
& NDR_OUT
) {
14994 ndr_print_struct(ndr
, "out", "netr_DsrEnumerateDomainTrusts");
14996 ndr_print_ptr(ndr
, "trusts", r
->out
.trusts
);
14998 ndr_print_netr_DomainTrustList(ndr
, "trusts", r
->out
.trusts
);
15000 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
15006 static enum ndr_err_code
ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push
*ndr
, int flags
, const struct netr_DsrDeregisterDNSHostRecords
*r
)
15008 if (flags
& NDR_IN
) {
15009 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15010 if (r
->in
.server_name
) {
15011 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15012 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15013 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15014 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
));
15016 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain
));
15017 if (r
->in
.domain
) {
15018 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain
, CH_UTF16
)));
15019 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15020 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.domain
, CH_UTF16
)));
15021 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->in
.domain
, ndr_charset_length(r
->in
.domain
, CH_UTF16
), sizeof(uint16_t), CH_UTF16
));
15023 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.domain_guid
));
15024 if (r
->in
.domain_guid
) {
15025 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
15027 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.dsa_guid
));
15028 if (r
->in
.dsa_guid
) {
15029 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, r
->in
.dsa_guid
));
15031 if (r
->in
.dns_host
== NULL
) {
15032 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15034 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.dns_host
, CH_UTF16
)));
15035 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15036 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.dns_host
, CH_UTF16
)));
15037 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
));
15039 if (flags
& NDR_OUT
) {
15040 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
15042 return NDR_ERR_SUCCESS
;
15045 static enum ndr_err_code
ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull
*ndr
, int flags
, struct netr_DsrDeregisterDNSHostRecords
*r
)
15047 uint32_t _ptr_server_name
;
15048 uint32_t _ptr_domain
;
15049 uint32_t _ptr_domain_guid
;
15050 uint32_t _ptr_dsa_guid
;
15051 TALLOC_CTX
*_mem_save_server_name_0
;
15052 TALLOC_CTX
*_mem_save_domain_0
;
15053 TALLOC_CTX
*_mem_save_domain_guid_0
;
15054 TALLOC_CTX
*_mem_save_dsa_guid_0
;
15055 if (flags
& NDR_IN
) {
15056 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
15057 if (_ptr_server_name
) {
15058 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
15060 r
->in
.server_name
= NULL
;
15062 if (r
->in
.server_name
) {
15063 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15064 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
15065 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
15066 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
15067 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
15068 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
));
15070 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
15071 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
));
15072 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
15074 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain
));
15076 NDR_PULL_ALLOC(ndr
, r
->in
.domain
);
15078 r
->in
.domain
= NULL
;
15080 if (r
->in
.domain
) {
15081 _mem_save_domain_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15082 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain
, 0);
15083 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.domain
));
15084 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.domain
));
15085 if (ndr_get_array_length(ndr
, &r
->in
.domain
) > ndr_get_array_size(ndr
, &r
->in
.domain
)) {
15086 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
));
15088 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.domain
), sizeof(uint16_t)));
15089 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->in
.domain
, ndr_get_array_length(ndr
, &r
->in
.domain
), sizeof(uint16_t), CH_UTF16
));
15090 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_0
, 0);
15092 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_domain_guid
));
15093 if (_ptr_domain_guid
) {
15094 NDR_PULL_ALLOC(ndr
, r
->in
.domain_guid
);
15096 r
->in
.domain_guid
= NULL
;
15098 if (r
->in
.domain_guid
) {
15099 _mem_save_domain_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15100 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.domain_guid
, 0);
15101 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.domain_guid
));
15102 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_domain_guid_0
, 0);
15104 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dsa_guid
));
15105 if (_ptr_dsa_guid
) {
15106 NDR_PULL_ALLOC(ndr
, r
->in
.dsa_guid
);
15108 r
->in
.dsa_guid
= NULL
;
15110 if (r
->in
.dsa_guid
) {
15111 _mem_save_dsa_guid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15112 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.dsa_guid
, 0);
15113 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, r
->in
.dsa_guid
));
15114 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dsa_guid_0
, 0);
15116 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.dns_host
));
15117 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.dns_host
));
15118 if (ndr_get_array_length(ndr
, &r
->in
.dns_host
) > ndr_get_array_size(ndr
, &r
->in
.dns_host
)) {
15119 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
));
15121 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.dns_host
), sizeof(uint16_t)));
15122 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
));
15124 if (flags
& NDR_OUT
) {
15125 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
15127 return NDR_ERR_SUCCESS
;
15130 _PUBLIC_
void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsrDeregisterDNSHostRecords
*r
)
15132 ndr_print_struct(ndr
, name
, "netr_DsrDeregisterDNSHostRecords");
15134 if (flags
& NDR_SET_VALUES
) {
15135 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
15137 if (flags
& NDR_IN
) {
15138 ndr_print_struct(ndr
, "in", "netr_DsrDeregisterDNSHostRecords");
15140 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
15142 if (r
->in
.server_name
) {
15143 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
15146 ndr_print_ptr(ndr
, "domain", r
->in
.domain
);
15148 if (r
->in
.domain
) {
15149 ndr_print_string(ndr
, "domain", r
->in
.domain
);
15152 ndr_print_ptr(ndr
, "domain_guid", r
->in
.domain_guid
);
15154 if (r
->in
.domain_guid
) {
15155 ndr_print_GUID(ndr
, "domain_guid", r
->in
.domain_guid
);
15158 ndr_print_ptr(ndr
, "dsa_guid", r
->in
.dsa_guid
);
15160 if (r
->in
.dsa_guid
) {
15161 ndr_print_GUID(ndr
, "dsa_guid", r
->in
.dsa_guid
);
15164 ndr_print_ptr(ndr
, "dns_host", r
->in
.dns_host
);
15166 ndr_print_string(ndr
, "dns_host", r
->in
.dns_host
);
15170 if (flags
& NDR_OUT
) {
15171 ndr_print_struct(ndr
, "out", "netr_DsrDeregisterDNSHostRecords");
15173 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
15179 static enum ndr_err_code
ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push
*ndr
, int flags
, const struct netr_ServerTrustPasswordsGet
*r
)
15181 if (flags
& NDR_IN
) {
15182 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15183 if (r
->in
.server_name
) {
15184 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15185 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15186 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15187 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
));
15189 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
15190 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15191 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
15192 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
));
15193 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
15194 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15195 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15196 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15197 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
));
15198 if (r
->in
.credential
== NULL
) {
15199 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15201 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15203 if (flags
& NDR_OUT
) {
15204 if (r
->out
.return_authenticator
== NULL
) {
15205 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15207 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15208 if (r
->out
.password
== NULL
) {
15209 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15211 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password
));
15212 if (r
->out
.password2
== NULL
) {
15213 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15215 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password2
));
15216 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
15218 return NDR_ERR_SUCCESS
;
15221 static enum ndr_err_code
ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull
*ndr
, int flags
, struct netr_ServerTrustPasswordsGet
*r
)
15223 uint32_t _ptr_server_name
;
15224 TALLOC_CTX
*_mem_save_server_name_0
;
15225 TALLOC_CTX
*_mem_save_credential_0
;
15226 TALLOC_CTX
*_mem_save_return_authenticator_0
;
15227 TALLOC_CTX
*_mem_save_password_0
;
15228 TALLOC_CTX
*_mem_save_password2_0
;
15229 if (flags
& NDR_IN
) {
15230 ZERO_STRUCT(r
->out
);
15232 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
15233 if (_ptr_server_name
) {
15234 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
15236 r
->in
.server_name
= NULL
;
15238 if (r
->in
.server_name
) {
15239 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15240 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
15241 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
15242 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
15243 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
15244 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
));
15246 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
15247 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
));
15248 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
15250 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
15251 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
15252 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
15253 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
));
15255 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
15256 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
));
15257 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
15258 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
15259 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
15260 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
15261 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
));
15263 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
15264 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
));
15265 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15266 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
15268 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15269 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
15270 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15271 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
15272 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
15273 ZERO_STRUCTP(r
->out
.return_authenticator
);
15274 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
15275 ZERO_STRUCTP(r
->out
.password
);
15276 NDR_PULL_ALLOC(ndr
, r
->out
.password2
);
15277 ZERO_STRUCTP(r
->out
.password2
);
15279 if (flags
& NDR_OUT
) {
15280 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15281 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
15283 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15284 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
15285 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15286 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
15287 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15288 NDR_PULL_ALLOC(ndr
, r
->out
.password
);
15290 _mem_save_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15291 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password
, LIBNDR_FLAG_REF_ALLOC
);
15292 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password
));
15293 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password_0
, LIBNDR_FLAG_REF_ALLOC
);
15294 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15295 NDR_PULL_ALLOC(ndr
, r
->out
.password2
);
15297 _mem_save_password2_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15298 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.password2
, LIBNDR_FLAG_REF_ALLOC
);
15299 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->out
.password2
));
15300 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_password2_0
, LIBNDR_FLAG_REF_ALLOC
);
15301 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
15303 return NDR_ERR_SUCCESS
;
15306 _PUBLIC_
void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerTrustPasswordsGet
*r
)
15308 ndr_print_struct(ndr
, name
, "netr_ServerTrustPasswordsGet");
15310 if (flags
& NDR_SET_VALUES
) {
15311 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
15313 if (flags
& NDR_IN
) {
15314 ndr_print_struct(ndr
, "in", "netr_ServerTrustPasswordsGet");
15316 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
15318 if (r
->in
.server_name
) {
15319 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
15322 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
15323 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
15324 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
15325 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
15327 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
15331 if (flags
& NDR_OUT
) {
15332 ndr_print_struct(ndr
, "out", "netr_ServerTrustPasswordsGet");
15334 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15336 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15338 ndr_print_ptr(ndr
, "password", r
->out
.password
);
15340 ndr_print_samr_Password(ndr
, "password", r
->out
.password
);
15342 ndr_print_ptr(ndr
, "password2", r
->out
.password2
);
15344 ndr_print_samr_Password(ndr
, "password2", r
->out
.password2
);
15346 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
15352 static enum ndr_err_code
ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push
*ndr
, int flags
, const struct netr_DsRGetForestTrustInformation
*r
)
15354 if (flags
& NDR_IN
) {
15355 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15356 if (r
->in
.server_name
) {
15357 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15358 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15359 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15360 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
));
15362 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.trusted_domain_name
));
15363 if (r
->in
.trusted_domain_name
) {
15364 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
15365 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15366 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
15367 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
));
15369 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
15371 if (flags
& NDR_OUT
) {
15372 if (r
->out
.forest_trust_info
== NULL
) {
15373 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15375 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.forest_trust_info
));
15376 if (*r
->out
.forest_trust_info
) {
15377 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
15379 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
15381 return NDR_ERR_SUCCESS
;
15384 static enum ndr_err_code
ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull
*ndr
, int flags
, struct netr_DsRGetForestTrustInformation
*r
)
15386 uint32_t _ptr_server_name
;
15387 uint32_t _ptr_trusted_domain_name
;
15388 uint32_t _ptr_forest_trust_info
;
15389 TALLOC_CTX
*_mem_save_server_name_0
;
15390 TALLOC_CTX
*_mem_save_trusted_domain_name_0
;
15391 TALLOC_CTX
*_mem_save_forest_trust_info_0
;
15392 TALLOC_CTX
*_mem_save_forest_trust_info_1
;
15393 if (flags
& NDR_IN
) {
15394 ZERO_STRUCT(r
->out
);
15396 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
15397 if (_ptr_server_name
) {
15398 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
15400 r
->in
.server_name
= NULL
;
15402 if (r
->in
.server_name
) {
15403 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15404 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
15405 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
15406 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
15407 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
15408 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
));
15410 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
15411 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
));
15412 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
15414 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trusted_domain_name
));
15415 if (_ptr_trusted_domain_name
) {
15416 NDR_PULL_ALLOC(ndr
, r
->in
.trusted_domain_name
);
15418 r
->in
.trusted_domain_name
= NULL
;
15420 if (r
->in
.trusted_domain_name
) {
15421 _mem_save_trusted_domain_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15422 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.trusted_domain_name
, 0);
15423 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.trusted_domain_name
));
15424 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.trusted_domain_name
));
15425 if (ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
) > ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
)) {
15426 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
));
15428 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t)));
15429 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
));
15430 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trusted_domain_name_0
, 0);
15432 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.flags
));
15433 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
15434 ZERO_STRUCTP(r
->out
.forest_trust_info
);
15436 if (flags
& NDR_OUT
) {
15437 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15438 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
15440 _mem_save_forest_trust_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15441 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
15442 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_forest_trust_info
));
15443 if (_ptr_forest_trust_info
) {
15444 NDR_PULL_ALLOC(ndr
, *r
->out
.forest_trust_info
);
15446 *r
->out
.forest_trust_info
= NULL
;
15448 if (*r
->out
.forest_trust_info
) {
15449 _mem_save_forest_trust_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
15450 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.forest_trust_info
, 0);
15451 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
15452 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_1
, 0);
15454 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_0
, LIBNDR_FLAG_REF_ALLOC
);
15455 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
15457 return NDR_ERR_SUCCESS
;
15460 _PUBLIC_
void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_DsRGetForestTrustInformation
*r
)
15462 ndr_print_struct(ndr
, name
, "netr_DsRGetForestTrustInformation");
15464 if (flags
& NDR_SET_VALUES
) {
15465 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
15467 if (flags
& NDR_IN
) {
15468 ndr_print_struct(ndr
, "in", "netr_DsRGetForestTrustInformation");
15470 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
15472 if (r
->in
.server_name
) {
15473 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
15476 ndr_print_ptr(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
15478 if (r
->in
.trusted_domain_name
) {
15479 ndr_print_string(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
15482 ndr_print_uint32(ndr
, "flags", r
->in
.flags
);
15485 if (flags
& NDR_OUT
) {
15486 ndr_print_struct(ndr
, "out", "netr_DsRGetForestTrustInformation");
15488 ndr_print_ptr(ndr
, "forest_trust_info", r
->out
.forest_trust_info
);
15490 ndr_print_ptr(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
15492 if (*r
->out
.forest_trust_info
) {
15493 ndr_print_lsa_ForestTrustInformation(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
15497 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
15503 static enum ndr_err_code
ndr_push_netr_GetForestTrustInformation(struct ndr_push
*ndr
, int flags
, const struct netr_GetForestTrustInformation
*r
)
15505 if (flags
& NDR_IN
) {
15506 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15507 if (r
->in
.server_name
) {
15508 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15509 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15510 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15511 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
));
15513 if (r
->in
.trusted_domain_name
== NULL
) {
15514 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15516 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
15517 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15518 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.trusted_domain_name
, CH_UTF16
)));
15519 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
));
15520 if (r
->in
.credential
== NULL
) {
15521 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15523 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15524 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
15526 if (flags
& NDR_OUT
) {
15527 if (r
->out
.return_authenticator
== NULL
) {
15528 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15530 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15531 if (r
->out
.forest_trust_info
== NULL
) {
15532 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15534 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.forest_trust_info
));
15535 if (*r
->out
.forest_trust_info
) {
15536 NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
15538 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
15540 return NDR_ERR_SUCCESS
;
15543 static enum ndr_err_code
ndr_pull_netr_GetForestTrustInformation(struct ndr_pull
*ndr
, int flags
, struct netr_GetForestTrustInformation
*r
)
15545 uint32_t _ptr_server_name
;
15546 uint32_t _ptr_forest_trust_info
;
15547 TALLOC_CTX
*_mem_save_server_name_0
;
15548 TALLOC_CTX
*_mem_save_credential_0
;
15549 TALLOC_CTX
*_mem_save_return_authenticator_0
;
15550 TALLOC_CTX
*_mem_save_forest_trust_info_0
;
15551 TALLOC_CTX
*_mem_save_forest_trust_info_1
;
15552 if (flags
& NDR_IN
) {
15553 ZERO_STRUCT(r
->out
);
15555 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
15556 if (_ptr_server_name
) {
15557 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
15559 r
->in
.server_name
= NULL
;
15561 if (r
->in
.server_name
) {
15562 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15563 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
15564 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
15565 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
15566 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
15567 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
));
15569 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
15570 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
));
15571 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
15573 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.trusted_domain_name
));
15574 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.trusted_domain_name
));
15575 if (ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
) > ndr_get_array_size(ndr
, &r
->in
.trusted_domain_name
)) {
15576 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
));
15578 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.trusted_domain_name
), sizeof(uint16_t)));
15579 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
));
15580 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15581 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
15583 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15584 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
15585 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15586 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
15587 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.flags
));
15588 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
15589 ZERO_STRUCTP(r
->out
.return_authenticator
);
15590 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
15591 ZERO_STRUCTP(r
->out
.forest_trust_info
);
15593 if (flags
& NDR_OUT
) {
15594 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15595 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
15597 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15598 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
15599 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15600 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
15601 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15602 NDR_PULL_ALLOC(ndr
, r
->out
.forest_trust_info
);
15604 _mem_save_forest_trust_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15605 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.forest_trust_info
, LIBNDR_FLAG_REF_ALLOC
);
15606 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_forest_trust_info
));
15607 if (_ptr_forest_trust_info
) {
15608 NDR_PULL_ALLOC(ndr
, *r
->out
.forest_trust_info
);
15610 *r
->out
.forest_trust_info
= NULL
;
15612 if (*r
->out
.forest_trust_info
) {
15613 _mem_save_forest_trust_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
15614 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.forest_trust_info
, 0);
15615 NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.forest_trust_info
));
15616 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_1
, 0);
15618 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_forest_trust_info_0
, LIBNDR_FLAG_REF_ALLOC
);
15619 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
15621 return NDR_ERR_SUCCESS
;
15624 _PUBLIC_
void ndr_print_netr_GetForestTrustInformation(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_GetForestTrustInformation
*r
)
15626 ndr_print_struct(ndr
, name
, "netr_GetForestTrustInformation");
15628 if (flags
& NDR_SET_VALUES
) {
15629 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
15631 if (flags
& NDR_IN
) {
15632 ndr_print_struct(ndr
, "in", "netr_GetForestTrustInformation");
15634 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
15636 if (r
->in
.server_name
) {
15637 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
15640 ndr_print_ptr(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
15642 ndr_print_string(ndr
, "trusted_domain_name", r
->in
.trusted_domain_name
);
15644 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
15646 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
15648 ndr_print_uint32(ndr
, "flags", r
->in
.flags
);
15651 if (flags
& NDR_OUT
) {
15652 ndr_print_struct(ndr
, "out", "netr_GetForestTrustInformation");
15654 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15656 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15658 ndr_print_ptr(ndr
, "forest_trust_info", r
->out
.forest_trust_info
);
15660 ndr_print_ptr(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
15662 if (*r
->out
.forest_trust_info
) {
15663 ndr_print_lsa_ForestTrustInformation(ndr
, "forest_trust_info", *r
->out
.forest_trust_info
);
15667 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
15673 static enum ndr_err_code
ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push
*ndr
, int flags
, const struct netr_LogonSamLogonWithFlags
*r
)
15675 if (flags
& NDR_IN
) {
15676 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15677 if (r
->in
.server_name
) {
15678 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15679 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15680 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15681 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
));
15683 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.computer_name
));
15684 if (r
->in
.computer_name
) {
15685 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15686 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15687 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15688 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
));
15690 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.credential
));
15691 if (r
->in
.credential
) {
15692 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15694 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.return_authenticator
));
15695 if (r
->in
.return_authenticator
) {
15696 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
15698 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr
, NDR_SCALARS
, r
->in
.logon_level
));
15699 if (r
->in
.logon
== NULL
) {
15700 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15702 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
15703 NDR_CHECK(ndr_push_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
15704 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->in
.validation_level
));
15705 if (r
->in
.flags
== NULL
) {
15706 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15708 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->in
.flags
));
15710 if (flags
& NDR_OUT
) {
15711 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->out
.return_authenticator
));
15712 if (r
->out
.return_authenticator
) {
15713 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15715 if (r
->out
.validation
== NULL
) {
15716 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15718 NDR_CHECK(ndr_push_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
15719 NDR_CHECK(ndr_push_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
15720 if (r
->out
.authoritative
== NULL
) {
15721 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15723 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, *r
->out
.authoritative
));
15724 if (r
->out
.flags
== NULL
) {
15725 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15727 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, *r
->out
.flags
));
15728 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
15730 return NDR_ERR_SUCCESS
;
15733 static enum ndr_err_code
ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull
*ndr
, int flags
, struct netr_LogonSamLogonWithFlags
*r
)
15735 uint32_t _ptr_server_name
;
15736 uint32_t _ptr_computer_name
;
15737 uint32_t _ptr_credential
;
15738 uint32_t _ptr_return_authenticator
;
15739 TALLOC_CTX
*_mem_save_server_name_0
;
15740 TALLOC_CTX
*_mem_save_computer_name_0
;
15741 TALLOC_CTX
*_mem_save_credential_0
;
15742 TALLOC_CTX
*_mem_save_return_authenticator_0
;
15743 TALLOC_CTX
*_mem_save_logon_0
;
15744 TALLOC_CTX
*_mem_save_validation_0
;
15745 TALLOC_CTX
*_mem_save_authoritative_0
;
15746 TALLOC_CTX
*_mem_save_flags_0
;
15747 if (flags
& NDR_IN
) {
15748 ZERO_STRUCT(r
->out
);
15750 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
15751 if (_ptr_server_name
) {
15752 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
15754 r
->in
.server_name
= NULL
;
15756 if (r
->in
.server_name
) {
15757 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15758 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
15759 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
15760 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
15761 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
15762 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
));
15764 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
15765 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
));
15766 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
15768 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_computer_name
));
15769 if (_ptr_computer_name
) {
15770 NDR_PULL_ALLOC(ndr
, r
->in
.computer_name
);
15772 r
->in
.computer_name
= NULL
;
15774 if (r
->in
.computer_name
) {
15775 _mem_save_computer_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15776 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.computer_name
, 0);
15777 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
15778 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
15779 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
15780 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
));
15782 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
15783 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
));
15784 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_computer_name_0
, 0);
15786 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_credential
));
15787 if (_ptr_credential
) {
15788 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
15790 r
->in
.credential
= NULL
;
15792 if (r
->in
.credential
) {
15793 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15794 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, 0);
15795 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15796 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, 0);
15798 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
15799 if (_ptr_return_authenticator
) {
15800 NDR_PULL_ALLOC(ndr
, r
->in
.return_authenticator
);
15802 r
->in
.return_authenticator
= NULL
;
15804 if (r
->in
.return_authenticator
) {
15805 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15806 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.return_authenticator
, 0);
15807 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.return_authenticator
));
15808 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
15810 NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr
, NDR_SCALARS
, &r
->in
.logon_level
));
15811 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15812 NDR_PULL_ALLOC(ndr
, r
->in
.logon
);
15814 _mem_save_logon_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15815 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.logon
, LIBNDR_FLAG_REF_ALLOC
);
15816 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
));
15817 NDR_CHECK(ndr_pull_netr_LogonLevel(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.logon
));
15818 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_logon_0
, LIBNDR_FLAG_REF_ALLOC
);
15819 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->in
.validation_level
));
15820 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15821 NDR_PULL_ALLOC(ndr
, r
->in
.flags
);
15823 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15824 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.flags
, LIBNDR_FLAG_REF_ALLOC
);
15825 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->in
.flags
));
15826 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
15827 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
15828 ZERO_STRUCTP(r
->out
.validation
);
15829 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
15830 ZERO_STRUCTP(r
->out
.authoritative
);
15831 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
15832 *r
->out
.flags
= *r
->in
.flags
;
15834 if (flags
& NDR_OUT
) {
15835 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_return_authenticator
));
15836 if (_ptr_return_authenticator
) {
15837 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
15839 r
->out
.return_authenticator
= NULL
;
15841 if (r
->out
.return_authenticator
) {
15842 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15843 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, 0);
15844 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15845 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, 0);
15847 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15848 NDR_PULL_ALLOC(ndr
, r
->out
.validation
);
15850 _mem_save_validation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15851 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.validation
, LIBNDR_FLAG_REF_ALLOC
);
15852 NDR_CHECK(ndr_pull_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
));
15853 NDR_CHECK(ndr_pull_netr_Validation(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->out
.validation
));
15854 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_validation_0
, LIBNDR_FLAG_REF_ALLOC
);
15855 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15856 NDR_PULL_ALLOC(ndr
, r
->out
.authoritative
);
15858 _mem_save_authoritative_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15859 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.authoritative
, LIBNDR_FLAG_REF_ALLOC
);
15860 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, r
->out
.authoritative
));
15861 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_authoritative_0
, LIBNDR_FLAG_REF_ALLOC
);
15862 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
15863 NDR_PULL_ALLOC(ndr
, r
->out
.flags
);
15865 _mem_save_flags_0
= NDR_PULL_GET_MEM_CTX(ndr
);
15866 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.flags
, LIBNDR_FLAG_REF_ALLOC
);
15867 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, r
->out
.flags
));
15868 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_flags_0
, LIBNDR_FLAG_REF_ALLOC
);
15869 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
15871 return NDR_ERR_SUCCESS
;
15874 _PUBLIC_
void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_LogonSamLogonWithFlags
*r
)
15876 ndr_print_struct(ndr
, name
, "netr_LogonSamLogonWithFlags");
15878 if (flags
& NDR_SET_VALUES
) {
15879 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
15881 if (flags
& NDR_IN
) {
15882 ndr_print_struct(ndr
, "in", "netr_LogonSamLogonWithFlags");
15884 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
15886 if (r
->in
.server_name
) {
15887 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
15890 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
15892 if (r
->in
.computer_name
) {
15893 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
15896 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
15898 if (r
->in
.credential
) {
15899 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
15902 ndr_print_ptr(ndr
, "return_authenticator", r
->in
.return_authenticator
);
15904 if (r
->in
.return_authenticator
) {
15905 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->in
.return_authenticator
);
15908 ndr_print_netr_LogonInfoClass(ndr
, "logon_level", r
->in
.logon_level
);
15909 ndr_print_ptr(ndr
, "logon", r
->in
.logon
);
15911 ndr_print_set_switch_value(ndr
, r
->in
.logon
, r
->in
.logon_level
);
15912 ndr_print_netr_LogonLevel(ndr
, "logon", r
->in
.logon
);
15914 ndr_print_uint16(ndr
, "validation_level", r
->in
.validation_level
);
15915 ndr_print_ptr(ndr
, "flags", r
->in
.flags
);
15917 ndr_print_uint32(ndr
, "flags", *r
->in
.flags
);
15921 if (flags
& NDR_OUT
) {
15922 ndr_print_struct(ndr
, "out", "netr_LogonSamLogonWithFlags");
15924 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15926 if (r
->out
.return_authenticator
) {
15927 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
15930 ndr_print_ptr(ndr
, "validation", r
->out
.validation
);
15932 ndr_print_set_switch_value(ndr
, r
->out
.validation
, r
->in
.validation_level
);
15933 ndr_print_netr_Validation(ndr
, "validation", r
->out
.validation
);
15935 ndr_print_ptr(ndr
, "authoritative", r
->out
.authoritative
);
15937 ndr_print_uint8(ndr
, "authoritative", *r
->out
.authoritative
);
15939 ndr_print_ptr(ndr
, "flags", r
->out
.flags
);
15941 ndr_print_uint32(ndr
, "flags", *r
->out
.flags
);
15943 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
15949 static enum ndr_err_code
ndr_push_netr_ServerGetTrustInfo(struct ndr_push
*ndr
, int flags
, const struct netr_ServerGetTrustInfo
*r
)
15951 if (flags
& NDR_IN
) {
15952 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server_name
));
15953 if (r
->in
.server_name
) {
15954 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15955 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15956 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.server_name
, CH_UTF16
)));
15957 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
));
15959 if (r
->in
.account_name
== NULL
) {
15960 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15962 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
15963 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15964 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.account_name
, CH_UTF16
)));
15965 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
));
15966 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->in
.secure_channel_type
));
15967 if (r
->in
.computer_name
== NULL
) {
15968 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15970 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15971 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
15972 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_charset_length(r
->in
.computer_name
, CH_UTF16
)));
15973 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
));
15974 if (r
->in
.credential
== NULL
) {
15975 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15977 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
15979 if (flags
& NDR_OUT
) {
15980 if (r
->out
.return_authenticator
== NULL
) {
15981 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15983 NDR_CHECK(ndr_push_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
15984 if (r
->out
.new_owf_password
== NULL
) {
15985 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15987 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->out
.new_owf_password
));
15988 if (r
->out
.old_owf_password
== NULL
) {
15989 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15991 NDR_CHECK(ndr_push_samr_Password(ndr
, NDR_SCALARS
, r
->out
.old_owf_password
));
15992 if (r
->out
.trust_info
== NULL
) {
15993 return ndr_push_error(ndr
, NDR_ERR_INVALID_POINTER
, "NULL [ref] pointer");
15995 NDR_CHECK(ndr_push_unique_ptr(ndr
, *r
->out
.trust_info
));
15996 if (*r
->out
.trust_info
) {
15997 NDR_CHECK(ndr_push_netr_TrustInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.trust_info
));
15999 NDR_CHECK(ndr_push_NTSTATUS(ndr
, NDR_SCALARS
, r
->out
.result
));
16001 return NDR_ERR_SUCCESS
;
16004 static enum ndr_err_code
ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull
*ndr
, int flags
, struct netr_ServerGetTrustInfo
*r
)
16006 uint32_t _ptr_server_name
;
16007 uint32_t _ptr_trust_info
;
16008 TALLOC_CTX
*_mem_save_server_name_0
;
16009 TALLOC_CTX
*_mem_save_credential_0
;
16010 TALLOC_CTX
*_mem_save_return_authenticator_0
;
16011 TALLOC_CTX
*_mem_save_new_owf_password_0
;
16012 TALLOC_CTX
*_mem_save_old_owf_password_0
;
16013 TALLOC_CTX
*_mem_save_trust_info_0
;
16014 TALLOC_CTX
*_mem_save_trust_info_1
;
16015 if (flags
& NDR_IN
) {
16016 ZERO_STRUCT(r
->out
);
16018 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server_name
));
16019 if (_ptr_server_name
) {
16020 NDR_PULL_ALLOC(ndr
, r
->in
.server_name
);
16022 r
->in
.server_name
= NULL
;
16024 if (r
->in
.server_name
) {
16025 _mem_save_server_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16026 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server_name
, 0);
16027 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.server_name
));
16028 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.server_name
));
16029 if (ndr_get_array_length(ndr
, &r
->in
.server_name
) > ndr_get_array_size(ndr
, &r
->in
.server_name
)) {
16030 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
));
16032 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.server_name
), sizeof(uint16_t)));
16033 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
));
16034 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_name_0
, 0);
16036 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.account_name
));
16037 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.account_name
));
16038 if (ndr_get_array_length(ndr
, &r
->in
.account_name
) > ndr_get_array_size(ndr
, &r
->in
.account_name
)) {
16039 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
));
16041 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.account_name
), sizeof(uint16_t)));
16042 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
));
16043 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->in
.secure_channel_type
));
16044 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->in
.computer_name
));
16045 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->in
.computer_name
));
16046 if (ndr_get_array_length(ndr
, &r
->in
.computer_name
) > ndr_get_array_size(ndr
, &r
->in
.computer_name
)) {
16047 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
));
16049 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->in
.computer_name
), sizeof(uint16_t)));
16050 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
));
16051 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
16052 NDR_PULL_ALLOC(ndr
, r
->in
.credential
);
16054 _mem_save_credential_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16055 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.credential
, LIBNDR_FLAG_REF_ALLOC
);
16056 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->in
.credential
));
16057 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_credential_0
, LIBNDR_FLAG_REF_ALLOC
);
16058 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
16059 ZERO_STRUCTP(r
->out
.return_authenticator
);
16060 NDR_PULL_ALLOC(ndr
, r
->out
.new_owf_password
);
16061 ZERO_STRUCTP(r
->out
.new_owf_password
);
16062 NDR_PULL_ALLOC(ndr
, r
->out
.old_owf_password
);
16063 ZERO_STRUCTP(r
->out
.old_owf_password
);
16064 NDR_PULL_ALLOC(ndr
, r
->out
.trust_info
);
16065 ZERO_STRUCTP(r
->out
.trust_info
);
16067 if (flags
& NDR_OUT
) {
16068 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
16069 NDR_PULL_ALLOC(ndr
, r
->out
.return_authenticator
);
16071 _mem_save_return_authenticator_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16072 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.return_authenticator
, LIBNDR_FLAG_REF_ALLOC
);
16073 NDR_CHECK(ndr_pull_netr_Authenticator(ndr
, NDR_SCALARS
, r
->out
.return_authenticator
));
16074 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_return_authenticator_0
, LIBNDR_FLAG_REF_ALLOC
);
16075 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
16076 NDR_PULL_ALLOC(ndr
, r
->out
.new_owf_password
);
16078 _mem_save_new_owf_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16079 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.new_owf_password
, LIBNDR_FLAG_REF_ALLOC
);
16080 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->out
.new_owf_password
));
16081 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_new_owf_password_0
, LIBNDR_FLAG_REF_ALLOC
);
16082 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
16083 NDR_PULL_ALLOC(ndr
, r
->out
.old_owf_password
);
16085 _mem_save_old_owf_password_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16086 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.old_owf_password
, LIBNDR_FLAG_REF_ALLOC
);
16087 NDR_CHECK(ndr_pull_samr_Password(ndr
, NDR_SCALARS
, r
->out
.old_owf_password
));
16088 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_old_owf_password_0
, LIBNDR_FLAG_REF_ALLOC
);
16089 if (ndr
->flags
& LIBNDR_FLAG_REF_ALLOC
) {
16090 NDR_PULL_ALLOC(ndr
, r
->out
.trust_info
);
16092 _mem_save_trust_info_0
= NDR_PULL_GET_MEM_CTX(ndr
);
16093 NDR_PULL_SET_MEM_CTX(ndr
, r
->out
.trust_info
, LIBNDR_FLAG_REF_ALLOC
);
16094 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_trust_info
));
16095 if (_ptr_trust_info
) {
16096 NDR_PULL_ALLOC(ndr
, *r
->out
.trust_info
);
16098 *r
->out
.trust_info
= NULL
;
16100 if (*r
->out
.trust_info
) {
16101 _mem_save_trust_info_1
= NDR_PULL_GET_MEM_CTX(ndr
);
16102 NDR_PULL_SET_MEM_CTX(ndr
, *r
->out
.trust_info
, 0);
16103 NDR_CHECK(ndr_pull_netr_TrustInfo(ndr
, NDR_SCALARS
|NDR_BUFFERS
, *r
->out
.trust_info
));
16104 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trust_info_1
, 0);
16106 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_trust_info_0
, LIBNDR_FLAG_REF_ALLOC
);
16107 NDR_CHECK(ndr_pull_NTSTATUS(ndr
, NDR_SCALARS
, &r
->out
.result
));
16109 return NDR_ERR_SUCCESS
;
16112 _PUBLIC_
void ndr_print_netr_ServerGetTrustInfo(struct ndr_print
*ndr
, const char *name
, int flags
, const struct netr_ServerGetTrustInfo
*r
)
16114 ndr_print_struct(ndr
, name
, "netr_ServerGetTrustInfo");
16116 if (flags
& NDR_SET_VALUES
) {
16117 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
16119 if (flags
& NDR_IN
) {
16120 ndr_print_struct(ndr
, "in", "netr_ServerGetTrustInfo");
16122 ndr_print_ptr(ndr
, "server_name", r
->in
.server_name
);
16124 if (r
->in
.server_name
) {
16125 ndr_print_string(ndr
, "server_name", r
->in
.server_name
);
16128 ndr_print_ptr(ndr
, "account_name", r
->in
.account_name
);
16130 ndr_print_string(ndr
, "account_name", r
->in
.account_name
);
16132 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->in
.secure_channel_type
);
16133 ndr_print_ptr(ndr
, "computer_name", r
->in
.computer_name
);
16135 ndr_print_string(ndr
, "computer_name", r
->in
.computer_name
);
16137 ndr_print_ptr(ndr
, "credential", r
->in
.credential
);
16139 ndr_print_netr_Authenticator(ndr
, "credential", r
->in
.credential
);
16143 if (flags
& NDR_OUT
) {
16144 ndr_print_struct(ndr
, "out", "netr_ServerGetTrustInfo");
16146 ndr_print_ptr(ndr
, "return_authenticator", r
->out
.return_authenticator
);
16148 ndr_print_netr_Authenticator(ndr
, "return_authenticator", r
->out
.return_authenticator
);
16150 ndr_print_ptr(ndr
, "new_owf_password", r
->out
.new_owf_password
);
16152 ndr_print_samr_Password(ndr
, "new_owf_password", r
->out
.new_owf_password
);
16154 ndr_print_ptr(ndr
, "old_owf_password", r
->out
.old_owf_password
);
16156 ndr_print_samr_Password(ndr
, "old_owf_password", r
->out
.old_owf_password
);
16158 ndr_print_ptr(ndr
, "trust_info", r
->out
.trust_info
);
16160 ndr_print_ptr(ndr
, "trust_info", *r
->out
.trust_info
);
16162 if (*r
->out
.trust_info
) {
16163 ndr_print_netr_TrustInfo(ndr
, "trust_info", *r
->out
.trust_info
);
16167 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
16173 static const struct ndr_interface_call netlogon_calls
[] = {
16175 "netr_LogonUasLogon",
16176 sizeof(struct netr_LogonUasLogon
),
16177 (ndr_push_flags_fn_t
) ndr_push_netr_LogonUasLogon
,
16178 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonUasLogon
,
16179 (ndr_print_function_t
) ndr_print_netr_LogonUasLogon
,
16183 "netr_LogonUasLogoff",
16184 sizeof(struct netr_LogonUasLogoff
),
16185 (ndr_push_flags_fn_t
) ndr_push_netr_LogonUasLogoff
,
16186 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonUasLogoff
,
16187 (ndr_print_function_t
) ndr_print_netr_LogonUasLogoff
,
16191 "netr_LogonSamLogon",
16192 sizeof(struct netr_LogonSamLogon
),
16193 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogon
,
16194 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogon
,
16195 (ndr_print_function_t
) ndr_print_netr_LogonSamLogon
,
16199 "netr_LogonSamLogoff",
16200 sizeof(struct netr_LogonSamLogoff
),
16201 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogoff
,
16202 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogoff
,
16203 (ndr_print_function_t
) ndr_print_netr_LogonSamLogoff
,
16207 "netr_ServerReqChallenge",
16208 sizeof(struct netr_ServerReqChallenge
),
16209 (ndr_push_flags_fn_t
) ndr_push_netr_ServerReqChallenge
,
16210 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerReqChallenge
,
16211 (ndr_print_function_t
) ndr_print_netr_ServerReqChallenge
,
16215 "netr_ServerAuthenticate",
16216 sizeof(struct netr_ServerAuthenticate
),
16217 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate
,
16218 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate
,
16219 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate
,
16223 "netr_ServerPasswordSet",
16224 sizeof(struct netr_ServerPasswordSet
),
16225 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordSet
,
16226 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordSet
,
16227 (ndr_print_function_t
) ndr_print_netr_ServerPasswordSet
,
16231 "netr_DatabaseDeltas",
16232 sizeof(struct netr_DatabaseDeltas
),
16233 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseDeltas
,
16234 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseDeltas
,
16235 (ndr_print_function_t
) ndr_print_netr_DatabaseDeltas
,
16239 "netr_DatabaseSync",
16240 sizeof(struct netr_DatabaseSync
),
16241 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseSync
,
16242 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseSync
,
16243 (ndr_print_function_t
) ndr_print_netr_DatabaseSync
,
16247 "netr_AccountDeltas",
16248 sizeof(struct netr_AccountDeltas
),
16249 (ndr_push_flags_fn_t
) ndr_push_netr_AccountDeltas
,
16250 (ndr_pull_flags_fn_t
) ndr_pull_netr_AccountDeltas
,
16251 (ndr_print_function_t
) ndr_print_netr_AccountDeltas
,
16255 "netr_AccountSync",
16256 sizeof(struct netr_AccountSync
),
16257 (ndr_push_flags_fn_t
) ndr_push_netr_AccountSync
,
16258 (ndr_pull_flags_fn_t
) ndr_pull_netr_AccountSync
,
16259 (ndr_print_function_t
) ndr_print_netr_AccountSync
,
16264 sizeof(struct netr_GetDcName
),
16265 (ndr_push_flags_fn_t
) ndr_push_netr_GetDcName
,
16266 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetDcName
,
16267 (ndr_print_function_t
) ndr_print_netr_GetDcName
,
16271 "netr_LogonControl",
16272 sizeof(struct netr_LogonControl
),
16273 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl
,
16274 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl
,
16275 (ndr_print_function_t
) ndr_print_netr_LogonControl
,
16279 "netr_GetAnyDCName",
16280 sizeof(struct netr_GetAnyDCName
),
16281 (ndr_push_flags_fn_t
) ndr_push_netr_GetAnyDCName
,
16282 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetAnyDCName
,
16283 (ndr_print_function_t
) ndr_print_netr_GetAnyDCName
,
16287 "netr_LogonControl2",
16288 sizeof(struct netr_LogonControl2
),
16289 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl2
,
16290 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl2
,
16291 (ndr_print_function_t
) ndr_print_netr_LogonControl2
,
16295 "netr_ServerAuthenticate2",
16296 sizeof(struct netr_ServerAuthenticate2
),
16297 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate2
,
16298 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate2
,
16299 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate2
,
16303 "netr_DatabaseSync2",
16304 sizeof(struct netr_DatabaseSync2
),
16305 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseSync2
,
16306 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseSync2
,
16307 (ndr_print_function_t
) ndr_print_netr_DatabaseSync2
,
16311 "netr_DatabaseRedo",
16312 sizeof(struct netr_DatabaseRedo
),
16313 (ndr_push_flags_fn_t
) ndr_push_netr_DatabaseRedo
,
16314 (ndr_pull_flags_fn_t
) ndr_pull_netr_DatabaseRedo
,
16315 (ndr_print_function_t
) ndr_print_netr_DatabaseRedo
,
16319 "netr_LogonControl2Ex",
16320 sizeof(struct netr_LogonControl2Ex
),
16321 (ndr_push_flags_fn_t
) ndr_push_netr_LogonControl2Ex
,
16322 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonControl2Ex
,
16323 (ndr_print_function_t
) ndr_print_netr_LogonControl2Ex
,
16327 "netr_NetrEnumerateTrustedDomains",
16328 sizeof(struct netr_NetrEnumerateTrustedDomains
),
16329 (ndr_push_flags_fn_t
) ndr_push_netr_NetrEnumerateTrustedDomains
,
16330 (ndr_pull_flags_fn_t
) ndr_pull_netr_NetrEnumerateTrustedDomains
,
16331 (ndr_print_function_t
) ndr_print_netr_NetrEnumerateTrustedDomains
,
16335 "netr_DsRGetDCName",
16336 sizeof(struct netr_DsRGetDCName
),
16337 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCName
,
16338 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCName
,
16339 (ndr_print_function_t
) ndr_print_netr_DsRGetDCName
,
16343 "netr_LogonGetCapabilities",
16344 sizeof(struct netr_LogonGetCapabilities
),
16345 (ndr_push_flags_fn_t
) ndr_push_netr_LogonGetCapabilities
,
16346 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonGetCapabilities
,
16347 (ndr_print_function_t
) ndr_print_netr_LogonGetCapabilities
,
16351 "netr_NETRLOGONSETSERVICEBITS",
16352 sizeof(struct netr_NETRLOGONSETSERVICEBITS
),
16353 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONSETSERVICEBITS
,
16354 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONSETSERVICEBITS
,
16355 (ndr_print_function_t
) ndr_print_netr_NETRLOGONSETSERVICEBITS
,
16359 "netr_LogonGetTrustRid",
16360 sizeof(struct netr_LogonGetTrustRid
),
16361 (ndr_push_flags_fn_t
) ndr_push_netr_LogonGetTrustRid
,
16362 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonGetTrustRid
,
16363 (ndr_print_function_t
) ndr_print_netr_LogonGetTrustRid
,
16367 "netr_NETRLOGONCOMPUTESERVERDIGEST",
16368 sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST
),
16369 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST
,
16370 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST
,
16371 (ndr_print_function_t
) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST
,
16375 "netr_NETRLOGONCOMPUTECLIENTDIGEST",
16376 sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST
),
16377 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
16378 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
16379 (ndr_print_function_t
) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST
,
16383 "netr_ServerAuthenticate3",
16384 sizeof(struct netr_ServerAuthenticate3
),
16385 (ndr_push_flags_fn_t
) ndr_push_netr_ServerAuthenticate3
,
16386 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerAuthenticate3
,
16387 (ndr_print_function_t
) ndr_print_netr_ServerAuthenticate3
,
16391 "netr_DsRGetDCNameEx",
16392 sizeof(struct netr_DsRGetDCNameEx
),
16393 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCNameEx
,
16394 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCNameEx
,
16395 (ndr_print_function_t
) ndr_print_netr_DsRGetDCNameEx
,
16399 "netr_DsRGetSiteName",
16400 sizeof(struct netr_DsRGetSiteName
),
16401 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetSiteName
,
16402 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetSiteName
,
16403 (ndr_print_function_t
) ndr_print_netr_DsRGetSiteName
,
16407 "netr_LogonGetDomainInfo",
16408 sizeof(struct netr_LogonGetDomainInfo
),
16409 (ndr_push_flags_fn_t
) ndr_push_netr_LogonGetDomainInfo
,
16410 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonGetDomainInfo
,
16411 (ndr_print_function_t
) ndr_print_netr_LogonGetDomainInfo
,
16415 "netr_ServerPasswordSet2",
16416 sizeof(struct netr_ServerPasswordSet2
),
16417 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordSet2
,
16418 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordSet2
,
16419 (ndr_print_function_t
) ndr_print_netr_ServerPasswordSet2
,
16423 "netr_ServerPasswordGet",
16424 sizeof(struct netr_ServerPasswordGet
),
16425 (ndr_push_flags_fn_t
) ndr_push_netr_ServerPasswordGet
,
16426 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerPasswordGet
,
16427 (ndr_print_function_t
) ndr_print_netr_ServerPasswordGet
,
16431 "netr_NETRLOGONSENDTOSAM",
16432 sizeof(struct netr_NETRLOGONSENDTOSAM
),
16433 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONSENDTOSAM
,
16434 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONSENDTOSAM
,
16435 (ndr_print_function_t
) ndr_print_netr_NETRLOGONSENDTOSAM
,
16439 "netr_DsRAddressToSitenamesW",
16440 sizeof(struct netr_DsRAddressToSitenamesW
),
16441 (ndr_push_flags_fn_t
) ndr_push_netr_DsRAddressToSitenamesW
,
16442 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRAddressToSitenamesW
,
16443 (ndr_print_function_t
) ndr_print_netr_DsRAddressToSitenamesW
,
16447 "netr_DsRGetDCNameEx2",
16448 sizeof(struct netr_DsRGetDCNameEx2
),
16449 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetDCNameEx2
,
16450 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetDCNameEx2
,
16451 (ndr_print_function_t
) ndr_print_netr_DsRGetDCNameEx2
,
16455 "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN",
16456 sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
),
16457 (ndr_push_flags_fn_t
) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
16458 (ndr_pull_flags_fn_t
) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
16459 (ndr_print_function_t
) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
16463 "netr_NetrEnumerateTrustedDomainsEx",
16464 sizeof(struct netr_NetrEnumerateTrustedDomainsEx
),
16465 (ndr_push_flags_fn_t
) ndr_push_netr_NetrEnumerateTrustedDomainsEx
,
16466 (ndr_pull_flags_fn_t
) ndr_pull_netr_NetrEnumerateTrustedDomainsEx
,
16467 (ndr_print_function_t
) ndr_print_netr_NetrEnumerateTrustedDomainsEx
,
16471 "netr_DsRAddressToSitenamesExW",
16472 sizeof(struct netr_DsRAddressToSitenamesExW
),
16473 (ndr_push_flags_fn_t
) ndr_push_netr_DsRAddressToSitenamesExW
,
16474 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRAddressToSitenamesExW
,
16475 (ndr_print_function_t
) ndr_print_netr_DsRAddressToSitenamesExW
,
16479 "netr_DsrGetDcSiteCoverageW",
16480 sizeof(struct netr_DsrGetDcSiteCoverageW
),
16481 (ndr_push_flags_fn_t
) ndr_push_netr_DsrGetDcSiteCoverageW
,
16482 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsrGetDcSiteCoverageW
,
16483 (ndr_print_function_t
) ndr_print_netr_DsrGetDcSiteCoverageW
,
16487 "netr_LogonSamLogonEx",
16488 sizeof(struct netr_LogonSamLogonEx
),
16489 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogonEx
,
16490 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogonEx
,
16491 (ndr_print_function_t
) ndr_print_netr_LogonSamLogonEx
,
16495 "netr_DsrEnumerateDomainTrusts",
16496 sizeof(struct netr_DsrEnumerateDomainTrusts
),
16497 (ndr_push_flags_fn_t
) ndr_push_netr_DsrEnumerateDomainTrusts
,
16498 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsrEnumerateDomainTrusts
,
16499 (ndr_print_function_t
) ndr_print_netr_DsrEnumerateDomainTrusts
,
16503 "netr_DsrDeregisterDNSHostRecords",
16504 sizeof(struct netr_DsrDeregisterDNSHostRecords
),
16505 (ndr_push_flags_fn_t
) ndr_push_netr_DsrDeregisterDNSHostRecords
,
16506 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsrDeregisterDNSHostRecords
,
16507 (ndr_print_function_t
) ndr_print_netr_DsrDeregisterDNSHostRecords
,
16511 "netr_ServerTrustPasswordsGet",
16512 sizeof(struct netr_ServerTrustPasswordsGet
),
16513 (ndr_push_flags_fn_t
) ndr_push_netr_ServerTrustPasswordsGet
,
16514 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerTrustPasswordsGet
,
16515 (ndr_print_function_t
) ndr_print_netr_ServerTrustPasswordsGet
,
16519 "netr_DsRGetForestTrustInformation",
16520 sizeof(struct netr_DsRGetForestTrustInformation
),
16521 (ndr_push_flags_fn_t
) ndr_push_netr_DsRGetForestTrustInformation
,
16522 (ndr_pull_flags_fn_t
) ndr_pull_netr_DsRGetForestTrustInformation
,
16523 (ndr_print_function_t
) ndr_print_netr_DsRGetForestTrustInformation
,
16527 "netr_GetForestTrustInformation",
16528 sizeof(struct netr_GetForestTrustInformation
),
16529 (ndr_push_flags_fn_t
) ndr_push_netr_GetForestTrustInformation
,
16530 (ndr_pull_flags_fn_t
) ndr_pull_netr_GetForestTrustInformation
,
16531 (ndr_print_function_t
) ndr_print_netr_GetForestTrustInformation
,
16535 "netr_LogonSamLogonWithFlags",
16536 sizeof(struct netr_LogonSamLogonWithFlags
),
16537 (ndr_push_flags_fn_t
) ndr_push_netr_LogonSamLogonWithFlags
,
16538 (ndr_pull_flags_fn_t
) ndr_pull_netr_LogonSamLogonWithFlags
,
16539 (ndr_print_function_t
) ndr_print_netr_LogonSamLogonWithFlags
,
16543 "netr_ServerGetTrustInfo",
16544 sizeof(struct netr_ServerGetTrustInfo
),
16545 (ndr_push_flags_fn_t
) ndr_push_netr_ServerGetTrustInfo
,
16546 (ndr_pull_flags_fn_t
) ndr_pull_netr_ServerGetTrustInfo
,
16547 (ndr_print_function_t
) ndr_print_netr_ServerGetTrustInfo
,
16550 { NULL
, 0, NULL
, NULL
, NULL
, false }
16553 static const char * const netlogon_endpoint_strings
[] = {
16554 "ncacn_np:[\\pipe\\netlogon]",
16559 static const struct ndr_interface_string_array netlogon_endpoints
= {
16561 .names
= netlogon_endpoint_strings
16564 static const char * const netlogon_authservice_strings
[] = {
16568 static const struct ndr_interface_string_array netlogon_authservices
= {
16570 .names
= netlogon_authservice_strings
16574 const struct ndr_interface_table ndr_table_netlogon
= {
16575 .name
= "netlogon",
16577 {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},
16578 NDR_NETLOGON_VERSION
16580 .helpstring
= NDR_NETLOGON_HELPSTRING
,
16582 .calls
= netlogon_calls
,
16583 .endpoints
= &netlogon_endpoints
,
16584 .authservices
= &netlogon_authservices