8c8b687a015fda537bae19b5df62a47dd18c2502
[jra/samba/.git] / librpc / gen_ndr / ndr_spoolss.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_spoolss.h"
5
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 #include "librpc/gen_ndr/ndr_winreg.h"
9 static enum ndr_err_code ndr_push_spoolss_Time(struct ndr_push *ndr, int ndr_flags, const struct spoolss_Time *r)
10 {
11         if (ndr_flags & NDR_SCALARS) {
12                 NDR_CHECK(ndr_push_align(ndr, 2));
13                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->year));
14                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->month));
15                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->day_of_week));
16                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->day));
17                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->hour));
18                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minute));
19                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->second));
20                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->millisecond));
21         }
22         if (ndr_flags & NDR_BUFFERS) {
23         }
24         return NDR_ERR_SUCCESS;
25 }
26
27 static enum ndr_err_code ndr_pull_spoolss_Time(struct ndr_pull *ndr, int ndr_flags, struct spoolss_Time *r)
28 {
29         if (ndr_flags & NDR_SCALARS) {
30                 NDR_CHECK(ndr_pull_align(ndr, 2));
31                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->year));
32                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->month));
33                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->day_of_week));
34                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->day));
35                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->hour));
36                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minute));
37                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->second));
38                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->millisecond));
39         }
40         if (ndr_flags & NDR_BUFFERS) {
41         }
42         return NDR_ERR_SUCCESS;
43 }
44
45 _PUBLIC_ void ndr_print_spoolss_Time(struct ndr_print *ndr, const char *name, const struct spoolss_Time *r)
46 {
47         ndr_print_struct(ndr, name, "spoolss_Time");
48         ndr->depth++;
49         ndr_print_uint16(ndr, "year", r->year);
50         ndr_print_uint16(ndr, "month", r->month);
51         ndr_print_uint16(ndr, "day_of_week", r->day_of_week);
52         ndr_print_uint16(ndr, "day", r->day);
53         ndr_print_uint16(ndr, "hour", r->hour);
54         ndr_print_uint16(ndr, "minute", r->minute);
55         ndr_print_uint16(ndr, "second", r->second);
56         ndr_print_uint16(ndr, "millisecond", r->millisecond);
57         ndr->depth--;
58 }
59
60 static 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 _PUBLIC_ 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 _PUBLIC_ 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 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo0(const struct spoolss_PrinterInfo0 *r, struct smb_iconv_convenience *ic, int flags)
516 {
517         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo0, ic);
518 }
519
520 static enum ndr_err_code ndr_push_spoolss_DeviceModeFields(struct ndr_push *ndr, int ndr_flags, uint32_t r)
521 {
522         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
523         return NDR_ERR_SUCCESS;
524 }
525
526 static enum ndr_err_code ndr_pull_spoolss_DeviceModeFields(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
527 {
528         uint32_t v;
529         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
530         *r = v;
531         return NDR_ERR_SUCCESS;
532 }
533
534 _PUBLIC_ void ndr_print_spoolss_DeviceModeFields(struct ndr_print *ndr, const char *name, uint32_t r)
535 {
536         ndr_print_uint32(ndr, name, r);
537         ndr->depth++;
538         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ORIENTATION", DEVMODE_ORIENTATION, r);
539         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERSIZE", DEVMODE_PAPERSIZE, r);
540         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERLENGTH", DEVMODE_PAPERLENGTH, r);
541         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERWIDTH", DEVMODE_PAPERWIDTH, r);
542         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_SCALE", DEVMODE_SCALE, r);
543         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_POSITION", DEVMODE_POSITION, r);
544         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_NUP", DEVMODE_NUP, r);
545         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COPIES", DEVMODE_COPIES, r);
546         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DEFAULTSOURCE", DEVMODE_DEFAULTSOURCE, r);
547         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PRINTQUALITY", DEVMODE_PRINTQUALITY, r);
548         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COLOR", DEVMODE_COLOR, r);
549         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DUPLEX", DEVMODE_DUPLEX, r);
550         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_YRESOLUTION", DEVMODE_YRESOLUTION, r);
551         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_TTOPTION", DEVMODE_TTOPTION, r);
552         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COLLATE", DEVMODE_COLLATE, r);
553         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_FORMNAME", DEVMODE_FORMNAME, r);
554         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_LOGPIXELS", DEVMODE_LOGPIXELS, r);
555         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_BITSPERPEL", DEVMODE_BITSPERPEL, r);
556         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PELSWIDTH", DEVMODE_PELSWIDTH, r);
557         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PELSHEIGHT", DEVMODE_PELSHEIGHT, r);
558         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DISPLAYFLAGS", DEVMODE_DISPLAYFLAGS, r);
559         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DISPLAYFREQUENCY", DEVMODE_DISPLAYFREQUENCY, r);
560         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ICMMETHOD", DEVMODE_ICMMETHOD, r);
561         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ICMINTENT", DEVMODE_ICMINTENT, r);
562         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_MEDIATYPE", DEVMODE_MEDIATYPE, r);
563         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DITHERTYPE", DEVMODE_DITHERTYPE, r);
564         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PANNINGWIDTH", DEVMODE_PANNINGWIDTH, r);
565         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PANNINGHEIGHT", DEVMODE_PANNINGHEIGHT, r);
566         ndr->depth--;
567 }
568
569 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeviceMode(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceMode *r)
570 {
571         if (ndr_flags & NDR_SCALARS) {
572                 NDR_CHECK(ndr_push_align(ndr, 4));
573                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devicename, 32, sizeof(uint16_t), CH_UTF16));
574                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->specversion));
575                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverversion));
576                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
577                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverextra_data.length));
578                 NDR_CHECK(ndr_push_spoolss_DeviceModeFields(ndr, NDR_SCALARS, r->fields));
579                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->orientation));
580                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->papersize));
581                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->paperlength));
582                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->paperwidth));
583                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->scale));
584                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->copies));
585                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->defaultsource));
586                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->printquality));
587                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->color));
588                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->duplex));
589                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->yresolution));
590                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ttoption));
591                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->collate));
592                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->formname, 32, sizeof(uint16_t), CH_UTF16));
593                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logpixels));
594                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bitsperpel));
595                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelswidth));
596                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelsheight));
597                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->displayflags));
598                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->displayfrequency));
599                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->icmmethod));
600                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->icmintent));
601                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->mediatype));
602                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dithertype));
603                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved1));
604                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved2));
605                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->panningwidth));
606                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->panningheight));
607                 {
608                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
609                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
610                         {
611                                 struct ndr_push *_ndr_driverextra_data;
612                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_driverextra_data, 0, r->driverextra_data.length));
613                                 NDR_CHECK(ndr_push_DATA_BLOB(_ndr_driverextra_data, NDR_SCALARS, r->driverextra_data));
614                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_driverextra_data, 0, r->driverextra_data.length));
615                         }
616                         ndr->flags = _flags_save_DATA_BLOB;
617                 }
618         }
619         if (ndr_flags & NDR_BUFFERS) {
620         }
621         return NDR_ERR_SUCCESS;
622 }
623
624 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeviceMode(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DeviceMode *r)
625 {
626         if (ndr_flags & NDR_SCALARS) {
627                 NDR_CHECK(ndr_pull_align(ndr, 4));
628                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devicename, 32, sizeof(uint16_t), CH_UTF16));
629                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->specversion));
630                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->driverversion));
631                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
632                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__driverextra_length));
633                 NDR_CHECK(ndr_pull_spoolss_DeviceModeFields(ndr, NDR_SCALARS, &r->fields));
634                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->orientation));
635                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->papersize));
636                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->paperlength));
637                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->paperwidth));
638                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->scale));
639                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->copies));
640                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->defaultsource));
641                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->printquality));
642                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->color));
643                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->duplex));
644                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->yresolution));
645                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ttoption));
646                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->collate));
647                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->formname, 32, sizeof(uint16_t), CH_UTF16));
648                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logpixels));
649                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bitsperpel));
650                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelswidth));
651                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelsheight));
652                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->displayflags));
653                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->displayfrequency));
654                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->icmmethod));
655                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->icmintent));
656                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->mediatype));
657                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dithertype));
658                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
659                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
660                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->panningwidth));
661                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->panningheight));
662                 {
663                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
664                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
665                         {
666                                 struct ndr_pull *_ndr_driverextra_data;
667                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_driverextra_data, 0, r->__driverextra_length));
668                                 NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_driverextra_data, NDR_SCALARS, &r->driverextra_data));
669                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_driverextra_data, 0, r->__driverextra_length));
670                         }
671                         ndr->flags = _flags_save_DATA_BLOB;
672                 }
673         }
674         if (ndr_flags & NDR_BUFFERS) {
675         }
676         return NDR_ERR_SUCCESS;
677 }
678
679 _PUBLIC_ void ndr_print_spoolss_DeviceMode(struct ndr_print *ndr, const char *name, const struct spoolss_DeviceMode *r)
680 {
681         ndr_print_struct(ndr, name, "spoolss_DeviceMode");
682         ndr->depth++;
683         ndr_print_string(ndr, "devicename", r->devicename);
684         ndr_print_uint16(ndr, "specversion", r->specversion);
685         ndr_print_uint16(ndr, "driverversion", r->driverversion);
686         ndr_print_uint16(ndr, "size", r->size);
687         ndr_print_uint16(ndr, "__driverextra_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->driverextra_data.length:r->__driverextra_length);
688         ndr_print_spoolss_DeviceModeFields(ndr, "fields", r->fields);
689         ndr_print_uint16(ndr, "orientation", r->orientation);
690         ndr_print_uint16(ndr, "papersize", r->papersize);
691         ndr_print_uint16(ndr, "paperlength", r->paperlength);
692         ndr_print_uint16(ndr, "paperwidth", r->paperwidth);
693         ndr_print_uint16(ndr, "scale", r->scale);
694         ndr_print_uint16(ndr, "copies", r->copies);
695         ndr_print_uint16(ndr, "defaultsource", r->defaultsource);
696         ndr_print_uint16(ndr, "printquality", r->printquality);
697         ndr_print_uint16(ndr, "color", r->color);
698         ndr_print_uint16(ndr, "duplex", r->duplex);
699         ndr_print_uint16(ndr, "yresolution", r->yresolution);
700         ndr_print_uint16(ndr, "ttoption", r->ttoption);
701         ndr_print_uint16(ndr, "collate", r->collate);
702         ndr_print_string(ndr, "formname", r->formname);
703         ndr_print_uint16(ndr, "logpixels", r->logpixels);
704         ndr_print_uint32(ndr, "bitsperpel", r->bitsperpel);
705         ndr_print_uint32(ndr, "pelswidth", r->pelswidth);
706         ndr_print_uint32(ndr, "pelsheight", r->pelsheight);
707         ndr_print_uint32(ndr, "displayflags", r->displayflags);
708         ndr_print_uint32(ndr, "displayfrequency", r->displayfrequency);
709         ndr_print_uint32(ndr, "icmmethod", r->icmmethod);
710         ndr_print_uint32(ndr, "icmintent", r->icmintent);
711         ndr_print_uint32(ndr, "mediatype", r->mediatype);
712         ndr_print_uint32(ndr, "dithertype", r->dithertype);
713         ndr_print_uint32(ndr, "reserved1", r->reserved1);
714         ndr_print_uint32(ndr, "reserved2", r->reserved2);
715         ndr_print_uint32(ndr, "panningwidth", r->panningwidth);
716         ndr_print_uint32(ndr, "panningheight", r->panningheight);
717         ndr_print_DATA_BLOB(ndr, "driverextra_data", r->driverextra_data);
718         ndr->depth--;
719 }
720
721 _PUBLIC_ size_t ndr_size_spoolss_DeviceMode(const struct spoolss_DeviceMode *r, struct smb_iconv_convenience *ic, int flags)
722 {
723         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DeviceMode, ic);
724 }
725
726 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
727 {
728         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
729         return NDR_ERR_SUCCESS;
730 }
731
732 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
733 {
734         uint32_t v;
735         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
736         *r = v;
737         return NDR_ERR_SUCCESS;
738 }
739
740 _PUBLIC_ void ndr_print_spoolss_EnumPrinterFlags(struct ndr_print *ndr, const char *name, uint32_t r)
741 {
742         ndr_print_uint32(ndr, name, r);
743         ndr->depth++;
744         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_DEFAULT", PRINTER_ENUM_DEFAULT, r);
745         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_LOCAL", PRINTER_ENUM_LOCAL, r);
746         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_CONNECTIONS", PRINTER_ENUM_CONNECTIONS, r);
747         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_FAVORITE", PRINTER_ENUM_FAVORITE, r);
748         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_NAME", PRINTER_ENUM_NAME, r);
749         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_REMOTE", PRINTER_ENUM_REMOTE, r);
750         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_SHARED", PRINTER_ENUM_SHARED, r);
751         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_NETWORK", PRINTER_ENUM_NETWORK, r);
752         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_EXPAND", PRINTER_ENUM_EXPAND, r);
753         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_CONTAINER", PRINTER_ENUM_CONTAINER, r);
754         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON1", PRINTER_ENUM_ICON1, r);
755         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON2", PRINTER_ENUM_ICON2, r);
756         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON3", PRINTER_ENUM_ICON3, r);
757         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON4", PRINTER_ENUM_ICON4, r);
758         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON5", PRINTER_ENUM_ICON5, r);
759         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON6", PRINTER_ENUM_ICON6, r);
760         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON7", PRINTER_ENUM_ICON7, r);
761         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON8", PRINTER_ENUM_ICON8, r);
762         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_HIDE", PRINTER_ENUM_HIDE, r);
763         ndr->depth--;
764 }
765
766 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo1 *r)
767 {
768         if (ndr_flags & NDR_SCALARS) {
769                 NDR_CHECK(ndr_push_align(ndr, 4));
770                 NDR_CHECK(ndr_push_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, r->flags));
771                 {
772                         uint32_t _flags_save_string = ndr->flags;
773                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
774                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->name));
775                         ndr->flags = _flags_save_string;
776                 }
777                 {
778                         uint32_t _flags_save_string = ndr->flags;
779                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
780                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->description));
781                         ndr->flags = _flags_save_string;
782                 }
783                 {
784                         uint32_t _flags_save_string = ndr->flags;
785                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
786                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->comment));
787                         ndr->flags = _flags_save_string;
788                 }
789         }
790         if (ndr_flags & NDR_BUFFERS) {
791                 {
792                         uint32_t _flags_save_string = ndr->flags;
793                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
794                         if (r->name) {
795                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->name));
796                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
797                         }
798                         ndr->flags = _flags_save_string;
799                 }
800                 {
801                         uint32_t _flags_save_string = ndr->flags;
802                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
803                         if (r->description) {
804                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->description));
805                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->description));
806                         }
807                         ndr->flags = _flags_save_string;
808                 }
809                 {
810                         uint32_t _flags_save_string = ndr->flags;
811                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
812                         if (r->comment) {
813                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->comment));
814                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
815                         }
816                         ndr->flags = _flags_save_string;
817                 }
818         }
819         return NDR_ERR_SUCCESS;
820 }
821
822 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo1 *r)
823 {
824         uint32_t _ptr_name;
825         TALLOC_CTX *_mem_save_name_0;
826         uint32_t _ptr_description;
827         TALLOC_CTX *_mem_save_description_0;
828         uint32_t _ptr_comment;
829         TALLOC_CTX *_mem_save_comment_0;
830         if (ndr_flags & NDR_SCALARS) {
831                 NDR_CHECK(ndr_pull_align(ndr, 4));
832                 NDR_CHECK(ndr_pull_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, &r->flags));
833                 {
834                         uint32_t _flags_save_string = ndr->flags;
835                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
836                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
837                         if (_ptr_name) {
838                                 NDR_PULL_ALLOC(ndr, r->name);
839                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->name, _ptr_name));
840                         } else {
841                                 r->name = NULL;
842                         }
843                         ndr->flags = _flags_save_string;
844                 }
845                 {
846                         uint32_t _flags_save_string = ndr->flags;
847                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
848                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_description));
849                         if (_ptr_description) {
850                                 NDR_PULL_ALLOC(ndr, r->description);
851                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->description, _ptr_description));
852                         } else {
853                                 r->description = NULL;
854                         }
855                         ndr->flags = _flags_save_string;
856                 }
857                 {
858                         uint32_t _flags_save_string = ndr->flags;
859                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
860                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
861                         if (_ptr_comment) {
862                                 NDR_PULL_ALLOC(ndr, r->comment);
863                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->comment, _ptr_comment));
864                         } else {
865                                 r->comment = NULL;
866                         }
867                         ndr->flags = _flags_save_string;
868                 }
869         }
870         if (ndr_flags & NDR_BUFFERS) {
871                 {
872                         uint32_t _flags_save_string = ndr->flags;
873                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
874                         if (r->name) {
875                                 uint32_t _relative_save_offset;
876                                 _relative_save_offset = ndr->offset;
877                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->name));
878                                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
879                                 NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
880                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
881                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
882                                 ndr->offset = _relative_save_offset;
883                         }
884                         ndr->flags = _flags_save_string;
885                 }
886                 {
887                         uint32_t _flags_save_string = ndr->flags;
888                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
889                         if (r->description) {
890                                 uint32_t _relative_save_offset;
891                                 _relative_save_offset = ndr->offset;
892                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->description));
893                                 _mem_save_description_0 = NDR_PULL_GET_MEM_CTX(ndr);
894                                 NDR_PULL_SET_MEM_CTX(ndr, r->description, 0);
895                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->description));
896                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_description_0, 0);
897                                 ndr->offset = _relative_save_offset;
898                         }
899                         ndr->flags = _flags_save_string;
900                 }
901                 {
902                         uint32_t _flags_save_string = ndr->flags;
903                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
904                         if (r->comment) {
905                                 uint32_t _relative_save_offset;
906                                 _relative_save_offset = ndr->offset;
907                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->comment));
908                                 _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
909                                 NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
910                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
911                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
912                                 ndr->offset = _relative_save_offset;
913                         }
914                         ndr->flags = _flags_save_string;
915                 }
916         }
917         return NDR_ERR_SUCCESS;
918 }
919
920 _PUBLIC_ void ndr_print_spoolss_PrinterInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo1 *r)
921 {
922         ndr_print_struct(ndr, name, "spoolss_PrinterInfo1");
923         ndr->depth++;
924         ndr_print_spoolss_EnumPrinterFlags(ndr, "flags", r->flags);
925         ndr_print_ptr(ndr, "name", r->name);
926         ndr->depth++;
927         if (r->name) {
928                 ndr_print_string(ndr, "name", r->name);
929         }
930         ndr->depth--;
931         ndr_print_ptr(ndr, "description", r->description);
932         ndr->depth++;
933         if (r->description) {
934                 ndr_print_string(ndr, "description", r->description);
935         }
936         ndr->depth--;
937         ndr_print_ptr(ndr, "comment", r->comment);
938         ndr->depth++;
939         if (r->comment) {
940                 ndr_print_string(ndr, "comment", r->comment);
941         }
942         ndr->depth--;
943         ndr->depth--;
944 }
945
946 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo1(const struct spoolss_PrinterInfo1 *r, struct smb_iconv_convenience *ic, int flags)
947 {
948         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo1, ic);
949 }
950
951 static enum ndr_err_code ndr_push_spoolss_PrinterAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
952 {
953         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
954         return NDR_ERR_SUCCESS;
955 }
956
957 static enum ndr_err_code ndr_pull_spoolss_PrinterAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
958 {
959         uint32_t v;
960         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
961         *r = v;
962         return NDR_ERR_SUCCESS;
963 }
964
965 _PUBLIC_ void ndr_print_spoolss_PrinterAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
966 {
967         ndr_print_uint32(ndr, name, r);
968         ndr->depth++;
969         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_QUEUED", PRINTER_ATTRIBUTE_QUEUED, r);
970         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DIRECT", PRINTER_ATTRIBUTE_DIRECT, r);
971         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DEFAULT", PRINTER_ATTRIBUTE_DEFAULT, r);
972         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_SHARED", PRINTER_ATTRIBUTE_SHARED, r);
973         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_NETWORK", PRINTER_ATTRIBUTE_NETWORK, r);
974         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_HIDDEN", PRINTER_ATTRIBUTE_HIDDEN, r);
975         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_LOCAL", PRINTER_ATTRIBUTE_LOCAL, r);
976         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_ENABLE_DEVQ", PRINTER_ATTRIBUTE_ENABLE_DEVQ, r);
977         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS", PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, r);
978         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST", PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, r);
979         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_WORK_OFFLINE", PRINTER_ATTRIBUTE_WORK_OFFLINE, r);
980         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_ENABLE_BIDI", PRINTER_ATTRIBUTE_ENABLE_BIDI, r);
981         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_RAW_ONLY", PRINTER_ATTRIBUTE_RAW_ONLY, r);
982         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_PUBLISHED", PRINTER_ATTRIBUTE_PUBLISHED, r);
983         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_FAX", PRINTER_ATTRIBUTE_FAX, r);
984         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_TS", PRINTER_ATTRIBUTE_TS, r);
985         ndr->depth--;
986 }
987
988 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo2 *r)
989 {
990         if (ndr_flags & NDR_SCALARS) {
991                 NDR_CHECK(ndr_push_align(ndr, 4));
992                 {
993                         uint32_t _flags_save_string = ndr->flags;
994                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
995                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->servername));
996                         ndr->flags = _flags_save_string;
997                 }
998                 {
999                         uint32_t _flags_save_string = ndr->flags;
1000                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1001                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
1002                         ndr->flags = _flags_save_string;
1003                 }
1004                 {
1005                         uint32_t _flags_save_string = ndr->flags;
1006                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1007                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sharename));
1008                         ndr->flags = _flags_save_string;
1009                 }
1010                 {
1011                         uint32_t _flags_save_string = ndr->flags;
1012                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1013                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->portname));
1014                         ndr->flags = _flags_save_string;
1015                 }
1016                 {
1017                         uint32_t _flags_save_string = ndr->flags;
1018                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1019                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->drivername));
1020                         ndr->flags = _flags_save_string;
1021                 }
1022                 {
1023                         uint32_t _flags_save_string = ndr->flags;
1024                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1025                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->comment));
1026                         ndr->flags = _flags_save_string;
1027                 }
1028                 {
1029                         uint32_t _flags_save_string = ndr->flags;
1030                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1031                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->location));
1032                         ndr->flags = _flags_save_string;
1033                 }
1034                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
1035                 {
1036                         uint32_t _flags_save_string = ndr->flags;
1037                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1038                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sepfile));
1039                         ndr->flags = _flags_save_string;
1040                 }
1041                 {
1042                         uint32_t _flags_save_string = ndr->flags;
1043                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1044                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printprocessor));
1045                         ndr->flags = _flags_save_string;
1046                 }
1047                 {
1048                         uint32_t _flags_save_string = ndr->flags;
1049                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1050                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->datatype));
1051                         ndr->flags = _flags_save_string;
1052                 }
1053                 {
1054                         uint32_t _flags_save_string = ndr->flags;
1055                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1056                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters));
1057                         ndr->flags = _flags_save_string;
1058                 }
1059                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
1060                 NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
1061                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
1062                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->defaultpriority));
1063                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->starttime));
1064                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->untiltime));
1065                 NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
1066                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cjobs));
1067                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->averageppm));
1068         }
1069         if (ndr_flags & NDR_BUFFERS) {
1070                 {
1071                         uint32_t _flags_save_string = ndr->flags;
1072                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1073                         if (r->servername) {
1074                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->servername));
1075                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
1076                         }
1077                         ndr->flags = _flags_save_string;
1078                 }
1079                 {
1080                         uint32_t _flags_save_string = ndr->flags;
1081                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1082                         if (r->printername) {
1083                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printername));
1084                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
1085                         }
1086                         ndr->flags = _flags_save_string;
1087                 }
1088                 {
1089                         uint32_t _flags_save_string = ndr->flags;
1090                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1091                         if (r->sharename) {
1092                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sharename));
1093                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sharename));
1094                         }
1095                         ndr->flags = _flags_save_string;
1096                 }
1097                 {
1098                         uint32_t _flags_save_string = ndr->flags;
1099                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1100                         if (r->portname) {
1101                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->portname));
1102                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->portname));
1103                         }
1104                         ndr->flags = _flags_save_string;
1105                 }
1106                 {
1107                         uint32_t _flags_save_string = ndr->flags;
1108                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1109                         if (r->drivername) {
1110                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->drivername));
1111                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->drivername));
1112                         }
1113                         ndr->flags = _flags_save_string;
1114                 }
1115                 {
1116                         uint32_t _flags_save_string = ndr->flags;
1117                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1118                         if (r->comment) {
1119                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->comment));
1120                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
1121                         }
1122                         ndr->flags = _flags_save_string;
1123                 }
1124                 {
1125                         uint32_t _flags_save_string = ndr->flags;
1126                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1127                         if (r->location) {
1128                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->location));
1129                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->location));
1130                         }
1131                         ndr->flags = _flags_save_string;
1132                 }
1133                 if (r->devmode) {
1134                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->devmode));
1135                         {
1136                                 struct ndr_push *_ndr_devmode;
1137                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
1138                                 NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
1139                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
1140                         }
1141                 }
1142                 {
1143                         uint32_t _flags_save_string = ndr->flags;
1144                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1145                         if (r->sepfile) {
1146                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sepfile));
1147                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sepfile));
1148                         }
1149                         ndr->flags = _flags_save_string;
1150                 }
1151                 {
1152                         uint32_t _flags_save_string = ndr->flags;
1153                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1154                         if (r->printprocessor) {
1155                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printprocessor));
1156                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printprocessor));
1157                         }
1158                         ndr->flags = _flags_save_string;
1159                 }
1160                 {
1161                         uint32_t _flags_save_string = ndr->flags;
1162                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1163                         if (r->datatype) {
1164                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->datatype));
1165                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->datatype));
1166                         }
1167                         ndr->flags = _flags_save_string;
1168                 }
1169                 {
1170                         uint32_t _flags_save_string = ndr->flags;
1171                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1172                         if (r->parameters) {
1173                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->parameters));
1174                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters));
1175                         }
1176                         ndr->flags = _flags_save_string;
1177                 }
1178                 if (r->secdesc) {
1179                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->secdesc));
1180                         {
1181                                 struct ndr_push *_ndr_secdesc;
1182                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
1183                                 NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
1184                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
1185                         }
1186                 }
1187         }
1188         return NDR_ERR_SUCCESS;
1189 }
1190
1191 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo2 *r)
1192 {
1193         uint32_t _ptr_servername;
1194         TALLOC_CTX *_mem_save_servername_0;
1195         uint32_t _ptr_printername;
1196         TALLOC_CTX *_mem_save_printername_0;
1197         uint32_t _ptr_sharename;
1198         TALLOC_CTX *_mem_save_sharename_0;
1199         uint32_t _ptr_portname;
1200         TALLOC_CTX *_mem_save_portname_0;
1201         uint32_t _ptr_drivername;
1202         TALLOC_CTX *_mem_save_drivername_0;
1203         uint32_t _ptr_comment;
1204         TALLOC_CTX *_mem_save_comment_0;
1205         uint32_t _ptr_location;
1206         TALLOC_CTX *_mem_save_location_0;
1207         uint32_t _ptr_devmode;
1208         TALLOC_CTX *_mem_save_devmode_0;
1209         uint32_t _ptr_sepfile;
1210         TALLOC_CTX *_mem_save_sepfile_0;
1211         uint32_t _ptr_printprocessor;
1212         TALLOC_CTX *_mem_save_printprocessor_0;
1213         uint32_t _ptr_datatype;
1214         TALLOC_CTX *_mem_save_datatype_0;
1215         uint32_t _ptr_parameters;
1216         TALLOC_CTX *_mem_save_parameters_0;
1217         uint32_t _ptr_secdesc;
1218         TALLOC_CTX *_mem_save_secdesc_0;
1219         if (ndr_flags & NDR_SCALARS) {
1220                 NDR_CHECK(ndr_pull_align(ndr, 4));
1221                 {
1222                         uint32_t _flags_save_string = ndr->flags;
1223                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1224                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
1225                         if (_ptr_servername) {
1226                                 NDR_PULL_ALLOC(ndr, r->servername);
1227                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->servername, _ptr_servername));
1228                         } else {
1229                                 r->servername = NULL;
1230                         }
1231                         ndr->flags = _flags_save_string;
1232                 }
1233                 {
1234                         uint32_t _flags_save_string = ndr->flags;
1235                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1236                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
1237                         if (_ptr_printername) {
1238                                 NDR_PULL_ALLOC(ndr, r->printername);
1239                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
1240                         } else {
1241                                 r->printername = NULL;
1242                         }
1243                         ndr->flags = _flags_save_string;
1244                 }
1245                 {
1246                         uint32_t _flags_save_string = ndr->flags;
1247                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1248                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename));
1249                         if (_ptr_sharename) {
1250                                 NDR_PULL_ALLOC(ndr, r->sharename);
1251                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sharename, _ptr_sharename));
1252                         } else {
1253                                 r->sharename = NULL;
1254                         }
1255                         ndr->flags = _flags_save_string;
1256                 }
1257                 {
1258                         uint32_t _flags_save_string = ndr->flags;
1259                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1260                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
1261                         if (_ptr_portname) {
1262                                 NDR_PULL_ALLOC(ndr, r->portname);
1263                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->portname, _ptr_portname));
1264                         } else {
1265                                 r->portname = NULL;
1266                         }
1267                         ndr->flags = _flags_save_string;
1268                 }
1269                 {
1270                         uint32_t _flags_save_string = ndr->flags;
1271                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1272                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_drivername));
1273                         if (_ptr_drivername) {
1274                                 NDR_PULL_ALLOC(ndr, r->drivername);
1275                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->drivername, _ptr_drivername));
1276                         } else {
1277                                 r->drivername = NULL;
1278                         }
1279                         ndr->flags = _flags_save_string;
1280                 }
1281                 {
1282                         uint32_t _flags_save_string = ndr->flags;
1283                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1284                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
1285                         if (_ptr_comment) {
1286                                 NDR_PULL_ALLOC(ndr, r->comment);
1287                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->comment, _ptr_comment));
1288                         } else {
1289                                 r->comment = NULL;
1290                         }
1291                         ndr->flags = _flags_save_string;
1292                 }
1293                 {
1294                         uint32_t _flags_save_string = ndr->flags;
1295                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1296                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_location));
1297                         if (_ptr_location) {
1298                                 NDR_PULL_ALLOC(ndr, r->location);
1299                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->location, _ptr_location));
1300                         } else {
1301                                 r->location = NULL;
1302                         }
1303                         ndr->flags = _flags_save_string;
1304                 }
1305                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
1306                 if (_ptr_devmode) {
1307                         NDR_PULL_ALLOC(ndr, r->devmode);
1308                         NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
1309                 } else {
1310                         r->devmode = NULL;
1311                 }
1312                 {
1313                         uint32_t _flags_save_string = ndr->flags;
1314                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1315                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sepfile));
1316                         if (_ptr_sepfile) {
1317                                 NDR_PULL_ALLOC(ndr, r->sepfile);
1318                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sepfile, _ptr_sepfile));
1319                         } else {
1320                                 r->sepfile = NULL;
1321                         }
1322                         ndr->flags = _flags_save_string;
1323                 }
1324                 {
1325                         uint32_t _flags_save_string = ndr->flags;
1326                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1327                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printprocessor));
1328                         if (_ptr_printprocessor) {
1329                                 NDR_PULL_ALLOC(ndr, r->printprocessor);
1330                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printprocessor, _ptr_printprocessor));
1331                         } else {
1332                                 r->printprocessor = NULL;
1333                         }
1334                         ndr->flags = _flags_save_string;
1335                 }
1336                 {
1337                         uint32_t _flags_save_string = ndr->flags;
1338                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1339                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_datatype));
1340                         if (_ptr_datatype) {
1341                                 NDR_PULL_ALLOC(ndr, r->datatype);
1342                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->datatype, _ptr_datatype));
1343                         } else {
1344                                 r->datatype = NULL;
1345                         }
1346                         ndr->flags = _flags_save_string;
1347                 }
1348                 {
1349                         uint32_t _flags_save_string = ndr->flags;
1350                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1351                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
1352                         if (_ptr_parameters) {
1353                                 NDR_PULL_ALLOC(ndr, r->parameters);
1354                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters));
1355                         } else {
1356                                 r->parameters = NULL;
1357                         }
1358                         ndr->flags = _flags_save_string;
1359                 }
1360                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
1361                 if (_ptr_secdesc) {
1362                         NDR_PULL_ALLOC(ndr, r->secdesc);
1363                         NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
1364                 } else {
1365                         r->secdesc = NULL;
1366                 }
1367                 NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
1368                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
1369                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->defaultpriority));
1370                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->starttime));
1371                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->untiltime));
1372                 NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
1373                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cjobs));
1374                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->averageppm));
1375         }
1376         if (ndr_flags & NDR_BUFFERS) {
1377                 {
1378                         uint32_t _flags_save_string = ndr->flags;
1379                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1380                         if (r->servername) {
1381                                 uint32_t _relative_save_offset;
1382                                 _relative_save_offset = ndr->offset;
1383                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->servername));
1384                                 _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1385                                 NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
1386                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
1387                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
1388                                 ndr->offset = _relative_save_offset;
1389                         }
1390                         ndr->flags = _flags_save_string;
1391                 }
1392                 {
1393                         uint32_t _flags_save_string = ndr->flags;
1394                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1395                         if (r->printername) {
1396                                 uint32_t _relative_save_offset;
1397                                 _relative_save_offset = ndr->offset;
1398                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
1399                                 _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1400                                 NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
1401                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
1402                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
1403                                 ndr->offset = _relative_save_offset;
1404                         }
1405                         ndr->flags = _flags_save_string;
1406                 }
1407                 {
1408                         uint32_t _flags_save_string = ndr->flags;
1409                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1410                         if (r->sharename) {
1411                                 uint32_t _relative_save_offset;
1412                                 _relative_save_offset = ndr->offset;
1413                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sharename));
1414                                 _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr);
1415                                 NDR_PULL_SET_MEM_CTX(ndr, r->sharename, 0);
1416                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sharename));
1417                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0);
1418                                 ndr->offset = _relative_save_offset;
1419                         }
1420                         ndr->flags = _flags_save_string;
1421                 }
1422                 {
1423                         uint32_t _flags_save_string = ndr->flags;
1424                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1425                         if (r->portname) {
1426                                 uint32_t _relative_save_offset;
1427                                 _relative_save_offset = ndr->offset;
1428                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->portname));
1429                                 _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
1430                                 NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
1431                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->portname));
1432                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
1433                                 ndr->offset = _relative_save_offset;
1434                         }
1435                         ndr->flags = _flags_save_string;
1436                 }
1437                 {
1438                         uint32_t _flags_save_string = ndr->flags;
1439                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1440                         if (r->drivername) {
1441                                 uint32_t _relative_save_offset;
1442                                 _relative_save_offset = ndr->offset;
1443                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->drivername));
1444                                 _mem_save_drivername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1445                                 NDR_PULL_SET_MEM_CTX(ndr, r->drivername, 0);
1446                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->drivername));
1447                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_drivername_0, 0);
1448                                 ndr->offset = _relative_save_offset;
1449                         }
1450                         ndr->flags = _flags_save_string;
1451                 }
1452                 {
1453                         uint32_t _flags_save_string = ndr->flags;
1454                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1455                         if (r->comment) {
1456                                 uint32_t _relative_save_offset;
1457                                 _relative_save_offset = ndr->offset;
1458                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->comment));
1459                                 _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
1460                                 NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
1461                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
1462                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
1463                                 ndr->offset = _relative_save_offset;
1464                         }
1465                         ndr->flags = _flags_save_string;
1466                 }
1467                 {
1468                         uint32_t _flags_save_string = ndr->flags;
1469                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1470                         if (r->location) {
1471                                 uint32_t _relative_save_offset;
1472                                 _relative_save_offset = ndr->offset;
1473                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->location));
1474                                 _mem_save_location_0 = NDR_PULL_GET_MEM_CTX(ndr);
1475                                 NDR_PULL_SET_MEM_CTX(ndr, r->location, 0);
1476                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->location));
1477                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0);
1478                                 ndr->offset = _relative_save_offset;
1479                         }
1480                         ndr->flags = _flags_save_string;
1481                 }
1482                 if (r->devmode) {
1483                         uint32_t _relative_save_offset;
1484                         _relative_save_offset = ndr->offset;
1485                         NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
1486                         _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
1487                         NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
1488                         {
1489                                 struct ndr_pull *_ndr_devmode;
1490                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
1491                                 NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
1492                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
1493                         }
1494                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
1495                         ndr->offset = _relative_save_offset;
1496                 }
1497                 {
1498                         uint32_t _flags_save_string = ndr->flags;
1499                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1500                         if (r->sepfile) {
1501                                 uint32_t _relative_save_offset;
1502                                 _relative_save_offset = ndr->offset;
1503                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sepfile));
1504                                 _mem_save_sepfile_0 = NDR_PULL_GET_MEM_CTX(ndr);
1505                                 NDR_PULL_SET_MEM_CTX(ndr, r->sepfile, 0);
1506                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sepfile));
1507                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sepfile_0, 0);
1508                                 ndr->offset = _relative_save_offset;
1509                         }
1510                         ndr->flags = _flags_save_string;
1511                 }
1512                 {
1513                         uint32_t _flags_save_string = ndr->flags;
1514                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1515                         if (r->printprocessor) {
1516                                 uint32_t _relative_save_offset;
1517                                 _relative_save_offset = ndr->offset;
1518                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printprocessor));
1519                                 _mem_save_printprocessor_0 = NDR_PULL_GET_MEM_CTX(ndr);
1520                                 NDR_PULL_SET_MEM_CTX(ndr, r->printprocessor, 0);
1521                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printprocessor));
1522                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printprocessor_0, 0);
1523                                 ndr->offset = _relative_save_offset;
1524                         }
1525                         ndr->flags = _flags_save_string;
1526                 }
1527                 {
1528                         uint32_t _flags_save_string = ndr->flags;
1529                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1530                         if (r->datatype) {
1531                                 uint32_t _relative_save_offset;
1532                                 _relative_save_offset = ndr->offset;
1533                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->datatype));
1534                                 _mem_save_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
1535                                 NDR_PULL_SET_MEM_CTX(ndr, r->datatype, 0);
1536                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->datatype));
1537                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_datatype_0, 0);
1538                                 ndr->offset = _relative_save_offset;
1539                         }
1540                         ndr->flags = _flags_save_string;
1541                 }
1542                 {
1543                         uint32_t _flags_save_string = ndr->flags;
1544                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1545                         if (r->parameters) {
1546                                 uint32_t _relative_save_offset;
1547                                 _relative_save_offset = ndr->offset;
1548                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters));
1549                                 _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
1550                                 NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
1551                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters));
1552                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
1553                                 ndr->offset = _relative_save_offset;
1554                         }
1555                         ndr->flags = _flags_save_string;
1556                 }
1557                 if (r->secdesc) {
1558                         uint32_t _relative_save_offset;
1559                         _relative_save_offset = ndr->offset;
1560                         NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
1561                         _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
1562                         NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
1563                         {
1564                                 struct ndr_pull *_ndr_secdesc;
1565                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
1566                                 NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
1567                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
1568                         }
1569                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
1570                         ndr->offset = _relative_save_offset;
1571                 }
1572         }
1573         return NDR_ERR_SUCCESS;
1574 }
1575
1576 _PUBLIC_ void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo2 *r)
1577 {
1578         ndr_print_struct(ndr, name, "spoolss_PrinterInfo2");
1579         ndr->depth++;
1580         ndr_print_ptr(ndr, "servername", r->servername);
1581         ndr->depth++;
1582         if (r->servername) {
1583                 ndr_print_string(ndr, "servername", r->servername);
1584         }
1585         ndr->depth--;
1586         ndr_print_ptr(ndr, "printername", r->printername);
1587         ndr->depth++;
1588         if (r->printername) {
1589                 ndr_print_string(ndr, "printername", r->printername);
1590         }
1591         ndr->depth--;
1592         ndr_print_ptr(ndr, "sharename", r->sharename);
1593         ndr->depth++;
1594         if (r->sharename) {
1595                 ndr_print_string(ndr, "sharename", r->sharename);
1596         }
1597         ndr->depth--;
1598         ndr_print_ptr(ndr, "portname", r->portname);
1599         ndr->depth++;
1600         if (r->portname) {
1601                 ndr_print_string(ndr, "portname", r->portname);
1602         }
1603         ndr->depth--;
1604         ndr_print_ptr(ndr, "drivername", r->drivername);
1605         ndr->depth++;
1606         if (r->drivername) {
1607                 ndr_print_string(ndr, "drivername", r->drivername);
1608         }
1609         ndr->depth--;
1610         ndr_print_ptr(ndr, "comment", r->comment);
1611         ndr->depth++;
1612         if (r->comment) {
1613                 ndr_print_string(ndr, "comment", r->comment);
1614         }
1615         ndr->depth--;
1616         ndr_print_ptr(ndr, "location", r->location);
1617         ndr->depth++;
1618         if (r->location) {
1619                 ndr_print_string(ndr, "location", r->location);
1620         }
1621         ndr->depth--;
1622         ndr_print_ptr(ndr, "devmode", r->devmode);
1623         ndr->depth++;
1624         if (r->devmode) {
1625                 ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
1626         }
1627         ndr->depth--;
1628         ndr_print_ptr(ndr, "sepfile", r->sepfile);
1629         ndr->depth++;
1630         if (r->sepfile) {
1631                 ndr_print_string(ndr, "sepfile", r->sepfile);
1632         }
1633         ndr->depth--;
1634         ndr_print_ptr(ndr, "printprocessor", r->printprocessor);
1635         ndr->depth++;
1636         if (r->printprocessor) {
1637                 ndr_print_string(ndr, "printprocessor", r->printprocessor);
1638         }
1639         ndr->depth--;
1640         ndr_print_ptr(ndr, "datatype", r->datatype);
1641         ndr->depth++;
1642         if (r->datatype) {
1643                 ndr_print_string(ndr, "datatype", r->datatype);
1644         }
1645         ndr->depth--;
1646         ndr_print_ptr(ndr, "parameters", r->parameters);
1647         ndr->depth++;
1648         if (r->parameters) {
1649                 ndr_print_string(ndr, "parameters", r->parameters);
1650         }
1651         ndr->depth--;
1652         ndr_print_ptr(ndr, "secdesc", r->secdesc);
1653         ndr->depth++;
1654         if (r->secdesc) {
1655                 ndr_print_security_descriptor(ndr, "secdesc", r->secdesc);
1656         }
1657         ndr->depth--;
1658         ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
1659         ndr_print_uint32(ndr, "priority", r->priority);
1660         ndr_print_uint32(ndr, "defaultpriority", r->defaultpriority);
1661         ndr_print_uint32(ndr, "starttime", r->starttime);
1662         ndr_print_uint32(ndr, "untiltime", r->untiltime);
1663         ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
1664         ndr_print_uint32(ndr, "cjobs", r->cjobs);
1665         ndr_print_uint32(ndr, "averageppm", r->averageppm);
1666         ndr->depth--;
1667 }
1668
1669 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo2(const struct spoolss_PrinterInfo2 *r, struct smb_iconv_convenience *ic, int flags)
1670 {
1671         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo2, ic);
1672 }
1673
1674 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo3 *r)
1675 {
1676         if (ndr_flags & NDR_SCALARS) {
1677                 NDR_CHECK(ndr_push_align(ndr, 4));
1678                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
1679         }
1680         if (ndr_flags & NDR_BUFFERS) {
1681                 if (r->secdesc) {
1682                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->secdesc));
1683                         {
1684                                 struct ndr_push *_ndr_secdesc;
1685                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
1686                                 NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
1687                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
1688                         }
1689                 }
1690         }
1691         return NDR_ERR_SUCCESS;
1692 }
1693
1694 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo3 *r)
1695 {
1696         uint32_t _ptr_secdesc;
1697         TALLOC_CTX *_mem_save_secdesc_0;
1698         if (ndr_flags & NDR_SCALARS) {
1699                 NDR_CHECK(ndr_pull_align(ndr, 4));
1700                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
1701                 if (_ptr_secdesc) {
1702                         NDR_PULL_ALLOC(ndr, r->secdesc);
1703                         NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
1704                 } else {
1705                         r->secdesc = NULL;
1706                 }
1707         }
1708         if (ndr_flags & NDR_BUFFERS) {
1709                 if (r->secdesc) {
1710                         uint32_t _relative_save_offset;
1711                         _relative_save_offset = ndr->offset;
1712                         NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
1713                         _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
1714                         NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
1715                         {
1716                                 struct ndr_pull *_ndr_secdesc;
1717                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
1718                                 NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
1719                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
1720                         }
1721                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
1722                         ndr->offset = _relative_save_offset;
1723                 }
1724         }
1725         return NDR_ERR_SUCCESS;
1726 }
1727
1728 _PUBLIC_ void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo3 *r)
1729 {
1730         ndr_print_struct(ndr, name, "spoolss_PrinterInfo3");
1731         ndr->depth++;
1732         ndr_print_ptr(ndr, "secdesc", r->secdesc);
1733         ndr->depth++;
1734         if (r->secdesc) {
1735                 ndr_print_security_descriptor(ndr, "secdesc", r->secdesc);
1736         }
1737         ndr->depth--;
1738         ndr->depth--;
1739 }
1740
1741 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo3(const struct spoolss_PrinterInfo3 *r, struct smb_iconv_convenience *ic, int flags)
1742 {
1743         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo3, ic);
1744 }
1745
1746 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo4 *r)
1747 {
1748         if (ndr_flags & NDR_SCALARS) {
1749                 NDR_CHECK(ndr_push_align(ndr, 4));
1750                 {
1751                         uint32_t _flags_save_string = ndr->flags;
1752                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1753                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
1754                         ndr->flags = _flags_save_string;
1755                 }
1756                 {
1757                         uint32_t _flags_save_string = ndr->flags;
1758                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1759                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->servername));
1760                         ndr->flags = _flags_save_string;
1761                 }
1762                 NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
1763         }
1764         if (ndr_flags & NDR_BUFFERS) {
1765                 {
1766                         uint32_t _flags_save_string = ndr->flags;
1767                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1768                         if (r->printername) {
1769                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printername));
1770                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
1771                         }
1772                         ndr->flags = _flags_save_string;
1773                 }
1774                 {
1775                         uint32_t _flags_save_string = ndr->flags;
1776                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1777                         if (r->servername) {
1778                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->servername));
1779                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
1780                         }
1781                         ndr->flags = _flags_save_string;
1782                 }
1783         }
1784         return NDR_ERR_SUCCESS;
1785 }
1786
1787 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo4 *r)
1788 {
1789         uint32_t _ptr_printername;
1790         TALLOC_CTX *_mem_save_printername_0;
1791         uint32_t _ptr_servername;
1792         TALLOC_CTX *_mem_save_servername_0;
1793         if (ndr_flags & NDR_SCALARS) {
1794                 NDR_CHECK(ndr_pull_align(ndr, 4));
1795                 {
1796                         uint32_t _flags_save_string = ndr->flags;
1797                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1798                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
1799                         if (_ptr_printername) {
1800                                 NDR_PULL_ALLOC(ndr, r->printername);
1801                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
1802                         } else {
1803                                 r->printername = NULL;
1804                         }
1805                         ndr->flags = _flags_save_string;
1806                 }
1807                 {
1808                         uint32_t _flags_save_string = ndr->flags;
1809                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1810                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
1811                         if (_ptr_servername) {
1812                                 NDR_PULL_ALLOC(ndr, r->servername);
1813                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->servername, _ptr_servername));
1814                         } else {
1815                                 r->servername = NULL;
1816                         }
1817                         ndr->flags = _flags_save_string;
1818                 }
1819                 NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
1820         }
1821         if (ndr_flags & NDR_BUFFERS) {
1822                 {
1823                         uint32_t _flags_save_string = ndr->flags;
1824                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1825                         if (r->printername) {
1826                                 uint32_t _relative_save_offset;
1827                                 _relative_save_offset = ndr->offset;
1828                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
1829                                 _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1830                                 NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
1831                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
1832                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
1833                                 ndr->offset = _relative_save_offset;
1834                         }
1835                         ndr->flags = _flags_save_string;
1836                 }
1837                 {
1838                         uint32_t _flags_save_string = ndr->flags;
1839                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1840                         if (r->servername) {
1841                                 uint32_t _relative_save_offset;
1842                                 _relative_save_offset = ndr->offset;
1843                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->servername));
1844                                 _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1845                                 NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
1846                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
1847                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
1848                                 ndr->offset = _relative_save_offset;
1849                         }
1850                         ndr->flags = _flags_save_string;
1851                 }
1852         }
1853         return NDR_ERR_SUCCESS;
1854 }
1855
1856 _PUBLIC_ void ndr_print_spoolss_PrinterInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo4 *r)
1857 {
1858         ndr_print_struct(ndr, name, "spoolss_PrinterInfo4");
1859         ndr->depth++;
1860         ndr_print_ptr(ndr, "printername", r->printername);
1861         ndr->depth++;
1862         if (r->printername) {
1863                 ndr_print_string(ndr, "printername", r->printername);
1864         }
1865         ndr->depth--;
1866         ndr_print_ptr(ndr, "servername", r->servername);
1867         ndr->depth++;
1868         if (r->servername) {
1869                 ndr_print_string(ndr, "servername", r->servername);
1870         }
1871         ndr->depth--;
1872         ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
1873         ndr->depth--;
1874 }
1875
1876 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo4(const struct spoolss_PrinterInfo4 *r, struct smb_iconv_convenience *ic, int flags)
1877 {
1878         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo4, ic);
1879 }
1880
1881 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo5 *r)
1882 {
1883         if (ndr_flags & NDR_SCALARS) {
1884                 NDR_CHECK(ndr_push_align(ndr, 4));
1885                 {
1886                         uint32_t _flags_save_string = ndr->flags;
1887                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1888                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
1889                         ndr->flags = _flags_save_string;
1890                 }
1891                 {
1892                         uint32_t _flags_save_string = ndr->flags;
1893                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1894                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->portname));
1895                         ndr->flags = _flags_save_string;
1896                 }
1897                 NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
1898                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->device_not_selected_timeout));
1899                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->transmission_retry_timeout));
1900         }
1901         if (ndr_flags & NDR_BUFFERS) {
1902                 {
1903                         uint32_t _flags_save_string = ndr->flags;
1904                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1905                         if (r->printername) {
1906                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printername));
1907                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
1908                         }
1909                         ndr->flags = _flags_save_string;
1910                 }
1911                 {
1912                         uint32_t _flags_save_string = ndr->flags;
1913                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1914                         if (r->portname) {
1915                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->portname));
1916                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->portname));
1917                         }
1918                         ndr->flags = _flags_save_string;
1919                 }
1920         }
1921         return NDR_ERR_SUCCESS;
1922 }
1923
1924 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo5 *r)
1925 {
1926         uint32_t _ptr_printername;
1927         TALLOC_CTX *_mem_save_printername_0;
1928         uint32_t _ptr_portname;
1929         TALLOC_CTX *_mem_save_portname_0;
1930         if (ndr_flags & NDR_SCALARS) {
1931                 NDR_CHECK(ndr_pull_align(ndr, 4));
1932                 {
1933                         uint32_t _flags_save_string = ndr->flags;
1934                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1935                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
1936                         if (_ptr_printername) {
1937                                 NDR_PULL_ALLOC(ndr, r->printername);
1938                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
1939                         } else {
1940                                 r->printername = NULL;
1941                         }
1942                         ndr->flags = _flags_save_string;
1943                 }
1944                 {
1945                         uint32_t _flags_save_string = ndr->flags;
1946                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1947                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
1948                         if (_ptr_portname) {
1949                                 NDR_PULL_ALLOC(ndr, r->portname);
1950                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->portname, _ptr_portname));
1951                         } else {
1952                                 r->portname = NULL;
1953                         }
1954                         ndr->flags = _flags_save_string;
1955                 }
1956                 NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
1957                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->device_not_selected_timeout));
1958                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->transmission_retry_timeout));
1959         }
1960         if (ndr_flags & NDR_BUFFERS) {
1961                 {
1962                         uint32_t _flags_save_string = ndr->flags;
1963                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1964                         if (r->printername) {
1965                                 uint32_t _relative_save_offset;
1966                                 _relative_save_offset = ndr->offset;
1967                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
1968                                 _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
1969                                 NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
1970                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
1971                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
1972                                 ndr->offset = _relative_save_offset;
1973                         }
1974                         ndr->flags = _flags_save_string;
1975                 }
1976                 {
1977                         uint32_t _flags_save_string = ndr->flags;
1978                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1979                         if (r->portname) {
1980                                 uint32_t _relative_save_offset;
1981                                 _relative_save_offset = ndr->offset;
1982                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->portname));
1983                                 _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
1984                                 NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
1985                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->portname));
1986                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
1987                                 ndr->offset = _relative_save_offset;
1988                         }
1989                         ndr->flags = _flags_save_string;
1990                 }
1991         }
1992         return NDR_ERR_SUCCESS;
1993 }
1994
1995 _PUBLIC_ void ndr_print_spoolss_PrinterInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo5 *r)
1996 {
1997         ndr_print_struct(ndr, name, "spoolss_PrinterInfo5");
1998         ndr->depth++;
1999         ndr_print_ptr(ndr, "printername", r->printername);
2000         ndr->depth++;
2001         if (r->printername) {
2002                 ndr_print_string(ndr, "printername", r->printername);
2003         }
2004         ndr->depth--;
2005         ndr_print_ptr(ndr, "portname", r->portname);
2006         ndr->depth++;
2007         if (r->portname) {
2008                 ndr_print_string(ndr, "portname", r->portname);
2009         }
2010         ndr->depth--;
2011         ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
2012         ndr_print_uint32(ndr, "device_not_selected_timeout", r->device_not_selected_timeout);
2013         ndr_print_uint32(ndr, "transmission_retry_timeout", r->transmission_retry_timeout);
2014         ndr->depth--;
2015 }
2016
2017 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo5(const struct spoolss_PrinterInfo5 *r, struct smb_iconv_convenience *ic, int flags)
2018 {
2019         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo5, ic);
2020 }
2021
2022 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo6 *r)
2023 {
2024         if (ndr_flags & NDR_SCALARS) {
2025                 NDR_CHECK(ndr_push_align(ndr, 4));
2026                 NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
2027         }
2028         if (ndr_flags & NDR_BUFFERS) {
2029         }
2030         return NDR_ERR_SUCCESS;
2031 }
2032
2033 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo6 *r)
2034 {
2035         if (ndr_flags & NDR_SCALARS) {
2036                 NDR_CHECK(ndr_pull_align(ndr, 4));
2037                 NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
2038         }
2039         if (ndr_flags & NDR_BUFFERS) {
2040         }
2041         return NDR_ERR_SUCCESS;
2042 }
2043
2044 _PUBLIC_ void ndr_print_spoolss_PrinterInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo6 *r)
2045 {
2046         ndr_print_struct(ndr, name, "spoolss_PrinterInfo6");
2047         ndr->depth++;
2048         ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
2049         ndr->depth--;
2050 }
2051
2052 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo6(const struct spoolss_PrinterInfo6 *r, struct smb_iconv_convenience *ic, int flags)
2053 {
2054         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo6, ic);
2055 }
2056
2057 static enum ndr_err_code ndr_push_spoolss_DsPrintAction(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2058 {
2059         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2060         return NDR_ERR_SUCCESS;
2061 }
2062
2063 static enum ndr_err_code ndr_pull_spoolss_DsPrintAction(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2064 {
2065         uint32_t v;
2066         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2067         *r = v;
2068         return NDR_ERR_SUCCESS;
2069 }
2070
2071 _PUBLIC_ void ndr_print_spoolss_DsPrintAction(struct ndr_print *ndr, const char *name, uint32_t r)
2072 {
2073         ndr_print_uint32(ndr, name, r);
2074         ndr->depth++;
2075         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_PUBLISH", DSPRINT_PUBLISH, r);
2076         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_UPDATE", DSPRINT_UPDATE, r);
2077         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_UNPUBLISH", DSPRINT_UNPUBLISH, r);
2078         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_REPUBLISH", DSPRINT_REPUBLISH, r);
2079         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_PENDING", DSPRINT_PENDING, r);
2080         ndr->depth--;
2081 }
2082
2083 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo7 *r)
2084 {
2085         if (ndr_flags & NDR_SCALARS) {
2086                 NDR_CHECK(ndr_push_align(ndr, 4));
2087                 {
2088                         uint32_t _flags_save_string = ndr->flags;
2089                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2090                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->guid));
2091                         ndr->flags = _flags_save_string;
2092                 }
2093                 NDR_CHECK(ndr_push_spoolss_DsPrintAction(ndr, NDR_SCALARS, r->action));
2094         }
2095         if (ndr_flags & NDR_BUFFERS) {
2096                 {
2097                         uint32_t _flags_save_string = ndr->flags;
2098                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2099                         if (r->guid) {
2100                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->guid));
2101                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->guid));
2102                         }
2103                         ndr->flags = _flags_save_string;
2104                 }
2105         }
2106         return NDR_ERR_SUCCESS;
2107 }
2108
2109 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo7 *r)
2110 {
2111         uint32_t _ptr_guid;
2112         TALLOC_CTX *_mem_save_guid_0;
2113         if (ndr_flags & NDR_SCALARS) {
2114                 NDR_CHECK(ndr_pull_align(ndr, 4));
2115                 {
2116                         uint32_t _flags_save_string = ndr->flags;
2117                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2118                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guid));
2119                         if (_ptr_guid) {
2120                                 NDR_PULL_ALLOC(ndr, r->guid);
2121                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->guid, _ptr_guid));
2122                         } else {
2123                                 r->guid = NULL;
2124                         }
2125                         ndr->flags = _flags_save_string;
2126                 }
2127                 NDR_CHECK(ndr_pull_spoolss_DsPrintAction(ndr, NDR_SCALARS, &r->action));
2128         }
2129         if (ndr_flags & NDR_BUFFERS) {
2130                 {
2131                         uint32_t _flags_save_string = ndr->flags;
2132                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2133                         if (r->guid) {
2134                                 uint32_t _relative_save_offset;
2135                                 _relative_save_offset = ndr->offset;
2136                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->guid));
2137                                 _mem_save_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2138                                 NDR_PULL_SET_MEM_CTX(ndr, r->guid, 0);
2139                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->guid));
2140                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guid_0, 0);
2141                                 ndr->offset = _relative_save_offset;
2142                         }
2143                         ndr->flags = _flags_save_string;
2144                 }
2145         }
2146         return NDR_ERR_SUCCESS;
2147 }
2148
2149 _PUBLIC_ void ndr_print_spoolss_PrinterInfo7(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo7 *r)
2150 {
2151         ndr_print_struct(ndr, name, "spoolss_PrinterInfo7");
2152         ndr->depth++;
2153         ndr_print_ptr(ndr, "guid", r->guid);
2154         ndr->depth++;
2155         if (r->guid) {
2156                 ndr_print_string(ndr, "guid", r->guid);
2157         }
2158         ndr->depth--;
2159         ndr_print_spoolss_DsPrintAction(ndr, "action", r->action);
2160         ndr->depth--;
2161 }
2162
2163 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo7(const struct spoolss_PrinterInfo7 *r, struct smb_iconv_convenience *ic, int flags)
2164 {
2165         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo7, ic);
2166 }
2167
2168 static enum ndr_err_code ndr_push_spoolss_DeviceModeInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceModeInfo *r)
2169 {
2170         if (ndr_flags & NDR_SCALARS) {
2171                 NDR_CHECK(ndr_push_align(ndr, 4));
2172                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
2173         }
2174         if (ndr_flags & NDR_BUFFERS) {
2175                 if (r->devmode) {
2176                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->devmode));
2177                         {
2178                                 struct ndr_push *_ndr_devmode;
2179                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
2180                                 NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
2181                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
2182                         }
2183                 }
2184         }
2185         return NDR_ERR_SUCCESS;
2186 }
2187
2188 static enum ndr_err_code ndr_pull_spoolss_DeviceModeInfo(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DeviceModeInfo *r)
2189 {
2190         uint32_t _ptr_devmode;
2191         TALLOC_CTX *_mem_save_devmode_0;
2192         if (ndr_flags & NDR_SCALARS) {
2193                 NDR_CHECK(ndr_pull_align(ndr, 4));
2194                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
2195                 if (_ptr_devmode) {
2196                         NDR_PULL_ALLOC(ndr, r->devmode);
2197                         NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
2198                 } else {
2199                         r->devmode = NULL;
2200                 }
2201         }
2202         if (ndr_flags & NDR_BUFFERS) {
2203                 if (r->devmode) {
2204                         uint32_t _relative_save_offset;
2205                         _relative_save_offset = ndr->offset;
2206                         NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
2207                         _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
2208                         NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
2209                         {
2210                                 struct ndr_pull *_ndr_devmode;
2211                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
2212                                 NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
2213                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
2214                         }
2215                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
2216                         ndr->offset = _relative_save_offset;
2217                 }
2218         }
2219         return NDR_ERR_SUCCESS;
2220 }
2221
2222 _PUBLIC_ void ndr_print_spoolss_DeviceModeInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DeviceModeInfo *r)
2223 {
2224         ndr_print_struct(ndr, name, "spoolss_DeviceModeInfo");
2225         ndr->depth++;
2226         ndr_print_ptr(ndr, "devmode", r->devmode);
2227         ndr->depth++;
2228         if (r->devmode) {
2229                 ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
2230         }
2231         ndr->depth--;
2232         ndr->depth--;
2233 }
2234
2235 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterInfo *r)
2236 {
2237         uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
2238         if (ndr_flags & NDR_SCALARS) {
2239                 int level = ndr_push_get_switch_value(ndr, r);
2240                 switch (level) {
2241                         case 0: {
2242                                 NDR_CHECK(ndr_push_align(ndr, 4));
2243                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2244                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo0(ndr, NDR_SCALARS, &r->info0));
2245                         break; }
2246
2247                         case 1: {
2248                                 NDR_CHECK(ndr_push_align(ndr, 4));
2249                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2250                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo1(ndr, NDR_SCALARS, &r->info1));
2251                         break; }
2252
2253                         case 2: {
2254                                 NDR_CHECK(ndr_push_align(ndr, 4));
2255                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2256                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo2(ndr, NDR_SCALARS, &r->info2));
2257                         break; }
2258
2259                         case 3: {
2260                                 NDR_CHECK(ndr_push_align(ndr, 4));
2261                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2262                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo3(ndr, NDR_SCALARS, &r->info3));
2263                         break; }
2264
2265                         case 4: {
2266                                 NDR_CHECK(ndr_push_align(ndr, 4));
2267                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2268                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo4(ndr, NDR_SCALARS, &r->info4));
2269                         break; }
2270
2271                         case 5: {
2272                                 NDR_CHECK(ndr_push_align(ndr, 4));
2273                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2274                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo5(ndr, NDR_SCALARS, &r->info5));
2275                         break; }
2276
2277                         case 6: {
2278                                 NDR_CHECK(ndr_push_align(ndr, 4));
2279                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2280                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo6(ndr, NDR_SCALARS, &r->info6));
2281                         break; }
2282
2283                         case 7: {
2284                                 NDR_CHECK(ndr_push_align(ndr, 4));
2285                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2286                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo7(ndr, NDR_SCALARS, &r->info7));
2287                         break; }
2288
2289                         case 8: {
2290                                 NDR_CHECK(ndr_push_align(ndr, 4));
2291                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2292                                 NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info8));
2293                         break; }
2294
2295                         case 9: {
2296                                 NDR_CHECK(ndr_push_align(ndr, 4));
2297                                 NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
2298                                 NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info9));
2299                         break; }
2300
2301                         default: {
2302                         break; }
2303
2304                 }
2305         }
2306         if (ndr_flags & NDR_BUFFERS) {
2307                 int level = ndr_push_get_switch_value(ndr, r);
2308                 NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
2309                 switch (level) {
2310                         case 0:
2311                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo0(ndr, NDR_BUFFERS, &r->info0));
2312                         break;
2313
2314                         case 1:
2315                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo1(ndr, NDR_BUFFERS, &r->info1));
2316                         break;
2317
2318                         case 2:
2319                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo2(ndr, NDR_BUFFERS, &r->info2));
2320                         break;
2321
2322                         case 3:
2323                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo3(ndr, NDR_BUFFERS, &r->info3));
2324                         break;
2325
2326                         case 4:
2327                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo4(ndr, NDR_BUFFERS, &r->info4));
2328                         break;
2329
2330                         case 5:
2331                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo5(ndr, NDR_BUFFERS, &r->info5));
2332                         break;
2333
2334                         case 6:
2335                         break;
2336
2337                         case 7:
2338                                 NDR_CHECK(ndr_push_spoolss_PrinterInfo7(ndr, NDR_BUFFERS, &r->info7));
2339                         break;
2340
2341                         case 8:
2342                                 NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info8));
2343                         break;
2344
2345                         case 9:
2346                                 NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info9));
2347                         break;
2348
2349                         default:
2350                         break;
2351
2352                 }
2353         }
2354         ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
2355         return NDR_ERR_SUCCESS;
2356 }
2357
2358 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterInfo *r)
2359 {
2360         uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
2361         int level;
2362         level = ndr_pull_get_switch_value(ndr, r);
2363         if (ndr_flags & NDR_SCALARS) {
2364                 switch (level) {
2365                         case 0: {
2366                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2367                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2368                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo0(ndr, NDR_SCALARS, &r->info0));
2369                         break; }
2370
2371                         case 1: {
2372                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2373                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2374                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo1(ndr, NDR_SCALARS, &r->info1));
2375                         break; }
2376
2377                         case 2: {
2378                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2379                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2380                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo2(ndr, NDR_SCALARS, &r->info2));
2381                         break; }
2382
2383                         case 3: {
2384                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2385                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2386                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo3(ndr, NDR_SCALARS, &r->info3));
2387                         break; }
2388
2389                         case 4: {
2390                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2391                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2392                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo4(ndr, NDR_SCALARS, &r->info4));
2393                         break; }
2394
2395                         case 5: {
2396                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2397                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2398                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo5(ndr, NDR_SCALARS, &r->info5));
2399                         break; }
2400
2401                         case 6: {
2402                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2403                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2404                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo6(ndr, NDR_SCALARS, &r->info6));
2405                         break; }
2406
2407                         case 7: {
2408                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2409                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2410                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo7(ndr, NDR_SCALARS, &r->info7));
2411                         break; }
2412
2413                         case 8: {
2414                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2415                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2416                                 NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info8));
2417                         break; }
2418
2419                         case 9: {
2420                                 NDR_CHECK(ndr_pull_align(ndr, 4));
2421                                 NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
2422                                 NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info9));
2423                         break; }
2424
2425                         default: {
2426                         break; }
2427
2428                 }
2429         }
2430         if (ndr_flags & NDR_BUFFERS) {
2431                 NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
2432                 switch (level) {
2433                         case 0:
2434                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo0(ndr, NDR_BUFFERS, &r->info0));
2435                         break;
2436
2437                         case 1:
2438                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo1(ndr, NDR_BUFFERS, &r->info1));
2439                         break;
2440
2441                         case 2:
2442                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo2(ndr, NDR_BUFFERS, &r->info2));
2443                         break;
2444
2445                         case 3:
2446                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo3(ndr, NDR_BUFFERS, &r->info3));
2447                         break;
2448
2449                         case 4:
2450                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo4(ndr, NDR_BUFFERS, &r->info4));
2451                         break;
2452
2453                         case 5:
2454                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo5(ndr, NDR_BUFFERS, &r->info5));
2455                         break;
2456
2457                         case 6:
2458                         break;
2459
2460                         case 7:
2461                                 NDR_CHECK(ndr_pull_spoolss_PrinterInfo7(ndr, NDR_BUFFERS, &r->info7));
2462                         break;
2463
2464                         case 8:
2465                                 NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info8));
2466                         break;
2467
2468                         case 9:
2469                                 NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info9));
2470                         break;
2471
2472                         default:
2473                         break;
2474
2475                 }
2476         }
2477         ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
2478         return NDR_ERR_SUCCESS;
2479 }
2480
2481 _PUBLIC_ void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrinterInfo *r)
2482 {
2483         int level;
2484         level = ndr_print_get_switch_value(ndr, r);
2485         ndr_print_union(ndr, name, level, "spoolss_PrinterInfo");
2486         switch (level) {
2487                 case 0:
2488                         ndr_print_spoolss_PrinterInfo0(ndr, "info0", &r->info0);
2489                 break;
2490
2491                 case 1:
2492                         ndr_print_spoolss_PrinterInfo1(ndr, "info1", &r->info1);
2493                 break;
2494
2495                 case 2:
2496                         ndr_print_spoolss_PrinterInfo2(ndr, "info2", &r->info2);
2497                 break;
2498
2499                 case 3:
2500                         ndr_print_spoolss_PrinterInfo3(ndr, "info3", &r->info3);
2501                 break;
2502
2503                 case 4:
2504                         ndr_print_spoolss_PrinterInfo4(ndr, "info4", &r->info4);
2505                 break;
2506
2507                 case 5:
2508                         ndr_print_spoolss_PrinterInfo5(ndr, "info5", &r->info5);
2509                 break;
2510
2511                 case 6:
2512                         ndr_print_spoolss_PrinterInfo6(ndr, "info6", &r->info6);
2513                 break;
2514
2515                 case 7:
2516                         ndr_print_spoolss_PrinterInfo7(ndr, "info7", &r->info7);
2517                 break;
2518
2519                 case 8:
2520                         ndr_print_spoolss_DeviceModeInfo(ndr, "info8", &r->info8);
2521                 break;
2522
2523                 case 9:
2524                         ndr_print_spoolss_DeviceModeInfo(ndr, "info9", &r->info9);
2525                 break;
2526
2527                 default:
2528                 break;
2529
2530         }
2531 }
2532
2533 _PUBLIC_ size_t ndr_size_spoolss_PrinterInfo(const union spoolss_PrinterInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
2534 {
2535         return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo, ic);
2536 }
2537
2538 static enum ndr_err_code ndr_push_spoolss_DevmodeContainer(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DevmodeContainer *r)
2539 {
2540         if (ndr_flags & NDR_SCALARS) {
2541                 NDR_CHECK(ndr_push_align(ndr, 4));
2542                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
2543                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode));
2544         }
2545         if (ndr_flags & NDR_BUFFERS) {
2546                 if (r->devmode) {
2547                         {
2548                                 struct ndr_push *_ndr_devmode;
2549                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 4, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
2550                                 NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
2551                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 4, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
2552                         }
2553                 }
2554         }
2555         return NDR_ERR_SUCCESS;
2556 }
2557
2558 static enum ndr_err_code ndr_pull_spoolss_DevmodeContainer(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DevmodeContainer *r)
2559 {
2560         uint32_t _ptr_devmode;
2561         TALLOC_CTX *_mem_save_devmode_0;
2562         if (ndr_flags & NDR_SCALARS) {
2563                 NDR_CHECK(ndr_pull_align(ndr, 4));
2564                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
2565                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
2566                 if (_ptr_devmode) {
2567                         NDR_PULL_ALLOC(ndr, r->devmode);
2568                 } else {
2569                         r->devmode = NULL;
2570                 }
2571         }
2572         if (ndr_flags & NDR_BUFFERS) {
2573                 if (r->devmode) {
2574                         _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
2575                         NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
2576                         {
2577                                 struct ndr_pull *_ndr_devmode;
2578                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 4, r->_ndr_size));
2579                                 NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
2580                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 4, r->_ndr_size));
2581                         }
2582                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
2583                 }
2584         }
2585         return NDR_ERR_SUCCESS;
2586 }
2587
2588 _PUBLIC_ void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const char *name, const struct spoolss_DevmodeContainer *r)
2589 {
2590         ndr_print_struct(ndr, name, "spoolss_DevmodeContainer");
2591         ndr->depth++;
2592         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);
2593         ndr_print_ptr(ndr, "devmode", r->devmode);
2594         ndr->depth++;
2595         if (r->devmode) {
2596                 ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
2597         }
2598         ndr->depth--;
2599         ndr->depth--;
2600 }
2601
2602 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r)
2603 {
2604         if (ndr_flags & NDR_SCALARS) {
2605                 NDR_CHECK(ndr_push_align(ndr, 4));
2606                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
2607                 {
2608                         uint32_t _flags_save_string = ndr->flags;
2609                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2610                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name));
2611                         ndr->flags = _flags_save_string;
2612                 }
2613                 {
2614                         uint32_t _flags_save_string = ndr->flags;
2615                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2616                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name));
2617                         ndr->flags = _flags_save_string;
2618                 }
2619                 {
2620                         uint32_t _flags_save_string = ndr->flags;
2621                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2622                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name));
2623                         ndr->flags = _flags_save_string;
2624                 }
2625                 {
2626                         uint32_t _flags_save_string = ndr->flags;
2627                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2628                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name));
2629                         ndr->flags = _flags_save_string;
2630                 }
2631                 {
2632                         uint32_t _flags_save_string = ndr->flags;
2633                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2634                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type));
2635                         ndr->flags = _flags_save_string;
2636                 }
2637                 {
2638                         uint32_t _flags_save_string = ndr->flags;
2639                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2640                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
2641                         ndr->flags = _flags_save_string;
2642                 }
2643                 NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
2644                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
2645                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
2646                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
2647                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
2648                 NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
2649         }
2650         if (ndr_flags & NDR_BUFFERS) {
2651                 {
2652                         uint32_t _flags_save_string = ndr->flags;
2653                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2654                         if (r->printer_name) {
2655                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printer_name));
2656                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name));
2657                         }
2658                         ndr->flags = _flags_save_string;
2659                 }
2660                 {
2661                         uint32_t _flags_save_string = ndr->flags;
2662                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2663                         if (r->server_name) {
2664                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->server_name));
2665                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name));
2666                         }
2667                         ndr->flags = _flags_save_string;
2668                 }
2669                 {
2670                         uint32_t _flags_save_string = ndr->flags;
2671                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2672                         if (r->user_name) {
2673                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->user_name));
2674                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
2675                         }
2676                         ndr->flags = _flags_save_string;
2677                 }
2678                 {
2679                         uint32_t _flags_save_string = ndr->flags;
2680                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2681                         if (r->document_name) {
2682                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->document_name));
2683                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name));
2684                         }
2685                         ndr->flags = _flags_save_string;
2686                 }
2687                 {
2688                         uint32_t _flags_save_string = ndr->flags;
2689                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2690                         if (r->data_type) {
2691                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->data_type));
2692                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type));
2693                         }
2694                         ndr->flags = _flags_save_string;
2695                 }
2696                 {
2697                         uint32_t _flags_save_string = ndr->flags;
2698                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2699                         if (r->text_status) {
2700                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->text_status));
2701                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status));
2702                         }
2703                         ndr->flags = _flags_save_string;
2704                 }
2705         }
2706         return NDR_ERR_SUCCESS;
2707 }
2708
2709 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo1 *r)
2710 {
2711         uint32_t _ptr_printer_name;
2712         TALLOC_CTX *_mem_save_printer_name_0;
2713         uint32_t _ptr_server_name;
2714         TALLOC_CTX *_mem_save_server_name_0;
2715         uint32_t _ptr_user_name;
2716         TALLOC_CTX *_mem_save_user_name_0;
2717         uint32_t _ptr_document_name;
2718         TALLOC_CTX *_mem_save_document_name_0;
2719         uint32_t _ptr_data_type;
2720         TALLOC_CTX *_mem_save_data_type_0;
2721         uint32_t _ptr_text_status;
2722         TALLOC_CTX *_mem_save_text_status_0;
2723         if (ndr_flags & NDR_SCALARS) {
2724                 NDR_CHECK(ndr_pull_align(ndr, 4));
2725                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
2726                 {
2727                         uint32_t _flags_save_string = ndr->flags;
2728                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2729                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
2730                         if (_ptr_printer_name) {
2731                                 NDR_PULL_ALLOC(ndr, r->printer_name);
2732                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name));
2733                         } else {
2734                                 r->printer_name = NULL;
2735                         }
2736                         ndr->flags = _flags_save_string;
2737                 }
2738                 {
2739                         uint32_t _flags_save_string = ndr->flags;
2740                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2741                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
2742                         if (_ptr_server_name) {
2743                                 NDR_PULL_ALLOC(ndr, r->server_name);
2744                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name));
2745                         } else {
2746                                 r->server_name = NULL;
2747                         }
2748                         ndr->flags = _flags_save_string;
2749                 }
2750                 {
2751                         uint32_t _flags_save_string = ndr->flags;
2752                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2753                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
2754                         if (_ptr_user_name) {
2755                                 NDR_PULL_ALLOC(ndr, r->user_name);
2756                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name));
2757                         } else {
2758                                 r->user_name = NULL;
2759                         }
2760                         ndr->flags = _flags_save_string;
2761                 }
2762                 {
2763                         uint32_t _flags_save_string = ndr->flags;
2764                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2765                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
2766                         if (_ptr_document_name) {
2767                                 NDR_PULL_ALLOC(ndr, r->document_name);
2768                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name));
2769                         } else {
2770                                 r->document_name = NULL;
2771                         }
2772                         ndr->flags = _flags_save_string;
2773                 }
2774                 {
2775                         uint32_t _flags_save_string = ndr->flags;
2776                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2777                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
2778                         if (_ptr_data_type) {
2779                                 NDR_PULL_ALLOC(ndr, r->data_type);
2780                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type));
2781                         } else {
2782                                 r->data_type = NULL;
2783                         }
2784                         ndr->flags = _flags_save_string;
2785                 }
2786                 {
2787                         uint32_t _flags_save_string = ndr->flags;
2788                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2789                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
2790                         if (_ptr_text_status) {
2791                                 NDR_PULL_ALLOC(ndr, r->text_status);
2792                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status));
2793                         } else {
2794                                 r->text_status = NULL;
2795                         }
2796                         ndr->flags = _flags_save_string;
2797                 }
2798                 NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
2799                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
2800                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
2801                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
2802                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
2803                 NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
2804         }
2805         if (ndr_flags & NDR_BUFFERS) {
2806                 {
2807                         uint32_t _flags_save_string = ndr->flags;
2808                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2809                         if (r->printer_name) {
2810                                 uint32_t _relative_save_offset;
2811                                 _relative_save_offset = ndr->offset;
2812                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name));
2813                                 _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2814                                 NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
2815                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name));
2816                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
2817                                 ndr->offset = _relative_save_offset;
2818                         }
2819                         ndr->flags = _flags_save_string;
2820                 }
2821                 {
2822                         uint32_t _flags_save_string = ndr->flags;
2823                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2824                         if (r->server_name) {
2825                                 uint32_t _relative_save_offset;
2826                                 _relative_save_offset = ndr->offset;
2827                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name));
2828                                 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2829                                 NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
2830                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name));
2831                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
2832                                 ndr->offset = _relative_save_offset;
2833                         }
2834                         ndr->flags = _flags_save_string;
2835                 }
2836                 {
2837                         uint32_t _flags_save_string = ndr->flags;
2838                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2839                         if (r->user_name) {
2840                                 uint32_t _relative_save_offset;
2841                                 _relative_save_offset = ndr->offset;
2842                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name));
2843                                 _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2844                                 NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
2845                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
2846                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
2847                                 ndr->offset = _relative_save_offset;
2848                         }
2849                         ndr->flags = _flags_save_string;
2850                 }
2851                 {
2852                         uint32_t _flags_save_string = ndr->flags;
2853                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2854                         if (r->document_name) {
2855                                 uint32_t _relative_save_offset;
2856                                 _relative_save_offset = ndr->offset;
2857                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name));
2858                                 _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2859                                 NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
2860                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name));
2861                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
2862                                 ndr->offset = _relative_save_offset;
2863                         }
2864                         ndr->flags = _flags_save_string;
2865                 }
2866                 {
2867                         uint32_t _flags_save_string = ndr->flags;
2868                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2869                         if (r->data_type) {
2870                                 uint32_t _relative_save_offset;
2871                                 _relative_save_offset = ndr->offset;
2872                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type));
2873                                 _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
2874                                 NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
2875                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type));
2876                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
2877                                 ndr->offset = _relative_save_offset;
2878                         }
2879                         ndr->flags = _flags_save_string;
2880                 }
2881                 {
2882                         uint32_t _flags_save_string = ndr->flags;
2883                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2884                         if (r->text_status) {
2885                                 uint32_t _relative_save_offset;
2886                                 _relative_save_offset = ndr->offset;
2887                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status));
2888                                 _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
2889                                 NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
2890                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status));
2891                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
2892                                 ndr->offset = _relative_save_offset;
2893                         }
2894                         ndr->flags = _flags_save_string;
2895                 }
2896         }
2897         return NDR_ERR_SUCCESS;
2898 }
2899
2900 _PUBLIC_ void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo1 *r)
2901 {
2902         ndr_print_struct(ndr, name, "spoolss_JobInfo1");
2903         ndr->depth++;
2904         ndr_print_uint32(ndr, "job_id", r->job_id);
2905         ndr_print_ptr(ndr, "printer_name", r->printer_name);
2906         ndr->depth++;
2907         if (r->printer_name) {
2908                 ndr_print_string(ndr, "printer_name", r->printer_name);
2909         }
2910         ndr->depth--;
2911         ndr_print_ptr(ndr, "server_name", r->server_name);
2912         ndr->depth++;
2913         if (r->server_name) {
2914                 ndr_print_string(ndr, "server_name", r->server_name);
2915         }
2916         ndr->depth--;
2917         ndr_print_ptr(ndr, "user_name", r->user_name);
2918         ndr->depth++;
2919         if (r->user_name) {
2920                 ndr_print_string(ndr, "user_name", r->user_name);
2921         }
2922         ndr->depth--;
2923         ndr_print_ptr(ndr, "document_name", r->document_name);
2924         ndr->depth++;
2925         if (r->document_name) {
2926                 ndr_print_string(ndr, "document_name", r->document_name);
2927         }
2928         ndr->depth--;
2929         ndr_print_ptr(ndr, "data_type", r->data_type);
2930         ndr->depth++;
2931         if (r->data_type) {
2932                 ndr_print_string(ndr, "data_type", r->data_type);
2933         }
2934         ndr->depth--;
2935         ndr_print_ptr(ndr, "text_status", r->text_status);
2936         ndr->depth++;
2937         if (r->text_status) {
2938                 ndr_print_string(ndr, "text_status", r->text_status);
2939         }
2940         ndr->depth--;
2941         ndr_print_spoolss_JobStatus(ndr, "status", r->status);
2942         ndr_print_uint32(ndr, "priority", r->priority);
2943         ndr_print_uint32(ndr, "position", r->position);
2944         ndr_print_uint32(ndr, "total_pages", r->total_pages);
2945         ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
2946         ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
2947         ndr->depth--;
2948 }
2949
2950 _PUBLIC_ size_t ndr_size_spoolss_JobInfo1(const struct spoolss_JobInfo1 *r, struct smb_iconv_convenience *ic, int flags)
2951 {
2952         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo1, ic);
2953 }
2954
2955 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo2 *r)
2956 {
2957         if (ndr_flags & NDR_SCALARS) {
2958                 NDR_CHECK(ndr_push_align(ndr, 4));
2959                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
2960                 {
2961                         uint32_t _flags_save_string = ndr->flags;
2962                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2963                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name));
2964                         ndr->flags = _flags_save_string;
2965                 }
2966                 {
2967                         uint32_t _flags_save_string = ndr->flags;
2968                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2969                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name));
2970                         ndr->flags = _flags_save_string;
2971                 }
2972                 {
2973                         uint32_t _flags_save_string = ndr->flags;
2974                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2975                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name));
2976                         ndr->flags = _flags_save_string;
2977                 }
2978                 {
2979                         uint32_t _flags_save_string = ndr->flags;
2980                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2981                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name));
2982                         ndr->flags = _flags_save_string;
2983                 }
2984                 {
2985                         uint32_t _flags_save_string = ndr->flags;
2986                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2987                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->notify_name));
2988                         ndr->flags = _flags_save_string;
2989                 }
2990                 {
2991                         uint32_t _flags_save_string = ndr->flags;
2992                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2993                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type));
2994                         ndr->flags = _flags_save_string;
2995                 }
2996                 {
2997                         uint32_t _flags_save_string = ndr->flags;
2998                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2999                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor));
3000                         ndr->flags = _flags_save_string;
3001                 }
3002                 {
3003                         uint32_t _flags_save_string = ndr->flags;
3004                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3005                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters));
3006                         ndr->flags = _flags_save_string;
3007                 }
3008                 {
3009                         uint32_t _flags_save_string = ndr->flags;
3010                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3011                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
3012                         ndr->flags = _flags_save_string;
3013                 }
3014                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
3015                 {
3016                         uint32_t _flags_save_string = ndr->flags;
3017                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3018                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
3019                         ndr->flags = _flags_save_string;
3020                 }
3021                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
3022                 NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
3023                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
3024                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
3025                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time));
3026                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time));
3027                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
3028                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
3029                 NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
3030                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
3031                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
3032         }
3033         if (ndr_flags & NDR_BUFFERS) {
3034                 {
3035                         uint32_t _flags_save_string = ndr->flags;
3036                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3037                         if (r->printer_name) {
3038                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printer_name));
3039                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name));
3040                         }
3041                         ndr->flags = _flags_save_string;
3042                 }
3043                 {
3044                         uint32_t _flags_save_string = ndr->flags;
3045                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3046                         if (r->server_name) {
3047                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->server_name));
3048                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name));
3049                         }
3050                         ndr->flags = _flags_save_string;
3051                 }
3052                 {
3053                         uint32_t _flags_save_string = ndr->flags;
3054                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3055                         if (r->user_name) {
3056                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->user_name));
3057                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
3058                         }
3059                         ndr->flags = _flags_save_string;
3060                 }
3061                 {
3062                         uint32_t _flags_save_string = ndr->flags;
3063                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3064                         if (r->document_name) {
3065                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->document_name));
3066                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name));
3067                         }
3068                         ndr->flags = _flags_save_string;
3069                 }
3070                 {
3071                         uint32_t _flags_save_string = ndr->flags;
3072                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3073                         if (r->notify_name) {
3074                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->notify_name));
3075                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->notify_name));
3076                         }
3077                         ndr->flags = _flags_save_string;
3078                 }
3079                 {
3080                         uint32_t _flags_save_string = ndr->flags;
3081                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3082                         if (r->data_type) {
3083                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->data_type));
3084                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type));
3085                         }
3086                         ndr->flags = _flags_save_string;
3087                 }
3088                 {
3089                         uint32_t _flags_save_string = ndr->flags;
3090                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3091                         if (r->print_processor) {
3092                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->print_processor));
3093                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor));
3094                         }
3095                         ndr->flags = _flags_save_string;
3096                 }
3097                 {
3098                         uint32_t _flags_save_string = ndr->flags;
3099                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3100                         if (r->parameters) {
3101                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->parameters));
3102                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters));
3103                         }
3104                         ndr->flags = _flags_save_string;
3105                 }
3106                 {
3107                         uint32_t _flags_save_string = ndr->flags;
3108                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3109                         if (r->driver_name) {
3110                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->driver_name));
3111                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
3112                         }
3113                         ndr->flags = _flags_save_string;
3114                 }
3115                 if (r->devmode) {
3116                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->devmode));
3117                         NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode));
3118                 }
3119                 {
3120                         uint32_t _flags_save_string = ndr->flags;
3121                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3122                         if (r->text_status) {
3123                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->text_status));
3124                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status));
3125                         }
3126                         ndr->flags = _flags_save_string;
3127                 }
3128                 if (r->secdesc) {
3129                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->secdesc));
3130                         NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
3131                 }
3132         }
3133         return NDR_ERR_SUCCESS;
3134 }
3135
3136 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo2 *r)
3137 {
3138         uint32_t _ptr_printer_name;
3139         TALLOC_CTX *_mem_save_printer_name_0;
3140         uint32_t _ptr_server_name;
3141         TALLOC_CTX *_mem_save_server_name_0;
3142         uint32_t _ptr_user_name;
3143         TALLOC_CTX *_mem_save_user_name_0;
3144         uint32_t _ptr_document_name;
3145         TALLOC_CTX *_mem_save_document_name_0;
3146         uint32_t _ptr_notify_name;
3147         TALLOC_CTX *_mem_save_notify_name_0;
3148         uint32_t _ptr_data_type;
3149         TALLOC_CTX *_mem_save_data_type_0;
3150         uint32_t _ptr_print_processor;
3151         TALLOC_CTX *_mem_save_print_processor_0;
3152         uint32_t _ptr_parameters;
3153         TALLOC_CTX *_mem_save_parameters_0;
3154         uint32_t _ptr_driver_name;
3155         TALLOC_CTX *_mem_save_driver_name_0;
3156         uint32_t _ptr_devmode;
3157         TALLOC_CTX *_mem_save_devmode_0;
3158         uint32_t _ptr_text_status;
3159         TALLOC_CTX *_mem_save_text_status_0;
3160         uint32_t _ptr_secdesc;
3161         TALLOC_CTX *_mem_save_secdesc_0;
3162         if (ndr_flags & NDR_SCALARS) {
3163                 NDR_CHECK(ndr_pull_align(ndr, 4));
3164                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
3165                 {
3166                         uint32_t _flags_save_string = ndr->flags;
3167                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
3168                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
3169                         if (_ptr_printer_name) {
3170                                 NDR_PULL_ALLOC(ndr, r->printer_name);
3171                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name));
3172                         } else {