cryptui: Add a (empty) hierarchy page to the cert properties dialog.

This commit is contained in:
Juan Lang 2008-12-17 08:59:06 -08:00 committed by Alexandre Julliard
parent 48c45fb39c
commit e958485fe2
3 changed files with 98 additions and 1 deletions

View File

@ -118,6 +118,20 @@ BEGIN
PUSHBUTTON "&Copy to File...", IDC_EXPORT,177,216,70,14 PUSHBUTTON "&Copy to File...", IDC_EXPORT,177,216,70,14
END END
IDD_HIERARCHY DIALOG DISCARDABLE 0, 0, 255, 236
CAPTION "Certification Path"
STYLE WS_VISIBLE
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Certification &path", grp1,6,10,245,165, BS_GROUPBOX
CONTROL "",IDC_CERTPATH, "SysTreeView32", TVS_HASLINES|WS_BORDER,
13,22,231,130
PUSHBUTTON "&View Certificate", IDC_VIEWCERTIFICATE,175,156,70,14
LTEXT "Certificate &status:", IDC_CERTIFICATESTATUS,6,183,70,14
CONTROL "", IDC_CERTIFICATESTATUSTEXT,"RichEdit20W",
WS_BORDER|ES_READONLY|ES_MULTILINE|WS_DISABLED,6,195,245,36
END
IDD_USERNOTICE DIALOG DISCARDABLE 0, 0, 255, 256 IDD_USERNOTICE DIALOG DISCARDABLE 0, 0, 255, 256
CAPTION "Disclaimer" CAPTION "Disclaimer"
STYLE WS_VISIBLE STYLE WS_VISIBLE

View File

@ -80,6 +80,7 @@
#define IDD_GENERAL 100 #define IDD_GENERAL 100
#define IDD_DETAIL 101 #define IDD_DETAIL 101
#define IDD_HIERARCHY 102
#define IDD_USERNOTICE 103 #define IDD_USERNOTICE 103
#define IDB_CERT 201 #define IDB_CERT 201
@ -101,6 +102,11 @@
#define IDC_EDITPROPERTIES 2103 #define IDC_EDITPROPERTIES 2103
#define IDC_EXPORT 2104 #define IDC_EXPORT 2104
#define IDC_VIEWCERTIFICATE 2200
#define IDC_CERTPATH 2201
#define IDC_CERTIFICATESTATUS 2202
#define IDC_CERTIFICATESTATUSTEXT 2203
#define IDC_USERNOTICE 2300 #define IDC_USERNOTICE 2300
#define IDC_CPS 2301 #define IDC_CPS 2301

View File

@ -1741,6 +1741,78 @@ static BOOL init_detail_page(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
return ret; return ret;
} }
struct hierarchy_data
{
PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo;
DWORD selectedCert;
};
static void show_cert_hierarchy(HWND hwnd, struct hierarchy_data *data)
{
/* Disable view certificate button until a certificate is selected */
EnableWindow(GetDlgItem(hwnd, IDC_VIEWCERTIFICATE), FALSE);
FIXME("show cert chain\n");
}
static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
LPARAM lp)
{
PROPSHEETPAGEW *page;
struct hierarchy_data *data;
TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd, msg, wp, lp);
switch (msg)
{
case WM_INITDIALOG:
page = (PROPSHEETPAGEW *)lp;
data = (struct hierarchy_data *)page->lParam;
show_cert_hierarchy(hwnd, data);
break;
}
return 0;
}
static UINT CALLBACK hierarchy_callback(HWND hwnd, UINT msg,
PROPSHEETPAGEW *page)
{
struct hierarchy_data *data;
switch (msg)
{
case PSPCB_RELEASE:
data = (struct hierarchy_data *)page->lParam;
HeapFree(GetProcessHeap(), 0, data);
break;
}
return 0;
}
static BOOL init_hierarchy_page(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
PROPSHEETPAGEW *page)
{
struct hierarchy_data *data = HeapAlloc(GetProcessHeap(), 0,
sizeof(struct hierarchy_data));
BOOL ret = FALSE;
if (data)
{
data->pCertViewInfo = pCertViewInfo;
data->selectedCert = 0xffffffff;
memset(page, 0, sizeof(PROPSHEETPAGEW));
page->dwSize = sizeof(PROPSHEETPAGEW);
page->dwFlags = PSP_USECALLBACK;
page->hInstance = hInstance;
page->u.pszTemplate = MAKEINTRESOURCEW(IDD_HIERARCHY);
page->pfnDlgProc = hierarchy_dlg_proc;
page->lParam = (LPARAM)data;
page->pfnCallback = hierarchy_callback;
ret = TRUE;
}
return ret;
}
static int CALLBACK cert_prop_sheet_proc(HWND hwnd, UINT msg, LPARAM lp) static int CALLBACK cert_prop_sheet_proc(HWND hwnd, UINT msg, LPARAM lp)
{ {
RECT rc; RECT rc;
@ -1782,7 +1854,7 @@ static BOOL show_cert_dialog(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
if (!(pCertViewInfo->dwFlags & CRYPTUI_HIDE_DETAILPAGE)) if (!(pCertViewInfo->dwFlags & CRYPTUI_HIDE_DETAILPAGE))
nPages++; nPages++;
if (!(pCertViewInfo->dwFlags & CRYPTUI_HIDE_HIERARCHYPAGE)) if (!(pCertViewInfo->dwFlags & CRYPTUI_HIDE_HIERARCHYPAGE))
FIXME("show hierarchy page\n"); nPages++;
pages = HeapAlloc(GetProcessHeap(), 0, nPages * sizeof(PROPSHEETPAGEW)); pages = HeapAlloc(GetProcessHeap(), 0, nPages * sizeof(PROPSHEETPAGEW));
if (pages) if (pages)
{ {
@ -1805,6 +1877,11 @@ static BOOL show_cert_dialog(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
&pages[hdr.nPages])) &pages[hdr.nPages]))
hdr.nPages++; hdr.nPages++;
} }
if (!(pCertViewInfo->dwFlags & CRYPTUI_HIDE_HIERARCHYPAGE))
{
if (init_hierarchy_page(pCertViewInfo, &pages[hdr.nPages]))
hdr.nPages++;
}
/* Copy each additional page, and create the init dialog struct for it /* Copy each additional page, and create the init dialog struct for it
*/ */
if (pCertViewInfo->cPropSheetPages) if (pCertViewInfo->cPropSheetPages)