2 * Unix SMB/CIFS implementation.
4 * WINREG client routines
6 * Copyright (c) 2011 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/>.
26 * @brief Query a key for the specified dword value.
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
32 * @param[in] mem_ctx The memory context to use.
34 * @param[in] h The binding handle for the rpc connection.
36 * @param[in] key_handle A handle to a key that MUST have been opened
39 * @param[in] value The name of the value to query.
41 * @param[out] data A pointer to store the data of the value.
43 * @param[out] pwerr A pointer to a WERROR to store result of the query.
45 * @return NT_STATUS_OK on success or a corresponding error if
46 * there was a problem on the connection.
48 NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx,
49 struct dcerpc_binding_handle *h,
50 struct policy_handle *key_handle,
56 * @brief Query a key for the specified binary value.
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.
61 * @param[in] mem_ctx The memory context to use.
63 * @param[in] h The binding handle for the rpc connection.
65 * @param[in] key_handle A handle to a key that MUST have been opened
68 * @param[in] value The name of the value to query.
70 * @param[out] data A pointer to store the data of the value.
72 * @param[out] pwerr A pointer to a WERROR to store result of the query.
74 * @return NT_STATUS_OK on success or a corresponding error if
75 * there was a problem on the connection.
77 NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx,
78 struct dcerpc_binding_handle *h,
79 struct policy_handle *key_handle,
85 * @brief Query a key for the specified multi sz value.
87 * Get the data that is associated with the named value of a specified registry
88 * open key. This function ensures that the key is a multi sz value.
90 * @param[in] mem_ctx The memory context to use.
92 * @param[in] h The binding handle for the rpc connection.
94 * @param[in] key_handle A handle to a key that MUST have been opened
97 * @param[in] value The name of the value to query.
99 * @param[out] data A pointer to store the data of the value.
101 * @param[out] pwerr A pointer to a WERROR to store result of the query.
103 * @return NT_STATUS_OK on success or a corresponding error if
104 * there was a problem on the connection.
106 NTSTATUS dcerpc_winreg_query_multi_sz(TALLOC_CTX *mem_ctx,
107 struct dcerpc_binding_handle *h,
108 struct policy_handle *key_handle,
114 * @brief Set a value with the specified dword data.
116 * @param[in] mem_ctx The memory context to use.
118 * @param[in] h The binding handle for the rpc connection.
120 * @param[in] key_handle A handle to a key that MUST have been opened
123 * @param[in] value The name of the value to set.
125 * @param[in] data The data to store in the value.
127 * @param[out] pwerr A pointer to a WERROR to store result of the query.
129 * @return NT_STATUS_OK on success or a corresponding error if
130 * there was a problem on the connection.
132 NTSTATUS dcerpc_winreg_set_dword(TALLOC_CTX *mem_ctx,
133 struct dcerpc_binding_handle *h,
134 struct policy_handle *key_handle,
140 * @brief Set a value with the specified sz data.
142 * @param[in] mem_ctx The memory context to use.
144 * @param[in] h The binding handle for the rpc connection.
146 * @param[in] key_handle A handle to a key that MUST have been opened
149 * @param[in] value The name of the value to set.
151 * @param[in] data The data to store in the value.
153 * @param[out] pwerr A pointer to a WERROR to store result of the query.
155 * @return NT_STATUS_OK on success or a corresponding error if
156 * there was a problem on the connection.
158 NTSTATUS dcerpc_winreg_set_sz(TALLOC_CTX *mem_ctx,
159 struct dcerpc_binding_handle *h,
160 struct policy_handle *key_handle,
166 * @brief Set a value with the specified expand sz data.
168 * @param[in] mem_ctx The memory context to use.
170 * @param[in] h The binding handle for the rpc connection.
172 * @param[in] key_handle A handle to a key that MUST have been opened
175 * @param[in] value The name of the value to set.
177 * @param[in] data The data to store in the value.
179 * @param[out] pwerr A pointer to a WERROR to store result of the query.
181 * @return NT_STATUS_OK on success or a corresponding error if
182 * there was a problem on the connection.
184 NTSTATUS dcerpc_winreg_set_expand_sz(TALLOC_CTX *mem_ctx,
185 struct dcerpc_binding_handle *h,
186 struct policy_handle *key_handle,
192 * @brief Set a value with the specified multi sz data.
194 * @param[in] mem_ctx The memory context to use.
196 * @param[in] h The binding handle for the rpc connection.
198 * @param[in] key_handle A handle to a key that MUST have been opened
201 * @param[in] value The name of the value to set.
203 * @param[in] data The data to store in the value.
205 * @param[out] pwerr A pointer to a WERROR to store result of the query.
207 * @return NT_STATUS_OK on success or a corresponding error if
208 * there was a problem on the connection.
210 NTSTATUS dcerpc_winreg_set_multi_sz(TALLOC_CTX *mem_ctx,
211 struct dcerpc_binding_handle *h,
212 struct policy_handle *key_handle,
218 * @brief Add a value to the multi sz data.
220 * This reads the multi sz data from the given value and adds the data to the
221 * multi sz. Then it saves it to the regsitry.
223 * @param[in] mem_ctx The memory context to use.
225 * @param[in] h The binding handle for the rpc connection.
227 * @param[in] key_handle A handle to a key that MUST have been opened
230 * @param[in] value The name of the value to set.
232 * @param[in] data The data to add.
234 * @param[out] pwerr A pointer to a WERROR to store result of the query.
236 * @return NT_STATUS_OK on success or a corresponding error if
237 * there was a problem on the connection.
239 NTSTATUS dcerpc_winreg_add_multi_sz(TALLOC_CTX *mem_ctx,
240 struct dcerpc_binding_handle *h,
241 struct policy_handle *key_handle,
247 * @brief Enumerate on the given keyhandle to get the subkey names.
249 * @param[in] mem_ctx The memory context to use.
251 * @param[in] h The binding handle for the rpc connection.
253 * @param[in] key_handle A handle to a key that MUST have been opened
256 * @param[out] pnum_subkeys A pointer to store the number of subkeys.
258 * @param[out] psubkeys A pointer to store the names of the subkeys.
260 * @param[out] pwerr A pointer to a WERROR to store result of the query.
262 * @return NT_STATUS_OK on success or a corresponding error if
263 * there was a problem on the connection.
265 NTSTATUS dcerpc_winreg_enum_keys(TALLOC_CTX *mem_ctx,
266 struct dcerpc_binding_handle *h,
267 struct policy_handle *key_hnd,
268 uint32_t *pnum_subkeys,
269 const char ***psubkeys,
272 #endif /* CLI_WINREG_H */
274 /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */