Line data Source code
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 : Copyright (C) Guenther Deschner 2009
9 :
10 : This program is free software; you can redistribute it and/or modify
11 : it under the terms of the GNU General Public License as published by
12 : the Free Software Foundation; either version 3 of the License, or
13 : (at your option) any later version.
14 :
15 : This program is distributed in the hope that it will be useful,
16 : but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : GNU General Public License for more details.
19 :
20 : You should have received a copy of the GNU General Public License
21 : along with this program. If not, see <http://www.gnu.org/licenses/>.
22 : */
23 :
24 :
25 : #include "includes.h"
26 : #include "librpc/gen_ndr/ndr_spoolss.h"
27 : #include "librpc/gen_ndr/ndr_security.h"
28 :
29 : #define NDR_SPOOLSS_PUSH_ENUM_IN(fn) do { \
30 : if (!r->in.buffer && r->in.offered != 0) {\
31 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
32 : "SPOOLSS Buffer: r->in.offered[%u] but there's no buffer",\
33 : (unsigned)r->in.offered);\
34 : } else if (r->in.buffer && r->in.buffer->length != r->in.offered) {\
35 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
36 : "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\
37 : (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\
38 : }\
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_IN_LEVEL(fn) do { \
45 : _r.in.level = r->in.level;\
46 : NDR_SPOOLSS_PUSH_ENUM_IN(fn);\
47 : } while(0)
48 :
49 : #define NDR_SPOOLSS_PUSH_ENUM_OUT_LEVEL(fn) do { \
50 : DATA_BLOB _data_blob_info = data_blob_null;\
51 : struct ndr_push *_ndr_info = NULL;\
52 : _r.in.level = r->in.level;\
53 : _r.in.buffer = r->in.buffer;\
54 : _r.in.offered = r->in.offered;\
55 : _r.out.info = NULL;\
56 : _r.out.needed = r->out.needed;\
57 : _r.out.count = r->out.count;\
58 : _r.out.result = r->out.result;\
59 : if (r->out.info && *r->out.info && !r->in.buffer) {\
60 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
61 : "SPOOLSS Buffer: *r->out.info but there's no r->in.buffer");\
62 : }\
63 : if (r->in.buffer) {\
64 : _ndr_info = ndr_push_init_ctx(ndr);\
65 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
66 : _ndr_info->flags= ndr->flags;\
67 : if (r->out.info) {\
68 : struct ndr_push *_subndr_info;\
69 : struct __##fn __r;\
70 : __r.in.level = r->in.level;\
71 : __r.in.count = *r->out.count;\
72 : __r.out.info = *r->out.info;\
73 : NDR_CHECK(ndr_push_subcontext_start(_ndr_info, &_subndr_info, 0, r->in.offered));\
74 : NDR_CHECK(ndr_push___##fn(_subndr_info, flags, &__r)); \
75 : NDR_CHECK(ndr_push_subcontext_end(_ndr_info, _subndr_info, 0, r->in.offered));\
76 : }\
77 : if (r->in.offered > _ndr_info->offset) {\
78 : uint32_t _padding_len = r->in.offered - _ndr_info->offset;\
79 : NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));\
80 : } else if (r->in.offered < _ndr_info->offset) {\
81 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
82 : "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]!",\
83 : (unsigned)r->in.offered, (unsigned)_ndr_info->offset);\
84 : }\
85 : _data_blob_info = ndr_push_blob(_ndr_info);\
86 : _r.out.info = &_data_blob_info;\
87 : }\
88 : NDR_CHECK(ndr_push__##fn(ndr, flags, &_r));\
89 : } while(0)
90 :
91 : #define NDR_SPOOLSS_PUSH_ENUM_OUT(fn) do { \
92 : DATA_BLOB _data_blob_info = data_blob_null;\
93 : struct ndr_push *_ndr_info = NULL;\
94 : _r.in.buffer = r->in.buffer;\
95 : _r.in.offered = r->in.offered;\
96 : _r.out.info = NULL;\
97 : _r.out.needed = r->out.needed;\
98 : _r.out.count = r->out.count;\
99 : _r.out.result = r->out.result;\
100 : if (r->out.info && *r->out.info && !r->in.buffer) {\
101 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
102 : "SPOOLSS Buffer: *r->out.info but there's no r->in.buffer");\
103 : }\
104 : if (r->in.buffer) {\
105 : _ndr_info = ndr_push_init_ctx(ndr);\
106 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
107 : _ndr_info->flags= ndr->flags;\
108 : if (r->out.info) {\
109 : struct ndr_push *_subndr_info;\
110 : struct __##fn __r;\
111 : __r.in.count = *r->out.count;\
112 : __r.out.info = *r->out.info;\
113 : NDR_CHECK(ndr_push_subcontext_start(_ndr_info, &_subndr_info, 0, r->in.offered));\
114 : NDR_CHECK(ndr_push___##fn(_subndr_info, flags, &__r)); \
115 : NDR_CHECK(ndr_push_subcontext_end(_ndr_info, _subndr_info, 0, r->in.offered));\
116 : }\
117 : if (r->in.offered > _ndr_info->offset) {\
118 : uint32_t _padding_len = r->in.offered - _ndr_info->offset;\
119 : NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));\
120 : } else if (r->in.offered < _ndr_info->offset) {\
121 : return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
122 : "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]!",\
123 : (unsigned)r->in.offered, (unsigned)_ndr_info->offset);\
124 : }\
125 : _data_blob_info = ndr_push_blob(_ndr_info);\
126 : _r.out.info = &_data_blob_info;\
127 : }\
128 : NDR_CHECK(ndr_push__##fn(ndr, flags, &_r));\
129 : } while(0)
130 :
131 : #define NDR_SPOOLSS_PUSH_ENUM_LEVEL(fn,in,out) do { \
132 : struct _##fn _r;\
133 : if (flags & NDR_IN) {\
134 : in;\
135 : NDR_SPOOLSS_PUSH_ENUM_IN_LEVEL(fn);\
136 : }\
137 : if (flags & NDR_OUT) {\
138 : out;\
139 : NDR_SPOOLSS_PUSH_ENUM_OUT_LEVEL(fn);\
140 : }\
141 : } while(0)
142 :
143 : #define NDR_SPOOLSS_PUSH_ENUM(fn,in,out) do { \
144 : struct _##fn _r;\
145 : if (flags & NDR_IN) {\
146 : in;\
147 : NDR_SPOOLSS_PUSH_ENUM_IN(fn);\
148 : }\
149 : if (flags & NDR_OUT) {\
150 : out;\
151 : NDR_SPOOLSS_PUSH_ENUM_OUT(fn);\
152 : }\
153 : } while(0)
154 :
155 : #define NDR_SPOOLSS_PULL_ENUM_IN_COMMON(fn) do { \
156 : ZERO_STRUCT(r->out);\
157 : r->in.buffer = _r.in.buffer;\
158 : r->in.offered = _r.in.offered;\
159 : r->out.needed = _r.out.needed;\
160 : r->out.count = _r.out.count;\
161 : if (!r->in.buffer && r->in.offered != 0) {\
162 : return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
163 : "SPOOLSS Buffer: r->in.offered[%u] but there's no buffer",\
164 : (unsigned)r->in.offered);\
165 : } else if (r->in.buffer && r->in.buffer->length != r->in.offered) {\
166 : return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
167 : "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\
168 : (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\
169 : }\
170 : NDR_PULL_ALLOC(ndr, r->out.info);\
171 : ZERO_STRUCTP(r->out.info);\
172 : } while(0)
173 :
174 : #define NDR_SPOOLSS_PULL_ENUM_IN(fn) do { \
175 : NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
176 : NDR_SPOOLSS_PULL_ENUM_IN_COMMON(fn); \
177 : } while(0)
178 :
179 : #define NDR_SPOOLSS_PULL_ENUM_IN_LEVEL(fn) do { \
180 : NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
181 : r->in.level = _r.in.level;\
182 : NDR_SPOOLSS_PULL_ENUM_IN_COMMON(fn); \
183 : } while(0)
184 :
185 : #define NDR_SPOOLSS_PULL_ENUM_OUT_LEVEL(fn) do { \
186 : _r.in.level = r->in.level;\
187 : _r.in.buffer = r->in.buffer;\
188 : _r.in.offered = r->in.offered;\
189 : _r.out.needed = r->out.needed;\
190 : _r.out.count = r->out.count;\
191 : NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
192 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {\
193 : NDR_PULL_ALLOC(ndr, r->out.info);\
194 : }\
195 : *r->out.info = NULL;\
196 : r->out.needed = _r.out.needed;\
197 : r->out.count = _r.out.count;\
198 : r->out.result = _r.out.result;\
199 : if (_r.out.info) {\
200 : struct ndr_pull *_ndr_info;\
201 : NDR_PULL_ALLOC(ndr, *r->out.info);\
202 : _ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info);\
203 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
204 : _ndr_info->flags= ndr->flags;\
205 : if (r->in.offered != _ndr_info->data_size) {\
206 : return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
207 : "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",\
208 : (unsigned)r->in.offered, (unsigned)_ndr_info->data_size);\
209 : }\
210 : if (*r->out.needed <= _ndr_info->data_size) {\
211 : struct __##fn __r;\
212 : __r.in.level = r->in.level;\
213 : __r.in.count = *r->out.count;\
214 : __r.out.info = NULL;\
215 : NDR_CHECK(ndr_pull___##fn(_ndr_info, flags, &__r));\
216 : *r->out.info = __r.out.info;\
217 : }\
218 : }\
219 : } while(0)
220 :
221 : #define NDR_SPOOLSS_PULL_ENUM_OUT(fn) do { \
222 : _r.in.buffer = r->in.buffer;\
223 : _r.in.offered = r->in.offered;\
224 : _r.out.needed = r->out.needed;\
225 : _r.out.count = r->out.count;\
226 : NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\
227 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {\
228 : NDR_PULL_ALLOC(ndr, r->out.info);\
229 : }\
230 : *r->out.info = NULL;\
231 : r->out.needed = _r.out.needed;\
232 : r->out.count = _r.out.count;\
233 : r->out.result = _r.out.result;\
234 : if (_r.out.info) {\
235 : struct ndr_pull *_ndr_info;\
236 : NDR_PULL_ALLOC(ndr, *r->out.info);\
237 : _ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info);\
238 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
239 : _ndr_info->flags= ndr->flags;\
240 : if (r->in.offered != _ndr_info->data_size) {\
241 : return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
242 : "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",\
243 : (unsigned)r->in.offered, (unsigned)_ndr_info->data_size);\
244 : }\
245 : if (*r->out.needed <= _ndr_info->data_size) {\
246 : struct __##fn __r;\
247 : __r.in.count = *r->out.count;\
248 : __r.out.info = NULL;\
249 : NDR_CHECK(ndr_pull___##fn(_ndr_info, flags, &__r));\
250 : *r->out.info = __r.out.info;\
251 : }\
252 : }\
253 : } while(0)
254 :
255 : #define NDR_SPOOLSS_PULL_ENUM_LEVEL(fn,in,out) do { \
256 : struct _##fn _r;\
257 : if (flags & NDR_IN) {\
258 : out;\
259 : NDR_SPOOLSS_PULL_ENUM_IN_LEVEL(fn);\
260 : in;\
261 : }\
262 : if (flags & NDR_OUT) {\
263 : out;\
264 : NDR_SPOOLSS_PULL_ENUM_OUT_LEVEL(fn);\
265 : }\
266 : } while(0)
267 :
268 : #define NDR_SPOOLSS_PULL_ENUM(fn,in,out) do { \
269 : struct _##fn _r;\
270 : if (flags & NDR_IN) {\
271 : out;\
272 : NDR_SPOOLSS_PULL_ENUM_IN(fn);\
273 : in;\
274 : }\
275 : if (flags & NDR_OUT) {\
276 : out;\
277 : NDR_SPOOLSS_PULL_ENUM_OUT(fn);\
278 : }\
279 : } while(0)
280 :
281 : #define _NDR_CHECK_UINT32(call) do {\
282 : enum ndr_err_code _ndr_err; \
283 : _ndr_err = call; \
284 : if (!NDR_ERR_CODE_IS_SUCCESS(_ndr_err)) { \
285 : return 0; \
286 : }\
287 : } while (0)
288 :
289 : /* TODO: set _ndr_info->flags correct */
290 : #define NDR_SPOOLSS_SIZE_ENUM_LEVEL(fn) do { \
291 : struct __##fn __r;\
292 : DATA_BLOB _data_blob_info;\
293 : struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\
294 : if (!_ndr_info) return 0;\
295 : _ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\
296 : __r.in.level = level;\
297 : __r.in.count = count;\
298 : __r.out.info = info;\
299 : _NDR_CHECK_UINT32(ndr_push___##fn(_ndr_info, NDR_OUT, &__r)); \
300 : _data_blob_info = ndr_push_blob(_ndr_info);\
301 : return _data_blob_info.length;\
302 : } while(0)
303 :
304 : /* TODO: set _ndr_info->flags correct */
305 : #define NDR_SPOOLSS_SIZE_ENUM(fn) do { \
306 : struct __##fn __r;\
307 : DATA_BLOB _data_blob_info;\
308 : struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\
309 : if (!_ndr_info) return 0;\
310 : _ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\
311 : __r.in.count = count;\
312 : __r.out.info = info;\
313 : _NDR_CHECK_UINT32(ndr_push___##fn(_ndr_info, NDR_OUT, &__r)); \
314 : _data_blob_info = ndr_push_blob(_ndr_info);\
315 : return _data_blob_info.length;\
316 : } while(0)
317 :
318 :
319 : /*
320 : spoolss_EnumPrinters
321 : */
322 360 : enum ndr_err_code ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPrinters *r)
323 : {
324 452 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumPrinters,{
325 : _r.in.flags = r->in.flags;
326 : _r.in.server = r->in.server;
327 : },{
328 : _r.in.flags = r->in.flags;
329 : _r.in.server = r->in.server;
330 : });
331 360 : return NDR_ERR_SUCCESS;
332 : }
333 :
334 360 : enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPrinters *r)
335 : {
336 360 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumPrinters,{
337 : r->in.flags = _r.in.flags;
338 : r->in.server = _r.in.server;
339 : },{
340 : _r.in.flags = r->in.flags;
341 : _r.in.server = r->in.server;
342 : });
343 360 : return NDR_ERR_SUCCESS;
344 : }
345 :
346 180 : uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info)
347 : {
348 180 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinters);
349 : }
350 :
351 : /*
352 : spoolss_EnumJobs
353 : */
354 196 : enum ndr_err_code ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumJobs *r)
355 : {
356 220 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumJobs,{
357 : _r.in.handle = r->in.handle;
358 : _r.in.firstjob = r->in.firstjob;
359 : _r.in.numjobs = r->in.numjobs;
360 : },{
361 : _r.in.handle = r->in.handle;
362 : _r.in.firstjob = r->in.firstjob;
363 : _r.in.numjobs = r->in.numjobs;
364 : });
365 196 : return NDR_ERR_SUCCESS;
366 : }
367 :
368 196 : enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumJobs *r)
369 : {
370 196 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumJobs,{
371 : r->in.handle = _r.in.handle;
372 : r->in.firstjob = _r.in.firstjob;
373 : r->in.numjobs = _r.in.numjobs;
374 : },{
375 : _r.in.handle = r->in.handle;
376 : _r.in.firstjob = r->in.firstjob;
377 : _r.in.numjobs = r->in.numjobs;
378 : });
379 196 : return NDR_ERR_SUCCESS;
380 : }
381 :
382 40 : uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_JobInfo *info)
383 : {
384 40 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumJobs);
385 : }
386 :
387 : /*
388 : spoolss_EnumPrinterDrivers
389 : */
390 216 : enum ndr_err_code ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPrinterDrivers *r)
391 : {
392 240 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumPrinterDrivers,{
393 : _r.in.server = r->in.server;
394 : _r.in.environment = r->in.environment;
395 : },{
396 : _r.in.server = r->in.server;
397 : _r.in.environment = r->in.environment;
398 : });
399 216 : return NDR_ERR_SUCCESS;
400 : }
401 :
402 216 : enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPrinterDrivers *r)
403 : {
404 216 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumPrinterDrivers,{
405 : r->in.server = _r.in.server;
406 : r->in.environment = _r.in.environment;
407 : },{
408 : _r.in.server = r->in.server;
409 : _r.in.environment = r->in.environment;
410 : });
411 216 : return NDR_ERR_SUCCESS;
412 : }
413 :
414 0 : uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_DriverInfo *info)
415 : {
416 0 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers);
417 : }
418 :
419 : /*
420 : spoolss_EnumForms
421 : */
422 1120 : enum ndr_err_code ndr_push_spoolss_EnumForms(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumForms *r)
423 : {
424 1388 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumForms,{
425 : _r.in.handle = r->in.handle;
426 : },{
427 : _r.in.handle = r->in.handle;
428 : });
429 1120 : return NDR_ERR_SUCCESS;
430 : }
431 :
432 1125 : enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumForms *r)
433 : {
434 1125 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumForms,{
435 : r->in.handle = _r.in.handle;
436 : },{
437 : _r.in.handle = r->in.handle;
438 : });
439 1125 : return NDR_ERR_SUCCESS;
440 : }
441 :
442 536 : uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_FormInfo *info)
443 : {
444 536 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumForms);
445 : }
446 :
447 : /*
448 : spoolss_EnumPorts
449 : */
450 48 : enum ndr_err_code ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPorts *r)
451 : {
452 60 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumPorts,{
453 : _r.in.servername= r->in.servername;
454 : },{
455 : _r.in.servername= r->in.servername;
456 : });
457 48 : return NDR_ERR_SUCCESS;
458 : }
459 :
460 48 : enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPorts *r)
461 : {
462 48 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumPorts,{
463 : r->in.servername= _r.in.servername;
464 : },{
465 : _r.in.servername= r->in.servername;
466 : });
467 48 : return NDR_ERR_SUCCESS;
468 : }
469 :
470 24 : uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PortInfo *info)
471 : {
472 24 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPorts);
473 : }
474 :
475 : /*
476 : spoolss_EnumMonitors
477 : */
478 32 : enum ndr_err_code ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumMonitors *r)
479 : {
480 40 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumMonitors,{
481 : _r.in.servername= r->in.servername;
482 : },{
483 : _r.in.servername= r->in.servername;
484 : });
485 32 : return NDR_ERR_SUCCESS;
486 : }
487 :
488 32 : enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumMonitors *r)
489 : {
490 32 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumMonitors,{
491 : r->in.servername= _r.in.servername;
492 : },{
493 : _r.in.servername= r->in.servername;
494 : });
495 32 : return NDR_ERR_SUCCESS;
496 : }
497 :
498 16 : uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info)
499 : {
500 16 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumMonitors);
501 : }
502 :
503 : /*
504 : spoolss_EnumPrintProcessors
505 : */
506 96 : enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPrintProcessors *r)
507 : {
508 108 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumPrintProcessors,{
509 : _r.in.servername = r->in.servername;
510 : _r.in.environment = r->in.environment;
511 : },{
512 : _r.in.servername = r->in.servername;
513 : _r.in.environment = r->in.environment;
514 : });
515 96 : return NDR_ERR_SUCCESS;
516 : }
517 :
518 96 : enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPrintProcessors *r)
519 : {
520 96 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumPrintProcessors,{
521 : r->in.servername = _r.in.servername;
522 : r->in.environment = _r.in.environment;
523 : },{
524 : _r.in.servername = r->in.servername;
525 : _r.in.environment = r->in.environment;
526 : });
527 96 : return NDR_ERR_SUCCESS;
528 : }
529 :
530 24 : uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
531 : uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info)
532 : {
533 24 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessors);
534 : }
535 :
536 : /*
537 : spoolss_EnumPrintProcessors
538 : */
539 88 : enum ndr_err_code ndr_push_spoolss_EnumPrintProcessorDataTypes(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPrintProcessorDataTypes *r)
540 : {
541 96 : NDR_SPOOLSS_PUSH_ENUM_LEVEL(spoolss_EnumPrintProcessorDataTypes,{
542 : _r.in.servername = r->in.servername;
543 : _r.in.print_processor_name = r->in.print_processor_name;
544 : },{
545 : _r.in.servername = r->in.servername;
546 : _r.in.print_processor_name = r->in.print_processor_name;
547 : });
548 88 : return NDR_ERR_SUCCESS;
549 : }
550 :
551 88 : enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessorDataTypes(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPrintProcessorDataTypes *r)
552 : {
553 88 : NDR_SPOOLSS_PULL_ENUM_LEVEL(spoolss_EnumPrintProcessorDataTypes,{
554 : r->in.servername = _r.in.servername;
555 : r->in.print_processor_name = _r.in.print_processor_name;
556 : },{
557 : _r.in.servername = r->in.servername;
558 : _r.in.print_processor_name = r->in.print_processor_name;
559 : });
560 88 : return NDR_ERR_SUCCESS;
561 : }
562 :
563 16 : uint32_t ndr_size_spoolss_EnumPrintProcessorDataTypes_info(TALLOC_CTX *mem_ctx,
564 : uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info)
565 : {
566 16 : NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessorDataTypes);
567 : }
568 :
569 : /*
570 : spoolss_EnumPerMachineConnections
571 : */
572 0 : enum ndr_err_code ndr_push_spoolss_EnumPerMachineConnections(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPerMachineConnections *r)
573 : {
574 0 : NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPerMachineConnections,{
575 : _r.in.server = r->in.server;
576 : },{
577 : _r.in.server = r->in.server;
578 : });
579 0 : return NDR_ERR_SUCCESS;
580 : }
581 :
582 0 : enum ndr_err_code ndr_pull_spoolss_EnumPerMachineConnections(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPerMachineConnections *r)
583 : {
584 0 : NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPerMachineConnections,{
585 : r->in.server = _r.in.server;
586 : },{
587 : _r.in.server = r->in.server;
588 : });
589 0 : return NDR_ERR_SUCCESS;
590 : }
591 :
592 0 : uint32_t ndr_size_spoolss_EnumPerMachineConnections_info(TALLOC_CTX *mem_ctx, uint32_t count, struct spoolss_PrinterInfo4 *info)
593 : {
594 0 : NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPerMachineConnections);
595 : }
596 :
597 : /*
598 : spoolss_EnumPrinterDataEx
599 : */
600 :
601 5192 : enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, ndr_flags_type flags, const struct spoolss_EnumPrinterDataEx *r)
602 : {
603 0 : struct _spoolss_EnumPrinterDataEx _r;
604 5192 : if (flags & NDR_IN) {
605 2596 : _r.in.handle = r->in.handle;
606 2596 : _r.in.key_name = r->in.key_name;
607 2596 : _r.in.offered = r->in.offered;
608 2596 : NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
609 : }
610 5192 : if (flags & NDR_OUT) {
611 0 : struct ndr_push *_ndr_info;
612 2596 : _r.in.handle = r->in.handle;
613 2596 : _r.in.key_name = r->in.key_name;
614 2596 : _r.in.offered = r->in.offered;
615 2596 : _r.out.count = r->out.count;
616 2596 : _r.out.needed = r->out.needed;
617 2596 : _r.out.result = r->out.result;
618 2596 : _r.out.info = data_blob(NULL, 0);
619 2596 : if (r->in.offered >= *r->out.needed) {
620 0 : struct ndr_push *_subndr_info;
621 0 : struct __spoolss_EnumPrinterDataEx __r;
622 1336 : _ndr_info = ndr_push_init_ctx(ndr);
623 1336 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
624 1336 : _ndr_info->flags= ndr->flags;
625 1336 : __r.in.count = *r->out.count;
626 1336 : __r.out.info = *r->out.info;
627 1336 : NDR_CHECK(ndr_push_subcontext_start(_ndr_info, &_subndr_info, 0, r->in.offered));
628 1336 : NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_subndr_info, flags, &__r));
629 1336 : NDR_CHECK(ndr_push_subcontext_end(_ndr_info, _subndr_info, 0, r->in.offered));
630 1336 : if (r->in.offered > _ndr_info->offset) {
631 0 : uint32_t _padding_len = r->in.offered - _ndr_info->offset;
632 0 : NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));
633 : }
634 1336 : _r.out.info = ndr_push_blob(_ndr_info);
635 : }
636 2596 : NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
637 : }
638 5192 : return NDR_ERR_SUCCESS;
639 : }
640 :
641 5200 : enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, ndr_flags_type flags, struct spoolss_EnumPrinterDataEx *r)
642 : {
643 8 : struct _spoolss_EnumPrinterDataEx _r;
644 5200 : if (flags & NDR_IN) {
645 2600 : _r.in.handle = r->in.handle;
646 2600 : _r.in.key_name = r->in.key_name;
647 2600 : ZERO_STRUCT(r->out);
648 2600 : NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
649 2600 : r->in.handle = _r.in.handle;
650 2600 : r->in.key_name = _r.in.key_name;
651 2600 : r->in.offered = _r.in.offered;
652 2600 : r->out.needed = _r.out.needed;
653 2600 : r->out.count = _r.out.count;
654 2600 : NDR_PULL_ALLOC(ndr, r->out.info);
655 2600 : ZERO_STRUCTP(r->out.info);
656 : }
657 5200 : if (flags & NDR_OUT) {
658 2600 : _r.in.handle = r->in.handle;
659 2600 : _r.in.key_name = r->in.key_name;
660 2600 : _r.in.offered = r->in.offered;
661 2600 : _r.out.count = r->out.count;
662 2600 : _r.out.needed = r->out.needed;
663 2600 : NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
664 2600 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
665 4 : NDR_PULL_ALLOC(ndr, r->out.info);
666 : }
667 2600 : *r->out.info = NULL;
668 2600 : r->out.needed = _r.out.needed;
669 2600 : r->out.count = _r.out.count;
670 2600 : r->out.result = _r.out.result;
671 2600 : if (_r.out.info.length) {
672 2 : struct ndr_pull *_ndr_info;
673 1262 : NDR_PULL_ALLOC(ndr, *r->out.info);
674 1262 : _ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info);
675 1262 : NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
676 1262 : _ndr_info->flags= ndr->flags;
677 1262 : if (r->in.offered != _ndr_info->data_size) {
678 0 : return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
679 : "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",
680 : (unsigned)r->in.offered, (unsigned)_ndr_info->data_size);
681 : }
682 1262 : if (*r->out.needed <= _ndr_info->data_size) {
683 2 : struct __spoolss_EnumPrinterDataEx __r;
684 1262 : __r.in.count = *r->out.count;
685 1262 : __r.out.info = NULL;
686 1262 : NDR_CHECK(ndr_pull___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r));
687 1262 : *r->out.info = __r.out.info;
688 : }
689 : }
690 : }
691 5192 : return NDR_ERR_SUCCESS;
692 : }
693 :
694 2856 : uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx,
695 : uint32_t count, struct spoolss_PrinterEnumValues *info)
696 : {
697 2856 : NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDataEx);
698 : }
699 :
700 2292 : uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, libndr_flags flags)
701 : {
702 2292 : if (!devmode) return 0;
703 936 : return ndr_size_spoolss_DeviceMode(devmode, flags);
704 : }
705 :
706 0 : _PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, libndr_flags flags)
707 : {
708 0 : if (!r) {
709 0 : return 4;
710 : }
711 :
712 0 : return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray);
713 : }
714 :
715 : /* hand marshall as pidl cannot (yet) generate a relative pointer to a fixed array of
716 : * structs */
717 :
718 0 : _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct spoolss_DriverInfo101 *r)
719 : {
720 0 : uint32_t cntr_file_info_1;
721 0 : if (ndr_flags & NDR_SCALARS) {
722 0 : NDR_CHECK(ndr_push_align(ndr, 8));
723 0 : NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
724 : {
725 0 : libndr_flags _flags_save_string = ndr->flags;
726 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
727 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
728 0 : ndr->flags = _flags_save_string;
729 : }
730 : {
731 0 : libndr_flags _flags_save_string = ndr->flags;
732 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
733 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
734 0 : ndr->flags = _flags_save_string;
735 : }
736 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->file_info));
737 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->file_count));
738 : {
739 0 : libndr_flags _flags_save_string = ndr->flags;
740 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
741 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name));
742 0 : ndr->flags = _flags_save_string;
743 : }
744 : {
745 0 : libndr_flags _flags_save_string = ndr->flags;
746 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
747 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype));
748 0 : ndr->flags = _flags_save_string;
749 : }
750 : {
751 0 : libndr_flags _flags_save_string_array = ndr->flags;
752 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
753 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names));
754 0 : ndr->flags = _flags_save_string_array;
755 : }
756 0 : NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date));
757 0 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version));
758 : {
759 0 : libndr_flags _flags_save_string = ndr->flags;
760 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
761 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_name));
762 0 : ndr->flags = _flags_save_string;
763 : }
764 : {
765 0 : libndr_flags _flags_save_string = ndr->flags;
766 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
767 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_url));
768 0 : ndr->flags = _flags_save_string;
769 : }
770 : {
771 0 : libndr_flags _flags_save_string = ndr->flags;
772 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
773 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->hardware_id));
774 0 : ndr->flags = _flags_save_string;
775 : }
776 : {
777 0 : libndr_flags _flags_save_string = ndr->flags;
778 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
779 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->provider));
780 0 : ndr->flags = _flags_save_string;
781 : }
782 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 8));
783 : }
784 0 : if (ndr_flags & NDR_BUFFERS) {
785 : {
786 0 : libndr_flags _flags_save_string = ndr->flags;
787 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
788 0 : if (r->driver_name) {
789 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
790 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
791 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
792 : }
793 0 : ndr->flags = _flags_save_string;
794 : }
795 : {
796 0 : libndr_flags _flags_save_string = ndr->flags;
797 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
798 0 : if (r->architecture) {
799 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
800 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
801 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
802 : }
803 0 : ndr->flags = _flags_save_string;
804 : }
805 0 : if (r->file_info) {
806 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->file_info));
807 : #if 0
808 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->file_count));
809 : #endif
810 0 : for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) {
811 0 : NDR_CHECK(ndr_push_spoolss_DriverFileInfo(ndr, NDR_SCALARS, &r->file_info[cntr_file_info_1]));
812 : }
813 0 : for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) {
814 0 : NDR_CHECK(ndr_push_spoolss_DriverFileInfo(ndr, NDR_BUFFERS, &r->file_info[cntr_file_info_1]));
815 : }
816 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->file_info));
817 : }
818 : {
819 0 : libndr_flags _flags_save_string = ndr->flags;
820 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
821 0 : if (r->monitor_name) {
822 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->monitor_name));
823 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name));
824 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->monitor_name));
825 : }
826 0 : ndr->flags = _flags_save_string;
827 : }
828 : {
829 0 : libndr_flags _flags_save_string = ndr->flags;
830 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
831 0 : if (r->default_datatype) {
832 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->default_datatype));
833 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype));
834 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->default_datatype));
835 : }
836 0 : ndr->flags = _flags_save_string;
837 : }
838 : {
839 0 : libndr_flags _flags_save_string_array = ndr->flags;
840 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
841 0 : if (r->previous_names) {
842 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous_names));
843 0 : NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->previous_names));
844 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous_names));
845 : }
846 0 : ndr->flags = _flags_save_string_array;
847 : }
848 : {
849 0 : libndr_flags _flags_save_string = ndr->flags;
850 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
851 0 : if (r->manufacturer_name) {
852 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_name));
853 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_name));
854 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_name));
855 : }
856 0 : ndr->flags = _flags_save_string;
857 : }
858 : {
859 0 : libndr_flags _flags_save_string = ndr->flags;
860 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
861 0 : if (r->manufacturer_url) {
862 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_url));
863 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_url));
864 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_url));
865 : }
866 0 : ndr->flags = _flags_save_string;
867 : }
868 : {
869 0 : libndr_flags _flags_save_string = ndr->flags;
870 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
871 0 : if (r->hardware_id) {
872 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->hardware_id));
873 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->hardware_id));
874 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->hardware_id));
875 : }
876 0 : ndr->flags = _flags_save_string;
877 : }
878 : {
879 0 : libndr_flags _flags_save_string = ndr->flags;
880 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
881 0 : if (r->provider) {
882 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->provider));
883 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->provider));
884 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->provider));
885 : }
886 0 : ndr->flags = _flags_save_string;
887 : }
888 : }
889 0 : return NDR_ERR_SUCCESS;
890 : }
891 :
892 0 : _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct spoolss_DriverInfo101 *r)
893 : {
894 0 : uint32_t _ptr_driver_name;
895 0 : TALLOC_CTX *_mem_save_driver_name_0;
896 0 : uint32_t _ptr_architecture;
897 0 : TALLOC_CTX *_mem_save_architecture_0;
898 0 : uint32_t _ptr_file_info;
899 0 : uint32_t cntr_file_info_1;
900 0 : TALLOC_CTX *_mem_save_file_info_0;
901 0 : TALLOC_CTX *_mem_save_file_info_1;
902 0 : uint32_t _ptr_monitor_name;
903 0 : TALLOC_CTX *_mem_save_monitor_name_0;
904 0 : uint32_t _ptr_default_datatype;
905 0 : TALLOC_CTX *_mem_save_default_datatype_0;
906 0 : uint32_t _ptr_previous_names;
907 0 : TALLOC_CTX *_mem_save_previous_names_0;
908 0 : uint32_t _ptr_manufacturer_name;
909 0 : TALLOC_CTX *_mem_save_manufacturer_name_0;
910 0 : uint32_t _ptr_manufacturer_url;
911 0 : TALLOC_CTX *_mem_save_manufacturer_url_0;
912 0 : uint32_t _ptr_hardware_id;
913 0 : TALLOC_CTX *_mem_save_hardware_id_0;
914 0 : uint32_t _ptr_provider;
915 0 : TALLOC_CTX *_mem_save_provider_0;
916 0 : if (ndr_flags & NDR_SCALARS) {
917 0 : NDR_CHECK(ndr_pull_align(ndr, 8));
918 0 : NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
919 : {
920 0 : libndr_flags _flags_save_string = ndr->flags;
921 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
922 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
923 0 : if (_ptr_driver_name) {
924 0 : NDR_PULL_ALLOC(ndr, r->driver_name);
925 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
926 : } else {
927 0 : r->driver_name = NULL;
928 : }
929 0 : ndr->flags = _flags_save_string;
930 : }
931 : {
932 0 : libndr_flags _flags_save_string = ndr->flags;
933 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
934 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
935 0 : if (_ptr_architecture) {
936 0 : NDR_PULL_ALLOC(ndr, r->architecture);
937 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
938 : } else {
939 0 : r->architecture = NULL;
940 : }
941 0 : ndr->flags = _flags_save_string;
942 : }
943 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_file_info));
944 0 : if (_ptr_file_info) {
945 0 : NDR_PULL_ALLOC(ndr, r->file_info);
946 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->file_info, _ptr_file_info));
947 : } else {
948 0 : r->file_info = NULL;
949 : }
950 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->file_count));
951 : {
952 0 : libndr_flags _flags_save_string = ndr->flags;
953 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
954 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
955 0 : if (_ptr_monitor_name) {
956 0 : NDR_PULL_ALLOC(ndr, r->monitor_name);
957 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name));
958 : } else {
959 0 : r->monitor_name = NULL;
960 : }
961 0 : ndr->flags = _flags_save_string;
962 : }
963 : {
964 0 : libndr_flags _flags_save_string = ndr->flags;
965 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
966 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
967 0 : if (_ptr_default_datatype) {
968 0 : NDR_PULL_ALLOC(ndr, r->default_datatype);
969 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype));
970 : } else {
971 0 : r->default_datatype = NULL;
972 : }
973 0 : ndr->flags = _flags_save_string;
974 : }
975 : {
976 0 : libndr_flags _flags_save_string_array = ndr->flags;
977 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
978 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
979 0 : if (_ptr_previous_names) {
980 0 : NDR_PULL_ALLOC(ndr, r->previous_names);
981 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous_names, _ptr_previous_names));
982 : } else {
983 0 : r->previous_names = NULL;
984 : }
985 0 : ndr->flags = _flags_save_string_array;
986 : }
987 0 : NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date));
988 0 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version));
989 : {
990 0 : libndr_flags _flags_save_string = ndr->flags;
991 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
992 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name));
993 0 : if (_ptr_manufacturer_name) {
994 0 : NDR_PULL_ALLOC(ndr, r->manufacturer_name);
995 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_name, _ptr_manufacturer_name));
996 : } else {
997 0 : r->manufacturer_name = NULL;
998 : }
999 0 : ndr->flags = _flags_save_string;
1000 : }
1001 : {
1002 0 : libndr_flags _flags_save_string = ndr->flags;
1003 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1004 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url));
1005 0 : if (_ptr_manufacturer_url) {
1006 0 : NDR_PULL_ALLOC(ndr, r->manufacturer_url);
1007 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_url, _ptr_manufacturer_url));
1008 : } else {
1009 0 : r->manufacturer_url = NULL;
1010 : }
1011 0 : ndr->flags = _flags_save_string;
1012 : }
1013 : {
1014 0 : libndr_flags _flags_save_string = ndr->flags;
1015 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1016 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id));
1017 0 : if (_ptr_hardware_id) {
1018 0 : NDR_PULL_ALLOC(ndr, r->hardware_id);
1019 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->hardware_id, _ptr_hardware_id));
1020 : } else {
1021 0 : r->hardware_id = NULL;
1022 : }
1023 0 : ndr->flags = _flags_save_string;
1024 : }
1025 : {
1026 0 : libndr_flags _flags_save_string = ndr->flags;
1027 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1028 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider));
1029 0 : if (_ptr_provider) {
1030 0 : NDR_PULL_ALLOC(ndr, r->provider);
1031 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->provider, _ptr_provider));
1032 : } else {
1033 0 : r->provider = NULL;
1034 : }
1035 0 : ndr->flags = _flags_save_string;
1036 : }
1037 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1038 : }
1039 0 : if (ndr_flags & NDR_BUFFERS) {
1040 : {
1041 0 : libndr_flags _flags_save_string = ndr->flags;
1042 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1043 0 : if (r->driver_name) {
1044 0 : uint32_t _relative_save_offset;
1045 0 : _relative_save_offset = ndr->offset;
1046 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
1047 0 : _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1048 0 : NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
1049 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
1050 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
1051 0 : if (ndr->offset > ndr->relative_highest_offset) {
1052 0 : ndr->relative_highest_offset = ndr->offset;
1053 : }
1054 0 : ndr->offset = _relative_save_offset;
1055 : }
1056 0 : ndr->flags = _flags_save_string;
1057 : }
1058 : {
1059 0 : libndr_flags _flags_save_string = ndr->flags;
1060 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1061 0 : if (r->architecture) {
1062 0 : uint32_t _relative_save_offset;
1063 0 : _relative_save_offset = ndr->offset;
1064 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
1065 0 : _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
1066 0 : NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
1067 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
1068 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
1069 0 : if (ndr->offset > ndr->relative_highest_offset) {
1070 0 : ndr->relative_highest_offset = ndr->offset;
1071 : }
1072 0 : ndr->offset = _relative_save_offset;
1073 : }
1074 0 : ndr->flags = _flags_save_string;
1075 : }
1076 0 : if (r->file_info) {
1077 0 : uint32_t _relative_save_offset;
1078 0 : _relative_save_offset = ndr->offset;
1079 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->file_info));
1080 0 : _mem_save_file_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1081 0 : NDR_PULL_SET_MEM_CTX(ndr, r->file_info, 0);
1082 : #if 0
1083 : NDR_CHECK(ndr_pull_array_size(ndr, &r->file_info));
1084 : #else
1085 0 : NDR_CHECK(ndr_token_store(ndr, &ndr->array_size_list, &r->file_info, r->file_count));
1086 : #endif
1087 0 : NDR_PULL_ALLOC_N(ndr, r->file_info, r->file_count);
1088 0 : _mem_save_file_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
1089 0 : NDR_PULL_SET_MEM_CTX(ndr, r->file_info, 0);
1090 0 : for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) {
1091 0 : NDR_CHECK(ndr_pull_spoolss_DriverFileInfo(ndr, NDR_SCALARS, &r->file_info[cntr_file_info_1]));
1092 : }
1093 0 : for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) {
1094 0 : NDR_CHECK(ndr_pull_spoolss_DriverFileInfo(ndr, NDR_BUFFERS, &r->file_info[cntr_file_info_1]));
1095 : }
1096 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_1, 0);
1097 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_0, 0);
1098 0 : if (ndr->offset > ndr->relative_highest_offset) {
1099 0 : ndr->relative_highest_offset = ndr->offset;
1100 : }
1101 0 : ndr->offset = _relative_save_offset;
1102 : }
1103 : {
1104 0 : libndr_flags _flags_save_string = ndr->flags;
1105 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1106 0 : if (r->monitor_name) {
1107 0 : uint32_t _relative_save_offset;
1108 0 : _relative_save_offset = ndr->offset;
1109 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name));
1110 0 : _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1111 0 : NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
1112 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name));
1113 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
1114 0 : if (ndr->offset > ndr->relative_highest_offset) {
1115 0 : ndr->relative_highest_offset = ndr->offset;
1116 : }
1117 0 : ndr->offset = _relative_save_offset;
1118 : }
1119 0 : ndr->flags = _flags_save_string;
1120 : }
1121 : {
1122 0 : libndr_flags _flags_save_string = ndr->flags;
1123 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1124 0 : if (r->default_datatype) {
1125 0 : uint32_t _relative_save_offset;
1126 0 : _relative_save_offset = ndr->offset;
1127 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype));
1128 0 : _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
1129 0 : NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
1130 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype));
1131 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
1132 0 : if (ndr->offset > ndr->relative_highest_offset) {
1133 0 : ndr->relative_highest_offset = ndr->offset;
1134 : }
1135 0 : ndr->offset = _relative_save_offset;
1136 : }
1137 0 : ndr->flags = _flags_save_string;
1138 : }
1139 : {
1140 0 : libndr_flags _flags_save_string_array = ndr->flags;
1141 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1142 0 : if (r->previous_names) {
1143 0 : uint32_t _relative_save_offset;
1144 0 : _relative_save_offset = ndr->offset;
1145 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous_names));
1146 0 : _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
1147 0 : NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
1148 0 : NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names));
1149 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
1150 0 : if (ndr->offset > ndr->relative_highest_offset) {
1151 0 : ndr->relative_highest_offset = ndr->offset;
1152 : }
1153 0 : ndr->offset = _relative_save_offset;
1154 : }
1155 0 : ndr->flags = _flags_save_string_array;
1156 : }
1157 : {
1158 0 : libndr_flags _flags_save_string = ndr->flags;
1159 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1160 0 : if (r->manufacturer_name) {
1161 0 : uint32_t _relative_save_offset;
1162 0 : _relative_save_offset = ndr->offset;
1163 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_name));
1164 0 : _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1165 0 : NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0);
1166 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_name));
1167 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0);
1168 0 : if (ndr->offset > ndr->relative_highest_offset) {
1169 0 : ndr->relative_highest_offset = ndr->offset;
1170 : }
1171 0 : ndr->offset = _relative_save_offset;
1172 : }
1173 0 : ndr->flags = _flags_save_string;
1174 : }
1175 : {
1176 0 : libndr_flags _flags_save_string = ndr->flags;
1177 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1178 0 : if (r->manufacturer_url) {
1179 0 : uint32_t _relative_save_offset;
1180 0 : _relative_save_offset = ndr->offset;
1181 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_url));
1182 0 : _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr);
1183 0 : NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0);
1184 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_url));
1185 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0);
1186 0 : if (ndr->offset > ndr->relative_highest_offset) {
1187 0 : ndr->relative_highest_offset = ndr->offset;
1188 : }
1189 0 : ndr->offset = _relative_save_offset;
1190 : }
1191 0 : ndr->flags = _flags_save_string;
1192 : }
1193 : {
1194 0 : libndr_flags _flags_save_string = ndr->flags;
1195 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1196 0 : if (r->hardware_id) {
1197 0 : uint32_t _relative_save_offset;
1198 0 : _relative_save_offset = ndr->offset;
1199 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->hardware_id));
1200 0 : _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
1201 0 : NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0);
1202 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->hardware_id));
1203 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0);
1204 0 : if (ndr->offset > ndr->relative_highest_offset) {
1205 0 : ndr->relative_highest_offset = ndr->offset;
1206 : }
1207 0 : ndr->offset = _relative_save_offset;
1208 : }
1209 0 : ndr->flags = _flags_save_string;
1210 : }
1211 : {
1212 0 : libndr_flags _flags_save_string = ndr->flags;
1213 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1214 0 : if (r->provider) {
1215 0 : uint32_t _relative_save_offset;
1216 0 : _relative_save_offset = ndr->offset;
1217 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->provider));
1218 0 : _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr);
1219 0 : NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0);
1220 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->provider));
1221 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0);
1222 0 : if (ndr->offset > ndr->relative_highest_offset) {
1223 0 : ndr->relative_highest_offset = ndr->offset;
1224 : }
1225 0 : ndr->offset = _relative_save_offset;
1226 : }
1227 0 : ndr->flags = _flags_save_string;
1228 : }
1229 0 : if (r->file_info) {
1230 0 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->file_info, r->file_count));
1231 : }
1232 : }
1233 0 : return NDR_ERR_SUCCESS;
1234 : }
1235 :
1236 122 : void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r)
1237 : {
1238 122 : int level;
1239 122 : level = ndr_print_steal_switch_value(ndr, r);
1240 122 : ndr_print_union(ndr, name, level, "spoolss_Field");
1241 122 : switch (level) {
1242 46 : case PRINTER_NOTIFY_TYPE:
1243 46 : ndr_print_spoolss_PrintNotifyField(ndr, "field", r->field);
1244 46 : break;
1245 :
1246 76 : case JOB_NOTIFY_TYPE:
1247 76 : ndr_print_spoolss_JobNotifyField(ndr, "field", r->field);
1248 76 : break;
1249 :
1250 0 : default:
1251 0 : ndr_print_uint16(ndr, "field", r->field);
1252 0 : break;
1253 :
1254 : }
1255 122 : }
1256 :
1257 0 : _PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, libndr_flags flags)
1258 : {
1259 0 : if (!r) {
1260 0 : return 0;
1261 : }
1262 0 : return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData);
1263 : }
1264 :
1265 0 : void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r)
1266 : {
1267 0 : ndr_print_security_descriptor(ndr, name, r);
1268 0 : }
1269 :
1270 704 : enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct security_descriptor *r)
1271 : {
1272 704 : libndr_flags _flags_save_STRUCT = ndr->flags;
1273 704 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NO_RELATIVE_REVERSE);
1274 704 : NDR_CHECK(ndr_pull_security_descriptor(ndr, ndr_flags, r));
1275 704 : ndr->flags = _flags_save_STRUCT;
1276 704 : return NDR_ERR_SUCCESS;
1277 : }
1278 :
1279 2160 : enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct security_descriptor *r)
1280 : {
1281 : {
1282 2160 : libndr_flags _flags_save_STRUCT = ndr->flags;
1283 2160 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_FLAG_NO_RELATIVE_REVERSE);
1284 2160 : if (ndr_flags & NDR_SCALARS) {
1285 2160 : NDR_CHECK(ndr_push_align(ndr, 5));
1286 2160 : NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision));
1287 2160 : NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type));
1288 2160 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid));
1289 2160 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid));
1290 2160 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl));
1291 2160 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl));
1292 2160 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1293 : }
1294 2160 : if (ndr_flags & NDR_BUFFERS) {
1295 2160 : if (r->sacl) {
1296 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->sacl));
1297 0 : NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl));
1298 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->sacl));
1299 : }
1300 2160 : if (r->dacl) {
1301 2160 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dacl));
1302 2160 : NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl));
1303 2160 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dacl));
1304 : }
1305 2160 : if (r->owner_sid) {
1306 2160 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->owner_sid));
1307 2160 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid));
1308 2160 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->owner_sid));
1309 : }
1310 2160 : if (r->group_sid) {
1311 2160 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->group_sid));
1312 2160 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid));
1313 2160 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->group_sid));
1314 : }
1315 : }
1316 2160 : ndr->flags = _flags_save_STRUCT;
1317 : }
1318 2160 : return NDR_ERR_SUCCESS;
1319 : }
1320 :
1321 3768 : _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct spoolss_PrinterInfo2 *r)
1322 : {
1323 3768 : if (ndr_flags & NDR_SCALARS) {
1324 1884 : NDR_CHECK(ndr_push_align(ndr, 5));
1325 : {
1326 1884 : libndr_flags _flags_save_string = ndr->flags;
1327 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1328 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->servername));
1329 1884 : ndr->flags = _flags_save_string;
1330 : }
1331 : {
1332 1884 : libndr_flags _flags_save_string = ndr->flags;
1333 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1334 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
1335 1884 : ndr->flags = _flags_save_string;
1336 : }
1337 : {
1338 1884 : libndr_flags _flags_save_string = ndr->flags;
1339 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1340 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sharename));
1341 1884 : ndr->flags = _flags_save_string;
1342 : }
1343 : {
1344 1884 : libndr_flags _flags_save_string = ndr->flags;
1345 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1346 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->portname));
1347 1884 : ndr->flags = _flags_save_string;
1348 : }
1349 : {
1350 1884 : libndr_flags _flags_save_string = ndr->flags;
1351 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1352 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->drivername));
1353 1884 : ndr->flags = _flags_save_string;
1354 : }
1355 : {
1356 1884 : libndr_flags _flags_save_string = ndr->flags;
1357 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1358 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->comment));
1359 1884 : ndr->flags = _flags_save_string;
1360 : }
1361 : {
1362 1884 : libndr_flags _flags_save_string = ndr->flags;
1363 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1364 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->location));
1365 1884 : ndr->flags = _flags_save_string;
1366 : }
1367 : {
1368 1884 : libndr_flags _flags_save_spoolss_DeviceMode = ndr->flags;
1369 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
1370 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
1371 1884 : ndr->flags = _flags_save_spoolss_DeviceMode;
1372 : }
1373 : {
1374 1884 : libndr_flags _flags_save_string = ndr->flags;
1375 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1376 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sepfile));
1377 1884 : ndr->flags = _flags_save_string;
1378 : }
1379 : {
1380 1884 : libndr_flags _flags_save_string = ndr->flags;
1381 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1382 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printprocessor));
1383 1884 : ndr->flags = _flags_save_string;
1384 : }
1385 : {
1386 1884 : libndr_flags _flags_save_string = ndr->flags;
1387 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1388 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->datatype));
1389 1884 : ndr->flags = _flags_save_string;
1390 : }
1391 : {
1392 1884 : libndr_flags _flags_save_string = ndr->flags;
1393 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1394 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters));
1395 1884 : ndr->flags = _flags_save_string;
1396 : }
1397 : {
1398 1884 : libndr_flags _flags_save_spoolss_security_descriptor = ndr->flags;
1399 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
1400 1884 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
1401 1884 : ndr->flags = _flags_save_spoolss_security_descriptor;
1402 : }
1403 1884 : NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
1404 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
1405 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->defaultpriority));
1406 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->starttime));
1407 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->untiltime));
1408 1884 : NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
1409 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cjobs));
1410 1884 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->averageppm));
1411 1884 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1412 : }
1413 3768 : if (ndr_flags & NDR_BUFFERS) {
1414 : {
1415 1884 : libndr_flags _flags_save_string = ndr->flags;
1416 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1417 1884 : if (r->servername) {
1418 864 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->servername));
1419 864 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
1420 864 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->servername));
1421 : }
1422 1884 : ndr->flags = _flags_save_string;
1423 : }
1424 : {
1425 1884 : libndr_flags _flags_save_string = ndr->flags;
1426 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1427 1884 : if (r->printername) {
1428 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printername));
1429 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
1430 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printername));
1431 : }
1432 1884 : ndr->flags = _flags_save_string;
1433 : }
1434 : {
1435 1884 : libndr_flags _flags_save_string = ndr->flags;
1436 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1437 1884 : if (r->sharename) {
1438 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->sharename));
1439 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sharename));
1440 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->sharename));
1441 : }
1442 1884 : ndr->flags = _flags_save_string;
1443 : }
1444 : {
1445 1884 : libndr_flags _flags_save_string = ndr->flags;
1446 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1447 1884 : if (r->portname) {
1448 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->portname));
1449 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->portname));
1450 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->portname));
1451 : }
1452 1884 : ndr->flags = _flags_save_string;
1453 : }
1454 : {
1455 1884 : libndr_flags _flags_save_string = ndr->flags;
1456 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1457 1884 : if (r->drivername) {
1458 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->drivername));
1459 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->drivername));
1460 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->drivername));
1461 : }
1462 1884 : ndr->flags = _flags_save_string;
1463 : }
1464 : {
1465 1884 : libndr_flags _flags_save_string = ndr->flags;
1466 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1467 1884 : if (r->comment) {
1468 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->comment));
1469 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
1470 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->comment));
1471 : }
1472 1884 : ndr->flags = _flags_save_string;
1473 : }
1474 : {
1475 1884 : libndr_flags _flags_save_string = ndr->flags;
1476 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1477 1884 : if (r->location) {
1478 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->location));
1479 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->location));
1480 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->location));
1481 : }
1482 1884 : ndr->flags = _flags_save_string;
1483 : }
1484 : {
1485 1884 : libndr_flags _flags_save_string = ndr->flags;
1486 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1487 1884 : if (r->sepfile) {
1488 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->sepfile));
1489 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sepfile));
1490 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->sepfile));
1491 : }
1492 1884 : ndr->flags = _flags_save_string;
1493 : }
1494 : {
1495 1884 : libndr_flags _flags_save_string = ndr->flags;
1496 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1497 1884 : if (r->printprocessor) {
1498 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printprocessor));
1499 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printprocessor));
1500 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printprocessor));
1501 : }
1502 1884 : ndr->flags = _flags_save_string;
1503 : }
1504 : {
1505 1884 : libndr_flags _flags_save_string = ndr->flags;
1506 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1507 1884 : if (r->datatype) {
1508 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->datatype));
1509 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->datatype));
1510 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->datatype));
1511 : }
1512 1884 : ndr->flags = _flags_save_string;
1513 : }
1514 : {
1515 1884 : libndr_flags _flags_save_string = ndr->flags;
1516 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1517 1884 : if (r->parameters) {
1518 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->parameters));
1519 1884 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters));
1520 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->parameters));
1521 : }
1522 1884 : ndr->flags = _flags_save_string;
1523 : }
1524 : {
1525 1884 : libndr_flags _flags_save_spoolss_DeviceMode = ndr->flags;
1526 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
1527 1884 : if (r->devmode) {
1528 1758 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->devmode));
1529 : {
1530 0 : struct ndr_push *_ndr_devmode;
1531 1758 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
1532 1758 : NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
1533 1758 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
1534 : }
1535 1758 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->devmode));
1536 : }
1537 1884 : ndr->flags = _flags_save_spoolss_DeviceMode;
1538 : }
1539 : {
1540 1884 : libndr_flags _flags_save_spoolss_security_descriptor = ndr->flags;
1541 1884 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
1542 1884 : if (r->secdesc) {
1543 1884 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc));
1544 : {
1545 0 : struct ndr_push *_ndr_secdesc;
1546 1884 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
1547 1884 : NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
1548 1884 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
1549 : }
1550 1884 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc));
1551 : }
1552 1884 : ndr->flags = _flags_save_spoolss_security_descriptor;
1553 : }
1554 : }
1555 3768 : return NDR_ERR_SUCCESS;
1556 : }
1557 :
1558 4 : _PUBLIC_ void ndr_print_spoolss_Time(struct ndr_print *ndr, const char *name, const struct spoolss_Time *r)
1559 : {
1560 4 : struct tm tm;
1561 4 : time_t t;
1562 4 : char *str;
1563 :
1564 4 : tm.tm_sec = r->second;
1565 4 : tm.tm_min = r->minute;
1566 4 : tm.tm_hour = r->hour;
1567 4 : tm.tm_mday = r->day;
1568 4 : tm.tm_mon = r->month - 1;
1569 4 : tm.tm_year = r->year - 1900;
1570 4 : tm.tm_wday = r->day_of_week;
1571 4 : tm.tm_yday = 0;
1572 4 : tm.tm_isdst = -1;
1573 :
1574 4 : t = mktime(&tm);
1575 :
1576 4 : str = timestring(ndr, t);
1577 :
1578 4 : ndr_print_struct(ndr, name, "spoolss_Time");
1579 4 : ndr->depth++;
1580 4 : ndr_print_string(ndr, "", str);
1581 4 : ndr->depth--;
1582 4 : talloc_free(str);
1583 4 : }
1584 :
1585 14486 : _PUBLIC_ libndr_flags ndr_spoolss_PrinterEnumValues_align(enum winreg_Type type)
1586 : {
1587 14486 : switch(type) {
1588 0 : case REG_NONE:
1589 0 : return 0;
1590 5568 : case REG_SZ:
1591 5568 : return LIBNDR_FLAG_ALIGN2;
1592 0 : case REG_EXPAND_SZ:
1593 0 : return LIBNDR_FLAG_ALIGN2;
1594 4800 : case REG_BINARY:
1595 4800 : return 0;
1596 1376 : case REG_DWORD:
1597 1376 : return LIBNDR_FLAG_ALIGN4;
1598 0 : case REG_DWORD_BIG_ENDIAN:
1599 0 : return LIBNDR_FLAG_ALIGN4;
1600 0 : case REG_LINK:
1601 0 : return 0;
1602 2592 : case REG_MULTI_SZ:
1603 2592 : return LIBNDR_FLAG_ALIGN2;
1604 0 : case REG_RESOURCE_LIST:
1605 0 : return LIBNDR_FLAG_ALIGN2;
1606 0 : case REG_FULL_RESOURCE_DESCRIPTOR:
1607 0 : return LIBNDR_FLAG_ALIGN4;
1608 0 : case REG_RESOURCE_REQUIREMENTS_LIST:
1609 0 : return LIBNDR_FLAG_ALIGN2;
1610 0 : case REG_QWORD:
1611 0 : return LIBNDR_FLAG_ALIGN8;
1612 : }
1613 :
1614 0 : return 0;
1615 : }
|