1998-03-11 21:11:04 +00:00
/*
2002-01-30 06:08:46 +00:00
* Unix SMB / CIFS implementation .
1998-03-11 21:11:04 +00:00
* RPC Pipe client / server routines
1999-12-13 13:27:58 +00:00
* Copyright ( C ) Andrew Tridgell 1992 - 1997 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997 ,
* Copyright ( C ) Paul Ashton 1997.
1998-03-11 21:11:04 +00: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"
1998-09-25 21:20:37 +00:00
/*******************************************************************
1999-12-13 13:27:58 +00:00
Init
1998-09-25 21:20:37 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
void init_wks_q_query_info ( WKS_Q_QUERY_INFO * q_u ,
1998-09-25 21:20:37 +00:00
char * server , uint16 switch_value )
{
1999-12-13 13:27:58 +00:00
DEBUG ( 5 , ( " init_wks_q_query_info \n " ) ) ;
1998-09-25 21:20:37 +00:00
1999-12-13 13:27:58 +00:00
init_buf_unistr2 ( & q_u - > uni_srv_name , & q_u - > ptr_srv_name , server ) ;
1998-09-25 21:20:37 +00:00
q_u - > switch_value = switch_value ;
}
1998-03-11 21:11:04 +00:00
/*******************************************************************
1999-12-13 13:27:58 +00:00
Reads or writes a WKS_Q_QUERY_INFO structure .
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
1999-10-15 18:46:22 +00:00
BOOL wks_io_q_query_info ( char * desc , WKS_Q_QUERY_INFO * q_u , prs_struct * ps , int depth )
1998-03-11 21:11:04 +00:00
{
1999-12-13 13:27:58 +00:00
if ( q_u = = NULL )
return False ;
1998-03-11 21:11:04 +00:00
prs_debug ( ps , depth , desc , " wks_io_q_query_info " ) ;
depth + + ;
1999-12-13 13:27:58 +00:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-11 21:11:04 +00:00
1999-12-13 13:27:58 +00:00
if ( ! prs_uint32 ( " ptr_srv_name " , ps , depth , & q_u - > ptr_srv_name ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & q_u - > uni_srv_name , q_u - > ptr_srv_name , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
1998-03-11 21:11:04 +00:00
1999-12-13 13:27:58 +00:00
if ( ! prs_uint16 ( " switch_value " , ps , depth , & q_u - > switch_value ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
1999-10-15 18:46:22 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}
/*******************************************************************
wks_info_100
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
void init_wks_info_100 ( WKS_INFO_100 * inf ,
1998-03-11 21:11:04 +00:00
uint32 platform_id , uint32 ver_major , uint32 ver_minor ,
char * my_name , char * domain_name )
{
1999-12-13 13:27:58 +00:00
DEBUG ( 5 , ( " Init WKS_INFO_100: %d \n " , __LINE__ ) ) ;
1998-03-11 21:11:04 +00:00
inf - > platform_id = platform_id ; /* 0x0000 01f4 - unknown */
inf - > ver_major = ver_major ; /* os major version */
inf - > ver_minor = ver_minor ; /* os minor version */
1999-12-13 13:27:58 +00:00
init_buf_unistr2 ( & inf - > uni_compname , & inf - > ptr_compname , my_name ) ;
init_buf_unistr2 ( & inf - > uni_lan_grp , & inf - > ptr_lan_grp , domain_name ) ;
1998-03-11 21:11:04 +00:00
}
/*******************************************************************
1999-12-13 13:27:58 +00:00
Reads or writes a WKS_INFO_100 structure .
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
1999-10-15 18:46:22 +00:00
static BOOL wks_io_wks_info_100 ( char * desc , WKS_INFO_100 * inf , prs_struct * ps , int depth )
1998-03-11 21:11:04 +00:00
{
1999-12-13 13:27:58 +00:00
if ( inf = = NULL )
return False ;
1998-03-11 21:11:04 +00:00
prs_debug ( ps , depth , desc , " wks_io_wks_info_100 " ) ;
depth + + ;
1999-12-13 13:27:58 +00:00
if ( ! prs_align ( ps ) )
return False ;
if ( ! prs_uint32 ( " platform_id " , ps , depth , & inf - > platform_id ) ) /* 0x0000 01f4 - unknown */
return False ;
if ( ! prs_uint32 ( " ptr_compname " , ps , depth , & inf - > ptr_compname ) ) /* pointer to computer name */
return False ;
if ( ! prs_uint32 ( " ptr_lan_grp " , ps , depth , & inf - > ptr_lan_grp ) ) /* pointer to LAN group name */
return False ;
if ( ! prs_uint32 ( " ver_major " , ps , depth , & inf - > ver_major ) ) /* 4 - major os version */
return False ;
if ( ! prs_uint32 ( " ver_minor " , ps , depth , & inf - > ver_minor ) ) /* 0 - minor os version */
return False ;
if ( ! smb_io_unistr2 ( " " , & inf - > uni_compname , inf - > ptr_compname , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
if ( ! smb_io_unistr2 ( " " , & inf - > uni_lan_grp , inf - > ptr_lan_grp , ps , depth ) )
return False ;
if ( ! prs_align ( ps ) )
return False ;
1999-10-15 18:46:22 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}
/*******************************************************************
1999-12-13 13:27:58 +00:00
Inits WKS_R_QUERY_INFO .
1998-03-11 21:11:04 +00:00
only supports info level 100 at the moment .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
void init_wks_r_query_info ( WKS_R_QUERY_INFO * r_u ,
2001-08-27 19:46:22 +00:00
uint32 switch_value , WKS_INFO_100 * wks100 ,
NTSTATUS status )
1998-03-11 21:11:04 +00:00
{
1999-12-13 13:27:58 +00:00
DEBUG ( 5 , ( " init_wks_r_unknown_0: %d \n " , __LINE__ ) ) ;
1998-03-11 21:11:04 +00:00
r_u - > switch_value = switch_value ; /* same as in request */
r_u - > ptr_1 = 1 ; /* pointer 1 */
r_u - > wks100 = wks100 ;
r_u - > status = status ;
}
/*******************************************************************
1999-12-13 13:27:58 +00:00
Reads or writes a structure .
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
BOOL wks_io_r_query_info ( char * desc , WKS_R_QUERY_INFO * r_u , prs_struct * ps , int depth )
1998-03-11 21:11:04 +00:00
{
1999-12-13 13:27:58 +00:00
if ( r_u = = NULL )
return False ;
1998-03-11 21:11:04 +00:00
prs_debug ( ps , depth , desc , " wks_io_r_query_info " ) ;
depth + + ;
1999-12-13 13:27:58 +00:00
if ( ! prs_align ( ps ) )
return False ;
1998-03-11 21:11:04 +00:00
1999-12-13 13:27:58 +00:00
if ( ! prs_uint16 ( " switch_value " , ps , depth , & r_u - > switch_value ) ) /* level 100 (0x64) */
return False ;
if ( ! prs_align ( ps ) )
return False ;
1998-03-11 21:11:04 +00:00
1999-12-13 13:27:58 +00:00
if ( ! prs_uint32 ( " ptr_1 " , ps , depth , & r_u - > ptr_1 ) ) /* pointer 1 */
return False ;
if ( ! wks_io_wks_info_100 ( " inf " , r_u - > wks100 , ps , depth ) )
return False ;
1998-03-11 21:11:04 +00:00
2001-09-04 07:13:01 +00:00
if ( ! prs_ntstatus ( " status " , ps , depth , & r_u - > status ) )
1999-12-13 13:27:58 +00:00
return False ;
1999-10-15 18:46:22 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}