Fix syntax errors.
[ira/wip.git] / source4 / librpc / ndr / ndr_spoolss_buf.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    routines for marshalling/unmarshalling spoolss subcontext buffer structures
5
6    Copyright (C) Andrew Tridgell 2003
7    Copyright (C) Tim Potter 2003
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23
24 #include "includes.h"
25 #include "librpc/gen_ndr/ndr_spoolss.h"
26 #include "param/param.h"
27
28 #define NDR_SPOOLSS_PUSH_ENUM_IN(fn) do { \
29         if (!r->in.buffer && r->in.offered != 0) {\
30                 return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
31                         "SPOOLSS Buffer: r->in.offered[%u] but there's no buffer",\
32                         (unsigned)r->in.offered);\
33         } else if (r->in.buffer && r->in.buffer->length != r->in.offered) {\
34                 return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
35                         "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\
36                         (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\
37         }\
38         _r.in.level     = r->in.level;\
39         _r.in.buffer    = r->in.buffer;\
40         _r.in.offered   = r->in.offered;\
41         NDR_CHECK(ndr_push__##fn(ndr, flags, &_r));\
42 } while(0)
43
44 #define NDR_SPOOLSS_PUSH_ENUM_OUT(fn) do { \
45         struct ndr_push *_ndr_info;\
46         _r.in.level     = r->in.level;\
47         _r.in.buffer    = r->in.buffer;\
48         _r.in.offered   = r->in.offered;\
49         _r.out.info     = NULL;\
50         _r.out.needed   = r->out.needed;\
51         _r.out.count    = r->out.count;\
52         _r.out.result   = r->out.result;\
53         if (r->out.info && !r->in.buffer) {\
54                 return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
55                         "SPOOLSS Buffer: r->out.info but there's no r->in.buffer");\
56         }\
57         if (r->in.buffer) {\
58                 DATA_BLOB _data_blob_info;\
59                 _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);\
60                 NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
61                 _ndr_info->flags= ndr->flags;\
62                 if (r->out.info) {\
63                         struct __##fn __r;\
64                         __r.in.level    = r->in.level;\
65                         __r.in.count    = r->out.count;\
66                         __r.out.info    = r->out.info;\
67                         NDR_CHECK(ndr_push___##fn(_ndr_info, flags, &__r)); \
68                 }\
69                 if (r->in.offered > _ndr_info->offset) {\
70                         uint32_t _padding_len = r->in.offered - _ndr_info->offset;\
71                         NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));\
72                 } else if (r->in.offered < _ndr_info->offset) {\
73                         return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
74                                 "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]!",\
75                                 (unsigned)r->in.offered, (unsigned)_ndr_info->offset);\
76                 }\
77                 _data_blob_info = ndr_push_blob(_ndr_info);\
78                 _r.out.info     = &_data_blob_info;\
79         }\
80         NDR_CHECK(ndr_push__##fn(ndr, flags, &_r));\
81 } while(0)
82
83 #define NDR_SPOOLSS_PUSH_ENUM(fn,in,out) do { \
84         struct _##fn _r;\
85         if (flags & NDR_IN) {\
86                 in;\
87                 NDR_SPOOLSS_PUSH_ENUM_IN(fn);\
88         }\
89         if (flags & NDR_OUT) {\
90                 out;\
91                 NDR_SPOOLSS_PUSH_ENUM_OUT(fn);\
92         }\
93 } while(0)
94
95 #define NDR_SPOOLSS_PULL_ENUM_IN(fn) do { \
96         ZERO_STRUCT(r->out);\
97         NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
98         r->in.level     = _r.in.level;\
99         r->in.buffer    = _r.in.buffer;\
100         r->in.offered   = _r.in.offered;\
101         r->out.needed   = _r.out.needed;\
102         if (!r->in.buffer && r->in.offered != 0) {\
103                 return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
104                         "SPOOLSS Buffer: r->in.offered[%u] but there's no buffer",\
105                         (unsigned)r->in.offered);\
106         } else if (r->in.buffer && r->in.buffer->length != r->in.offered) {\
107                 return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
108                         "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\
109                         (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\
110         }\
111 } while(0)
112
113 #define NDR_SPOOLSS_PULL_ENUM_OUT(fn) do { \
114         _r.in.level     = r->in.level;\
115         _r.in.buffer    = r->in.buffer;\
116         _r.in.offered   = r->in.offered;\
117         _r.out.needed   = r->out.needed;\
118         NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
119         r->out.info     = NULL;\
120         r->out.needed   = _r.out.needed;\
121         r->out.count    = _r.out.count;\
122         r->out.result   = _r.out.result;\
123         if (_r.out.info) {\
124                 struct ndr_pull *_ndr_info = ndr_pull_init_blob(_r.out.info, ndr, ndr->iconv_convenience);\
125                 NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
126                 _ndr_info->flags= ndr->flags;\
127                 if (r->in.offered != _ndr_info->data_size) {\
128                         return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
129                                 "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",\
130                                 (unsigned)r->in.offered, (unsigned)_ndr_info->data_size);\
131                 }\
132                 if (r->out.needed <= _ndr_info->data_size) {\
133                         struct __##fn __r;\
134                         __r.in.level    = r->in.level;\
135                         __r.in.count    = r->out.count;\
136                         __r.out.info    = NULL;\
137                         NDR_CHECK(ndr_pull___##fn(_ndr_info, flags, &__r));\
138                         r->out.info     = __r.out.info;\
139                 }\
140         }\
141 } while(0)
142
143 #define NDR_SPOOLSS_PULL_ENUM(fn,in,out) do { \
144         struct _##fn _r;\
145         if (flags & NDR_IN) {\
146                 out;\
147                 NDR_SPOOLSS_PULL_ENUM_IN(fn);\
148                 in;\
149         }\
150         if (flags & NDR_OUT) {\
151                 out;\
152                 NDR_SPOOLSS_PULL_ENUM_OUT(fn);\
153         }\
154 } while(0)
155
156 #define _NDR_CHECK_UINT32(call) do {\
157         enum ndr_err_code _ndr_err; \
158         _ndr_err = call; \
159         if (!NDR_ERR_CODE_IS_SUCCESS(_ndr_err)) { \
160                 return 0; \
161         }\
162 } while (0)
163
164 /* TODO: set _ndr_info->flags correct */
165 #define NDR_SPOOLSS_SIZE_ENUM(fn) do { \
166         struct __##fn __r;\
167         DATA_BLOB _data_blob_info;\
168         struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, iconv_convenience);\
169         if (!_ndr_info) return 0;\
170         _ndr_info->flags|=0;\
171         __r.in.level    = level;\
172         __r.in.count    = count;\
173         __r.out.info    = info;\
174         _NDR_CHECK_UINT32(ndr_push___##fn(_ndr_info, NDR_OUT, &__r)); \
175         _data_blob_info = ndr_push_blob(_ndr_info);\
176         return _data_blob_info.length;\
177 } while(0)
178
179 /*
180   spoolss_EnumPrinters
181 */
182 enum ndr_err_code ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinters *r)
183 {
184         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrinters,{
185                 _r.in.flags     = r->in.flags;
186                 _r.in.server    = r->in.server;
187         },{
188                 _r.in.flags     = r->in.flags;
189                 _r.in.server    = r->in.server;
190         });
191         return NDR_ERR_SUCCESS;
192 }
193
194 enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinters *r)
195 {
196         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrinters,{
197                 r->in.flags     = _r.in.flags;
198                 r->in.server    = _r.in.server;
199         },{
200                 _r.in.flags     = r->in.flags;
201                 _r.in.server    = r->in.server;
202         });
203         return NDR_ERR_SUCCESS;
204 }
205
206 uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info)
207 {
208         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinters);
209 }
210
211 /*
212   spoolss_EnumJobs
213 */
214 enum ndr_err_code ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, const struct spoolss_EnumJobs *r)
215 {
216         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumJobs,{
217                 _r.in.handle    = r->in.handle;
218                 _r.in.firstjob  = r->in.firstjob;
219                 _r.in.numjobs   = r->in.numjobs;
220         },{
221                 _r.in.handle    = r->in.handle;
222                 _r.in.firstjob  = r->in.firstjob;
223                 _r.in.numjobs   = r->in.numjobs;
224         });
225         return NDR_ERR_SUCCESS;
226 }
227
228 enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, struct spoolss_EnumJobs *r)
229 {
230         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumJobs,{
231                 r->in.handle    = _r.in.handle;
232                 r->in.firstjob  = _r.in.firstjob;
233                 r->in.numjobs   = _r.in.numjobs;
234         },{
235                 _r.in.handle    = r->in.handle;
236                 _r.in.firstjob  = r->in.firstjob;
237                 _r.in.numjobs   = r->in.numjobs;
238         });
239         return NDR_ERR_SUCCESS;
240 }
241
242 uint32_t ndr_size_spoolss_EnumJobss_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info)
243 {
244         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumJobs);
245 }
246
247 /*
248   spoolss_EnumPrinterDrivers
249 */
250 enum ndr_err_code ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDrivers *r)
251 {
252         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrinterDrivers,{
253                 _r.in.server            = r->in.server;
254                 _r.in.environment       = r->in.environment;
255         },{
256                 _r.in.server            = r->in.server;
257                 _r.in.environment       = r->in.environment;
258         });
259         return NDR_ERR_SUCCESS;
260 }
261
262 enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDrivers *r)
263 {
264         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrinterDrivers,{
265                 r->in.server            = _r.in.server;
266                 r->in.environment       = _r.in.environment;
267         },{
268                 _r.in.server            = r->in.server;
269                 _r.in.environment       = r->in.environment;
270         });
271         return NDR_ERR_SUCCESS;
272 }
273
274 uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_DriverInfo *info)
275 {
276         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDrivers);
277 }
278
279 /*
280   spoolss_EnumForms
281 */
282 enum ndr_err_code ndr_push_spoolss_EnumForms(struct ndr_push *ndr, int flags, const struct spoolss_EnumForms *r)
283 {
284         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumForms,{
285                 _r.in.handle    = r->in.handle;
286         },{
287                 _r.in.handle    = r->in.handle;
288         });
289         return NDR_ERR_SUCCESS;
290 }
291
292 enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, int flags, struct spoolss_EnumForms *r)
293 {
294         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumForms,{
295                 r->in.handle    = _r.in.handle;
296         },{
297                 _r.in.handle    = r->in.handle;
298         });
299         return NDR_ERR_SUCCESS;
300 }
301
302 uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_FormInfo *info)
303 {
304         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumForms);
305 }
306
307 /*
308   spoolss_EnumPorts
309 */
310 enum ndr_err_code ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, int flags, const struct spoolss_EnumPorts *r)
311 {
312         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPorts,{
313                 _r.in.servername= r->in.servername;
314         },{
315                 _r.in.servername= r->in.servername;
316         });
317         return NDR_ERR_SUCCESS;
318 }
319
320 enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, int flags, struct spoolss_EnumPorts *r)
321 {
322         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPorts,{
323                 r->in.servername= _r.in.servername;
324         },{
325                 _r.in.servername= r->in.servername;
326         });
327         return NDR_ERR_SUCCESS;
328 }
329
330 uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PortInfo *info)
331 {
332         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPorts);
333 }
334
335 /*
336   spoolss_EnumMonitors
337 */
338 enum ndr_err_code ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, int flags, const struct spoolss_EnumMonitors *r)
339 {
340         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumMonitors,{
341                 _r.in.servername= r->in.servername;
342         },{
343                 _r.in.servername= r->in.servername;
344         });
345         return NDR_ERR_SUCCESS;
346 }
347
348 enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags, struct spoolss_EnumMonitors *r)
349 {
350         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumMonitors,{
351                 r->in.servername= _r.in.servername;
352         },{
353                 _r.in.servername= r->in.servername;
354         });
355         return NDR_ERR_SUCCESS;
356 }
357
358 uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info)
359 {
360         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumMonitors);
361 }
362
363 /*
364   spoolss_EnumPrintProcessors
365 */
366 enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r)
367 {
368         NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrintProcessors,{
369                 _r.in.servername        = r->in.servername;
370                 _r.in.environment       = r->in.environment;
371         },{
372                 _r.in.servername        = r->in.servername;
373                 _r.in.environment       = r->in.environment;
374         });
375         return NDR_ERR_SUCCESS;
376 }
377
378 enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessors *r)
379 {
380         NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrintProcessors,{
381                 r->in.servername        = _r.in.servername;
382                 r->in.environment       = _r.in.environment;
383         },{
384                 _r.in.servername        = r->in.servername;
385                 _r.in.environment       = r->in.environment;
386         });
387         return NDR_ERR_SUCCESS;
388 }
389
390 uint32_t ndr_size_spoolss_EnumPrinterProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, 
391                                                                                                          uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info)
392 {
393         NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrintProcessors);
394 }
395
396 /*
397   spoolss_GetPrinterData
398 */
399 enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r)
400 {
401         struct _spoolss_GetPrinterData _r;
402         if (flags & NDR_IN) {
403                 _r.in.handle    = r->in.handle;
404                 _r.in.value_name= r->in.value_name;
405                 _r.in.offered   = r->in.offered;
406                 NDR_CHECK(ndr_push__spoolss_GetPrinterData(ndr, flags, &_r));
407         }
408         if (flags & NDR_OUT) {
409                 struct ndr_push *_ndr_info;
410                 _r.in.handle    = r->in.handle;
411                 _r.in.value_name= r->in.value_name;
412                 _r.in.offered   = r->in.offered;
413                 _r.out.type     = r->out.type;
414                 _r.out.data     = data_blob(NULL, 0);
415                 _r.out.needed   = r->out.needed;
416                 _r.out.result   = r->out.result;
417                 {
418                         struct __spoolss_GetPrinterData __r;
419                         _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
420                         NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
421                         _ndr_info->flags= ndr->flags;
422                         __r.in.type     = r->out.type;
423                         __r.out.data    = r->out.data;
424                         NDR_CHECK(ndr_push___spoolss_GetPrinterData(_ndr_info, flags, &__r));
425                         if (r->in.offered > _ndr_info->offset) {
426                                 uint32_t _padding_len = r->in.offered - _ndr_info->offset;
427                                 NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));
428                         }
429                         _r.out.data = ndr_push_blob(_ndr_info);
430                 }
431                 NDR_CHECK(ndr_push__spoolss_GetPrinterData(ndr, flags, &_r));
432         }
433         return NDR_ERR_SUCCESS;
434 }
435
436 enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r)
437 {
438         struct _spoolss_GetPrinterData _r;
439         if (flags & NDR_IN) {
440                 ZERO_STRUCT(r->out);
441
442                 _r.in.handle    = r->in.handle;
443                 _r.in.value_name= r->in.value_name;
444                 _r.in.offered   = r->in.offered;
445                 _r.out.type     = r->out.type;
446                 _r.out.data     = data_blob(NULL,0),
447                 _r.out.needed   = r->out.needed;
448                 NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r));
449                 r->in.handle    = _r.in.handle;
450                 r->in.value_name= _r.in.value_name;
451                 r->in.offered   = _r.in.offered;
452                 r->out.needed   = _r.out.needed;
453         }
454         if (flags & NDR_OUT) {
455                 _r.in.handle    = r->in.handle;
456                 _r.in.value_name= r->in.value_name;
457                 _r.in.offered   = r->in.offered;
458                 _r.out.type     = r->out.type;
459                 _r.out.data     = data_blob(NULL,0),
460                 _r.out.needed   = r->out.needed;
461                 _r.out.result   = r->out.result;
462                 NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r));
463                 r->out.type     = _r.out.type;
464                 ZERO_STRUCT(r->out.data);
465                 r->out.needed   = _r.out.needed;
466                 r->out.result   = _r.out.result;
467                 if (_r.out.data.length != r->in.offered) {
468                         return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
469                                 "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]",
470                                 (unsigned)r->in.offered, (unsigned)_r.out.data.length);
471                 }
472                 if (_r.out.data.length > 0 && r->out.needed <= _r.out.data.length) {
473                         struct __spoolss_GetPrinterData __r;
474                         struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr, ndr->iconv_convenience);
475                         NDR_ERR_HAVE_NO_MEMORY(_ndr_data);
476                         _ndr_data->flags= ndr->flags;
477                         __r.in.type     = r->out.type;
478                         __r.out.data    = r->out.data;
479                         NDR_CHECK(ndr_pull___spoolss_GetPrinterData(_ndr_data, flags, &__r));
480                         r->out.data     = __r.out.data;
481                 } else {
482                         r->out.type     = SPOOLSS_PRINTER_DATA_TYPE_NULL;
483                 }
484         }
485         return NDR_ERR_SUCCESS;
486 }
487
488 /*
489   spoolss_SetPrinterData
490 */
491 enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r)
492 {
493         struct _spoolss_SetPrinterData _r;
494         if (flags & NDR_IN) {
495                 struct ndr_push *_ndr_data;
496                 struct __spoolss_SetPrinterData __r;
497                 DATA_BLOB _data_blob_data;
498
499                 _ndr_data = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
500                 NDR_ERR_HAVE_NO_MEMORY(_ndr_data);
501                 _ndr_data->flags= ndr->flags;
502
503                 __r.in.type     = r->in.type;
504                 __r.out.data    = r->in.data;
505                 NDR_CHECK(ndr_push___spoolss_SetPrinterData(_ndr_data, NDR_OUT, &__r));
506                 _data_blob_data = ndr_push_blob(_ndr_data);
507
508                 _r.in.handle    = r->in.handle;
509                 _r.in.value_name= r->in.value_name;
510                 _r.in.type      = r->in.type;
511                 _r.in.data      = _data_blob_data;
512                 _r.in._offered  = _data_blob_data.length;
513                 _r.out.result   = r->out.result;
514                 NDR_CHECK(ndr_push__spoolss_SetPrinterData(ndr, flags, &_r));
515         }
516         if (flags & NDR_OUT) {
517                 _r.in.handle    = r->in.handle;
518                 _r.in.value_name= r->in.value_name;
519                 _r.in.type      = r->in.type;
520                 _r.in.data      = data_blob(NULL,0),
521                 _r.in._offered  = r->in._offered;
522                 _r.out.result   = r->out.result;
523                 NDR_CHECK(ndr_push__spoolss_SetPrinterData(ndr, flags, &_r));
524         }
525         return NDR_ERR_SUCCESS;
526 }
527
528 uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags)
529 {
530         if (!devmode) return 0;
531         return ndr_size_spoolss_DeviceMode(devmode,ic,flags);
532 }