2 Unix SMB/CIFS implementation.
3 DCOM proxy tables functionality
4 Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org>
5 Copyright (C) 2006 Andrzej Hajda <andrzej.hajda@wp.pl>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "../lib/util/dlinklist.h"
24 #include "librpc/gen_ndr/com_dcom.h"
25 #include "lib/com/dcom/dcom.h"
27 static struct dcom_proxy {
28 struct IUnknown_vtable *vtable;
29 struct dcom_proxy *prev, *next;
32 NTSTATUS dcom_register_proxy(TALLOC_CTX *ctx,
33 struct IUnknown_vtable *proxy_vtable)
35 struct dcom_proxy *proxy = talloc(ctx, struct dcom_proxy);
37 proxy->vtable = proxy_vtable;
38 DLIST_ADD(proxies, proxy);
43 struct IUnknown_vtable *dcom_proxy_vtable_by_iid(struct GUID *iid)
46 for (p = proxies; p; p = p->next) {
47 if (GUID_equal(&p->vtable->iid, iid)) {
54 static struct dcom_marshal {
57 unmarshal_fn unmarshal;
58 struct dcom_marshal *prev, *next;
61 NTSTATUS dcom_register_marshal(TALLOC_CTX *ctx,
62 struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal)
64 struct dcom_marshal *p = talloc(ctx, struct dcom_marshal);
68 p->unmarshal = unmarshal;
69 DLIST_ADD(marshals, p);
73 _PUBLIC_ marshal_fn dcom_marshal_by_clsid(struct GUID *clsid)
75 struct dcom_marshal *p;
76 for (p = marshals; p; p = p->next) {
77 if (GUID_equal(&p->clsid, clsid)) {
84 _PUBLIC_ unmarshal_fn dcom_unmarshal_by_clsid(struct GUID *clsid)
86 struct dcom_marshal *p;
87 for (p = marshals; p; p = p->next) {
88 if (GUID_equal(&p->clsid, clsid)) {