Juan Lang : cryptui: Move code for enabling the PFX export format to the correct dialog proc.

Alexandre Julliard julliard at winehq.org
Tue Jan 27 09:06:54 CST 2009


Module: wine
Branch: master
Commit: b2fefc0ffd4c8b6c9f64c4aee8a07e2403e1a455
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b2fefc0ffd4c8b6c9f64c4aee8a07e2403e1a455

Author: Juan Lang <juan.lang at gmail.com>
Date:   Sat Jan 24 14:13:44 2009 -0800

cryptui: Move code for enabling the PFX export format to the correct dialog proc.

---

 dlls/cryptui/main.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index d2c438e..50b5cb5 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -5557,9 +5557,13 @@ static LRESULT CALLBACK export_format_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
     {
         PROPSHEETPAGEW *page = (PROPSHEETPAGEW *)lp;
         int defaultFormatID;
+        BOOL hasPrivateKey;
 
         data = (struct ExportWizData *)page->lParam;
         SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data);
+        hasPrivateKey = export_info_has_private_key(data->pExportInfo);
+        if (hasPrivateKey)
+            EnableWindow(GetDlgItem(hwnd, IDC_EXPORT_FORMAT_PFX), TRUE);
         switch (data->contextInfo.dwExportFormat)
         {
         case CRYPTUI_WIZ_EXPORT_FORMAT_BASE64:
@@ -5569,7 +5573,7 @@ static LRESULT CALLBACK export_format_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
             defaultFormatID = IDC_EXPORT_FORMAT_CMS;
             break;
         case CRYPTUI_WIZ_EXPORT_FORMAT_PFX:
-            if (export_info_has_private_key(data->pExportInfo))
+            if (hasPrivateKey)
                 defaultFormatID = IDC_EXPORT_FORMAT_PFX;
             else
                 defaultFormatID = IDC_EXPORT_FORMAT_DER;
@@ -5882,8 +5886,6 @@ static LRESULT CALLBACK export_file_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
 
         data = (struct ExportWizData *)page->lParam;
         SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data);
-        if (export_info_has_private_key(data->pExportInfo))
-            EnableWindow(GetDlgItem(hwnd, IDC_EXPORT_FORMAT_PFX), TRUE);
         break;
     }
     case WM_NOTIFY:




More information about the wine-cvs mailing list