d3d8/tests: Test invalid volume lock boxes.
[wine/multimedia.git] / dlls / oledb32 / dslocator.c
blobdcc2fe3c390b8e09d4bf34ce07235bc0e9944f80
1 /* Data Links
3 * Copyright 2013 Alistair Leslie-Hughes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <string.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "objbase.h"
27 #include "oleauto.h"
28 #include "winerror.h"
29 #include "oledb.h"
30 #include "oledberr.h"
31 #include "msdasc.h"
33 #include "oledb_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(oledb);
40 typedef struct DSLocatorImpl
42 IDataSourceLocator IDataSourceLocator_iface;
43 LONG ref;
45 } DSLocatorImpl;
47 static inline DSLocatorImpl *impl_from_IDataSourceLocator( IDataSourceLocator *iface )
49 return CONTAINING_RECORD(iface, DSLocatorImpl, IDataSourceLocator_iface);
53 static HRESULT WINAPI dslocator_QueryInterface(IDataSourceLocator *iface, REFIID riid, void **ppvoid)
55 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
56 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid),ppvoid);
58 *ppvoid = NULL;
60 if (IsEqualIID(riid, &IID_IUnknown) ||
61 IsEqualIID(riid, &IID_IDispatch) ||
62 IsEqualIID(riid, &IID_IDataSourceLocator))
64 *ppvoid = &This->IDataSourceLocator_iface;
67 if(*ppvoid)
69 IUnknown_AddRef( (IUnknown*)*ppvoid );
70 return S_OK;
73 FIXME("interface %s not implemented\n", debugstr_guid(riid));
74 return E_NOINTERFACE;
77 static ULONG WINAPI dslocator_AddRef(IDataSourceLocator *iface)
79 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
80 TRACE("(%p)->%u\n",This,This->ref);
81 return InterlockedIncrement(&This->ref);
84 static ULONG WINAPI dslocator_Release(IDataSourceLocator *iface)
86 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
87 ULONG ref = InterlockedDecrement(&This->ref);
89 TRACE("(%p)->%u\n",This,ref+1);
91 if (!ref)
93 heap_free(This);
96 return ref;
99 static HRESULT WINAPI dslocator_GetTypeInfoCount(IDataSourceLocator *iface, UINT *pctinfo)
101 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
103 FIXME("(%p)->()\n", This);
105 return E_NOTIMPL;
108 static HRESULT WINAPI dslocator_GetTypeInfo(IDataSourceLocator *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
110 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
112 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
114 return E_NOTIMPL;
117 static HRESULT WINAPI dslocator_GetIDsOfNames(IDataSourceLocator *iface, REFIID riid, LPOLESTR *rgszNames,
118 UINT cNames, LCID lcid, DISPID *rgDispId)
120 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
122 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
124 return E_NOTIMPL;
127 static HRESULT WINAPI dslocator_Invoke(IDataSourceLocator *iface, DISPID dispIdMember, REFIID riid,
128 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
130 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
132 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
133 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
135 return E_NOTIMPL;
138 static HRESULT WINAPI dslocator_get_hWnd(IDataSourceLocator *iface, LONG *phwndParent)
140 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
142 FIXME("(%p)->(%p)\n",This, phwndParent);
144 return E_NOTIMPL;
147 static HRESULT WINAPI dslocator_put_hWnd(IDataSourceLocator *iface, LONG phwndParent)
149 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
151 FIXME("(%p)->(%d)\n",This, phwndParent);
153 return E_NOTIMPL;
156 static HRESULT WINAPI dslocator_PromptNew(IDataSourceLocator *iface, IDispatch **ppADOConnection)
158 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
160 FIXME("(%p)->(%p)\n",This, ppADOConnection);
162 return E_NOTIMPL;
165 static HRESULT WINAPI dslocator_PromptEdit(IDataSourceLocator *iface, IDispatch **ppADOConnection, VARIANT_BOOL *success)
167 DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
169 FIXME("(%p)->(%p %p)\n",This, ppADOConnection, success);
171 return E_NOTIMPL;
174 static const IDataSourceLocatorVtbl DSLocatorVtbl =
176 dslocator_QueryInterface,
177 dslocator_AddRef,
178 dslocator_Release,
179 dslocator_GetTypeInfoCount,
180 dslocator_GetTypeInfo,
181 dslocator_GetIDsOfNames,
182 dslocator_Invoke,
183 dslocator_get_hWnd,
184 dslocator_put_hWnd,
185 dslocator_PromptNew,
186 dslocator_PromptEdit
189 HRESULT create_dslocator(IUnknown *outer, void **obj)
191 DSLocatorImpl *This;
193 TRACE("(%p, %p)\n", outer, obj);
195 *obj = NULL;
197 if(outer) return CLASS_E_NOAGGREGATION;
199 This = heap_alloc(sizeof(*This));
200 if(!This) return E_OUTOFMEMORY;
202 This->IDataSourceLocator_iface.lpVtbl = &DSLocatorVtbl;
203 This->ref = 1;
205 *obj = &This->IDataSourceLocator_iface;
207 return S_OK;