2 * Copyright 2021 Jactry Zeng for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "comsvcs_private.h"
20 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(comsvcs
);
26 ISharedPropertyGroupManager ISharedPropertyGroupManager_iface
;
30 static struct group_manager
*group_manager
= NULL
;
32 static inline struct group_manager
*impl_from_ISharedPropertyGroupManager(ISharedPropertyGroupManager
*iface
)
34 return CONTAINING_RECORD(iface
, struct group_manager
, ISharedPropertyGroupManager_iface
);
37 static HRESULT WINAPI
group_manager_QueryInterface(ISharedPropertyGroupManager
*iface
, REFIID riid
, void **out
)
39 struct group_manager
*manager
= impl_from_ISharedPropertyGroupManager(iface
);
41 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
43 if (IsEqualGUID(riid
, &IID_IUnknown
)
44 || IsEqualGUID(riid
, &IID_IDispatch
)
45 || IsEqualGUID(riid
, &IID_ISharedPropertyGroupManager
))
47 *out
= &manager
->ISharedPropertyGroupManager_iface
;
48 IUnknown_AddRef((IUnknown
*)*out
);
52 WARN("%s not implemented.\n", debugstr_guid(riid
));
57 static ULONG WINAPI
group_manager_AddRef(ISharedPropertyGroupManager
*iface
)
59 struct group_manager
*manager
= impl_from_ISharedPropertyGroupManager(iface
);
60 ULONG refcount
= InterlockedIncrement(&manager
->refcount
);
62 TRACE("%p increasing refcount to %lu.\n", iface
, refcount
);
67 static ULONG WINAPI
group_manager_Release(ISharedPropertyGroupManager
*iface
)
69 struct group_manager
*manager
= impl_from_ISharedPropertyGroupManager(iface
);
70 ULONG refcount
= InterlockedDecrement(&manager
->refcount
);
72 TRACE("%p decreasing refcount to %lu.\n", iface
, refcount
);
77 static HRESULT WINAPI
group_manager_GetTypeInfoCount(ISharedPropertyGroupManager
*iface
, UINT
*info
)
79 FIXME("iface %p, info %p: stub.\n", iface
, info
);
83 static HRESULT WINAPI
group_manager_GetTypeInfo(ISharedPropertyGroupManager
*iface
, UINT index
, LCID lcid
,
86 FIXME("iface %p, index %u, lcid %lu, info %p: stub.\n", iface
, index
, lcid
, info
);
90 static HRESULT WINAPI
group_manager_GetIDsOfNames(ISharedPropertyGroupManager
*iface
, REFIID riid
,
91 LPOLESTR
*names
, UINT count
, LCID lcid
, DISPID
*dispid
)
93 FIXME("iface %p, riid %s, names %p, count %u, lcid %lu, dispid %p: stub.\n",
94 iface
, debugstr_guid(riid
), names
, count
, lcid
, dispid
);
99 static HRESULT WINAPI
group_manager_Invoke(ISharedPropertyGroupManager
*iface
, DISPID member
, REFIID riid
,
100 LCID lcid
, WORD flags
, DISPPARAMS
*params
, VARIANT
*result
, EXCEPINFO
*except
, UINT
*argerr
)
102 FIXME("iface %p, member %lu, riid %s, lcid %lu, flags %x, params %p, result %p, except %p, argerr %p: stub.\n",
103 iface
, member
, debugstr_guid(riid
), lcid
, flags
, params
, result
, except
, argerr
);
107 static HRESULT WINAPI
group_manager_CreatePropertyGroup(ISharedPropertyGroupManager
*iface
, BSTR name
,
108 LONG
*isolation
, LONG
*release
, VARIANT_BOOL
*exists
, ISharedPropertyGroup
**group
)
110 FIXME("iface %p, name %s, isolation %p, release %p, exists %p, group %p: stub.\n",
111 iface
, debugstr_w(name
), isolation
, release
, exists
, group
);
115 static HRESULT WINAPI
group_manager_get_Group(ISharedPropertyGroupManager
*iface
, BSTR name
,
116 ISharedPropertyGroup
**group
)
118 FIXME("iface %p, name %s, group %p: stub.\n", iface
, debugstr_w(name
), group
);
122 static HRESULT WINAPI
group_manager_get__NewEnum(ISharedPropertyGroupManager
*iface
, IUnknown
**retval
)
124 FIXME("iface %p, retval %p: stub.\n", iface
, retval
);
128 static const ISharedPropertyGroupManagerVtbl group_manager_vtbl
=
130 group_manager_QueryInterface
,
131 group_manager_AddRef
,
132 group_manager_Release
,
133 group_manager_GetTypeInfoCount
,
134 group_manager_GetTypeInfo
,
135 group_manager_GetIDsOfNames
,
136 group_manager_Invoke
,
137 group_manager_CreatePropertyGroup
,
138 group_manager_get_Group
,
139 group_manager_get__NewEnum
142 HRESULT WINAPI
group_manager_create(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **out
)
144 struct group_manager
*manager
;
147 return CLASS_E_NOAGGREGATION
;
151 manager
= malloc(sizeof(*manager
));
155 return E_OUTOFMEMORY
;
157 manager
->ISharedPropertyGroupManager_iface
.lpVtbl
= &group_manager_vtbl
;
158 manager
->refcount
= 1;
160 if (InterlockedCompareExchangePointer((void **)&group_manager
, manager
, NULL
))
165 return ISharedPropertyGroupManager_QueryInterface(&group_manager
->ISharedPropertyGroupManager_iface
, riid
, out
);