*
* 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
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* 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 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info0_str(const char *desc, SH_INFO_0_STR *sh0, prs_struct *ps, int depth)
+static bool srv_io_share_info0_str(const char *desc, SH_INFO_0_STR *sh0, prs_struct *ps, int depth)
{
if (sh0 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info0(const char *desc, SH_INFO_0 *sh0, prs_struct *ps, int depth)
+static bool srv_io_share_info0(const char *desc, SH_INFO_0 *sh0, prs_struct *ps, int depth)
{
if (sh0 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1_str(const char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth)
+static bool srv_io_share_info1_str(const char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth)
{
if (sh1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1(const char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth)
+static bool srv_io_share_info1(const char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth)
{
if (sh1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info2_str(const char *desc, SH_INFO_2 *sh, SH_INFO_2_STR *sh2, prs_struct *ps, int depth)
+static bool srv_io_share_info2_str(const char *desc, SH_INFO_2 *sh, SH_INFO_2_STR *sh2, prs_struct *ps, int depth)
{
if (sh2 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info2(const char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth)
+static bool srv_io_share_info2(const char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth)
{
if (sh2 == NULL)
return False;
Reads of writes a structure.
*******************************************************************/
-static BOOL srv_io_share_info501(const char *desc, SH_INFO_501 *sh501, prs_struct *ps, int depth)
+static bool srv_io_share_info501(const char *desc, SH_INFO_501 *sh501, prs_struct *ps, int depth)
{
if (sh501 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info501_str(const char *desc, SH_INFO_501_STR *sh501, prs_struct *ps, int depth)
+static bool srv_io_share_info501_str(const char *desc, SH_INFO_501_STR *sh501, prs_struct *ps, int depth)
{
if (sh501 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info502(const char *desc, SH_INFO_502 *sh502, prs_struct *ps, int depth)
+static bool srv_io_share_info502(const char *desc, SH_INFO_502 *sh502, prs_struct *ps, int depth)
{
if (sh502 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info502_str(const char *desc, SH_INFO_502_STR *sh502, prs_struct *ps, int depth)
+static bool srv_io_share_info502_str(const char *desc, SH_INFO_502_STR *sh502, prs_struct *ps, int depth)
{
if (sh502 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1004_str(const char *desc, SH_INFO_1004_STR *sh1004, prs_struct *ps, int depth)
+static bool srv_io_share_info1004_str(const char *desc, SH_INFO_1004_STR *sh1004, prs_struct *ps, int depth)
{
if (sh1004 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1004(const char *desc, SH_INFO_1004 *sh1004, prs_struct *ps, int depth)
+static bool srv_io_share_info1004(const char *desc, SH_INFO_1004 *sh1004, prs_struct *ps, int depth)
{
if (sh1004 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1005(const char* desc, SRV_SHARE_INFO_1005* sh1005, prs_struct* ps, int depth)
+static bool srv_io_share_info1005(const char* desc, SRV_SHARE_INFO_1005* sh1005, prs_struct* ps, int depth)
{
if(sh1005 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1006(const char* desc, SRV_SHARE_INFO_1006* sh1006, prs_struct* ps, int depth)
+static bool srv_io_share_info1006(const char* desc, SRV_SHARE_INFO_1006* sh1006, prs_struct* ps, int depth)
{
if(sh1006 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1007_str(const char *desc, SH_INFO_1007_STR *sh1007, prs_struct *ps, int depth)
+static bool srv_io_share_info1007_str(const char *desc, SH_INFO_1007_STR *sh1007, prs_struct *ps, int depth)
{
if (sh1007 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1007(const char *desc, SH_INFO_1007 *sh1007, prs_struct *ps, int depth)
+static bool srv_io_share_info1007(const char *desc, SH_INFO_1007 *sh1007, prs_struct *ps, int depth)
{
if (sh1007 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info1501(const char* desc, SRV_SHARE_INFO_1501* sh1501,
+static bool srv_io_share_info1501(const char* desc, SRV_SHARE_INFO_1501* sh1501,
prs_struct* ps, int depth)
{
if(sh1501 == NULL)
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth)
+static bool srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth)
{
if (ctr == NULL)
return False;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info0 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_0, num_entries)))
return False;
ctr->share.info0 = info0;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_1, num_entries)))
return False;
ctr->share.info1 = info1;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info2 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_2,num_entries)))
return False;
ctr->share.info2 = info2;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info501 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_501, num_entries)))
return False;
ctr->share.info501 = info501;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info502 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_502,num_entries)))
return False;
ctr->share.info502 = info502;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1004 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1004,num_entries)))
return False;
ctr->share.info1004 = info1004;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1005 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1005,num_entries)))
return False;
ctr->share.info1005 = info1005;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1006 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1006,num_entries)))
return False;
ctr->share.info1006 = info1006;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1007 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1007,num_entries)))
return False;
ctr->share.info1007 = info1007;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info1501 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1501,num_entries)))
return False;
ctr->share.info1501 = info1501;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_share_enum(const char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_share_enum(const char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_share_enum(const char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_share_enum(const char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
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)
+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;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_share_get_info(const char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_share_get_info(const char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_share_info(const char *desc, prs_struct *ps, int depth, SRV_SHARE_INFO *r_n)
+static bool srv_io_srv_share_info(const char *desc, prs_struct *ps, int depth, SRV_SHARE_INFO *r_n)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_share_get_info(const char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_share_get_info(const char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
intialises a structure.
********************************************************************/
-BOOL init_srv_q_net_share_set_info(SRV_Q_NET_SHARE_SET_INFO *q_n,
+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,
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_share_set_info(const char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_share_set_info(const char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_share_set_info(const char *desc, SRV_R_NET_SHARE_SET_INFO *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_share_set_info(const char *desc, SRV_R_NET_SHARE_SET_INFO *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_share_add(const char *desc, SRV_Q_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_share_add(const char *desc, SRV_Q_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_share_add(const char *desc, SRV_R_NET_SHARE_ADD *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_share_add(const char *desc, SRV_R_NET_SHARE_ADD *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_share_del(const char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_share_del(const char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_share_del(const char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
+bool srv_io_r_net_share_del(const char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
ZERO_STRUCTP( ss0 );
if ( name ) {
- if ( (ss0->sharename = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL ) {
+ if ( (ss0->sharename = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL ) {
DEBUG(0,("init_srv_sess_info0: talloc failed!\n"));
return;
}
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_sess_info_0(const char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth)
+static bool srv_io_srv_sess_info_0(const char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth)
{
if (ss0 == NULL)
return False;
ZERO_STRUCTP( ss1 );
if ( name ) {
- if ( (ss1->sharename = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL ) {
+ if ( (ss1->sharename = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL ) {
DEBUG(0,("init_srv_sess_info0: talloc failed!\n"));
return;
}
}
if ( user ) {
- if ( (ss1->username = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL ) {
+ if ( (ss1->username = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL ) {
DEBUG(0,("init_srv_sess_info0: talloc failed!\n"));
return;
}
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_sess_info_1(const char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth)
+static bool srv_io_srv_sess_info_1(const char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth)
{
if (ss1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_sess_ctr(const char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
+static bool srv_io_srv_sess_ctr(const char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
{
SRV_SESS_INFO_CTR *ctr = *pp_ctr;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_sess_enum(const char *desc, SRV_Q_NET_SESS_ENUM *q_u, prs_struct *ps, int depth)
+bool srv_io_q_net_sess_enum(const char *desc, SRV_Q_NET_SESS_ENUM *q_u, prs_struct *ps, int depth)
{
if (q_u == NULL)
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("servername", ps, depth, (void*)&q_u->servername, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("servername", ps, depth, (void*)&q_u->servername,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("qualifier", ps, depth, (void*)&q_u->qualifier, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("qualifier", ps, depth, (void*)&q_u->qualifier,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("username", ps, depth, (void*)&q_u->username, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("username", ps, depth, (void*)&q_u->username,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_sess_enum(const char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_sess_enum(const char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
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)
+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;
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)
+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;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_conn_info0(const char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth)
+static bool srv_io_conn_info0(const char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth)
{
if (ss0 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_conn_info_0(const char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth)
+static bool srv_io_srv_conn_info_0(const char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth)
{
if (ss0 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_conn_info1_str(const char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth)
+static bool srv_io_conn_info1_str(const char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth)
{
if (ss1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_conn_info1(const char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth)
+static bool srv_io_conn_info1(const char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth)
{
if (ss1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_conn_info_1(const char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth)
+static bool srv_io_srv_conn_info_1(const char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth)
{
if (ss1 == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_conn_ctr(const char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
+static bool srv_io_srv_conn_ctr(const char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
{
SRV_CONN_INFO_CTR *ctr = *pp_ctr;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_conn_enum(const char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_conn_enum(const char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_conn_enum(const char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_conn_enum(const char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_file_info3_str(const char *desc, FILE_INFO_3 *sh1, prs_struct *ps, int depth)
+static bool srv_io_file_info3_str(const char *desc, FILE_INFO_3 *sh1, prs_struct *ps, int depth)
{
if (sh1 == NULL)
return False;
fl3->num_locks = num_locks;
if ( path_name ) {
- if ( (fl3->path = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL )
+ if ( (fl3->path = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL )
return;
init_unistr2(fl3->path, path_name, UNI_STR_TERMINATE);
}
if ( user_name ) {
- if ( (fl3->user = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL )
+ if ( (fl3->user = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL )
return;
init_unistr2(fl3->user, user_name, UNI_STR_TERMINATE);
}
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_file_info3(const char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth)
+static bool srv_io_file_info3(const char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth)
{
uint32 uni_p;
Reads or writes a structure.
********************************************************************/
-static BOOL srv_io_srv_file_ctr(const char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth)
+static bool srv_io_srv_file_ctr(const char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth)
{
if (ctr == NULL)
return False;
int num_entries = ctr->num_entries;
int i;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && num_entries) {
if (!(info3 = PRS_ALLOC_MEM(ps, FILE_INFO_3, num_entries)))
return False;
ctr->file.info3 = info3;
uint32 ptr;
if ( srv_name ) {
- if ( (q_n->servername = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL )
+ if ( (q_n->servername = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL )
return;
init_buf_unistr2(q_n->servername, &ptr, srv_name);
}
if ( qual_name ) {
- if ( (q_n->qualifier = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL )
+ if ( (q_n->qualifier = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL )
return;
init_buf_unistr2(q_n->qualifier, &ptr, qual_name);
}
if ( user_name ) {
- if ( (q_n->username = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL )
+ if ( (q_n->username = TALLOC_P( talloc_tos(), UNISTR2 )) == NULL )
return;
init_buf_unistr2(q_n->username, &ptr, user_name);
}
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_file_enum(const char *desc, SRV_Q_NET_FILE_ENUM *q_u, prs_struct *ps, int depth)
+bool srv_io_q_net_file_enum(const char *desc, SRV_Q_NET_FILE_ENUM *q_u, prs_struct *ps, int depth)
{
if (q_u == NULL)
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("servername", ps, depth, (void*)&q_u->servername, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("servername", ps, depth, (void*)&q_u->servername,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("qualifier", ps, depth, (void*)&q_u->qualifier, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("qualifier", ps, depth, (void*)&q_u->qualifier,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("username", ps, depth, (void*)&q_u->username, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("username", ps, depth, (void*)&q_u->username,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_file_enum(const char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_file_enum(const char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
return True;
}
-/*******************************************************************
- Initialize a net file close request
-********************************************************************/
-void init_srv_q_net_file_close(SRV_Q_NET_FILE_CLOSE *q_n, const char *server,
- uint32 file_id)
-{
- if ( server ) {
- if ( (q_n->servername = TALLOC_P( get_talloc_ctx(), UNISTR2 )) == NULL ) {
- return;
- }
- init_unistr2(q_n->servername, server, UNI_STR_TERMINATE);
- }
-
- q_n->file_id = file_id;
-}
-
/*******************************************************************
Inits a SRV_INFO_100 structure.
********************************************************************/
Reads or writes a SRV_INFO_101 structure.
********************************************************************/
-static BOOL srv_io_info_100(const char *desc, SRV_INFO_100 *sv100, prs_struct *ps, int depth)
+static bool srv_io_info_100(const char *desc, SRV_INFO_100 *sv100, prs_struct *ps, int depth)
{
if (sv100 == NULL)
return False;
Reads or writes a SRV_INFO_101 structure.
********************************************************************/
-static BOOL srv_io_info_101(const char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth)
+static bool srv_io_info_101(const char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth)
{
if (sv101 == NULL)
return False;
Reads or writes a SRV_INFO_102 structure.
********************************************************************/
-static BOOL srv_io_info_102(const char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth)
+static bool srv_io_info_102(const char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth)
{
if (sv102 == NULL)
return False;
Reads or writes a SRV_INFO_102 structure.
********************************************************************/
-static BOOL srv_io_info_ctr(const char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth)
+static bool srv_io_info_ctr(const char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth)
{
if (ctr == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_srv_get_info(const char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_srv_get_info(const char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_srv_set_info(const char *desc, SRV_Q_NET_SRV_SET_INFO *q_n,
+bool srv_io_q_net_srv_set_info(const char *desc, SRV_Q_NET_SRV_SET_INFO *q_n,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "srv_io_q_net_srv_set_info");
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_srv_get_info(const char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_srv_get_info(const char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_srv_set_info(const char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
+bool srv_io_r_net_srv_set_info(const char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "srv_io_r_net_srv_set_info");
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_remote_tod(const char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_remote_tod(const char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a TIME_OF_DAY_INFO structure.
********************************************************************/
-static BOOL srv_io_time_of_day_info(const char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth)
+static bool srv_io_time_of_day_info(const char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth)
{
if (tod == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_remote_tod(const char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_remote_tod(const char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
initialises a structure.
********************************************************************/
-BOOL init_srv_q_net_disk_enum(SRV_Q_NET_DISK_ENUM *q_n,
+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
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_disk_enum(const char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_disk_enum(const char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth)
{
unsigned int i;
r_n->disk_enum_ctr.entries_read = entries_read3;
- if(UNMARSHALLING(ps)) {
+ if(UNMARSHALLING(ps) && entries_read3) {
DISK_INFO *dinfo;
r_n->disk_enum_ctr.disk_info = dinfo;
}
- for(i=0; i < r_n->disk_enum_ctr.entries_read; i++) {
+ for(i=0; i < entries_read3; i++) {
if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.disk_info[i].unknown))
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_name_validate(const char *desc, SRV_Q_NET_NAME_VALIDATE *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_name_validate(const char *desc, SRV_Q_NET_NAME_VALIDATE *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
if(!prs_align(ps))
return False;
- if(!prs_pointer("servername", ps, depth, (void*)&q_n->servername, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
+ if(!prs_pointer("servername", ps, depth, (void*)&q_n->servername,
+ sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
return False;
if(!prs_align(ps))
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_name_validate(const char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_name_validate(const char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_file_query_secdesc(const char *desc, SRV_Q_NET_FILE_QUERY_SECDESC *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_file_query_secdesc(const char *desc, SRV_Q_NET_FILE_QUERY_SECDESC *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_file_query_secdesc(const char *desc, SRV_R_NET_FILE_QUERY_SECDESC *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_file_query_secdesc(const char *desc, SRV_R_NET_FILE_QUERY_SECDESC *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_q_net_file_set_secdesc(const char *desc, SRV_Q_NET_FILE_SET_SECDESC *q_n, prs_struct *ps, int depth)
+bool srv_io_q_net_file_set_secdesc(const char *desc, SRV_Q_NET_FILE_SET_SECDESC *q_n, prs_struct *ps, int depth)
{
if (q_n == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL srv_io_r_net_file_set_secdesc(const char *desc, SRV_R_NET_FILE_SET_SECDESC *r_n, prs_struct *ps, int depth)
+bool srv_io_r_net_file_set_secdesc(const char *desc, SRV_R_NET_FILE_SET_SECDESC *r_n, prs_struct *ps, int depth)
{
if (r_n == NULL)
return False;
init_unistr2(&q_u->uni_srv_name, server, UNI_STR_TERMINATE);
}
-
-/*******************************************************************
- Reads or writes a structure.
-********************************************************************/
-
-BOOL srv_io_q_net_file_close(const char *desc, SRV_Q_NET_FILE_CLOSE *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "srv_io_q_net_file_close");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_pointer("servername", ps, depth, (void*)&q_u->servername, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2))
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("file_id", ps, depth, &q_u->file_id))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- ********************************************************************/
-
-BOOL srv_io_r_net_file_close(const char *desc, SRV_R_NET_FILE_CLOSE *r_n,
- prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "srv_io_r_net_file_close");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_werror("status", ps, depth, &r_n->status))
- return False;
-
- return True;
-}