s4:librpc/rpc: make PyErr_SetDCERPCStatus() static
[Samba/gebeck_regimport.git] / source3 / rpc_server / srv_spoolss_util.h
blob7d53348c81b7ecca115b37eea15d7d69bc528402
1 /*
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
25 /**
26 * @internal
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,
48 const char *printer,
49 const char *key,
50 const char *value,
51 enum winreg_Type type,
52 uint8_t *data,
53 uint32_t data_size);
55 /**
56 * @internal
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,
78 const char *printer,
79 const char *key,
80 const char *value,
81 enum winreg_Type *type,
82 uint8_t **data,
83 uint32_t *data_size);
85 /**
86 * @internal
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,
104 const char *printer,
105 const char *key,
106 uint32_t *pnum_values,
107 struct spoolss_PrinterEnumValues **penum_values);
110 * @internal
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,
126 const char *printer,
127 const char *key,
128 const char *value);
131 * @internal
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
144 * found.
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,
150 const char *printer,
151 const char *key,
152 uint32_t *pnum_subkeys,
153 const char ***psubkeys);
156 * @internal
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,
170 const char *printer,
171 const char *key);
174 * @internal
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
185 * builtin form.
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,
204 uint32_t *pnum_info,
205 union spoolss_FormInfo **pinfo);
208 * @brief This function removes a form name from the list of supported forms.
210 * @param[in] p The pipes structure to be able to open a new pipe.
212 * @param[in] form_name The name of the form to delete.
214 * @return WERR_OK on success.
215 * WERR_INVALID_PARAM if the form is a builtin form.
216 * A corresponding DOS error is something went wrong.
218 WERROR winreg_printer_deleteform1(struct pipes_struct *p,
219 const char *form_name);
222 * @brief This function sets the form information for the specified printer.
224 * If one provides both the name in the API call and inside the FormInfo
225 * structure, then the form gets renamed.
227 * @param[in] p The pipes structure to be able to open a new pipe.
229 * @param[in] form_name The name of the form to set or rename.
231 * @param[in] form The FormInfo structure to save.
233 * @return WERR_OK on success.
234 * WERR_INVALID_PARAM if the form is a builtin form.
235 * A corresponding DOS error is something went wrong.
237 WERROR winreg_printer_setform1(struct pipes_struct *p,
238 const char *form_name,
239 struct spoolss_AddFormInfo1 *form);
242 * @brief This function retrieves information about a specified form.
244 * @param[in] p The pipes structure to be able to open a new pipe.
246 * @param[in] form_name The name of the form to query.
248 * @param[out] form A pointer to a form structure to fill out.
250 * @return On success WERR_OK, a corresponding DOS error is
251 * something went wrong.
253 WERROR winreg_printer_getform1(struct pipes_struct *p,
254 const char *form_name,
255 struct spoolss_FormInfo1 *form);
257 #endif /* _SRV_SPOOLSS_UITL_H */