librpc/rpc: let ndr_pull_spoolss_EnumPrinterDataEx() use a subcontext
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Mar 2011 16:41:27 +0000 (17:41 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Mar 2011 12:13:02 +0000 (13:13 +0100)
This is not strictly needed, but it's good to have the logic
in common with the other Enum* calls.

This also allows us to play with the NDR_RELATIVE_REVERSE flag.

metze

librpc/ndr/ndr_spoolss_buf.c

index d1e4b4157083a46f07f4abd47e67ea8d2788bb26..14fb222f4ac3487c9472d92e771a5b996b36f202 100644 (file)
@@ -480,13 +480,16 @@ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int f
                _r.out.result   = r->out.result;
                _r.out.info     = data_blob(NULL, 0);
                if (r->in.offered >= *r->out.needed) {
+                       struct ndr_push *_subndr_info;
                        struct __spoolss_EnumPrinterDataEx __r;
                        _ndr_info = ndr_push_init_ctx(ndr);
                        NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
                        _ndr_info->flags= ndr->flags;
                        __r.in.count    = *r->out.count;
                        __r.out.info    = *r->out.info;
-                       NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r));
+                       NDR_CHECK(ndr_push_subcontext_start(_ndr_info, &_subndr_info, 0, r->in.offered));
+                       NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_subndr_info, flags, &__r));
+                       NDR_CHECK(ndr_push_subcontext_end(_ndr_info, _subndr_info, 0, r->in.offered));
                        if (r->in.offered > _ndr_info->offset) {
                                uint32_t _padding_len = r->in.offered - _ndr_info->offset;
                                NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));