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
23 #define NONAMELESSUNION
36 #include "oledb_private.h"
39 #include "wine/debug.h"
40 #include "wine/heap.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(oledb
);
47 IDBProperties
*provider
;
48 DBPROPINFOSET
*propinfoset
;
52 static struct datasource
*create_datasource(WCHAR
*guid
)
54 struct datasource
*data
= heap_alloc_zero(sizeof(struct datasource
));
57 CLSIDFromString(guid
, &data
->clsid
);
63 static void destroy_datasource(struct datasource
*data
)
65 if (data
->propinfoset
)
69 for (i
= 0; i
< data
->propinfoset
->cPropertyInfos
; i
++)
70 VariantClear(&data
->propinfoset
->rgPropertyInfos
[i
].vValues
);
72 CoTaskMemFree(data
->propinfoset
->rgPropertyInfos
);
73 CoTaskMemFree(data
->propinfoset
);
75 if (data
->description
)
76 CoTaskMemFree(data
->description
);
79 IDBProperties_Release(data
->provider
);
84 static BOOL
initialize_datasource(struct datasource
*data
)
87 DBPROPIDSET propidset
;
90 hr
= CoCreateInstance(&data
->clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IDBProperties
, (void**)&data
->provider
);
93 WARN("Datasource cannot be created (0x%08x)\n", hr
);
97 propidset
.rgPropertyIDs
= NULL
;
98 propidset
.cPropertyIDs
= 0;
99 propidset
.guidPropertySet
= DBPROPSET_DBINITALL
;
101 hr
= IDBProperties_GetPropertyInfo(data
->provider
, 1, &propidset
, &infocount
, &data
->propinfoset
, &data
->description
);
104 WARN("Failed to get DB Properties (0x%08x)\n", hr
);
106 IDBProperties_Release(data
->provider
);
107 data
->provider
= NULL
;
114 typedef struct DSLocatorImpl
116 IDataSourceLocator IDataSourceLocator_iface
;
117 IDataInitialize IDataInitialize_iface
;
123 static inline DSLocatorImpl
*impl_from_IDataSourceLocator( IDataSourceLocator
*iface
)
125 return CONTAINING_RECORD(iface
, DSLocatorImpl
, IDataSourceLocator_iface
);
128 static inline DSLocatorImpl
*impl_from_IDataInitialize(IDataInitialize
*iface
)
130 return CONTAINING_RECORD(iface
, DSLocatorImpl
, IDataInitialize_iface
);
133 static HRESULT WINAPI
dslocator_QueryInterface(IDataSourceLocator
*iface
, REFIID riid
, void **ppvoid
)
135 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
136 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(riid
),ppvoid
);
140 if (IsEqualIID(riid
, &IID_IUnknown
) ||
141 IsEqualIID(riid
, &IID_IDispatch
) ||
142 IsEqualIID(riid
, &IID_IDataSourceLocator
))
144 *ppvoid
= &This
->IDataSourceLocator_iface
;
146 else if (IsEqualIID(riid
, &IID_IDataInitialize
))
148 *ppvoid
= &This
->IDataInitialize_iface
;
150 else if (IsEqualIID(riid
, &IID_IRunnableObject
))
152 TRACE("IID_IRunnableObject returning NULL\n");
153 return E_NOINTERFACE
;
155 else if (IsEqualIID(riid
, &IID_IProvideClassInfo
))
157 TRACE("IID_IProvideClassInfo returning NULL\n");
158 return E_NOINTERFACE
;
160 else if (IsEqualIID(riid
, &IID_IMarshal
))
162 TRACE("IID_IMarshal returning NULL\n");
163 return E_NOINTERFACE
;
165 else if (IsEqualIID(riid
, &IID_IRpcOptions
))
167 TRACE("IID_IRpcOptions returning NULL\n");
168 return E_NOINTERFACE
;
173 IUnknown_AddRef( (IUnknown
*)*ppvoid
);
177 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
178 return E_NOINTERFACE
;
181 static ULONG WINAPI
dslocator_AddRef(IDataSourceLocator
*iface
)
183 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
184 TRACE("(%p)->%u\n",This
,This
->ref
);
185 return InterlockedIncrement(&This
->ref
);
188 static ULONG WINAPI
dslocator_Release(IDataSourceLocator
*iface
)
190 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
191 ULONG ref
= InterlockedDecrement(&This
->ref
);
193 TRACE("(%p)->%u\n",This
,ref
+1);
203 static HRESULT WINAPI
dslocator_GetTypeInfoCount(IDataSourceLocator
*iface
, UINT
*pctinfo
)
205 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
207 FIXME("(%p)->()\n", This
);
212 static HRESULT WINAPI
dslocator_GetTypeInfo(IDataSourceLocator
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
214 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
216 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
221 static HRESULT WINAPI
dslocator_GetIDsOfNames(IDataSourceLocator
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
222 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
224 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
226 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
231 static HRESULT WINAPI
dslocator_Invoke(IDataSourceLocator
*iface
, DISPID dispIdMember
, REFIID riid
,
232 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
234 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
236 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
237 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
242 static HRESULT WINAPI
dslocator_get_hWnd(IDataSourceLocator
*iface
, COMPATIBLE_LONG
*phwndParent
)
244 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
246 TRACE("(%p)->(%p)\n",This
, phwndParent
);
248 *phwndParent
= (COMPATIBLE_LONG
)This
->hwnd
;
253 static HRESULT WINAPI
dslocator_put_hWnd(IDataSourceLocator
*iface
, COMPATIBLE_LONG hwndParent
)
255 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
257 TRACE("(%p)->(%p)\n",This
, (HWND
)hwndParent
);
259 This
->hwnd
= (HWND
)hwndParent
;
264 static void create_connections_columns(HWND lv
)
270 SendMessageW(lv
, LVM_SETEXTENDEDLISTVIEWSTYLE
, 0, LVS_EX_FULLROWSELECT
);
271 GetWindowRect(lv
, &rc
);
272 LoadStringW(instance
, IDS_COL_PROVIDER
, buf
, ARRAY_SIZE(buf
));
273 column
.mask
= LVCF_WIDTH
| LVCF_TEXT
;
274 column
.cx
= (rc
.right
- rc
.left
) - 5;
275 column
.pszText
= buf
;
276 SendMessageW(lv
, LVM_INSERTCOLUMNW
, 0, (LPARAM
)&column
);
279 static void add_connections_providers(HWND lv
)
281 static const WCHAR oledbprov
[] = {'\\','O','L','E',' ','D','B',' ','P','r','o','v','i','d','e','r',0};
283 HKEY key
= NULL
, subkey
;
286 WCHAR provider
[MAX_PATH
];
287 WCHAR guidkey
[MAX_PATH
];
290 res
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, L
"CLSID", 0, KEY_READ
, &key
);
291 if (res
== ERROR_FILE_NOT_FOUND
)
294 next_key
= RegEnumKeyW(key
, index
, provider
, MAX_PATH
);
295 while (next_key
== ERROR_SUCCESS
)
297 WCHAR description
[MAX_PATH
];
299 lstrcpyW(guidkey
, provider
);
300 lstrcatW(guidkey
, oledbprov
);
302 res
= RegOpenKeyW(key
, guidkey
, &subkey
);
303 if (res
== ERROR_SUCCESS
)
305 TRACE("Found %s\n", debugstr_w(guidkey
));
308 res
= RegQueryValueW(subkey
, NULL
, description
, &size
);
309 if (res
== ERROR_SUCCESS
)
312 struct datasource
*data
;
314 data
= create_datasource(guidkey
);
316 item
.mask
= LVIF_TEXT
| LVIF_PARAM
;
317 item
.iItem
= SendMessageW(lv
, LVM_GETITEMCOUNT
, 0, 0);
319 item
.pszText
= description
;
320 item
.lParam
= (LPARAM
)data
;
322 SendMessageW(lv
, LVM_INSERTITEMW
, 0, (LPARAM
)&item
);
328 next_key
= RegEnumKeyW(key
, index
, provider
, MAX_PATH
);
334 static LRESULT CALLBACK
data_link_properties_dlg_proc(HWND hwnd
, UINT msg
, WPARAM wp
, LPARAM lp
)
336 TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd
, msg
, wp
, lp
);
342 HWND btn
, lv
= GetDlgItem(hwnd
, IDC_LST_CONNECTIONS
);
343 create_connections_columns(lv
);
344 add_connections_providers(lv
);
346 btn
= GetDlgItem(GetParent(hwnd
), IDOK
);
347 EnableWindow(btn
, FALSE
);
353 HWND lv
= GetDlgItem(hwnd
, IDC_LST_CONNECTIONS
);
358 item
.mask
= LVIF_PARAM
;
360 while(ListView_GetItemA(lv
, &item
))
362 destroy_datasource( (struct datasource
*)item
.lParam
);
369 NMHDR
*hdr
= ((LPNMHDR
)lp
);
376 * FIXME: This needs to replace the connection page based off the selection.
377 * We only care about the ODBC for now which is the default.
380 HWND lv
= GetDlgItem(hwnd
, IDC_LST_CONNECTIONS
);
381 if (!SendMessageW(lv
, LVM_GETSELECTEDCOUNT
, 0, 0))
383 WCHAR title
[256], msg
[256];
385 LoadStringW(instance
, IDS_PROVIDER_TITLE
, title
, ARRAY_SIZE(title
));
386 LoadStringW(instance
, IDS_PROVIDER_ERROR
, msg
, ARRAY_SIZE(msg
));
387 MessageBoxW(hwnd
, msg
, title
, MB_OK
| MB_ICONEXCLAMATION
);
388 SetWindowLongPtrW(hwnd
, DWLP_MSGRESULT
, TRUE
);
394 item
.stateMask
= LVIS_SELECTED
;
395 item
.mask
= LVIF_PARAM
| LVIF_STATE
;
397 if(ListView_GetItemA(lv
, &item
))
399 if(!initialize_datasource( (struct datasource
*)item
.lParam
))
401 WCHAR title
[256], msg
[256];
402 LoadStringW(instance
, IDS_PROVIDER_TITLE
, title
, ARRAY_SIZE(title
));
403 LoadStringW(instance
, IDS_PROVIDER_NOT_AVAIL
, msg
, ARRAY_SIZE(msg
));
404 MessageBoxW(hwnd
, msg
, title
, MB_OK
| MB_ICONEXCLAMATION
);
405 SetWindowLongPtrW(hwnd
, DWLP_MSGRESULT
, TRUE
);
410 ERR("Failed to get selected item\n");
420 if (LOWORD(wp
) == IDC_BTN_NEXT
)
421 SendMessageW(GetParent(hwnd
), PSM_SETCURSEL
, 1, 0);
430 static void connection_fill_odbc_list(HWND parent
)
435 WCHAR name
[MAX_PATH
];
438 HWND combo
= GetDlgItem(parent
, IDC_CBO_NAMES
);
442 res
= RegOpenKeyExW(HKEY_CURRENT_USER
, L
"Software\\ODBC\\ODBC.INI\\ODBC Data Sources", 0, KEY_READ
, &key
);
443 if (res
== ERROR_FILE_NOT_FOUND
)
446 SendMessageW (combo
, CB_RESETCONTENT
, 0, 0);
451 if (RegEnumValueW(key
, index
, name
, &nameLen
, NULL
, NULL
, NULL
, NULL
) != ERROR_SUCCESS
)
454 SendMessageW(combo
, CB_ADDSTRING
, 0, (LPARAM
)name
);
460 static void connection_initialize_controls(HWND parent
)
462 HWND hwnd
= GetDlgItem(parent
, IDC_RDO_SRC_NAME
);
464 SendMessageA(hwnd
, BM_SETCHECK
, BST_CHECKED
, 0);
467 static void connection_toggle_controls(HWND parent
)
470 HWND hwnd
= GetDlgItem(parent
, IDC_RDO_SRC_NAME
);
472 checked
= SendMessageA(hwnd
, BM_GETCHECK
, 0, 0);
474 EnableWindow(GetDlgItem(parent
, IDC_CBO_NAMES
), checked
);
475 EnableWindow(GetDlgItem(parent
, IDC_BTN_REFRESH
), checked
);
477 EnableWindow(GetDlgItem(parent
, IDC_LBL_CONNECTION
), !checked
);
478 EnableWindow(GetDlgItem(parent
, IDC_EDT_CONNECTION
), !checked
);
479 EnableWindow(GetDlgItem(parent
, IDC_BTN_BUILD
), !checked
);
482 static LRESULT CALLBACK
data_link_connection_dlg_proc(HWND hwnd
, UINT msg
, WPARAM wp
, LPARAM lp
)
484 TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd
, msg
, wp
, lp
);
490 connection_initialize_controls(hwnd
);
491 connection_fill_odbc_list(hwnd
);
492 connection_toggle_controls(hwnd
);
499 case IDC_RDO_SRC_NAME
:
500 case IDC_BTN_CONNECTION
:
501 connection_toggle_controls(hwnd
);
503 case IDC_BTN_REFRESH
:
504 connection_fill_odbc_list(hwnd
);
508 /* TODO: Implement dialogs */
509 MessageBoxA(hwnd
, "Not implemented yet.", "Error", MB_OK
| MB_ICONEXCLAMATION
);
521 static void advanced_fill_permission_list(HWND parent
)
526 int resources
[] = {IDS_PERM_READ
, IDS_PERM_READWRITE
, IDS_PERM_SHAREDENYNONE
,
527 IDS_PERM_SHAREDENYREAD
, IDS_PERM_SHAREDENYWRITE
, IDS_PERM_SHAREEXCLUSIVE
,
531 HWND lv
= GetDlgItem(parent
, IDC_LST_PERMISSIONS
);
535 SendMessageW(lv
, LVM_SETEXTENDEDLISTVIEWSTYLE
, 0, LVS_EX_CHECKBOXES
);
536 GetWindowRect(lv
, &rc
);
537 column
.mask
= LVCF_WIDTH
| LVCF_FMT
;
538 column
.fmt
= LVCFMT_FIXED_WIDTH
;
539 column
.cx
= (rc
.right
- rc
.left
) - 25;
540 column
.pszText
= buf
;
541 SendMessageW(lv
, LVM_INSERTCOLUMNW
, 0, (LPARAM
)&column
);
543 for(i
=0; i
< ARRAY_SIZE(resources
); i
++)
545 item
.mask
= LVIF_TEXT
;
546 item
.iItem
= SendMessageW(lv
, LVM_GETITEMCOUNT
, 0, 0);
548 LoadStringW(instance
, resources
[i
], buf
, ARRAY_SIZE(buf
));
550 SendMessageW(lv
, LVM_INSERTITEMW
, 0, (LPARAM
)&item
);
554 static LRESULT CALLBACK
data_link_advanced_dlg_proc(HWND hwnd
, UINT msg
, WPARAM wp
, LPARAM lp
)
556 TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd
, msg
, wp
, lp
);
562 EnableWindow(GetDlgItem(hwnd
, IDC_LBL_LEVEL
), FALSE
);
563 EnableWindow(GetDlgItem(hwnd
, IDC_CBO_LEVEL
), FALSE
);
564 EnableWindow(GetDlgItem(hwnd
, IDC_LBL_PROTECTION
), FALSE
);
565 EnableWindow(GetDlgItem(hwnd
, IDC_CBO_PROTECTION
), FALSE
);
567 advanced_fill_permission_list(hwnd
);
577 static void create_page_all_columns(HWND lv
)
583 SendMessageW(lv
, LVM_SETEXTENDEDLISTVIEWSTYLE
, 0, LVS_EX_FULLROWSELECT
);
584 GetWindowRect(lv
, &rc
);
585 LoadStringW(instance
, IDS_COL_NAME
, buf
, ARRAY_SIZE(buf
));
586 column
.mask
= LVCF_WIDTH
| LVCF_TEXT
;
587 column
.cx
= (rc
.right
/ 2);
588 column
.pszText
= buf
;
589 SendMessageW(lv
, LVM_INSERTCOLUMNW
, 0, (LPARAM
)&column
);
591 LoadStringW(instance
, IDS_COL_VALUE
, buf
, ARRAY_SIZE(buf
));
592 column
.mask
= LVCF_WIDTH
| LVCF_TEXT
;
593 column
.cx
= (rc
.right
/ 2);
594 column
.pszText
= buf
;
595 SendMessageW(lv
, LVM_INSERTCOLUMNW
, 0, (LPARAM
)&column
);
598 static LRESULT CALLBACK
data_link_all_dlg_proc(HWND hwnd
, UINT msg
, WPARAM wp
, LPARAM lp
)
600 TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd
, msg
, wp
, lp
);
606 HWND lv
= GetDlgItem(hwnd
, IDC_LST_PROPERTIES
);
607 create_page_all_columns(lv
);
612 if (LOWORD(wp
) == IDC_BTN_EDIT
)
614 /* TODO: Implement Connection dialog */
615 MessageBoxA(hwnd
, "Not implemented yet.", "Error", MB_OK
| MB_ICONEXCLAMATION
);
623 static HRESULT WINAPI
dslocator_PromptNew(IDataSourceLocator
*iface
, IDispatch
**connection
)
625 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
626 PROPSHEETHEADERW hdr
;
627 PROPSHEETPAGEW pages
[4];
630 FIXME("(%p, %p) Semi-stub\n", iface
, connection
);
637 memset(&pages
, 0, sizeof(pages
));
639 pages
[0].dwSize
= sizeof(PROPSHEETPAGEW
);
640 pages
[0].hInstance
= instance
;
641 pages
[0].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_PROVIDER
);
642 pages
[0].pfnDlgProc
= data_link_properties_dlg_proc
;
644 pages
[1].dwSize
= sizeof(PROPSHEETPAGEW
);
645 pages
[1].hInstance
= instance
;
646 pages
[1].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_CONNECTION
);
647 pages
[1].pfnDlgProc
= data_link_connection_dlg_proc
;
649 pages
[2].dwSize
= sizeof(PROPSHEETPAGEW
);
650 pages
[2].hInstance
= instance
;
651 pages
[2].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_ADVANCED
);
652 pages
[2].pfnDlgProc
= data_link_advanced_dlg_proc
;
654 pages
[3].dwSize
= sizeof(pages
[0]);
655 pages
[3].hInstance
= instance
;
656 pages
[3].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_ALL
);
657 pages
[3].pfnDlgProc
= data_link_all_dlg_proc
;
659 memset(&hdr
, 0, sizeof(hdr
));
660 hdr
.dwSize
= sizeof(hdr
);
661 hdr
.hwndParent
= This
->hwnd
;
662 hdr
.dwFlags
= PSH_NOAPPLYNOW
| PSH_PROPSHEETPAGE
;
663 hdr
.hInstance
= instance
;
664 hdr
.pszCaption
= MAKEINTRESOURCEW(IDS_PROPSHEET_TITLE
);
666 hdr
.nPages
= ARRAY_SIZE(pages
);
667 ret
= PropertySheetW(&hdr
);
669 return ret
? S_OK
: S_FALSE
;
672 static HRESULT WINAPI
dslocator_PromptEdit(IDataSourceLocator
*iface
, IDispatch
**ppADOConnection
, VARIANT_BOOL
*success
)
674 DSLocatorImpl
*This
= impl_from_IDataSourceLocator(iface
);
676 FIXME("(%p)->(%p %p)\n",This
, ppADOConnection
, success
);
681 static const IDataSourceLocatorVtbl DSLocatorVtbl
=
683 dslocator_QueryInterface
,
686 dslocator_GetTypeInfoCount
,
687 dslocator_GetTypeInfo
,
688 dslocator_GetIDsOfNames
,
696 static HRESULT WINAPI
datainitialize_QueryInterface(IDataInitialize
*iface
, REFIID riid
, void **obj
)
698 DSLocatorImpl
*This
= impl_from_IDataInitialize(iface
);
699 return IDataSourceLocator_QueryInterface(&This
->IDataSourceLocator_iface
, riid
, obj
);
702 static ULONG WINAPI
datainitialize_AddRef(IDataInitialize
*iface
)
704 DSLocatorImpl
*This
= impl_from_IDataInitialize(iface
);
705 return IDataSourceLocator_AddRef(&This
->IDataSourceLocator_iface
);
708 static ULONG WINAPI
datainitialize_Release(IDataInitialize
*iface
)
710 DSLocatorImpl
*This
= impl_from_IDataInitialize(iface
);
711 return IDataSourceLocator_Release(&This
->IDataSourceLocator_iface
);
714 static HRESULT WINAPI
datainitialize_GetDataSource(IDataInitialize
*iface
,
715 IUnknown
*outer
, DWORD context
, LPWSTR initstring
, REFIID riid
, IUnknown
**datasource
)
717 TRACE("(%p)->(%p %#x %s %s %p)\n", iface
, outer
, context
, debugstr_w(initstring
), debugstr_guid(riid
),
720 return get_data_source(outer
, context
, initstring
, riid
, datasource
);
723 static HRESULT WINAPI
datainitialize_GetInitializationString(IDataInitialize
*iface
, IUnknown
*datasource
,
724 boolean include_password
, LPWSTR
*initstring
)
726 FIXME("(%p)->(%d %p): stub\n", iface
, include_password
, initstring
);
730 static HRESULT WINAPI
datainitialize_CreateDBInstance(IDataInitialize
*iface
, REFCLSID prov
, IUnknown
*outer
,
731 DWORD clsctx
, LPWSTR reserved
, REFIID riid
, IUnknown
**datasource
)
733 FIXME("(%p)->(%s %p %#x %p %s %p): stub\n", iface
, debugstr_guid(prov
), outer
, clsctx
, reserved
,
734 debugstr_guid(riid
), datasource
);
738 static HRESULT WINAPI
datainitialize_CreateDBInstanceEx(IDataInitialize
*iface
, REFCLSID prov
, IUnknown
*outer
,
739 DWORD clsctx
, LPWSTR reserved
, COSERVERINFO
*server_info
, DWORD cmq
, MULTI_QI
*results
)
741 FIXME("(%p)->(%s %p %#x %p %p %u %p): stub\n", iface
, debugstr_guid(prov
), outer
, clsctx
, reserved
,
742 server_info
, cmq
, results
);
746 static HRESULT WINAPI
datainitialize_LoadStringFromStorage(IDataInitialize
*iface
, LPWSTR filename
, LPWSTR
*initstring
)
748 FIXME("(%p)->(%s %p): stub\n", iface
, debugstr_w(filename
), initstring
);
752 static HRESULT WINAPI
datainitialize_WriteStringToStorage(IDataInitialize
*iface
, LPWSTR filename
, LPWSTR initstring
,
755 FIXME("(%p)->(%s %s %#x): stub\n", iface
, debugstr_w(filename
), debugstr_w(initstring
), disposition
);
759 static const IDataInitializeVtbl ds_datainitialize_vtbl
=
761 datainitialize_QueryInterface
,
762 datainitialize_AddRef
,
763 datainitialize_Release
,
764 datainitialize_GetDataSource
,
765 datainitialize_GetInitializationString
,
766 datainitialize_CreateDBInstance
,
767 datainitialize_CreateDBInstanceEx
,
768 datainitialize_LoadStringFromStorage
,
769 datainitialize_WriteStringToStorage
,
772 HRESULT
create_dslocator(IUnknown
*outer
, void **obj
)
776 TRACE("(%p, %p)\n", outer
, obj
);
780 if(outer
) return CLASS_E_NOAGGREGATION
;
782 This
= heap_alloc(sizeof(*This
));
783 if(!This
) return E_OUTOFMEMORY
;
785 This
->IDataSourceLocator_iface
.lpVtbl
= &DSLocatorVtbl
;
786 This
->IDataInitialize_iface
.lpVtbl
= &ds_datainitialize_vtbl
;
790 *obj
= &This
->IDataSourceLocator_iface
;