Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/oledb32/dslocator.c | 63 +++++++++++++++++++++++++++++++++++++++-
dlls/oledb32/resource.h | 16 ++++++++++
dlls/oledb32/version.rc | 26 +++++++++++++++++
3 files changed, 104 insertions(+), 1 deletion(-)
diff --git a/dlls/oledb32/dslocator.c b/dlls/oledb32/dslocator.c
index 556390fdf8..d33d637264 100644
--- a/dlls/oledb32/dslocator.c
+++ b/dlls/oledb32/dslocator.c
@@ -380,11 +380,67 @@ static LRESULT CALLBACK data_link_connection_dlg_proc(HWND hwnd, UINT msg, WPARA
return 0;
}
+static void advanced_fill_permission_list(HWND parent)
+{
+ LVITEMW item;
+ LVCOLUMNW column;
+ RECT rc;
+ int resources[] = {IDS_PERM_READ, IDS_PERM_READWRITE, IDS_PERM_SHAREDENYNONE,
+ IDS_PERM_SHAREDENYREAD, IDS_PERM_SHAREDENYWRITE, IDS_PERM_SHAREEXCLUSIVE,
+ IDS_PERM_WRITE};
+ int i;
+ WCHAR buf[256];
+ HWND lv = GetDlgItem(parent, IDC_LST_PERMISSIONS);
+ if (!lv)
+ return;
+
+ SendMessageW(lv, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_CHECKBOXES);
+ GetWindowRect(lv, &rc);
+ column.mask = LVCF_WIDTH | LVCF_FMT;
+ column.fmt = LVCFMT_FIXED_WIDTH;
+ column.cx = (rc.right - rc.left) - 25;
+ column.pszText = buf;
+ SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column);
+
+ for(i =0; i < ARRAY_SIZE(resources); i++)
+ {
+ item.mask = LVIF_TEXT;
+ item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
+ item.iSubItem = 0;
+ LoadStringW(instance, resources[i], buf, ARRAY_SIZE(buf));
+ item.pszText = buf;
+ SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item);
+ }
+}
+
+static LRESULT CALLBACK data_link_advanced_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
+{
+ TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd, msg, wp, lp);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ EnableWindow(GetDlgItem(hwnd, IDC_LBL_LEVEL), FALSE);
+ EnableWindow(GetDlgItem(hwnd, IDC_CBO_LEVEL), FALSE);
+ EnableWindow(GetDlgItem(hwnd, IDC_LBL_PROTECTION), FALSE);
+ EnableWindow(GetDlgItem(hwnd, IDC_CBO_PROTECTION), FALSE);
+
+ advanced_fill_permission_list(hwnd);
+
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
static HRESULT WINAPI dslocator_PromptNew(IDataSourceLocator *iface, IDispatch **connection)
{
DSLocatorImpl *This = impl_from_IDataSourceLocator(iface);
PROPSHEETHEADERW hdr;
- PROPSHEETPAGEW pages[2];
+ PROPSHEETPAGEW pages[3];
INT_PTR ret;
FIXME("(%p, %p) Semi-stub\n", iface, connection);
@@ -406,6 +462,11 @@ static HRESULT WINAPI dslocator_PromptNew(IDataSourceLocator *iface, IDispatch *
pages[1].u.pszTemplate = MAKEINTRESOURCEW(IDD_CONNECTION);
pages[1].pfnDlgProc = data_link_connection_dlg_proc;
+ pages[2].dwSize = sizeof(PROPSHEETPAGEW);
+ pages[2].hInstance = instance;
+ pages[2].u.pszTemplate = MAKEINTRESOURCEW(IDD_ADVANCED);
+ pages[2].pfnDlgProc = data_link_advanced_dlg_proc;
+
memset(&hdr, 0, sizeof(hdr));
hdr.dwSize = sizeof(hdr);
hdr.hwndParent = This->hwnd;
diff --git a/dlls/oledb32/resource.h b/dlls/oledb32/resource.h
index 57e7d5496a..99d3595d4a 100644
--- a/dlls/oledb32/resource.h
+++ b/dlls/oledb32/resource.h
@@ -22,6 +22,13 @@
#define IDS_PROPSHEET_TITLE 2000
#define IDS_COL_PROVIDER 2001
+#define IDS_PERM_READ 2002
+#define IDS_PERM_READWRITE 2003
+#define IDS_PERM_SHAREDENYNONE 2004
+#define IDS_PERM_SHAREDENYREAD 2005
+#define IDS_PERM_SHAREDENYWRITE 2006
+#define IDS_PERM_SHAREEXCLUSIVE 2007
+#define IDS_PERM_WRITE 2008
#define IDD_CONNECTION 3000
#define IDC_BTN_EDIT 3001
@@ -41,3 +48,12 @@
#define IDC_LBL_LOGIN 3015
#define IDC_LBL_INITIAL 3016
#define IDC_LBL_CONNECTION 3017
+
+#define IDD_ADVANCED 4000
+#define IDC_CBO_LEVEL 4001
+#define IDC_CBO_PROTECTION 4002
+#define IDC_EDT_TIMEOUT 4003
+#define IDC_LST_PERMISSIONS 4004
+#define IDC_GRP_NETWORK 4005
+#define IDC_LBL_LEVEL 4006
+#define IDC_LBL_PROTECTION 4007
diff --git a/dlls/oledb32/version.rc b/dlls/oledb32/version.rc
index 63d1d6c002..bb5266d92c 100644
--- a/dlls/oledb32/version.rc
+++ b/dlls/oledb32/version.rc
@@ -35,6 +35,14 @@ STRINGTABLE
{
IDS_PROPSHEET_TITLE "Data Link Properties"
IDS_COL_PROVIDER "OLE DB Provider(s)"
+
+ IDS_PERM_READ "Read"
+ IDS_PERM_READWRITE "ReadWrite"
+ IDS_PERM_SHAREDENYNONE "Share Deny None"
+ IDS_PERM_SHAREDENYREAD "Share Deny Read"
+ IDS_PERM_SHAREDENYWRITE "Share Deny Write"
+ IDS_PERM_SHAREEXCLUSIVE "Share Exclusive"
+ IDS_PERM_WRITE "Write"
}
IDD_PROVIDER DIALOG 0, 0, 227, 225
@@ -72,3 +80,21 @@ BEGIN
COMBOBOX IDC_CBO_INITIAL,29,170,191,64,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Test Connection",IDC_BTN_TEST,140,194,81,14,WS_GROUP
END
+
+IDD_ADVANCED DIALOG 0, 0, 227, 225
+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
+CAPTION "Advanced"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ GROUPBOX "Network settings",IDC_GRP_NETWORK,7,7,213,51
+ LTEXT "&Impersonation level:",IDC_LBL_LEVEL,14,22,66,8
+ COMBOBOX IDC_CBO_LEVEL,83,20,131,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "P&rotection level:",IDC_LBL_PROTECTION,14,39,54,8
+ COMBOBOX IDC_CBO_PROTECTION,83,37,131,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Other",-1,7,62,213,92
+ LTEXT "Connect:",-1,14,76,100,8
+ EDITTEXT IDC_EDT_TIMEOUT,83,74,48,12,ES_RIGHT | ES_NUMBER
+ LTEXT "seconds.",-1,133,75,28,8
+ LTEXT "A&ccess:",-1,14,91,100,8
+ CONTROL "List1",IDC_LST_PERMISSIONS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_NOLABELWRAP | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,83,91,131,55
+END
--
2.17.1