2006-09-15 18:32:43 +00:00
/*
* Unix SMB / CIFS implementation .
* server auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
2008-12-16 16:32:18 +01:00
# include "../librpc/gen_ndr/srv_winreg.h"
2006-09-15 18:32:43 +00:00
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKCR ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKCR * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKCR ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKCR ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKCR , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKCR ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKCR , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKCU ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKCU * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKCU ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKCU ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKCU , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKCU ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKCU , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKLM ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKLM * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKLM ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKLM ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKLM , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKLM ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKLM , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKPD ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKPD * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKPD ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKPD ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKPD , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKPD ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKPD , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKU ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKU * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKU ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKU ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKU , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKU ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKU , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_CloseKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_CloseKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_CLOSEKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_CloseKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_CloseKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = r - > in . handle ;
r - > out . result = _winreg_CloseKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_CloseKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_CreateKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_CreateKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_CREATEKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_CreateKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_CreateKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-11-19 22:00:43 +01:00
r - > out . action_taken = r - > in . action_taken ;
2007-08-21 14:06:46 +00:00
r - > out . new_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . new_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_CreateKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_CreateKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_DeleteKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_DeleteKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_DELETEKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_DeleteKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_DeleteKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_DeleteKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_DeleteKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_DeleteValue ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_DeleteValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_DELETEVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_DeleteValue ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_DeleteValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_DeleteValue ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_DeleteValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_EnumKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_EnumKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_ENUMKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_EnumKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_EnumKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . name = r - > in . name ;
r - > out . keyclass = r - > in . keyclass ;
r - > out . last_changed_time = r - > in . last_changed_time ;
r - > out . result = _winreg_EnumKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_EnumKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_EnumValue ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_EnumValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_ENUMVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_EnumValue ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_EnumValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . name = r - > in . name ;
r - > out . type = r - > in . type ;
r - > out . value = r - > in . value ;
r - > out . size = r - > in . size ;
r - > out . length = r - > in . length ;
r - > out . result = _winreg_EnumValue ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_EnumValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_FlushKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_FlushKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_FLUSHKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_FlushKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_FlushKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_FlushKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_FlushKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_GetKeySecurity ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_GetKeySecurity * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_GETKEYSECURITY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_GetKeySecurity ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_GetKeySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . sd = r - > in . sd ;
r - > out . result = _winreg_GetKeySecurity ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_GetKeySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_LoadKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_LoadKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_LOADKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_LoadKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_LoadKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_LoadKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_LoadKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_NotifyChangeKeyValue ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_NotifyChangeKeyValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_NOTIFYCHANGEKEYVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_NotifyChangeKeyValue ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_NotifyChangeKeyValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_NotifyChangeKeyValue ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_NotifyChangeKeyValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_QueryInfoKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_QueryInfoKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_QUERYINFOKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_QueryInfoKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_QueryInfoKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . classname = r - > in . classname ;
r - > out . num_subkeys = talloc_zero ( r , uint32_t ) ;
if ( r - > out . num_subkeys = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . max_subkeylen = talloc_zero ( r , uint32_t ) ;
if ( r - > out . max_subkeylen = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . max_classlen = talloc_zero ( r , uint32_t ) ;
if ( r - > out . max_classlen = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . num_values = talloc_zero ( r , uint32_t ) ;
if ( r - > out . num_values = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . max_valnamelen = talloc_zero ( r , uint32_t ) ;
if ( r - > out . max_valnamelen = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . max_valbufsize = talloc_zero ( r , uint32_t ) ;
if ( r - > out . max_valbufsize = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . secdescsize = talloc_zero ( r , uint32_t ) ;
if ( r - > out . secdescsize = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . last_changed_time = talloc_zero ( r , NTTIME ) ;
if ( r - > out . last_changed_time = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_QueryInfoKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_QueryInfoKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_QueryValue ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_QueryValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_QUERYVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_QueryValue ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_QueryValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . type = r - > in . type ;
r - > out . data = r - > in . data ;
r - > out . data_size = r - > in . data_size ;
2008-10-15 21:32:49 +02:00
r - > out . data_length = r - > in . data_length ;
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_QueryValue ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_QueryValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_ReplaceKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_ReplaceKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_REPLACEKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_ReplaceKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_ReplaceKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_ReplaceKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_ReplaceKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_RestoreKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_RestoreKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_RESTOREKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_RestoreKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_RestoreKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_RestoreKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_RestoreKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_SaveKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_SaveKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_SAVEKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_SaveKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_SaveKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_SaveKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_SaveKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_SetKeySecurity ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_SetKeySecurity * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_SETKEYSECURITY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_SetKeySecurity ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_SetKeySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_SetKeySecurity ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_SetKeySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_SetValue ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_SetValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_SETVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_SetValue ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_SetValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_SetValue ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_SetValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_UnLoadKey ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_UnLoadKey * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_UNLOADKEY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_UnLoadKey ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_UnLoadKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_UnLoadKey ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_UnLoadKey , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_InitiateSystemShutdown ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_InitiateSystemShutdown * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_INITIATESYSTEMSHUTDOWN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_InitiateSystemShutdown ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_InitiateSystemShutdown , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_InitiateSystemShutdown ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_InitiateSystemShutdown , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_AbortSystemShutdown ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_AbortSystemShutdown * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_ABORTSYSTEMSHUTDOWN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_AbortSystemShutdown ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_AbortSystemShutdown , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_AbortSystemShutdown ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_AbortSystemShutdown , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_GetVersion ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_GetVersion * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_GETVERSION ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_GetVersion ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_GetVersion , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . version = talloc_zero ( r , uint32_t ) ;
if ( r - > out . version = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_GetVersion ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_GetVersion , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKCC ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKCC * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKCC ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKCC ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKCC , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKCC ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKCC , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKDD ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKDD * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKDD ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKDD ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKDD , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKDD ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKDD , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_QueryMultipleValues ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_QueryMultipleValues * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_QUERYMULTIPLEVALUES ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_QueryMultipleValues ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_QueryMultipleValues , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . values = r - > in . values ;
r - > out . buffer = r - > in . buffer ;
r - > out . buffer_size = r - > in . buffer_size ;
r - > out . result = _winreg_QueryMultipleValues ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_QueryMultipleValues , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_InitiateSystemShutdownEx ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_InitiateSystemShutdownEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_INITIATESYSTEMSHUTDOWNEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_InitiateSystemShutdownEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_InitiateSystemShutdownEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_InitiateSystemShutdownEx ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_InitiateSystemShutdownEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_SaveKeyEx ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_SaveKeyEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_SAVEKEYEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_SaveKeyEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_SaveKeyEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_SaveKeyEx ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_SaveKeyEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKPT ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKPT * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKPT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKPT ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKPT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKPT ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKPT , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_OpenHKPN ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_OpenHKPN * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_OPENHKPN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_OpenHKPN ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_OpenHKPN , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_OpenHKPN ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_OpenHKPN , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_winreg_QueryMultipleValues2 ( pipes_struct * p )
2006-09-15 18:32:43 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-15 18:32:43 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-15 18:32:43 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct winreg_QueryMultipleValues2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_winreg . calls [ NDR_WINREG_QUERYMULTIPLEVALUES2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct winreg_QueryMultipleValues2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( winreg_QueryMultipleValues2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _winreg_QueryMultipleValues2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( winreg_QueryMultipleValues2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 18:32:43 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-15 18:32:43 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-15 18:32:43 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-15 18:32:43 +00:00
}
/* Tables */
static struct api_struct api_winreg_cmds [ ] =
{
2007-08-19 22:10:11 +00:00
{ " WINREG_OPENHKCR " , NDR_WINREG_OPENHKCR , api_winreg_OpenHKCR } ,
{ " WINREG_OPENHKCU " , NDR_WINREG_OPENHKCU , api_winreg_OpenHKCU } ,
{ " WINREG_OPENHKLM " , NDR_WINREG_OPENHKLM , api_winreg_OpenHKLM } ,
{ " WINREG_OPENHKPD " , NDR_WINREG_OPENHKPD , api_winreg_OpenHKPD } ,
{ " WINREG_OPENHKU " , NDR_WINREG_OPENHKU , api_winreg_OpenHKU } ,
{ " WINREG_CLOSEKEY " , NDR_WINREG_CLOSEKEY , api_winreg_CloseKey } ,
{ " WINREG_CREATEKEY " , NDR_WINREG_CREATEKEY , api_winreg_CreateKey } ,
{ " WINREG_DELETEKEY " , NDR_WINREG_DELETEKEY , api_winreg_DeleteKey } ,
{ " WINREG_DELETEVALUE " , NDR_WINREG_DELETEVALUE , api_winreg_DeleteValue } ,
{ " WINREG_ENUMKEY " , NDR_WINREG_ENUMKEY , api_winreg_EnumKey } ,
{ " WINREG_ENUMVALUE " , NDR_WINREG_ENUMVALUE , api_winreg_EnumValue } ,
{ " WINREG_FLUSHKEY " , NDR_WINREG_FLUSHKEY , api_winreg_FlushKey } ,
{ " WINREG_GETKEYSECURITY " , NDR_WINREG_GETKEYSECURITY , api_winreg_GetKeySecurity } ,
{ " WINREG_LOADKEY " , NDR_WINREG_LOADKEY , api_winreg_LoadKey } ,
{ " WINREG_NOTIFYCHANGEKEYVALUE " , NDR_WINREG_NOTIFYCHANGEKEYVALUE , api_winreg_NotifyChangeKeyValue } ,
{ " WINREG_OPENKEY " , NDR_WINREG_OPENKEY , api_winreg_OpenKey } ,
{ " WINREG_QUERYINFOKEY " , NDR_WINREG_QUERYINFOKEY , api_winreg_QueryInfoKey } ,
{ " WINREG_QUERYVALUE " , NDR_WINREG_QUERYVALUE , api_winreg_QueryValue } ,
{ " WINREG_REPLACEKEY " , NDR_WINREG_REPLACEKEY , api_winreg_ReplaceKey } ,
{ " WINREG_RESTOREKEY " , NDR_WINREG_RESTOREKEY , api_winreg_RestoreKey } ,
{ " WINREG_SAVEKEY " , NDR_WINREG_SAVEKEY , api_winreg_SaveKey } ,
{ " WINREG_SETKEYSECURITY " , NDR_WINREG_SETKEYSECURITY , api_winreg_SetKeySecurity } ,
{ " WINREG_SETVALUE " , NDR_WINREG_SETVALUE , api_winreg_SetValue } ,
{ " WINREG_UNLOADKEY " , NDR_WINREG_UNLOADKEY , api_winreg_UnLoadKey } ,
{ " WINREG_INITIATESYSTEMSHUTDOWN " , NDR_WINREG_INITIATESYSTEMSHUTDOWN , api_winreg_InitiateSystemShutdown } ,
{ " WINREG_ABORTSYSTEMSHUTDOWN " , NDR_WINREG_ABORTSYSTEMSHUTDOWN , api_winreg_AbortSystemShutdown } ,
{ " WINREG_GETVERSION " , NDR_WINREG_GETVERSION , api_winreg_GetVersion } ,
{ " WINREG_OPENHKCC " , NDR_WINREG_OPENHKCC , api_winreg_OpenHKCC } ,
{ " WINREG_OPENHKDD " , NDR_WINREG_OPENHKDD , api_winreg_OpenHKDD } ,
{ " WINREG_QUERYMULTIPLEVALUES " , NDR_WINREG_QUERYMULTIPLEVALUES , api_winreg_QueryMultipleValues } ,
{ " WINREG_INITIATESYSTEMSHUTDOWNEX " , NDR_WINREG_INITIATESYSTEMSHUTDOWNEX , api_winreg_InitiateSystemShutdownEx } ,
{ " WINREG_SAVEKEYEX " , NDR_WINREG_SAVEKEYEX , api_winreg_SaveKeyEx } ,
{ " WINREG_OPENHKPT " , NDR_WINREG_OPENHKPT , api_winreg_OpenHKPT } ,
{ " WINREG_OPENHKPN " , NDR_WINREG_OPENHKPN , api_winreg_OpenHKPN } ,
{ " WINREG_QUERYMULTIPLEVALUES2 " , NDR_WINREG_QUERYMULTIPLEVALUES2 , api_winreg_QueryMultipleValues2 } ,
2006-09-15 18:32:43 +00:00
} ;
void winreg_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_winreg_cmds ;
* n_fns = sizeof ( api_winreg_cmds ) / sizeof ( struct api_struct ) ;
}
2009-01-21 14:05:51 +01:00
NTSTATUS rpc_winreg_dispatch ( struct rpc_pipe_client * cli , TALLOC_CTX * mem_ctx , const struct ndr_interface_table * table , uint32_t opnum , void * _r )
{
if ( cli - > pipes_struct = = NULL ) {
return NT_STATUS_INVALID_PARAMETER ;
}
switch ( opnum )
{
case NDR_WINREG_OPENHKCR : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKCR * r = ( struct winreg_OpenHKCR * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKCR ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKCU : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKCU * r = ( struct winreg_OpenHKCU * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKCU ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKLM : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKLM * r = ( struct winreg_OpenHKLM * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKLM ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKPD : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKPD * r = ( struct winreg_OpenHKPD * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKPD ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKU : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKU * r = ( struct winreg_OpenHKU * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKU ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_CLOSEKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_CloseKey * r = ( struct winreg_CloseKey * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = r - > in . handle ;
r - > out . result = _winreg_CloseKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_CREATEKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_CreateKey * r = ( struct winreg_CreateKey * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . action_taken = r - > in . action_taken ;
r - > out . new_handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . new_handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_CreateKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_DELETEKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_DeleteKey * r = ( struct winreg_DeleteKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_DeleteKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_DELETEVALUE : {
2009-01-22 01:19:38 +01:00
struct winreg_DeleteValue * r = ( struct winreg_DeleteValue * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_DeleteValue ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_ENUMKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_EnumKey * r = ( struct winreg_EnumKey * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . name = r - > in . name ;
r - > out . keyclass = r - > in . keyclass ;
r - > out . last_changed_time = r - > in . last_changed_time ;
r - > out . result = _winreg_EnumKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_ENUMVALUE : {
2009-01-22 01:19:38 +01:00
struct winreg_EnumValue * r = ( struct winreg_EnumValue * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . name = r - > in . name ;
r - > out . type = r - > in . type ;
r - > out . value = r - > in . value ;
r - > out . size = r - > in . size ;
r - > out . length = r - > in . length ;
r - > out . result = _winreg_EnumValue ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_FLUSHKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_FlushKey * r = ( struct winreg_FlushKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_FlushKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_GETKEYSECURITY : {
2009-01-22 01:19:38 +01:00
struct winreg_GetKeySecurity * r = ( struct winreg_GetKeySecurity * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . sd = r - > in . sd ;
r - > out . result = _winreg_GetKeySecurity ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_LOADKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_LoadKey * r = ( struct winreg_LoadKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_LoadKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_NOTIFYCHANGEKEYVALUE : {
2009-01-22 01:19:38 +01:00
struct winreg_NotifyChangeKeyValue * r = ( struct winreg_NotifyChangeKeyValue * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_NotifyChangeKeyValue ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenKey * r = ( struct winreg_OpenKey * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_QUERYINFOKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_QueryInfoKey * r = ( struct winreg_QueryInfoKey * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . classname = r - > in . classname ;
r - > out . num_subkeys = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . num_subkeys = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . max_subkeylen = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . max_subkeylen = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . max_classlen = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . max_classlen = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . num_values = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . num_values = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . max_valnamelen = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . max_valnamelen = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . max_valbufsize = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . max_valbufsize = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . secdescsize = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . secdescsize = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . last_changed_time = talloc_zero ( mem_ctx , NTTIME ) ;
if ( r - > out . last_changed_time = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_QueryInfoKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_QUERYVALUE : {
2009-01-22 01:19:38 +01:00
struct winreg_QueryValue * r = ( struct winreg_QueryValue * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . type = r - > in . type ;
r - > out . data = r - > in . data ;
r - > out . data_size = r - > in . data_size ;
r - > out . data_length = r - > in . data_length ;
r - > out . result = _winreg_QueryValue ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_REPLACEKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_ReplaceKey * r = ( struct winreg_ReplaceKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_ReplaceKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_RESTOREKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_RestoreKey * r = ( struct winreg_RestoreKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_RestoreKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_SAVEKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_SaveKey * r = ( struct winreg_SaveKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_SaveKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_SETKEYSECURITY : {
2009-01-22 01:19:38 +01:00
struct winreg_SetKeySecurity * r = ( struct winreg_SetKeySecurity * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_SetKeySecurity ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_SETVALUE : {
2009-01-22 01:19:38 +01:00
struct winreg_SetValue * r = ( struct winreg_SetValue * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_SetValue ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_UNLOADKEY : {
2009-01-22 01:19:38 +01:00
struct winreg_UnLoadKey * r = ( struct winreg_UnLoadKey * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_UnLoadKey ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_INITIATESYSTEMSHUTDOWN : {
2009-01-22 01:19:38 +01:00
struct winreg_InitiateSystemShutdown * r = ( struct winreg_InitiateSystemShutdown * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_InitiateSystemShutdown ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_ABORTSYSTEMSHUTDOWN : {
2009-01-22 01:19:38 +01:00
struct winreg_AbortSystemShutdown * r = ( struct winreg_AbortSystemShutdown * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_AbortSystemShutdown ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_GETVERSION : {
2009-01-22 01:19:38 +01:00
struct winreg_GetVersion * r = ( struct winreg_GetVersion * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . version = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . version = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_GetVersion ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKCC : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKCC * r = ( struct winreg_OpenHKCC * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKCC ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKDD : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKDD * r = ( struct winreg_OpenHKDD * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKDD ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_QUERYMULTIPLEVALUES : {
2009-01-22 01:19:38 +01:00
struct winreg_QueryMultipleValues * r = ( struct winreg_QueryMultipleValues * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . values = r - > in . values ;
r - > out . buffer = r - > in . buffer ;
r - > out . buffer_size = r - > in . buffer_size ;
r - > out . result = _winreg_QueryMultipleValues ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_INITIATESYSTEMSHUTDOWNEX : {
2009-01-22 01:19:38 +01:00
struct winreg_InitiateSystemShutdownEx * r = ( struct winreg_InitiateSystemShutdownEx * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_InitiateSystemShutdownEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_SAVEKEYEX : {
2009-01-22 01:19:38 +01:00
struct winreg_SaveKeyEx * r = ( struct winreg_SaveKeyEx * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_SaveKeyEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKPT : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKPT * r = ( struct winreg_OpenHKPT * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKPT ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_OPENHKPN : {
2009-01-22 01:19:38 +01:00
struct winreg_OpenHKPN * r = ( struct winreg_OpenHKPN * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( mem_ctx , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _winreg_OpenHKPN ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_WINREG_QUERYMULTIPLEVALUES2 : {
2009-01-22 01:19:38 +01:00
struct winreg_QueryMultipleValues2 * r = ( struct winreg_QueryMultipleValues2 * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _winreg_QueryMultipleValues2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
default :
return NT_STATUS_NOT_IMPLEMENTED ;
}
}
2006-09-15 18:32:43 +00:00
NTSTATUS rpc_winreg_init ( void )
{
2009-01-06 23:29:25 +01:00
return rpc_srv_register ( SMB_RPC_INTERFACE_VERSION , " winreg " , " winreg " , & ndr_table_winreg , api_winreg_cmds , sizeof ( api_winreg_cmds ) / sizeof ( struct api_struct ) ) ;
2006-09-15 18:32:43 +00:00
}