2 * Copyright 2020 Dmitry Timoshkov
4 * This file contains only stubs to get the printui.dll up and running
5 * activeds.dll is much much more than this
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/heap.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(activeds
);
36 DEFINE_GUID(CLSID_Pathname
,0x080d0d78,0xf421,0x11d0,0xa3,0x6e,0x00,0xc0,0x4f,0xb9,0x50,0xdc);
40 IADsPathname IADsPathname_iface
;
45 static inline Pathname
*impl_from_IADsPathname(IADsPathname
*iface
)
47 return CONTAINING_RECORD(iface
, Pathname
, IADsPathname_iface
);
50 static HRESULT WINAPI
path_QueryInterface(IADsPathname
*iface
, REFIID riid
, void **obj
)
52 TRACE("%p,%s,%p\n", iface
, debugstr_guid(riid
), obj
);
54 if (!riid
|| !obj
) return E_INVALIDARG
;
56 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
57 IsEqualGUID(riid
, &IID_IDispatch
) ||
58 IsEqualGUID(riid
, &IID_IADsPathname
))
60 IADsPathname_AddRef(iface
);
65 FIXME("interface %s is not implemented\n", debugstr_guid(riid
));
69 static ULONG WINAPI
path_AddRef(IADsPathname
*iface
)
71 Pathname
*path
= impl_from_IADsPathname(iface
);
72 return InterlockedIncrement(&path
->ref
);
75 static ULONG WINAPI
path_Release(IADsPathname
*iface
)
77 Pathname
*path
= impl_from_IADsPathname(iface
);
78 LONG ref
= InterlockedDecrement(&path
->ref
);
82 TRACE("destroying %p\n", iface
);
89 static HRESULT WINAPI
path_GetTypeInfoCount(IADsPathname
*iface
, UINT
*count
)
91 FIXME("%p,%p: stub\n", iface
, count
);
95 static HRESULT WINAPI
path_GetTypeInfo(IADsPathname
*iface
, UINT index
, LCID lcid
, ITypeInfo
**info
)
97 FIXME("%p,%u,%#x,%p: stub\n", iface
, index
, lcid
, info
);
101 static HRESULT WINAPI
path_GetIDsOfNames(IADsPathname
*iface
, REFIID riid
, LPOLESTR
*names
,
102 UINT count
, LCID lcid
, DISPID
*dispid
)
104 FIXME("%p,%s,%p,%u,%u,%p: stub\n", iface
, debugstr_guid(riid
), names
, count
, lcid
, dispid
);
108 static HRESULT WINAPI
path_Invoke(IADsPathname
*iface
, DISPID dispid
, REFIID riid
, LCID lcid
, WORD flags
,
109 DISPPARAMS
*params
, VARIANT
*result
, EXCEPINFO
*excepinfo
, UINT
*argerr
)
111 FIXME("%p,%d,%s,%04x,%04x,%p,%p,%p,%p: stub\n", iface
, dispid
, debugstr_guid(riid
), lcid
, flags
,
112 params
, result
, excepinfo
, argerr
);
116 static HRESULT WINAPI
path_Set(IADsPathname
*iface
, BSTR adspath
, LONG type
)
118 Pathname
*path
= impl_from_IADsPathname(iface
);
120 FIXME("%p,%s,%d: stub\n", iface
, debugstr_w(adspath
), type
);
122 if (!adspath
) return E_INVALIDARG
;
124 path
->adspath
= SysAllocString(adspath
);
125 return path
->adspath
? S_OK
: E_OUTOFMEMORY
;
128 static HRESULT WINAPI
path_SetDisplayType(IADsPathname
*iface
, LONG type
)
130 FIXME("%p,%d: stub\n", iface
, type
);
134 static HRESULT WINAPI
path_Retrieve(IADsPathname
*iface
, LONG type
, BSTR
*adspath
)
136 Pathname
*path
= impl_from_IADsPathname(iface
);
138 FIXME("%p,%d,%p: stub\n", iface
, type
, adspath
);
140 if (!adspath
) return E_INVALIDARG
;
142 *adspath
= SysAllocString(path
->adspath
);
143 return *adspath
? S_OK
: E_OUTOFMEMORY
;
146 static HRESULT WINAPI
path_GetNumElements(IADsPathname
*iface
, LONG
*count
)
148 FIXME("%p,%p: stub\n", iface
, count
);
152 static HRESULT WINAPI
path_GetElement(IADsPathname
*iface
, LONG index
, BSTR
*element
)
154 FIXME("%p,%d,%p: stub\n", iface
, index
, element
);
158 static HRESULT WINAPI
path_AddLeafElement(IADsPathname
*iface
, BSTR element
)
160 FIXME("%p,%s: stub\n", iface
, debugstr_w(element
));
164 static HRESULT WINAPI
path_RemoveLeafElement(IADsPathname
*iface
)
166 FIXME("%p: stub\n", iface
);
170 static HRESULT WINAPI
path_CopyPath(IADsPathname
*iface
, IDispatch
**path
)
172 FIXME("%p,%p: stub\n", iface
, path
);
176 static HRESULT WINAPI
path_GetEscapedElement(IADsPathname
*iface
, LONG reserved
, BSTR element
, BSTR
*str
)
178 FIXME("%p,%d,%s,%p: stub\n", iface
, reserved
, debugstr_w(element
), str
);
182 static HRESULT WINAPI
path_get_EscapedMode(IADsPathname
*iface
, LONG
*mode
)
184 FIXME("%p,%p: stub\n", iface
, mode
);
188 static HRESULT WINAPI
path_put_EscapedMode(IADsPathname
*iface
, LONG mode
)
190 FIXME("%p,%d: stub\n", iface
, mode
);
194 static const IADsPathnameVtbl IADsPathname_vtbl
=
199 path_GetTypeInfoCount
,
209 path_RemoveLeafElement
,
211 path_GetEscapedElement
,
212 path_get_EscapedMode
,
216 static HRESULT
Pathname_create(REFIID riid
, void **obj
)
221 path
= heap_alloc(sizeof(*path
));
222 if (!path
) return E_OUTOFMEMORY
;
224 path
->IADsPathname_iface
.lpVtbl
= &IADsPathname_vtbl
;
226 path
->adspath
= NULL
;
228 hr
= IADsPathname_QueryInterface(&path
->IADsPathname_iface
, riid
, obj
);
229 IADsPathname_Release(&path
->IADsPathname_iface
);
234 static const struct class_info
237 HRESULT (*constructor
)(REFIID
, void **);
240 { &CLSID_Pathname
, Pathname_create
}
245 IClassFactory IClassFactory_iface
;
247 const struct class_info
*info
;
250 static inline class_factory
*impl_from_IClassFactory(IClassFactory
*iface
)
252 return CONTAINING_RECORD(iface
, class_factory
, IClassFactory_iface
);
255 static HRESULT WINAPI
factory_QueryInterface(IClassFactory
*iface
, REFIID riid
, LPVOID
*obj
)
257 TRACE("%p,%s,%p\n", iface
, debugstr_guid(riid
), obj
);
259 if (!riid
|| !obj
) return E_INVALIDARG
;
261 if (IsEqualIID(riid
, &IID_IUnknown
) ||
262 IsEqualIID(riid
, &IID_IClassFactory
))
264 IClassFactory_AddRef(iface
);
270 FIXME("interface %s is not implemented\n", debugstr_guid(riid
));
271 return E_NOINTERFACE
;
274 static ULONG WINAPI
factory_AddRef(IClassFactory
*iface
)
276 class_factory
*factory
= impl_from_IClassFactory(iface
);
277 ULONG ref
= InterlockedIncrement(&factory
->ref
);
279 TRACE("(%p) ref %u\n", iface
, ref
);
284 static ULONG WINAPI
factory_Release(IClassFactory
*iface
)
286 class_factory
*factory
= impl_from_IClassFactory(iface
);
287 ULONG ref
= InterlockedDecrement(&factory
->ref
);
289 TRACE("(%p) ref %u\n", iface
, ref
);
297 static HRESULT WINAPI
factory_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **obj
)
299 class_factory
*factory
= impl_from_IClassFactory(iface
);
301 TRACE("%p,%s,%p\n", outer
, debugstr_guid(riid
), obj
);
303 if (!riid
|| !obj
) return E_INVALIDARG
;
306 if (outer
) return CLASS_E_NOAGGREGATION
;
308 return factory
->info
->constructor(riid
, obj
);
311 static HRESULT WINAPI
factory_LockServer(IClassFactory
*iface
, BOOL lock
)
313 FIXME("%p,%d: stub\n", iface
, lock
);
317 static const struct IClassFactoryVtbl factory_vtbl
=
319 factory_QueryInterface
,
322 factory_CreateInstance
,
326 static HRESULT
factory_constructor(const struct class_info
*info
, REFIID riid
, void **obj
)
328 class_factory
*factory
;
331 factory
= heap_alloc(sizeof(*factory
));
332 if (!factory
) return E_OUTOFMEMORY
;
334 factory
->IClassFactory_iface
.lpVtbl
= &factory_vtbl
;
336 factory
->info
= info
;
338 hr
= IClassFactory_QueryInterface(&factory
->IClassFactory_iface
, riid
, obj
);
339 IClassFactory_Release(&factory
->IClassFactory_iface
);
344 HRESULT WINAPI
DllGetClassObject(REFCLSID clsid
, REFIID iid
, LPVOID
*obj
)
348 TRACE("%s,%s,%p\n", debugstr_guid(clsid
), debugstr_guid(iid
), obj
);
350 if (!clsid
|| !iid
|| !obj
) return E_INVALIDARG
;
354 for (i
= 0; i
< ARRAY_SIZE(class_info
); i
++)
356 if (IsEqualCLSID(class_info
[i
].clsid
, clsid
))
357 return factory_constructor(&class_info
[i
], iid
, obj
);
360 FIXME("class %s/%s is not implemented\n", debugstr_guid(clsid
), debugstr_guid(iid
));
361 return CLASS_E_CLASSNOTAVAILABLE
;