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