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 3 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, see <http://www.gnu.org/licenses/>.
23 #define DBGC_CLASS DBGC_RPC_PARSE
25 /*******************************************************************
26 ********************************************************************/
28 BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth)
33 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_version");
36 /* there is nothing to parse in this PDU */
42 /*******************************************************************
43 ********************************************************************/
45 BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth)
50 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_version");
56 if(!prs_uint32("version", ps, depth, &r_u->version))
59 if(!prs_werror("status", ps, depth, &r_u->status))
65 /*******************************************************************
66 ********************************************************************/
68 BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth)
73 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list_size");
79 if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
84 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
91 /*******************************************************************
92 ********************************************************************/
94 BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth)
99 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
105 if(!prs_uint32("size", ps, depth, &r_u->size))
108 if(!prs_werror("status", ps, depth, &r_u->status))
115 /*******************************************************************
116 ********************************************************************/
118 BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth)
123 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list");
129 if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
134 if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
136 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
143 /*******************************************************************
144 ********************************************************************/
146 BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth)
151 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
157 if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) )
162 if(!prs_uint32("needed", ps, depth, &r_u->needed))
165 if(!prs_werror("status", ps, depth, &r_u->status))
171 /*******************************************************************
172 ********************************************************************/
174 BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth)
179 prs_debug(ps, depth, desc, "ntsvcs_io_q_validate_device_instance");
185 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
190 if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
197 /*******************************************************************
198 ********************************************************************/
200 BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth)
205 prs_debug(ps, depth, desc, "ntsvcs_io_r_validate_device_instance");
208 if(!prs_werror("status", ps, depth, &r_u->status))
214 /*******************************************************************
215 ********************************************************************/
217 BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth)
222 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_reg_property");
228 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
233 if ( !prs_uint32("property", ps, depth, &q_u->property) )
235 if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
237 if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) )
239 if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) )
241 if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
248 /*******************************************************************
249 ********************************************************************/
251 BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth)
256 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
259 if ( !prs_align(ps) )
262 if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
265 if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) )
267 if ( !prs_align(ps) )
270 if ( !prs_uint32("size", ps, depth, &r_u->size) )
273 if ( !prs_uint32("needed", ps, depth, &r_u->needed) )
276 if(!prs_werror("status", ps, depth, &r_u->status))
282 /*******************************************************************
283 ********************************************************************/
285 BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth)
290 prs_debug(ps, depth, desc, "ntsvcs_io_q_get_hw_profile_info");
296 if ( !prs_uint32("index", ps, depth, &q_u->index) )
299 q_u->buffer_size = 0x000000a8;
301 if ( UNMARSHALLING(ps) ) {
302 q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size );
308 if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) )
311 if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
314 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
321 /*******************************************************************
322 ********************************************************************/
324 BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth)
329 prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
332 if ( !prs_align(ps) )
335 if ( UNMARSHALLING(ps) ) {
336 if (r_u->buffer_size) {
337 r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size );
346 if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) )
349 if(!prs_werror("status", ps, depth, &r_u->status))
355 /*******************************************************************
356 ********************************************************************/
358 BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth)
363 prs_debug(ps, depth, desc, "ntsvcs_io_q_hw_profile_flags");
369 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
373 if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
378 if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
380 if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) )
382 if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) )
384 if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
386 if ( !prs_uint32("unknown6", ps, depth, &q_u->unknown6) )
388 if ( !prs_uint32("unknown7", ps, depth, &q_u->unknown7) )
391 if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
398 /*******************************************************************
399 ********************************************************************/
401 BOOL ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth)
406 prs_debug(ps, depth, desc, "ntsvcs_io_r_hw_profile_flags");
409 if ( !prs_align(ps) )
412 if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
414 if ( !prs_uint32("unknown2", ps, depth, &r_u->unknown2) )
416 if ( !prs_uint32("unknown3", ps, depth, &r_u->unknown3) )
418 if(!prs_werror("status", ps, depth, &r_u->status))