21e3d3581be9dab3e31a9442bade67548b6977ff
[kamenim/samba.git] / source3 / rpc_server / srv_spoolss_util.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  SPOOLSS RPC Pipe server / winreg client routines
5  *
6  *  Copyright (c) 2010      Andreas Schneider <asn@samba.org>
7  *
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.
12  *
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.
17  *
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/>.
20  */
21
22 #ifndef _SRV_SPOOLSS_UITL_H
23 #define _SRV_SPOOLSS_UITL_H
24
25 /**
26  * @internal
27  *
28  * @brief Set printer data over the winreg pipe.
29  *
30  * @param[in]  p        The pipes structure to be able to open a new pipe.
31  *
32  * @param[in]  printer  The printer name.
33  *
34  * @param[in]  key      The key of the printer data to store the value.
35  *
36  * @param[in]  value    The value name to save.
37  *
38  * @param[in]  type     The type of the value to use.
39  *
40  * @param[in]  data     The data which sould be saved under the given value.
41  *
42  * @param[in]  data_size The size of the data.
43  *
44  * @return              On success WERR_OK, a corresponding DOS error is
45  *                      something went wrong.
46  */
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);
54
55 /**
56  * @internal
57  *
58  * @brief Get printer data over a winreg pipe.
59  *
60  * @param[in]  p        The pipes structure to be able to open a new pipe.
61  *
62  * @param[in]  printer  The printer name.
63  *
64  * @param[in]  key      The key of the printer data to get the value.
65  *
66  * @param[in]  value    The name of the value to query.
67  *
68  * @param[in]  type     The type of the value to query.
69  *
70  * @param[out] data     A pointer to store the data.
71  *
72  * @param[out] data_size A pointer to store the size of the data.
73  *
74  * @return              On success WERR_OK, a corresponding DOS error is
75  *                      something went wrong.
76  */
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);
84
85 /**
86  * @internal
87  *
88  * @brief Enumerate on the values of a given key and provide the data.
89  *
90  * @param[in]  p        The pipes structure to be able to open a new pipe.
91  *
92  * @param[in]  printer  The printer name.
93  *
94  * @param[in]  key      The key of the printer data to get the value.
95  *
96  * @param[out] pnum_values A pointer to store the number of values we found.
97  *
98  * @param[out] penum_values A pointer to store the values and its data.
99  *
100  * @return                   WERR_OK on success, the corresponding DOS error
101  *                           code if something gone wrong.
102  */
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);
108
109 /**
110  * @internal
111  *
112  * @brief Delete printer data over a winreg pipe.
113  *
114  * @param[in]  p        The pipes structure to be able to open a new pipe.
115  *
116  * @param[in]  printer  The printer name.
117  *
118  * @param[in]  key      The key of the printer data to delete.
119  *
120  * @param[in]  value    The name of the value to delete.
121  *
122  * @return              On success WERR_OK, a corresponding DOS error is
123  *                      something went wrong.
124  */
125 WERROR winreg_delete_printer_dataex(struct pipes_struct *p,
126                                     const char *printer,
127                                     const char *key,
128                                     const char *value);
129
130 /**
131  * @internal
132  *
133  * @brief Enumerate on the subkeys of a given key and provide the data.
134  *
135  * @param[in]  p        The pipes structure to be able to open a new pipe.
136  *
137  * @param[in]  printer  The printer name.
138  *
139  * @param[in]  key      The key of the printer data to get the value.
140  *
141  * @param[out] pnum_subkeys A pointer to store the number of subkeys found.
142  *
143  * @param[in]  psubkeys A pointer to an array to store the names of the subkeys
144  *                      found.
145  *
146  * @return              WERR_OK on success, the corresponding DOS error
147  *                      code if something gone wrong.
148  */
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);
154
155 #endif /* _SRV_SPOOLSS_UITL_H */