2 Unix SMB/CIFS implementation.
3 DCOM interface and class tables
4 Copyright (C) 2004 Jelmer Vernooij <jelmer@samba.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "dlinklist.h"
24 static struct class_list
{
25 struct class_list
*prev
, *next
;
26 struct dcom_class
class;
29 static struct interface_list
{
30 struct interface_list
*prev
, *next
;
31 struct dcom_interface interface
;
34 const struct dcom_interface
*dcom_interface_by_iid(const struct GUID
*iid
)
36 struct interface_list
*l
= interfaces
;
40 if (GUID_equal(iid
, &l
->interface
.iid
))
49 const struct dcom_class
*dcom_class_by_clsid(const struct GUID
*clsid
)
51 struct class_list
*c
= classes
;
55 if (GUID_equal(clsid
, &c
->class.clsid
)) {
65 const void *dcom_proxy_vtable_by_iid(const struct GUID
*iid
)
67 const struct dcom_interface
*iface
= dcom_interface_by_iid(iid
);
73 return iface
->proxy_vtable
;
76 NTSTATUS
dcom_register_interface(const void *_iface
)
78 const struct dcom_interface
*iface
= _iface
;
79 struct interface_list
*l
;
81 l
= talloc_zero_p(interfaces
?interfaces
:talloc_autofree_context(),
82 struct interface_list
);
84 l
->interface
= *iface
;
86 DLIST_ADD(interfaces
, l
);
91 NTSTATUS
dcom_register_class(const void *_class
)
93 const struct dcom_class
*class = _class
;
94 struct class_list
*l
= talloc_zero_p(classes
?classes
:talloc_autofree_context(),
99 DLIST_ADD(classes
, l
);