1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * RPC Pipe client / server routines
|
---|
4 | * Copyright (C) Gerald (Jerry) Carter 2005.
|
---|
5 | *
|
---|
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.
|
---|
10 | *
|
---|
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.
|
---|
15 | *
|
---|
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/>.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #include "includes.h"
|
---|
21 |
|
---|
22 | #undef DBGC_CLASS
|
---|
23 | #define DBGC_CLASS DBGC_RPC_PARSE
|
---|
24 |
|
---|
25 | /*******************************************************************
|
---|
26 | ********************************************************************/
|
---|
27 |
|
---|
28 | bool ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth)
|
---|
29 | {
|
---|
30 | if (q_u == NULL)
|
---|
31 | return False;
|
---|
32 |
|
---|
33 | prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list");
|
---|
34 | depth++;
|
---|
35 |
|
---|
36 | if(!prs_align(ps))
|
---|
37 | return False;
|
---|
38 |
|
---|
39 | if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
|
---|
40 | return False;
|
---|
41 | if( !prs_align(ps) )
|
---|
42 | return False;
|
---|
43 |
|
---|
44 | if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
|
---|
45 | return False;
|
---|
46 | if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
|
---|
47 | return False;
|
---|
48 |
|
---|
49 | return True;
|
---|
50 |
|
---|
51 | }
|
---|
52 |
|
---|
53 | /*******************************************************************
|
---|
54 | ********************************************************************/
|
---|
55 |
|
---|
56 | bool ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth)
|
---|
57 | {
|
---|
58 | if ( !r_u )
|
---|
59 | return False;
|
---|
60 |
|
---|
61 | prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
|
---|
62 | depth++;
|
---|
63 |
|
---|
64 | if(!prs_align(ps))
|
---|
65 | return False;
|
---|
66 |
|
---|
67 | if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) )
|
---|
68 | return False;
|
---|
69 | if(!prs_align(ps))
|
---|
70 | return False;
|
---|
71 |
|
---|
72 | if(!prs_uint32("needed", ps, depth, &r_u->needed))
|
---|
73 | return False;
|
---|
74 |
|
---|
75 | if(!prs_werror("status", ps, depth, &r_u->status))
|
---|
76 | return False;
|
---|
77 |
|
---|
78 | return True;
|
---|
79 | }
|
---|
80 |
|
---|
81 | /*******************************************************************
|
---|
82 | ********************************************************************/
|
---|
83 |
|
---|
84 | bool ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth)
|
---|
85 | {
|
---|
86 | if (q_u == NULL)
|
---|
87 | return False;
|
---|
88 |
|
---|
89 | prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_reg_property");
|
---|
90 | depth++;
|
---|
91 |
|
---|
92 | if(!prs_align(ps))
|
---|
93 | return False;
|
---|
94 |
|
---|
95 | if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
|
---|
96 | return False;
|
---|
97 | if( !prs_align(ps) )
|
---|
98 | return False;
|
---|
99 |
|
---|
100 | if ( !prs_uint32("property", ps, depth, &q_u->property) )
|
---|
101 | return False;
|
---|
102 | if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
|
---|
103 | return False;
|
---|
104 | if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) )
|
---|
105 | return False;
|
---|
106 | if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) )
|
---|
107 | return False;
|
---|
108 | if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
|
---|
109 | return False;
|
---|
110 |
|
---|
111 | return True;
|
---|
112 |
|
---|
113 | }
|
---|
114 |
|
---|
115 | /*******************************************************************
|
---|
116 | ********************************************************************/
|
---|
117 |
|
---|
118 | bool ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth)
|
---|
119 | {
|
---|
120 | if ( !r_u )
|
---|
121 | return False;
|
---|
122 |
|
---|
123 | prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
|
---|
124 | depth++;
|
---|
125 |
|
---|
126 | if ( !prs_align(ps) )
|
---|
127 | return False;
|
---|
128 |
|
---|
129 | if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
|
---|
130 | return False;
|
---|
131 |
|
---|
132 | if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) )
|
---|
133 | return False;
|
---|
134 | if ( !prs_align(ps) )
|
---|
135 | return False;
|
---|
136 |
|
---|
137 | if ( !prs_uint32("size", ps, depth, &r_u->size) )
|
---|
138 | return False;
|
---|
139 |
|
---|
140 | if ( !prs_uint32("needed", ps, depth, &r_u->needed) )
|
---|
141 | return False;
|
---|
142 |
|
---|
143 | if(!prs_werror("status", ps, depth, &r_u->status))
|
---|
144 | return False;
|
---|
145 |
|
---|
146 | return True;
|
---|
147 | }
|
---|