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_CHECK(ndr_pull_spoolss_FormInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
64 NTSTATUS pull_spoolss_JobInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
65 uint32_t level, uint32_t count,
66 union spoolss_JobInfo **info)
70 ndr = ndr_pull_init_blob(blob, mem_ctx);
72 return NT_STATUS_NO_MEMORY;
74 NDR_ALLOC_N(ndr, *info, count);
75 for (i=0;i<count;i++) {
76 NDR_CHECK(ndr_pull_spoolss_JobInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
81 NTSTATUS pull_spoolss_DriverInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
82 uint32_t level, uint32_t count,
83 union spoolss_DriverInfo **info)
87 ndr = ndr_pull_init_blob(blob, mem_ctx);
89 return NT_STATUS_NO_MEMORY;
91 NDR_ALLOC_N(ndr, *info, count);
92 for (i=0;i<count;i++) {
93 NDR_CHECK(ndr_pull_spoolss_DriverInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
98 NTSTATUS pull_spoolss_PortInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
99 uint32_t level, uint32_t count,
100 union spoolss_PortInfo **info)
103 struct ndr_pull *ndr;
104 ndr = ndr_pull_init_blob(blob, mem_ctx);
106 return NT_STATUS_NO_MEMORY;
108 NDR_ALLOC_N(ndr, *info, count);
109 for (i=0;i<count;i++) {
110 ndr->data += ndr->offset;
112 NDR_CHECK(ndr_pull_spoolss_PortInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));