From fe15b46d61ee50f4225458faf963c818cde3e283 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Oct 2004 09:22:21 +0000 Subject: r2990: Add support to pidl for autogenerating ndr_size_*() functions. Adding the [gensize] property to a struct or union will make pidl generate a ndr_size_*() function. (not all nasty bits of NDR are completely covered yet by the ndr_size*() functions, support for those will be added when necessary) I also have a local patch (not applied now) that simplifies the pidl output and eliminates the number of functions required. It would, however, make pidl more complex. (This used to be commit 7c823f886afd0c4c6ee838f17882ca0658417011) --- source4/librpc/ndr/ndr_basic.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source4/librpc/ndr/ndr_basic.c') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index edb1590489..5808ae7452 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -1130,3 +1130,15 @@ NTSTATUS ndr_pull_DATA_BLOB(struct ndr_pull *ndr, DATA_BLOB *blob) ndr->offset += length; return NT_STATUS_OK; } + +uint32 ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags) +{ + return ret + data->length; +} + +uint32 ndr_size_string(int ret, const char **string, int flags) +{ + /* FIXME: Is this correct for all strings ? */ + if(!(*string)) return ret; + return ret+strlen(*string)+1; +} -- cgit