2006-09-15 22:32:43 +04:00
/*
* Unix SMB / CIFS implementation .
* server auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
2008-12-16 18:32:18 +03:00
# include "../librpc/gen_ndr/srv_initshutdown.h"
2006-09-15 22:32:43 +04:00
2007-10-19 04:40:25 +04:00
static bool api_initshutdown_Init ( pipes_struct * p )
2006-09-15 22:32:43 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2006-09-15 22:32:43 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2006-09-15 22:32:43 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct initshutdown_Init * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_initshutdown . calls [ NDR_INITSHUTDOWN_INIT ] ;
2008-01-09 14:28:44 +03:00
2008-02-11 11:15:30 +03:00
r = talloc ( talloc_tos ( ) , struct initshutdown_Init ) ;
2007-08-21 18:06:46 +04:00
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2008-09-23 22:59:30 +04:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 11:55:46 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( initshutdown_Init , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _initshutdown_Init ( p , r ) ;
2008-01-09 14:28:44 +03:00
2006-10-10 11:55:46 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( initshutdown_Init , r ) ;
2008-01-09 14:28:44 +03:00
}
2008-10-12 21:05:46 +04:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 22:32:43 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2006-09-15 22:32:43 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_initshutdown_Abort ( pipes_struct * p )
2006-09-15 22:32:43 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2006-09-15 22:32:43 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2006-09-15 22:32:43 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct initshutdown_Abort * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_initshutdown . calls [ NDR_INITSHUTDOWN_ABORT ] ;
2008-01-09 14:28:44 +03:00
2008-02-11 11:15:30 +03:00
r = talloc ( talloc_tos ( ) , struct initshutdown_Abort ) ;
2007-08-21 18:06:46 +04:00
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2008-09-23 22:59:30 +04:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 11:55:46 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( initshutdown_Abort , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _initshutdown_Abort ( p , r ) ;
2008-01-09 14:28:44 +03:00
2006-10-10 11:55:46 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( initshutdown_Abort , r ) ;
2008-01-09 14:28:44 +03:00
}
2008-10-12 21:05:46 +04:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 22:32:43 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2006-09-15 22:32:43 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_initshutdown_InitEx ( pipes_struct * p )
2006-09-15 22:32:43 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2006-09-15 22:32:43 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2006-09-15 22:32:43 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct initshutdown_InitEx * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_initshutdown . calls [ NDR_INITSHUTDOWN_INITEX ] ;
2008-01-09 14:28:44 +03:00
2008-02-11 11:15:30 +03:00
r = talloc ( talloc_tos ( ) , struct initshutdown_InitEx ) ;
2007-08-21 18:06:46 +04:00
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2008-09-23 22:59:30 +04:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 11:55:46 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( initshutdown_InitEx , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _initshutdown_InitEx ( p , r ) ;
2008-01-09 14:28:44 +03:00
2006-10-10 11:55:46 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 11:55:46 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( initshutdown_InitEx , r ) ;
2008-01-09 14:28:44 +03:00
}
2008-10-12 21:05:46 +04:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-15 22:32:43 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2006-09-15 22:32:43 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2006-09-15 22:32:43 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2006-09-15 22:32:43 +04:00
}
/* Tables */
static struct api_struct api_initshutdown_cmds [ ] =
{
2007-08-20 02:10:11 +04:00
{ " INITSHUTDOWN_INIT " , NDR_INITSHUTDOWN_INIT , api_initshutdown_Init } ,
{ " INITSHUTDOWN_ABORT " , NDR_INITSHUTDOWN_ABORT , api_initshutdown_Abort } ,
{ " INITSHUTDOWN_INITEX " , NDR_INITSHUTDOWN_INITEX , api_initshutdown_InitEx } ,
2006-09-15 22:32:43 +04:00
} ;
void initshutdown_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_initshutdown_cmds ;
* n_fns = sizeof ( api_initshutdown_cmds ) / sizeof ( struct api_struct ) ;
}
2009-01-21 16:05:51 +03:00
NTSTATUS rpc_initshutdown_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_INITSHUTDOWN_INIT : {
2009-01-22 03:19:38 +03:00
struct initshutdown_Init * r = ( struct initshutdown_Init * ) _r ;
2009-01-21 16:05:51 +03:00
r - > out . result = _initshutdown_Init ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_INITSHUTDOWN_ABORT : {
2009-01-22 03:19:38 +03:00
struct initshutdown_Abort * r = ( struct initshutdown_Abort * ) _r ;
2009-01-21 16:05:51 +03:00
r - > out . result = _initshutdown_Abort ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_INITSHUTDOWN_INITEX : {
2009-01-22 03:19:38 +03:00
struct initshutdown_InitEx * r = ( struct initshutdown_InitEx * ) _r ;
2009-01-21 16:05:51 +03:00
r - > out . result = _initshutdown_InitEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
default :
return NT_STATUS_NOT_IMPLEMENTED ;
}
}
2006-09-15 22:32:43 +04:00
NTSTATUS rpc_initshutdown_init ( void )
{
2009-01-07 01:29:25 +03:00
return rpc_srv_register ( SMB_RPC_INTERFACE_VERSION , " initshutdown " , " initshutdown " , & ndr_table_initshutdown , api_initshutdown_cmds , sizeof ( api_initshutdown_cmds ) / sizeof ( struct api_struct ) ) ;
2006-09-15 22:32:43 +04:00
}