s3-rpc_client: Added a winreg set expand sz helper.
[kai/samba.git] / source3 / rpc_client / cli_winreg.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  WINREG client routines
5  *
6  *  Copyright (c) 2011      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 CLI_WINREG_H
23 #define CLI_WINREG_H
24
25 /**
26  * @brief Query a key for the specified dword value.
27  *
28  * Get the data that is associated with the named value of a specified registry
29  * open key. This function ensures that the key is a dword and converts it
30  * corretly.
31  *
32  * @param[in]  mem_ctx  The memory context to use.
33  *
34  * @param[in]  h        The binding handle for the rpc connection.
35  *
36  * @param[in]  key_handle A handle to a key that MUST have been opened
37  *                        previously.
38  *
39  * @param[in]  value    The name of the value to query.
40  *
41  * @param[out] data     A pointer to store the data of the value.
42  *
43  * @param[out] pwerr    A pointer to a WERROR to store result of the query.
44  *
45  * @return              NT_STATUS_OK on success or a corresponding error if
46  *                      there was a problem on the connection.
47  */
48 NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx,
49                                    struct dcerpc_binding_handle *h,
50                                    struct policy_handle *key_handle,
51                                    const char *value,
52                                    uint32_t *data,
53                                    WERROR *pwerr);
54
55 /**
56  * @brief Query a key for the specified binary value.
57  *
58  * Get the data that is associated with the named value of a specified registry
59  * open key. This function ensures that the key is a binary value.
60  *
61  * @param[in]  mem_ctx  The memory context to use.
62  *
63  * @param[in]  h        The binding handle for the rpc connection.
64  *
65  * @param[in]  key_handle A handle to a key that MUST have been opened
66  *                        previously.
67  *
68  * @param[in]  value    The name of the value to query.
69  *
70  * @param[out] data     A pointer to store the data of the value.
71  *
72  * @param[out] pwerr    A pointer to a WERROR to store result of the query.
73  *
74  * @return              NT_STATUS_OK on success or a corresponding error if
75  *                      there was a problem on the connection.
76  */
77 NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx,
78                                     struct dcerpc_binding_handle *h,
79                                     struct policy_handle *key_handle,
80                                     const char *value,
81                                     DATA_BLOB *data,
82                                     WERROR *pwerr);
83
84 /**
85  * @brief Set a value with the specified dword data.
86  *
87  * @param[in]  mem_ctx  The memory context to use.
88  *
89  * @param[in]  h        The binding handle for the rpc connection.
90  *
91  * @param[in]  key_handle A handle to a key that MUST have been opened
92  *                        previously.
93  *
94  * @param[in]  value    The name of the value to set.
95  *
96  * @param[in]  data     The data to store in the value.
97  *
98  * @param[out] pwerr    A pointer to a WERROR to store result of the query.
99  *
100  * @return              NT_STATUS_OK on success or a corresponding error if
101  *                      there was a problem on the connection.
102  */
103 NTSTATUS dcerpc_winreg_set_dword(TALLOC_CTX *mem_ctx,
104                                  struct dcerpc_binding_handle *h,
105                                  struct policy_handle *key_handle,
106                                  const char *value,
107                                  uint32_t data,
108                                  WERROR *pwerr);
109
110 /**
111  * @brief Set a value with the specified sz data.
112  *
113  * @param[in]  mem_ctx  The memory context to use.
114  *
115  * @param[in]  h        The binding handle for the rpc connection.
116  *
117  * @param[in]  key_handle A handle to a key that MUST have been opened
118  *                        previously.
119  *
120  * @param[in]  value    The name of the value to set.
121  *
122  * @param[in]  data     The data to store in the value.
123  *
124  * @param[out] pwerr    A pointer to a WERROR to store result of the query.
125  *
126  * @return              NT_STATUS_OK on success or a corresponding error if
127  *                      there was a problem on the connection.
128  */
129 NTSTATUS dcerpc_winreg_set_sz(TALLOC_CTX *mem_ctx,
130                               struct dcerpc_binding_handle *h,
131                               struct policy_handle *key_handle,
132                               const char *value,
133                               const char *data,
134                               WERROR *pwerr);
135
136 /**
137  * @brief Set a value with the specified expand sz data.
138  *
139  * @param[in]  mem_ctx  The memory context to use.
140  *
141  * @param[in]  h        The binding handle for the rpc connection.
142  *
143  * @param[in]  key_handle A handle to a key that MUST have been opened
144  *                        previously.
145  *
146  * @param[in]  value    The name of the value to set.
147  *
148  * @param[in]  data     The data to store in the value.
149  *
150  * @param[out] pwerr    A pointer to a WERROR to store result of the query.
151  *
152  * @return              NT_STATUS_OK on success or a corresponding error if
153  *                      there was a problem on the connection.
154  */
155 NTSTATUS dcerpc_winreg_set_expand_sz(TALLOC_CTX *mem_ctx,
156                                      struct dcerpc_binding_handle *h,
157                                      struct policy_handle *key_handle,
158                                      const char *value,
159                                      const char *data,
160                                      WERROR *pwerr);
161
162 #endif /* CLI_WINREG_H */
163
164 /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */