2 * Class factory interface for WiaServc
4 * Copyright (C) 2009 Damjan Jovanovic
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wiaservc_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(wia
);
35 static inline ClassFactoryImpl
*impl_from_IClassFactory(IClassFactory
*iface
)
37 return CONTAINING_RECORD(iface
, ClassFactoryImpl
, IClassFactory_iface
);
41 WIASERVC_IClassFactory_AddRef(LPCLASSFACTORY iface
)
47 WIASERVC_IClassFactory_QueryInterface(LPCLASSFACTORY iface
, REFIID riid
,
50 ClassFactoryImpl
*This
= impl_from_IClassFactory(iface
);
52 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IClassFactory
))
54 *ppvObj
= &This
->IClassFactory_iface
;
63 WIASERVC_IClassFactory_Release(LPCLASSFACTORY iface
)
69 WIASERVC_IClassFactory_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pUnkOuter
,
70 REFIID riid
, LPVOID
*ppvObj
)
73 IUnknown
*punk
= NULL
;
75 TRACE("IID: %s\n", debugstr_guid(riid
));
78 return CLASS_E_NOAGGREGATION
;
80 res
= wiadevmgr_Constructor(pUnkOuter
, (LPVOID
*) &punk
);
84 res
= IUnknown_QueryInterface(punk
, riid
, ppvObj
);
85 IUnknown_Release(punk
);
90 WIASERVC_IClassFactory_LockServer(LPCLASSFACTORY iface
, BOOL fLock
)
92 FIXME("Not implemented\n");
96 static const IClassFactoryVtbl WIASERVC_IClassFactory_Vtbl
=
98 WIASERVC_IClassFactory_QueryInterface
,
99 WIASERVC_IClassFactory_AddRef
,
100 WIASERVC_IClassFactory_Release
,
101 WIASERVC_IClassFactory_CreateInstance
,
102 WIASERVC_IClassFactory_LockServer
105 ClassFactoryImpl WIASERVC_ClassFactory
=
107 { &WIASERVC_IClassFactory_Vtbl
}