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(struct IUnknown_vtable
*proxy_vtable
)
34 struct dcom_proxy
*proxy
= talloc(talloc_autofree_context(), struct dcom_proxy
);
36 proxy
->vtable
= proxy_vtable
;
37 DLIST_ADD(proxies
, proxy
);
42 struct IUnknown_vtable
*dcom_proxy_vtable_by_iid(struct GUID
*iid
)
45 for (p
= proxies
; p
; p
= p
->next
) {
46 if (GUID_equal(&p
->vtable
->iid
, iid
)) {
53 static struct dcom_marshal
{
56 unmarshal_fn unmarshal
;
57 struct dcom_marshal
*prev
, *next
;
60 NTSTATUS
dcom_register_marshal(struct GUID
*clsid
, marshal_fn marshal
, unmarshal_fn unmarshal
)
62 struct dcom_marshal
*p
= talloc(talloc_autofree_context(), struct dcom_marshal
);
66 p
->unmarshal
= unmarshal
;
67 DLIST_ADD(marshals
, p
);
71 _PUBLIC_ marshal_fn
dcom_marshal_by_clsid(struct GUID
*clsid
)
73 struct dcom_marshal
*p
;
74 for (p
= marshals
; p
; p
= p
->next
) {
75 if (GUID_equal(&p
->clsid
, clsid
)) {
82 _PUBLIC_ unmarshal_fn
dcom_unmarshal_by_clsid(struct GUID
*clsid
)
84 struct dcom_marshal
*p
;
85 for (p
= marshals
; p
; p
= p
->next
) {
86 if (GUID_equal(&p
->clsid
, clsid
)) {