2 Unix SMB/CIFS implementation.
5 Copyright (C) Gerald (Jerry) Carter 2005-2006
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "rpc_client.h"
25 /*******************************************************************
26 connect to a registry hive root (open a registry policy)
27 *******************************************************************/
29 NTSTATUS
rpccli_winreg_Connect(struct rpc_pipe_client
*cli
, TALLOC_CTX
*mem_ctx
,
30 uint32 reg_type
, uint32 access_mask
,
33 ZERO_STRUCTP(reg_hnd
);
37 case HKEY_CLASSES_ROOT
:
38 return rpccli_winreg_OpenHKCR( cli
, mem_ctx
, NULL
,
39 access_mask
, reg_hnd
);
41 case HKEY_LOCAL_MACHINE
:
42 return rpccli_winreg_OpenHKLM( cli
, mem_ctx
, NULL
,
43 access_mask
, reg_hnd
);
46 return rpccli_winreg_OpenHKU( cli
, mem_ctx
, NULL
,
47 access_mask
, reg_hnd
);
49 case HKEY_PERFORMANCE_DATA
:
50 return rpccli_winreg_OpenHKPD( cli
, mem_ctx
, NULL
,
51 access_mask
, reg_hnd
);
54 /* fall through to end of function */
58 return NT_STATUS_INVALID_PARAMETER
;
61 /*******************************************************************
62 Fill in a REGVAL_BUFFER for the data given a REGISTRY_VALUE
63 *******************************************************************/
65 uint32
reg_init_regval_buffer( REGVAL_BUFFER
*buf2
, REGISTRY_VALUE
*val
)
72 real_size
= regval_size(val
);
73 init_regval_buffer( buf2
, (unsigned char*)regval_data_p(val
), real_size
);