From 46b829513a47dbb74fb0ea07ed85494da1480919 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Jun 2005 13:42:01 +0000 Subject: r7462: fix Enum* pushing, we need to send back a buffer of the same size as we got in the recv code..., this makes the w2k3 printserver properties gui happy:-) metze (This used to be commit 0130b0d90223bb7278f924e1b1370778f25d0d91) --- source4/librpc/ndr/ndr_spoolss_buf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c index 00958c2cb8..6ecaa49fcf 100644 --- a/source4/librpc/ndr/ndr_spoolss_buf.c +++ b/source4/librpc/ndr/ndr_spoolss_buf.c @@ -51,6 +51,10 @@ __r.in.count = r->out.count;\ __r.out.info = r->out.info;\ NDR_CHECK(ndr_push___##fn(_ndr_info, flags, &__r)); \ + if (*r->in.buf_size > _ndr_info->offset) {\ + uint32_t _padding_len = *r->in.buf_size - _ndr_info->offset;\ + NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));\ + }\ _data_blob_info = ndr_push_blob(_ndr_info);\ _r.out.buffer = &_data_blob_info;\ }\ @@ -94,6 +98,11 @@ _ndr_info = ndr_pull_init_blob(_r.out.buffer, ndr);\ if (!_ndr_info) return NT_STATUS_NO_MEMORY;\ _ndr_info->flags= ndr->flags;\ + if (*r->out.buf_size != _ndr_info->data_size) {\ + return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\ + "SPOOLSS Buffer: buf_size[%u] doesn't match length of buffer[%u]",\ + *r->out.buf_size, _ndr_info->data_size);\ + }\ __r.in.level = r->in.level;\ __r.in.count = r->out.count;\ __r.out.info = NULL;\ -- cgit