2 * Unix SMB/CIFS implementation.
4 * SPOOLSS RPC Pipe server / winreg client routines
6 * Copyright (c) 2010 Andreas Schneider <asn@samba.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #ifndef _SRV_SPOOLSS_UITL_H
23 #define _SRV_SPOOLSS_UITL_H
28 * @brief Set printer data over the winreg pipe.
30 * @param[in] p The pipes structure to be able to open a new pipe.
32 * @param[in] printer The printer name.
34 * @param[in] key The key of the printer data to store the value.
36 * @param[in] value The value name to save.
38 * @param[in] type The type of the value to use.
40 * @param[in] data The data which sould be saved under the given value.
42 * @param[in] data_size The size of the data.
44 * @return On success WERR_OK, a corresponding DOS error is
45 * something went wrong.
47 WERROR winreg_set_printer_dataex(struct pipes_struct *p,
51 enum winreg_Type type,
58 * @brief Get printer data over a winreg pipe.
60 * @param[in] p The pipes structure to be able to open a new pipe.
62 * @param[in] printer The printer name.
64 * @param[in] key The key of the printer data to get the value.
66 * @param[in] value The name of the value to query.
68 * @param[in] type The type of the value to query.
70 * @param[out] data A pointer to store the data.
72 * @param[out] data_size A pointer to store the size of the data.
74 * @return On success WERR_OK, a corresponding DOS error is
75 * something went wrong.
77 WERROR winreg_get_printer_dataex(struct pipes_struct *p,
81 enum winreg_Type *type,
88 * @brief Enumerate on the values of a given key and provide the data.
90 * @param[in] p The pipes structure to be able to open a new pipe.
92 * @param[in] printer The printer name.
94 * @param[in] key The key of the printer data to get the value.
96 * @param[out] pnum_values A pointer to store the number of values we found.
98 * @param[out] penum_values A pointer to store the values and its data.
100 * @return WERR_OK on success, the corresponding DOS error
101 * code if something gone wrong.
103 WERROR winreg_enum_printer_dataex(struct pipes_struct *p,
106 uint32_t *pnum_values,
107 struct spoolss_PrinterEnumValues **penum_values);
112 * @brief Delete printer data over a winreg pipe.
114 * @param[in] p The pipes structure to be able to open a new pipe.
116 * @param[in] printer The printer name.
118 * @param[in] key The key of the printer data to delete.
120 * @param[in] value The name of the value to delete.
122 * @return On success WERR_OK, a corresponding DOS error is
123 * something went wrong.
125 WERROR winreg_delete_printer_dataex(struct pipes_struct *p,
133 * @brief Enumerate on the subkeys of a given key and provide the data.
135 * @param[in] p The pipes structure to be able to open a new pipe.
137 * @param[in] printer The printer name.
139 * @param[in] key The key of the printer data to get the value.
141 * @param[out] pnum_subkeys A pointer to store the number of subkeys found.
143 * @param[in] psubkeys A pointer to an array to store the names of the subkeys
146 * @return WERR_OK on success, the corresponding DOS error
147 * code if something gone wrong.
149 WERROR winreg_enum_printer_key(struct pipes_struct *p,
152 uint32_t *pnum_subkeys,
153 const char ***psubkeys);
158 * @brief Delete a key with subkeys of a given printer.
160 * @param[in] p The pipes structure to be able to open a new pipe.
162 * @param[in] printer The printer name.
164 * @param[in] key The key of the printer to delete.
166 * @return On success WERR_OK, a corresponding DOS error is
167 * something went wrong.
169 WERROR winreg_delete_printer_key(struct pipes_struct *p,
176 * @brief This function adds a form to the list of available forms that can be
177 * selected for the specified printer.
179 * @param[in] p The pipes structure to be able to open a new pipe.
181 * @param[in] form The form to add.
183 * @return WERR_OK on success.
184 * WERR_ALREADY_EXISTS if the form already exists or is a
186 * A corresponding DOS error is something went wrong.
188 WERROR winreg_printer_addform1(struct pipes_struct *p,
189 struct spoolss_AddFormInfo1 *form);
192 * @brief This function enumerates the forms supported by the specified printer.
194 * @param[in] p The pipes structure to be able to open a new pipe.
196 * @param[out] pnum_info A pointer to store the FormInfo count.
198 * @param[out] pinfo A pointer to store an array with FormInfo.
200 * @return On success WERR_OK, a corresponding DOS error is
201 * something went wrong.
203 WERROR winreg_printer_enumforms1(struct pipes_struct *p,
205 union spoolss_FormInfo **pinfo);
207 #endif /* _SRV_SPOOLSS_UITL_H */