RIP BOOL. Convert BOOL -> bool. I found a few interesting
[samba.git] / source3 / rpc_parse / parse_ds.c
index 9155419ae438848b59ab9fb0e9ef844719f2a3fe..8f3ce361e7439a553ca433a84977642768e34abc 100644 (file)
@@ -6,7 +6,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,
@@ -15,8 +15,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"
 /************************************************************************
 ************************************************************************/
 
-static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSROLE_PRIMARY_DOMAIN_INFO_BASIC **basic)
+static bool ds_io_dominfobasic(const char *desc, DSROLE_PRIMARY_DOMAIN_INFO_BASIC **basic, prs_struct *ps, int depth)
 {
        DSROLE_PRIMARY_DOMAIN_INFO_BASIC *p = *basic;
        
-       if ( UNMARSHALLING(ps) )
+       if ( UNMARSHALLING(ps) ) {
                p = *basic = PRS_ALLOC_MEM(ps, DSROLE_PRIMARY_DOMAIN_INFO_BASIC, 1);
+       }
                
        if ( !p )
                return False;
                
        if ( !prs_uint16("machine_role", ps, depth, &p->machine_role) )
                return False;
-       if ( !prs_uint16("unknown", ps, depth, &p->unknown) )
+       if ( !prs_align(ps) )
                return False;
 
        if ( !prs_uint32("flags", ps, depth, &p->flags) )
@@ -75,7 +75,7 @@ static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSR
 /************************************************************************
 ************************************************************************/
 
-BOOL ds_io_q_getprimdominfo( const char *desc, prs_struct *ps, int depth, DS_Q_GETPRIMDOMINFO *q_u)
+bool ds_io_q_getprimdominfo( const char *desc, DS_Q_GETPRIMDOMINFO *q_u, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "ds_io_q_getprimdominfo");
        depth++;
@@ -92,7 +92,7 @@ BOOL ds_io_q_getprimdominfo( const char *desc, prs_struct *ps, int depth, DS_Q_G
 /************************************************************************
 ************************************************************************/
 
-BOOL ds_io_r_getprimdominfo( const char *desc, prs_struct *ps, int depth, DS_R_GETPRIMDOMINFO *r_u)
+bool ds_io_r_getprimdominfo( const char *desc, DS_R_GETPRIMDOMINFO *r_u, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "ds_io_r_getprimdominfo");
        depth++;
@@ -114,7 +114,7 @@ BOOL ds_io_r_getprimdominfo( const char *desc, prs_struct *ps, int depth, DS_R_G
                switch ( r_u->level )
                {
                        case DsRolePrimaryDomainInfoBasic:
-                               if ( !ds_io_dominfobasic( "dominfobasic", ps, depth, &r_u->info.basic ) )
+                               if ( !ds_io_dominfobasic( "dominfobasic", &r_u->info.basic, ps, depth) )
                                        return False;
                                break;
                        default:
@@ -135,8 +135,7 @@ BOOL ds_io_r_getprimdominfo( const char *desc, prs_struct *ps, int depth, DS_R_G
  initialize a DS_ENUM_DOM_TRUSTS structure
 ************************************************************************/
 
-BOOL init_q_ds_enum_domain_trusts( DS_Q_ENUM_DOM_TRUSTS *q, const char *server, 
-                                 uint32 flags )
+bool init_q_ds_enum_domain_trusts( DS_Q_ENUM_DOM_TRUSTS *q, const char *server, uint32 flags )
 {
        q->flags = flags;
        
@@ -153,7 +152,7 @@ BOOL init_q_ds_enum_domain_trusts( DS_Q_ENUM_DOM_TRUSTS *q, const char *server,
 /************************************************************************
 ************************************************************************/
 
-static BOOL ds_io_domain_trusts( const char *desc, prs_struct *ps, int depth, DS_DOMAIN_TRUSTS *trust)
+static bool ds_io_domain_trusts( const char *desc, DS_DOMAIN_TRUSTS *trust, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "ds_io_dom_trusts_ctr");
        depth++;
@@ -188,7 +187,7 @@ static BOOL ds_io_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
 /************************************************************************
 ************************************************************************/
 
-static BOOL ds_io_dom_trusts_ctr( const char *desc, prs_struct *ps, int depth, DS_DOMAIN_TRUSTS_CTR *ctr)
+static bool ds_io_dom_trusts_ctr( const char *desc, DS_DOMAIN_TRUSTS_CTR *ctr, prs_struct *ps, int depth)
 {
        int i;
 
@@ -217,7 +216,7 @@ static BOOL ds_io_dom_trusts_ctr( const char *desc, prs_struct *ps, int depth, D
           we need another loop to read the UNISTR2's and SID's */
           
        for ( i=0; i<ctr->max_count;i++ ) {
-               if ( !ds_io_domain_trusts("domain_trusts", ps, depth, &ctr->trusts[i] ) )
+               if ( !ds_io_domain_trusts("domain_trusts", &ctr->trusts[i], ps, depth) )
                        return False;
        }
 
@@ -248,7 +247,7 @@ static BOOL ds_io_dom_trusts_ctr( const char *desc, prs_struct *ps, int depth, D
  initialize a DS_ENUM_DOM_TRUSTS request
 ************************************************************************/
 
-BOOL ds_io_q_enum_domain_trusts( const char *desc, prs_struct *ps, int depth, DS_Q_ENUM_DOM_TRUSTS *q_u)
+bool ds_io_q_enum_domain_trusts( const char *desc, DS_Q_ENUM_DOM_TRUSTS *q_u, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "ds_io_q_enum_domain_trusts");
        depth++;
@@ -274,7 +273,7 @@ BOOL ds_io_q_enum_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
 /************************************************************************
 ************************************************************************/
 
-BOOL ds_io_r_enum_domain_trusts( const char *desc, prs_struct *ps, int depth, DS_R_ENUM_DOM_TRUSTS *r_u)
+bool ds_io_r_enum_domain_trusts( const char *desc, DS_R_ENUM_DOM_TRUSTS *r_u, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "ds_io_r_enum_domain_trusts");
        depth++;
@@ -286,7 +285,7 @@ BOOL ds_io_r_enum_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
                return False;
                
        if ( r_u->num_domains ) {
-               if ( !ds_io_dom_trusts_ctr("domains", ps, depth, &r_u->domains ) )
+               if ( !ds_io_dom_trusts_ctr("domains", &r_u->domains, ps, depth) )
                        return False;
        }
                
@@ -298,5 +297,3 @@ BOOL ds_io_r_enum_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
                
        return True;
 }
-
-