wined3d: Pass fully initialized shader objects to CS.
[wine.git] / dlls / msdaps / main.c
blob403df3a100b28bf30ad3ac16000f8a00793e287e
1 /*
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
20 #include <stdarg.h>
21 #include <string.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winuser.h"
29 #include "winerror.h"
30 #include "initguid.h"
31 #include "objbase.h"
32 #include "oleauto.h"
33 #define DBINITCONSTANTS
34 #include "oledb.h"
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;
45 extern HRESULT WINAPI msdaps_DllRegisterServer(void) DECLSPEC_HIDDEN;
46 extern HRESULT WINAPI msdaps_DllUnregisterServer(void) DECLSPEC_HIDDEN;
48 /*****************************************************************************
49 * DllMain
51 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
53 return msdaps_DllMain(instance, reason, reserved);
57 /******************************************************************************
58 * ClassFactory
60 typedef struct
62 IClassFactory IClassFactory_iface;
63 HRESULT (*create_object)( IUnknown*, LPVOID* );
64 } cf;
66 static inline cf *impl_from_IClassFactory(IClassFactory *iface)
68 return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
71 static HRESULT WINAPI CF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
73 cf *This = impl_from_IClassFactory(iface);
75 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj);
77 if( IsEqualCLSID( riid, &IID_IUnknown ) ||
78 IsEqualCLSID( riid, &IID_IClassFactory ) )
80 IClassFactory_AddRef( iface );
81 *obj = iface;
82 return S_OK;
84 return E_NOINTERFACE;
87 static ULONG WINAPI CF_AddRef(IClassFactory *iface)
89 return 2;
92 static ULONG WINAPI CF_Release(IClassFactory *iface)
94 return 1;
97 static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **obj)
99 cf *This = impl_from_IClassFactory(iface);
100 IUnknown *unk = NULL;
101 HRESULT r;
103 TRACE("(%p, %p, %s, %p)\n", This, pOuter, debugstr_guid(riid), obj);
105 r = This->create_object( pOuter, (void **) &unk );
106 if (SUCCEEDED(r))
108 r = IUnknown_QueryInterface( unk, riid, obj );
109 IUnknown_Release( unk );
111 return r;
114 static HRESULT WINAPI CF_LockServer(IClassFactory *iface, BOOL dolock)
116 FIXME("(%p, %d): stub\n", iface, dolock);
117 return S_OK;
120 static const IClassFactoryVtbl CF_Vtbl =
122 CF_QueryInterface,
123 CF_AddRef,
124 CF_Release,
125 CF_CreateInstance,
126 CF_LockServer
129 static cf row_server_cf = { { &CF_Vtbl }, create_row_server };
130 static cf row_proxy_cf = { { &CF_Vtbl }, create_row_marshal };
131 static cf rowset_server_cf = { { &CF_Vtbl }, create_rowset_server };
132 static cf rowset_proxy_cf = { { &CF_Vtbl }, create_rowset_marshal };
134 /***********************************************************************
135 * DllGetClassObject
137 HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, LPVOID *obj)
139 TRACE("(%s, %s, %p)\n", debugstr_guid(clsid), debugstr_guid(iid), obj);
141 if (IsEqualCLSID(clsid, &CLSID_wine_row_server))
143 *obj = &row_server_cf;
144 return S_OK;
147 if (IsEqualCLSID(clsid, &CLSID_wine_row_proxy))
149 *obj = &row_proxy_cf;
150 return S_OK;
153 if (IsEqualCLSID(clsid, &CLSID_wine_rowset_server))
155 *obj = &rowset_server_cf;
156 return S_OK;
159 if (IsEqualCLSID(clsid, &CLSID_wine_rowset_proxy))
161 *obj = &rowset_proxy_cf;
162 return S_OK;
165 return msdaps_DllGetClassObject(clsid, iid, obj);
168 /***********************************************************************
169 * DllCanUnloadNow
171 HRESULT WINAPI DllCanUnloadNow(void)
173 return msdaps_DllCanUnloadNow();
176 /***********************************************************************
177 * DllRegisterServer
179 HRESULT WINAPI DllRegisterServer(void)
181 return msdaps_DllRegisterServer();
184 /***********************************************************************
185 * DllUnregisterServer
187 HRESULT WINAPI DllUnregisterServer(void)
189 return msdaps_DllUnregisterServer();