2 * msdaps initialisation.
4 * Copyright 2010 Huw Davies
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
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
36 #include "row_server.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(oledb);
42 extern BOOL WINAPI msdaps_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN;
43 extern HRESULT WINAPI msdaps_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN;
44 extern HRESULT WINAPI msdaps_DllCanUnloadNow(void) DECLSPEC_HIDDEN;
46 /*****************************************************************************
49 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
51 return msdaps_DllMain(instance, reason, reserved);
55 /******************************************************************************
60 const IClassFactoryVtbl *lpVtbl;
61 HRESULT (*create_object)( IUnknown*, LPVOID* );
64 static HRESULT WINAPI CF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
66 cf *This = (cf *)iface;
68 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj);
70 if( IsEqualCLSID( riid, &IID_IUnknown ) ||
71 IsEqualCLSID( riid, &IID_IClassFactory ) )
73 IClassFactory_AddRef( iface );
80 static ULONG WINAPI CF_AddRef(IClassFactory *iface)
85 static ULONG WINAPI CF_Release(IClassFactory *iface)
90 static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **obj)
92 cf *This = (cf *)iface;
96 TRACE("(%p, %p, %s, %p)\n", This, pOuter, debugstr_guid(riid), obj);
98 r = This->create_object( pOuter, (void **) &unk );
101 r = IUnknown_QueryInterface( unk, riid, obj );
102 IUnknown_Release( unk );
107 static HRESULT WINAPI CF_LockServer(IClassFactory *iface, BOOL dolock)
109 FIXME("(%p, %d): stub\n", iface, dolock);
113 static const IClassFactoryVtbl CF_Vtbl =
122 static cf row_server_cf = { &CF_Vtbl, create_row_server };
123 static cf row_proxy_cf = { &CF_Vtbl, create_row_marshal };
124 static cf rowset_server_cf = { &CF_Vtbl, create_rowset_server };
125 static cf rowset_proxy_cf = { &CF_Vtbl, create_rowset_marshal };
127 /***********************************************************************
130 HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, LPVOID *obj)
132 TRACE("(%s, %s, %p)\n", debugstr_guid(clsid), debugstr_guid(iid), obj);
134 if (IsEqualCLSID(clsid, &CLSID_wine_row_server))
136 *obj = &row_server_cf;
140 if (IsEqualCLSID(clsid, &CLSID_wine_row_proxy))
142 *obj = &row_proxy_cf;
146 if (IsEqualCLSID(clsid, &CLSID_wine_rowset_server))
148 *obj = &rowset_server_cf;
152 if (IsEqualCLSID(clsid, &CLSID_wine_rowset_proxy))
154 *obj = &rowset_proxy_cf;
158 return msdaps_DllGetClassObject(clsid, iid, obj);
161 /***********************************************************************
164 HRESULT WINAPI DllCanUnloadNow(void)
166 return msdaps_DllCanUnloadNow();