s3-auth Use struct auth3_session_info outside the auth subsystem
[samba.git] / source3 / rpc_client / cli_winreg_int.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  WINREG internal 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_INT_H
23 #define CLI_WINREG_INT_H
24
25 struct auth3_session_info;
26 struct dcerpc_binding_handle;
27
28 /**
29  * @brief Connect to the interal winreg server and open the given key.
30  *
31  * The function will create the needed subkeys if they don't exist.
32  *
33  * @param[in]  mem_ctx       The memory context to use.
34  *
35  * @param[in]  session_info   The supplied server info.
36  *
37  * @param[in]  key           The key to open. This needs to start with the name
38  *                           of the hive like HKLM.
39  *
40  * @param[in]  create_key    Set to true if the key should be created if it
41  *                           doesn't exist.
42  *
43  * @param[in]  access_mask   The access mask to open the key.
44  *
45  * @param[out] binding_handle A pointer for the winreg dcerpc binding handle.
46  *
47  * @param[out] hive_handle   A policy handle for the opened hive.
48  *
49  * @param[out] key_handle    A policy handle for the opened key.
50  *
51  * @return                   WERR_OK on success, the corresponding DOS error
52  *                           code if something gone wrong.
53  */
54 NTSTATUS dcerpc_winreg_int_openkey(TALLOC_CTX *mem_ctx,
55                                    const struct auth3_session_info *server_info,
56                                    struct messaging_context *msg_ctx,
57                                    struct dcerpc_binding_handle **h,
58                                    const char *key,
59                                    bool create_key,
60                                    uint32_t access_mask,
61                                    struct policy_handle *hive_handle,
62                                    struct policy_handle *key_handle,
63                                    WERROR *pwerr);
64
65 /**
66  * @brief Connect to the interal winreg server and open the given key.
67  *
68  * The function will create the needed subkeys if they don't exist.
69  *
70  * @param[in]  mem_ctx       The memory context to use.
71  *
72  * @param[in]  server_info   The supplied server info.
73  *
74  * @param[in]  key           The key to open.
75  *
76  * @param[in]  create_key    Set to true if the key should be created if it
77  *                           doesn't exist.
78  *
79  * @param[in]  access_mask   The access mask to open the key.
80  *
81  * @param[out] binding_handle A pointer for the winreg dcerpc binding handle.
82  *
83  * @param[out] hive_handle   A policy handle for the opened hive.
84  *
85  * @param[out] key_handle    A policy handle for the opened key.
86  *
87  * @return                   WERR_OK on success, the corresponding DOS error
88  *                           code if something gone wrong.
89  */
90 NTSTATUS dcerpc_winreg_int_hklm_openkey(TALLOC_CTX *mem_ctx,
91                                         const struct auth3_session_info *session_info,
92                                         struct messaging_context *msg_ctx,
93                                         struct dcerpc_binding_handle **h,
94                                         const char *key,
95                                         bool create_key,
96                                         uint32_t access_mask,
97                                         struct policy_handle *hive_handle,
98                                         struct policy_handle *key_handle,
99                                         WERROR *pwerr);
100
101 #endif /* CLI_WINREG_INT_H */
102
103 /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */