RIP BOOL. Convert BOOL -> bool. I found a few interesting
[samba.git] / source3 / rpc_parse / parse_srv.c
index 5123d1c2ccacb5bc24f28d18d211e6295a93bc35..e7a73183f5829df865ec645d111bfa7503de9e53 100644 (file)
@@ -11,7 +11,7 @@
  *  
  *  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,
@@ -20,8 +20,7 @@
  *  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"
@@ -44,7 +43,7 @@ void init_srv_share_info0_str(SH_INFO_0_STR *sh0, const char *net_name)
  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;
@@ -76,7 +75,7 @@ void init_srv_share_info0(SH_INFO_0 *sh0, const char *net_name)
  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;
@@ -109,7 +108,7 @@ void init_srv_share_info1_str(SH_INFO_1_STR *sh1, const char *net_name, const ch
  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;
@@ -151,7 +150,7 @@ void init_srv_share_info1(SH_INFO_1 *sh1, const char *net_name, uint32 type, con
  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;
@@ -192,7 +191,7 @@ void init_srv_share_info2_str(SH_INFO_2_STR *sh2,
  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;
@@ -250,7 +249,7 @@ void init_srv_share_info2(SH_INFO_2 *sh2,
  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;
@@ -315,7 +314,7 @@ void init_srv_share_info501(SH_INFO_501 *sh501, const char *net_name, uint32 typ
  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;
@@ -342,7 +341,7 @@ static BOOL srv_io_share_info501(const char *desc, SH_INFO_501 *sh501, prs_struc
  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;
@@ -393,7 +392,7 @@ void init_srv_share_info502(SH_INFO_502 *sh502,
  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;
@@ -451,7 +450,7 @@ void init_srv_share_info502_str(SH_INFO_502_STR *sh502str,
  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;
@@ -546,7 +545,7 @@ void init_srv_share_info1004_str(SH_INFO_1004_STR *sh1004, const char *remark)
  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;
@@ -578,7 +577,7 @@ void init_srv_share_info1004(SH_INFO_1004 *sh1004, const char *remark)
  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;
@@ -599,7 +598,7 @@ static BOOL srv_io_share_info1004(const char *desc, SH_INFO_1004 *sh1004, prs_st
  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;
@@ -621,7 +620,7 @@ static BOOL srv_io_share_info1005(const char* desc, SRV_SHARE_INFO_1005* sh1005,
  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;
@@ -653,7 +652,7 @@ void init_srv_share_info1007_str(SH_INFO_1007_STR *sh1007, const char *alternate
  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;
@@ -686,7 +685,7 @@ void init_srv_share_info1007(SH_INFO_1007 *sh1007, uint32 flags, const char *alt
  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;
@@ -709,7 +708,7 @@ static BOOL srv_io_share_info1007(const char *desc, SH_INFO_1007 *sh1007, prs_st
  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)
@@ -731,7 +730,7 @@ static BOOL srv_io_share_info1501(const char* desc, SRV_SHARE_INFO_1501* sh1501,
  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;
@@ -783,7 +782,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -809,7 +808,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -835,7 +834,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -860,7 +859,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -885,7 +884,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -911,7 +910,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -937,7 +936,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -957,7 +956,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -977,7 +976,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -1003,7 +1002,7 @@ static BOOL srv_io_srv_share_ctr(const char *desc, SRV_SHARE_INFO_CTR *ctr, prs_
                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;
@@ -1053,7 +1052,7 @@ void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n,
  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;
@@ -1088,7 +1087,7 @@ BOOL srv_io_q_net_share_enum(const char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_st
  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;
@@ -1118,7 +1117,7 @@ BOOL srv_io_r_net_share_enum(const char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_st
  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;
@@ -1137,7 +1136,7 @@ BOOL init_srv_q_net_share_get_info(SRV_Q_NET_SHARE_GET_INFO *q_n, const char *sr
  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;
@@ -1169,7 +1168,7 @@ BOOL srv_io_q_net_share_get_info(const char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n
  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;
@@ -1280,7 +1279,7 @@ static BOOL srv_io_srv_share_info(const char *desc, prs_struct *ps, int depth, S
  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;
@@ -1307,7 +1306,7 @@ BOOL srv_io_r_net_share_get_info(const char *desc, SRV_R_NET_SHARE_GET_INFO *r_n
  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, 
@@ -1335,7 +1334,7 @@ BOOL init_srv_q_net_share_set_info(SRV_Q_NET_SHARE_SET_INFO *q_n,
  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;
@@ -1382,7 +1381,7 @@ BOOL srv_io_q_net_share_set_info(const char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n
  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;
@@ -1413,7 +1412,7 @@ BOOL srv_io_r_net_share_set_info(const char *desc, SRV_R_NET_SHARE_SET_INFO *r_n
  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;
@@ -1495,7 +1494,7 @@ void init_srv_q_net_share_add(SRV_Q_NET_SHARE_ADD *q, const char *srvname,
  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;
@@ -1537,7 +1536,7 @@ void init_srv_q_net_share_del(SRV_Q_NET_SHARE_DEL *del, const char *srvname,
  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;
@@ -1568,7 +1567,7 @@ BOOL srv_io_q_net_share_del(const char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_stru
  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;
@@ -1594,7 +1593,7 @@ void init_srv_sess_info0( SESS_INFO_0 *ss0, const char *name )
        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;
                }
@@ -1606,7 +1605,7 @@ void init_srv_sess_info0( SESS_INFO_0 *ss0, const char *name )
  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;
@@ -1667,7 +1666,7 @@ void init_srv_sess_info1( SESS_INFO_1 *ss1, const char *name, const char *user,
        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;
                }
@@ -1675,7 +1674,7 @@ void init_srv_sess_info1( SESS_INFO_1 *ss1, const char *name, const char *user,
        }
 
        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;
                }
@@ -1693,7 +1692,7 @@ void init_srv_sess_info1( SESS_INFO_1 *ss1, const char *name, const char *user,
  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;
@@ -1761,7 +1760,7 @@ static BOOL srv_io_srv_sess_info_1(const char *desc, SRV_SESS_INFO_1 *ss1, prs_s
  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;
 
@@ -1809,7 +1808,7 @@ static BOOL srv_io_srv_sess_ctr(const char *desc, SRV_SESS_INFO_CTR **pp_ctr, pr
  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;
@@ -1820,19 +1819,22 @@ BOOL srv_io_q_net_sess_enum(const char *desc, SRV_Q_NET_SESS_ENUM *q_u, prs_stru
        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))
@@ -1859,7 +1861,7 @@ BOOL srv_io_q_net_sess_enum(const char *desc, SRV_Q_NET_SESS_ENUM *q_u, prs_stru
  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;
@@ -1906,7 +1908,7 @@ void init_srv_q_net_sess_del(SRV_Q_NET_SESS_DEL *q_n, const char *srv_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)
+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;
@@ -1944,7 +1946,7 @@ BOOL srv_io_q_net_sess_del(const char *desc, SRV_Q_NET_SESS_DEL *q_n, prs_struct
  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;
@@ -1976,7 +1978,7 @@ void init_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id)
  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;
@@ -1997,7 +1999,7 @@ static BOOL srv_io_conn_info0(const char *desc, CONN_INFO_0 *ss0, prs_struct *ps
  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;
@@ -2052,7 +2054,7 @@ void init_srv_conn_info1_str(CONN_INFO_1_STR *ss1, const char *usr_name, const c
  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;
@@ -2096,7 +2098,7 @@ void init_srv_conn_info1(CONN_INFO_1 *ss1,
  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;
@@ -2130,7 +2132,7 @@ static BOOL srv_io_conn_info1(const char *desc, CONN_INFO_1 *ss1, prs_struct *ps
  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;
@@ -2178,7 +2180,7 @@ static BOOL srv_io_srv_conn_info_1(const char *desc, SRV_CONN_INFO_1 *ss1, prs_s
  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;
 
@@ -2249,7 +2251,7 @@ void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n,
  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;
@@ -2297,7 +2299,7 @@ BOOL srv_io_q_net_conn_enum(const char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_stru
  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;
@@ -2330,7 +2332,7 @@ BOOL srv_io_r_net_conn_enum(const char *desc,  SRV_R_NET_CONN_ENUM *r_n, prs_str
  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;
@@ -2366,13 +2368,13 @@ void init_srv_file_info3( FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_
        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);
         }
@@ -2384,7 +2386,7 @@ void init_srv_file_info3( FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_
  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;
 
@@ -2429,7 +2431,7 @@ static BOOL srv_io_file_info3(const char *desc, FILE_INFO_3 *fl3, prs_struct *ps
  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;
@@ -2466,7 +2468,7 @@ static BOOL srv_io_srv_file_ctr(const char *desc, SRV_FILE_INFO_CTR *ctr, prs_st
                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;
@@ -2505,19 +2507,19 @@ void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n,
        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);
        }
@@ -2536,7 +2538,7 @@ void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n,
  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;
@@ -2547,17 +2549,20 @@ BOOL srv_io_q_net_file_enum(const char *desc, SRV_Q_NET_FILE_ENUM *q_u, prs_stru
        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;
@@ -2583,7 +2588,7 @@ BOOL srv_io_q_net_file_enum(const char *desc, SRV_Q_NET_FILE_ENUM *q_u, prs_stru
  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;
@@ -2612,22 +2617,6 @@ BOOL srv_io_r_net_file_enum(const char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_stru
        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.
  ********************************************************************/
@@ -2644,7 +2633,7 @@ void init_srv_info_100(SRV_INFO_100 *sv100, uint32 platform_id, const char *name
  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;
@@ -2689,7 +2678,7 @@ void init_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, const char *name
  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;
@@ -2759,7 +2748,7 @@ void init_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, const char *name
  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;
@@ -2818,7 +2807,7 @@ static BOOL srv_io_info_102(const char *desc, SRV_INFO_102 *sv102, prs_struct *p
  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;
@@ -2878,7 +2867,7 @@ void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
  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;
@@ -2942,7 +2931,7 @@ void init_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv,
  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");
@@ -2979,7 +2968,7 @@ BOOL srv_io_q_net_srv_set_info(const char *desc, SRV_Q_NET_SRV_SET_INFO *q_n,
  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;
@@ -3003,7 +2992,7 @@ BOOL srv_io_r_net_srv_get_info(const char *desc, SRV_R_NET_SRV_GET_INFO *r_n, pr
  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");
@@ -3025,7 +3014,7 @@ BOOL srv_io_r_net_srv_set_info(const char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
  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;
@@ -3048,7 +3037,7 @@ BOOL srv_io_q_net_remote_tod(const char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_st
  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;
@@ -3117,7 +3106,7 @@ void init_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
  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;
@@ -3144,7 +3133,7 @@ BOOL srv_io_r_net_remote_tod(const char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_st
  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
@@ -3169,7 +3158,7 @@ BOOL init_srv_q_net_disk_enum(SRV_Q_NET_DISK_ENUM *q_n,
  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;
@@ -3213,7 +3202,7 @@ BOOL srv_io_q_net_disk_enum(const char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_stru
  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;
@@ -3246,7 +3235,7 @@ BOOL srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_stru
 
        r_n->disk_enum_ctr.entries_read = entries_read3;
 
-       if(UNMARSHALLING(ps)) {
+       if(UNMARSHALLING(ps) && entries_read3) {
 
                DISK_INFO *dinfo;
 
@@ -3255,7 +3244,7 @@ BOOL srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_stru
                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;
@@ -3283,7 +3272,7 @@ BOOL srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_stru
  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;
@@ -3294,7 +3283,8 @@ BOOL srv_io_q_net_name_validate(const char *desc, SRV_Q_NET_NAME_VALIDATE *q_n,
        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))
@@ -3319,7 +3309,7 @@ BOOL srv_io_q_net_name_validate(const char *desc, SRV_Q_NET_NAME_VALIDATE *q_n,
  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;
@@ -3340,7 +3330,7 @@ BOOL srv_io_r_net_name_validate(const char *desc, SRV_R_NET_NAME_VALIDATE *r_n,
  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;
@@ -3388,7 +3378,7 @@ BOOL srv_io_q_net_file_query_secdesc(const char *desc, SRV_Q_NET_FILE_QUERY_SECD
  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;
@@ -3427,7 +3417,7 @@ BOOL srv_io_r_net_file_query_secdesc(const char *desc, SRV_R_NET_FILE_QUERY_SECD
  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;
@@ -3484,7 +3474,7 @@ BOOL srv_io_q_net_file_set_secdesc(const char *desc, SRV_Q_NET_FILE_SET_SECDESC
  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;
@@ -3511,47 +3501,3 @@ void init_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_u, const char *server)
        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;
-}