diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index f876c583963..41f671d021d 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -380,7 +380,7 @@ BEGIN CHECKBOX "&Include all certificates in the certification path if possible", IDC_EXPORT_CMS_INCLUDE_CHAIN, 44,57,200,8, BS_AUTOCHECKBOX|WS_TABSTOP|WS_DISABLED AUTORADIOBUTTON "&Personal Information Exchange/PKCS #12 (.pfx)", - IDC_EXPORT_FORMAT_PFX, 31,72,200,12, BS_AUTORADIOBUTTON + IDC_EXPORT_FORMAT_PFX, 31,72,200,12, BS_AUTORADIOBUTTON|WS_DISABLED CHECKBOX "Incl&ude all certificates in the certification path if possible", IDC_EXPORT_PFX_INCLUDE_CHAIN, 44,87,200,8, BS_AUTOCHECKBOX|WS_TABSTOP|WS_DISABLED CHECKBOX "&Enable strong encryption", diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 8542828f866..2eef5dc10c7 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -5567,6 +5567,19 @@ 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 (data->pExportInfo->dwSubjectChoice == + CRYPTUI_WIZ_EXPORT_CERT_CONTEXT) + { + DWORD size; + + /* If there's a CRYPT_KEY_PROV_INFO set for this cert, assume the + * cert has a private key. + */ + if (CertGetCertificateContextProperty( + data->pExportInfo->u.pCertContext, CERT_KEY_PROV_INFO_PROP_ID, + NULL, &size)) + EnableWindow(GetDlgItem(hwnd, IDC_EXPORT_FORMAT_PFX), TRUE); + } break; } case WM_NOTIFY: