diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm index 27e1e5d4243..35e6e3f0d19 100644 --- a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm +++ b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm @@ -44,9 +44,9 @@ sub ParseRegFunc($) { my $interface = shift; - $res .= "static NTSTATUS dcom_proxy_$interface->{NAME}_init(void) + $res .= "static NTSTATUS dcom_proxy_$interface->{NAME}_init(TALLOC_CTX *ctx) { - struct $interface->{NAME}_vtable *proxy_vtable = talloc(talloc_autofree_context(), struct $interface->{NAME}_vtable); + struct $interface->{NAME}_vtable *proxy_vtable = talloc(ctx, struct $interface->{NAME}_vtable); "; if (defined($interface->{BASE})) { @@ -75,7 +75,7 @@ sub ParseRegFunc($) $res.= " proxy_vtable->iid = ndr_table_$interface->{NAME}.syntax_id.uuid; - return dcom_register_proxy((struct IUnknown_vtable *)proxy_vtable); + return dcom_register_proxy(ctx, (struct IUnknown_vtable *)proxy_vtable); }\n\n"; } diff --git a/source4/lib/com/classes/simple.c b/source4/lib/com/classes/simple.c index 28f5d848de5..7d0573372e3 100644 --- a/source4/lib/com/classes/simple.c +++ b/source4/lib/com/classes/simple.c @@ -110,7 +110,7 @@ static struct IStream_vtable simple_IStream_vtable = { NTSTATUS com_simple_init(TALLOC_CTX *ctx) { struct GUID clsid; - struct IUnknown *class_object = talloc(talloc_autofree_context(), struct IUnknown); + struct IUnknown *class_object = talloc(ctx, struct IUnknown); class_object->ctx = NULL; class_object->object_data = NULL; @@ -120,5 +120,5 @@ NTSTATUS com_simple_init(TALLOC_CTX *ctx) GUID_from_string(COM_ICLASSFACTORY_UUID, &simple_classobject_vtable.iid); GUID_from_string(COM_ISTREAM_UUID, &simple_IStream_vtable.iid); - return com_register_running_class(&clsid, PROGID_SIMPLE, class_object); + return com_register_running_class(ctx, &clsid, PROGID_SIMPLE, class_object); } diff --git a/source4/lib/com/com.h b/source4/lib/com/com.h index 82d10daf4fd..e6be3114678 100644 --- a/source4/lib/com/com.h +++ b/source4/lib/com/com.h @@ -21,6 +21,7 @@ #define __SAMBA_COM_H__ #include "librpc/gen_ndr/misc.h" +#include "lib/talloc/talloc.h" struct com_context; struct tevent_context; @@ -38,7 +39,7 @@ struct com_context }; struct IUnknown *com_class_by_clsid(struct com_context *ctx, const struct GUID *clsid); -NTSTATUS com_register_running_class(struct GUID *clsid, const char *progid, struct IUnknown *p); +NTSTATUS com_register_running_class(TALLOC_CTX *ctx, struct GUID *clsid, const char *progid, struct IUnknown *p); struct dcom_interface_p *dcom_get_local_iface_p(struct GUID *ipid); diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c index f94aa879253..7f745c1d479 100644 --- a/source4/lib/com/dcom/tables.c +++ b/source4/lib/com/dcom/tables.c @@ -29,9 +29,10 @@ static struct dcom_proxy { struct dcom_proxy *prev, *next; } *proxies = NULL; -NTSTATUS dcom_register_proxy(struct IUnknown_vtable *proxy_vtable) +NTSTATUS dcom_register_proxy(TALLOC_CTX *ctx, + struct IUnknown_vtable *proxy_vtable) { - struct dcom_proxy *proxy = talloc(talloc_autofree_context(), struct dcom_proxy); + struct dcom_proxy *proxy = talloc(ctx, struct dcom_proxy); proxy->vtable = proxy_vtable; DLIST_ADD(proxies, proxy); @@ -57,9 +58,10 @@ static struct dcom_marshal { struct dcom_marshal *prev, *next; } *marshals = NULL; -NTSTATUS dcom_register_marshal(struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal) +NTSTATUS dcom_register_marshal(TALLOC_CTX *ctx, + struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal) { - struct dcom_marshal *p = talloc(talloc_autofree_context(), struct dcom_marshal); + struct dcom_marshal *p = talloc(ctx, struct dcom_marshal); p->clsid = *clsid; p->marshal = marshal; diff --git a/source4/lib/com/tables.c b/source4/lib/com/tables.c index 842067e8a54..e1f93bcae59 100644 --- a/source4/lib/com/tables.c +++ b/source4/lib/com/tables.c @@ -96,9 +96,11 @@ struct IUnknown *com_class_by_clsid(struct com_context *ctx, const struct GUID * return NULL; } -NTSTATUS com_register_running_class(struct GUID *clsid, const char *progid, struct IUnknown *p) +NTSTATUS com_register_running_class(TALLOC_CTX *ctx, + struct GUID *clsid, const char *progid, struct IUnknown *p) { - struct com_class *l = talloc_zero(running_classes?running_classes:talloc_autofree_context(), struct com_class); + struct com_class *l = talloc_zero(running_classes? + running_classes : ctx, struct com_class); l->clsid = *clsid; l->progid = talloc_strdup(l, progid); diff --git a/source4/lib/wmi/wbemdata.c b/source4/lib/wmi/wbemdata.c index 2aeda01a50e..df98da43a2a 100644 --- a/source4/lib/wmi/wbemdata.c +++ b/source4/lib/wmi/wbemdata.c @@ -432,11 +432,11 @@ struct composite_context *dcom_proxy_IEnumWbemClassObject_Release_send(struct IU return c; } -NTSTATUS dcom_proxy_IWbemClassObject_init(void) +NTSTATUS dcom_proxy_IWbemClassObject_init(TALLOC_CTX *ctx) { struct GUID clsid; GUID_from_string("4590f812-1d3a-11d0-891f-00aa004b2e24", &clsid); - dcom_register_marshal(&clsid, marshal, unmarshal); + dcom_register_marshal(ctx, &clsid, marshal, unmarshal); #if 0 struct IEnumWbemClassObject_vtable *proxy_vtable;