2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Gerald (Jerry) Carter 2005.
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.
24 #define DBGC_CLASS DBGC_RPC_PARSE
26 /*******************************************************************
27 ********************************************************************/
29 BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth)
34 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_version");
37 /* there is nothing to parse in this PDU */
43 /*******************************************************************
44 ********************************************************************/
46 BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth)
51 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_version");
57 if(!prs_uint32("version", ps, depth, &r_u->version))
60 if(!prs_werror("status", ps, depth, &r_u->status))
66 /*******************************************************************
67 ********************************************************************/
69 BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth)
74 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list_size");
80 if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
85 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
92 /*******************************************************************
93 ********************************************************************/
95 BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth)
100 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
106 if(!prs_uint32("size", ps, depth, &r_u->size))
109 if(!prs_werror("status", ps, depth, &r_u->status))
116 /*******************************************************************
117 ********************************************************************/
119 BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth)
124 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list");
130 if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
135 if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
137 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
144 /*******************************************************************
145 ********************************************************************/
147 BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth)
152 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
158 if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) )
163 if(!prs_uint32("needed", ps, depth, &r_u->needed))
166 if(!prs_werror("status", ps, depth, &r_u->status))
172 /*******************************************************************
173 ********************************************************************/
175 BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth)
180 prs_debug(ps, depth, desc, "ntsvcs_io_q_validate_device_instance");
186 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
191 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
198 /*******************************************************************
199 ********************************************************************/
201 BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth)
206 prs_debug(ps, depth, desc, "ntsvcs_io_r_validate_device_instance");
209 if(!prs_werror("status", ps, depth, &r_u->status))
215 /*******************************************************************
216 ********************************************************************/
218 BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth)
223 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_reg_property");
229 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
234 if ( !prs_uint32("property", ps, depth, &q_u->property) )
236 if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
238 if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) )
240 if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) )
242 if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
249 /*******************************************************************
250 ********************************************************************/
252 BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth)
257 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
260 if ( !prs_align(ps) )
263 if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
266 if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) )
268 if ( !prs_align(ps) )
271 if ( !prs_uint32("size", ps, depth, &r_u->size) )
274 if ( !prs_uint32("needed", ps, depth, &r_u->needed) )
277 if(!prs_werror("status", ps, depth, &r_u->status))
283 /*******************************************************************
284 ********************************************************************/
286 BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth)
291 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_hw_profile_info");
297 if ( !prs_uint32("index", ps, depth, &q_u->index) )
300 q_u->buffer_size = 0x000000a8;
302 if ( UNMARSHALLING(ps) )
303 q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size );
305 if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) )
308 if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
311 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
318 /*******************************************************************
319 ********************************************************************/
321 BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth)
326 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
329 if ( !prs_align(ps) )
332 if ( UNMARSHALLING(ps) )
333 r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size );
335 if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) )
338 if(!prs_werror("status", ps, depth, &r_u->status))
344 /*******************************************************************
345 ********************************************************************/
347 BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth)
352 prs_debug(ps, depth, desc, "ntsvcs_io_q_hw_profile_flags");
358 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
362 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
367 if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
369 if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) )
371 if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) )
373 if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
375 if ( !prs_uint32("unknown6", ps, depth, &q_u->unknown6) )
377 if ( !prs_uint32("unknown7", ps, depth, &q_u->unknown7) )
380 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
387 /*******************************************************************
388 ********************************************************************/
390 BOOL ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth)
395 prs_debug(ps, depth, desc, "ntsvcs_io_r_hw_profile_flags");
398 if ( !prs_align(ps) )
401 if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
403 if ( !prs_uint32("unknown2", ps, depth, &r_u->unknown2) )
405 if ( !prs_uint32("unknown3", ps, depth, &r_u->unknown3) )
407 if(!prs_werror("status", ps, depth, &r_u->status))