mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
s4: COM: Remove talloc_autofree_context() from (unused) COM code.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
1c1fce7414
commit
fe2ac3e304
@ -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";
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user