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
33 #include "oledb_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(oledb
);
40 typedef struct DSLocatorImpl
42 IDataSourceLocator IDataSourceLocator_iface
;
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
);
60 if (IsEqualIID(riid
, &IID_IUnknown
) ||
61 IsEqualIID(riid
, &IID_IDispatch
) ||
62 IsEqualIID(riid
, &IID_IDataSourceLocator
))
64 *ppvoid
= &This
->IDataSourceLocator_iface
;
69 IUnknown_AddRef( (IUnknown
*)*ppvoid
);
73 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
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);
99 static HRESULT WINAPI
dslocator_GetTypeInfoCount(IDataSourceLocator
*iface
, UINT
*pctinfo
)
101 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
103 FIXME("(%p)->()\n", This
);
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
);
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
);
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
);
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
);
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
);
156 static HRESULT WINAPI
dslocator_PromptNew(IDataSourceLocator
*iface
, IDispatch
**ppADOConnection
)
158 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
160 FIXME("(%p)->(%p)\n",This
, ppADOConnection
);
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
);
174 static const IDataSourceLocatorVtbl DSLocatorVtbl
=
176 dslocator_QueryInterface
,
179 dslocator_GetTypeInfoCount
,
180 dslocator_GetTypeInfo
,
181 dslocator_GetIDsOfNames
,
189 HRESULT
create_dslocator(IUnknown
*outer
, void **obj
)
193 TRACE("(%p, %p)\n", outer
, obj
);
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
;
205 *obj
= &This
->IDataSourceLocator_iface
;