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
;
48 static inline DSLocatorImpl
*impl_from_IDataSourceLocator( IDataSourceLocator
*iface
)
50 return CONTAINING_RECORD(iface
, DSLocatorImpl
, IDataSourceLocator_iface
);
54 static HRESULT WINAPI
dslocator_QueryInterface(IDataSourceLocator
*iface
, REFIID riid
, void **ppvoid
)
56 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
57 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(riid
),ppvoid
);
61 if (IsEqualIID(riid
, &IID_IUnknown
) ||
62 IsEqualIID(riid
, &IID_IDispatch
) ||
63 IsEqualIID(riid
, &IID_IDataSourceLocator
))
65 *ppvoid
= &This
->IDataSourceLocator_iface
;
70 IUnknown_AddRef( (IUnknown
*)*ppvoid
);
74 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
78 static ULONG WINAPI
dslocator_AddRef(IDataSourceLocator
*iface
)
80 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
81 TRACE("(%p)->%u\n",This
,This
->ref
);
82 return InterlockedIncrement(&This
->ref
);
85 static ULONG WINAPI
dslocator_Release(IDataSourceLocator
*iface
)
87 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
88 ULONG ref
= InterlockedDecrement(&This
->ref
);
90 TRACE("(%p)->%u\n",This
,ref
+1);
100 static HRESULT WINAPI
dslocator_GetTypeInfoCount(IDataSourceLocator
*iface
, UINT
*pctinfo
)
102 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
104 FIXME("(%p)->()\n", This
);
109 static HRESULT WINAPI
dslocator_GetTypeInfo(IDataSourceLocator
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
111 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
113 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
118 static HRESULT WINAPI
dslocator_GetIDsOfNames(IDataSourceLocator
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
119 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
121 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
123 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
128 static HRESULT WINAPI
dslocator_Invoke(IDataSourceLocator
*iface
, DISPID dispIdMember
, REFIID riid
,
129 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
131 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
133 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
134 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
139 static HRESULT WINAPI
dslocator_get_hWnd(IDataSourceLocator
*iface
, COMPATIBLE_LONG
*phwndParent
)
141 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
143 TRACE("(%p)->(%p)\n",This
, phwndParent
);
145 *phwndParent
= (COMPATIBLE_LONG
)This
->hwnd
;
150 static HRESULT WINAPI
dslocator_put_hWnd(IDataSourceLocator
*iface
, COMPATIBLE_LONG hwndParent
)
152 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
154 TRACE("(%p)->(%p)\n",This
, (HWND
)hwndParent
);
156 This
->hwnd
= (HWND
)hwndParent
;
161 static HRESULT WINAPI
dslocator_PromptNew(IDataSourceLocator
*iface
, IDispatch
**ppADOConnection
)
163 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
165 FIXME("(%p)->(%p)\n",This
, ppADOConnection
);
170 static HRESULT WINAPI
dslocator_PromptEdit(IDataSourceLocator
*iface
, IDispatch
**ppADOConnection
, VARIANT_BOOL
*success
)
172 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
174 FIXME("(%p)->(%p %p)\n",This
, ppADOConnection
, success
);
179 static const IDataSourceLocatorVtbl DSLocatorVtbl
=
181 dslocator_QueryInterface
,
184 dslocator_GetTypeInfoCount
,
185 dslocator_GetTypeInfo
,
186 dslocator_GetIDsOfNames
,
194 HRESULT
create_dslocator(IUnknown
*outer
, void **obj
)
198 TRACE("(%p, %p)\n", outer
, obj
);
202 if(outer
) return CLASS_E_NOAGGREGATION
;
204 This
= heap_alloc(sizeof(*This
));
205 if(!This
) return E_OUTOFMEMORY
;
207 This
->IDataSourceLocator_iface
.lpVtbl
= &DSLocatorVtbl
;
211 *obj
= &This
->IDataSourceLocator_iface
;