Module: wine Branch: master Commit: 8f7e9eee937435fa3f606670dadf1f4853a81bc2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f7e9eee937435fa3f606670da...
Author: Juan Lang juan.lang@gmail.com Date: Sat Dec 20 12:43:13 2008 -0800
cryptui: Make sure a store is selected when the user click OK in the select store dialog.
---
dlls/cryptui/cryptui_En.rc | 2 ++ dlls/cryptui/cryptuires.h | 2 ++ dlls/cryptui/main.c | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index a101ad2..7ad889e 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -61,6 +61,8 @@ STRINGTABLE DISCARDABLE IDS_CERTIFICATE_PROPERTIES "Certificate Properties" IDS_CERTIFICATE_PURPOSE_ERROR "Please enter an OID in the form 1.2.3.4" IDS_CERTIFICATE_PURPOSE_EXISTS "The OID you entered already exists." + IDS_SELECT_STORE_TITLE "Select Certificate Store" + IDS_SELECT_STORE "Please select a certificate store." IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer" IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer" IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication" diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h index 0376511..25dcb8a 100644 --- a/dlls/cryptui/cryptuires.h +++ b/dlls/cryptui/cryptuires.h @@ -58,6 +58,8 @@ #define IDS_CERTIFICATE_PROPERTIES 1038 #define IDS_CERTIFICATE_PURPOSE_ERROR 1039 #define IDS_CERTIFICATE_PURPOSE_EXISTS 1040 +#define IDS_SELECT_STORE_TITLE 1041 +#define IDS_SELECT_STORE 1042
#define IDS_PURPOSE_SERVER_AUTH 1100 #define IDS_PURPOSE_CLIENT_AUTH 1101 diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index dc29842..8970c7d 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -248,6 +248,8 @@ static void free_store_info(HWND tree) } }
+#define MAX_STRING_LEN 512 + static LRESULT CALLBACK select_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { @@ -274,10 +276,38 @@ static LRESULT CALLBACK select_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, switch (wp) { case IDOK: - free_store_info(GetDlgItem(hwnd, IDC_STORE_LIST)); - EndDialog(hwnd, IDOK); + { + HWND tree = GetDlgItem(hwnd, IDC_STORE_LIST); + HTREEITEM selection = (HTREEITEM)SendMessageW(tree, + TVM_GETNEXTITEM, TVGN_CARET, (LPARAM)NULL); + + info = (PCRYPTUI_SELECTSTORE_INFO_W)GetWindowLongPtrW(hwnd, + DWLP_USER); + if (!selection) + { + WCHAR title[MAX_STRING_LEN], error[MAX_STRING_LEN], *pTitle; + + if (info->pwszTitle) + pTitle = info->pwszTitle; + else + { + LoadStringW(hInstance, IDS_SELECT_STORE_TITLE, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, IDS_SELECT_STORE, error, + sizeof(error) / sizeof(error[0])); + MessageBoxW(hwnd, error, pTitle, MB_ICONEXCLAMATION | MB_OK); + } + else + { + /* FIXME: convert selection to store and return it */ + free_store_info(tree); + EndDialog(hwnd, IDOK); + } ret = TRUE; break; + } case IDCANCEL: free_store_info(GetDlgItem(hwnd, IDC_STORE_LIST)); EndDialog(hwnd, IDCANCEL); @@ -580,8 +610,6 @@ static void add_oid_text_to_control(HWND hwnd, char *oid) } }
-#define MAX_STRING_LEN 512 - struct OIDToString { LPCSTR oid;