~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/ndr_ntprinting_c.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* client functions auto-generated by pidl */
 
2
 
 
3
#include "includes.h"
 
4
#include <tevent.h>
 
5
#include "lib/util/tevent_ntstatus.h"
 
6
#include "librpc/gen_ndr/ndr_ntprinting.h"
 
7
#include "librpc/gen_ndr/ndr_ntprinting_c.h"
 
8
 
 
9
/* ntprinting - client functions generated by pidl */
 
10
 
 
11
struct dcerpc_decode_ntprinting_form_r_state {
 
12
        TALLOC_CTX *out_mem_ctx;
 
13
};
 
14
 
 
15
static void dcerpc_decode_ntprinting_form_r_done(struct tevent_req *subreq);
 
16
 
 
17
struct tevent_req *dcerpc_decode_ntprinting_form_r_send(TALLOC_CTX *mem_ctx,
 
18
        struct tevent_context *ev,
 
19
        struct dcerpc_binding_handle *h,
 
20
        struct decode_ntprinting_form *r)
 
21
{
 
22
        struct tevent_req *req;
 
23
        struct dcerpc_decode_ntprinting_form_r_state *state;
 
24
        struct tevent_req *subreq;
 
25
 
 
26
        req = tevent_req_create(mem_ctx, &state,
 
27
                                struct dcerpc_decode_ntprinting_form_r_state);
 
28
        if (req == NULL) {
 
29
                return NULL;
 
30
        }
 
31
 
 
32
        state->out_mem_ctx = NULL;
 
33
 
 
34
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
35
                        NULL, &ndr_table_ntprinting,
 
36
                        NDR_DECODE_NTPRINTING_FORM, state, r);
 
37
        if (tevent_req_nomem(subreq, req)) {
 
38
                return tevent_req_post(req, ev);
 
39
        }
 
40
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_form_r_done, req);
 
41
 
 
42
        return req;
 
43
}
 
44
 
 
45
static void dcerpc_decode_ntprinting_form_r_done(struct tevent_req *subreq)
 
46
{
 
47
        struct tevent_req *req =
 
48
                tevent_req_callback_data(subreq,
 
49
                struct tevent_req);
 
50
        NTSTATUS status;
 
51
 
 
52
        status = dcerpc_binding_handle_call_recv(subreq);
 
53
        if (!NT_STATUS_IS_OK(status)) {
 
54
                tevent_req_nterror(req, status);
 
55
                return;
 
56
        }
 
57
 
 
58
        tevent_req_done(req);
 
59
}
 
60
 
 
61
NTSTATUS dcerpc_decode_ntprinting_form_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
62
{
 
63
        struct dcerpc_decode_ntprinting_form_r_state *state =
 
64
                tevent_req_data(req,
 
65
                struct dcerpc_decode_ntprinting_form_r_state);
 
66
        NTSTATUS status;
 
67
 
 
68
        if (tevent_req_is_nterror(req, &status)) {
 
69
                tevent_req_received(req);
 
70
                return status;
 
71
        }
 
72
 
 
73
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
74
 
 
75
        tevent_req_received(req);
 
76
        return NT_STATUS_OK;
 
77
}
 
78
 
 
79
NTSTATUS dcerpc_decode_ntprinting_form_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct decode_ntprinting_form *r)
 
80
{
 
81
        NTSTATUS status;
 
82
 
 
83
        status = dcerpc_binding_handle_call(h,
 
84
                        NULL, &ndr_table_ntprinting,
 
85
                        NDR_DECODE_NTPRINTING_FORM, mem_ctx, r);
 
86
 
 
87
        return status;
 
88
}
 
89
 
 
90
struct dcerpc_decode_ntprinting_form_state {
 
91
        struct decode_ntprinting_form orig;
 
92
        struct decode_ntprinting_form tmp;
 
93
        TALLOC_CTX *out_mem_ctx;
 
94
};
 
95
 
 
96
static void dcerpc_decode_ntprinting_form_done(struct tevent_req *subreq);
 
97
 
 
98
struct tevent_req *dcerpc_decode_ntprinting_form_send(TALLOC_CTX *mem_ctx,
 
99
                                                      struct tevent_context *ev,
 
100
                                                      struct dcerpc_binding_handle *h,
 
101
                                                      struct ntprinting_form _form /* [in]  */)
 
102
{
 
103
        struct tevent_req *req;
 
104
        struct dcerpc_decode_ntprinting_form_state *state;
 
105
        struct tevent_req *subreq;
 
106
 
 
107
        req = tevent_req_create(mem_ctx, &state,
 
108
                                struct dcerpc_decode_ntprinting_form_state);
 
109
        if (req == NULL) {
 
110
                return NULL;
 
111
        }
 
112
        state->out_mem_ctx = NULL;
 
113
 
 
114
        /* In parameters */
 
115
        state->orig.in.form = _form;
 
116
 
 
117
        /* Out parameters */
 
118
 
 
119
        /* make a temporary copy, that we pass to the dispatch function */
 
120
        state->tmp = state->orig;
 
121
 
 
122
        subreq = dcerpc_decode_ntprinting_form_r_send(state, ev, h, &state->tmp);
 
123
        if (tevent_req_nomem(subreq, req)) {
 
124
                return tevent_req_post(req, ev);
 
125
        }
 
126
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_form_done, req);
 
127
        return req;
 
128
}
 
129
 
 
130
static void dcerpc_decode_ntprinting_form_done(struct tevent_req *subreq)
 
131
{
 
132
        struct tevent_req *req = tevent_req_callback_data(
 
133
                subreq, struct tevent_req);
 
134
        struct dcerpc_decode_ntprinting_form_state *state = tevent_req_data(
 
135
                req, struct dcerpc_decode_ntprinting_form_state);
 
136
        NTSTATUS status;
 
137
        TALLOC_CTX *mem_ctx;
 
138
 
 
139
        if (state->out_mem_ctx) {
 
140
                mem_ctx = state->out_mem_ctx;
 
141
        } else {
 
142
                mem_ctx = state;
 
143
        }
 
144
 
 
145
        status = dcerpc_decode_ntprinting_form_r_recv(subreq, mem_ctx);
 
146
        TALLOC_FREE(subreq);
 
147
        if (!NT_STATUS_IS_OK(status)) {
 
148
                tevent_req_nterror(req, status);
 
149
                return;
 
150
        }
 
151
 
 
152
        /* Copy out parameters */
 
153
 
 
154
        /* Reset temporary structure */
 
155
        ZERO_STRUCT(state->tmp);
 
156
 
 
157
        tevent_req_done(req);
 
158
}
 
159
 
 
160
NTSTATUS dcerpc_decode_ntprinting_form_recv(struct tevent_req *req,
 
161
                                            TALLOC_CTX *mem_ctx)
 
162
{
 
163
        struct dcerpc_decode_ntprinting_form_state *state = tevent_req_data(
 
164
                req, struct dcerpc_decode_ntprinting_form_state);
 
165
        NTSTATUS status;
 
166
 
 
167
        if (tevent_req_is_nterror(req, &status)) {
 
168
                tevent_req_received(req);
 
169
                return status;
 
170
        }
 
171
 
 
172
        /* Steal possible out parameters to the callers context */
 
173
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
174
 
 
175
        tevent_req_received(req);
 
176
        return NT_STATUS_OK;
 
177
}
 
178
 
 
179
NTSTATUS dcerpc_decode_ntprinting_form(struct dcerpc_binding_handle *h,
 
180
                                       TALLOC_CTX *mem_ctx,
 
181
                                       struct ntprinting_form _form /* [in]  */)
 
182
{
 
183
        struct decode_ntprinting_form r;
 
184
        NTSTATUS status;
 
185
 
 
186
        /* In parameters */
 
187
        r.in.form = _form;
 
188
 
 
189
        status = dcerpc_decode_ntprinting_form_r(h, mem_ctx, &r);
 
190
        if (!NT_STATUS_IS_OK(status)) {
 
191
                return status;
 
192
        }
 
193
 
 
194
        /* Return variables */
 
195
 
 
196
        /* Return result */
 
197
 
 
198
        return NT_STATUS_OK;
 
199
}
 
200
 
 
201
struct dcerpc_decode_ntprinting_driver_r_state {
 
202
        TALLOC_CTX *out_mem_ctx;
 
203
};
 
204
 
 
205
static void dcerpc_decode_ntprinting_driver_r_done(struct tevent_req *subreq);
 
206
 
 
207
struct tevent_req *dcerpc_decode_ntprinting_driver_r_send(TALLOC_CTX *mem_ctx,
 
208
        struct tevent_context *ev,
 
209
        struct dcerpc_binding_handle *h,
 
210
        struct decode_ntprinting_driver *r)
 
211
{
 
212
        struct tevent_req *req;
 
213
        struct dcerpc_decode_ntprinting_driver_r_state *state;
 
214
        struct tevent_req *subreq;
 
215
 
 
216
        req = tevent_req_create(mem_ctx, &state,
 
217
                                struct dcerpc_decode_ntprinting_driver_r_state);
 
218
        if (req == NULL) {
 
219
                return NULL;
 
220
        }
 
221
 
 
222
        state->out_mem_ctx = NULL;
 
223
 
 
224
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
225
                        NULL, &ndr_table_ntprinting,
 
226
                        NDR_DECODE_NTPRINTING_DRIVER, state, r);
 
227
        if (tevent_req_nomem(subreq, req)) {
 
228
                return tevent_req_post(req, ev);
 
229
        }
 
230
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_driver_r_done, req);
 
231
 
 
232
        return req;
 
233
}
 
234
 
 
235
static void dcerpc_decode_ntprinting_driver_r_done(struct tevent_req *subreq)
 
236
{
 
237
        struct tevent_req *req =
 
238
                tevent_req_callback_data(subreq,
 
239
                struct tevent_req);
 
240
        NTSTATUS status;
 
241
 
 
242
        status = dcerpc_binding_handle_call_recv(subreq);
 
243
        if (!NT_STATUS_IS_OK(status)) {
 
244
                tevent_req_nterror(req, status);
 
245
                return;
 
246
        }
 
247
 
 
248
        tevent_req_done(req);
 
249
}
 
250
 
 
251
NTSTATUS dcerpc_decode_ntprinting_driver_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
252
{
 
253
        struct dcerpc_decode_ntprinting_driver_r_state *state =
 
254
                tevent_req_data(req,
 
255
                struct dcerpc_decode_ntprinting_driver_r_state);
 
256
        NTSTATUS status;
 
257
 
 
258
        if (tevent_req_is_nterror(req, &status)) {
 
259
                tevent_req_received(req);
 
260
                return status;
 
261
        }
 
262
 
 
263
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
264
 
 
265
        tevent_req_received(req);
 
266
        return NT_STATUS_OK;
 
267
}
 
268
 
 
269
NTSTATUS dcerpc_decode_ntprinting_driver_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct decode_ntprinting_driver *r)
 
270
{
 
271
        NTSTATUS status;
 
272
 
 
273
        status = dcerpc_binding_handle_call(h,
 
274
                        NULL, &ndr_table_ntprinting,
 
275
                        NDR_DECODE_NTPRINTING_DRIVER, mem_ctx, r);
 
276
 
 
277
        return status;
 
278
}
 
279
 
 
280
struct dcerpc_decode_ntprinting_driver_state {
 
281
        struct decode_ntprinting_driver orig;
 
282
        struct decode_ntprinting_driver tmp;
 
283
        TALLOC_CTX *out_mem_ctx;
 
284
};
 
285
 
 
286
static void dcerpc_decode_ntprinting_driver_done(struct tevent_req *subreq);
 
287
 
 
288
struct tevent_req *dcerpc_decode_ntprinting_driver_send(TALLOC_CTX *mem_ctx,
 
289
                                                        struct tevent_context *ev,
 
290
                                                        struct dcerpc_binding_handle *h,
 
291
                                                        struct ntprinting_driver _driver /* [in]  */)
 
292
{
 
293
        struct tevent_req *req;
 
294
        struct dcerpc_decode_ntprinting_driver_state *state;
 
295
        struct tevent_req *subreq;
 
296
 
 
297
        req = tevent_req_create(mem_ctx, &state,
 
298
                                struct dcerpc_decode_ntprinting_driver_state);
 
299
        if (req == NULL) {
 
300
                return NULL;
 
301
        }
 
302
        state->out_mem_ctx = NULL;
 
303
 
 
304
        /* In parameters */
 
305
        state->orig.in.driver = _driver;
 
306
 
 
307
        /* Out parameters */
 
308
 
 
309
        /* make a temporary copy, that we pass to the dispatch function */
 
310
        state->tmp = state->orig;
 
311
 
 
312
        subreq = dcerpc_decode_ntprinting_driver_r_send(state, ev, h, &state->tmp);
 
313
        if (tevent_req_nomem(subreq, req)) {
 
314
                return tevent_req_post(req, ev);
 
315
        }
 
316
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_driver_done, req);
 
317
        return req;
 
318
}
 
319
 
 
320
static void dcerpc_decode_ntprinting_driver_done(struct tevent_req *subreq)
 
321
{
 
322
        struct tevent_req *req = tevent_req_callback_data(
 
323
                subreq, struct tevent_req);
 
324
        struct dcerpc_decode_ntprinting_driver_state *state = tevent_req_data(
 
325
                req, struct dcerpc_decode_ntprinting_driver_state);
 
326
        NTSTATUS status;
 
327
        TALLOC_CTX *mem_ctx;
 
328
 
 
329
        if (state->out_mem_ctx) {
 
330
                mem_ctx = state->out_mem_ctx;
 
331
        } else {
 
332
                mem_ctx = state;
 
333
        }
 
334
 
 
335
        status = dcerpc_decode_ntprinting_driver_r_recv(subreq, mem_ctx);
 
336
        TALLOC_FREE(subreq);
 
337
        if (!NT_STATUS_IS_OK(status)) {
 
338
                tevent_req_nterror(req, status);
 
339
                return;
 
340
        }
 
341
 
 
342
        /* Copy out parameters */
 
343
 
 
344
        /* Reset temporary structure */
 
345
        ZERO_STRUCT(state->tmp);
 
346
 
 
347
        tevent_req_done(req);
 
348
}
 
349
 
 
350
NTSTATUS dcerpc_decode_ntprinting_driver_recv(struct tevent_req *req,
 
351
                                              TALLOC_CTX *mem_ctx)
 
352
{
 
353
        struct dcerpc_decode_ntprinting_driver_state *state = tevent_req_data(
 
354
                req, struct dcerpc_decode_ntprinting_driver_state);
 
355
        NTSTATUS status;
 
356
 
 
357
        if (tevent_req_is_nterror(req, &status)) {
 
358
                tevent_req_received(req);
 
359
                return status;
 
360
        }
 
361
 
 
362
        /* Steal possible out parameters to the callers context */
 
363
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
364
 
 
365
        tevent_req_received(req);
 
366
        return NT_STATUS_OK;
 
367
}
 
368
 
 
369
NTSTATUS dcerpc_decode_ntprinting_driver(struct dcerpc_binding_handle *h,
 
370
                                         TALLOC_CTX *mem_ctx,
 
371
                                         struct ntprinting_driver _driver /* [in]  */)
 
372
{
 
373
        struct decode_ntprinting_driver r;
 
374
        NTSTATUS status;
 
375
 
 
376
        /* In parameters */
 
377
        r.in.driver = _driver;
 
378
 
 
379
        status = dcerpc_decode_ntprinting_driver_r(h, mem_ctx, &r);
 
380
        if (!NT_STATUS_IS_OK(status)) {
 
381
                return status;
 
382
        }
 
383
 
 
384
        /* Return variables */
 
385
 
 
386
        /* Return result */
 
387
 
 
388
        return NT_STATUS_OK;
 
389
}
 
390
 
 
391
struct dcerpc_decode_ntprinting_printer_r_state {
 
392
        TALLOC_CTX *out_mem_ctx;
 
393
};
 
394
 
 
395
static void dcerpc_decode_ntprinting_printer_r_done(struct tevent_req *subreq);
 
396
 
 
397
struct tevent_req *dcerpc_decode_ntprinting_printer_r_send(TALLOC_CTX *mem_ctx,
 
398
        struct tevent_context *ev,
 
399
        struct dcerpc_binding_handle *h,
 
400
        struct decode_ntprinting_printer *r)
 
401
{
 
402
        struct tevent_req *req;
 
403
        struct dcerpc_decode_ntprinting_printer_r_state *state;
 
404
        struct tevent_req *subreq;
 
405
 
 
406
        req = tevent_req_create(mem_ctx, &state,
 
407
                                struct dcerpc_decode_ntprinting_printer_r_state);
 
408
        if (req == NULL) {
 
409
                return NULL;
 
410
        }
 
411
 
 
412
        state->out_mem_ctx = NULL;
 
413
 
 
414
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
415
                        NULL, &ndr_table_ntprinting,
 
416
                        NDR_DECODE_NTPRINTING_PRINTER, state, r);
 
417
        if (tevent_req_nomem(subreq, req)) {
 
418
                return tevent_req_post(req, ev);
 
419
        }
 
420
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_printer_r_done, req);
 
421
 
 
422
        return req;
 
423
}
 
424
 
 
425
static void dcerpc_decode_ntprinting_printer_r_done(struct tevent_req *subreq)
 
426
{
 
427
        struct tevent_req *req =
 
428
                tevent_req_callback_data(subreq,
 
429
                struct tevent_req);
 
430
        NTSTATUS status;
 
431
 
 
432
        status = dcerpc_binding_handle_call_recv(subreq);
 
433
        if (!NT_STATUS_IS_OK(status)) {
 
434
                tevent_req_nterror(req, status);
 
435
                return;
 
436
        }
 
437
 
 
438
        tevent_req_done(req);
 
439
}
 
440
 
 
441
NTSTATUS dcerpc_decode_ntprinting_printer_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
442
{
 
443
        struct dcerpc_decode_ntprinting_printer_r_state *state =
 
444
                tevent_req_data(req,
 
445
                struct dcerpc_decode_ntprinting_printer_r_state);
 
446
        NTSTATUS status;
 
447
 
 
448
        if (tevent_req_is_nterror(req, &status)) {
 
449
                tevent_req_received(req);
 
450
                return status;
 
451
        }
 
452
 
 
453
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
454
 
 
455
        tevent_req_received(req);
 
456
        return NT_STATUS_OK;
 
457
}
 
458
 
 
459
NTSTATUS dcerpc_decode_ntprinting_printer_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct decode_ntprinting_printer *r)
 
460
{
 
461
        NTSTATUS status;
 
462
 
 
463
        status = dcerpc_binding_handle_call(h,
 
464
                        NULL, &ndr_table_ntprinting,
 
465
                        NDR_DECODE_NTPRINTING_PRINTER, mem_ctx, r);
 
466
 
 
467
        return status;
 
468
}
 
469
 
 
470
struct dcerpc_decode_ntprinting_printer_state {
 
471
        struct decode_ntprinting_printer orig;
 
472
        struct decode_ntprinting_printer tmp;
 
473
        TALLOC_CTX *out_mem_ctx;
 
474
};
 
475
 
 
476
static void dcerpc_decode_ntprinting_printer_done(struct tevent_req *subreq);
 
477
 
 
478
struct tevent_req *dcerpc_decode_ntprinting_printer_send(TALLOC_CTX *mem_ctx,
 
479
                                                         struct tevent_context *ev,
 
480
                                                         struct dcerpc_binding_handle *h,
 
481
                                                         struct ntprinting_printer _printer /* [in]  */)
 
482
{
 
483
        struct tevent_req *req;
 
484
        struct dcerpc_decode_ntprinting_printer_state *state;
 
485
        struct tevent_req *subreq;
 
486
 
 
487
        req = tevent_req_create(mem_ctx, &state,
 
488
                                struct dcerpc_decode_ntprinting_printer_state);
 
489
        if (req == NULL) {
 
490
                return NULL;
 
491
        }
 
492
        state->out_mem_ctx = NULL;
 
493
 
 
494
        /* In parameters */
 
495
        state->orig.in.printer = _printer;
 
496
 
 
497
        /* Out parameters */
 
498
 
 
499
        /* make a temporary copy, that we pass to the dispatch function */
 
500
        state->tmp = state->orig;
 
501
 
 
502
        subreq = dcerpc_decode_ntprinting_printer_r_send(state, ev, h, &state->tmp);
 
503
        if (tevent_req_nomem(subreq, req)) {
 
504
                return tevent_req_post(req, ev);
 
505
        }
 
506
        tevent_req_set_callback(subreq, dcerpc_decode_ntprinting_printer_done, req);
 
507
        return req;
 
508
}
 
509
 
 
510
static void dcerpc_decode_ntprinting_printer_done(struct tevent_req *subreq)
 
511
{
 
512
        struct tevent_req *req = tevent_req_callback_data(
 
513
                subreq, struct tevent_req);
 
514
        struct dcerpc_decode_ntprinting_printer_state *state = tevent_req_data(
 
515
                req, struct dcerpc_decode_ntprinting_printer_state);
 
516
        NTSTATUS status;
 
517
        TALLOC_CTX *mem_ctx;
 
518
 
 
519
        if (state->out_mem_ctx) {
 
520
                mem_ctx = state->out_mem_ctx;
 
521
        } else {
 
522
                mem_ctx = state;
 
523
        }
 
524
 
 
525
        status = dcerpc_decode_ntprinting_printer_r_recv(subreq, mem_ctx);
 
526
        TALLOC_FREE(subreq);
 
527
        if (!NT_STATUS_IS_OK(status)) {
 
528
                tevent_req_nterror(req, status);
 
529
                return;
 
530
        }
 
531
 
 
532
        /* Copy out parameters */
 
533
 
 
534
        /* Reset temporary structure */
 
535
        ZERO_STRUCT(state->tmp);
 
536
 
 
537
        tevent_req_done(req);
 
538
}
 
539
 
 
540
NTSTATUS dcerpc_decode_ntprinting_printer_recv(struct tevent_req *req,
 
541
                                               TALLOC_CTX *mem_ctx)
 
542
{
 
543
        struct dcerpc_decode_ntprinting_printer_state *state = tevent_req_data(
 
544
                req, struct dcerpc_decode_ntprinting_printer_state);
 
545
        NTSTATUS status;
 
546
 
 
547
        if (tevent_req_is_nterror(req, &status)) {
 
548
                tevent_req_received(req);
 
549
                return status;
 
550
        }
 
551
 
 
552
        /* Steal possible out parameters to the callers context */
 
553
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
554
 
 
555
        tevent_req_received(req);
 
556
        return NT_STATUS_OK;
 
557
}
 
558
 
 
559
NTSTATUS dcerpc_decode_ntprinting_printer(struct dcerpc_binding_handle *h,
 
560
                                          TALLOC_CTX *mem_ctx,
 
561
                                          struct ntprinting_printer _printer /* [in]  */)
 
562
{
 
563
        struct decode_ntprinting_printer r;
 
564
        NTSTATUS status;
 
565
 
 
566
        /* In parameters */
 
567
        r.in.printer = _printer;
 
568
 
 
569
        status = dcerpc_decode_ntprinting_printer_r(h, mem_ctx, &r);
 
570
        if (!NT_STATUS_IS_OK(status)) {
 
571
                return status;
 
572
        }
 
573
 
 
574
        /* Return variables */
 
575
 
 
576
        /* Return result */
 
577
 
 
578
        return NT_STATUS_OK;
 
579
}
 
580