From d106cb2ee59a6517d28660efeeb4f8f5a976f56b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 7 May 2008 16:04:21 +0200 Subject: Reimport COM and DCOM libraries. --- source4/lib/com/dcom/tables.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source4/lib/com/dcom/tables.c (limited to 'source4/lib/com/dcom/tables.c') diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c new file mode 100644 index 0000000000..ce4f672d37 --- /dev/null +++ b/source4/lib/com/dcom/tables.c @@ -0,0 +1,49 @@ +/* + Unix SMB/CIFS implementation. + DCOM proxy tables functionality + Copyright (C) 2005 Jelmer Vernooij + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "dlinklist.h" +#include "librpc/gen_ndr/com_dcom.h" + +static struct dcom_proxy { + struct IUnknown_vtable *vtable; + struct dcom_proxy *prev, *next; +} *proxies = NULL; + +NTSTATUS dcom_register_proxy(struct IUnknown_vtable *proxy_vtable) +{ + struct dcom_proxy *proxy = talloc(talloc_autofree_context(), struct dcom_proxy); + + proxy->vtable = proxy_vtable; + DLIST_ADD(proxies, proxy); + + return NT_STATUS_OK; +} + +struct IUnknown_vtable *dcom_proxy_vtable_by_iid(struct GUID *iid) +{ + struct dcom_proxy *p; + for (p = proxies; p; p = p->next) { + if (GUID_equal(&p->vtable->iid, iid)) { + return p->vtable; + } + } + return NULL; +} -- cgit From 3667256f9791347fa4a505b85c0ebc7914427198 Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Sun, 14 Sep 2008 23:03:35 +0200 Subject: Import WMI changes. --- source4/lib/com/dcom/tables.c | 45 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'source4/lib/com/dcom/tables.c') diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c index ce4f672d37..26a18a9ae9 100644 --- a/source4/lib/com/dcom/tables.c +++ b/source4/lib/com/dcom/tables.c @@ -2,6 +2,7 @@ Unix SMB/CIFS implementation. DCOM proxy tables functionality Copyright (C) 2005 Jelmer Vernooij + Copyright (C) 2006 Andrzej Hajda This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,8 +20,9 @@ */ #include "includes.h" -#include "dlinklist.h" +#include "lib/util/dlinklist.h" #include "librpc/gen_ndr/com_dcom.h" +#include "lib/com/dcom/dcom.h" static struct dcom_proxy { struct IUnknown_vtable *vtable; @@ -47,3 +49,44 @@ struct IUnknown_vtable *dcom_proxy_vtable_by_iid(struct GUID *iid) } return NULL; } + +static struct dcom_marshal { + struct GUID clsid; + marshal_fn marshal; + unmarshal_fn unmarshal; + struct dcom_marshal *prev, *next; +} *marshals = NULL; + +NTSTATUS dcom_register_marshal(struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal) +{ + struct dcom_marshal *p = talloc(talloc_autofree_context(), struct dcom_marshal); + + p->clsid = *clsid; + p->marshal = marshal; + p->unmarshal = unmarshal; + DLIST_ADD(marshals, p); + return NT_STATUS_OK; +} + +_PUBLIC_ marshal_fn dcom_marshal_by_clsid(struct GUID *clsid) +{ + struct dcom_marshal *p; + for (p = marshals; p; p = p->next) { + if (GUID_equal(&p->clsid, clsid)) { + return p->marshal; + } + } + return NULL; +} + +_PUBLIC_ unmarshal_fn dcom_unmarshal_by_clsid(struct GUID *clsid) +{ + struct dcom_marshal *p; + for (p = marshals; p; p = p->next) { + if (GUID_equal(&p->clsid, clsid)) { + return p->unmarshal; + } + } + return NULL; +} + -- cgit From 0d99e58f272ab05873b706a154a528d04749c335 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 12 Oct 2008 04:41:53 +0200 Subject: Fix include paths for files that aren't compiled - breaks dependency file generation. --- source4/lib/com/dcom/tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/com/dcom/tables.c') diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c index 26a18a9ae9..f94aa87925 100644 --- a/source4/lib/com/dcom/tables.c +++ b/source4/lib/com/dcom/tables.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "lib/util/dlinklist.h" +#include "../lib/util/dlinklist.h" #include "librpc/gen_ndr/com_dcom.h" #include "lib/com/dcom/dcom.h" -- cgit