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