{
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})) {
$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";
}
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;
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);
}
#define __SAMBA_COM_H__
#include "librpc/gen_ndr/misc.h"
+#include "lib/talloc/talloc.h"
struct com_context;
struct tevent_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);
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);
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;
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);
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;