2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Gerald Carter 2002
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSROLE_PRIMARY_DOMAIN_INFO_BASIC **basic)
25 DSROLE_PRIMARY_DOMAIN_INFO_BASIC *p = *basic;
27 if ( UNMARSHALLING(ps) )
28 p = *basic = (DSROLE_PRIMARY_DOMAIN_INFO_BASIC *)prs_alloc_mem(ps, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC));
33 if ( !prs_uint16("machine_role", ps, depth, &p->machine_role) )
35 if ( !prs_uint16("unknown", ps, depth, &p->unknown) )
38 if ( !prs_uint32("flags", ps, depth, &p->flags) )
41 if ( !prs_uint32("netbios_ptr", ps, depth, &p->netbios_ptr) )
43 if ( !prs_uint32("dnsname_ptr", ps, depth, &p->dnsname_ptr) )
45 if ( !prs_uint32("forestname_ptr", ps, depth, &p->forestname_ptr) )
48 if ( !prs_uint8s(False, "domain_guid", ps, depth, p->domain_guid.info, GUID_SIZE) )
51 if ( !smb_io_unistr2( "netbios_domain", &p->netbios_domain, p->netbios_ptr, ps, depth) )
56 if ( !smb_io_unistr2( "dns_domain", &p->dns_domain, p->dnsname_ptr, ps, depth) )
61 if ( !smb_io_unistr2( "forest_domain", &p->forest_domain, p->forestname_ptr, ps, depth) )
71 BOOL ds_io_q_getprimdominfo( const char *desc, DS_Q_GETPRIMDOMINFO *q_u, prs_struct *ps, int depth)
73 prs_debug(ps, depth, desc, "ds_io_q_getprimdominfo");
79 if ( !prs_uint16( "level", ps, depth, &q_u->level ) )
85 BOOL ds_io_r_getprimdominfo( const char *desc, DS_R_GETPRIMDOMINFO *r_u, prs_struct *ps, int depth)
87 prs_debug(ps, depth, desc, "ds_io_r_getprimdominfo");
93 if ( !prs_uint32( "ptr", ps, depth, &r_u->ptr ) )
98 if ( !prs_uint16( "level", ps, depth, &r_u->level ) )
101 if ( !prs_uint16( "unknown0", ps, depth, &r_u->unknown0 ) )
104 switch ( r_u->level )
106 case DsRolePrimaryDomainInfoBasic:
107 if ( !ds_io_dominfobasic( "dominfobasic", ps, depth, &r_u->info.basic ) )
115 if ( !prs_align(ps) )
118 if ( !prs_ntstatus("status", ps, depth, &r_u->status ) )