1998-03-12 00:11:04 +03:00
/*
2002-03-22 09:24:38 +03:00
* Unix SMB / CIFS implementation .
1998-03-12 00:11:04 +03:00
* RPC Pipe client / server routines
1999-12-13 16:27:58 +03:00
* Copyright ( C ) Andrew Tridgell 1992 - 1997 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997 ,
2002-08-17 21:00:51 +04:00
* Copyright ( C ) Paul Ashton 1997 ,
* Copyright ( C ) Jeremy Allison 1999 ,
* Copyright ( C ) Nigel Williams 2001 ,
* Copyright ( C ) Jim McDonough ( jmcd @ us . ibm . com ) 2002.
1998-03-12 00:11:04 +03:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# include "includes.h"
2002-07-15 14:35:28 +04:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_RPC_PARSE
2002-08-17 21:00:51 +04:00
/*******************************************************************
Inits a SH_INFO_0_STR structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info0_str ( SH_INFO_0_STR * sh0 , const char * net_name )
2002-08-17 21:00:51 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info0_str \n " ) ) ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh0 - > uni_netname , net_name , UNI_STR_TERMINATE ) ;
2002-08-17 21:00:51 +04:00
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info0_str ( const char * desc , SH_INFO_0_STR * sh0 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh0 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info0_str " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( sh0 - > ptrs - > ptr_netname )
if ( ! smb_io_unistr2 ( " " , & sh0 - > uni_netname , True , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
makes a SH_INFO_0 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info0 ( SH_INFO_0 * sh0 , const char * net_name )
2002-08-17 21:00:51 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info0: %s \n " , net_name ) ) ;
sh0 - > ptr_netname = ( net_name ! = NULL ) ? 1 : 0 ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info0 ( const char * desc , SH_INFO_0 * sh0 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh0 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info0 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_netname " , ps , depth , & sh0 - > ptr_netname ) )
return False ;
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SH_INFO_1_STR structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info1_str ( SH_INFO_1_STR * sh1 , const char * net_name , const char * remark )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_share_info1_str \n " ) ) ;
1999-10-15 22:46:22 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh1 - > uni_netname , net_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh1 - > uni_remark , remark , UNI_STR_TERMINATE ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1_str ( const char * desc , SH_INFO_1_STR * sh1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sh1 = = NULL )
return False ;
2002-08-17 21:00:51 +04:00
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_share_info1_str " ) ;
depth + + ;
2002-08-17 21:00:51 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
2000-11-29 17:39:06 +03:00
2002-08-17 21:00:51 +04:00
if ( sh1 - > ptrs - > ptr_netname )
if ( ! smb_io_unistr2 ( " " , & sh1 - > uni_netname , True , ps , depth ) )
return False ;
2000-11-29 17:39:06 +03:00
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( sh1 - > ptrs - > ptr_remark )
if ( ! smb_io_unistr2 ( " " , & sh1 - > uni_remark , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
makes a SH_INFO_1 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info1 ( SH_INFO_1 * sh1 , const char * net_name , uint32 type , const char * remark )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_share_info1: %s %8x %s \n " , net_name , type , remark ) ) ;
2002-08-17 21:00:51 +04:00
1999-12-13 16:27:58 +03:00
sh1 - > ptr_netname = ( net_name ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
sh1 - > type = type ;
1999-12-13 16:27:58 +03:00
sh1 - > ptr_remark = ( remark ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1 ( const char * desc , SH_INFO_1 * sh1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sh1 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_share_info1 " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_netname " , ps , depth , & sh1 - > ptr_netname ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & sh1 - > type ) )
return False ;
if ( ! prs_uint32 ( " ptr_remark " , ps , depth , & sh1 - > ptr_remark ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SH_INFO_2_STR structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_share_info2_str ( SH_INFO_2_STR * sh2 ,
2003-01-03 11:28:12 +03:00
const char * net_name , const char * remark ,
const char * path , const char * passwd )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_share_info2_str \n " ) ) ;
1999-10-15 22:46:22 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh2 - > uni_netname , net_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh2 - > uni_remark , remark , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh2 - > uni_path , path , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh2 - > uni_passwd , passwd , UNI_STR_TERMINATE ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info2_str ( const char * desc , SH_INFO_2 * sh , SH_INFO_2_STR * sh2 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sh2 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
2002-03-05 05:12:00 +03:00
if ( UNMARSHALLING ( ps ) )
ZERO_STRUCTP ( sh2 ) ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_share_info2_str " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
2002-03-05 05:12:00 +03:00
if ( sh - > ptr_netname )
if ( ! smb_io_unistr2 ( " " , & sh2 - > uni_netname , True , ps , depth ) )
return False ;
2000-11-29 17:39:06 +03:00
2002-03-05 05:12:00 +03:00
if ( sh - > ptr_remark )
if ( ! smb_io_unistr2 ( " " , & sh2 - > uni_remark , True , ps , depth ) )
return False ;
2000-11-29 17:39:06 +03:00
2002-03-05 05:12:00 +03:00
if ( sh - > ptr_netname )
if ( ! smb_io_unistr2 ( " " , & sh2 - > uni_path , True , ps , depth ) )
return False ;
2000-11-29 17:39:06 +03:00
2002-03-05 05:12:00 +03:00
if ( sh - > ptr_passwd )
if ( ! smb_io_unistr2 ( " " , & sh2 - > uni_passwd , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SH_INFO_2 structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_share_info2 ( SH_INFO_2 * sh2 ,
2003-01-03 11:28:12 +03:00
const char * net_name , uint32 type , const char * remark ,
1998-03-12 00:11:04 +03:00
uint32 perms , uint32 max_uses , uint32 num_uses ,
2003-01-03 11:28:12 +03:00
const char * path , const char * passwd )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_share_info2: %s %8x %s \n " , net_name , type , remark ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
sh2 - > ptr_netname = ( net_name ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
sh2 - > type = type ;
1999-12-13 16:27:58 +03:00
sh2 - > ptr_remark = ( remark ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
sh2 - > perms = perms ;
sh2 - > max_uses = max_uses ;
sh2 - > num_uses = num_uses ;
1999-12-13 16:27:58 +03:00
sh2 - > ptr_path = ( path ! = NULL ) ? 1 : 0 ;
sh2 - > ptr_passwd = ( passwd ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info2 ( const char * desc , SH_INFO_2 * sh2 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sh2 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_share_info2 " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_netname " , ps , depth , & sh2 - > ptr_netname ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & sh2 - > type ) )
return False ;
if ( ! prs_uint32 ( " ptr_remark " , ps , depth , & sh2 - > ptr_remark ) )
return False ;
if ( ! prs_uint32 ( " perms " , ps , depth , & sh2 - > perms ) )
return False ;
if ( ! prs_uint32 ( " max_uses " , ps , depth , & sh2 - > max_uses ) )
return False ;
if ( ! prs_uint32 ( " num_uses " , ps , depth , & sh2 - > num_uses ) )
return False ;
if ( ! prs_uint32 ( " ptr_path " , ps , depth , & sh2 - > ptr_path ) )
return False ;
if ( ! prs_uint32 ( " ptr_passwd " , ps , depth , & sh2 - > ptr_passwd ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
Inits a SH_INFO_501_STR structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_share_info501_str ( SH_INFO_501_STR * sh501 ,
2003-01-03 11:28:12 +03:00
const char * net_name , const char * remark )
2002-08-17 21:00:51 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info501_str \n " ) ) ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh501 - > uni_netname , net_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh501 - > uni_remark , remark , UNI_STR_TERMINATE ) ;
2002-08-17 21:00:51 +04:00
}
2002-04-10 05:04:13 +04:00
/*******************************************************************
Inits a SH_INFO_2 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info501 ( SH_INFO_501 * sh501 , const char * net_name , uint32 type , const char * remark , uint32 csc_policy )
2002-04-10 05:04:13 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info501: %s %8x %s %08x \n " , net_name , type ,
remark , csc_policy ) ) ;
ZERO_STRUCTP ( sh501 ) ;
sh501 - > ptr_netname = ( net_name ! = NULL ) ? 1 : 0 ;
sh501 - > type = type ;
sh501 - > ptr_remark = ( remark ! = NULL ) ? 1 : 0 ;
sh501 - > csc_policy = csc_policy ;
}
/*******************************************************************
Reads of writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info501 ( const char * desc , SH_INFO_501 * sh501 , prs_struct * ps , int depth )
2002-04-10 05:04:13 +04:00
{
if ( sh501 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info501 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_netname " , ps , depth , & sh501 - > ptr_netname ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & sh501 - > type ) )
return False ;
if ( ! prs_uint32 ( " ptr_remark " , ps , depth , & sh501 - > ptr_remark ) )
return False ;
if ( ! prs_uint32 ( " csc_policy " , ps , depth , & sh501 - > csc_policy ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info501_str ( const char * desc , SH_INFO_501_STR * sh501 , prs_struct * ps , int depth )
2002-04-10 05:04:13 +04:00
{
if ( sh501 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info501_str " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & sh501 - > uni_netname , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & sh501 - > uni_remark , True , ps , depth ) )
return False ;
return True ;
}
2001-04-05 03:42:17 +04:00
/*******************************************************************
Inits a SH_INFO_502 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_share_info502 ( SH_INFO_502 * sh502 ,
2003-01-03 11:28:12 +03:00
const char * net_name , uint32 type , const char * remark ,
2001-04-05 03:42:17 +04:00
uint32 perms , uint32 max_uses , uint32 num_uses ,
2003-01-03 11:28:12 +03:00
const char * path , const char * passwd , SEC_DESC * psd , size_t sd_size )
2001-04-05 03:42:17 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info502: %s %8x %s \n " , net_name , type , remark ) ) ;
ZERO_STRUCTP ( sh502 ) ;
sh502 - > ptr_netname = ( net_name ! = NULL ) ? 1 : 0 ;
sh502 - > type = type ;
sh502 - > ptr_remark = ( remark ! = NULL ) ? 1 : 0 ;
sh502 - > perms = perms ;
sh502 - > max_uses = max_uses ;
sh502 - > num_uses = num_uses ;
sh502 - > ptr_path = ( path ! = NULL ) ? 1 : 0 ;
sh502 - > ptr_passwd = ( passwd ! = NULL ) ? 1 : 0 ;
2002-08-17 21:00:51 +04:00
sh502 - > reserved = 0 ; /* actual size within rpc */
2001-04-05 03:42:17 +04:00
sh502 - > sd_size = ( uint32 ) sd_size ;
sh502 - > ptr_sd = ( psd ! = NULL ) ? 1 : 0 ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info502 ( const char * desc , SH_INFO_502 * sh502 , prs_struct * ps , int depth )
2001-04-05 03:42:17 +04:00
{
if ( sh502 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info502 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_netname " , ps , depth , & sh502 - > ptr_netname ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & sh502 - > type ) )
return False ;
if ( ! prs_uint32 ( " ptr_remark " , ps , depth , & sh502 - > ptr_remark ) )
return False ;
if ( ! prs_uint32 ( " perms " , ps , depth , & sh502 - > perms ) )
return False ;
if ( ! prs_uint32 ( " max_uses " , ps , depth , & sh502 - > max_uses ) )
return False ;
if ( ! prs_uint32 ( " num_uses " , ps , depth , & sh502 - > num_uses ) )
return False ;
if ( ! prs_uint32 ( " ptr_path " , ps , depth , & sh502 - > ptr_path ) )
return False ;
if ( ! prs_uint32 ( " ptr_passwd " , ps , depth , & sh502 - > ptr_passwd ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32_pre ( " reserved " , ps , depth , & sh502 - > reserved , & sh502 - > reserved_offset ) )
2001-04-05 03:42:17 +04:00
return False ;
if ( ! prs_uint32 ( " ptr_sd " , ps , depth , & sh502 - > ptr_sd ) )
return False ;
return True ;
}
/*******************************************************************
Inits a SH_INFO_502_STR structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-05-01 05:01:19 +04:00
void init_srv_share_info502_str ( SH_INFO_502_STR * sh502str ,
2003-01-03 11:28:12 +03:00
const char * net_name , const char * remark ,
const char * path , const char * passwd , SEC_DESC * psd , size_t sd_size )
2001-04-05 03:42:17 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info502_str \n " ) ) ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh502str - > uni_netname , net_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh502str - > uni_remark , remark , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh502str - > uni_path , path , UNI_STR_TERMINATE ) ;
init_unistr2 ( & sh502str - > uni_passwd , passwd , UNI_STR_TERMINATE ) ;
sh502str - > sd = psd ;
2002-08-17 21:00:51 +04:00
sh502str - > reserved = 0 ;
2003-09-26 01:26:16 +04:00
sh502str - > sd_size = sd_size ;
2001-04-05 03:42:17 +04:00
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info502_str ( const char * desc , SH_INFO_502_STR * sh502 , prs_struct * ps , int depth )
2001-04-05 03:42:17 +04:00
{
if ( sh502 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info502_str " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2001-05-01 05:01:19 +04:00
if ( sh502 - > ptrs - > ptr_netname ) {
if ( ! smb_io_unistr2 ( " " , & sh502 - > uni_netname , True , ps , depth ) )
return False ;
}
2001-04-05 03:42:17 +04:00
if ( ! prs_align ( ps ) )
return False ;
2001-05-01 05:01:19 +04:00
if ( sh502 - > ptrs - > ptr_remark ) {
if ( ! smb_io_unistr2 ( " " , & sh502 - > uni_remark , True , ps , depth ) )
return False ;
}
2001-04-05 03:42:17 +04:00
if ( ! prs_align ( ps ) )
return False ;
2001-05-01 05:01:19 +04:00
if ( sh502 - > ptrs - > ptr_path ) {
if ( ! smb_io_unistr2 ( " " , & sh502 - > uni_path , True , ps , depth ) )
return False ;
}
2001-04-05 03:42:17 +04:00
if ( ! prs_align ( ps ) )
return False ;
2001-05-01 05:01:19 +04:00
if ( sh502 - > ptrs - > ptr_passwd ) {
if ( ! smb_io_unistr2 ( " " , & sh502 - > uni_passwd , True , ps , depth ) )
return False ;
}
2001-04-05 03:42:17 +04:00
if ( ! prs_align ( ps ) )
return False ;
2001-05-01 05:01:19 +04:00
if ( sh502 - > ptrs - > ptr_sd ) {
2002-08-17 21:00:51 +04:00
uint32 old_offset ;
uint32 reserved_offset ;
if ( ! prs_uint32_pre ( " reserved " , ps , depth , & sh502 - > reserved , & reserved_offset ) )
2001-05-01 05:01:19 +04:00
return False ;
2002-08-17 21:00:51 +04:00
old_offset = prs_offset ( ps ) ;
2001-05-01 05:01:19 +04:00
if ( ! sec_io_desc ( desc , & sh502 - > sd , ps , depth ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( UNMARSHALLING ( ps ) ) {
sh502 - > ptrs - > sd_size = sh502 - > sd_size = sec_desc_size ( sh502 - > sd ) ;
prs_set_offset ( ps , old_offset + sh502 - > reserved ) ;
}
prs_align ( ps ) ;
if ( MARSHALLING ( ps ) ) {
sh502 - > ptrs - > reserved = sh502 - > reserved = prs_offset ( ps ) - old_offset ;
}
if ( ! prs_uint32_post ( " reserved " , ps , depth ,
& sh502 - > reserved , reserved_offset , sh502 - > reserved ) )
return False ;
if ( ! prs_uint32_post ( " reserved " , ps , depth ,
& sh502 - > ptrs - > reserved , sh502 - > ptrs - > reserved_offset , sh502 - > ptrs - > reserved ) )
return False ;
2001-05-01 05:01:19 +04:00
}
2001-04-05 03:42:17 +04:00
return True ;
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
Inits a SH_INFO_1004_STR structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info1004_str ( SH_INFO_1004_STR * sh1004 , const char * remark )
2002-08-17 21:00:51 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info1004_str \n " ) ) ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh1004 - > uni_remark , remark , UNI_STR_TERMINATE ) ;
2002-08-17 21:00:51 +04:00
}
2000-04-28 22:36:47 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-04-09 12:00:19 +04:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1004_str ( const char * desc , SH_INFO_1004_STR * sh1004 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh1004 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1004_str " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( sh1004 - > ptrs - > ptr_remark )
if ( ! smb_io_unistr2 ( " " , & sh1004 - > uni_remark , True , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
makes a SH_INFO_1004 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_share_info1004 ( SH_INFO_1004 * sh1004 , const char * remark )
2002-08-17 21:00:51 +04:00
{
DEBUG ( 5 , ( " init_srv_share_info1004: %s \n " , remark ) ) ;
sh1004 - > ptr_remark = ( remark ! = NULL ) ? 1 : 0 ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1004 ( const char * desc , SH_INFO_1004 * sh1004 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh1004 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1004 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_remark " , ps , depth , & sh1004 - > ptr_remark ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1005 ( const char * desc , SRV_SHARE_INFO_1005 * sh1005 , prs_struct * ps , int depth )
2000-04-28 22:36:47 +04:00
{
2001-04-09 12:00:19 +04:00
if ( sh1005 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1005 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2003-07-02 01:47:13 +04:00
if ( ! prs_uint32 ( " share_info_flags " , ps , depth ,
& sh1005 - > share_info_flags ) )
2001-04-09 12:00:19 +04:00
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1006 ( const char * desc , SRV_SHARE_INFO_1006 * sh1006 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh1006 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1006 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " max uses " , ps , depth , & sh1006 - > max_uses ) )
return False ;
return True ;
}
/*******************************************************************
Inits a SH_INFO_1007_STR structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_share_info1007_str ( SH_INFO_1007_STR * sh1007 , const char * alternate_directory_name )
{
DEBUG ( 5 , ( " init_srv_share_info1007_str \n " ) ) ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & sh1007 - > uni_AlternateDirectoryName , alternate_directory_name , UNI_STR_TERMINATE ) ;
2002-08-17 21:00:51 +04:00
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1007_str ( const char * desc , SH_INFO_1007_STR * sh1007 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh1007 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1007_str " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( sh1007 - > ptrs - > ptr_AlternateDirectoryName )
if ( ! smb_io_unistr2 ( " " , & sh1007 - > uni_AlternateDirectoryName , True , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
makes a SH_INFO_1007 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_share_info1007 ( SH_INFO_1007 * sh1007 , uint32 flags , const char * alternate_directory_name )
{
DEBUG ( 5 , ( " init_srv_share_info1007: %s \n " , alternate_directory_name ) ) ;
sh1007 - > flags = flags ;
sh1007 - > ptr_AlternateDirectoryName = ( alternate_directory_name ! = NULL ) ? 1 : 0 ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1007 ( const char * desc , SH_INFO_1007 * sh1007 , prs_struct * ps , int depth )
2002-08-17 21:00:51 +04:00
{
if ( sh1007 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_share_info1007 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " flags " , ps , depth , & sh1007 - > flags ) )
return False ;
if ( ! prs_uint32 ( " ptr_Alter.. " , ps , depth , & sh1007 - > ptr_AlternateDirectoryName ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_share_info1501 ( const char * desc , SRV_SHARE_INFO_1501 * sh1501 ,
2001-04-09 12:00:19 +04:00
prs_struct * ps , int depth )
{
if ( sh1501 = = NULL )
return False ;
2000-04-28 22:36:47 +04:00
2001-04-09 12:00:19 +04:00
prs_debug ( ps , depth , desc , " srv_io_share_info1501 " ) ;
depth + + ;
2000-04-28 22:36:47 +04:00
2001-04-09 12:00:19 +04:00
if ( ! prs_align ( ps ) )
return False ;
2000-04-28 22:36:47 +04:00
2001-04-09 12:00:19 +04:00
if ( ! sec_io_desc_buf ( desc , & sh1501 - > sdb , ps , depth ) )
return False ;
2000-04-28 22:36:47 +04:00
2001-04-09 12:00:19 +04:00
return True ;
2000-04-28 22:36:47 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_share_ctr ( const char * desc , SRV_SHARE_INFO_CTR * ctr , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ctr = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_share_ctr " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( UNMARSHALLING ( ps ) ) {
memset ( ctr , ' \0 ' , sizeof ( SRV_SHARE_INFO_CTR ) ) ;
1998-03-12 00:11:04 +03:00
}
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " info_level " , ps , depth , & ctr - > info_level ) )
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & ctr - > switch_value ) )
return False ;
if ( ! prs_uint32 ( " ptr_share_info " , ps , depth , & ctr - > ptr_share_info ) )
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
if ( ctr - > ptr_share_info = = 0 )
return True ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries " , ps , depth , & ctr - > num_entries ) )
return False ;
if ( ! prs_uint32 ( " ptr_entries " , ps , depth , & ctr - > ptr_entries ) )
return False ;
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
if ( ctr - > ptr_entries = = 0 ) {
if ( ctr - > num_entries = = 0 )
return True ;
else
return False ;
}
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries2 " , ps , depth , & ctr - > num_entries2 ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ctr - > num_entries2 ! = ctr - > num_entries )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
switch ( ctr - > switch_value ) {
2002-08-17 21:00:51 +04:00
case 0 :
{
SRV_SHARE_INFO_0 * info0 = ctr - > share . info0 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info0 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_0 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info0 = info0 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info0 ( " " , & info0 [ i ] . info_0 , ps , depth ) )
return False ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
info0 [ i ] . info_0_str . ptrs = & info0 [ i ] . info_0 ;
if ( ! srv_io_share_info0_str ( " " , & info0 [ i ] . info_0_str , ps , depth ) )
return False ;
}
break ;
}
1999-12-13 16:27:58 +03:00
case 1 :
{
SRV_SHARE_INFO_1 * info1 = ctr - > share . info1 ;
int num_entries = ctr - > num_entries ;
int i ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1 , num_entries ) ) )
1999-12-13 16:27:58 +03:00
return False ;
ctr - > share . info1 = info1 ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1 ( " " , & info1 [ i ] . info_1 , ps , depth ) )
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
2002-08-17 21:00:51 +04:00
info1 [ i ] . info_1_str . ptrs = & info1 [ i ] . info_1 ;
1999-12-13 16:27:58 +03:00
if ( ! srv_io_share_info1_str ( " " , & info1 [ i ] . info_1_str , ps , depth ) )
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
break ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
case 2 :
{
SRV_SHARE_INFO_2 * info2 = ctr - > share . info2 ;
int num_entries = ctr - > num_entries ;
int i ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info2 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_2 , num_entries ) ) )
1999-12-13 16:27:58 +03:00
return False ;
ctr - > share . info2 = info2 ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info2 ( " " , & info2 [ i ] . info_2 , ps , depth ) )
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
2002-03-05 05:12:00 +03:00
if ( ! srv_io_share_info2_str ( " " , & info2 [ i ] . info_2 , & info2 [ i ] . info_2_str , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
break ;
1998-03-12 00:11:04 +03:00
}
2002-04-10 05:04:13 +04:00
case 501 :
{
SRV_SHARE_INFO_501 * info501 = ctr - > share . info501 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info501 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_501 , num_entries ) ) )
2002-04-10 05:04:13 +04:00
return False ;
ctr - > share . info501 = info501 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info501 ( " " , & info501 [ i ] . info_501 , ps , depth ) )
return False ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info501_str ( " " , & info501 [ i ] . info_501_str , ps , depth ) )
return False ;
}
break ;
}
2001-04-05 03:42:17 +04:00
case 502 :
{
SRV_SHARE_INFO_502 * info502 = ctr - > share . info502 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info502 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_502 , num_entries ) ) )
2001-04-05 03:42:17 +04:00
return False ;
ctr - > share . info502 = info502 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info502 ( " " , & info502 [ i ] . info_502 , ps , depth ) )
return False ;
2002-08-17 21:00:51 +04:00
}
2001-04-05 03:42:17 +04:00
for ( i = 0 ; i < num_entries ; i + + ) {
2001-05-01 05:01:19 +04:00
info502 [ i ] . info_502_str . ptrs = & info502 [ i ] . info_502 ;
2001-04-05 03:42:17 +04:00
if ( ! srv_io_share_info502_str ( " " , & info502 [ i ] . info_502_str , ps , depth ) )
return False ;
}
break ;
}
2002-08-17 21:00:51 +04:00
case 1004 :
{
SRV_SHARE_INFO_1004 * info1004 = ctr - > share . info1004 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1004 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1004 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info1004 = info1004 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1004 ( " " , & info1004 [ i ] . info_1004 , ps , depth ) )
return False ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
info1004 [ i ] . info_1004_str . ptrs = & info1004 [ i ] . info_1004 ;
if ( ! srv_io_share_info1004_str ( " " , & info1004 [ i ] . info_1004_str , ps , depth ) )
return False ;
}
break ;
}
case 1005 :
{
SRV_SHARE_INFO_1005 * info1005 = ctr - > share . info1005 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1005 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1005 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info1005 = info1005 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1005 ( " " , & info1005 [ i ] , ps , depth ) )
return False ;
}
break ;
}
case 1006 :
{
SRV_SHARE_INFO_1006 * info1006 = ctr - > share . info1006 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1006 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1006 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info1006 = info1006 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1006 ( " " , & info1006 [ i ] , ps , depth ) )
return False ;
}
break ;
}
case 1007 :
{
SRV_SHARE_INFO_1007 * info1007 = ctr - > share . info1007 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1007 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1007 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info1007 = info1007 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1007 ( " " , & info1007 [ i ] . info_1007 , ps , depth ) )
return False ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
info1007 [ i ] . info_1007_str . ptrs = & info1007 [ i ] . info_1007 ;
if ( ! srv_io_share_info1007_str ( " " , & info1007 [ i ] . info_1007_str , ps , depth ) )
return False ;
}
break ;
}
case 1501 :
{
SRV_SHARE_INFO_1501 * info1501 = ctr - > share . info1501 ;
int num_entries = ctr - > num_entries ;
int i ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info1501 = PRS_ALLOC_MEM ( ps , SRV_SHARE_INFO_1501 , num_entries ) ) )
2002-08-17 21:00:51 +04:00
return False ;
ctr - > share . info1501 = info1501 ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_share_info1501 ( " " , & info1501 [ i ] , ps , depth ) )
return False ;
}
break ;
}
1999-12-13 16:27:58 +03:00
default :
DEBUG ( 5 , ( " %s no share info at switch_value %d \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
break ;
}
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_Q_NET_SHARE_ENUM structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_q_net_share_enum ( SRV_Q_NET_SHARE_ENUM * q_n ,
2003-01-03 11:28:12 +03:00
const char * srv_name , uint32 info_level ,
1999-12-13 16:27:58 +03:00
uint32 preferred_len , ENUM_HND * hnd )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_q_net_share_enum \n " ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
q_n - > ctr . info_level = q_n - > ctr . switch_value = info_level ;
2002-07-15 14:35:28 +04:00
q_n - > ctr . ptr_share_info = 1 ;
2002-08-17 21:00:51 +04:00
q_n - > ctr . num_entries = 0 ;
q_n - > ctr . ptr_entries = 0 ;
q_n - > ctr . num_entries2 = 0 ;
1999-12-13 16:27:58 +03:00
q_n - > preferred_len = preferred_len ;
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
memcpy ( & q_n - > enum_hnd , hnd , sizeof ( * hnd ) ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_share_enum ( const char * desc , SRV_Q_NET_SHARE_ENUM * q_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_share_enum " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! srv_io_srv_share_ctr ( " share_ctr " , & q_n - > ctr , ps , depth ) )
return False ;
1998-08-22 06:54:21 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " preferred_len " , ps , depth , & q_n - > preferred_len ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_enum_hnd ( " enum_hnd " , & q_n - > enum_hnd , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_share_enum ( const char * desc , SRV_R_NET_SHARE_ENUM * r_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_r_net_share_enum " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! srv_io_srv_share_ctr ( " share_ctr " , & r_n - > ctr , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " total_entries " , ps , depth , & r_n - > total_entries ) )
return False ;
2002-08-17 21:00:51 +04:00
2002-09-25 19:19:00 +04:00
if ( ! smb_io_enum_hnd ( " enum_hnd " , & r_n - > enum_hnd , ps , depth ) )
return False ;
2002-08-17 21:00:51 +04:00
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
initialises a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL init_srv_q_net_share_get_info ( SRV_Q_NET_SHARE_GET_INFO * q_n , const char * srv_name , const char * share_name , uint32 info_level )
{
uint32 ptr_share_name ;
DEBUG ( 5 , ( " init_srv_q_net_share_get_info \n " ) ) ;
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_share_name , & ptr_share_name , share_name ) ;
q_n - > info_level = info_level ;
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_share_get_info ( const char * desc , SRV_Q_NET_SHARE_GET_INFO * q_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_share_get_info " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1998-08-22 06:54:21 +04:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_share_name , True , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " info_level " , ps , depth , & q_n - > info_level ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_share_info ( const char * desc , prs_struct * ps , int depth , SRV_SHARE_INFO * r_n )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
2001-04-05 03:42:17 +04:00
prs_debug ( ps , depth , desc , " srv_io_srv_share_info " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & r_n - > switch_value ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_share_ctr " , ps , depth , & r_n - > ptr_share_ctr ) )
return False ;
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
if ( r_n - > ptr_share_ctr ! = 0 ) {
switch ( r_n - > switch_value ) {
2002-08-17 21:00:51 +04:00
case 0 :
if ( ! srv_io_share_info0 ( " " , & r_n - > share . info0 . info_0 , ps , depth ) )
return False ;
/* allow access to pointers in the str part. */
r_n - > share . info0 . info_0_str . ptrs = & r_n - > share . info0 . info_0 ;
if ( ! srv_io_share_info0_str ( " " , & r_n - > share . info0 . info_0_str , ps , depth ) )
return False ;
break ;
1999-12-13 16:27:58 +03:00
case 1 :
if ( ! srv_io_share_info1 ( " " , & r_n - > share . info1 . info_1 , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
2002-08-17 21:00:51 +04:00
/* allow access to pointers in the str part. */
r_n - > share . info1 . info_1_str . ptrs = & r_n - > share . info1 . info_1 ;
1999-12-13 16:27:58 +03:00
if ( ! srv_io_share_info1_str ( " " , & r_n - > share . info1 . info_1_str , ps , depth ) )
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
break ;
case 2 :
if ( ! srv_io_share_info2 ( " " , & r_n - > share . info2 . info_2 , ps , depth ) )
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
2002-03-05 05:12:00 +03:00
if ( ! srv_io_share_info2_str ( " " , & r_n - > share . info2 . info_2 , & r_n - > share . info2 . info_2_str , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
break ;
2002-04-10 05:04:13 +04:00
case 501 :
if ( ! srv_io_share_info501 ( " " , & r_n - > share . info501 . info_501 , ps , depth ) )
return False ;
if ( ! srv_io_share_info501_str ( " " , & r_n - > share . info501 . info_501_str , ps , depth ) )
return False ;
break ;
2001-04-05 03:42:17 +04:00
case 502 :
if ( ! srv_io_share_info502 ( " " , & r_n - > share . info502 . info_502 , ps , depth ) )
return False ;
2002-08-17 21:00:51 +04:00
/* allow access to pointers in the str part. */
2001-05-01 05:01:19 +04:00
r_n - > share . info502 . info_502_str . ptrs = & r_n - > share . info502 . info_502 ;
2001-04-05 03:42:17 +04:00
if ( ! srv_io_share_info502_str ( " " , & r_n - > share . info502 . info_502_str , ps , depth ) )
return False ;
break ;
2002-08-17 21:00:51 +04:00
case 1004 :
if ( ! srv_io_share_info1004 ( " " , & r_n - > share . info1004 . info_1004 , ps , depth ) )
return False ;
/* allow access to pointers in the str part. */
r_n - > share . info1004 . info_1004_str . ptrs = & r_n - > share . info1004 . info_1004 ;
if ( ! srv_io_share_info1004_str ( " " , & r_n - > share . info1004 . info_1004_str , ps , depth ) )
return False ;
break ;
2000-04-28 22:36:47 +04:00
case 1005 :
2001-04-09 12:00:19 +04:00
if ( ! srv_io_share_info1005 ( " " , & r_n - > share . info1005 , ps , depth ) )
return False ;
break ;
2002-08-17 21:00:51 +04:00
case 1006 :
if ( ! srv_io_share_info1006 ( " " , & r_n - > share . info1006 , ps , depth ) )
return False ;
break ;
case 1007 :
if ( ! srv_io_share_info1007 ( " " , & r_n - > share . info1007 . info_1007 , ps , depth ) )
return False ;
/* allow access to pointers in the str part. */
r_n - > share . info1007 . info_1007_str . ptrs = & r_n - > share . info1007 . info_1007 ;
if ( ! srv_io_share_info1007_str ( " " , & r_n - > share . info1007 . info_1007_str , ps , depth ) )
return False ;
break ;
2001-04-09 12:00:19 +04:00
case 1501 :
if ( ! srv_io_share_info1501 ( " " , & r_n - > share . info1501 , ps , depth ) )
return False ;
1999-12-13 16:27:58 +03:00
default :
2000-04-28 22:36:47 +04:00
DEBUG ( 5 , ( " %s no share info at switch_value %d \n " ,
1999-12-13 16:27:58 +03:00
tab_depth ( depth ) , r_n - > switch_value ) ) ;
break ;
}
}
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
2001-04-05 03:42:17 +04:00
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_share_get_info ( const char * desc , SRV_R_NET_SHARE_GET_INFO * r_n , prs_struct * ps , int depth )
2001-04-05 03:42:17 +04:00
{
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_share_get_info " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! srv_io_srv_share_info ( " info " , ps , depth , & r_n - > info ) )
return False ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
2002-03-05 05:12:00 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
intialises a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL init_srv_q_net_share_set_info ( SRV_Q_NET_SHARE_SET_INFO * q_n ,
const char * srv_name ,
const char * share_name ,
uint32 info_level ,
const SRV_SHARE_INFO * info )
{
uint32 ptr_share_name ;
DEBUG ( 5 , ( " init_srv_q_net_share_set_info \n " ) ) ;
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_share_name , & ptr_share_name , share_name ) ;
q_n - > info_level = info_level ;
q_n - > info = * info ;
q_n - > ptr_parm_error = 1 ;
q_n - > parm_error = 0 ;
return True ;
}
2001-04-05 03:42:17 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_share_set_info ( const char * desc , SRV_Q_NET_SHARE_SET_INFO * q_n , prs_struct * ps , int depth )
2001-04-05 03:42:17 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_share_set_info " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_share_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " info_level " , ps , depth , & q_n - > info_level ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! srv_io_srv_share_info ( " info " , ps , depth , & q_n - > info ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_parm_error " , ps , depth , & q_n - > ptr_parm_error ) )
return False ;
if ( q_n - > ptr_parm_error ! = 0 ) {
if ( ! prs_uint32 ( " parm_error " , ps , depth , & q_n - > parm_error ) )
return False ;
}
2001-04-05 03:42:17 +04:00
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_share_set_info ( const char * desc , SRV_R_NET_SHARE_SET_INFO * r_n , prs_struct * ps , int depth )
2001-04-05 03:42:17 +04:00
{
2002-08-17 21:00:51 +04:00
if ( r_n = = NULL )
2001-04-05 03:42:17 +04:00
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_share_set_info " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " ptr_parm_error " , ps , depth , & r_n - > ptr_parm_error ) )
2001-04-05 03:42:17 +04:00
return False ;
2002-08-17 21:00:51 +04:00
if ( r_n - > ptr_parm_error ) {
if ( ! prs_uint32 ( " parm_error " , ps , depth , & r_n - > parm_error ) )
return False ;
}
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-04-05 03:42:17 +04:00
return False ;
return True ;
}
2002-08-17 21:00:51 +04:00
2001-04-06 21:41:47 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_share_add ( const char * desc , SRV_Q_NET_SHARE_ADD * q_n , prs_struct * ps , int depth )
2001-04-06 21:41:47 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_share_add " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " info_level " , ps , depth , & q_n - > info_level ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! srv_io_srv_share_info ( " info " , ps , depth , & q_n - > info ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_align ( ps ) )
return False ;
2002-07-15 14:35:28 +04:00
if ( ! prs_uint32 ( " ptr_err_index " , ps , depth , & q_n - > ptr_err_index ) )
return False ;
if ( q_n - > ptr_err_index )
if ( ! prs_uint32 ( " err_index " , ps , depth , & q_n - > err_index ) )
return False ;
2001-04-06 21:41:47 +04:00
return True ;
}
2003-01-03 11:28:12 +03:00
void init_srv_q_net_share_add ( SRV_Q_NET_SHARE_ADD * q , const char * srvname ,
const char * netname , uint32 type , const char * remark ,
2002-07-15 14:35:28 +04:00
uint32 perms , uint32 max_uses , uint32 num_uses ,
2004-08-10 18:27:17 +04:00
const char * path , const char * passwd ,
int level , SEC_DESC * sd )
2002-07-15 14:35:28 +04:00
{
2004-08-10 18:27:17 +04:00
switch ( level ) {
case 502 : {
size_t sd_size = sec_desc_size ( sd ) ;
q - > ptr_srv_name = 1 ;
init_unistr2 ( & q - > uni_srv_name , srvname , UNI_STR_TERMINATE ) ;
q - > info . switch_value = q - > info_level = level ;
q - > info . ptr_share_ctr = 1 ;
init_srv_share_info502 ( & q - > info . share . info502 . info_502 , netname , type ,
remark , perms , max_uses , num_uses , path , passwd , sd , sd_size ) ;
init_srv_share_info502_str ( & q - > info . share . info502 . info_502_str , netname ,
remark , path , passwd , sd , sd_size ) ;
q - > ptr_err_index = 1 ;
q - > err_index = 0 ;
}
break ;
case 2 :
default :
q - > ptr_srv_name = 1 ;
init_unistr2 ( & q - > uni_srv_name , srvname , UNI_STR_TERMINATE ) ;
q - > info . switch_value = q - > info_level = level ;
q - > info . ptr_share_ctr = 1 ;
init_srv_share_info2 ( & q - > info . share . info2 . info_2 , netname , type ,
remark , perms , max_uses , num_uses , path , passwd ) ;
init_srv_share_info2_str ( & q - > info . share . info2 . info_2_str , netname ,
remark , path , passwd ) ;
q - > ptr_err_index = 1 ;
q - > err_index = 0 ;
break ;
}
2002-07-15 14:35:28 +04:00
}
2001-04-06 21:41:47 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_share_add ( const char * desc , SRV_R_NET_SHARE_ADD * r_n , prs_struct * ps , int depth )
2001-04-06 21:41:47 +04:00
{
2002-08-17 21:00:51 +04:00
if ( r_n = = NULL )
2001-04-06 21:41:47 +04:00
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_share_add " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " ptr_parm_error " , ps , depth , & r_n - > ptr_parm_error ) )
2001-04-06 21:41:47 +04:00
return False ;
2002-08-17 21:00:51 +04:00
if ( r_n - > ptr_parm_error ) {
if ( ! prs_uint32 ( " parm_error " , ps , depth , & r_n - > parm_error ) )
return False ;
}
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-04-06 21:41:47 +04:00
return False ;
return True ;
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
initialises a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2002-07-15 14:35:28 +04:00
void init_srv_q_net_share_del ( SRV_Q_NET_SHARE_DEL * del , const char * srvname ,
const char * sharename )
{
del - > ptr_srv_name = 1 ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & del - > uni_srv_name , srvname , UNI_STR_TERMINATE ) ;
init_unistr2 ( & del - > uni_share_name , sharename , UNI_STR_TERMINATE ) ;
2002-07-15 14:35:28 +04:00
}
2001-04-06 22:25:17 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_share_del ( const char * desc , SRV_Q_NET_SHARE_DEL * q_n , prs_struct * ps , int depth )
2001-04-06 22:25:17 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_share_del " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_share_name , True , ps , depth ) )
return False ;
2002-07-15 14:35:28 +04:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " reserved " , ps , depth , & q_n - > reserved ) )
return False ;
2001-04-06 22:25:17 +04:00
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_share_del ( const char * desc , SRV_R_NET_SHARE_DEL * q_n , prs_struct * ps , int depth )
2001-04-06 22:25:17 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_share_del " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & q_n - > status ) )
2001-04-06 22:25:17 +04:00
return False ;
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SESS_INFO_0_STR structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_sess_info0_str ( SESS_INFO_0_STR * ss0 , const char * name )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_sess_info0_str \n " ) ) ;
1999-10-15 22:46:22 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & ss0 - > uni_name , name , UNI_STR_TERMINATE ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_sess_info0_str ( const char * desc , SESS_INFO_0_STR * ss0 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss0 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_sess_info0_str " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " " , & ss0 - > uni_name , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SESS_INFO_0 structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_sess_info0 ( SESS_INFO_0 * ss0 , const char * name )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_sess_info0: %s \n " , name ) ) ;
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
ss0 - > ptr_name = ( name ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_sess_info0 ( const char * desc , SESS_INFO_0 * ss0 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss0 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_sess_info0 " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_name " , ps , depth , & ss0 - > ptr_name ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_sess_info_0 ( const char * desc , SRV_SESS_INFO_0 * ss0 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss0 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_sess_info_0 " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries_read " , ps , depth , & ss0 - > num_entries_read ) )
return False ;
if ( ! prs_uint32 ( " ptr_sess_info " , ps , depth , & ss0 - > ptr_sess_info ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ss0 - > ptr_sess_info ! = 0 ) {
2003-03-18 02:04:03 +03:00
uint32 i ;
uint32 num_entries = ss0 - > num_entries_read ;
1999-12-13 16:27:58 +03:00
if ( num_entries > MAX_SESS_ENTRIES ) {
num_entries = MAX_SESS_ENTRIES ; /* report this! */
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries_read2 " , ps , depth , & ss0 - > num_entries_read2 ) )
return False ;
SMB_ASSERT_ARRAY ( ss0 - > info_0 , num_entries ) ;
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_sess_info0 ( " " , & ss0 - > info_0 [ i ] , ps , depth ) )
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_sess_info0_str ( " " , & ss0 - > info_0_str [ i ] , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SESS_INFO_1_STR structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_sess_info1_str ( SESS_INFO_1_STR * ss1 , const char * name , const char * user )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_sess_info1_str \n " ) ) ;
1999-10-15 22:46:22 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & ss1 - > uni_name , name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & ss1 - > uni_user , user , UNI_STR_TERMINATE ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_sess_info1_str ( const char * desc , SESS_INFO_1_STR * ss1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss1 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_sess_info1_str " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " " , & ss1 - > uni_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & ( ss1 - > uni_user ) , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SESS_INFO_1 structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_sess_info1 ( SESS_INFO_1 * ss1 ,
2003-01-03 11:28:12 +03:00
const char * name , const char * user ,
1999-12-13 16:27:58 +03:00
uint32 num_opens , uint32 open_time , uint32 idle_time ,
uint32 user_flags )
{
DEBUG ( 5 , ( " init_srv_sess_info1: %s \n " , name ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
ss1 - > ptr_name = ( name ! = NULL ) ? 1 : 0 ;
ss1 - > ptr_user = ( user ! = NULL ) ? 1 : 0 ;
1999-10-15 22:46:22 +04:00
1999-12-13 16:27:58 +03:00
ss1 - > num_opens = num_opens ;
ss1 - > open_time = open_time ;
ss1 - > idle_time = idle_time ;
ss1 - > user_flags = user_flags ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_sess_info1 ( const char * desc , SESS_INFO_1 * ss1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss1 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_sess_info1 " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_name " , ps , depth , & ss1 - > ptr_name ) )
return False ;
if ( ! prs_uint32 ( " ptr_user " , ps , depth , & ss1 - > ptr_user ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_opens " , ps , depth , & ss1 - > num_opens ) )
return False ;
if ( ! prs_uint32 ( " open_time " , ps , depth , & ss1 - > open_time ) )
return False ;
if ( ! prs_uint32 ( " idle_time " , ps , depth , & ss1 - > idle_time ) )
return False ;
if ( ! prs_uint32 ( " user_flags " , ps , depth , & ss1 - > user_flags ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_sess_info_1 ( const char * desc , SRV_SESS_INFO_1 * ss1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ss1 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_sess_info_1 " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries_read " , ps , depth , & ss1 - > num_entries_read ) )
return False ;
if ( ! prs_uint32 ( " ptr_sess_info " , ps , depth , & ss1 - > ptr_sess_info ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ss1 - > ptr_sess_info ! = 0 ) {
2003-03-18 02:04:03 +03:00
uint32 i ;
uint32 num_entries = ss1 - > num_entries_read ;
1999-12-13 16:27:58 +03:00
if ( num_entries > MAX_SESS_ENTRIES ) {
num_entries = MAX_SESS_ENTRIES ; /* report this! */
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries_read2 " , ps , depth , & ss1 - > num_entries_read2 ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
SMB_ASSERT_ARRAY ( ss1 - > info_1 , num_entries ) ;
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_sess_info1 ( " " , & ss1 - > info_1 [ i ] , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_sess_info1_str ( " " , & ss1 - > info_1_str [ i ] , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_sess_ctr ( const char * desc , SRV_SESS_INFO_CTR * * pp_ctr , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
2001-02-27 01:05:41 +03:00
SRV_SESS_INFO_CTR * ctr = * pp_ctr ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_sess_ctr " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
2001-02-27 01:05:41 +03:00
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
ctr = * pp_ctr = PRS_ALLOC_MEM ( ps , SRV_SESS_INFO_CTR , 1 ) ;
2001-02-27 01:05:41 +03:00
if ( ctr = = NULL )
return False ;
}
if ( ctr = = NULL )
return False ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & ctr - > switch_value ) )
return False ;
if ( ! prs_uint32 ( " ptr_sess_ctr " , ps , depth , & ctr - > ptr_sess_ctr ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ctr - > ptr_sess_ctr ! = 0 ) {
switch ( ctr - > switch_value ) {
case 0 :
if ( ! srv_io_srv_sess_info_0 ( " " , & ctr - > sess . info0 , ps , depth ) )
return False ;
break ;
case 1 :
if ( ! srv_io_srv_sess_info_1 ( " " , & ctr - > sess . info1 , ps , depth ) )
return False ;
break ;
default :
DEBUG ( 5 , ( " %s no session info at switch_value %d \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
break ;
1998-03-12 00:11:04 +03:00
}
}
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_Q_NET_SESS_ENUM structure .
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_q_net_sess_enum ( SRV_Q_NET_SESS_ENUM * q_n ,
2003-01-03 11:28:12 +03:00
const char * srv_name , const char * qual_name ,
const char * user_name , uint32 sess_level ,
2002-07-15 14:35:28 +04:00
SRV_SESS_INFO_CTR * ctr , uint32 preferred_len ,
ENUM_HND * hnd )
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
{
q_n - > ctr = ctr ;
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_q_net_sess_enum \n " ) ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_qual_name , & q_n - > ptr_qual_name , qual_name ) ;
2002-07-15 14:35:28 +04:00
init_buf_unistr2 ( & q_n - > uni_user_name , & q_n - > ptr_user_name , user_name ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
q_n - > sess_level = sess_level ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
q_n - > preferred_len = preferred_len ;
1999-12-13 16:27:58 +03:00
memcpy ( & q_n - > enum_hnd , hnd , sizeof ( * hnd ) ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_sess_enum ( const char * desc , SRV_Q_NET_SESS_ENUM * q_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_sess_enum " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_qual_name " , ps , depth , & q_n - > ptr_qual_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_qual_name , q_n - > ptr_qual_name , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
2002-07-15 14:35:28 +04:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_user_name " , ps , depth , & q_n - > ptr_user_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_user_name , q_n - > ptr_user_name , ps , depth ) )
return False ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " sess_level " , ps , depth , & q_n - > sess_level ) )
return False ;
1998-03-12 00:11:04 +03:00
2003-03-18 02:04:03 +03:00
if ( q_n - > sess_level ! = ( uint32 ) - 1 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_sess_ctr ( " sess_ctr " , & q_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " preferred_len " , ps , depth , & q_n - > preferred_len ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_enum_hnd ( " enum_hnd " , & q_n - > enum_hnd , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_sess_enum ( const char * desc , SRV_R_NET_SESS_ENUM * r_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_r_net_sess_enum " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " sess_level " , ps , depth , & r_n - > sess_level ) )
return False ;
1998-03-12 00:11:04 +03:00
2003-03-18 02:04:03 +03:00
if ( r_n - > sess_level ! = ( uint32 ) - 1 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_sess_ctr ( " sess_ctr " , & r_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " total_entries " , ps , depth , & r_n - > total_entries ) )
return False ;
if ( ! smb_io_enum_hnd ( " enum_hnd " , & r_n - > enum_hnd , ps , depth ) )
return False ;
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
2005-03-23 23:57:03 +03:00
/*******************************************************************
Inits a SRV_Q_NET_SESS_DEL structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_q_net_sess_del ( SRV_Q_NET_SESS_DEL * q_n , const char * srv_name ,
const char * cli_name , const char * user_name )
{
DEBUG ( 5 , ( " init_q_net_sess_enum \n " ) ) ;
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_cli_name , & q_n - > ptr_cli_name , cli_name ) ;
init_buf_unistr2 ( & q_n - > uni_user_name , & q_n - > ptr_user_name , user_name ) ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL srv_io_q_net_sess_del ( const char * desc , SRV_Q_NET_SESS_DEL * q_n , prs_struct * ps , int depth )
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_sess_del " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_cli_name " , ps , depth , & q_n - > ptr_cli_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_cli_name , q_n - > ptr_cli_name , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_user_name " , ps , depth , & q_n - > ptr_user_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_user_name , q_n - > ptr_user_name , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL srv_io_r_net_sess_del ( const char * desc , SRV_R_NET_SESS_DEL * r_n , prs_struct * ps , int depth )
{
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_sess_del " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
return False ;
return True ;
}
1999-10-31 02:34:38 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a CONN_INFO_0 structure
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_conn_info0 ( CONN_INFO_0 * ss0 , uint32 id )
{
DEBUG ( 5 , ( " init_srv_conn_info0 \n " ) ) ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
ss0 - > id = id ;
1999-10-31 02:34:38 +04:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_conn_info0 ( const char * desc , CONN_INFO_0 * ss0 , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( ss0 = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_conn_info0 " ) ;
1999-10-31 02:34:38 +04:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " id " , ps , depth , & ss0 - > id ) )
return False ;
1999-10-31 02:34:38 +04:00
return True ;
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_conn_info_0 ( const char * desc , SRV_CONN_INFO_0 * ss0 , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( ss0 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_srv_conn_info_0 " ) ;
depth + + ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " num_entries_read " , ps , depth , & ss0 - > num_entries_read ) )
return False ;
if ( ! prs_uint32 ( " ptr_conn_info " , ps , depth , & ss0 - > ptr_conn_info ) )
return False ;
if ( ss0 - > ptr_conn_info ! = 0 ) {
int i ;
int num_entries = ss0 - > num_entries_read ;
if ( num_entries > MAX_CONN_ENTRIES ) {
num_entries = MAX_CONN_ENTRIES ; /* report this! */
}
if ( ! prs_uint32 ( " num_entries_read2 " , ps , depth , & ss0 - > num_entries_read2 ) )
return False ;
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_conn_info0 ( " " , & ss0 - > info_0 [ i ] , ps , depth ) )
return False ;
}
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
}
1999-10-31 02:34:38 +04:00
return True ;
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a CONN_INFO_1_STR structure
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_conn_info1_str ( CONN_INFO_1_STR * ss1 , const char * usr_name , const char * net_name )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_conn_info1_str \n " ) ) ;
1999-10-31 02:34:38 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & ss1 - > uni_usr_name , usr_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & ss1 - > uni_net_name , net_name , UNI_STR_TERMINATE ) ;
1999-10-31 02:34:38 +04:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_conn_info1_str ( const char * desc , CONN_INFO_1_STR * ss1 , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( ss1 = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_conn_info1_str " ) ;
1999-10-31 02:34:38 +04:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " " , & ss1 - > uni_usr_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & ss1 - > uni_net_name , True , ps , depth ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
return True ;
}
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
/*******************************************************************
Inits a CONN_INFO_1 structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
void init_srv_conn_info1 ( CONN_INFO_1 * ss1 ,
uint32 id , uint32 type ,
uint32 num_opens , uint32 num_users , uint32 open_time ,
2003-01-03 11:28:12 +03:00
const char * usr_name , const char * net_name )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_conn_info1: %s %s \n " , usr_name , net_name ) ) ;
1999-11-04 00:51:29 +03:00
1999-12-13 16:27:58 +03:00
ss1 - > id = id ;
ss1 - > type = type ;
ss1 - > num_opens = num_opens ;
ss1 - > num_users = num_users ;
ss1 - > open_time = open_time ;
1999-11-04 00:51:29 +03:00
1999-12-13 16:27:58 +03:00
ss1 - > ptr_usr_name = ( usr_name ! = NULL ) ? 1 : 0 ;
ss1 - > ptr_net_name = ( net_name ! = NULL ) ? 1 : 0 ;
}
1999-11-04 00:51:29 +03:00
1999-12-13 16:27:58 +03:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-10-31 02:34:38 +04:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_conn_info1 ( const char * desc , CONN_INFO_1 * ss1 , prs_struct * ps , int depth )
1999-12-13 16:27:58 +03:00
{
if ( ss1 = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_conn_info1 " ) ;
depth + + ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " id " , ps , depth , & ss1 - > id ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & ss1 - > type ) )
return False ;
if ( ! prs_uint32 ( " num_opens " , ps , depth , & ss1 - > num_opens ) )
return False ;
if ( ! prs_uint32 ( " num_users " , ps , depth , & ss1 - > num_users ) )
return False ;
if ( ! prs_uint32 ( " open_time " , ps , depth , & ss1 - > open_time ) )
return False ;
if ( ! prs_uint32 ( " ptr_usr_name " , ps , depth , & ss1 - > ptr_usr_name ) )
return False ;
if ( ! prs_uint32 ( " ptr_net_name " , ps , depth , & ss1 - > ptr_net_name ) )
return False ;
1999-11-04 00:51:29 +03:00
1999-10-31 02:34:38 +04:00
return True ;
}
1999-11-04 00:51:29 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-11-04 00:51:29 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_conn_info_1 ( const char * desc , SRV_CONN_INFO_1 * ss1 , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( ss1 = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_conn_info_1 " ) ;
1999-10-31 02:34:38 +04:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " num_entries_read " , ps , depth , & ss1 - > num_entries_read ) )
return False ;
if ( ! prs_uint32 ( " ptr_conn_info " , ps , depth , & ss1 - > ptr_conn_info ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ss1 - > ptr_conn_info ! = 0 ) {
int i ;
int num_entries = ss1 - > num_entries_read ;
if ( num_entries > MAX_CONN_ENTRIES ) {
num_entries = MAX_CONN_ENTRIES ; /* report this! */
}
if ( ! prs_uint32 ( " num_entries_read2 " , ps , depth , & ss1 - > num_entries_read2 ) )
return False ;
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_conn_info1 ( " " , & ss1 - > info_1 [ i ] , ps , depth ) )
return False ;
}
for ( i = 0 ; i < num_entries ; i + + ) {
if ( ! srv_io_conn_info1_str ( " " , & ss1 - > info_1_str [ i ] , ps , depth ) )
return False ;
1999-10-31 02:34:38 +04:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
}
return True ;
}
1999-11-04 00:51:29 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-11-04 00:51:29 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_conn_ctr ( const char * desc , SRV_CONN_INFO_CTR * * pp_ctr , prs_struct * ps , int depth )
1999-11-04 00:51:29 +03:00
{
2001-02-27 01:05:41 +03:00
SRV_CONN_INFO_CTR * ctr = * pp_ctr ;
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_srv_conn_ctr " ) ;
depth + + ;
2001-02-27 01:05:41 +03:00
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
ctr = * pp_ctr = PRS_ALLOC_MEM ( ps , SRV_CONN_INFO_CTR , 1 ) ;
2001-02-27 01:05:41 +03:00
if ( ctr = = NULL )
return False ;
}
if ( ctr = = NULL )
return False ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " switch_value " , ps , depth , & ctr - > switch_value ) )
return False ;
if ( ! prs_uint32 ( " ptr_conn_ctr " , ps , depth , & ctr - > ptr_conn_ctr ) )
return False ;
if ( ctr - > ptr_conn_ctr ! = 0 ) {
switch ( ctr - > switch_value ) {
1999-11-04 00:51:29 +03:00
case 0 :
1999-12-13 16:27:58 +03:00
if ( ! srv_io_srv_conn_info_0 ( " " , & ctr - > conn . info0 , ps , depth ) )
return False ;
break ;
case 1 :
if ( ! srv_io_srv_conn_info_1 ( " " , & ctr - > conn . info1 , ps , depth ) )
return False ;
1999-11-04 00:51:29 +03:00
break ;
default :
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " %s no connection info at switch_value %d \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
1999-11-04 00:51:29 +03:00
break ;
}
}
1999-12-13 16:27:58 +03:00
return True ;
1999-11-04 00:51:29 +03:00
}
1999-10-31 02:34:38 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_q_net_conn_enum ( SRV_Q_NET_CONN_ENUM * q_n ,
2003-01-03 11:28:12 +03:00
const char * srv_name , const char * qual_name ,
1999-12-13 16:27:58 +03:00
uint32 conn_level , SRV_CONN_INFO_CTR * ctr ,
1999-10-31 02:34:38 +04:00
uint32 preferred_len ,
ENUM_HND * hnd )
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_q_net_conn_enum \n " ) ) ;
1999-10-31 02:34:38 +04:00
q_n - > ctr = ctr ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_qual_name , & q_n - > ptr_qual_name , qual_name ) ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
q_n - > conn_level = conn_level ;
1999-10-31 02:34:38 +04:00
q_n - > preferred_len = preferred_len ;
1999-12-13 16:27:58 +03:00
memcpy ( & q_n - > enum_hnd , hnd , sizeof ( * hnd ) ) ;
1999-10-31 02:34:38 +04:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_conn_enum ( const char * desc , SRV_Q_NET_CONN_ENUM * q_n , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_conn_enum " ) ;
1999-10-31 02:34:38 +04:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , q_n - > ptr_srv_name , ps , depth ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_qual_name " , ps , depth , & q_n - > ptr_qual_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_qual_name , q_n - > ptr_qual_name , ps , depth ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " conn_level " , ps , depth , & q_n - > conn_level ) )
return False ;
1999-10-31 02:34:38 +04:00
2003-03-18 02:04:03 +03:00
if ( q_n - > conn_level ! = ( uint32 ) - 1 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_conn_ctr ( " conn_ctr " , & q_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-31 02:34:38 +04:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " preferred_len " , ps , depth , & q_n - > preferred_len ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_enum_hnd ( " enum_hnd " , & q_n - > enum_hnd , ps , depth ) )
return False ;
1999-10-31 02:34:38 +04:00
return True ;
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1999-10-31 02:34:38 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_conn_enum ( const char * desc , SRV_R_NET_CONN_ENUM * r_n , prs_struct * ps , int depth )
1999-10-31 02:34:38 +04:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
prs_debug ( ps , depth , desc , " srv_io_r_net_conn_enum " ) ;
1999-10-31 02:34:38 +04:00
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1999-10-31 02:34:38 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " conn_level " , ps , depth , & r_n - > conn_level ) )
return False ;
1999-10-31 02:34:38 +04:00
2003-03-18 02:04:03 +03:00
if ( r_n - > conn_level ! = ( uint32 ) - 1 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_conn_ctr ( " conn_ctr " , & r_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-31 02:34:38 +04:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " total_entries " , ps , depth , & r_n - > total_entries ) )
return False ;
if ( ! smb_io_enum_hnd ( " enum_hnd " , & r_n - > enum_hnd , ps , depth ) )
return False ;
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-31 02:34:38 +04:00
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a FILE_INFO_3_STR structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_file_info3_str ( FILE_INFO_3_STR * fi3 , const char * user_name , const char * path_name )
1999-12-13 16:27:58 +03:00
{
DEBUG ( 5 , ( " init_srv_file_info3_str \n " ) ) ;
1999-10-15 22:46:22 +04:00
2003-09-26 01:26:16 +04:00
init_unistr2 ( & fi3 - > uni_path_name , path_name , UNI_STR_TERMINATE ) ;
init_unistr2 ( & fi3 - > uni_user_name , user_name , UNI_STR_TERMINATE ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_file_info3_str ( const char * desc , FILE_INFO_3_STR * sh1 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sh1 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_file_info3_str " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " " , & sh1 - > uni_path_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & sh1 - > uni_user_name , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a FILE_INFO_3 structure
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_file_info3 ( FILE_INFO_3 * fl3 ,
2002-08-17 21:00:51 +04:00
uint32 id , uint32 perms , uint32 num_locks ,
2003-01-03 11:28:12 +03:00
const char * path_name , const char * user_name )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_file_info3: %s %s \n " , path_name , user_name ) ) ;
1998-03-12 00:11:04 +03:00
fl3 - > id = id ;
fl3 - > perms = perms ;
fl3 - > num_locks = num_locks ;
1999-12-13 16:27:58 +03:00
fl3 - > ptr_path_name = ( path_name ! = NULL ) ? 1 : 0 ;
fl3 - > ptr_user_name = ( user_name ! = NULL ) ? 1 : 0 ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_file_info3 ( const char * desc , FILE_INFO_3 * fl3 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( fl3 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_file_info3 " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " id " , ps , depth , & fl3 - > id ) )
return False ;
if ( ! prs_uint32 ( " perms " , ps , depth , & fl3 - > perms ) )
return False ;
if ( ! prs_uint32 ( " num_locks " , ps , depth , & fl3 - > num_locks ) )
return False ;
if ( ! prs_uint32 ( " ptr_path_name " , ps , depth , & fl3 - > ptr_path_name ) )
return False ;
if ( ! prs_uint32 ( " ptr_user_name " , ps , depth , & fl3 - > ptr_user_name ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_srv_file_ctr ( const char * desc , SRV_FILE_INFO_CTR * ctr , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
2002-07-15 14:35:28 +04:00
if ( ctr = = NULL )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
2002-07-15 14:35:28 +04:00
prs_debug ( ps , depth , desc , " srv_io_srv_file_ctr " ) ;
1998-03-12 00:11:04 +03:00
depth + + ;
2002-07-15 14:35:28 +04:00
if ( UNMARSHALLING ( ps ) ) {
memset ( ctr , ' \0 ' , sizeof ( SRV_FILE_INFO_CTR ) ) ;
}
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
2002-07-15 14:35:28 +04:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & ctr - > switch_value ) )
1999-12-13 16:27:58 +03:00
return False ;
2002-07-15 14:35:28 +04:00
if ( ctr - > switch_value ! = 3 ) {
DEBUG ( 5 , ( " %s File info %d level not supported \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
}
if ( ! prs_uint32 ( " ptr_file_info " , ps , depth , & ctr - > ptr_file_info ) )
return False ;
if ( ! prs_uint32 ( " num_entries " , ps , depth , & ctr - > num_entries ) )
return False ;
if ( ! prs_uint32 ( " ptr_entries " , ps , depth , & ctr - > ptr_entries ) )
return False ;
if ( ctr - > ptr_entries = = 0 )
return True ;
if ( ! prs_uint32 ( " num_entries2 " , ps , depth ,
& ctr - > num_entries2 ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-25 23:03:27 +04:00
2002-07-15 14:35:28 +04:00
switch ( ctr - > switch_value ) {
case 3 : {
SRV_FILE_INFO_3 * info3 = ctr - > file . info3 ;
int num_entries = ctr - > num_entries ;
1999-12-13 16:27:58 +03:00
int i ;
2002-07-15 14:35:28 +04:00
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
if ( ! ( info3 = PRS_ALLOC_MEM ( ps , SRV_FILE_INFO_3 , num_entries ) ) )
2002-07-15 14:35:28 +04:00
return False ;
ctr - > file . info3 = info3 ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
2002-07-15 14:35:28 +04:00
if ( ! srv_io_file_info3 ( " " , & ctr - > file . info3 [ i ] . info_3 , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_entries ; i + + ) {
2002-07-15 14:35:28 +04:00
if ( ! srv_io_file_info3_str ( " " , & ctr - > file . info3 [ i ] . info_3_str , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
2002-07-15 14:35:28 +04:00
break ;
2001-02-27 01:05:41 +03:00
}
2002-07-15 14:35:28 +04:00
default :
DEBUG ( 5 , ( " %s no file info at switch_value %d \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
break ;
1998-03-12 00:11:04 +03:00
}
2002-07-15 14:35:28 +04:00
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_Q_NET_FILE_ENUM structure .
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_q_net_file_enum ( SRV_Q_NET_FILE_ENUM * q_n ,
2002-08-17 21:00:51 +04:00
const char * srv_name , const char * qual_name ,
const char * user_name ,
2002-07-15 14:35:28 +04:00
uint32 file_level , SRV_FILE_INFO_CTR * ctr ,
uint32 preferred_len ,
ENUM_HND * hnd )
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_q_net_file_enum \n " ) ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_qual_name , & q_n - > ptr_qual_name , qual_name ) ;
2002-07-15 14:35:28 +04:00
init_buf_unistr2 ( & q_n - > uni_user_name , & q_n - > ptr_user_name , user_name ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
2002-07-15 14:35:28 +04:00
q_n - > file_level = q_n - > ctr . switch_value = file_level ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
q_n - > preferred_len = preferred_len ;
2002-07-15 14:35:28 +04:00
q_n - > ctr . ptr_file_info = 1 ;
q_n - > ctr . num_entries = 0 ;
q_n - > ctr . num_entries2 = 0 ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
memcpy ( & q_n - > enum_hnd , hnd , sizeof ( * hnd ) ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_file_enum ( const char * desc , SRV_Q_NET_FILE_ENUM * q_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_file_enum " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_qual_name " , ps , depth , & q_n - > ptr_qual_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_qual_name , q_n - > ptr_qual_name , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
2002-07-15 14:35:28 +04:00
if ( ! prs_uint32 ( " ptr_user_name " , ps , depth , & q_n - > ptr_user_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_user_name , q_n - > ptr_user_name , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " file_level " , ps , depth , & q_n - > file_level ) )
return False ;
1998-03-12 00:11:04 +03:00
2003-03-18 02:04:03 +03:00
if ( q_n - > file_level ! = ( uint32 ) - 1 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_file_ctr ( " file_ctr " , & q_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " preferred_len " , ps , depth , & q_n - > preferred_len ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_enum_hnd ( " enum_hnd " , & q_n - > enum_hnd , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_file_enum ( const char * desc , SRV_R_NET_FILE_ENUM * r_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_r_net_file_enum " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " file_level " , ps , depth , & r_n - > file_level ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( r_n - > file_level ! = 0 ) {
2001-02-27 01:05:41 +03:00
if ( ! srv_io_srv_file_ctr ( " file_ctr " , & r_n - > ctr , ps , depth ) )
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " total_entries " , ps , depth , & r_n - > total_entries ) )
return False ;
if ( ! smb_io_enum_hnd ( " enum_hnd " , & r_n - > enum_hnd , ps , depth ) )
return False ;
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
2002-07-15 14:35:28 +04:00
/*******************************************************************
Initialize a net file close request
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_q_net_file_close ( SRV_Q_NET_FILE_CLOSE * q_n , const char * server ,
2002-07-15 14:35:28 +04:00
uint32 file_id )
{
q_n - > ptr_srv_name = 1 ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & q_n - > uni_srv_name , server , UNI_STR_TERMINATE ) ;
2002-07-15 14:35:28 +04:00
q_n - > file_id = file_id ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_file_close ( const char * desc , SRV_Q_NET_FILE_CLOSE * q_n ,
2002-07-15 14:35:28 +04:00
prs_struct * ps , int depth )
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_file_close " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " file_id " , ps , depth , & q_n - > file_id ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_file_close ( const char * desc , SRV_R_NET_FILE_CLOSE * q_n ,
2002-07-15 14:35:28 +04:00
prs_struct * ps , int depth )
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_file_close " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_werror ( " status " , ps , depth , & q_n - > status ) )
return False ;
return True ;
}
2001-03-11 03:32:10 +03:00
/*******************************************************************
Inits a SRV_INFO_100 structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2002-11-13 02:20:50 +03:00
void init_srv_info_100 ( SRV_INFO_100 * sv100 , uint32 platform_id , const char * name )
2001-03-11 03:32:10 +03:00
{
DEBUG ( 5 , ( " init_srv_info_100 \n " ) ) ;
sv100 - > platform_id = platform_id ;
init_buf_unistr2 ( & sv100 - > uni_name , & sv100 - > ptr_name , name ) ;
}
/*******************************************************************
Reads or writes a SRV_INFO_101 structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
static BOOL srv_io_info_100 ( const char * desc , SRV_INFO_100 * sv100 , prs_struct * ps , int depth )
2001-03-11 03:32:10 +03:00
{
if ( sv100 = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_info_100 " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " platform_id " , ps , depth , & sv100 - > platform_id ) )
return False ;
if ( ! prs_uint32 ( " ptr_name " , ps , depth , & sv100 - > ptr_name ) )
return False ;
if ( ! smb_io_unistr2 ( " uni_name " , & sv100 - > uni_name , True , ps , depth ) )
return False ;
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_INFO_101 structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2002-11-13 02:20:50 +03:00
void init_srv_info_101 ( SRV_INFO_101 * sv101 , uint32 platform_id , const char * name ,
1998-03-12 00:11:04 +03:00
uint32 ver_major , uint32 ver_minor ,
2002-11-13 02:20:50 +03:00
uint32 srv_type , const char * comment )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_info_101 \n " ) ) ;
1998-03-12 00:11:04 +03:00
sv101 - > platform_id = platform_id ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & sv101 - > uni_name , & sv101 - > ptr_name , name ) ;
1998-03-12 00:11:04 +03:00
sv101 - > ver_major = ver_major ;
sv101 - > ver_minor = ver_minor ;
sv101 - > srv_type = srv_type ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & sv101 - > uni_comment , & sv101 - > ptr_comment , comment ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a SRV_INFO_101 structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_info_101 ( const char * desc , SRV_INFO_101 * sv101 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sv101 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_info_101 " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " platform_id " , ps , depth , & sv101 - > platform_id ) )
return False ;
if ( ! prs_uint32 ( " ptr_name " , ps , depth , & sv101 - > ptr_name ) )
return False ;
if ( ! prs_uint32 ( " ver_major " , ps , depth , & sv101 - > ver_major ) )
return False ;
if ( ! prs_uint32 ( " ver_minor " , ps , depth , & sv101 - > ver_minor ) )
return False ;
if ( ! prs_uint32 ( " srv_type " , ps , depth , & sv101 - > srv_type ) )
return False ;
if ( ! prs_uint32 ( " ptr_comment " , ps , depth , & sv101 - > ptr_comment ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! smb_io_unistr2 ( " uni_name " , & sv101 - > uni_name , True , ps , depth ) )
return False ;
if ( ! smb_io_unistr2 ( " uni_comment " , & sv101 - > uni_comment , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_INFO_102 structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2002-11-13 02:20:50 +03:00
void init_srv_info_102 ( SRV_INFO_102 * sv102 , uint32 platform_id , const char * name ,
const char * comment , uint32 ver_major , uint32 ver_minor ,
1998-03-12 00:11:04 +03:00
uint32 srv_type , uint32 users , uint32 disc , uint32 hidden ,
uint32 announce , uint32 ann_delta , uint32 licenses ,
2002-11-13 02:20:50 +03:00
const char * usr_path )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_info_102 \n " ) ) ;
1998-03-12 00:11:04 +03:00
sv102 - > platform_id = platform_id ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & sv102 - > uni_name , & sv102 - > ptr_name , name ) ;
1998-03-12 00:11:04 +03:00
sv102 - > ver_major = ver_major ;
sv102 - > ver_minor = ver_minor ;
sv102 - > srv_type = srv_type ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & sv102 - > uni_comment , & sv102 - > ptr_comment , comment ) ;
1998-03-12 00:11:04 +03:00
/* same as 101 up to here */
sv102 - > users = users ;
sv102 - > disc = disc ;
sv102 - > hidden = hidden ;
sv102 - > announce = announce ;
2002-08-17 21:00:51 +04:00
sv102 - > ann_delta = ann_delta ;
1998-03-12 00:11:04 +03:00
sv102 - > licenses = licenses ;
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & sv102 - > uni_usr_path , & sv102 - > ptr_usr_path , usr_path ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a SRV_INFO_102 structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_info_102 ( const char * desc , SRV_INFO_102 * sv102 , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( sv102 = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_info102 " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " platform_id " , ps , depth , & sv102 - > platform_id ) )
return False ;
if ( ! prs_uint32 ( " ptr_name " , ps , depth , & sv102 - > ptr_name ) )
return False ;
if ( ! prs_uint32 ( " ver_major " , ps , depth , & sv102 - > ver_major ) )
return False ;
if ( ! prs_uint32 ( " ver_minor " , ps , depth , & sv102 - > ver_minor ) )
return False ;
if ( ! prs_uint32 ( " srv_type " , ps , depth , & sv102 - > srv_type ) )
return False ;
if ( ! prs_uint32 ( " ptr_comment " , ps , depth , & sv102 - > ptr_comment ) )
return False ;
1998-03-12 00:11:04 +03:00
/* same as 101 up to here */
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " users " , ps , depth , & sv102 - > users ) )
return False ;
if ( ! prs_uint32 ( " disc " , ps , depth , & sv102 - > disc ) )
return False ;
if ( ! prs_uint32 ( " hidden " , ps , depth , & sv102 - > hidden ) )
return False ;
if ( ! prs_uint32 ( " announce " , ps , depth , & sv102 - > announce ) )
return False ;
if ( ! prs_uint32 ( " ann_delta " , ps , depth , & sv102 - > ann_delta ) )
return False ;
if ( ! prs_uint32 ( " licenses " , ps , depth , & sv102 - > licenses ) )
return False ;
if ( ! prs_uint32 ( " ptr_usr_path " , ps , depth , & sv102 - > ptr_usr_path ) )
return False ;
if ( ! smb_io_unistr2 ( " uni_name " , & sv102 - > uni_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " uni_comment " , & sv102 - > uni_comment , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " uni_usr_path " , & sv102 - > uni_usr_path , True , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a SRV_INFO_102 structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_info_ctr ( const char * desc , SRV_INFO_CTR * ctr , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( ctr = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_info_ctr " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & ctr - > switch_value ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_ctr " , ps , depth , & ctr - > ptr_srv_ctr ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ctr - > ptr_srv_ctr ! = 0 & & ctr - > switch_value ! = 0 & & ctr ! = NULL ) {
switch ( ctr - > switch_value ) {
2001-03-11 03:32:10 +03:00
case 100 :
if ( ! srv_io_info_100 ( " sv100 " , & ctr - > srv . sv100 , ps , depth ) )
return False ;
break ;
1999-12-13 16:27:58 +03:00
case 101 :
if ( ! srv_io_info_101 ( " sv101 " , & ctr - > srv . sv101 , ps , depth ) )
return False ;
break ;
case 102 :
if ( ! srv_io_info_102 ( " sv102 " , & ctr - > srv . sv102 , ps , depth ) )
return False ;
break ;
default :
DEBUG ( 5 , ( " %s no server info at switch_value %d \n " ,
tab_depth ( depth ) , ctr - > switch_value ) ) ;
break ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
}
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_Q_NET_SRV_GET_INFO structure .
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_q_net_srv_get_info ( SRV_Q_NET_SRV_GET_INFO * srv ,
2003-01-03 11:28:12 +03:00
const char * server_name , uint32 switch_value )
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_q_net_srv_get_info \n " ) ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
1999-12-13 16:27:58 +03:00
init_buf_unistr2 ( & srv - > uni_srv_name , & srv - > ptr_srv_name , server_name ) ;
Makefile.in :
- added srvsvc client files
clientgen.c :
- replaced cli_error(cli, int *cls, int *err) with
cli_error(cli, uint8 cls, uint32 *err). this version detects
32 bit status messages. the DOS error "MORE_DATA", the
equivalent of the 32 bit *warning* 0x8000 0005
(STATUS_BUFFER_OVERFLOW), was being processed as an error,
terminating the cli_receive_trans() call.
cli_pipe.c :
- replaced calls that had been incorrectly modified from
32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
the use of the old version of cli_error (DOS only)
instead of the new one (DOS and 32 bit) caused the
dce/rpc client code to fail.
- replaced 2 space indentation with tab indentation in all functions.
cli_srvsvc.c :
cmd_srvsvc.c :
- added these files back in, fixing them up to use jeremy's
modified versions of the dce/rpc client functions.
parse_srv.c :
- added back in some "unused" functions required by dce/rpc
client-side code. it would be helpful if all such "unused"
functions could be added back in.
rpcclient.c :
- added "session", "file", "share", "connection" enumeration
functions back in. these are equivalent to nt's "NetXXXXXEnum"
Win32 (MSDN) functions.
- added "srvinfo" function back in. this is equivalent to
nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d)
1998-10-03 01:09:23 +04:00
srv - > switch_value = switch_value ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_srv_get_info ( const char * desc , SRV_Q_NET_SRV_GET_INFO * q_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_q_net_srv_get_info " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " switch_value " , ps , depth , & q_n - > switch_value ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Inits a SRV_R_NET_SRV_GET_INFO structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_srv_r_net_srv_get_info ( SRV_R_NET_SRV_GET_INFO * srv ,
2002-03-05 05:12:00 +03:00
uint32 switch_value , SRV_INFO_CTR * ctr , WERROR status )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_srv_r_net_srv_get_info \n " ) ) ;
1998-03-12 00:11:04 +03:00
srv - > ctr = ctr ;
2002-03-05 05:12:00 +03:00
if ( W_ERROR_IS_OK ( status ) ) {
1998-03-12 00:11:04 +03:00
srv - > ctr - > switch_value = switch_value ;
srv - > ctr - > ptr_srv_ctr = 1 ;
1999-12-13 16:27:58 +03:00
} else {
1998-03-12 00:11:04 +03:00
srv - > ctr - > switch_value = 0 ;
srv - > ctr - > ptr_srv_ctr = 0 ;
}
srv - > status = status ;
}
2001-06-25 10:13:27 +04:00
/*******************************************************************
Inits a SRV_R_NET_SRV_SET_INFO structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void init_srv_r_net_srv_set_info ( SRV_R_NET_SRV_SET_INFO * srv ,
2002-03-05 05:12:00 +03:00
uint32 switch_value , WERROR status )
2001-06-25 10:13:27 +04:00
{
DEBUG ( 5 , ( " init_srv_r_net_srv_set_info \n " ) ) ;
srv - > switch_value = switch_value ;
srv - > status = status ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_srv_set_info ( const char * desc , SRV_Q_NET_SRV_SET_INFO * q_n ,
2001-06-25 10:13:27 +04:00
prs_struct * ps , int depth )
{
prs_debug ( ps , depth , desc , " srv_io_q_net_srv_set_info " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " switch_value " , ps , depth , & q_n - > switch_value ) )
return False ;
if ( UNMARSHALLING ( ps ) ) {
2004-12-07 21:25:53 +03:00
q_n - > ctr = PRS_ALLOC_MEM ( ps , SRV_INFO_CTR , 1 ) ;
2001-06-25 10:13:27 +04:00
if ( ! q_n - > ctr )
return False ;
}
if ( ! srv_io_info_ctr ( " ctr " , q_n - > ctr , ps , depth ) )
return False ;
return True ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_srv_get_info ( const char * desc , SRV_R_NET_SRV_GET_INFO * r_n , prs_struct * ps , int depth )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-03-12 00:11:04 +03:00
prs_debug ( ps , depth , desc , " srv_io_r_net_srv_get_info " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! srv_io_info_ctr ( " ctr " , r_n - > ctr , ps , depth ) )
return False ;
1998-03-12 00:11:04 +03:00
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
2001-06-25 10:13:27 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_srv_set_info ( const char * desc , SRV_R_NET_SRV_SET_INFO * r_n ,
2001-06-25 10:13:27 +04:00
prs_struct * ps , int depth )
{
prs_debug ( ps , depth , desc , " srv_io_r_net_srv_set_info " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " switch value " , ps , depth , & r_n - > switch_value ) )
2001-06-25 10:13:27 +04:00
return False ;
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-06-25 10:13:27 +04:00
return False ;
return True ;
}
1998-03-12 00:11:04 +03:00
1998-05-20 17:17:26 +04:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-05-20 17:17:26 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_remote_tod ( const char * desc , SRV_Q_NET_REMOTE_TOD * q_n , prs_struct * ps , int depth )
1998-05-20 17:17:26 +04:00
{
1999-12-13 16:27:58 +03:00
if ( q_n = = NULL )
return False ;
1998-05-20 17:17:26 +04:00
prs_debug ( ps , depth , desc , " srv_io_q_net_remote_tod " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-05-20 17:17:26 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-05-20 17:17:26 +04:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a TIME_OF_DAY_INFO structure .
1998-05-20 17:17:26 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
static BOOL srv_io_time_of_day_info ( const char * desc , TIME_OF_DAY_INFO * tod , prs_struct * ps , int depth )
1998-05-20 17:17:26 +04:00
{
1999-12-13 16:27:58 +03:00
if ( tod = = NULL )
return False ;
1998-05-20 17:17:26 +04:00
prs_debug ( ps , depth , desc , " srv_io_time_of_day_info " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-05-20 17:17:26 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " elapsedt " , ps , depth , & tod - > elapsedt ) )
return False ;
if ( ! prs_uint32 ( " msecs " , ps , depth , & tod - > msecs ) )
return False ;
if ( ! prs_uint32 ( " hours " , ps , depth , & tod - > hours ) )
return False ;
if ( ! prs_uint32 ( " mins " , ps , depth , & tod - > mins ) )
return False ;
if ( ! prs_uint32 ( " secs " , ps , depth , & tod - > secs ) )
return False ;
if ( ! prs_uint32 ( " hunds " , ps , depth , & tod - > hunds ) )
return False ;
if ( ! prs_uint32 ( " timezone " , ps , depth , & tod - > zone ) )
return False ;
if ( ! prs_uint32 ( " tintervals " , ps , depth , & tod - > tintervals ) )
return False ;
if ( ! prs_uint32 ( " day " , ps , depth , & tod - > day ) )
return False ;
if ( ! prs_uint32 ( " month " , ps , depth , & tod - > month ) )
return False ;
if ( ! prs_uint32 ( " year " , ps , depth , & tod - > year ) )
return False ;
if ( ! prs_uint32 ( " weekday " , ps , depth , & tod - > weekday ) )
return False ;
return True ;
}
/*******************************************************************
Inits a TIME_OF_DAY_INFO structure .
1998-05-20 17:17:26 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
void init_time_of_day_info ( TIME_OF_DAY_INFO * tod , uint32 elapsedt , uint32 msecs ,
1998-05-20 17:17:26 +04:00
uint32 hours , uint32 mins , uint32 secs , uint32 hunds ,
uint32 zone , uint32 tintervals , uint32 day ,
uint32 month , uint32 year , uint32 weekday )
{
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " init_time_of_day_info \n " ) ) ;
1998-05-20 17:17:26 +04:00
tod - > elapsedt = elapsedt ;
tod - > msecs = msecs ;
tod - > hours = hours ;
tod - > mins = mins ;
tod - > secs = secs ;
tod - > hunds = hunds ;
tod - > zone = zone ;
tod - > tintervals = tintervals ;
tod - > day = day ;
tod - > month = month ;
tod - > year = year ;
tod - > weekday = weekday ;
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
Reads or writes a structure .
1998-05-20 17:17:26 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_remote_tod ( const char * desc , SRV_R_NET_REMOTE_TOD * r_n , prs_struct * ps , int depth )
1998-05-20 17:17:26 +04:00
{
1999-12-13 16:27:58 +03:00
if ( r_n = = NULL )
return False ;
1998-05-20 17:17:26 +04:00
prs_debug ( ps , depth , desc , " srv_io_r_net_remote_tod " ) ;
depth + + ;
1999-12-13 16:27:58 +03:00
if ( ! prs_align ( ps ) )
return False ;
1998-05-20 17:17:26 +04:00
1999-12-13 16:27:58 +03:00
if ( ! prs_uint32 ( " ptr_srv_tod " , ps , depth , & r_n - > ptr_srv_tod ) )
return False ;
1998-05-20 17:17:26 +04:00
1999-12-13 16:27:58 +03:00
if ( ! srv_io_time_of_day_info ( " tod " , r_n - > tod , ps , depth ) )
return False ;
1998-05-20 17:17:26 +04:00
2002-03-14 05:48:03 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
1999-12-13 16:27:58 +03:00
return False ;
1999-10-15 22:46:22 +04:00
return True ;
1998-05-20 17:17:26 +04:00
}
2001-05-01 05:01:19 +04:00
2002-08-17 21:00:51 +04:00
/*******************************************************************
initialises a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL init_srv_q_net_disk_enum ( SRV_Q_NET_DISK_ENUM * q_n ,
const char * srv_name ,
uint32 preferred_len ,
ENUM_HND * enum_hnd
)
{
DEBUG ( 5 , ( " init_srv_q_net_srv_disk_enum \n " ) ) ;
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
q_n - > disk_enum_ctr . level = 0 ;
q_n - > disk_enum_ctr . disk_info_ptr = 0 ;
q_n - > preferred_len = preferred_len ;
memcpy ( & q_n - > enum_hnd , enum_hnd , sizeof ( * enum_hnd ) ) ;
return True ;
}
2001-05-01 05:01:19 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_disk_enum ( const char * desc , SRV_Q_NET_DISK_ENUM * q_n , prs_struct * ps , int depth )
2001-05-01 05:01:19 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_disk_enum " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " level " , ps , depth , & q_n - > disk_enum_ctr . level ) )
return False ;
if ( ! prs_uint32 ( " entries_read " , ps , depth , & q_n - > disk_enum_ctr . entries_read ) )
return False ;
if ( ! prs_uint32 ( " buffer " , ps , depth , & q_n - > disk_enum_ctr . disk_info_ptr ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " preferred_len " , ps , depth , & q_n - > preferred_len ) )
return False ;
if ( ! smb_io_enum_hnd ( " enum_hnd " , & q_n - > enum_hnd , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_disk_enum ( const char * desc , SRV_R_NET_DISK_ENUM * r_n , prs_struct * ps , int depth )
2001-05-01 05:01:19 +04:00
{
2002-08-17 21:00:51 +04:00
2003-03-18 02:04:03 +03:00
unsigned int i ;
2002-08-17 21:00:51 +04:00
uint32 entries_read , entries_read2 , entries_read3 ;
2001-05-01 05:01:19 +04:00
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_disk_enum " ) ;
depth + + ;
2002-08-17 21:00:51 +04:00
entries_read = entries_read2 = entries_read3 = r_n - > disk_enum_ctr . entries_read ;
2001-05-01 05:01:19 +04:00
if ( ! prs_align ( ps ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " entries_read " , ps , depth , & entries_read ) )
2001-05-01 05:01:19 +04:00
return False ;
if ( ! prs_uint32 ( " ptr_disk_info " , ps , depth , & r_n - > disk_enum_ctr . disk_info_ptr ) )
return False ;
/*this may be max, unknown, actual?*/
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " max_elements " , ps , depth , & entries_read2 ) )
2001-05-01 05:01:19 +04:00
return False ;
if ( ! prs_uint32 ( " unknown " , ps , depth , & r_n - > disk_enum_ctr . unknown ) )
return False ;
2002-08-17 21:00:51 +04:00
if ( ! prs_uint32 ( " actual_elements " , ps , depth , & entries_read3 ) )
2001-05-01 05:01:19 +04:00
return False ;
2002-08-17 21:00:51 +04:00
r_n - > disk_enum_ctr . entries_read = entries_read3 ;
if ( UNMARSHALLING ( ps ) ) {
DISK_INFO * dinfo ;
2004-12-07 21:25:53 +03:00
if ( ! ( dinfo = PRS_ALLOC_MEM ( ps , DISK_INFO , entries_read3 ) ) )
return False ;
2002-08-17 21:00:51 +04:00
r_n - > disk_enum_ctr . disk_info = dinfo ;
}
2001-05-01 05:01:19 +04:00
for ( i = 0 ; i < r_n - > disk_enum_ctr . entries_read ; i + + ) {
if ( ! prs_uint32 ( " unknown " , ps , depth , & r_n - > disk_enum_ctr . disk_info [ i ] . unknown ) )
return False ;
if ( ! smb_io_unistr3 ( " disk_name " , & r_n - > disk_enum_ctr . disk_info [ i ] . disk_name , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
}
if ( ! prs_uint32 ( " total_entries " , ps , depth , & r_n - > total_entries ) )
return False ;
if ( ! smb_io_enum_hnd ( " enum_hnd " , & r_n - > enum_hnd , ps , depth ) )
return False ;
2002-03-05 05:12:00 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-05-01 05:01:19 +04:00
return False ;
return True ;
}
2002-08-17 21:00:51 +04:00
/*******************************************************************
initialises a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BOOL init_srv_q_net_name_validate ( SRV_Q_NET_NAME_VALIDATE * q_n , const char * srv_name , const char * share_name , int type )
{
uint32 ptr_share_name ;
DEBUG ( 5 , ( " init_srv_q_net_name_validate \n " ) ) ;
init_buf_unistr2 ( & q_n - > uni_srv_name , & q_n - > ptr_srv_name , srv_name ) ;
init_buf_unistr2 ( & q_n - > uni_name , & ptr_share_name , share_name ) ;
q_n - > type = type ;
q_n - > flags = 0 ;
return True ;
}
2001-05-01 05:01:19 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_name_validate ( const char * desc , SRV_Q_NET_NAME_VALIDATE * q_n , prs_struct * ps , int depth )
2001-05-01 05:01:19 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_name_validate " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " type " , ps , depth , & q_n - > type ) )
return False ;
if ( ! prs_uint32 ( " flags " , ps , depth , & q_n - > flags ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_name_validate ( const char * desc , SRV_R_NET_NAME_VALIDATE * r_n , prs_struct * ps , int depth )
2001-05-01 05:01:19 +04:00
{
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_name_validate " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-03-05 05:12:00 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-05-01 05:01:19 +04:00
return False ;
return True ;
}
2001-06-16 00:08:12 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_file_query_secdesc ( const char * desc , SRV_Q_NET_FILE_QUERY_SECDESC * q_n , prs_struct * ps , int depth )
2001-06-16 00:08:12 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_file_query_secdesc " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_qual_name " , ps , depth , & q_n - > ptr_qual_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_qual_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_file_name , True , ps , depth ) )
return False ;
if ( ! prs_uint32 ( " unknown1 " , ps , depth , & q_n - > unknown1 ) )
return False ;
if ( ! prs_uint32 ( " unknown2 " , ps , depth , & q_n - > unknown2 ) )
return False ;
if ( ! prs_uint32 ( " unknown3 " , ps , depth , & q_n - > unknown3 ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_file_query_secdesc ( const char * desc , SRV_R_NET_FILE_QUERY_SECDESC * r_n , prs_struct * ps , int depth )
2001-06-16 00:08:12 +04:00
{
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_file_query_secdesc " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_response " , ps , depth , & r_n - > ptr_response ) )
return False ;
if ( ! prs_uint32 ( " size_response " , ps , depth , & r_n - > size_response ) )
return False ;
if ( ! prs_uint32 ( " ptr_secdesc " , ps , depth , & r_n - > ptr_secdesc ) )
return False ;
if ( ! prs_uint32 ( " size_secdesc " , ps , depth , & r_n - > size_secdesc ) )
return False ;
if ( ! sec_io_desc ( " sec_desc " , & r_n - > sec_desc , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
2002-03-05 05:12:00 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-06-16 00:08:12 +04:00
return False ;
return True ;
}
2001-06-16 04:32:13 +04:00
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_q_net_file_set_secdesc ( const char * desc , SRV_Q_NET_FILE_SET_SECDESC * q_n , prs_struct * ps , int depth )
2001-06-16 04:32:13 +04:00
{
if ( q_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_q_net_file_set_secdesc " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_n - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_srv_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " ptr_qual_name " , ps , depth , & q_n - > ptr_qual_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_qual_name , True , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_n - > uni_file_name , True , ps , depth ) )
return False ;
2001-07-03 01:56:20 +04:00
if ( ! prs_align ( ps ) )
return False ;
2001-06-16 04:32:13 +04:00
if ( ! prs_uint32 ( " sec_info " , ps , depth , & q_n - > sec_info ) )
return False ;
if ( ! prs_uint32 ( " size_set " , ps , depth , & q_n - > size_set ) )
return False ;
if ( ! prs_uint32 ( " ptr_secdesc " , ps , depth , & q_n - > ptr_secdesc ) )
return False ;
if ( ! prs_uint32 ( " size_secdesc " , ps , depth , & q_n - > size_secdesc ) )
return False ;
if ( ! sec_io_desc ( " sec_desc " , & q_n - > sec_desc , ps , depth ) )
return False ;
return True ;
}
/*******************************************************************
Reads or writes a structure .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
BOOL srv_io_r_net_file_set_secdesc ( const char * desc , SRV_R_NET_FILE_SET_SECDESC * r_n , prs_struct * ps , int depth )
2001-06-16 04:32:13 +04:00
{
if ( r_n = = NULL )
return False ;
prs_debug ( ps , depth , desc , " srv_io_r_net_file_set_secdesc " ) ;
depth + + ;
if ( ! prs_align ( ps ) )
return False ;
2002-03-05 05:12:00 +03:00
if ( ! prs_werror ( " status " , ps , depth , & r_n - > status ) )
2001-06-16 04:32:13 +04:00
return False ;
return True ;
}
2002-07-15 14:35:28 +04:00
/*******************************************************************
Inits a structure
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-01-03 11:28:12 +03:00
void init_srv_q_net_remote_tod ( SRV_Q_NET_REMOTE_TOD * q_u , const char * server )
2002-07-15 14:35:28 +04:00
{
q_u - > ptr_srv_name = 1 ;
2003-09-26 01:26:16 +04:00
init_unistr2 ( & q_u - > uni_srv_name , server , UNI_STR_TERMINATE ) ;
2002-07-15 14:35:28 +04:00
}