s3-rpc_client: Added a winreg set expand sz helper.
[Samba.git] / source3 / rpc_client / cli_winreg.h
blobbf48c5d7e3ce8d9d0dbcf7d0b844d174af6db2ea
1 /*
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/>.
22 #ifndef CLI_WINREG_H
23 #define CLI_WINREG_H
25 /**
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
30 * corretly.
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
37 * previously.
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,
51 const char *value,
52 uint32_t *data,
53 WERROR *pwerr);
55 /**
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
66 * previously.
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,
80 const char *value,
81 DATA_BLOB *data,
82 WERROR *pwerr);
84 /**
85 * @brief Set a value with the specified dword data.
87 * @param[in] mem_ctx The memory context to use.
89 * @param[in] h The binding handle for the rpc connection.
91 * @param[in] key_handle A handle to a key that MUST have been opened
92 * previously.
94 * @param[in] value The name of the value to set.
96 * @param[in] data The data to store in the value.
98 * @param[out] pwerr A pointer to a WERROR to store result of the query.
100 * @return NT_STATUS_OK on success or a corresponding error if
101 * there was a problem on the connection.
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);
111 * @brief Set a value with the specified sz data.
113 * @param[in] mem_ctx The memory context to use.
115 * @param[in] h The binding handle for the rpc connection.
117 * @param[in] key_handle A handle to a key that MUST have been opened
118 * previously.
120 * @param[in] value The name of the value to set.
122 * @param[in] data The data to store in the value.
124 * @param[out] pwerr A pointer to a WERROR to store result of the query.
126 * @return NT_STATUS_OK on success or a corresponding error if
127 * there was a problem on the connection.
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);
137 * @brief Set a value with the specified expand sz data.
139 * @param[in] mem_ctx The memory context to use.
141 * @param[in] h The binding handle for the rpc connection.
143 * @param[in] key_handle A handle to a key that MUST have been opened
144 * previously.
146 * @param[in] value The name of the value to set.
148 * @param[in] data The data to store in the value.
150 * @param[out] pwerr A pointer to a WERROR to store result of the query.
152 * @return NT_STATUS_OK on success or a corresponding error if
153 * there was a problem on the connection.
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);
162 #endif /* CLI_WINREG_H */
164 /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */