Juan Lang : cryptui: Allow viewing another cert in the chain from the hierarchy page.
Alexandre Julliard
julliard at winehq.org
Thu Dec 18 08:08:43 CST 2008
Module: wine
Branch: master
Commit: 6e907fea1339c67af651d648cba77815ae45506c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e907fea1339c67af651d648cba77815ae45506c
Author: Juan Lang <juan.lang at gmail.com>
Date: Wed Dec 17 09:02:21 2008 -0800
cryptui: Allow viewing another cert in the chain from the hierarchy page.
---
dlls/cryptui/main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index cc585f8..8a251b4 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -1954,12 +1954,57 @@ static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
data->pCertViewInfo->idxSigner,
data->pCertViewInfo->fCounterSigner,
data->pCertViewInfo->idxCounterSigner);
+ EnableWindow(GetDlgItem(hwnd, IDC_VIEWCERTIFICATE), selection != 0);
set_certificate_status(GetDlgItem(hwnd, IDC_CERTIFICATESTATUSTEXT),
&provSigner->pasCertChain[selection]);
break;
}
break;
}
+ case WM_COMMAND:
+ switch (wp)
+ {
+ case IDC_VIEWCERTIFICATE:
+ {
+ TVITEMW item;
+ CRYPT_PROVIDER_SGNR *provSigner;
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW viewInfo;
+ BOOL changed = FALSE;
+
+ memset(&item, 0, sizeof(item));
+ item.mask = TVIF_HANDLE | TVIF_PARAM;
+ item.hItem = (HTREEITEM)SendMessageW(tree, TVM_GETNEXTITEM,
+ TVGN_CARET, (LPARAM)NULL);
+ SendMessageW(tree, TVM_GETITEMW, 0, (LPARAM)&item);
+ data = get_hierarchy_data_from_tree_item(tree, item.hItem);
+ selection = lparam_to_index(data, item.lParam);
+ provSigner = WTHelperGetProvSignerFromChain(
+ (CRYPT_PROVIDER_DATA *)data->pCertViewInfo->u.pCryptProviderData,
+ data->pCertViewInfo->idxSigner,
+ data->pCertViewInfo->fCounterSigner,
+ data->pCertViewInfo->idxCounterSigner);
+ memset(&viewInfo, 0, sizeof(viewInfo));
+ viewInfo.dwSize = sizeof(viewInfo);
+ viewInfo.dwFlags = data->pCertViewInfo->dwFlags;
+ viewInfo.szTitle = data->pCertViewInfo->szTitle;
+ viewInfo.pCertContext = provSigner->pasCertChain[selection].pCert;
+ viewInfo.cStores = data->pCertViewInfo->cStores;
+ viewInfo.rghStores = data->pCertViewInfo->rghStores;
+ viewInfo.cPropSheetPages = data->pCertViewInfo->cPropSheetPages;
+ viewInfo.rgPropSheetPages = data->pCertViewInfo->rgPropSheetPages;
+ viewInfo.nStartPage = data->pCertViewInfo->nStartPage;
+ CryptUIDlgViewCertificateW(&viewInfo, &changed);
+ if (changed)
+ {
+ /* Delete the contents of the tree */
+ SendMessageW(tree, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);
+ /* Reinitialize the tree */
+ show_cert_hierarchy(hwnd, data);
+ }
+ break;
+ }
+ }
+ break;
}
return 0;
}
More information about the wine-cvs
mailing list