Juan Lang : cryptui: Show selected certificate when requested in the certificate manager dialog .

Alexandre Julliard julliard at winehq.org
Fri Jan 9 09:52:32 CST 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Jan  7 17:45:58 2009 -0800

cryptui: Show selected certificate when requested in the certificate manager dialog.

---

 dlls/cryptui/main.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index 00f87ca..6955f0c 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -779,6 +779,27 @@ static void cert_mgr_clear_cert_selection(HWND hwnd)
     refresh_store_certs(hwnd);
 }
 
+static void show_selected_cert(HWND hwnd, int index)
+{
+    LVITEMW item;
+    HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS);
+
+    item.mask = LVIF_PARAM;
+    item.iItem = index;
+    item.iSubItem = 0;
+    if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item))
+    {
+        CRYPTUI_VIEWCERTIFICATE_STRUCTW viewInfo;
+
+        memset(&viewInfo, 0, sizeof(viewInfo));
+        viewInfo.dwSize = sizeof(viewInfo);
+        viewInfo.hwndParent = hwnd;
+        viewInfo.pCertContext = (PCCERT_CONTEXT)item.lParam;
+        /* FIXME: this should be modal */
+        CryptUIDlgViewCertificateW(&viewInfo, NULL);
+    }
+}
+
 static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
  LPARAM lp)
 {
@@ -839,6 +860,9 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
             }
             break;
         }
+        case NM_DBLCLK:
+            show_selected_cert(hwnd, ((NMITEMACTIVATE *)lp)->iItem);
+            break;
         }
         break;
     }
@@ -877,6 +901,16 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
                 refresh_store_certs(hwnd);
             }
             break;
+        case IDC_MGR_VIEW:
+        {
+            HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS);
+            int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1,
+             LVNI_SELECTED);
+
+            if (selection >= 0)
+                show_selected_cert(hwnd, selection);
+            break;
+        }
         case IDCANCEL:
             free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS));
             close_stores(GetDlgItem(hwnd, IDC_MGR_STORES));




More information about the wine-cvs mailing list