From 5d92e2d20f8863fc730e3c1f863d6d4a7d747238 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 23 Jan 2009 11:41:41 -0800 Subject: [PATCH] cryptui: Show details of export on finish page of export wizard. --- dlls/cryptui/cryptui_En.rc | 5 +++ dlls/cryptui/cryptuires.h | 5 +++ dlls/cryptui/main.c | 88 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index 91164b65273..02dc5144bb8 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -153,6 +153,11 @@ STRINGTABLE DISCARDABLE IDS_EXPORT_FILTER_CTL "Certificate Trust List (*.stl)" IDS_EXPORT_FILTER_CMS "CMS/PKCS #7 Messages (*.p7b)" IDS_EXPORT_FILTER_PFX "Personal Information Exchange (*.pfx)" + IDS_EXPORT_FORMAT "File Format" + IDS_EXPORT_INCLUDE_CHAIN "Include all certificates in certificate path" + IDS_EXPORT_KEYS "Export keys" + IDS_YES "Yes" + IDS_NO "No" } IDD_GENERAL DIALOG DISCARDABLE 0, 0, 255, 236 diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h index 7384314f97a..bf99375abde 100644 --- a/dlls/cryptui/cryptuires.h +++ b/dlls/cryptui/cryptuires.h @@ -152,6 +152,11 @@ #define IDS_EXPORT_FILTER_CTL 1209 #define IDS_EXPORT_FILTER_CMS 1210 #define IDS_EXPORT_FILTER_PFX 1211 +#define IDS_EXPORT_FORMAT 1212 +#define IDS_EXPORT_INCLUDE_CHAIN 1213 +#define IDS_EXPORT_KEYS 1214 +#define IDS_YES 1215 +#define IDS_NO 1216 #define IDD_GENERAL 100 #define IDD_DETAIL 101 diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index f7b93041804..aaf69604c54 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -5905,6 +5905,92 @@ static LRESULT CALLBACK export_file_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, return ret; } +static void show_export_details(HWND lv, struct ExportWizData *data) +{ + WCHAR text[MAX_STRING_LEN]; + LVITEMW item; + int contentID; + + item.mask = LVIF_TEXT; + if (data->fileName) + { + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_IMPORT_FILE, text, + sizeof(text)/ sizeof(text[0])); + item.pszText = text; + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + item.iSubItem = 1; + item.pszText = data->fileName; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + } + + item.pszText = text; + switch (data->pExportInfo->dwSubjectChoice) + { + case CRYPTUI_WIZ_EXPORT_CRL_CONTEXT: + case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT: + /* do nothing */ + break; + default: + { + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_EXPORT_INCLUDE_CHAIN, text, + sizeof(text) / sizeof(text[0])); + SendMessageW(lv, LVM_INSERTITEMW, item.iItem, (LPARAM)&item); + item.iSubItem = 1; + LoadStringW(hInstance, data->includeChain ? IDS_YES : IDS_NO, text, + sizeof(text) / sizeof(text[0])); + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_EXPORT_KEYS, text, + sizeof(text) / sizeof(text[0])); + SendMessageW(lv, LVM_INSERTITEMW, item.iItem, (LPARAM)&item); + item.iSubItem = 1; + LoadStringW(hInstance, data->deletePrivateKey ? IDS_YES : IDS_NO, text, + sizeof(text) / sizeof(text[0])); + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + } + } + + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_EXPORT_FORMAT, text, + sizeof(text)/ sizeof(text[0])); + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + + item.iSubItem = 1; + switch (data->pExportInfo->dwSubjectChoice) + { + case CRYPTUI_WIZ_EXPORT_CRL_CONTEXT: + contentID = IDS_EXPORT_FILTER_CRL; + break; + case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT: + contentID = IDS_EXPORT_FILTER_CTL; + break; + default: + switch (data->exportFormat) + { + case CRYPTUI_WIZ_EXPORT_FORMAT_BASE64: + contentID = IDS_EXPORT_FILTER_BASE64_CERT; + break; + case CRYPTUI_WIZ_EXPORT_FORMAT_PKCS7: + contentID = IDS_EXPORT_FILTER_CMS; + break; + case CRYPTUI_WIZ_EXPORT_FORMAT_PFX: + contentID = IDS_EXPORT_FILTER_PFX; + break; + default: + contentID = IDS_EXPORT_FILTER_CERT; + } + } + LoadStringW(hInstance, contentID, text, sizeof(text) / sizeof(text[0])); + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); +} + static LRESULT CALLBACK export_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { @@ -5929,6 +6015,7 @@ static LRESULT CALLBACK export_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, column.cx = (rc.right - rc.left) / 2 - 2; SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, 1, (LPARAM)&column); + show_export_details(lv, data); break; } case WM_NOTIFY: @@ -5943,6 +6030,7 @@ static LRESULT CALLBACK export_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, data = (struct ExportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); SendMessageW(lv, LVM_DELETEALLITEMS, 0, 0); + show_export_details(lv, data); PostMessageW(GetParent(hwnd), PSM_SETWIZBUTTONS, 0, PSWIZB_BACK | PSWIZB_FINISH); ret = TRUE;