Add new script for building IDL files in librpc/idl, generating both
[sfrench/samba-autobuild/.git] / librpc / gen_ndr / ndr_winreg.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_winreg.h"
5
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 static enum ndr_err_code ndr_push_winreg_AccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
9 {
10         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
11         return NDR_ERR_SUCCESS;
12 }
13
14 static enum ndr_err_code ndr_pull_winreg_AccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
15 {
16         uint32_t v;
17         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
18         *r = v;
19         return NDR_ERR_SUCCESS;
20 }
21
22 _PUBLIC_ void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
23 {
24         ndr_print_uint32(ndr, name, r);
25         ndr->depth++;
26         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_QUERY_VALUE", KEY_QUERY_VALUE, r);
27         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_SET_VALUE", KEY_SET_VALUE, r);
28         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_SUB_KEY", KEY_CREATE_SUB_KEY, r);
29         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_ENUMERATE_SUB_KEYS", KEY_ENUMERATE_SUB_KEYS, r);
30         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_NOTIFY", KEY_NOTIFY, r);
31         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_LINK", KEY_CREATE_LINK, r);
32         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_64KEY", KEY_WOW64_64KEY, r);
33         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_32KEY", KEY_WOW64_32KEY, r);
34         ndr->depth--;
35 }
36
37 _PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
38 {
39         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
40         return NDR_ERR_SUCCESS;
41 }
42
43 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
44 {
45         uint32_t v;
46         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
47         *r = v;
48         return NDR_ERR_SUCCESS;
49 }
50
51 _PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r)
52 {
53         const char *val = NULL;
54
55         switch (r) {
56                 case REG_NONE: val = "REG_NONE"; break;
57                 case REG_SZ: val = "REG_SZ"; break;
58                 case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break;
59                 case REG_BINARY: val = "REG_BINARY"; break;
60                 case REG_DWORD: val = "REG_DWORD"; break;
61                 case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break;
62                 case REG_LINK: val = "REG_LINK"; break;
63                 case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break;
64                 case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break;
65                 case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break;
66                 case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break;
67                 case REG_QWORD: val = "REG_QWORD"; break;
68         }
69         ndr_print_enum(ndr, name, "ENUM", val, r);
70 }
71
72 _PUBLIC_ enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r)
73 {
74         if (ndr_flags & NDR_SCALARS) {
75                 NDR_CHECK(ndr_push_align(ndr, 4));
76                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
77                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
78                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
79         }
80         if (ndr_flags & NDR_BUFFERS) {
81                 if (r->name) {
82                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
83                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
84                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
85                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
86                 }
87         }
88         return NDR_ERR_SUCCESS;
89 }
90
91 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r)
92 {
93         uint32_t _ptr_name;
94         TALLOC_CTX *_mem_save_name_0;
95         if (ndr_flags & NDR_SCALARS) {
96                 NDR_CHECK(ndr_pull_align(ndr, 4));
97                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len));
98                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_size));
99                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
100                 if (_ptr_name) {
101                         NDR_PULL_ALLOC(ndr, r->name);
102                 } else {
103                         r->name = NULL;
104                 }
105         }
106         if (ndr_flags & NDR_BUFFERS) {
107                 if (r->name) {
108                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
109                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
110                         NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
111                         NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
112                         if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
113                                 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));
114                         }
115                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t)));
116                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
117                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
118                 }
119         }
120         return NDR_ERR_SUCCESS;
121 }
122
123 _PUBLIC_ void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r)
124 {
125         ndr_print_struct(ndr, name, "winreg_String");
126         ndr->depth++;
127         ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_len);
128         ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_size);
129         ndr_print_ptr(ndr, "name", r->name);
130         ndr->depth++;
131         if (r->name) {
132                 ndr_print_string(ndr, "name", r->name);
133         }
134         ndr->depth--;
135         ndr->depth--;
136 }
137
138 static enum ndr_err_code ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityData *r)
139 {
140         if (ndr_flags & NDR_SCALARS) {
141                 NDR_CHECK(ndr_push_align(ndr, 4));
142                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
143                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
144                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
145         }
146         if (ndr_flags & NDR_BUFFERS) {
147                 if (r->data) {
148                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
149                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
150                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
151                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->len));
152                 }
153         }
154         return NDR_ERR_SUCCESS;
155 }
156
157 static enum ndr_err_code ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityData *r)
158 {
159         uint32_t _ptr_data;
160         TALLOC_CTX *_mem_save_data_0;
161         if (ndr_flags & NDR_SCALARS) {
162                 NDR_CHECK(ndr_pull_align(ndr, 4));
163                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
164                 if (_ptr_data) {
165                         NDR_PULL_ALLOC(ndr, r->data);
166                 } else {
167                         r->data = NULL;
168                 }
169                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
170                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len));
171         }
172         if (ndr_flags & NDR_BUFFERS) {
173                 if (r->data) {
174                         _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
175                         NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
176                         NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
177                         NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
178                         if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) {
179                                 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));
180                         }
181                         NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
182                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data)));
183                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
184                 }
185                 if (r->data) {
186                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size));
187                 }
188                 if (r->data) {
189                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->len));
190                 }
191         }
192         return NDR_ERR_SUCCESS;
193 }
194
195 _PUBLIC_ void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r)
196 {
197         ndr_print_struct(ndr, name, "KeySecurityData");
198         ndr->depth++;
199         ndr_print_ptr(ndr, "data", r->data);
200         ndr->depth++;
201         if (r->data) {
202                 ndr_print_array_uint8(ndr, "data", r->data, r->len);
203         }
204         ndr->depth--;
205         ndr_print_uint32(ndr, "size", r->size);
206         ndr_print_uint32(ndr, "len", r->len);
207         ndr->depth--;
208 }
209
210 static enum ndr_err_code ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_SecBuf *r)
211 {
212         if (ndr_flags & NDR_SCALARS) {
213                 NDR_CHECK(ndr_push_align(ndr, 4));
214                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
215                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sd));
216                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit));
217         }
218         if (ndr_flags & NDR_BUFFERS) {
219                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sd));
220         }
221         return NDR_ERR_SUCCESS;
222 }
223
224 static enum ndr_err_code ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_SecBuf *r)
225 {
226         if (ndr_flags & NDR_SCALARS) {
227                 NDR_CHECK(ndr_pull_align(ndr, 4));
228                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
229                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sd));
230                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit));
231         }
232         if (ndr_flags & NDR_BUFFERS) {
233                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sd));
234         }
235         return NDR_ERR_SUCCESS;
236 }
237
238 _PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r)
239 {
240         ndr_print_struct(ndr, name, "winreg_SecBuf");
241         ndr->depth++;
242         ndr_print_uint32(ndr, "length", r->length);
243         ndr_print_KeySecurityData(ndr, "sd", &r->sd);
244         ndr_print_uint8(ndr, "inherit", r->inherit);
245         ndr->depth--;
246 }
247
248 static enum ndr_err_code ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r)
249 {
250         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
251         return NDR_ERR_SUCCESS;
252 }
253
254 static enum ndr_err_code ndr_pull_winreg_CreateAction(struct ndr_pull *ndr, int ndr_flags, enum winreg_CreateAction *r)
255 {
256         uint32_t v;
257         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
258         *r = v;
259         return NDR_ERR_SUCCESS;
260 }
261
262 _PUBLIC_ void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r)
263 {
264         const char *val = NULL;
265
266         switch (r) {
267                 case REG_ACTION_NONE: val = "REG_ACTION_NONE"; break;
268                 case REG_CREATED_NEW_KEY: val = "REG_CREATED_NEW_KEY"; break;
269                 case REG_OPENED_EXISTING_KEY: val = "REG_OPENED_EXISTING_KEY"; break;
270         }
271         ndr_print_enum(ndr, name, "ENUM", val, r);
272 }
273
274 static enum ndr_err_code ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_StringBuf *r)
275 {
276         if (ndr_flags & NDR_SCALARS) {
277                 NDR_CHECK(ndr_push_align(ndr, 4));
278                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
279                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
280                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
281         }
282         if (ndr_flags & NDR_BUFFERS) {
283                 if (r->name) {
284                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2));
285                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
286                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2 / 2));
287                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term(r->name) * 2 / 2, sizeof(uint16_t), CH_UTF16));
288                 }
289         }
290         return NDR_ERR_SUCCESS;
291 }
292
293 static enum ndr_err_code ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_StringBuf *r)
294 {
295         uint32_t _ptr_name;
296         TALLOC_CTX *_mem_save_name_0;
297         if (ndr_flags & NDR_SCALARS) {
298                 NDR_CHECK(ndr_pull_align(ndr, 4));
299                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
300                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
301                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
302                 if (_ptr_name) {
303                         NDR_PULL_ALLOC(ndr, r->name);
304                 } else {
305                         r->name = NULL;
306                 }
307         }
308         if (ndr_flags & NDR_BUFFERS) {
309                 if (r->name) {
310                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
311                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
312                         NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
313                         NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
314                         if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
315                                 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));
316                         }
317                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
318                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
319                 }
320                 if (r->name) {
321                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size / 2));
322                 }
323                 if (r->name) {
324                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length / 2));
325                 }
326         }
327         return NDR_ERR_SUCCESS;
328 }
329
330 _PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r)
331 {
332         ndr_print_struct(ndr, name, "winreg_StringBuf");
333         ndr->depth++;
334         ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->length);
335         ndr_print_uint16(ndr, "size", r->size);
336         ndr_print_ptr(ndr, "name", r->name);
337         ndr->depth++;
338         if (r->name) {
339                 ndr_print_string(ndr, "name", r->name);
340         }
341         ndr->depth--;
342         ndr->depth--;
343 }
344
345 _PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r)
346 {
347         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
348         return NDR_ERR_SUCCESS;
349 }
350
351 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
352 {
353         uint32_t v;
354         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
355         *r = v;
356         return NDR_ERR_SUCCESS;
357 }
358
359 _PUBLIC_ void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r)
360 {
361         ndr_print_uint32(ndr, name, r);
362         ndr->depth++;
363         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_NAME", REG_NOTIFY_CHANGE_NAME, r);
364         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_ATTRIBUTES", REG_NOTIFY_CHANGE_ATTRIBUTES, r);
365         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_LAST_SET", REG_NOTIFY_CHANGE_LAST_SET, r);
366         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_SECURITY", REG_NOTIFY_CHANGE_SECURITY, r);
367         ndr->depth--;
368 }
369
370 static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r)
371 {
372         if (ndr_flags & NDR_SCALARS) {
373                 NDR_CHECK(ndr_push_align(ndr, 4));
374                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_size));
375                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data));
376                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit));
377         }
378         if (ndr_flags & NDR_BUFFERS) {
379                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data));
380         }
381         return NDR_ERR_SUCCESS;
382 }
383
384 static enum ndr_err_code ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityAttribute *r)
385 {
386         if (ndr_flags & NDR_SCALARS) {
387                 NDR_CHECK(ndr_pull_align(ndr, 4));
388                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_size));
389                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data));
390                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit));
391         }
392         if (ndr_flags & NDR_BUFFERS) {
393                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data));
394         }
395         return NDR_ERR_SUCCESS;
396 }
397
398 _PUBLIC_ void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r)
399 {
400         ndr_print_struct(ndr, name, "KeySecurityAttribute");
401         ndr->depth++;
402         ndr_print_uint32(ndr, "data_size", r->data_size);
403         ndr_print_KeySecurityData(ndr, "sec_data", &r->sec_data);
404         ndr_print_uint8(ndr, "inherit", r->inherit);
405         ndr->depth--;
406 }
407
408 static enum ndr_err_code ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const struct QueryMultipleValue *r)
409 {
410         if (ndr_flags & NDR_SCALARS) {
411                 NDR_CHECK(ndr_push_align(ndr, 4));
412                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
413                 NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type));
414                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->offset));
415                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
416         }
417         if (ndr_flags & NDR_BUFFERS) {
418                 if (r->name) {
419                         NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name));
420                 }
421         }
422         return NDR_ERR_SUCCESS;
423 }
424
425 static enum ndr_err_code ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct QueryMultipleValue *r)
426 {
427         uint32_t _ptr_name;
428         TALLOC_CTX *_mem_save_name_0;
429         if (ndr_flags & NDR_SCALARS) {
430                 NDR_CHECK(ndr_pull_align(ndr, 4));
431                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
432                 if (_ptr_name) {
433                         NDR_PULL_ALLOC(ndr, r->name);
434                 } else {
435                         r->name = NULL;
436                 }
437                 NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type));
438                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->offset));
439                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
440         }
441         if (ndr_flags & NDR_BUFFERS) {
442                 if (r->name) {
443                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
444                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
445                         NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name));
446                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
447                 }
448         }
449         return NDR_ERR_SUCCESS;
450 }
451
452 _PUBLIC_ void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r)
453 {
454         ndr_print_struct(ndr, name, "QueryMultipleValue");
455         ndr->depth++;
456         ndr_print_ptr(ndr, "name", r->name);
457         ndr->depth++;
458         if (r->name) {
459                 ndr_print_winreg_String(ndr, "name", r->name);
460         }
461         ndr->depth--;
462         ndr_print_winreg_Type(ndr, "type", r->type);
463         ndr_print_uint32(ndr, "offset", r->offset);
464         ndr_print_uint32(ndr, "length", r->length);
465         ndr->depth--;
466 }
467
468 static enum ndr_err_code ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCR *r)
469 {
470         if (flags & NDR_IN) {
471                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
472                 if (r->in.system_name) {
473                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name));
474                 }
475                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
476         }
477         if (flags & NDR_OUT) {
478                 if (r->out.handle == NULL) {
479                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
480                 }
481                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
482                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
483         }
484         return NDR_ERR_SUCCESS;
485 }
486
487 static enum ndr_err_code ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCR *r)
488 {
489         uint32_t _ptr_system_name;
490         TALLOC_CTX *_mem_save_system_name_0;
491         TALLOC_CTX *_mem_save_handle_0;
492         if (flags & NDR_IN) {
493                 ZERO_STRUCT(r->out);
494
495                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name));
496                 if (_ptr_system_name) {
497                         NDR_PULL_ALLOC(ndr, r->in.system_name);
498                 } else {
499                         r->in.system_name = NULL;
500                 }
501                 if (r->in.system_name) {
502                         _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
503                         NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0);
504                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name));
505                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0);
506                 }
507                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
508                 NDR_PULL_ALLOC(ndr, r->out.handle);
509                 ZERO_STRUCTP(r->out.handle);
510         }
511         if (flags & NDR_OUT) {
512                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
513                         NDR_PULL_ALLOC(ndr, r->out.handle);
514                 }
515                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
516                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
517                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
518                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
519                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
520         }
521         return NDR_ERR_SUCCESS;
522 }
523
524 _PUBLIC_ void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r)
525 {
526         ndr_print_struct(ndr, name, "winreg_OpenHKCR");
527         ndr->depth++;
528         if (flags & NDR_SET_VALUES) {
529                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
530         }
531         if (flags & NDR_IN) {
532                 ndr_print_struct(ndr, "in", "winreg_OpenHKCR");
533                 ndr->depth++;
534                 ndr_print_ptr(ndr, "system_name", r->in.system_name);
535                 ndr->depth++;
536                 if (r->in.system_name) {
537                         ndr_print_uint16(ndr, "system_name", *r->in.system_name);
538                 }
539                 ndr->depth--;
540                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
541                 ndr->depth--;
542         }
543         if (flags & NDR_OUT) {
544                 ndr_print_struct(ndr, "out", "winreg_OpenHKCR");
545                 ndr->depth++;
546                 ndr_print_ptr(ndr, "handle", r->out.handle);
547                 ndr->depth++;
548                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
549                 ndr->depth--;
550                 ndr_print_WERROR(ndr, "result", r->out.result);
551                 ndr->depth--;
552         }
553         ndr->depth--;
554 }
555
556 static enum ndr_err_code ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCU *r)
557 {
558         if (flags & NDR_IN) {
559                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
560                 if (r->in.system_name) {
561                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name));
562                 }
563                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
564         }
565         if (flags & NDR_OUT) {
566                 if (r->out.handle == NULL) {
567                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
568                 }
569                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
570                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
571         }
572         return NDR_ERR_SUCCESS;
573 }
574
575 static enum ndr_err_code ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCU *r)
576 {
577         uint32_t _ptr_system_name;
578         TALLOC_CTX *_mem_save_system_name_0;
579         TALLOC_CTX *_mem_save_handle_0;
580         if (flags & NDR_IN) {
581                 ZERO_STRUCT(r->out);
582
583                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name));
584                 if (_ptr_system_name) {
585                         NDR_PULL_ALLOC(ndr, r->in.system_name);
586                 } else {
587                         r->in.system_name = NULL;
588                 }
589                 if (r->in.system_name) {
590                         _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
591                         NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0);
592                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name));
593                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0);
594                 }
595                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
596                 NDR_PULL_ALLOC(ndr, r->out.handle);
597                 ZERO_STRUCTP(r->out.handle);
598         }
599         if (flags & NDR_OUT) {
600                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
601                         NDR_PULL_ALLOC(ndr, r->out.handle);
602                 }
603                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
604                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
605                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
606                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
607                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
608         }
609         return NDR_ERR_SUCCESS;
610 }
611
612 _PUBLIC_ void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r)
613 {
614         ndr_print_struct(ndr, name, "winreg_OpenHKCU");
615         ndr->depth++;
616         if (flags & NDR_SET_VALUES) {
617                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
618         }
619         if (flags & NDR_IN) {
620                 ndr_print_struct(ndr, "in", "winreg_OpenHKCU");
621                 ndr->depth++;
622                 ndr_print_ptr(ndr, "system_name", r->in.system_name);
623                 ndr->depth++;
624                 if (r->in.system_name) {
625                         ndr_print_uint16(ndr, "system_name", *r->in.system_name);
626                 }
627                 ndr->depth--;
628                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
629                 ndr->depth--;
630         }
631         if (flags & NDR_OUT) {
632                 ndr_print_struct(ndr, "out", "winreg_OpenHKCU");
633                 ndr->depth++;
634                 ndr_print_ptr(ndr, "handle", r->out.handle);
635                 ndr->depth++;
636                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
637                 ndr->depth--;
638                 ndr_print_WERROR(ndr, "result", r->out.result);
639                 ndr->depth--;
640         }
641         ndr->depth--;
642 }
643
644 _PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r)
645 {
646         if (flags & NDR_IN) {
647                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
648                 if (r->in.system_name) {
649                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name));
650                 }
651                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
652         }
653         if (flags & NDR_OUT) {
654                 if (r->out.handle == NULL) {
655                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
656                 }
657                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
658                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
659         }
660         return NDR_ERR_SUCCESS;
661 }
662
663 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r)
664 {
665         uint32_t _ptr_system_name;
666         TALLOC_CTX *_mem_save_system_name_0;
667         TALLOC_CTX *_mem_save_handle_0;
668         if (flags & NDR_IN) {
669                 ZERO_STRUCT(r->out);
670
671                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name));
672                 if (_ptr_system_name) {
673                         NDR_PULL_ALLOC(ndr, r->in.system_name);
674                 } else {
675                         r->in.system_name = NULL;
676                 }
677                 if (r->in.system_name) {
678                         _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
679                         NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0);
680                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name));
681                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0);
682                 }
683                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
684                 NDR_PULL_ALLOC(ndr, r->out.handle);
685                 ZERO_STRUCTP(r->out.handle);
686         }
687         if (flags & NDR_OUT) {
688                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
689                         NDR_PULL_ALLOC(ndr, r->out.handle);
690                 }
691                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
692                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
693                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
694                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
695                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
696         }
697         return NDR_ERR_SUCCESS;
698 }
699
700 _PUBLIC_ void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r)
701 {
702         ndr_print_struct(ndr, name, "winreg_OpenHKLM");
703         ndr->depth++;
704         if (flags & NDR_SET_VALUES) {
705                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
706         }
707         if (flags & NDR_IN) {
708                 ndr_print_struct(ndr, "in", "winreg_OpenHKLM");
709                 ndr->depth++;
710                 ndr_print_ptr(ndr, "system_name", r->in.system_name);
711                 ndr->depth++;
712                 if (r->in.system_name) {
713                         ndr_print_uint16(ndr, "system_name", *r->in.system_name);
714                 }
715                 ndr->depth--;
716                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
717                 ndr->depth--;
718         }
719         if (flags & NDR_OUT) {
720                 ndr_print_struct(ndr, "out", "winreg_OpenHKLM");
721                 ndr->depth++;
722                 ndr_print_ptr(ndr, "handle", r->out.handle);
723                 ndr->depth++;
724                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
725                 ndr->depth--;
726                 ndr_print_WERROR(ndr, "result", r->out.result);
727                 ndr->depth--;
728         }
729         ndr->depth--;
730 }
731
732 static enum ndr_err_code ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPD *r)
733 {
734         if (flags & NDR_IN) {
735                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
736                 if (r->in.system_name) {
737                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name));
738                 }
739                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
740         }
741         if (flags & NDR_OUT) {
742                 if (r->out.handle == NULL) {
743                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
744                 }
745                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
746                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
747         }
748         return NDR_ERR_SUCCESS;
749 }
750
751 static enum ndr_err_code ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPD *r)
752 {
753         uint32_t _ptr_system_name;
754         TALLOC_CTX *_mem_save_system_name_0;
755         TALLOC_CTX *_mem_save_handle_0;
756         if (flags & NDR_IN) {
757                 ZERO_STRUCT(r->out);
758
759                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name));
760                 if (_ptr_system_name) {
761                         NDR_PULL_ALLOC(ndr, r->in.system_name);
762                 } else {
763                         r->in.system_name = NULL;
764                 }
765                 if (r->in.system_name) {
766                         _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
767                         NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0);
768                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name));
769                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0);
770                 }
771                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
772                 NDR_PULL_ALLOC(ndr, r->out.handle);
773                 ZERO_STRUCTP(r->out.handle);
774         }
775         if (flags & NDR_OUT) {
776                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
777                         NDR_PULL_ALLOC(ndr, r->out.handle);
778                 }
779                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
780                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
781                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
782                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
783                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
784         }
785         return NDR_ERR_SUCCESS;
786 }
787
788 _PUBLIC_ void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r)
789 {
790         ndr_print_struct(ndr, name, "winreg_OpenHKPD");
791         ndr->depth++;
792         if (flags & NDR_SET_VALUES) {
793                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
794         }
795         if (flags & NDR_IN) {
796                 ndr_print_struct(ndr, "in", "winreg_OpenHKPD");
797                 ndr->depth++;
798                 ndr_print_ptr(ndr, "system_name", r->in.system_name);
799                 ndr->depth++;
800                 if (r->in.system_name) {
801                         ndr_print_uint16(ndr, "system_name", *r->in.system_name);
802                 }
803                 ndr->depth--;
804                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
805                 ndr->depth--;
806         }
807         if (flags & NDR_OUT) {
808                 ndr_print_struct(ndr, "out", "winreg_OpenHKPD");
809                 ndr->depth++;
810                 ndr_print_ptr(ndr, "handle", r->out.handle);
811                 ndr->depth++;
812                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
813                 ndr->depth--;
814                 ndr_print_WERROR(ndr, "result", r->out.result);
815                 ndr->depth--;
816         }
817         ndr->depth--;
818 }
819
820 static enum ndr_err_code ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKU *r)
821 {
822         if (flags & NDR_IN) {
823                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
824                 if (r->in.system_name) {
825                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name));
826                 }
827                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
828         }
829         if (flags & NDR_OUT) {
830                 if (r->out.handle == NULL) {
831                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
832                 }
833                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
834                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
835         }
836         return NDR_ERR_SUCCESS;
837 }
838
839 static enum ndr_err_code ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKU *r)
840 {
841         uint32_t _ptr_system_name;
842         TALLOC_CTX *_mem_save_system_name_0;
843         TALLOC_CTX *_mem_save_handle_0;
844         if (flags & NDR_IN) {
845                 ZERO_STRUCT(r->out);
846
847                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name));
848                 if (_ptr_system_name) {
849                         NDR_PULL_ALLOC(ndr, r->in.system_name);
850                 } else {
851                         r->in.system_name = NULL;
852                 }
853                 if (r->in.system_name) {
854                         _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
855                         NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0);
856                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name));
857                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0);
858                 }
859                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
860                 NDR_PULL_ALLOC(ndr, r->out.handle);
861                 ZERO_STRUCTP(r->out.handle);
862         }
863         if (flags & NDR_OUT) {
864                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
865                         NDR_PULL_ALLOC(ndr, r->out.handle);
866                 }
867                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
868                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
869                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
870                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
871                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
872         }
873         return NDR_ERR_SUCCESS;
874 }
875
876 _PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r)
877 {
878         ndr_print_struct(ndr, name, "winreg_OpenHKU");
879         ndr->depth++;
880         if (flags & NDR_SET_VALUES) {
881                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
882         }
883         if (flags & NDR_IN) {
884                 ndr_print_struct(ndr, "in", "winreg_OpenHKU");
885                 ndr->depth++;
886                 ndr_print_ptr(ndr, "system_name", r->in.system_name);
887                 ndr->depth++;
888                 if (r->in.system_name) {
889                         ndr_print_uint16(ndr, "system_name", *r->in.system_name);
890                 }
891                 ndr->depth--;
892                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
893                 ndr->depth--;
894         }
895         if (flags & NDR_OUT) {
896                 ndr_print_struct(ndr, "out", "winreg_OpenHKU");
897                 ndr->depth++;
898                 ndr_print_ptr(ndr, "handle", r->out.handle);
899                 ndr->depth++;
900                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
901                 ndr->depth--;
902                 ndr_print_WERROR(ndr, "result", r->out.result);
903                 ndr->depth--;
904         }
905         ndr->depth--;
906 }
907
908 _PUBLIC_ enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r)
909 {
910         if (flags & NDR_IN) {
911                 if (r->in.handle == NULL) {
912                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
913                 }
914                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
915         }
916         if (flags & NDR_OUT) {
917                 if (r->out.handle == NULL) {
918                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
919                 }
920                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
921                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
922         }
923         return NDR_ERR_SUCCESS;
924 }
925
926 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r)
927 {
928         TALLOC_CTX *_mem_save_handle_0;
929         if (flags & NDR_IN) {
930                 ZERO_STRUCT(r->out);
931
932                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
933                         NDR_PULL_ALLOC(ndr, r->in.handle);
934                 }
935                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
936                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
937                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
938                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
939                 NDR_PULL_ALLOC(ndr, r->out.handle);
940                 *r->out.handle = *r->in.handle;
941         }
942         if (flags & NDR_OUT) {
943                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
944                         NDR_PULL_ALLOC(ndr, r->out.handle);
945                 }
946                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
947                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
948                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
949                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
950                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
951         }
952         return NDR_ERR_SUCCESS;
953 }
954
955 _PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r)
956 {
957         ndr_print_struct(ndr, name, "winreg_CloseKey");
958         ndr->depth++;
959         if (flags & NDR_SET_VALUES) {
960                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
961         }
962         if (flags & NDR_IN) {
963                 ndr_print_struct(ndr, "in", "winreg_CloseKey");
964                 ndr->depth++;
965                 ndr_print_ptr(ndr, "handle", r->in.handle);
966                 ndr->depth++;
967                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
968                 ndr->depth--;
969                 ndr->depth--;
970         }
971         if (flags & NDR_OUT) {
972                 ndr_print_struct(ndr, "out", "winreg_CloseKey");
973                 ndr->depth++;
974                 ndr_print_ptr(ndr, "handle", r->out.handle);
975                 ndr->depth++;
976                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
977                 ndr->depth--;
978                 ndr_print_WERROR(ndr, "result", r->out.result);
979                 ndr->depth--;
980         }
981         ndr->depth--;
982 }
983
984 _PUBLIC_ enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r)
985 {
986         if (flags & NDR_IN) {
987                 if (r->in.handle == NULL) {
988                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
989                 }
990                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
991                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name));
992                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass));
993                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options));
994                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
995                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.secdesc));
996                 if (r->in.secdesc) {
997                         NDR_CHECK(ndr_push_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc));
998                 }
999                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.action_taken));
1000                 if (r->in.action_taken) {
1001                         NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->in.action_taken));
1002                 }
1003         }
1004         if (flags & NDR_OUT) {
1005                 if (r->out.new_handle == NULL) {
1006                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1007                 }
1008                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.new_handle));
1009                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken));
1010                 if (r->out.action_taken) {
1011                         NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->out.action_taken));
1012                 }
1013                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1014         }
1015         return NDR_ERR_SUCCESS;
1016 }
1017
1018 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r)
1019 {
1020         uint32_t _ptr_secdesc;
1021         uint32_t _ptr_action_taken;
1022         TALLOC_CTX *_mem_save_handle_0;
1023         TALLOC_CTX *_mem_save_secdesc_0;
1024         TALLOC_CTX *_mem_save_new_handle_0;
1025         TALLOC_CTX *_mem_save_action_taken_0;
1026         if (flags & NDR_IN) {
1027                 ZERO_STRUCT(r->out);
1028
1029                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1030                         NDR_PULL_ALLOC(ndr, r->in.handle);
1031                 }
1032                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1033                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1034                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1035                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1036                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name));
1037                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass));
1038                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options));
1039                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
1040                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
1041                 if (_ptr_secdesc) {
1042                         NDR_PULL_ALLOC(ndr, r->in.secdesc);
1043                 } else {
1044                         r->in.secdesc = NULL;
1045                 }
1046                 if (r->in.secdesc) {
1047                         _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
1048                         NDR_PULL_SET_MEM_CTX(ndr, r->in.secdesc, 0);
1049                         NDR_CHECK(ndr_pull_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc));
1050                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
1051                 }
1052                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken));
1053                 if (_ptr_action_taken) {
1054                         NDR_PULL_ALLOC(ndr, r->in.action_taken);
1055                 } else {
1056                         r->in.action_taken = NULL;
1057                 }
1058                 if (r->in.action_taken) {
1059                         _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
1060                         NDR_PULL_SET_MEM_CTX(ndr, r->in.action_taken, 0);
1061                         NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->in.action_taken));
1062                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0);
1063                 }
1064                 NDR_PULL_ALLOC(ndr, r->out.new_handle);
1065                 ZERO_STRUCTP(r->out.new_handle);
1066         }
1067         if (flags & NDR_OUT) {
1068                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1069                         NDR_PULL_ALLOC(ndr, r->out.new_handle);
1070                 }
1071                 _mem_save_new_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1072                 NDR_PULL_SET_MEM_CTX(ndr, r->out.new_handle, LIBNDR_FLAG_REF_ALLOC);
1073                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.new_handle));
1074                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_handle_0, LIBNDR_FLAG_REF_ALLOC);
1075                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken));
1076                 if (_ptr_action_taken) {
1077                         NDR_PULL_ALLOC(ndr, r->out.action_taken);
1078                 } else {
1079                         r->out.action_taken = NULL;
1080                 }
1081                 if (r->out.action_taken) {
1082                         _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
1083                         NDR_PULL_SET_MEM_CTX(ndr, r->out.action_taken, 0);
1084                         NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->out.action_taken));
1085                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0);
1086                 }
1087                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1088         }
1089         return NDR_ERR_SUCCESS;
1090 }
1091
1092 _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r)
1093 {
1094         ndr_print_struct(ndr, name, "winreg_CreateKey");
1095         ndr->depth++;
1096         if (flags & NDR_SET_VALUES) {
1097                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1098         }
1099         if (flags & NDR_IN) {
1100                 ndr_print_struct(ndr, "in", "winreg_CreateKey");
1101                 ndr->depth++;
1102                 ndr_print_ptr(ndr, "handle", r->in.handle);
1103                 ndr->depth++;
1104                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1105                 ndr->depth--;
1106                 ndr_print_winreg_String(ndr, "name", &r->in.name);
1107                 ndr_print_winreg_String(ndr, "keyclass", &r->in.keyclass);
1108                 ndr_print_uint32(ndr, "options", r->in.options);
1109                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
1110                 ndr_print_ptr(ndr, "secdesc", r->in.secdesc);
1111                 ndr->depth++;
1112                 if (r->in.secdesc) {
1113                         ndr_print_winreg_SecBuf(ndr, "secdesc", r->in.secdesc);
1114                 }
1115                 ndr->depth--;
1116                 ndr_print_ptr(ndr, "action_taken", r->in.action_taken);
1117                 ndr->depth++;
1118                 if (r->in.action_taken) {
1119                         ndr_print_winreg_CreateAction(ndr, "action_taken", *r->in.action_taken);
1120                 }
1121                 ndr->depth--;
1122                 ndr->depth--;
1123         }
1124         if (flags & NDR_OUT) {
1125                 ndr_print_struct(ndr, "out", "winreg_CreateKey");
1126                 ndr->depth++;
1127                 ndr_print_ptr(ndr, "new_handle", r->out.new_handle);
1128                 ndr->depth++;
1129                 ndr_print_policy_handle(ndr, "new_handle", r->out.new_handle);
1130                 ndr->depth--;
1131                 ndr_print_ptr(ndr, "action_taken", r->out.action_taken);
1132                 ndr->depth++;
1133                 if (r->out.action_taken) {
1134                         ndr_print_winreg_CreateAction(ndr, "action_taken", *r->out.action_taken);
1135                 }
1136                 ndr->depth--;
1137                 ndr_print_WERROR(ndr, "result", r->out.result);
1138                 ndr->depth--;
1139         }
1140         ndr->depth--;
1141 }
1142
1143 _PUBLIC_ enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r)
1144 {
1145         if (flags & NDR_IN) {
1146                 if (r->in.handle == NULL) {
1147                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1148                 }
1149                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1150                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key));
1151         }
1152         if (flags & NDR_OUT) {
1153                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1154         }
1155         return NDR_ERR_SUCCESS;
1156 }
1157
1158 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r)
1159 {
1160         TALLOC_CTX *_mem_save_handle_0;
1161         if (flags & NDR_IN) {
1162                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1163                         NDR_PULL_ALLOC(ndr, r->in.handle);
1164                 }
1165                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1166                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1167                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1168                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1169                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key));
1170         }
1171         if (flags & NDR_OUT) {
1172                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1173         }
1174         return NDR_ERR_SUCCESS;
1175 }
1176
1177 _PUBLIC_ void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r)
1178 {
1179         ndr_print_struct(ndr, name, "winreg_DeleteKey");
1180         ndr->depth++;
1181         if (flags & NDR_SET_VALUES) {
1182                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1183         }
1184         if (flags & NDR_IN) {
1185                 ndr_print_struct(ndr, "in", "winreg_DeleteKey");
1186                 ndr->depth++;
1187                 ndr_print_ptr(ndr, "handle", r->in.handle);
1188                 ndr->depth++;
1189                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1190                 ndr->depth--;
1191                 ndr_print_winreg_String(ndr, "key", &r->in.key);
1192                 ndr->depth--;
1193         }
1194         if (flags & NDR_OUT) {
1195                 ndr_print_struct(ndr, "out", "winreg_DeleteKey");
1196                 ndr->depth++;
1197                 ndr_print_WERROR(ndr, "result", r->out.result);
1198                 ndr->depth--;
1199         }
1200         ndr->depth--;
1201 }
1202
1203 static enum ndr_err_code ndr_push_winreg_DeleteValue(struct ndr_push *ndr, int flags, const struct winreg_DeleteValue *r)
1204 {
1205         if (flags & NDR_IN) {
1206                 if (r->in.handle == NULL) {
1207                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1208                 }
1209                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1210                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value));
1211         }
1212         if (flags & NDR_OUT) {
1213                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1214         }
1215         return NDR_ERR_SUCCESS;
1216 }
1217
1218 static enum ndr_err_code ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct winreg_DeleteValue *r)
1219 {
1220         TALLOC_CTX *_mem_save_handle_0;
1221         if (flags & NDR_IN) {
1222                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1223                         NDR_PULL_ALLOC(ndr, r->in.handle);
1224                 }
1225                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1226                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1227                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1228                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1229                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value));
1230         }
1231         if (flags & NDR_OUT) {
1232                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1233         }
1234         return NDR_ERR_SUCCESS;
1235 }
1236
1237 _PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r)
1238 {
1239         ndr_print_struct(ndr, name, "winreg_DeleteValue");
1240         ndr->depth++;
1241         if (flags & NDR_SET_VALUES) {
1242                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1243         }
1244         if (flags & NDR_IN) {
1245                 ndr_print_struct(ndr, "in", "winreg_DeleteValue");
1246                 ndr->depth++;
1247                 ndr_print_ptr(ndr, "handle", r->in.handle);
1248                 ndr->depth++;
1249                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1250                 ndr->depth--;
1251                 ndr_print_winreg_String(ndr, "value", &r->in.value);
1252                 ndr->depth--;
1253         }
1254         if (flags & NDR_OUT) {
1255                 ndr_print_struct(ndr, "out", "winreg_DeleteValue");
1256                 ndr->depth++;
1257                 ndr_print_WERROR(ndr, "result", r->out.result);
1258                 ndr->depth--;
1259         }
1260         ndr->depth--;
1261 }
1262
1263 _PUBLIC_ enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r)
1264 {
1265         if (flags & NDR_IN) {
1266                 if (r->in.handle == NULL) {
1267                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1268                 }
1269                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1270                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index));
1271                 if (r->in.name == NULL) {
1272                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1273                 }
1274                 NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
1275                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyclass));
1276                 if (r->in.keyclass) {
1277                         NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass));
1278                 }
1279                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.last_changed_time));
1280                 if (r->in.last_changed_time) {
1281                         NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->in.last_changed_time));
1282                 }
1283         }
1284         if (flags & NDR_OUT) {
1285                 if (r->out.name == NULL) {
1286                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1287                 }
1288                 NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
1289                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.keyclass));
1290                 if (r->out.keyclass) {
1291                         NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass));
1292                 }
1293                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.last_changed_time));
1294                 if (r->out.last_changed_time) {
1295                         NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
1296                 }
1297                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1298         }
1299         return NDR_ERR_SUCCESS;
1300 }
1301
1302 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r)
1303 {
1304         uint32_t _ptr_keyclass;
1305         uint32_t _ptr_last_changed_time;
1306         TALLOC_CTX *_mem_save_handle_0;
1307         TALLOC_CTX *_mem_save_name_0;
1308         TALLOC_CTX *_mem_save_keyclass_0;
1309         TALLOC_CTX *_mem_save_last_changed_time_0;
1310         if (flags & NDR_IN) {
1311                 ZERO_STRUCT(r->out);
1312
1313                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1314                         NDR_PULL_ALLOC(ndr, r->in.handle);
1315                 }
1316                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1317                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1318                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1319                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1320                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index));
1321                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1322                         NDR_PULL_ALLOC(ndr, r->in.name);
1323                 }
1324                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1325                 NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
1326                 NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
1327                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
1328                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass));
1329                 if (_ptr_keyclass) {
1330                         NDR_PULL_ALLOC(ndr, r->in.keyclass);
1331                 } else {
1332                         r->in.keyclass = NULL;
1333                 }
1334                 if (r->in.keyclass) {
1335                         _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
1336                         NDR_PULL_SET_MEM_CTX(ndr, r->in.keyclass, 0);
1337                         NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass));
1338                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0);
1339                 }
1340                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time));
1341                 if (_ptr_last_changed_time) {
1342                         NDR_PULL_ALLOC(ndr, r->in.last_changed_time);
1343                 } else {
1344                         r->in.last_changed_time = NULL;
1345                 }
1346                 if (r->in.last_changed_time) {
1347                         _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
1348                         NDR_PULL_SET_MEM_CTX(ndr, r->in.last_changed_time, 0);
1349                         NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->in.last_changed_time));
1350                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0);
1351                 }
1352                 NDR_PULL_ALLOC(ndr, r->out.name);
1353                 *r->out.name = *r->in.name;
1354         }
1355         if (flags & NDR_OUT) {
1356                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1357                         NDR_PULL_ALLOC(ndr, r->out.name);
1358                 }
1359                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1360                 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
1361                 NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
1362                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
1363                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass));
1364                 if (_ptr_keyclass) {
1365                         NDR_PULL_ALLOC(ndr, r->out.keyclass);
1366                 } else {
1367                         r->out.keyclass = NULL;
1368                 }
1369                 if (r->out.keyclass) {
1370                         _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
1371                         NDR_PULL_SET_MEM_CTX(ndr, r->out.keyclass, 0);
1372                         NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass));
1373                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0);
1374                 }
1375                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time));
1376                 if (_ptr_last_changed_time) {
1377                         NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
1378                 } else {
1379                         r->out.last_changed_time = NULL;
1380                 }
1381                 if (r->out.last_changed_time) {
1382                         _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
1383                         NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, 0);
1384                         NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time));
1385                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0);
1386                 }
1387                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1388         }
1389         return NDR_ERR_SUCCESS;
1390 }
1391
1392 _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r)
1393 {
1394         ndr_print_struct(ndr, name, "winreg_EnumKey");
1395         ndr->depth++;
1396         if (flags & NDR_SET_VALUES) {
1397                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1398         }
1399         if (flags & NDR_IN) {
1400                 ndr_print_struct(ndr, "in", "winreg_EnumKey");
1401                 ndr->depth++;
1402                 ndr_print_ptr(ndr, "handle", r->in.handle);
1403                 ndr->depth++;
1404                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1405                 ndr->depth--;
1406                 ndr_print_uint32(ndr, "enum_index", r->in.enum_index);
1407                 ndr_print_ptr(ndr, "name", r->in.name);
1408                 ndr->depth++;
1409                 ndr_print_winreg_StringBuf(ndr, "name", r->in.name);
1410                 ndr->depth--;
1411                 ndr_print_ptr(ndr, "keyclass", r->in.keyclass);
1412                 ndr->depth++;
1413                 if (r->in.keyclass) {
1414                         ndr_print_winreg_StringBuf(ndr, "keyclass", r->in.keyclass);
1415                 }
1416                 ndr->depth--;
1417                 ndr_print_ptr(ndr, "last_changed_time", r->in.last_changed_time);
1418                 ndr->depth++;
1419                 if (r->in.last_changed_time) {
1420                         ndr_print_NTTIME(ndr, "last_changed_time", *r->in.last_changed_time);
1421                 }
1422                 ndr->depth--;
1423                 ndr->depth--;
1424         }
1425         if (flags & NDR_OUT) {
1426                 ndr_print_struct(ndr, "out", "winreg_EnumKey");
1427                 ndr->depth++;
1428                 ndr_print_ptr(ndr, "name", r->out.name);
1429                 ndr->depth++;
1430                 ndr_print_winreg_StringBuf(ndr, "name", r->out.name);
1431                 ndr->depth--;
1432                 ndr_print_ptr(ndr, "keyclass", r->out.keyclass);
1433                 ndr->depth++;
1434                 if (r->out.keyclass) {
1435                         ndr_print_winreg_StringBuf(ndr, "keyclass", r->out.keyclass);
1436                 }
1437                 ndr->depth--;
1438                 ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time);
1439                 ndr->depth++;
1440                 if (r->out.last_changed_time) {
1441                         ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time);
1442                 }
1443                 ndr->depth--;
1444                 ndr_print_WERROR(ndr, "result", r->out.result);
1445                 ndr->depth--;
1446         }
1447         ndr->depth--;
1448 }
1449
1450 _PUBLIC_ enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r)
1451 {
1452         if (flags & NDR_IN) {
1453                 if (r->in.handle == NULL) {
1454                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1455                 }
1456                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1457                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index));
1458                 if (r->in.name == NULL) {
1459                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1460                 }
1461                 NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
1462                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type));
1463                 if (r->in.type) {
1464                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type));
1465                 }
1466                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value));
1467                 if (r->in.value) {
1468                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size));
1469                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1470                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length));
1471                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.value, *r->in.length));
1472                 }
1473                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.size));
1474                 if (r->in.size) {
1475                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size));
1476                 }
1477                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.length));
1478                 if (r->in.length) {
1479                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length));
1480                 }
1481         }
1482         if (flags & NDR_OUT) {
1483                 if (r->out.name == NULL) {
1484                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1485                 }
1486                 NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
1487                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type));
1488                 if (r->out.type) {
1489                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type));
1490                 }
1491                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value));
1492                 if (r->out.value) {
1493                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size));
1494                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1495                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
1496                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.value, *r->out.length));
1497                 }
1498                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.size));
1499                 if (r->out.size) {
1500                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size));
1501                 }
1502                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.length));
1503                 if (r->out.length) {
1504                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
1505                 }
1506                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1507         }
1508         return NDR_ERR_SUCCESS;
1509 }
1510
1511 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r)
1512 {
1513         uint32_t _ptr_type;
1514         uint32_t _ptr_value;
1515         uint32_t _ptr_size;
1516         uint32_t _ptr_length;
1517         TALLOC_CTX *_mem_save_handle_0;
1518         TALLOC_CTX *_mem_save_name_0;
1519         TALLOC_CTX *_mem_save_type_0;
1520         TALLOC_CTX *_mem_save_value_0;
1521         TALLOC_CTX *_mem_save_size_0;
1522         TALLOC_CTX *_mem_save_length_0;
1523         if (flags & NDR_IN) {
1524                 ZERO_STRUCT(r->out);
1525
1526                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1527                         NDR_PULL_ALLOC(ndr, r->in.handle);
1528                 }
1529                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1530                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1531                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1532                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1533                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index));
1534                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1535                         NDR_PULL_ALLOC(ndr, r->in.name);
1536                 }
1537                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1538                 NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
1539                 NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
1540                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
1541                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
1542                 if (_ptr_type) {
1543                         NDR_PULL_ALLOC(ndr, r->in.type);
1544                 } else {
1545                         r->in.type = NULL;
1546                 }
1547                 if (r->in.type) {
1548                         _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
1549                         NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0);
1550                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type));
1551                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
1552                 }
1553                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value));
1554                 if (_ptr_value) {
1555                         NDR_PULL_ALLOC(ndr, r->in.value);
1556                 } else {
1557                         r->in.value = NULL;
1558                 }
1559                 if (r->in.value) {
1560                         _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr);
1561                         NDR_PULL_SET_MEM_CTX(ndr, r->in.value, 0);
1562                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.value));
1563                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.value));
1564                         if (ndr_get_array_length(ndr, &r->in.value) > ndr_get_array_size(ndr, &r->in.value)) {
1565                                 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.value), ndr_get_array_length(ndr, &r->in.value));
1566                         }
1567                         NDR_PULL_ALLOC_N(ndr, r->in.value, ndr_get_array_size(ndr, &r->in.value));
1568                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.value, ndr_get_array_length(ndr, &r->in.value)));
1569                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0);
1570                 }
1571                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size));
1572                 if (_ptr_size) {
1573                         NDR_PULL_ALLOC(ndr, r->in.size);
1574                 } else {
1575                         r->in.size = NULL;
1576                 }
1577                 if (r->in.size) {
1578                         _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
1579                         NDR_PULL_SET_MEM_CTX(ndr, r->in.size, 0);
1580                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.size));
1581                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0);
1582                 }
1583                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length));
1584                 if (_ptr_length) {
1585                         NDR_PULL_ALLOC(ndr, r->in.length);
1586                 } else {
1587                         r->in.length = NULL;
1588                 }
1589                 if (r->in.length) {
1590                         _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
1591                         NDR_PULL_SET_MEM_CTX(ndr, r->in.length, 0);
1592                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length));
1593                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0);
1594                 }
1595                 NDR_PULL_ALLOC(ndr, r->out.name);
1596                 *r->out.name = *r->in.name;
1597                 if (r->in.value) {
1598                         if (r->in.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
1599                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.value, *r->in.size));
1600                 }
1601                 if (r->in.value) {
1602                         if (r->in.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
1603                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.value, *r->in.length));
1604                 }
1605         }
1606         if (flags & NDR_OUT) {
1607                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1608                         NDR_PULL_ALLOC(ndr, r->out.name);
1609                 }
1610                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1611                 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
1612                 NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
1613                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
1614                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
1615                 if (_ptr_type) {
1616                         NDR_PULL_ALLOC(ndr, r->out.type);
1617                 } else {
1618                         r->out.type = NULL;
1619                 }
1620                 if (r->out.type) {
1621                         _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
1622                         NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0);
1623                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type));
1624                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
1625                 }
1626                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value));
1627                 if (_ptr_value) {
1628                         NDR_PULL_ALLOC(ndr, r->out.value);
1629                 } else {
1630                         r->out.value = NULL;
1631                 }
1632                 if (r->out.value) {
1633                         _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr);
1634                         NDR_PULL_SET_MEM_CTX(ndr, r->out.value, 0);
1635                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.value));
1636                         NDR_CHECK(ndr_pull_array_length(ndr, &r->out.value));
1637                         if (ndr_get_array_length(ndr, &r->out.value) > ndr_get_array_size(ndr, &r->out.value)) {
1638                                 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.value), ndr_get_array_length(ndr, &r->out.value));
1639                         }
1640                         NDR_PULL_ALLOC_N(ndr, r->out.value, ndr_get_array_size(ndr, &r->out.value));
1641                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.value, ndr_get_array_length(ndr, &r->out.value)));
1642                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0);
1643                 }
1644                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size));
1645                 if (_ptr_size) {
1646                         NDR_PULL_ALLOC(ndr, r->out.size);
1647                 } else {
1648                         r->out.size = NULL;
1649                 }
1650                 if (r->out.size) {
1651                         _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
1652                         NDR_PULL_SET_MEM_CTX(ndr, r->out.size, 0);
1653                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size));
1654                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0);
1655                 }
1656                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length));
1657                 if (_ptr_length) {
1658                         NDR_PULL_ALLOC(ndr, r->out.length);
1659                 } else {
1660                         r->out.length = NULL;
1661                 }
1662                 if (r->out.length) {
1663                         _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
1664                         NDR_PULL_SET_MEM_CTX(ndr, r->out.length, 0);
1665                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length));
1666                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0);
1667                 }
1668                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1669                 if (r->out.value) {
1670                         if (r->out.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
1671                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.value, *r->out.size));
1672                 }
1673                 if (r->out.value) {
1674                         if (r->out.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
1675                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.value, *r->out.length));
1676                 }
1677         }
1678         return NDR_ERR_SUCCESS;
1679 }
1680
1681 _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r)
1682 {
1683         ndr_print_struct(ndr, name, "winreg_EnumValue");
1684         ndr->depth++;
1685         if (flags & NDR_SET_VALUES) {
1686                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1687         }
1688         if (flags & NDR_IN) {
1689                 ndr_print_struct(ndr, "in", "winreg_EnumValue");
1690                 ndr->depth++;
1691                 ndr_print_ptr(ndr, "handle", r->in.handle);
1692                 ndr->depth++;
1693                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1694                 ndr->depth--;
1695                 ndr_print_uint32(ndr, "enum_index", r->in.enum_index);
1696                 ndr_print_ptr(ndr, "name", r->in.name);
1697                 ndr->depth++;
1698                 ndr_print_winreg_StringBuf(ndr, "name", r->in.name);
1699                 ndr->depth--;
1700                 ndr_print_ptr(ndr, "type", r->in.type);
1701                 ndr->depth++;
1702                 if (r->in.type) {
1703                         ndr_print_winreg_Type(ndr, "type", *r->in.type);
1704                 }
1705                 ndr->depth--;
1706                 ndr_print_ptr(ndr, "value", r->in.value);
1707                 ndr->depth++;
1708                 if (r->in.value) {
1709                         if (r->in.length == NULL) return;
1710                         ndr_print_array_uint8(ndr, "value", r->in.value, *r->in.length);
1711                 }
1712                 ndr->depth--;
1713                 ndr_print_ptr(ndr, "size", r->in.size);
1714                 ndr->depth++;
1715                 if (r->in.size) {
1716                         ndr_print_uint32(ndr, "size", *r->in.size);
1717                 }
1718                 ndr->depth--;
1719                 ndr_print_ptr(ndr, "length", r->in.length);
1720                 ndr->depth++;
1721                 if (r->in.length) {
1722                         ndr_print_uint32(ndr, "length", *r->in.length);
1723                 }
1724                 ndr->depth--;
1725                 ndr->depth--;
1726         }
1727         if (flags & NDR_OUT) {
1728                 ndr_print_struct(ndr, "out", "winreg_EnumValue");
1729                 ndr->depth++;
1730                 ndr_print_ptr(ndr, "name", r->out.name);
1731                 ndr->depth++;
1732                 ndr_print_winreg_StringBuf(ndr, "name", r->out.name);
1733                 ndr->depth--;
1734                 ndr_print_ptr(ndr, "type", r->out.type);
1735                 ndr->depth++;
1736                 if (r->out.type) {
1737                         ndr_print_winreg_Type(ndr, "type", *r->out.type);
1738                 }
1739                 ndr->depth--;
1740                 ndr_print_ptr(ndr, "value", r->out.value);
1741                 ndr->depth++;
1742                 if (r->out.value) {
1743                         if (r->out.length == NULL) return;
1744                         ndr_print_array_uint8(ndr, "value", r->out.value, *r->out.length);
1745                 }
1746                 ndr->depth--;
1747                 ndr_print_ptr(ndr, "size", r->out.size);
1748                 ndr->depth++;
1749                 if (r->out.size) {
1750                         ndr_print_uint32(ndr, "size", *r->out.size);
1751                 }
1752                 ndr->depth--;
1753                 ndr_print_ptr(ndr, "length", r->out.length);
1754                 ndr->depth++;
1755                 if (r->out.length) {
1756                         ndr_print_uint32(ndr, "length", *r->out.length);
1757                 }
1758                 ndr->depth--;
1759                 ndr_print_WERROR(ndr, "result", r->out.result);
1760                 ndr->depth--;
1761         }
1762         ndr->depth--;
1763 }
1764
1765 _PUBLIC_ enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r)
1766 {
1767         if (flags & NDR_IN) {
1768                 if (r->in.handle == NULL) {
1769                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1770                 }
1771                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1772         }
1773         if (flags & NDR_OUT) {
1774                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1775         }
1776         return NDR_ERR_SUCCESS;
1777 }
1778
1779 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r)
1780 {
1781         TALLOC_CTX *_mem_save_handle_0;
1782         if (flags & NDR_IN) {
1783                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1784                         NDR_PULL_ALLOC(ndr, r->in.handle);
1785                 }
1786                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1787                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1788                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1789                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1790         }
1791         if (flags & NDR_OUT) {
1792                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1793         }
1794         return NDR_ERR_SUCCESS;
1795 }
1796
1797 _PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r)
1798 {
1799         ndr_print_struct(ndr, name, "winreg_FlushKey");
1800         ndr->depth++;
1801         if (flags & NDR_SET_VALUES) {
1802                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1803         }
1804         if (flags & NDR_IN) {
1805                 ndr_print_struct(ndr, "in", "winreg_FlushKey");
1806                 ndr->depth++;
1807                 ndr_print_ptr(ndr, "handle", r->in.handle);
1808                 ndr->depth++;
1809                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1810                 ndr->depth--;
1811                 ndr->depth--;
1812         }
1813         if (flags & NDR_OUT) {
1814                 ndr_print_struct(ndr, "out", "winreg_FlushKey");
1815                 ndr->depth++;
1816                 ndr_print_WERROR(ndr, "result", r->out.result);
1817                 ndr->depth--;
1818         }
1819         ndr->depth--;
1820 }
1821
1822 _PUBLIC_ enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r)
1823 {
1824         if (flags & NDR_IN) {
1825                 if (r->in.handle == NULL) {
1826                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1827                 }
1828                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1829                 NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info));
1830                 if (r->in.sd == NULL) {
1831                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1832                 }
1833                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
1834         }
1835         if (flags & NDR_OUT) {
1836                 if (r->out.sd == NULL) {
1837                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1838                 }
1839                 NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
1840                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1841         }
1842         return NDR_ERR_SUCCESS;
1843 }
1844
1845 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r)
1846 {
1847         TALLOC_CTX *_mem_save_handle_0;
1848         TALLOC_CTX *_mem_save_sd_0;
1849         if (flags & NDR_IN) {
1850                 ZERO_STRUCT(r->out);
1851
1852                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1853                         NDR_PULL_ALLOC(ndr, r->in.handle);
1854                 }
1855                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1856                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1857                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1858                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1859                 NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info));
1860                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1861                         NDR_PULL_ALLOC(ndr, r->in.sd);
1862                 }
1863                 _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
1864                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC);
1865                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
1866                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC);
1867                 NDR_PULL_ALLOC(ndr, r->out.sd);
1868                 *r->out.sd = *r->in.sd;
1869         }
1870         if (flags & NDR_OUT) {
1871                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1872                         NDR_PULL_ALLOC(ndr, r->out.sd);
1873                 }
1874                 _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
1875                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sd, LIBNDR_FLAG_REF_ALLOC);
1876                 NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
1877                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC);
1878                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1879         }
1880         return NDR_ERR_SUCCESS;
1881 }
1882
1883 _PUBLIC_ void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r)
1884 {
1885         ndr_print_struct(ndr, name, "winreg_GetKeySecurity");
1886         ndr->depth++;
1887         if (flags & NDR_SET_VALUES) {
1888                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1889         }
1890         if (flags & NDR_IN) {
1891                 ndr_print_struct(ndr, "in", "winreg_GetKeySecurity");
1892                 ndr->depth++;
1893                 ndr_print_ptr(ndr, "handle", r->in.handle);
1894                 ndr->depth++;
1895                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1896                 ndr->depth--;
1897                 ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info);
1898                 ndr_print_ptr(ndr, "sd", r->in.sd);
1899                 ndr->depth++;
1900                 ndr_print_KeySecurityData(ndr, "sd", r->in.sd);
1901                 ndr->depth--;
1902                 ndr->depth--;
1903         }
1904         if (flags & NDR_OUT) {
1905                 ndr_print_struct(ndr, "out", "winreg_GetKeySecurity");
1906                 ndr->depth++;
1907                 ndr_print_ptr(ndr, "sd", r->out.sd);
1908                 ndr->depth++;
1909                 ndr_print_KeySecurityData(ndr, "sd", r->out.sd);
1910                 ndr->depth--;
1911                 ndr_print_WERROR(ndr, "result", r->out.result);
1912                 ndr->depth--;
1913         }
1914         ndr->depth--;
1915 }
1916
1917 static enum ndr_err_code ndr_push_winreg_LoadKey(struct ndr_push *ndr, int flags, const struct winreg_LoadKey *r)
1918 {
1919         if (flags & NDR_IN) {
1920                 if (r->in.handle == NULL) {
1921                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1922                 }
1923                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1924                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyname));
1925                 if (r->in.keyname) {
1926                         NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname));
1927                 }
1928                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filename));
1929                 if (r->in.filename) {
1930                         NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
1931                 }
1932         }
1933         if (flags & NDR_OUT) {
1934                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1935         }
1936         return NDR_ERR_SUCCESS;
1937 }
1938
1939 static enum ndr_err_code ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_LoadKey *r)
1940 {
1941         uint32_t _ptr_keyname;
1942         uint32_t _ptr_filename;
1943         TALLOC_CTX *_mem_save_handle_0;
1944         TALLOC_CTX *_mem_save_keyname_0;
1945         TALLOC_CTX *_mem_save_filename_0;
1946         if (flags & NDR_IN) {
1947                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1948                         NDR_PULL_ALLOC(ndr, r->in.handle);
1949                 }
1950                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1951                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1952                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1953                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1954                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyname));
1955                 if (_ptr_keyname) {
1956                         NDR_PULL_ALLOC(ndr, r->in.keyname);
1957                 } else {
1958                         r->in.keyname = NULL;
1959                 }
1960                 if (r->in.keyname) {
1961                         _mem_save_keyname_0 = NDR_PULL_GET_MEM_CTX(ndr);
1962                         NDR_PULL_SET_MEM_CTX(ndr, r->in.keyname, 0);
1963                         NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname));
1964                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyname_0, 0);
1965                 }
1966                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filename));
1967                 if (_ptr_filename) {
1968                         NDR_PULL_ALLOC(ndr, r->in.filename);
1969                 } else {
1970                         r->in.filename = NULL;
1971                 }
1972                 if (r->in.filename) {
1973                         _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr);
1974                         NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, 0);
1975                         NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
1976                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, 0);
1977                 }
1978         }
1979         if (flags & NDR_OUT) {
1980                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1981         }
1982         return NDR_ERR_SUCCESS;
1983 }
1984
1985 _PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r)
1986 {
1987         ndr_print_struct(ndr, name, "winreg_LoadKey");
1988         ndr->depth++;
1989         if (flags & NDR_SET_VALUES) {
1990                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1991         }
1992         if (flags & NDR_IN) {
1993                 ndr_print_struct(ndr, "in", "winreg_LoadKey");
1994                 ndr->depth++;
1995                 ndr_print_ptr(ndr, "handle", r->in.handle);
1996                 ndr->depth++;
1997                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1998                 ndr->depth--;
1999                 ndr_print_ptr(ndr, "keyname", r->in.keyname);
2000                 ndr->depth++;
2001                 if (r->in.keyname) {
2002                         ndr_print_winreg_String(ndr, "keyname", r->in.keyname);
2003                 }
2004                 ndr->depth--;
2005                 ndr_print_ptr(ndr, "filename", r->in.filename);
2006                 ndr->depth++;
2007                 if (r->in.filename) {
2008                         ndr_print_winreg_String(ndr, "filename", r->in.filename);
2009                 }
2010                 ndr->depth--;
2011                 ndr->depth--;
2012         }
2013         if (flags & NDR_OUT) {
2014                 ndr_print_struct(ndr, "out", "winreg_LoadKey");
2015                 ndr->depth++;
2016                 ndr_print_WERROR(ndr, "result", r->out.result);
2017                 ndr->depth--;
2018         }
2019         ndr->depth--;
2020 }
2021
2022 _PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r)
2023 {
2024         if (flags & NDR_IN) {
2025                 if (r->in.handle == NULL) {
2026                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2027                 }
2028                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2029                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree));
2030                 NDR_CHECK(ndr_push_winreg_NotifyChangeType(ndr, NDR_SCALARS, r->in.notify_filter));
2031                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown));
2032                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1));
2033                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2));
2034                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2));
2035         }
2036         if (flags & NDR_OUT) {
2037                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2038         }
2039         return NDR_ERR_SUCCESS;
2040 }
2041
2042 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r)
2043 {
2044         TALLOC_CTX *_mem_save_handle_0;
2045         if (flags & NDR_IN) {
2046                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2047                         NDR_PULL_ALLOC(ndr, r->in.handle);
2048                 }
2049                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2050                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2051                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2052                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2053                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.watch_subtree));
2054                 NDR_CHECK(ndr_pull_winreg_NotifyChangeType(ndr, NDR_SCALARS, &r->in.notify_filter));
2055                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown));
2056                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1));
2057                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2));
2058                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2));
2059         }
2060         if (flags & NDR_OUT) {
2061                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2062         }
2063         return NDR_ERR_SUCCESS;
2064 }
2065
2066 _PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r)
2067 {
2068         ndr_print_struct(ndr, name, "winreg_NotifyChangeKeyValue");
2069         ndr->depth++;
2070         if (flags & NDR_SET_VALUES) {
2071                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2072         }
2073         if (flags & NDR_IN) {
2074                 ndr_print_struct(ndr, "in", "winreg_NotifyChangeKeyValue");
2075                 ndr->depth++;
2076                 ndr_print_ptr(ndr, "handle", r->in.handle);
2077                 ndr->depth++;
2078                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2079                 ndr->depth--;
2080                 ndr_print_uint8(ndr, "watch_subtree", r->in.watch_subtree);
2081                 ndr_print_winreg_NotifyChangeType(ndr, "notify_filter", r->in.notify_filter);
2082                 ndr_print_uint32(ndr, "unknown", r->in.unknown);
2083                 ndr_print_winreg_String(ndr, "string1", &r->in.string1);
2084                 ndr_print_winreg_String(ndr, "string2", &r->in.string2);
2085                 ndr_print_uint32(ndr, "unknown2", r->in.unknown2);
2086                 ndr->depth--;
2087         }
2088         if (flags & NDR_OUT) {
2089                 ndr_print_struct(ndr, "out", "winreg_NotifyChangeKeyValue");
2090                 ndr->depth++;
2091                 ndr_print_WERROR(ndr, "result", r->out.result);
2092                 ndr->depth--;
2093         }
2094         ndr->depth--;
2095 }
2096
2097 _PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r)
2098 {
2099         if (flags & NDR_IN) {
2100                 if (r->in.parent_handle == NULL) {
2101                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2102                 }
2103                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle));
2104                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname));
2105                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown));
2106                 NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
2107         }
2108         if (flags & NDR_OUT) {
2109                 if (r->out.handle == NULL) {
2110                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2111                 }
2112                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2113                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2114         }
2115         return NDR_ERR_SUCCESS;
2116 }
2117
2118 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r)
2119 {
2120         TALLOC_CTX *_mem_save_parent_handle_0;
2121         TALLOC_CTX *_mem_save_handle_0;
2122         if (flags & NDR_IN) {
2123                 ZERO_STRUCT(r->out);
2124
2125                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2126                         NDR_PULL_ALLOC(ndr, r->in.parent_handle);
2127                 }
2128                 _mem_save_parent_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2129                 NDR_PULL_SET_MEM_CTX(ndr, r->in.parent_handle, LIBNDR_FLAG_REF_ALLOC);
2130                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle));
2131                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_handle_0, LIBNDR_FLAG_REF_ALLOC);
2132                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname));
2133                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown));
2134                 NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
2135                 NDR_PULL_ALLOC(ndr, r->out.handle);
2136                 ZERO_STRUCTP(r->out.handle);
2137         }
2138         if (flags & NDR_OUT) {
2139                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2140                         NDR_PULL_ALLOC(ndr, r->out.handle);
2141                 }
2142                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2143                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
2144                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2145                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2146                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2147         }
2148         return NDR_ERR_SUCCESS;
2149 }
2150
2151 _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r)
2152 {
2153         ndr_print_struct(ndr, name, "winreg_OpenKey");
2154         ndr->depth++;
2155         if (flags & NDR_SET_VALUES) {
2156                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2157         }
2158         if (flags & NDR_IN) {
2159                 ndr_print_struct(ndr, "in", "winreg_OpenKey");
2160                 ndr->depth++;
2161                 ndr_print_ptr(ndr, "parent_handle", r->in.parent_handle);
2162                 ndr->depth++;
2163                 ndr_print_policy_handle(ndr, "parent_handle", r->in.parent_handle);
2164                 ndr->depth--;
2165                 ndr_print_winreg_String(ndr, "keyname", &r->in.keyname);
2166                 ndr_print_uint32(ndr, "unknown", r->in.unknown);
2167                 ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
2168                 ndr->depth--;
2169         }
2170         if (flags & NDR_OUT) {
2171                 ndr_print_struct(ndr, "out", "winreg_OpenKey");
2172                 ndr->depth++;
2173                 ndr_print_ptr(ndr, "handle", r->out.handle);
2174                 ndr->depth++;
2175                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
2176                 ndr->depth--;
2177                 ndr_print_WERROR(ndr, "result", r->out.result);
2178                 ndr->depth--;
2179         }
2180         ndr->depth--;
2181 }
2182
2183 _PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r)
2184 {
2185         if (flags & NDR_IN) {
2186                 if (r->in.handle == NULL) {
2187                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2188                 }
2189                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2190                 if (r->in.classname == NULL) {
2191                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2192                 }
2193                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname));
2194         }
2195         if (flags & NDR_OUT) {
2196                 if (r->out.classname == NULL) {
2197                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2198                 }
2199                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname));
2200                 if (r->out.num_subkeys == NULL) {
2201                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2202                 }
2203                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_subkeys));
2204                 if (r->out.max_subkeylen == NULL) {
2205                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2206                 }
2207                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeylen));
2208                 if (r->out.max_classlen == NULL) {
2209                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2210                 }
2211                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_classlen));
2212                 if (r->out.num_values == NULL) {
2213                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2214                 }
2215                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_values));
2216                 if (r->out.max_valnamelen == NULL) {
2217                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2218                 }
2219                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valnamelen));
2220                 if (r->out.max_valbufsize == NULL) {
2221                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2222                 }
2223                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valbufsize));
2224                 if (r->out.secdescsize == NULL) {
2225                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2226                 }
2227                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.secdescsize));
2228                 if (r->out.last_changed_time == NULL) {
2229                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2230                 }
2231                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
2232                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2233         }
2234         return NDR_ERR_SUCCESS;
2235 }
2236
2237 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
2238 {
2239         TALLOC_CTX *_mem_save_handle_0;
2240         TALLOC_CTX *_mem_save_classname_0;
2241         TALLOC_CTX *_mem_save_num_subkeys_0;
2242         TALLOC_CTX *_mem_save_max_subkeylen_0;
2243         TALLOC_CTX *_mem_save_max_classlen_0;
2244         TALLOC_CTX *_mem_save_num_values_0;
2245         TALLOC_CTX *_mem_save_max_valnamelen_0;
2246         TALLOC_CTX *_mem_save_max_valbufsize_0;
2247         TALLOC_CTX *_mem_save_secdescsize_0;
2248         TALLOC_CTX *_mem_save_last_changed_time_0;
2249         if (flags & NDR_IN) {
2250                 ZERO_STRUCT(r->out);
2251
2252                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2253                         NDR_PULL_ALLOC(ndr, r->in.handle);
2254                 }
2255                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2256                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2257                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2258                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2259                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2260                         NDR_PULL_ALLOC(ndr, r->in.classname);
2261                 }
2262                 _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr);
2263                 NDR_PULL_SET_MEM_CTX(ndr, r->in.classname, LIBNDR_FLAG_REF_ALLOC);
2264                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname));
2265                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC);
2266                 NDR_PULL_ALLOC(ndr, r->out.classname);
2267                 *r->out.classname = *r->in.classname;
2268                 NDR_PULL_ALLOC(ndr, r->out.num_subkeys);
2269                 ZERO_STRUCTP(r->out.num_subkeys);
2270                 NDR_PULL_ALLOC(ndr, r->out.max_subkeylen);
2271                 ZERO_STRUCTP(r->out.max_subkeylen);
2272                 NDR_PULL_ALLOC(ndr, r->out.max_classlen);
2273                 ZERO_STRUCTP(r->out.max_classlen);
2274                 NDR_PULL_ALLOC(ndr, r->out.num_values);
2275                 ZERO_STRUCTP(r->out.num_values);
2276                 NDR_PULL_ALLOC(ndr, r->out.max_valnamelen);
2277                 ZERO_STRUCTP(r->out.max_valnamelen);
2278                 NDR_PULL_ALLOC(ndr, r->out.max_valbufsize);
2279                 ZERO_STRUCTP(r->out.max_valbufsize);
2280                 NDR_PULL_ALLOC(ndr, r->out.secdescsize);
2281                 ZERO_STRUCTP(r->out.secdescsize);
2282                 NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
2283                 ZERO_STRUCTP(r->out.last_changed_time);
2284         }
2285         if (flags & NDR_OUT) {
2286                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2287                         NDR_PULL_ALLOC(ndr, r->out.classname);
2288                 }
2289                 _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr);
2290                 NDR_PULL_SET_MEM_CTX(ndr, r->out.classname, LIBNDR_FLAG_REF_ALLOC);
2291                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname));
2292                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC);
2293                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2294                         NDR_PULL_ALLOC(ndr, r->out.num_subkeys);
2295                 }
2296                 _mem_save_num_subkeys_0 = NDR_PULL_GET_MEM_CTX(ndr);
2297                 NDR_PULL_SET_MEM_CTX(ndr, r->out.num_subkeys, LIBNDR_FLAG_REF_ALLOC);
2298                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_subkeys));
2299                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_subkeys_0, LIBNDR_FLAG_REF_ALLOC);
2300                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2301                         NDR_PULL_ALLOC(ndr, r->out.max_subkeylen);
2302                 }
2303                 _mem_save_max_subkeylen_0 = NDR_PULL_GET_MEM_CTX(ndr);
2304                 NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeylen, LIBNDR_FLAG_REF_ALLOC);
2305                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeylen));
2306                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeylen_0, LIBNDR_FLAG_REF_ALLOC);
2307                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2308                         NDR_PULL_ALLOC(ndr, r->out.max_classlen);
2309                 }
2310                 _mem_save_max_classlen_0 = NDR_PULL_GET_MEM_CTX(ndr);
2311                 NDR_PULL_SET_MEM_CTX(ndr, r->out.max_classlen, LIBNDR_FLAG_REF_ALLOC);
2312                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_classlen));
2313                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_classlen_0, LIBNDR_FLAG_REF_ALLOC);
2314                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2315                         NDR_PULL_ALLOC(ndr, r->out.num_values);
2316                 }
2317                 _mem_save_num_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
2318                 NDR_PULL_SET_MEM_CTX(ndr, r->out.num_values, LIBNDR_FLAG_REF_ALLOC);
2319                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_values));
2320                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_values_0, LIBNDR_FLAG_REF_ALLOC);
2321                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2322                         NDR_PULL_ALLOC(ndr, r->out.max_valnamelen);
2323                 }
2324                 _mem_save_max_valnamelen_0 = NDR_PULL_GET_MEM_CTX(ndr);
2325                 NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valnamelen, LIBNDR_FLAG_REF_ALLOC);
2326                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valnamelen));
2327                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valnamelen_0, LIBNDR_FLAG_REF_ALLOC);
2328                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2329                         NDR_PULL_ALLOC(ndr, r->out.max_valbufsize);
2330                 }
2331                 _mem_save_max_valbufsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
2332                 NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valbufsize, LIBNDR_FLAG_REF_ALLOC);
2333                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valbufsize));
2334                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valbufsize_0, LIBNDR_FLAG_REF_ALLOC);
2335                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2336                         NDR_PULL_ALLOC(ndr, r->out.secdescsize);
2337                 }
2338                 _mem_save_secdescsize_0 = NDR_PULL_GET_MEM_CTX(ndr);
2339                 NDR_PULL_SET_MEM_CTX(ndr, r->out.secdescsize, LIBNDR_FLAG_REF_ALLOC);
2340                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.secdescsize));
2341                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdescsize_0, LIBNDR_FLAG_REF_ALLOC);
2342                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2343                         NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
2344                 }
2345                 _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
2346                 NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
2347                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time));
2348                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC);
2349                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2350         }
2351         return NDR_ERR_SUCCESS;
2352 }
2353
2354 _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r)
2355 {
2356         ndr_print_struct(ndr, name, "winreg_QueryInfoKey");
2357         ndr->depth++;
2358         if (flags & NDR_SET_VALUES) {
2359                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2360         }
2361         if (flags & NDR_IN) {
2362                 ndr_print_struct(ndr, "in", "winreg_QueryInfoKey");
2363                 ndr->depth++;
2364                 ndr_print_ptr(ndr, "handle", r->in.handle);
2365                 ndr->depth++;
2366                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2367                 ndr->depth--;
2368                 ndr_print_ptr(ndr, "classname", r->in.classname);
2369                 ndr->depth++;
2370                 ndr_print_winreg_String(ndr, "classname", r->in.classname);
2371                 ndr->depth--;
2372                 ndr->depth--;
2373         }
2374         if (flags & NDR_OUT) {
2375                 ndr_print_struct(ndr, "out", "winreg_QueryInfoKey");
2376                 ndr->depth++;
2377                 ndr_print_ptr(ndr, "classname", r->out.classname);
2378                 ndr->depth++;
2379                 ndr_print_winreg_String(ndr, "classname", r->out.classname);
2380                 ndr->depth--;
2381                 ndr_print_ptr(ndr, "num_subkeys", r->out.num_subkeys);
2382                 ndr->depth++;
2383                 ndr_print_uint32(ndr, "num_subkeys", *r->out.num_subkeys);
2384                 ndr->depth--;
2385                 ndr_print_ptr(ndr, "max_subkeylen", r->out.max_subkeylen);
2386                 ndr->depth++;
2387                 ndr_print_uint32(ndr, "max_subkeylen", *r->out.max_subkeylen);
2388                 ndr->depth--;
2389                 ndr_print_ptr(ndr, "max_classlen", r->out.max_classlen);
2390                 ndr->depth++;
2391                 ndr_print_uint32(ndr, "max_classlen", *r->out.max_classlen);
2392                 ndr->depth--;
2393                 ndr_print_ptr(ndr, "num_values", r->out.num_values);
2394                 ndr->depth++;
2395                 ndr_print_uint32(ndr, "num_values", *r->out.num_values);
2396                 ndr->depth--;
2397                 ndr_print_ptr(ndr, "max_valnamelen", r->out.max_valnamelen);
2398                 ndr->depth++;
2399                 ndr_print_uint32(ndr, "max_valnamelen", *r->out.max_valnamelen);
2400                 ndr->depth--;
2401                 ndr_print_ptr(ndr, "max_valbufsize", r->out.max_valbufsize);
2402                 ndr->depth++;
2403                 ndr_print_uint32(ndr, "max_valbufsize", *r->out.max_valbufsize);
2404                 ndr->depth--;
2405                 ndr_print_ptr(ndr, "secdescsize", r->out.secdescsize);
2406                 ndr->depth++;
2407                 ndr_print_uint32(ndr, "secdescsize", *r->out.secdescsize);
2408                 ndr->depth--;
2409                 ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time);
2410                 ndr->depth++;
2411                 ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time);
2412                 ndr->depth--;
2413                 ndr_print_WERROR(ndr, "result", r->out.result);
2414                 ndr->depth--;
2415         }
2416         ndr->depth--;
2417 }
2418
2419 _PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r)
2420 {
2421         if (flags & NDR_IN) {
2422                 if (r->in.handle == NULL) {
2423                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2424                 }
2425                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2426                 if (r->in.value_name == NULL) {
2427                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2428                 }
2429                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
2430                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type));
2431                 if (r->in.type) {
2432                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type));
2433                 }
2434                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data));
2435                 if (r->in.data) {
2436                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
2437                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2438                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length));
2439                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.data_length));
2440                 }
2441                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_size));
2442                 if (r->in.data_size) {
2443                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
2444                 }
2445                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_length));
2446                 if (r->in.data_length) {
2447                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length));
2448                 }
2449         }
2450         if (flags & NDR_OUT) {
2451                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type));
2452                 if (r->out.type) {
2453                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type));
2454                 }
2455                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data));
2456                 if (r->out.data) {
2457                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
2458                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2459                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length));
2460                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.data_length));
2461                 }
2462                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_size));
2463                 if (r->out.data_size) {
2464                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
2465                 }
2466                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_length));
2467                 if (r->out.data_length) {
2468                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length));
2469                 }
2470                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2471         }
2472         return NDR_ERR_SUCCESS;
2473 }
2474
2475 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r)
2476 {
2477         uint32_t _ptr_type;
2478         uint32_t _ptr_data;
2479         uint32_t _ptr_data_size;
2480         uint32_t _ptr_data_length;
2481         TALLOC_CTX *_mem_save_handle_0;
2482         TALLOC_CTX *_mem_save_value_name_0;
2483         TALLOC_CTX *_mem_save_type_0;
2484         TALLOC_CTX *_mem_save_data_0;
2485         TALLOC_CTX *_mem_save_data_size_0;
2486         TALLOC_CTX *_mem_save_data_length_0;
2487         if (flags & NDR_IN) {
2488                 ZERO_STRUCT(r->out);
2489
2490                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2491                         NDR_PULL_ALLOC(ndr, r->in.handle);
2492                 }
2493                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2494                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2495                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2496                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2497                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2498                         NDR_PULL_ALLOC(ndr, r->in.value_name);
2499                 }
2500                 _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2501                 NDR_PULL_SET_MEM_CTX(ndr, r->in.value_name, LIBNDR_FLAG_REF_ALLOC);
2502                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
2503                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, LIBNDR_FLAG_REF_ALLOC);
2504                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
2505                 if (_ptr_type) {
2506                         NDR_PULL_ALLOC(ndr, r->in.type);
2507                 } else {
2508                         r->in.type = NULL;
2509                 }
2510                 if (r->in.type) {
2511                         _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
2512                         NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0);
2513                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type));
2514                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
2515                 }
2516                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
2517                 if (_ptr_data) {
2518                         NDR_PULL_ALLOC(ndr, r->in.data);
2519                 } else {
2520                         r->in.data = NULL;
2521                 }
2522                 if (r->in.data) {
2523                         _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2524                         NDR_PULL_SET_MEM_CTX(ndr, r->in.data, 0);
2525                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data));
2526                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.data));
2527                         if (ndr_get_array_length(ndr, &r->in.data) > ndr_get_array_size(ndr, &r->in.data)) {
2528                                 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.data), ndr_get_array_length(ndr, &r->in.data));
2529                         }
2530                         NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data));
2531                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_length(ndr, &r->in.data)));
2532                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
2533                 }
2534                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size));
2535                 if (_ptr_data_size) {
2536                         NDR_PULL_ALLOC(ndr, r->in.data_size);
2537                 } else {
2538                         r->in.data_size = NULL;
2539                 }
2540                 if (r->in.data_size) {
2541                         _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
2542                         NDR_PULL_SET_MEM_CTX(ndr, r->in.data_size, 0);
2543                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_size));
2544                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
2545                 }
2546                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length));
2547                 if (_ptr_data_length) {
2548                         NDR_PULL_ALLOC(ndr, r->in.data_length);
2549                 } else {
2550                         r->in.data_length = NULL;
2551                 }
2552                 if (r->in.data_length) {
2553                         _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
2554                         NDR_PULL_SET_MEM_CTX(ndr, r->in.data_length, 0);
2555                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_length));
2556                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0);
2557                 }
2558                 if (r->in.data) {
2559                         if (r->in.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
2560                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, *r->in.data_size));
2561                 }
2562                 if (r->in.data) {
2563                         if (r->in.data_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
2564                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.data_length));
2565                 }
2566         }
2567         if (flags & NDR_OUT) {
2568                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
2569                 if (_ptr_type) {
2570                         NDR_PULL_ALLOC(ndr, r->out.type);
2571                 } else {
2572                         r->out.type = NULL;
2573                 }
2574                 if (r->out.type) {
2575                         _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
2576                         NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0);
2577                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type));
2578                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
2579                 }
2580                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
2581                 if (_ptr_data) {
2582                         NDR_PULL_ALLOC(ndr, r->out.data);
2583                 } else {
2584                         r->out.data = NULL;
2585                 }
2586                 if (r->out.data) {
2587                         _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2588                         NDR_PULL_SET_MEM_CTX(ndr, r->out.data, 0);
2589                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
2590                         NDR_CHECK(ndr_pull_array_length(ndr, &r->out.data));
2591                         if (ndr_get_array_length(ndr, &r->out.data) > ndr_get_array_size(ndr, &r->out.data)) {
2592                                 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.data), ndr_get_array_length(ndr, &r->out.data));
2593                         }
2594                         NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data));
2595                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_length(ndr, &r->out.data)));
2596                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
2597                 }
2598                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size));
2599                 if (_ptr_data_size) {
2600                         NDR_PULL_ALLOC(ndr, r->out.data_size);
2601                 } else {
2602                         r->out.data_size = NULL;
2603                 }
2604                 if (r->out.data_size) {
2605                         _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
2606                         NDR_PULL_SET_MEM_CTX(ndr, r->out.data_size, 0);
2607                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_size));
2608                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
2609                 }
2610                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length));
2611                 if (_ptr_data_length) {
2612                         NDR_PULL_ALLOC(ndr, r->out.data_length);
2613                 } else {
2614                         r->out.data_length = NULL;
2615                 }
2616                 if (r->out.data_length) {
2617                         _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
2618                         NDR_PULL_SET_MEM_CTX(ndr, r->out.data_length, 0);
2619                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_length));
2620                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0);
2621                 }
2622                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2623                 if (r->out.data) {
2624                         if (r->out.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
2625                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, *r->out.data_size));
2626                 }
2627                 if (r->out.data) {
2628                         if (r->out.data_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
2629                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.data_length));
2630                 }
2631         }
2632         return NDR_ERR_SUCCESS;
2633 }
2634
2635 _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r)
2636 {
2637         ndr_print_struct(ndr, name, "winreg_QueryValue");
2638         ndr->depth++;
2639         if (flags & NDR_SET_VALUES) {
2640                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2641         }
2642         if (flags & NDR_IN) {
2643                 ndr_print_struct(ndr, "in", "winreg_QueryValue");
2644                 ndr->depth++;
2645                 ndr_print_ptr(ndr, "handle", r->in.handle);
2646                 ndr->depth++;
2647                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2648                 ndr->depth--;
2649                 ndr_print_ptr(ndr, "value_name", r->in.value_name);
2650                 ndr->depth++;
2651                 ndr_print_winreg_String(ndr, "value_name", r->in.value_name);
2652                 ndr->depth--;
2653                 ndr_print_ptr(ndr, "type", r->in.type);
2654                 ndr->depth++;
2655                 if (r->in.type) {
2656                         ndr_print_winreg_Type(ndr, "type", *r->in.type);
2657                 }
2658                 ndr->depth--;
2659                 ndr_print_ptr(ndr, "data", r->in.data);
2660                 ndr->depth++;
2661                 if (r->in.data) {
2662                         if (r->in.data_length == NULL) return;
2663                         ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.data_length);
2664                 }
2665                 ndr->depth--;
2666                 ndr_print_ptr(ndr, "data_size", r->in.data_size);
2667                 ndr->depth++;
2668                 if (r->in.data_size) {
2669                         ndr_print_uint32(ndr, "data_size", *r->in.data_size);
2670                 }
2671                 ndr->depth--;
2672                 ndr_print_ptr(ndr, "data_length", r->in.data_length);
2673                 ndr->depth++;
2674                 if (r->in.data_length) {
2675                         ndr_print_uint32(ndr, "data_length", *r->in.data_length);
2676                 }
2677                 ndr->depth--;
2678                 ndr->depth--;
2679         }
2680         if (flags & NDR_OUT) {
2681                 ndr_print_struct(ndr, "out", "winreg_QueryValue");
2682                 ndr->depth++;
2683                 ndr_print_ptr(ndr, "type", r->out.type);
2684                 ndr->depth++;
2685                 if (r->out.type) {
2686                         ndr_print_winreg_Type(ndr, "type", *r->out.type);
2687                 }
2688                 ndr->depth--;
2689                 ndr_print_ptr(ndr, "data", r->out.data);
2690                 ndr->depth++;
2691                 if (r->out.data) {
2692                         if (r->out.data_length == NULL) return;
2693                         ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.data_length);
2694                 }
2695                 ndr->depth--;
2696                 ndr_print_ptr(ndr, "data_size", r->out.data_size);
2697                 ndr->depth++;
2698                 if (r->out.data_size) {
2699                         ndr_print_uint32(ndr, "data_size", *r->out.data_size);
2700                 }
2701                 ndr->depth--;
2702                 ndr_print_ptr(ndr, "data_length", r->out.data_length);
2703                 ndr->depth++;
2704                 if (r->out.data_length) {
2705                         ndr_print_uint32(ndr, "data_length", *r->out.data_length);
2706                 }
2707                 ndr->depth--;
2708                 ndr_print_WERROR(ndr, "result", r->out.result);
2709                 ndr->depth--;
2710         }
2711         ndr->depth--;
2712 }
2713
2714 static enum ndr_err_code ndr_push_winreg_ReplaceKey(struct ndr_push *ndr, int flags, const struct winreg_ReplaceKey *r)
2715 {
2716         if (flags & NDR_IN) {
2717         }
2718         if (flags & NDR_OUT) {
2719                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2720         }
2721         return NDR_ERR_SUCCESS;
2722 }
2723
2724 static enum ndr_err_code ndr_pull_winreg_ReplaceKey(struct ndr_pull *ndr, int flags, struct winreg_ReplaceKey *r)
2725 {
2726         if (flags & NDR_IN) {
2727         }
2728         if (flags & NDR_OUT) {
2729                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2730         }
2731         return NDR_ERR_SUCCESS;
2732 }
2733
2734 _PUBLIC_ void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r)
2735 {
2736         ndr_print_struct(ndr, name, "winreg_ReplaceKey");
2737         ndr->depth++;
2738         if (flags & NDR_SET_VALUES) {
2739                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2740         }
2741         if (flags & NDR_IN) {
2742                 ndr_print_struct(ndr, "in", "winreg_ReplaceKey");
2743                 ndr->depth++;
2744                 ndr->depth--;
2745         }
2746         if (flags & NDR_OUT) {
2747                 ndr_print_struct(ndr, "out", "winreg_ReplaceKey");
2748                 ndr->depth++;
2749                 ndr_print_WERROR(ndr, "result", r->out.result);
2750                 ndr->depth--;
2751         }
2752         ndr->depth--;
2753 }
2754
2755 static enum ndr_err_code ndr_push_winreg_RestoreKey(struct ndr_push *ndr, int flags, const struct winreg_RestoreKey *r)
2756 {
2757         if (flags & NDR_IN) {
2758                 if (r->in.handle == NULL) {
2759                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2760                 }
2761                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2762                 if (r->in.filename == NULL) {
2763                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2764                 }
2765                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
2766                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
2767         }
2768         if (flags & NDR_OUT) {
2769                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2770         }
2771         return NDR_ERR_SUCCESS;
2772 }
2773
2774 static enum ndr_err_code ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winreg_RestoreKey *r)
2775 {
2776         TALLOC_CTX *_mem_save_handle_0;
2777         TALLOC_CTX *_mem_save_filename_0;
2778         if (flags & NDR_IN) {
2779                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2780                         NDR_PULL_ALLOC(ndr, r->in.handle);
2781                 }
2782                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2783                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2784                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2785                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2786                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2787                         NDR_PULL_ALLOC(ndr, r->in.filename);
2788                 }
2789                 _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr);
2790                 NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, LIBNDR_FLAG_REF_ALLOC);
2791                 NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
2792                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, LIBNDR_FLAG_REF_ALLOC);
2793                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
2794         }
2795         if (flags & NDR_OUT) {
2796                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2797         }
2798         return NDR_ERR_SUCCESS;
2799 }
2800
2801 _PUBLIC_ void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r)
2802 {
2803         ndr_print_struct(ndr, name, "winreg_RestoreKey");
2804         ndr->depth++;
2805         if (flags & NDR_SET_VALUES) {
2806                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2807         }
2808         if (flags & NDR_IN) {
2809                 ndr_print_struct(ndr, "in", "winreg_RestoreKey");
2810                 ndr->depth++;
2811                 ndr_print_ptr(ndr, "handle", r->in.handle);
2812                 ndr->depth++;
2813                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2814                 ndr->depth--;
2815                 ndr_print_ptr(ndr, "filename", r->in.filename);
2816                 ndr->depth++;
2817                 ndr_print_winreg_String(ndr, "filename", r->in.filename);
2818                 ndr->depth--;
2819                 ndr_print_uint32(ndr, "flags", r->in.flags);
2820                 ndr->depth--;
2821         }
2822         if (flags & NDR_OUT) {
2823                 ndr_print_struct(ndr, "out", "winreg_RestoreKey");
2824                 ndr->depth++;
2825                 ndr_print_WERROR(ndr, "result", r->out.result);
2826                 ndr->depth--;
2827         }
2828         ndr->depth--;
2829 }
2830
2831 static enum ndr_err_code ndr_push_winreg_SaveKey(struct ndr_push *ndr, int flags, const struct winreg_SaveKey *r)
2832 {
2833         if (flags & NDR_IN) {
2834                 if (r->in.handle == NULL) {
2835                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2836                 }
2837                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2838                 if (r->in.filename == NULL) {
2839                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2840                 }
2841                 NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));