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