From d3339cd0c6ffa490513cc4562d2c06c218c7967e Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 1 Dec 2009 00:24:16 +0100 Subject: [PATCH] drsuapi: fix build warning of NDR size calculation of drsuapi_DsReplicaObjectIdentifier3Binary. The generated size actually does not include the size of the binary itself. Guenther --- librpc/gen_ndr/drsuapi.h | 4 ++-- librpc/gen_ndr/ndr_drsuapi.c | 9 ++------- librpc/gen_ndr/ndr_drsuapi.h | 1 - librpc/idl/drsuapi.idl | 4 ++-- librpc/ndr/ndr_drsuapi.c | 6 ++++++ librpc/ndr/ndr_drsuapi.h | 2 ++ 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/librpc/gen_ndr/drsuapi.h b/librpc/gen_ndr/drsuapi.h index 52b6ee9ac2f..116ded48812 100644 --- a/librpc/gen_ndr/drsuapi.h +++ b/librpc/gen_ndr/drsuapi.h @@ -517,7 +517,7 @@ struct drsuapi_DsReplicaObjectIdentifier3 { }/* [gensize,public] */; struct drsuapi_DsReplicaObjectIdentifier3Binary { - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r,ndr->iconv_convenience,ndr->flags))] */ + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r,ndr->iconv_convenience,ndr->flags))] */ uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ struct GUID guid; struct dom_sid28 sid; @@ -525,7 +525,7 @@ struct drsuapi_DsReplicaObjectIdentifier3Binary { const char *dn;/* [charset(UTF16)] */ uint32_t __ndr_size_binary;/* [value(binary.length+4)] */ DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [gensize,public] */; +}/* [public] */; struct drsuapi_DsReplicaAttribute { enum drsuapi_DsAttributeId attid; diff --git a/librpc/gen_ndr/ndr_drsuapi.c b/librpc/gen_ndr/ndr_drsuapi.c index 700306cb8b2..6777accb9fd 100644 --- a/librpc/gen_ndr/ndr_drsuapi.c +++ b/librpc/gen_ndr/ndr_drsuapi.c @@ -2176,7 +2176,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(str { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); @@ -2226,7 +2226,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_prin { ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary"); ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size); + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size); ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); ndr_print_GUID(ndr, "guid", &r->guid); ndr_print_dom_sid28(ndr, "sid", &r->sid); @@ -2237,11 +2237,6 @@ _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_prin ndr->depth--; } -_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary, ic); -} - _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r) { if (ndr_flags & NDR_SCALARS) { diff --git a/librpc/gen_ndr/ndr_drsuapi.h b/librpc/gen_ndr/ndr_drsuapi.h index f157cc5c1f0..0baf5518fc9 100644 --- a/librpc/gen_ndr/ndr_drsuapi.h +++ b/librpc/gen_ndr/ndr_drsuapi.h @@ -120,7 +120,6 @@ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplic enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r); void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); -size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r); enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r); void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r); diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl index 9d2d1534188..4dd3a9ec43c 100644 --- a/librpc/idl/drsuapi.idl +++ b/librpc/idl/drsuapi.idl @@ -552,8 +552,8 @@ interface drsuapi [charset(UTF16)] uint16 dn[__ndr_size_dn+1]; } drsuapi_DsReplicaObjectIdentifier3; - typedef [public,gensize] struct { - [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size; + typedef [public] struct { + [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size; [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid; GUID guid; dom_sid28 sid; diff --git a/librpc/ndr/ndr_drsuapi.c b/librpc/ndr/ndr_drsuapi.c index 0c790e52ca7..40325452023 100644 --- a/librpc/ndr/ndr_drsuapi.c +++ b/librpc/ndr/ndr_drsuapi.c @@ -351,3 +351,9 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr } return NDR_ERR_SUCCESS; } + +_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic); +} + diff --git a/librpc/ndr/ndr_drsuapi.h b/librpc/ndr/ndr_drsuapi.h index 12c2c78bdea..fad11fe6b1f 100644 --- a/librpc/ndr/ndr_drsuapi.h +++ b/librpc/ndr/ndr_drsuapi.h @@ -32,4 +32,6 @@ enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_fl enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r); size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags); +size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags); + #endif /* _LIBRPC_NDR_NDR_DRSUAPI_H */ -- 2.11.4.GIT