From 152a6a00c31f52d14a63bfc977ac54713c56c9cd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 24 Jun 2005 01:18:56 +0000 Subject: r7865: changed pidl to take a "const void *" instead of a "void *" for the structure in ndr_push_*() and ndr_print_*(). The push and print functions really should not modify the structure. metze, to make this work I had to change your spoolss hand marshaller. Can you please check it is OK? I think that the IN and OUT sides of that function are not ever called on the same structure, so I think that attempt at remembering the value by assigning to r->in._offered was not doing anything anyway, but please correct me if I have misunderstood it. If you really do need to remember something on those structures I'd suggest the ndr_token_store() and ndr_token_retrieve() functions, which are used by pidl for just this sort of thing. (This used to be commit eee528be97fa43ca53bdc5652b4d29a0a2caf563) --- source4/build/pidl/dcom_stub.pm | 2 +- source4/build/pidl/ndr_header.pm | 4 ++-- source4/build/pidl/ndr_parser.pm | 18 ++++++++---------- source4/build/pidl/server.pm | 2 +- source4/libcli/nbt/nbtname.c | 2 +- source4/librpc/ndr/libndr.h | 7 +++---- source4/librpc/ndr/ndr.c | 2 +- source4/librpc/ndr/ndr_drsuapi.c | 3 ++- source4/librpc/ndr/ndr_orpc.c | 8 ++++---- source4/librpc/ndr/ndr_sec.c | 4 ++-- source4/librpc/ndr/ndr_sec_helper.c | 16 ++++++++-------- source4/librpc/ndr/ndr_spoolss_buf.c | 22 ++++++++++------------ source4/librpc/rpc/dcerpc.c | 4 ++-- source4/librpc/rpc/dcerpc.h | 6 +++--- source4/rpc_server/dcerpc_server.h | 2 +- source4/rpc_server/echo/rpc_echo.c | 2 +- source4/rpc_server/remote/dcesrv_remote.c | 2 +- 17 files changed, 51 insertions(+), 55 deletions(-) (limited to 'source4') diff --git a/source4/build/pidl/dcom_stub.pm b/source4/build/pidl/dcom_stub.pm index 024037e2e8..b551b06299 100644 --- a/source4/build/pidl/dcom_stub.pm +++ b/source4/build/pidl/dcom_stub.pm @@ -179,7 +179,7 @@ pidl " return NT_STATUS_OK; } -static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, void *r) +static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r) { NTSTATUS status; uint16_t opnum = dce_call->pkt.u.request.opnum; diff --git a/source4/build/pidl/ndr_header.pm b/source4/build/pidl/ndr_header.pm index 6269320115..33183cec96 100644 --- a/source4/build/pidl/ndr_header.pm +++ b/source4/build/pidl/ndr_header.pm @@ -361,7 +361,7 @@ sub HeaderFnProto($$) my ($interface,$fn) = @_; my $name = $fn->{NAME}; - pidl "void ndr_print_$name(struct ndr_print *ndr, const char *name, int flags, struct $name *r);\n"; + pidl "void ndr_print_$name(struct ndr_print *ndr, const char *name, int flags, const struct $name *r);\n"; if (defined($fn->{OPNUM})) { pidl "NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r);\n"; @@ -370,7 +370,7 @@ sub HeaderFnProto($$) return unless util::has_property($fn, "public"); - pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, struct $name *r);\n"; + pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, const struct $name *r);\n"; pidl "NTSTATUS ndr_pull_$name(struct ndr_pull *ndr, int flags, struct $name *r);\n"; pidl "\n"; diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm index a654909e0b..ba6b9d58da 100644 --- a/source4/build/pidl/ndr_parser.pm +++ b/source4/build/pidl/ndr_parser.pm @@ -603,7 +603,7 @@ sub ParseElementPush($$$$$$) start_flags($e); if (my $value = util::has_property($e, "value")) { - pidl "$var_name = " . util::ParseExpr($value, $env) . ";"; + $var_name = util::ParseExpr($value, $env); } ParseElementPushLevel($e, $e->{LEVELS}[0], $ndr, $var_name, $env, $primitives, $deferred); @@ -642,9 +642,7 @@ sub ParseElementPrint($$$) return if (util::has_property($e, "noprint")); if (my $value = util::has_property($e, "value")) { - pidl "if (ndr->flags & LIBNDR_PRINT_SET_VALUES) {"; - pidl "\t$var_name = " . util::ParseExpr($value,$env) . ";"; - pidl "}"; + $var_name = "(ndr->flags & LIBNDR_PRINT_SET_VALUES)?" . util::ParseExpr($value,$env) . ":$var_name"; } foreach my $l (@{$e->{LEVELS}}) { @@ -1361,13 +1359,13 @@ sub ParseStructNdrSize($) sub ArgsStructPush($) { my $e = shift; - return "struct ndr_push *ndr, int ndr_flags, struct $e->{NAME} *r"; + return "struct ndr_push *ndr, int ndr_flags, const struct $e->{NAME} *r"; } sub ArgsStructPrint($) { my $e = shift; - return "struct ndr_print *ndr, const char *name, struct $e->{NAME} *r"; + return "struct ndr_print *ndr, const char *name, const struct $e->{NAME} *r"; } sub ArgsStructPull($) @@ -1634,13 +1632,13 @@ sub ParseUnionPull($$) sub ArgsUnionPush($) { my $e = shift; - return "struct ndr_push *ndr, int ndr_flags, union $e->{NAME} *r"; + return "struct ndr_push *ndr, int ndr_flags, const union $e->{NAME} *r"; } sub ArgsUnionPrint($) { my $e = shift; - return "struct ndr_print *ndr, const char *name, union $e->{NAME} *r"; + return "struct ndr_print *ndr, const char *name, const union $e->{NAME} *r"; } sub ArgsUnionPull($) @@ -1746,7 +1744,7 @@ sub ParseFunctionPrint($) return if util::has_property($fn, "noprint"); - pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, struct $fn->{NAME} *r)"; + pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)"; pidl "{"; indent; @@ -1809,7 +1807,7 @@ sub ParseFunctionPush($) return if util::has_property($fn, "nopush"); - pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, struct $fn->{NAME} *r)"; + pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)"; pidl "{"; indent; diff --git a/source4/build/pidl/server.pm b/source4/build/pidl/server.pm index 29745686fe..e52ce51722 100644 --- a/source4/build/pidl/server.pm +++ b/source4/build/pidl/server.pm @@ -168,7 +168,7 @@ pidl " return NT_STATUS_OK; } -static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, void *r) +static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r) { NTSTATUS status; uint16_t opnum = dce_call->pkt.u.request.opnum; diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c index 0fc679def3..c2fb062025 100644 --- a/source4/libcli/nbt/nbtname.c +++ b/source4/libcli/nbt/nbtname.c @@ -308,7 +308,7 @@ NTSTATUS ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name /* push a nbt name to the wire */ -NTSTATUS ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, struct nbt_name *r) +NTSTATUS ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_name *r) { uint8_t *cname, *fullname; NTSTATUS status; diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 93cc67eaad..17c06b79da 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -247,9 +247,8 @@ enum ndr_compression_alg { #define NDR_PUSH_ALLOC(ndr, s) NDR_PUSH_ALLOC_SIZE(ndr, s, sizeof(*(s))) /* these are used when generic fn pointers are needed for ndr push/pull fns */ -typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void *); -typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, const void *); +typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, const void *); typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *); -typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *); -typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, void *); +typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, const void *); +typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, const void *); diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 74997748a3..6694209c68 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -622,7 +622,7 @@ NTSTATUS ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p /* push a struct to a blob using NDR */ -NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, +NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn) { NTSTATUS status; diff --git a/source4/librpc/ndr/ndr_drsuapi.c b/source4/librpc/ndr/ndr_drsuapi.c index f2f8469f5e..6f6dd74ea4 100644 --- a/source4/librpc/ndr/ndr_drsuapi.c +++ b/source4/librpc/ndr/ndr_drsuapi.c @@ -24,7 +24,8 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_drsuapi.h" -void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name, struct drsuapi_DsReplicaObjectListItem *r) +void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name, + const struct drsuapi_DsReplicaObjectListItem *r) { ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItem"); ndr->depth++; diff --git a/source4/librpc/ndr/ndr_orpc.c b/source4/librpc/ndr/ndr_orpc.c index ccfd48e099..782b640073 100644 --- a/source4/librpc/ndr/ndr_orpc.c +++ b/source4/librpc/ndr/ndr_orpc.c @@ -78,7 +78,7 @@ NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DU return NT_STATUS_OK; } -NTSTATUS ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) +NTSTATUS ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct DUALSTRINGARRAY *ar) { return NT_STATUS_NOT_SUPPORTED; } @@ -86,7 +86,7 @@ NTSTATUS ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct DU /* print a dom_sid */ -void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, struct DUALSTRINGARRAY *ar) +void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const struct DUALSTRINGARRAY *ar) { int i; ndr->print(ndr, "%-25s: DUALSTRINGARRAY", name); @@ -149,7 +149,7 @@ NTSTATUS ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRING return NT_STATUS_OK; } -NTSTATUS ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct STRINGARRAY *ar) +NTSTATUS ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct STRINGARRAY *ar) { return NT_STATUS_NOT_SUPPORTED; } @@ -157,7 +157,7 @@ NTSTATUS ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct STRING /* print a dom_sid */ -void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, struct STRINGARRAY *ar) +void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, const struct STRINGARRAY *ar) { int i; ndr->print(ndr, "%-25s: STRINGARRAY", name); diff --git a/source4/librpc/ndr/ndr_sec.c b/source4/librpc/ndr/ndr_sec.c index 2e9bf86aac..c6eb98c58a 100644 --- a/source4/librpc/ndr/ndr_sec.c +++ b/source4/librpc/ndr/ndr_sec.c @@ -47,7 +47,7 @@ NTSTATUS ndr_pull_dom_sid2(struct ndr_pull *ndr, int ndr_flags, struct dom_sid * /* parse a dom_sid2 - this is a dom_sid but with an extra copy of the num_auths field */ -NTSTATUS ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, struct dom_sid *sid) +NTSTATUS ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid) { if (!(ndr_flags & NDR_SCALARS)) { return NT_STATUS_OK; @@ -89,7 +89,7 @@ NTSTATUS ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct dom_sid /* push a dom_sid28 - this is a dom_sid in a 28 byte fixed buffer */ -NTSTATUS ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, struct dom_sid *sid) +NTSTATUS ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid) { uint32_t old_offset; uint32_t padding; diff --git a/source4/librpc/ndr/ndr_sec_helper.c b/source4/librpc/ndr/ndr_sec_helper.c index 268f270ebe..8325aef93d 100644 --- a/source4/librpc/ndr/ndr_sec_helper.c +++ b/source4/librpc/ndr/ndr_sec_helper.c @@ -27,7 +27,7 @@ /* return the wire size of a dom_sid */ -size_t ndr_size_dom_sid(struct dom_sid *sid) +size_t ndr_size_dom_sid(const struct dom_sid *sid) { if (!sid) return 0; return 8 + 4*sid->num_auths; @@ -36,7 +36,7 @@ size_t ndr_size_dom_sid(struct dom_sid *sid) /* return the wire size of a dom_sid */ -size_t ndr_length_dom_sid(struct dom_sid *sid) +size_t ndr_length_dom_sid(const struct dom_sid *sid) { if (!sid) return 0; if (sid->sid_rev_num == 0) return 0; @@ -46,7 +46,7 @@ size_t ndr_length_dom_sid(struct dom_sid *sid) /* return the wire size of a security_ace */ -size_t ndr_size_security_ace(struct security_ace *ace) +size_t ndr_size_security_ace(const struct security_ace *ace) { if (!ace) return 0; return 8 + ndr_size_dom_sid(&ace->trustee); @@ -56,7 +56,7 @@ size_t ndr_size_security_ace(struct security_ace *ace) /* return the wire size of a security_acl */ -size_t ndr_size_security_acl(struct security_acl *acl) +size_t ndr_size_security_acl(const struct security_acl *acl) { size_t ret; int i; @@ -71,7 +71,7 @@ size_t ndr_size_security_acl(struct security_acl *acl) /* return the wire size of a security descriptor */ -size_t ndr_size_security_descriptor(struct security_descriptor *sd) +size_t ndr_size_security_descriptor(const struct security_descriptor *sd) { size_t ret; if (!sd) return 0; @@ -87,17 +87,17 @@ size_t ndr_size_security_descriptor(struct security_descriptor *sd) /* print a dom_sid */ -void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, struct dom_sid *sid) +void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, const struct dom_sid *sid) { ndr->print(ndr, "%-25s: %s", name, dom_sid_string(ndr, sid)); } -void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, struct dom_sid *sid) +void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, const struct dom_sid *sid) { ndr_print_dom_sid(ndr, name, sid); } -void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, struct dom_sid *sid) +void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid) { ndr_print_dom_sid(ndr, name, sid); } diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c index 46b72eaa5f..594c56dda3 100644 --- a/source4/librpc/ndr/ndr_spoolss_buf.c +++ b/source4/librpc/ndr/ndr_spoolss_buf.c @@ -179,7 +179,7 @@ /* spoolss_EnumPrinters */ -NTSTATUS ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, int flags, struct spoolss_EnumPrinters *r) +NTSTATUS ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinters *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrinters,{ _r.in.flags = r->in.flags; @@ -211,7 +211,7 @@ uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, /* spoolss_EnumJobs */ -NTSTATUS ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, struct spoolss_EnumJobs *r) +NTSTATUS ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, const struct spoolss_EnumJobs *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumJobs,{ _r.in.handle = r->in.handle; @@ -247,7 +247,7 @@ uint32_t ndr_size_spoolss_EnumJobss_info(TALLOC_CTX *mem_ctx, uint32_t level, ui /* spoolss_EnumPrinterDrivers */ -NTSTATUS ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, struct spoolss_EnumPrinterDrivers *r) +NTSTATUS ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDrivers *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrinterDrivers,{ _r.in.server = r->in.server; @@ -279,7 +279,7 @@ uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t /* spoolss_EnumForms */ -NTSTATUS ndr_push_spoolss_EnumForms(struct ndr_push *ndr, int flags, struct spoolss_EnumForms *r) +NTSTATUS ndr_push_spoolss_EnumForms(struct ndr_push *ndr, int flags, const struct spoolss_EnumForms *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumForms,{ _r.in.handle = r->in.handle; @@ -307,7 +307,7 @@ uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, ui /* spoolss_EnumPorts */ -NTSTATUS ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, int flags, struct spoolss_EnumPorts *r) +NTSTATUS ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, int flags, const struct spoolss_EnumPorts *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPorts,{ _r.in.servername= r->in.servername; @@ -335,7 +335,7 @@ uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, ui /* spoolss_EnumMonitors */ -NTSTATUS ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, int flags, struct spoolss_EnumMonitors *r) +NTSTATUS ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, int flags, const struct spoolss_EnumMonitors *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumMonitors,{ _r.in.servername= r->in.servername; @@ -363,7 +363,7 @@ uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, /* spoolss_EnumPrintProcessors */ -NTSTATUS ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, struct spoolss_EnumPrintProcessors *r) +NTSTATUS ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r) { NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrintProcessors,{ _r.in.servername = r->in.servername; @@ -395,7 +395,7 @@ uint32_t ndr_size_spoolss_EnumPrinterProcessors_info(TALLOC_CTX *mem_ctx, uint32 /* spoolss_GetPrinterData */ -NTSTATUS ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, struct spoolss_GetPrinterData *r) +NTSTATUS ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r) { struct _spoolss_GetPrinterData _r; if (flags & NDR_IN) { @@ -487,7 +487,7 @@ NTSTATUS ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct /* spoolss_SetPrinterData */ -NTSTATUS ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, struct spoolss_SetPrinterData *r) +NTSTATUS ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r) { struct _spoolss_SetPrinterData _r; if (flags & NDR_IN) { @@ -504,13 +504,11 @@ NTSTATUS ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, struct NDR_CHECK(ndr_push___spoolss_SetPrinterData(_ndr_data, NDR_OUT, &__r)); _data_blob_data = ndr_push_blob(_ndr_data); - r->in._offered = _data_blob_data.length; - _r.in.handle = r->in.handle; _r.in.value_name= r->in.value_name; _r.in.type = r->in.type; _r.in.data = _data_blob_data; - _r.in._offered = r->in._offered; + _r.in._offered = _data_blob_data.length; _r.out.result = r->out.result; NDR_CHECK(ndr_push__spoolss_SetPrinterData(ndr, flags, &_r)); } diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index bd4756cb21..d253fcaacc 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -1069,8 +1069,8 @@ static NTSTATUS dcerpc_ndr_validate_in(struct dcerpc_connection *c, TALLOC_CTX *mem_ctx, DATA_BLOB blob, size_t struct_size, - NTSTATUS (*ndr_push)(struct ndr_push *, int, void *), - NTSTATUS (*ndr_pull)(struct ndr_pull *, int, void *)) + ndr_push_flags_fn_t ndr_push, + ndr_pull_flags_fn_t ndr_pull) { void *st; struct ndr_pull *pull; diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h index 3b1cc20bca..c5b0ad159b 100644 --- a/source4/librpc/rpc/dcerpc.h +++ b/source4/librpc/rpc/dcerpc.h @@ -142,9 +142,9 @@ struct dcerpc_pipe { struct dcerpc_interface_call { const char *name; size_t struct_size; - NTSTATUS (*ndr_push)(struct ndr_push *, int , void *); - NTSTATUS (*ndr_pull)(struct ndr_pull *, int , void *); - void (*ndr_print)(struct ndr_print *, const char *, int, void *); + ndr_push_flags_fn_t ndr_push; + ndr_pull_flags_fn_t ndr_pull; + ndr_print_function_t ndr_print; }; struct dcerpc_endpoint_list { diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 96ef418a5b..3c4888784d 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -60,7 +60,7 @@ struct dcesrv_interface { /* the ndr_push function for the chosen interface. */ - NTSTATUS (*ndr_push)(struct dcesrv_call_state *, TALLOC_CTX *, struct ndr_push *,void *); + NTSTATUS (*ndr_push)(struct dcesrv_call_state *, TALLOC_CTX *, struct ndr_push *, const void *); /* for any private use by the interface code */ const void *private; diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 5e50a69641..d7d7ef31c2 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -68,7 +68,7 @@ static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX * static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { - r->out.s2 = "this is a test string"; + r->out.s2 = talloc_strdup(mem_ctx, "this is a test string"); return NT_STATUS_OK; } diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index 3c5caac118..9e77347fa7 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -136,7 +136,7 @@ static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CT return NT_STATUS_OK; } -static NTSTATUS remote_op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, void *r) +static NTSTATUS remote_op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r) { NTSTATUS status; const struct dcerpc_interface_table *table = dce_call->context->iface->private; -- cgit