2 Unix SMB/CIFS implementation.
4 routines for marshalling/unmarshalling spoolss subcontext buffer structures
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) Tim Potter 2003
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 2 of the License, or
12 (at your option) any later version.
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.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "librpc/gen_ndr/ndr_spoolss.h"
28 NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
29 uint32_t level, uint32_t count,
30 union spoolss_PrinterInfo **info)
34 ndr = ndr_pull_init_blob(blob, mem_ctx);
36 return NT_STATUS_NO_MEMORY;
38 NDR_ALLOC_N(ndr, *info, count);
39 for (i=0;i<count;i++) {
40 ndr->data += ndr->offset;
42 NDR_CHECK(ndr_pull_spoolss_PrinterInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
47 NTSTATUS pull_spoolss_FormInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
48 uint32_t level, uint32_t count,
49 union spoolss_FormInfo **info)
53 ndr = ndr_pull_init_blob(blob, mem_ctx);
55 return NT_STATUS_NO_MEMORY;
57 NDR_ALLOC_N(ndr, *info, count);
58 for (i=0;i<count;i++) {
59 ndr->data += ndr->offset;
61 NDR_CHECK(ndr_pull_spoolss_FormInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
66 NTSTATUS pull_spoolss_JobInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
67 uint32_t level, uint32_t count,
68 union spoolss_JobInfo **info)
72 ndr = ndr_pull_init_blob(blob, mem_ctx);
74 return NT_STATUS_NO_MEMORY;
76 NDR_ALLOC_N(ndr, *info, count);
77 for (i=0;i<count;i++) {
78 ndr->data += ndr->offset;
80 NDR_CHECK(ndr_pull_spoolss_JobInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
85 NTSTATUS pull_spoolss_DriverInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
86 uint32_t level, uint32_t count,
87 union spoolss_DriverInfo **info)
91 ndr = ndr_pull_init_blob(blob, mem_ctx);
93 return NT_STATUS_NO_MEMORY;
95 NDR_ALLOC_N(ndr, *info, count);
96 for (i=0;i<count;i++) {
97 ndr->data += ndr->offset;
99 NDR_CHECK(ndr_pull_spoolss_DriverInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
104 NTSTATUS pull_spoolss_PortInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
105 uint32_t level, uint32_t count,
106 union spoolss_PortInfo **info)
109 struct ndr_pull *ndr;
110 ndr = ndr_pull_init_blob(blob, mem_ctx);
112 return NT_STATUS_NO_MEMORY;
114 NDR_ALLOC_N(ndr, *info, count);
115 for (i=0;i<count;i++) {
116 ndr->data += ndr->offset;
118 NDR_CHECK(ndr_pull_spoolss_PortInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));