1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
/* parser auto-generated by pidl */
#include "includes.h"
NTSTATUS ndr_push_dfs_Exist(struct ndr_push *ndr, struct dfs_Exist *r)
{
return NT_STATUS_OK;
}
NTSTATUS ndr_push_dfs_Add(struct ndr_push *ndr, struct dfs_Add *r)
{
NDR_CHECK(ndr_push_ptr(ndr, r->in.path));
if (r->in.path) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.path));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.server));
if (r->in.server) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.server));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.share));
if (r->in.share) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.share));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.comment));
if (r->in.comment) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.comment));
}
NDR_CHECK(ndr_push_uint32(ndr, r->in.flags));
return NT_STATUS_OK;
}
NTSTATUS ndr_push_dfs_Remove(struct ndr_push *ndr, struct dfs_Remove *r)
{
NDR_CHECK(ndr_push_unistr(ndr, r->in.path));
NDR_CHECK(ndr_push_ptr(ndr, r->in.server));
if (r->in.server) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.server));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.share));
if (r->in.share) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.share));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_push_dfs_UNKNOWN3(struct ndr_push *ndr, struct dfs_UNKNOWN3 *r)
{
return NT_STATUS_OK;
}
NTSTATUS ndr_push_dfs_Info(struct ndr_push *ndr, struct dfs_Info *r)
{
NDR_CHECK(ndr_push_unistr_noterm(ndr, r->in.path));
NDR_CHECK(ndr_push_ptr(ndr, r->in.server));
if (r->in.server) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.server));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.share));
if (r->in.share) {
NDR_CHECK(ndr_push_unistr(ndr, r->in.share));
}
NDR_CHECK(ndr_push_uint16(ndr, r->in.level));
return NT_STATUS_OK;
}
static NTSTATUS ndr_push_dfs_String(struct ndr_push *ndr, int ndr_flags, struct dfs_String *r)
{
NDR_CHECK(ndr_push_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_ptr(ndr, r->str));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->str) {
NDR_CHECK(ndr_push_unistr(ndr, r->str));
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_push_dfs_Enum1(struct ndr_push *ndr, int ndr_flags, struct dfs_Enum1 *r)
{
NDR_CHECK(ndr_push_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_uint32(ndr, r->count));
NDR_CHECK(ndr_push_ptr(ndr, r->s));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->s) {
NDR_CHECK(ndr_push_uint32(ndr, r->count));
NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_String));
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_flags, uint16 level, union dfs_EnumInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_uint16(ndr, level));
switch (level) {
case 1:
NDR_CHECK(ndr_push_ptr(ndr, r->enum1));
break;
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
switch (level) {
case 1:
if (r->enum1) {
NDR_CHECK(ndr_push_dfs_Enum1(ndr, ndr_flags, r->enum1));
}
break;
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_push_dfs_EnumStruct(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumStruct *r)
{
NDR_CHECK(ndr_push_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_uint32(ndr, r->level));
NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_SCALARS, r->level, &r->e));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_BUFFERS, r->level, &r->e));
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_push_dfs_Enum(struct ndr_push *ndr, struct dfs_Enum *r)
{
NDR_CHECK(ndr_push_uint32(ndr, r->in.level));
NDR_CHECK(ndr_push_uint32(ndr, r->in.bufsize));
NDR_CHECK(ndr_push_ptr(ndr, r->in.info));
if (r->in.info) {
NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.unknown));
if (r->in.unknown) {
NDR_CHECK(ndr_push_uint32(ndr, *r->in.unknown));
}
NDR_CHECK(ndr_push_ptr(ndr, r->in.total));
if (r->in.total) {
NDR_CHECK(ndr_push_uint32(ndr, *r->in.total));
}
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_Exist(struct ndr_pull *ndr, struct dfs_Exist *r)
{
NDR_CHECK(ndr_pull_uint32(ndr, r->out.exist_flag));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_Add(struct ndr_pull *ndr, struct dfs_Add *r)
{
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_Remove(struct ndr_pull *ndr, struct dfs_Remove *r)
{
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_UNKNOWN3(struct ndr_pull *ndr, struct dfs_UNKNOWN3 *r)
{
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_Info(struct ndr_pull *ndr, struct dfs_Info *r)
{
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
}
static NTSTATUS ndr_pull_dfs_String(struct ndr_pull *ndr, int ndr_flags, struct dfs_String *r)
{
uint32 _ptr_str;
NDR_CHECK(ndr_pull_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_str));
if (_ptr_str) {
NDR_ALLOC(ndr, r->str);
} else {
r->str = NULL;
}
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->str) {
NDR_CHECK(ndr_pull_unistr(ndr, &r->str));
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_pull_dfs_Enum1(struct ndr_pull *ndr, int ndr_flags, struct dfs_Enum1 *r)
{
uint32 _ptr_s;
NDR_CHECK(ndr_pull_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_pull_uint32(ndr, &r->count));
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s));
if (_ptr_s) {
NDR_ALLOC(ndr, r->s);
} else {
r->s = NULL;
}
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->s) {
{
uint32 _array_size;
NDR_CHECK(ndr_pull_uint32(ndr, &_array_size));
if (r->count > _array_size) {
return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count);
}
}
NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0]));
NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_String));
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union dfs_EnumInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_pull_uint16(ndr, level));
switch (*level) {
case 1: {
uint32 _ptr_enum1;
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_enum1));
if (_ptr_enum1) {
NDR_ALLOC(ndr, r->enum1);
} else {
r->enum1 = NULL;
}
break; }
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level);
}
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
switch (*level) {
case 1:
if (r->enum1) {
NDR_CHECK(ndr_pull_dfs_Enum1(ndr, NDR_SCALARS|NDR_BUFFERS, r->enum1));
}
break;
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level);
}
done:
return NT_STATUS_OK;
}
static NTSTATUS ndr_pull_dfs_EnumStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumStruct *r)
{
NDR_CHECK(ndr_pull_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_pull_uint32(ndr, &r->level));
{ uint16 _level;
NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e));
if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e");
}
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
{ uint16 _level;
NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_BUFFERS, &_level, &r->e));
if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e");
}
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_dfs_Enum(struct ndr_pull *ndr, struct dfs_Enum *r)
{
uint32 _ptr_info;
uint32 _ptr_total;
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info));
if (_ptr_info) {
NDR_ALLOC(ndr, r->out.info);
} else {
r->out.info = NULL;
}
if (r->out.info) {
NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
}
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_total));
if (_ptr_total) {
NDR_ALLOC(ndr, r->out.total);
} else {
r->out.total = NULL;
}
if (r->out.total) {
NDR_CHECK(ndr_pull_uint32(ndr, r->out.total));
}
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
}
void ndr_print_dfs_String(struct ndr_print *ndr, const char *name, struct dfs_String *r)
{
ndr_print_struct(ndr, name, "dfs_String");
ndr->depth++;
ndr_print_ptr(ndr, "str", r->str);
ndr->depth++;
if (r->str) {
ndr_print_unistr(ndr, "str", r->str);
}
ndr->depth--;
ndr->depth--;
}
void ndr_print_dfs_Enum1(struct ndr_print *ndr, const char *name, struct dfs_Enum1 *r)
{
ndr_print_struct(ndr, name, "dfs_Enum1");
ndr->depth++;
ndr_print_uint32(ndr, "count", r->count);
ndr_print_ptr(ndr, "s", r->s);
ndr->depth++;
if (r->s) {
ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_String);
}
ndr->depth--;
ndr->depth--;
}
void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, uint16 level, union dfs_EnumInfo *r)
{
ndr_print_union(ndr, name, level, "dfs_EnumInfo");
switch (level) {
case 1:
ndr_print_ptr(ndr, "enum1", r->enum1);
ndr->depth++;
if (r->enum1) {
ndr_print_dfs_Enum1(ndr, "enum1", r->enum1);
}
ndr->depth--;
break;
default:
ndr_print_bad_level(ndr, name, level);
}
}
void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, struct dfs_EnumStruct *r)
{
ndr_print_struct(ndr, name, "dfs_EnumStruct");
ndr->depth++;
ndr_print_uint32(ndr, "level", r->level);
ndr_print_dfs_EnumInfo(ndr, "e", r->level, &r->e);
ndr->depth--;
}
|