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