mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 02:46:32 +00:00
cryptui: Implement specifying the destination store in CryptUIWizImport.
This commit is contained in:
parent
9f6c543355
commit
2bab6a2c5d
3 changed files with 68 additions and 1 deletions
|
@ -79,6 +79,7 @@ STRINGTABLE DISCARDABLE
|
|||
IDS_IMPORT_EMPTY_FILE "Please select a file."
|
||||
IDS_IMPORT_BAD_FORMAT "The file format is not recognized. Please select another file."
|
||||
IDS_IMPORT_OPEN_FAILED "Could not open "
|
||||
IDS_IMPORT_DEST_DETERMINED "Determined by the program"
|
||||
IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer"
|
||||
IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer"
|
||||
IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication"
|
||||
|
@ -254,7 +255,7 @@ BEGIN
|
|||
IDC_IMPORT_AUTO_STORE, 31,18,180,12, BS_AUTORADIOBUTTON|WS_TABSTOP
|
||||
AUTORADIOBUTTON "&Place all certificates in the following store:",
|
||||
IDC_IMPORT_SPECIFY_STORE, 31,30,180,12, BS_AUTORADIOBUTTON
|
||||
EDITTEXT IDC_IMPORT_STORE, 44,49,185,14, ES_AUTOHSCROLL|WS_TABSTOP
|
||||
EDITTEXT IDC_IMPORT_STORE, 44,49,185,14, ES_READONLY
|
||||
PUSHBUTTON "B&rowse...", IDC_IMPORT_BROWSE_STORE, 236,49,60,14
|
||||
END
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
#define IDS_IMPORT_EMPTY_FILE 1056
|
||||
#define IDS_IMPORT_BAD_FORMAT 1057
|
||||
#define IDS_IMPORT_OPEN_FAILED 1058
|
||||
#define IDS_IMPORT_DEST_DETERMINED 1059
|
||||
|
||||
#define IDS_PURPOSE_SERVER_AUTH 1100
|
||||
#define IDS_PURPOSE_CLIENT_AUTH 1101
|
||||
|
|
|
@ -3784,6 +3784,8 @@ struct ImportWizData
|
|||
CRYPTUI_WIZ_IMPORT_SRC_INFO importSrc;
|
||||
BOOL freeSource;
|
||||
HCERTSTORE hDestCertStore;
|
||||
BOOL freeDest;
|
||||
BOOL autoDest;
|
||||
};
|
||||
|
||||
static BOOL import_validate_filename(HWND hwnd, struct ImportWizData *data,
|
||||
|
@ -3953,9 +3955,23 @@ static LRESULT CALLBACK import_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
|
|||
LPARAM lp)
|
||||
{
|
||||
LRESULT ret = 0;
|
||||
struct ImportWizData *data;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
PROPSHEETPAGEW *page = (PROPSHEETPAGEW *)lp;
|
||||
|
||||
data = (struct ImportWizData *)page->lParam;
|
||||
SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data);
|
||||
SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_AUTO_STORE), BM_CLICK, 0, 0);
|
||||
if (data->dwFlags & CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE)
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_SPECIFY_STORE), FALSE);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE);
|
||||
break;
|
||||
}
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *hdr = (NMHDR *)lp;
|
||||
|
@ -3970,6 +3986,51 @@ static LRESULT CALLBACK import_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case WM_COMMAND:
|
||||
switch (wp)
|
||||
{
|
||||
case IDC_IMPORT_AUTO_STORE:
|
||||
data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER);
|
||||
data->autoDest = TRUE;
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE);
|
||||
break;
|
||||
case IDC_IMPORT_SPECIFY_STORE:
|
||||
data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER);
|
||||
data->autoDest = FALSE;
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), TRUE);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), TRUE);
|
||||
break;
|
||||
case IDC_IMPORT_BROWSE_STORE:
|
||||
{
|
||||
CRYPTUI_ENUM_SYSTEM_STORE_ARGS enumArgs = {
|
||||
CERT_SYSTEM_STORE_CURRENT_USER, NULL };
|
||||
CRYPTUI_ENUM_DATA enumData = { 0, NULL, 1, &enumArgs };
|
||||
CRYPTUI_SELECTSTORE_INFO_W selectInfo;
|
||||
HCERTSTORE store;
|
||||
|
||||
data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER);
|
||||
selectInfo.dwSize = sizeof(selectInfo);
|
||||
selectInfo.parent = hwnd;
|
||||
selectInfo.dwFlags = CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE;
|
||||
selectInfo.pwszTitle = selectInfo.pwszTitle = NULL;
|
||||
selectInfo.pEnumData = &enumData;
|
||||
selectInfo.pfnSelectedStoreCallback = NULL;
|
||||
if ((store = CryptUIDlgSelectStoreW(&selectInfo)))
|
||||
{
|
||||
WCHAR storeTitle[MAX_STRING_LEN];
|
||||
|
||||
LoadStringW(hInstance, IDS_IMPORT_DEST_DETERMINED,
|
||||
storeTitle, sizeof(storeTitle) / sizeof(storeTitle[0]));
|
||||
SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_STORE), WM_SETTEXT,
|
||||
0, (LPARAM)storeTitle);
|
||||
data->hDestCertStore = store;
|
||||
data->freeDest = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -4018,6 +4079,9 @@ static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent,
|
|||
memset(&data.importSrc, 0, sizeof(data.importSrc));
|
||||
data.freeSource = FALSE;
|
||||
data.hDestCertStore = hDestCertStore;
|
||||
data.freeDest = FALSE;
|
||||
data.autoDest = TRUE;
|
||||
|
||||
memset(&pages, 0, sizeof(pages));
|
||||
|
||||
pages[nPages].dwSize = sizeof(pages[0]);
|
||||
|
@ -4050,6 +4114,7 @@ static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent,
|
|||
pages[nPages].pszHeaderTitle = MAKEINTRESOURCEW(IDS_IMPORT_STORE_TITLE);
|
||||
pages[nPages].pszHeaderSubTitle =
|
||||
MAKEINTRESOURCEW(IDS_IMPORT_STORE_SUBTITLE);
|
||||
pages[nPages].lParam = (LPARAM)&data;
|
||||
nPages++;
|
||||
|
||||
pages[nPages].dwSize = sizeof(pages[0]);
|
||||
|
|
Loading…
Reference in a new issue