ReactOS 0.4.15-dev-8236-g99f0937
main.c File Reference
#include <stdarg.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "softpub.h"
#include "wingdi.h"
#include "richedit.h"
#include "ole2.h"
#include "richole.h"
#include "commdlg.h"
#include "commctrl.h"
#include "cryptuiapi.h"
#include "cryptuires.h"
#include "urlmon.h"
#include "hlink.h"
#include "winreg.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  CertMgrStoreInfo
 
struct  CertMgrData
 
struct  _CRYPTUI_ENUM_SYSTEM_STORE_ARGS
 
struct  _CRYPTUI_ENUM_DATA
 
struct  _CRYPTUI_SELECTSTORE_INFO_A
 
struct  _CRYPTUI_SELECTSTORE_INFO_W
 
struct  StoreInfo
 
struct  SelectStoreInfo
 
struct  ReadStringStruct
 
struct  OIDToString
 
struct  IssuerStatement
 
struct  detail_data
 
struct  field_value_data
 
struct  v1_field
 
struct  prop_id_to_string_id
 
struct  selection_list_item
 
struct  edit_cert_data
 
struct  hierarchy_data
 
struct  ImportWizData
 
struct  ExportWizData
 
struct  SelectCertData
 
struct  SortData
 
struct  SelectCertParam
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define MAX_STRING_LEN   512
 
#define CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE   0x00000001
 
#define MY_INDENT   200
 
#define MAX_PURPOSE   255
 
#define WM_REFRESH_VIEW   WM_USER + 0
 
#define MAX_FRIENDLY_NAME   40
 
#define MAX_DESCRIPTION   255
 

Typedefs

typedef struct _CRYPTUI_ENUM_SYSTEM_STORE_ARGS CRYPTUI_ENUM_SYSTEM_STORE_ARGS
 
typedef struct _CRYPTUI_ENUM_SYSTEM_STORE_ARGSPCRYPTUI_ENUM_SYSTEM_STORE_ARGS
 
typedef struct _CRYPTUI_ENUM_DATA CRYPTUI_ENUM_DATA
 
typedef struct _CRYPTUI_ENUM_DATAPCRYPTUI_ENUM_DATA
 
typedef BOOL(WINAPIPFN_SELECTED_STORE_CB) (HCERTSTORE store, HWND hwnd, void *pvArg)
 
typedef struct _CRYPTUI_SELECTSTORE_INFO_A CRYPTUI_SELECTSTORE_INFO_A
 
typedef struct _CRYPTUI_SELECTSTORE_INFO_APCRYPTUI_SELECTSTORE_INFO_A
 
typedef struct _CRYPTUI_SELECTSTORE_INFO_W CRYPTUI_SELECTSTORE_INFO_W
 
typedef struct _CRYPTUI_SELECTSTORE_INFO_WPCRYPTUI_SELECTSTORE_INFO_W
 
typedef WCHAR *(* field_format_func) (PCCERT_CONTEXT cert)
 
typedef void(* add_fields_func) (HWND hwnd, struct detail_data *data)
 
typedef WCHAR *(* create_detailed_value_func) (PCCERT_CONTEXT cert, void *param)
 
typedef WCHAR *(* prop_to_value_func) (void *pb, DWORD cb)
 

Enumerations

enum  PurposeFilter { PurposeFilterShowAll = 0 , PurposeFilterShowAdvanced = 1 , PurposeFilterShowOID = 2 }
 
enum  CheckBitmapIndex { CheckBitmapIndexUnchecked = 1 , CheckBitmapIndexChecked = 2 , CheckBitmapIndexDisabledUnchecked = 3 , CheckBitmapIndexDisabledChecked = 4 }
 
enum  PurposeSelection { PurposeEnableAll = 0 , PurposeDisableAll , PurposeEnableSelected }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (cryptui)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static WCHARstrdupAtoW (const char *str)
 
static void add_cert_columns (HWND hwnd)
 
static void add_cert_to_view (HWND lv, PCCERT_CONTEXT cert, DWORD *allocatedLen, LPWSTR *str)
 
static LPSTR get_cert_mgr_usages (void)
 
static void initialize_purpose_selection (HWND hwnd)
 
BOOL WINAPI WTHelperGetKnownUsages (DWORD action, PCCRYPT_OID_INFO **usages)
 
static CERT_ENHKEY_USAGEadd_oid_to_usage (CERT_ENHKEY_USAGE *usage, LPSTR oid)
 
static CERT_ENHKEY_USAGEconvert_usages_str_to_usage (LPSTR usageStr)
 
static CERT_ENHKEY_USAGEcreate_advanced_filter (void)
 
static int CALLBACK cert_mgr_sort_by_subject (LPARAM lp1, LPARAM lp2, LPARAM lp)
 
static void show_store_certs (HWND hwnd, HCERTSTORE store)
 
static void show_cert_stores (HWND hwnd, DWORD dwFlags, struct CertMgrData *data)
 
static void free_certs (HWND lv)
 
static HCERTSTORE cert_mgr_index_to_store (HWND tab, int index)
 
static HCERTSTORE cert_mgr_current_store (HWND hwnd)
 
static void close_stores (HWND tab)
 
static void refresh_store_certs (HWND hwnd)
 
static void add_known_usage (HWND lv, PCCRYPT_OID_INFO info, CheckBitmapIndex state)
 
static void add_known_usages_to_list (HWND lv, CheckBitmapIndex state)
 
static void toggle_usage (HWND hwnd, int iItem)
 
static LONG_PTR find_oid_in_list (HWND lv, LPCSTR oid)
 
static void save_cert_mgr_usages (HWND hwnd)
 
static LRESULT CALLBACK cert_mgr_advanced_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void cert_mgr_clear_cert_selection (HWND hwnd)
 
static PCCERT_CONTEXT cert_mgr_index_to_cert (HWND hwnd, int index)
 
static void show_selected_cert (HWND hwnd, int index)
 
static void get_cert_usages (PCCERT_CONTEXT cert, LPWSTR *str)
 
static void cert_mgr_show_cert_usages (HWND hwnd, int index)
 
static void cert_mgr_do_remove (HWND hwnd)
 
static void cert_mgr_do_export (HWND hwnd)
 
static int cert_mgr_sort_by_text (HWND lv, int col, int index1, int index2)
 
static int CALLBACK cert_mgr_sort_by_issuer (LPARAM lp1, LPARAM lp2, LPARAM lp)
 
static int CALLBACK cert_mgr_sort_by_date (LPARAM lp1, LPARAM lp2, LPARAM lp)
 
static int CALLBACK cert_mgr_sort_by_friendly_name (LPARAM lp1, LPARAM lp2, LPARAM lp)
 
static LRESULT CALLBACK cert_mgr_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
BOOL WINAPI CryptUIDlgCertMgr (PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr)
 
static BOOL WINAPI enum_store_callback (const void *pvSystemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved, void *pvArg)
 
static void enumerate_stores (HWND hwnd, CRYPTUI_ENUM_DATA *pEnumData)
 
static void free_store_info (HWND tree)
 
static HCERTSTORE selected_item_to_store (HWND tree, HTREEITEM hItem)
 
static LRESULT CALLBACK select_store_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
HCERTSTORE WINAPI CryptUIDlgSelectStoreW (PCRYPTUI_SELECTSTORE_INFO_W info)
 
HCERTSTORE WINAPI CryptUIDlgSelectStoreA (PCRYPTUI_SELECTSTORE_INFO_A info)
 
BOOL WINAPI CryptUIDlgViewCertificateA (PCCRYPTUI_VIEWCERTIFICATE_STRUCTA pCertViewInfo, BOOL *pfPropertiesChanged)
 
static DWORD CALLBACK read_text_callback (DWORD_PTR dwCookie, LPBYTE buf, LONG cb, LONG *pcb)
 
static void add_unformatted_text_to_control (HWND hwnd, LPCWSTR text, LONG len)
 
static void add_string_resource_to_control (HWND hwnd, int id)
 
static void add_text_with_paraformat_to_control (HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
 
static void add_string_resource_with_paraformat_to_control (HWND hwnd, int id, const PARAFORMAT2 *fmt)
 
static LPWSTR get_cert_name_string (PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags)
 
static void add_cert_string_to_control (HWND hwnd, PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags)
 
static void add_icon_to_control (HWND hwnd, int id)
 
static void add_oid_text_to_control (HWND hwnd, char *oid)
 
static struct OIDToStringfindSupportedOID (LPCSTR oid)
 
static void add_local_oid_text_to_control (HWND text, LPCSTR oid)
 
static void display_app_usages (HWND text, PCCERT_CONTEXT cert, BOOL *anyUsageAdded)
 
static BOOL display_cert_usages (HWND text, PCCERT_CONTEXT cert, BOOL *anyUsageAdded)
 
static void set_policy_text (HWND text, PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
 
static CRYPT_OBJID_BLOBfind_policy_qualifier (CERT_POLICIES_INFO *policies, LPCSTR policyOid)
 
static WCHARget_cps_str_from_qualifier (const CRYPT_OBJID_BLOB *qualifier)
 
static WCHARget_user_notice_from_qualifier (const CRYPT_OBJID_BLOB *qualifier)
 
static void set_issuer_statement (HWND hwnd, PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
 
static void set_cert_info (HWND hwnd, PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
 
static void set_cert_name_string (HWND hwnd, PCCERT_CONTEXT cert, DWORD nameFlags, int heading)
 
static void add_date_string_to_control (HWND hwnd, const FILETIME *fileTime)
 
static void set_cert_validity_period (HWND hwnd, PCCERT_CONTEXT cert)
 
static void set_general_info (HWND hwnd, PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
 
static LRESULT CALLBACK user_notice_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void show_user_notice (HWND hwnd, struct IssuerStatement *issuerStatement)
 
static LRESULT CALLBACK general_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static UINT CALLBACK general_callback_proc (HWND hwnd, UINT msg, PROPSHEETPAGEW *page)
 
static void init_general_page (PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, PROPSHEETPAGEW *page)
 
static WCHARfield_format_version (PCCERT_CONTEXT cert)
 
static WCHARformat_hex_string (void *pb, DWORD cb)
 
static WCHARfield_format_serial_number (PCCERT_CONTEXT cert)
 
static WCHARfield_format_issuer (PCCERT_CONTEXT cert)
 
static WCHARfield_format_detailed_cert_name (PCERT_NAME_BLOB name)
 
static WCHARfield_format_detailed_issuer (PCCERT_CONTEXT cert, void *param)
 
static WCHARfield_format_subject (PCCERT_CONTEXT cert)
 
static WCHARfield_format_detailed_subject (PCCERT_CONTEXT cert, void *param)
 
static WCHARformat_long_date (const FILETIME *fileTime)
 
static WCHARfield_format_from_date (PCCERT_CONTEXT cert)
 
static WCHARfield_format_to_date (PCCERT_CONTEXT cert)
 
static WCHARfield_format_public_key (PCCERT_CONTEXT cert)
 
static WCHARfield_format_detailed_public_key (PCCERT_CONTEXT cert, void *param)
 
static void add_field_value_data (struct detail_data *data, create_detailed_value_func create, void *param)
 
static void add_field_and_value_to_list (HWND hwnd, struct detail_data *data, LPWSTR field, LPWSTR value, create_detailed_value_func create, void *param)
 
static void add_string_id_and_value_to_list (HWND hwnd, struct detail_data *data, int id, LPWSTR value, create_detailed_value_func create, void *param)
 
static void add_v1_field (HWND hwnd, struct detail_data *data, const struct v1_field *field)
 
static void add_v1_fields (HWND hwnd, struct detail_data *data)
 
static WCHARcrypt_format_extension (const CERT_EXTENSION *ext, DWORD formatStrType)
 
static WCHARfield_format_extension_hex_with_ascii (const CERT_EXTENSION *ext)
 
static WCHARfield_format_detailed_extension (PCCERT_CONTEXT cert, void *param)
 
static void add_cert_extension_detail (HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
 
static void add_all_extensions (HWND hwnd, struct detail_data *data)
 
static void add_critical_extensions (HWND hwnd, struct detail_data *data)
 
static WCHARformat_enhanced_key_usage_value (void *pb, DWORD cb)
 
static void add_properties (HWND hwnd, struct detail_data *data)
 
static void add_all_fields (HWND hwnd, struct detail_data *data)
 
static void create_show_list (HWND hwnd, struct detail_data *data)
 
static void create_listview_columns (HWND hwnd)
 
static void set_fields_selection (HWND hwnd, struct detail_data *data, int sel)
 
static void create_cert_details_list (HWND hwnd, struct detail_data *data)
 
static void add_purpose (HWND hwnd, LPCSTR oid)
 
static BOOL is_valid_oid (LPCSTR oid)
 
static BOOL is_oid_in_list (HWND hwnd, LPCSTR oid)
 
static LRESULT CALLBACK add_purpose_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static WCHARget_cert_property_as_string (PCCERT_CONTEXT cert, DWORD prop)
 
static void redraw_states (HWND list, BOOL enabled)
 
static void select_purposes (HWND hwnd, PurposeSelection selection)
 
static void show_cert_usages (HWND hwnd, struct edit_cert_data *data)
 
static void set_general_cert_properties (HWND hwnd, struct edit_cert_data *data)
 
static void set_cert_string_property (PCCERT_CONTEXT cert, DWORD prop, LPWSTR str)
 
static BOOL CALLBACK refresh_propsheet_pages (HWND hwnd, LPARAM lParam)
 
static void apply_general_changes (HWND hwnd)
 
static LRESULT CALLBACK cert_properties_general_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static UINT CALLBACK cert_properties_general_callback (HWND hwnd, UINT msg, PROPSHEETPAGEW *page)
 
static void show_edit_cert_properties_dialog (HWND parent, struct detail_data *data)
 
static void free_detail_fields (struct detail_data *data)
 
static void refresh_details_view (HWND hwnd)
 
static LRESULT CALLBACK detail_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static UINT CALLBACK detail_callback (HWND hwnd, UINT msg, PROPSHEETPAGEW *page)
 
static BOOL init_detail_page (PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, BOOL *pfPropertiesChanged, PROPSHEETPAGEW *page)
 
static LPARAM index_to_lparam (struct hierarchy_data *data, DWORD index)
 
static DWORD lparam_to_index (struct hierarchy_data *data, LPARAM lp)
 
static struct hierarchy_dataget_hierarchy_data_from_tree_item (HWND tree, HTREEITEM hItem)
 
static WCHARget_cert_display_name (PCCERT_CONTEXT cert)
 
static void show_cert_chain (HWND hwnd, struct hierarchy_data *data)
 
static void set_certificate_status (HWND hwnd, const CRYPT_PROVIDER_CERT *cert)
 
static void set_certificate_status_for_end_cert (HWND hwnd, PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
 
static void show_cert_hierarchy (HWND hwnd, struct hierarchy_data *data)
 
static void show_dialog_for_selected_cert (HWND hwnd)
 
static LRESULT CALLBACK hierarchy_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static UINT CALLBACK hierarchy_callback (HWND hwnd, UINT msg, PROPSHEETPAGEW *page)
 
static BOOL init_hierarchy_page (PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, PROPSHEETPAGEW *page)
 
static int CALLBACK cert_prop_sheet_proc (HWND hwnd, UINT msg, LPARAM lp)
 
static BOOL show_cert_dialog (PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, CRYPT_PROVIDER_CERT *provCert, BOOL *pfPropertiesChanged)
 
BOOL WINAPI CryptUIDlgViewCertificateW (PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, BOOL *pfPropertiesChanged)
 
BOOL WINAPI CryptUIDlgViewContext (DWORD dwContextType, LPVOID pvContext, HWND hwnd, LPCWSTR pwszTitle, DWORD dwFlags, LPVOID pvReserved)
 
static BOOL is_ca_cert (PCCERT_CONTEXT cert, BOOL defaultIfNotSpecified)
 
static HCERTSTORE choose_store_for_cert (PCCERT_CONTEXT cert)
 
static BOOL import_cert (PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore)
 
static BOOL import_crl (PCCRL_CONTEXT crl, HCERTSTORE hDestCertStore)
 
static BOOL import_ctl (PCCTL_CONTEXT ctl, HCERTSTORE hDestCertStore)
 
static BOOL check_context_type (DWORD dwFlags, DWORD type)
 
static void import_warning (DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, int warningID)
 
static void import_warn_type_mismatch (DWORD dwFlags, HWND hwnd, LPCWSTR szTitle)
 
static BOOL check_store_context_type (DWORD dwFlags, HCERTSTORE store)
 
static BOOL import_store (DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, HCERTSTORE source, HCERTSTORE dest)
 
static HCERTSTORE open_store_from_file (DWORD dwFlags, LPCWSTR fileName, DWORD *pContentType)
 
static BOOL import_file (DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, LPCWSTR fileName, HCERTSTORE dest)
 
static LRESULT CALLBACK import_welcome_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static WCHARmake_import_file_filter (DWORD dwFlags)
 
static BOOL import_validate_filename (HWND hwnd, struct ImportWizData *data, LPCWSTR fileName)
 
static LRESULT CALLBACK import_file_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static LRESULT CALLBACK import_store_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void show_import_details (HWND lv, struct ImportWizData *data)
 
static BOOL do_import (DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore)
 
static LRESULT CALLBACK import_finish_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static BOOL show_import_ui (DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore)
 
BOOL WINAPI CryptUIWizImport (DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore)
 
static LRESULT CALLBACK export_welcome_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static PCRYPT_KEY_PROV_INFO export_get_private_key_info (PCCERT_CONTEXT cert)
 
static BOOL export_acquire_private_key (const CRYPT_KEY_PROV_INFO *info, HCRYPTPROV *phProv)
 
static BOOL export_is_key_exportable (HCRYPTPROV hProv, DWORD keySpec)
 
static LRESULT CALLBACK export_private_key_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static BOOL export_info_has_private_key (PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo)
 
static void export_format_enable_controls (HWND hwnd, const struct ExportWizData *data)
 
static LRESULT CALLBACK export_format_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void export_password_mismatch (HWND hwnd, const struct ExportWizData *data)
 
static LRESULT CALLBACK export_password_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static LPWSTR export_append_extension (const struct ExportWizData *data, LPWSTR fileName)
 
static BOOL export_validate_filename (HWND hwnd, struct ExportWizData *data, LPCWSTR fileName)
 
static WCHARmake_export_file_filter (DWORD exportFormat, DWORD subjectChoice)
 
static LRESULT CALLBACK export_file_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void show_export_details (HWND lv, const struct ExportWizData *data)
 
static BOOL save_der (HANDLE file, const BYTE *pb, DWORD cb)
 
static BOOL save_base64 (HANDLE file, const BYTE *pb, DWORD cb)
 
static BOOL save_store_as_cms (HANDLE file, HCERTSTORE store)
 
static BOOL save_cert_as_cms (HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, BOOL includeChain)
 
static BOOL save_serialized_store (HANDLE file, HCERTSTORE store)
 
static BOOL save_pfx (HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO pContextInfo, PCRYPT_KEY_PROV_INFO keyProvInfo, BOOL deleteKeys)
 
static BOOL do_export (HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO pContextInfo, PCRYPT_KEY_PROV_INFO keyProvInfo, BOOL deleteKeys)
 
static LRESULT CALLBACK export_finish_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static BOOL show_export_ui (DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, const void *pvoid)
 
BOOL WINAPI CryptUIWizExport (DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, void *pvoid)
 
BOOL WINAPI CryptUIDlgViewSignerInfoA (CRYPTUI_VIEWSIGNERINFO_STRUCTA *pcvsi)
 
static void init_columns (HWND lv, DWORD flags)
 
static void add_cert_to_list (HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *allocatedLen, LPWSTR *str)
 
static void add_store_certs (HWND lv, HCERTSTORE store, DWORD flags, PFNCFILTERPROC filter, void *callback_data)
 
static PCCERT_CONTEXT select_cert_get_selected (HWND hwnd, int selection)
 
static void select_cert_update_view_button (HWND hwnd)
 
static void select_cert_view (HWND hwnd, PCCERT_CONTEXT cert, struct SelectCertData *data)
 
static int CALLBACK select_cert_sort_by_text (LPARAM lp1, LPARAM lp2, LPARAM lp)
 
static LRESULT CALLBACK select_cert_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateW (PCCRYPTUI_SELECTCERTIFICATE_STRUCTW pcsc)
 
static void free_prop_sheet_pages (PROPSHEETPAGEW *pages, DWORD num)
 
static PROPSHEETPAGEWprop_sheet_pages_AtoW (LPCPROPSHEETPAGEA pages, DWORD num)
 
PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateA (PCCRYPTUI_SELECTCERTIFICATE_STRUCTA pcsc)
 
PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateFromStore (HCERTSTORE hCertStore, HWND hwnd, LPCWSTR pwszTitle, LPCWSTR pwszDisplayString, DWORD dwDontUseColumn, DWORD dwFlags, void *pvReserved)
 
BOOL WINAPI CryptUIWizDigitalSign (DWORD flags, HWND parent, LPCWSTR title, PCCRYPTUI_WIZ_DIGITAL_SIGN_INFO info, PCCRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT *context)
 

Variables

static HINSTANCE hInstance
 
static const WCHAR empty [] = {0}
 
static const WCHAR my [] = { 'M','y',0 }
 
static const WCHAR addressBook []
 
static const WCHAR ca [] = { 'C','A',0 }
 
static const WCHAR root [] = { 'R','o','o','t',0 }
 
static const WCHAR trustedPublisher []
 
static const WCHAR disallowed [] = { 'D','i','s','a','l','l','o','w','e','d',0 }
 
static const struct CertMgrStoreInfo defaultStoreList []
 
static const struct CertMgrStoreInfo publisherStoreList []
 
static struct OIDToString oidMap []
 
static const struct v1_field v1_fields []
 
static const struct prop_id_to_string_id prop_id_map []
 
static const struct selection_list_item listItems []
 
static const WCHAR filter_cert []
 
static const WCHAR filter_pfx []
 
static const WCHAR filter_crl [] = { '*','.','c','r','l',0 }
 
static const WCHAR filter_ctl [] = { '*','.','s','t','l',0 }
 
static const WCHAR filter_serialized_store [] = { '*','.','s','s','t',0 }
 
static const WCHAR filter_cms []
 
static const WCHAR filter_all [] = { '*','.','*',0 }
 
struct {
   int   id
 
   DWORD   allowFlags
 
   LPCWSTR   filter
 
import_filters []
 
static const WCHAR export_filter_cert [] = { '*','.','c','e','r',0 }
 
static const WCHAR export_filter_crl [] = { '*','.','c','r','l',0 }
 
static const WCHAR export_filter_ctl [] = { '*','.','s','t','l',0 }
 
static const WCHAR export_filter_cms [] = { '*','.','p','7','b',0 }
 
static const WCHAR export_filter_pfx [] = { '*','.','p','f','x',0 }
 
static const WCHAR export_filter_sst [] = { '*','.','s','s','t',0 }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file main.c.

◆ CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE

#define CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE   0x00000001

Definition at line 1345 of file main.c.

◆ MAX_DESCRIPTION

#define MAX_DESCRIPTION   255

Definition at line 3534 of file main.c.

◆ MAX_FRIENDLY_NAME

#define MAX_FRIENDLY_NAME   40

Definition at line 3533 of file main.c.

◆ MAX_PURPOSE

#define MAX_PURPOSE   255

Definition at line 3225 of file main.c.

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   512

Definition at line 73 of file main.c.

◆ MY_INDENT

#define MY_INDENT   200

Definition at line 1889 of file main.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 23 of file main.c.

◆ WM_REFRESH_VIEW

#define WM_REFRESH_VIEW   WM_USER + 0

Definition at line 3524 of file main.c.

Typedef Documentation

◆ add_fields_func

typedef void(* add_fields_func) (HWND hwnd, struct detail_data *data)

Definition at line 2754 of file main.c.

◆ create_detailed_value_func

typedef WCHAR *(* create_detailed_value_func) (PCCERT_CONTEXT cert, void *param)

Definition at line 2756 of file main.c.

◆ CRYPTUI_ENUM_DATA

◆ CRYPTUI_ENUM_SYSTEM_STORE_ARGS

◆ CRYPTUI_SELECTSTORE_INFO_A

◆ CRYPTUI_SELECTSTORE_INFO_W

◆ field_format_func

typedef WCHAR *(* field_format_func) (PCCERT_CONTEXT cert)

Definition at line 2595 of file main.c.

◆ PCRYPTUI_ENUM_DATA

◆ PCRYPTUI_ENUM_SYSTEM_STORE_ARGS

◆ PCRYPTUI_SELECTSTORE_INFO_A

◆ PCRYPTUI_SELECTSTORE_INFO_W

◆ PFN_SELECTED_STORE_CB

typedef BOOL(WINAPI * PFN_SELECTED_STORE_CB) (HCERTSTORE store, HWND hwnd, void *pvArg)

Definition at line 1341 of file main.c.

◆ prop_to_value_func

typedef WCHAR *(* prop_to_value_func) (void *pb, DWORD cb)

Definition at line 3003 of file main.c.

Enumeration Type Documentation

◆ CheckBitmapIndex

Enumerator
CheckBitmapIndexUnchecked 
CheckBitmapIndexChecked 
CheckBitmapIndexDisabledUnchecked 
CheckBitmapIndexDisabledChecked 

Definition at line 579 of file main.c.

579 {
CheckBitmapIndex
Definition: main.c:579
@ CheckBitmapIndexChecked
Definition: main.c:581
@ CheckBitmapIndexUnchecked
Definition: main.c:580
@ CheckBitmapIndexDisabledUnchecked
Definition: main.c:582
@ CheckBitmapIndexDisabledChecked
Definition: main.c:583

◆ PurposeFilter

Enumerator
PurposeFilterShowAll 
PurposeFilterShowAdvanced 
PurposeFilterShowOID 

Definition at line 214 of file main.c.

214 {
PurposeFilter
Definition: main.c:214
@ PurposeFilterShowAdvanced
Definition: main.c:216
@ PurposeFilterShowAll
Definition: main.c:215
@ PurposeFilterShowOID
Definition: main.c:217

◆ PurposeSelection

Enumerator
PurposeEnableAll 
PurposeDisableAll 
PurposeEnableSelected 

Definition at line 3378 of file main.c.

3378 {
3379 PurposeEnableAll = 0,
PurposeSelection
Definition: main.c:3378
@ PurposeEnableAll
Definition: main.c:3379
@ PurposeEnableSelected
Definition: main.c:3381
@ PurposeDisableAll
Definition: main.c:3380

Function Documentation

◆ add_all_extensions()

static void add_all_extensions ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 2983 of file main.c.

2984{
2985 DWORD i;
2986 PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2987
2988 for (i = 0; i < cert->pCertInfo->cExtension; i++)
2989 add_cert_extension_detail(hwnd, data, &cert->pCertInfo->rgExtension[i]);
2990}
static void add_cert_extension_detail(HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
Definition: main.c:2954
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static BYTE cert[]
Definition: msg.c:1437
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by add_all_fields().

◆ add_all_fields()

static void add_all_fields ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 3076 of file main.c.

3077{
3081}
static void add_v1_fields(HWND hwnd, struct detail_data *data)
Definition: main.c:2844
static void add_properties(HWND hwnd, struct detail_data *data)
Definition: main.c:3035
static void add_all_extensions(HWND hwnd, struct detail_data *data)
Definition: main.c:2983

◆ add_cert_columns()

static void add_cert_columns ( HWND  hwnd)
static

Definition at line 75 of file main.c.

76{
78 RECT rc;
81
83 GetWindowRect(lv, &rc);
86 column.cx = (rc.right - rc.left) * 29 / 100 - 2;
87 column.pszText = buf;
91 column.cx = (rc.right - rc.left) * 16 / 100 - 2;
94 column.cx = (rc.right - rc.left) * 23 / 100 - 1;
97}
#define MAX_STRING_LEN
Definition: precomp.h:36
#define ARRAY_SIZE(A)
Definition: main.h:33
HINSTANCE hInstance
Definition: charmap.c:19
#define IDS_EXPIRATION_COLUMN
Definition: cryptuires.h:102
#define IDS_FRIENDLY_NAME_COLUMN
Definition: cryptuires.h:103
#define IDS_SUBJECT_COLUMN
Definition: cryptuires.h:100
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
#define IDS_ISSUER_COLUMN
Definition: cryptuires.h:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2632
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2724
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by cert_mgr_dlg_proc().

◆ add_cert_extension_detail()

static void add_cert_extension_detail ( HWND  hwnd,
struct detail_data data,
PCERT_EXTENSION  ext 
)
static

Definition at line 2954 of file main.c.

2956{
2958 ext->pszObjId, 0);
2960
2961 if (oidInfo)
2964 else
2965 {
2966 DWORD len = strlen(ext->pszObjId);
2967 LPWSTR oidW = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
2968
2969 if (oidW)
2970 {
2971 DWORD i;
2972
2973 for (i = 0; i <= len; i++)
2974 oidW[i] = ext->pszObjId[i];
2977 HeapFree(GetProcessHeap(), 0, oidW);
2978 }
2979 }
2981}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static struct list oidInfo
Definition: oid.c:1206
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1799
static void add_field_and_value_to_list(HWND hwnd, struct detail_data *data, LPWSTR field, LPWSTR value, create_detailed_value_func create, void *param)
Definition: main.c:2783
static WCHAR * field_format_detailed_extension(PCCERT_CONTEXT cert, void *param)
Definition: main.c:2943
static WCHAR * crypt_format_extension(const CERT_EXTENSION *ext, DWORD formatStrType)
Definition: main.c:2858
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static const WCHAR *const ext[]
Definition: module.c:53
GLuint GLfloat * val
Definition: glext.h:7180
GLenum GLsizei len
Definition: glext.h:6722
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by add_all_extensions(), and add_critical_extensions().

◆ add_cert_string_to_control()

static void add_cert_string_to_control ( HWND  hwnd,
PCCERT_CONTEXT  pCertContext,
DWORD  dwType,
DWORD  dwFlags 
)
static

Definition at line 1792 of file main.c.

1794{
1796
1797 if (name)
1798 {
1799 /* Don't include NULL-terminator in output */
1801
1804 }
1805}
static LPWSTR get_cert_name_string(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags)
Definition: main.c:1776
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1733
#define lstrlenW
Definition: compat.h:750
Definition: name.c:39
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ PCCERT_CONTEXT pCertContext
Definition: wincrypt.h:4836

Referenced by set_cert_name_string().

◆ add_cert_to_list()

static void add_cert_to_list ( HWND  lv,
PCCERT_CONTEXT  cert,
DWORD  flags,
DWORD allocatedLen,
LPWSTR str 
)
static

Definition at line 7064 of file main.c.

7066{
7067 DWORD len;
7068 LVITEMW item;
7069 WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
7070 WCHAR buf[80];
7071 SYSTEMTIME sysTime;
7072 LPWSTR none, usages;
7073
7075 item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
7076 item.iSubItem = 0;
7077 item.iImage = 0;
7079 if (!item.iItem)
7080 {
7081 item.mask |= LVIF_STATE;
7082 item.state = LVIS_SELECTED;
7083 item.stateMask = -1;
7084 }
7086 {
7088 if (len > *allocatedLen)
7089 {
7090 HeapFree(GetProcessHeap(), 0, *str);
7091 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7092 if (*str)
7093 *allocatedLen = len;
7094 }
7095 if (*str)
7096 {
7098 item.pszText = *str;
7100 }
7101 item.mask = LVIF_TEXT;
7102 ++item.iSubItem;
7103 }
7105 {
7107 NULL, 0);
7108 if (len > *allocatedLen)
7109 {
7110 HeapFree(GetProcessHeap(), 0, *str);
7111 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7112 if (*str)
7113 *allocatedLen = len;
7114 }
7115 if (*str)
7116 {
7118 *str, len);
7119 item.pszText = *str;
7120 if (!item.iSubItem)
7122 else
7124 }
7125 item.mask = LVIF_TEXT;
7126 ++item.iSubItem;
7127 }
7129 {
7131 if (usages)
7132 {
7133 item.pszText = usages;
7134 if (!item.iSubItem)
7136 else
7139 }
7140 item.mask = LVIF_TEXT;
7141 ++item.iSubItem;
7142 }
7144 {
7147 if (len > *allocatedLen)
7148 {
7149 HeapFree(GetProcessHeap(), 0, *str);
7150 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7151 if (*str)
7152 *allocatedLen = len;
7153 }
7154 if (*str)
7155 {
7157 item.pszText = none;
7158 else
7159 item.pszText = *str;
7160 if (!item.iSubItem)
7162 else
7164 }
7165 item.mask = LVIF_TEXT;
7166 ++item.iSubItem;
7167 }
7169 {
7171 FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
7172 GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, buf, ARRAY_SIZE(buf));
7173 item.pszText = buf;
7174 if (!item.iSubItem)
7176 else
7178 item.mask = LVIF_TEXT;
7179 ++item.iSubItem;
7180 }
7182 {
7183 static int show_fixme;
7184 if (!show_fixme++)
7185 FIXME("showing location is not implemented\n");
7187 if (!item.iSubItem)
7189 else
7191 }
7192}
#define FIXME(fmt,...)
Definition: debug.h:114
#define CRYPTUI_SELECT_ISSUEDTO_COLUMN
Definition: cryptuiapi.h:35
#define CRYPTUI_SELECT_ISSUEDBY_COLUMN
Definition: cryptuiapi.h:36
#define CRYPTUI_SELECT_FRIENDLYNAME_COLUMN
Definition: cryptuiapi.h:38
#define CRYPTUI_SELECT_EXPIRATION_COLUMN
Definition: cryptuiapi.h:40
#define CRYPTUI_SELECT_LOCATION_COLUMN
Definition: cryptuiapi.h:39
#define CRYPTUI_SELECT_INTENDEDUSE_COLUMN
Definition: cryptuiapi.h:37
#define IDS_FRIENDLY_NAME_NONE
Definition: cryptuires.h:119
#define IDS_NO_IMPL
Definition: cryptuires.h:181
#define NULL
Definition: types.h:112
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:551
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:360
DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString)
Definition: str.c:1228
static void get_cert_usages(PCCERT_CONTEXT cert, LPWSTR *str)
Definition: main.c:850
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1665
GLbitfield flags
Definition: glext.h:7161
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
static ATOM item
Definition: dde.c:856
static PCCRYPT_OID_INFO ** usages
Definition: softpub.c:81
#define LOCALE_SYSTEM_DEFAULT
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2687
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2306
#define LVIF_STATE
Definition: commctrl.h:2312
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define LVM_INSERTITEMW
Definition: commctrl.h:2404
const WCHAR * str
#define CERT_NAME_SIMPLE_DISPLAY_TYPE
Definition: wincrypt.h:3500
#define CERT_FRIENDLY_NAME_PROP_ID
Definition: wincrypt.h:2697
#define CERT_NAME_ISSUER_FLAG
Definition: wincrypt.h:3506
#define LOCALE_SSHORTDATE
Definition: winnls.h:60

Referenced by add_store_certs().

◆ add_cert_to_view()

static void add_cert_to_view ( HWND  lv,
PCCERT_CONTEXT  cert,
DWORD allocatedLen,
LPWSTR str 
)
static

Definition at line 99 of file main.c.

101{
102 DWORD len;
104 WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
105 WCHAR date[80];
106 SYSTEMTIME sysTime;
107 LPWSTR none;
108
110 item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
111 item.iSubItem = 0;
112 item.iImage = 0;
115 NULL, 0);
116 if (len > *allocatedLen)
117 {
119 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
120 if (*str)
121 *allocatedLen = len;
122 }
123 if (*str)
124 {
126 *str, len);
127 item.pszText = *str;
129 }
130
131 item.mask = LVIF_TEXT;
134 if (len > *allocatedLen)
135 {
137 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
138 if (*str)
139 *allocatedLen = len;
140 }
141 if (*str)
142 {
145 item.pszText = *str;
146 item.iSubItem = 1;
148 }
149
151 FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
152 GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
153 item.pszText = date;
154 item.iSubItem = 2;
156
158 NULL, &len))
160 if (len > *allocatedLen)
161 {
163 *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
164 if (*str)
165 *allocatedLen = len;
166 }
167 if (*str)
168 {
170 *str, &len))
171 item.pszText = none;
172 else
173 item.pszText = *str;
174 item.iSubItem = 3;
176 }
177}
__u16 date
Definition: mkdosfs.c:8

Referenced by show_store_certs().

◆ add_critical_extensions()

static void add_critical_extensions ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 2992 of file main.c.

2993{
2994 DWORD i;
2995 PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2996
2997 for (i = 0; i < cert->pCertInfo->cExtension; i++)
2998 if (cert->pCertInfo->rgExtension[i].fCritical)
3000 &cert->pCertInfo->rgExtension[i]);
3001}

◆ add_date_string_to_control()

static void add_date_string_to_control ( HWND  hwnd,
const FILETIME fileTime 
)
static

Definition at line 2409 of file main.c.

2410{
2411 WCHAR dateFmt[80]; /* sufficient for all versions of LOCALE_SSHORTDATE */
2412 WCHAR date[80];
2413 SYSTEMTIME sysTime;
2414
2416 FileTimeToSystemTime(fileTime, &sysTime);
2417 GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
2419}

Referenced by set_cert_validity_period().

◆ add_field_and_value_to_list()

static void add_field_and_value_to_list ( HWND  hwnd,
struct detail_data data,
LPWSTR  field,
LPWSTR  value,
create_detailed_value_func  create,
void param 
)
static

Definition at line 2783 of file main.c.

2785{
2786 LVITEMW item;
2787 int iItem = SendMessageW(hwnd, LVM_GETITEMCOUNT, 0, 0);
2788
2789 item.mask = LVIF_TEXT | LVIF_PARAM;
2790 item.iItem = iItem;
2791 item.iSubItem = 0;
2792 item.pszText = field;
2793 item.lParam = (LPARAM)data;
2795 if (value)
2796 {
2797 item.pszText = value;
2798 item.iSubItem = 1;
2800 }
2802}
static void add_field_value_data(struct detail_data *data, create_detailed_value_func create, void *param)
Definition: main.c:2765
GLfloat param
Definition: glext.h:5796
static const struct access_res create[16]
Definition: package.c:7644
Definition: parser.c:44
Definition: pdh_main.c:94

Referenced by add_cert_extension_detail(), and add_string_id_and_value_to_list().

◆ add_field_value_data()

static void add_field_value_data ( struct detail_data data,
create_detailed_value_func  create,
void param 
)
static

Definition at line 2765 of file main.c.

2767{
2768 if (data->cFields)
2769 data->fields = HeapReAlloc(GetProcessHeap(), 0, data->fields,
2770 (data->cFields + 1) * sizeof(struct field_value_data));
2771 else
2772 data->fields = HeapAlloc(GetProcessHeap(), 0,
2773 sizeof(struct field_value_data));
2774 if (data->fields)
2775 {
2776 data->fields[data->cFields].create = create;
2777 data->fields[data->cFields].detailed_value = NULL;
2778 data->fields[data->cFields].param = param;
2779 data->cFields++;
2780 }
2781}
#define HeapReAlloc
Definition: compat.h:734

Referenced by add_field_and_value_to_list().

◆ add_icon_to_control()

static void add_icon_to_control ( HWND  hwnd,
int  id 
)
static

Definition at line 1807 of file main.c.

1808{
1809 HRESULT hr;
1810 IRichEditOle *richEditOle = NULL;
1811 IOleObject *object = NULL;
1812 CLSID clsid;
1813 LPOLECACHE oleCache = NULL;
1814 FORMATETC formatEtc;
1815 DWORD conn;
1816 IDataObject *dataObject = NULL;
1818 STGMEDIUM stgm;
1819 IOleClientSite *clientSite = NULL;
1820 REOBJECT reObject;
1821
1822 TRACE("(%p, %d)\n", hwnd, id);
1823
1824 SendMessageW(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&richEditOle);
1825 if (!richEditOle)
1826 goto end;
1828 (void**)&object);
1829 if (FAILED(hr))
1830 goto end;
1831 hr = IOleObject_GetUserClassID(object, &clsid);
1832 if (FAILED(hr))
1833 goto end;
1834 hr = IOleObject_QueryInterface(object, &IID_IOleCache, (void**)&oleCache);
1835 if (FAILED(hr))
1836 goto end;
1837 formatEtc.cfFormat = CF_BITMAP;
1838 formatEtc.ptd = NULL;
1839 formatEtc.dwAspect = DVASPECT_CONTENT;
1840 formatEtc.lindex = -1;
1841 formatEtc.tymed = TYMED_GDI;
1842 hr = IOleCache_Cache(oleCache, &formatEtc, 0, &conn);
1843 if (FAILED(hr))
1844 goto end;
1845 hr = IOleObject_QueryInterface(object, &IID_IDataObject,
1846 (void**)&dataObject);
1847 if (FAILED(hr))
1848 goto end;
1849 hr = IRichEditOle_GetClientSite(richEditOle, &clientSite);
1850 if (FAILED(hr))
1851 goto end;
1854 if (!bitmap)
1855 goto end;
1856 stgm.tymed = TYMED_GDI;
1857 stgm.u.hBitmap = bitmap;
1858 stgm.pUnkForRelease = NULL;
1859 hr = IDataObject_SetData(dataObject, &formatEtc, &stgm, TRUE);
1860 if (FAILED(hr))
1861 goto end;
1862
1863 reObject.cbStruct = sizeof(reObject);
1864 reObject.cp = REO_CP_SELECTION;
1865 reObject.clsid = clsid;
1866 reObject.poleobj = object;
1867 reObject.pstg = NULL;
1868 reObject.polesite = clientSite;
1869 reObject.sizel.cx = reObject.sizel.cy = 0;
1870 reObject.dvaspect = DVASPECT_CONTENT;
1871 reObject.dwFlags = 0;
1872 reObject.dwUser = 0;
1873
1874 IRichEditOle_InsertObject(richEditOle, &reObject);
1875
1876end:
1877 if (clientSite)
1878 IOleClientSite_Release(clientSite);
1879 if (dataObject)
1880 IDataObject_Release(dataObject);
1881 if (oleCache)
1882 IOleCache_Release(oleCache);
1883 if (object)
1884 IOleObject_Release(object);
1885 if (richEditOle)
1886 IRichEditOle_Release(richEditOle);
1887}
#define CF_BITMAP
Definition: constants.h:397
#define TRUE
Definition: types.h:120
HRESULT WINAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
GLuint GLuint end
Definition: gl.h:1545
#define FAILED(hr)
Definition: intsafe.h:51
static HBITMAP
Definition: button.c:44
REFCLSID clsid
Definition: msctf.c:82
const GUID IID_IOleCache
const GUID IID_IDataObject
const GUID IID_IOleObject
#define CLSID_NULL
Definition: guiddef.h:99
#define EM_GETOLEINTERFACE
Definition: richedit.h:93
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD dwUser
Definition: richole.idl:67
CLSID clsid
Definition: richole.idl:60
DWORD dwFlags
Definition: richole.idl:66
LPSTORAGE pstg
Definition: richole.idl:62
LPOLEOBJECT poleobj
Definition: richole.idl:61
DWORD dvaspect
Definition: richole.idl:65
LPOLECLIENTSITE polesite
Definition: richole.idl:63
DWORD cbStruct
Definition: richole.idl:58
LONG cp
Definition: richole.idl:59
SIZEL sizel
Definition: richole.idl:64
Definition: uimain.c:89
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_LOADTRANSPARENT
Definition: winuser.h:1093
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2234
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by set_cert_info().

◆ add_known_usage()

static void add_known_usage ( HWND  lv,
PCCRYPT_OID_INFO  info,
CheckBitmapIndex  state 
)
static

Definition at line 586 of file main.c.

588{
590
593 item.stateMask = LVIS_STATEIMAGEMASK;
594 item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
595 item.iSubItem = 0;
596 item.lParam = (LPARAM)info;
597 item.pszText = (LPWSTR)info->pwszName;
599}
static int state
Definition: maze.c:121
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2328
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326

Referenced by add_known_usages_to_list(), and show_cert_usages().

◆ add_known_usages_to_list()

static void add_known_usages_to_list ( HWND  lv,
CheckBitmapIndex  state 
)
static

Definition at line 601 of file main.c.

602{
604
606 {
608
609 for (ptr = usages; *ptr; ptr++)
612 }
613}
BOOL WINAPI WTHelperGetKnownUsages(DWORD action, PCCRYPT_OID_INFO **usages)
static void add_known_usage(HWND lv, PCCRYPT_OID_INFO info, CheckBitmapIndex state)
Definition: main.c:586
static PVOID ptr
Definition: dispmode.c:27

Referenced by cert_mgr_advanced_dlg_proc(), and show_cert_usages().

◆ add_local_oid_text_to_control()

static void add_local_oid_text_to_control ( HWND  text,
LPCSTR  oid 
)
static

Definition at line 1991 of file main.c.

1992{
1993 struct OIDToString *entry;
1994 WCHAR nl = '\n';
1995 PARAFORMAT2 parFmt;
1996
1997 parFmt.cbSize = sizeof(parFmt);
1998 parFmt.dwMask = PFM_STARTINDENT;
1999 parFmt.dxStartIndent = MY_INDENT * 3;
2000 if ((entry = findSupportedOID(oid)))
2001 {
2002 WCHAR *str, *linebreak, *ptr;
2003 BOOL multiline = FALSE;
2004 int len;
2005
2006 len = LoadStringW(hInstance, entry->id, (LPWSTR)&str, 0);
2007 ptr = str;
2008 do {
2009 if ((linebreak = wmemchr(ptr, '\n', len)))
2010 {
2012
2013 multiline = TRUE;
2014 /* The source string contains a newline, which the richedit
2015 * control won't find since it's interpreted as a paragraph
2016 * break. Therefore copy up to the newline. lstrcpynW always
2017 * NULL-terminates, so pass one more than the length of the
2018 * source line so the copy includes the entire line and the
2019 * NULL-terminator.
2020 */
2021 lstrcpynW(copy, ptr, linebreak - ptr + 1);
2023 linebreak - ptr, &parFmt);
2024 ptr = linebreak + 1;
2026 }
2027 else if (multiline && *ptr)
2028 {
2029 /* Add the last line */
2031 len - (ptr - str), &parFmt);
2033 }
2034 } while (linebreak);
2035 if (!multiline)
2036 {
2039 }
2040 }
2041 else
2042 {
2043 WCHAR *oidW = HeapAlloc(GetProcessHeap(), 0,
2044 (strlen(oid) + 1) * sizeof(WCHAR));
2045
2046 if (oidW)
2047 {
2048 LPCSTR src;
2049 WCHAR *dst;
2050
2051 for (src = oid, dst = oidW; *src; src++, dst++)
2052 *dst = *src;
2053 *dst = 0;
2055 &parFmt);
2057 HeapFree(GetProcessHeap(), 0, oidW);
2058 }
2059 }
2060}
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define FALSE
Definition: types.h:117
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1759
#define MY_INDENT
Definition: main.c:1889
static struct OIDToString * findSupportedOID(LPCSTR oid)
Definition: main.c:1974
#define lstrcpynW
Definition: compat.h:738
const WCHAR * text
Definition: package.c:1799
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
_CONST_RETURN wchar_t *__cdecl wmemchr(_In_reads_(_N) const wchar_t *_S, _In_ wchar_t _C, _In_ size_t _N)
Definition: wchar.h:2554
uint32_t entry
Definition: isohybrid.c:63
#define PFM_STARTINDENT
Definition: richedit.h:838
LPCSTR oid
Definition: main.c:1910
DWORD dwMask
Definition: richedit.h:667
UINT cbSize
Definition: richedit.h:666
LONG dxStartIndent
Definition: richedit.h:670
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by display_app_usages(), and display_cert_usages().

◆ add_oid_text_to_control()

static void add_oid_text_to_control ( HWND  hwnd,
char oid 
)
static

Definition at line 1891 of file main.c.

1892{
1893 WCHAR nl = '\n';
1895 PARAFORMAT2 parFmt;
1896
1897 parFmt.cbSize = sizeof(parFmt);
1898 parFmt.dwMask = PFM_STARTINDENT;
1899 parFmt.dxStartIndent = MY_INDENT * 3;
1900 if (oidInfo)
1901 {
1903 lstrlenW(oidInfo->pwszName), &parFmt);
1905 }
1906}

Referenced by display_app_usages(), and display_cert_usages().

◆ add_oid_to_usage()

static CERT_ENHKEY_USAGE * add_oid_to_usage ( CERT_ENHKEY_USAGE usage,
LPSTR  oid 
)
static

Definition at line 260 of file main.c.

261{
262 if (!usage->cUsageIdentifier)
263 usage->rgpszUsageIdentifier = HeapAlloc(GetProcessHeap(), 0,
264 sizeof(LPSTR));
265 else
266 usage->rgpszUsageIdentifier = HeapReAlloc(GetProcessHeap(), 0,
267 usage->rgpszUsageIdentifier,
268 (usage->cUsageIdentifier + 1) * sizeof(LPSTR));
269 if (usage->rgpszUsageIdentifier)
270 usage->rgpszUsageIdentifier[usage->cUsageIdentifier++] = oid;
271 else
272 {
274 usage = NULL;
275 }
276 return usage;
277}
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
char * LPSTR
Definition: xmlstorage.h:182

Referenced by convert_usages_str_to_usage(), and create_advanced_filter().

◆ add_properties()

static void add_properties ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 3035 of file main.c.

3036{
3037 DWORD i;
3038 PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
3039
3040 for (i = 0; i < ARRAY_SIZE(prop_id_map); i++)
3041 {
3042 DWORD cb;
3043
3045 &cb))
3046 {
3047 BYTE *pb;
3048 WCHAR *val = NULL;
3049
3050 /* FIXME: MS adds a separate value for the signature hash
3051 * algorithm.
3052 */
3053 pb = HeapAlloc(GetProcessHeap(), 0, cb);
3054 if (pb)
3055 {
3057 prop_id_map[i].prop, pb, &cb))
3058 {
3059 if (prop_id_map[i].prop_is_string)
3060 {
3061 val = (LPWSTR)pb;
3062 /* Don't double-free pb */
3063 pb = NULL;
3064 }
3065 else
3066 val = prop_id_map[i].prop_to_value(pb, cb);
3067 }
3068 HeapFree(GetProcessHeap(), 0, pb);
3069 }
3071 NULL, NULL);
3072 }
3073 }
3074}
static void add_string_id_and_value_to_list(HWND hwnd, struct detail_data *data, int id, LPWSTR value, create_detailed_value_func create, void *param)
Definition: main.c:2804
static const struct prop_id_to_string_id prop_id_map[]
Definition: main.c:3027
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
unsigned char BYTE
Definition: xxhash.c:193

Referenced by add_all_fields().

◆ add_purpose()

static void add_purpose ( HWND  hwnd,
LPCSTR  oid 
)
static

Definition at line 3150 of file main.c.

3151{
3154 sizeof(CRYPT_OID_INFO));
3155
3156 if (info)
3157 {
3158 char *oidCopy = HeapAlloc(GetProcessHeap(), 0, strlen(oid) + 1);
3159
3160 if (oidCopy)
3161 {
3162 LVITEMA item;
3163
3164 strcpy(oidCopy, oid);
3165 info->cbSize = sizeof(CRYPT_OID_INFO);
3166 info->pszOID = oidCopy;
3169 item.stateMask = LVIS_STATEIMAGEMASK;
3170 item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
3171 item.iSubItem = 0;
3172 item.lParam = (LPARAM)info;
3173 item.pszText = oidCopy;
3175 }
3176 else
3178 }
3179}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define IDC_CERTIFICATE_USAGES
Definition: cryptuires.h:238
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define LVM_INSERTITEMA
Definition: commctrl.h:2403
struct _CRYPT_OID_INFO CRYPT_OID_INFO
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by add_purpose_dlg_proc(), and show_cert_usages().

◆ add_purpose_dlg_proc()

static LRESULT CALLBACK add_purpose_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 3227 of file main.c.

3229{
3230 LRESULT ret = 0;
3231 char buf[MAX_PURPOSE + 1];
3232
3233 switch (msg)
3234 {
3235 case WM_INITDIALOG:
3237 MAX_PURPOSE, 0);
3240 break;
3241 case WM_COMMAND:
3242 switch (HIWORD(wp))
3243 {
3244 case EN_CHANGE:
3245 if (LOWORD(wp) == IDC_NEW_PURPOSE)
3246 {
3247 /* Show/hide scroll bar on description depending on how much
3248 * text it has.
3249 */
3252
3254 }
3255 break;
3256 case BN_CLICKED:
3257 switch (LOWORD(wp))
3258 {
3259 case IDOK:
3261 (LPARAM)buf);
3262 if (!buf[0])
3263 {
3264 /* An empty purpose is the same as cancelling */
3266 ret = TRUE;
3267 }
3268 else if (!is_valid_oid(buf))
3269 {
3271
3275 }
3276 else if (is_oid_in_list(
3278 {
3280
3282 ARRAY_SIZE(error));
3285 }
3286 else
3287 {
3289
3291 EndDialog(hwnd, wp);
3292 ret = TRUE;
3293 }
3294 break;
3295 case IDCANCEL:
3296 EndDialog(hwnd, wp);
3297 ret = TRUE;
3298 break;
3299 }
3300 break;
3301 }
3302 break;
3303 }
3304 return ret;
3305}
#define msg(x)
Definition: auth_time.c:54
#define IDS_CERTIFICATE_PURPOSE_EXISTS
Definition: cryptuires.h:64
#define IDS_CERTIFICATE_PURPOSE_ERROR
Definition: cryptuires.h:63
#define IDS_CERTIFICATE_PROPERTIES
Definition: cryptuires.h:62
#define IDC_NEW_PURPOSE
Definition: cryptuires.h:241
static void add_purpose(HWND hwnd, LPCSTR oid)
Definition: main.c:3150
static BOOL is_oid_in_list(HWND hwnd, LPCSTR oid)
Definition: main.c:3219
static BOOL is_valid_oid(LPCSTR oid)
Definition: main.c:3181
#define MAX_PURPOSE
Definition: main.c:3225
HANDLE HWND
Definition: compat.h:19
r parent
Definition: btrfs.c:3010
#define error(str)
Definition: mkdosfs.c:1605
#define LOWORD(l)
Definition: pedump.c:82
static char title[]
Definition: ps.c:92
eMaj lines
Definition: tritemp.h:206
#define HIWORD(l)
Definition: typedefs.h:247
int ret
LONG_PTR LRESULT
Definition: windef.h:209
const char * description
Definition: directx.c:2497
#define DWLP_USER
Definition: winuser.h:872
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define IDCANCEL
Definition: winuser.h:831
#define SB_VERT
Definition: winuser.h:553
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_GETTEXT
Definition: winuser.h:1618
#define WM_INITDIALOG
Definition: winuser.h:1739
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define IDOK
Definition: winuser.h:830
#define MB_ICONERROR
Definition: winuser.h:787
#define EM_SETLIMITTEXT
Definition: winuser.h:2011
#define MB_ICONEXCLAMATION
Definition: winuser.h:785
#define MB_OK
Definition: winuser.h:790
#define BN_CLICKED
Definition: winuser.h:1925
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
#define EM_GETLINECOUNT
Definition: winuser.h:1992
#define SetWindowLongPtrW
Definition: winuser.h:5355
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2022

Referenced by cert_properties_general_dlg_proc().

◆ add_store_certs()

static void add_store_certs ( HWND  lv,
HCERTSTORE  store,
DWORD  flags,
PFNCFILTERPROC  filter,
void callback_data 
)
static

Definition at line 7194 of file main.c.

7196{
7198 BOOL select = FALSE;
7199 DWORD allocatedLen = 0;
7200 LPWSTR str = NULL;
7201
7202 do {
7204 if (cert && (!filter || filter(cert, &select, callback_data)))
7205 add_cert_to_list(lv, cert, flags, &allocatedLen, &str);
7206 } while (cert);
7208}
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
Definition: store.c:928
static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *allocatedLen, LPWSTR *str)
Definition: main.c:7064
LPCWSTR filter
Definition: main.c:4927
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition: select.c:41
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

Referenced by select_cert_dlg_proc().

◆ add_string_id_and_value_to_list()

static void add_string_id_and_value_to_list ( HWND  hwnd,
struct detail_data data,
int  id,
LPWSTR  value,
create_detailed_value_func  create,
void param 
)
static

Definition at line 2804 of file main.c.

Referenced by add_properties(), and add_v1_field().

◆ add_string_resource_to_control()

static void add_string_resource_to_control ( HWND  hwnd,
int  id 
)
static

Definition at line 1750 of file main.c.

1751{
1752 LPWSTR str;
1753 LONG len;
1754
1755 len = LoadStringW(hInstance, id, (LPWSTR)&str, 0);
1757}
long LONG
Definition: pedump.c:60

Referenced by set_cert_validity_period(), and set_certificate_status().

◆ add_string_resource_with_paraformat_to_control()

static void add_string_resource_with_paraformat_to_control ( HWND  hwnd,
int  id,
const PARAFORMAT2 fmt 
)
static

◆ add_text_with_paraformat_to_control()

static void add_text_with_paraformat_to_control ( HWND  hwnd,
LPCWSTR  text,
LONG  len,
const PARAFORMAT2 fmt 
)
static

◆ add_unformatted_text_to_control()

static void add_unformatted_text_to_control ( HWND  hwnd,
LPCWSTR  text,
LONG  len 
)
static

Definition at line 1733 of file main.c.

1734{
1735 struct ReadStringStruct string;
1736 EDITSTREAM editstream;
1737
1738 TRACE("(%p, %s)\n", hwnd, debugstr_wn(text, len));
1739
1740 string.buf = text;
1741 string.pos = 0;
1742 string.len = len;
1743 editstream.dwCookie = (DWORD_PTR)&string;
1744 editstream.dwError = 0;
1745 editstream.pfnCallback = read_text_callback;
1747 (LPARAM)&editstream);
1748}
static DWORD CALLBACK read_text_callback(DWORD_PTR dwCookie, LPBYTE buf, LONG cb, LONG *pcb)
Definition: main.c:1719
#define debugstr_wn
Definition: kernel32.h:33
#define SFF_SELECTION
Definition: richedit.h:979
#define EM_STREAMIN
Definition: richedit.h:106
#define SF_TEXT
Definition: richedit.h:720
#define SF_UNICODE
Definition: richedit.h:724
#define DWORD_PTR
Definition: treelist.c:76

Referenced by add_cert_string_to_control(), add_date_string_to_control(), add_local_oid_text_to_control(), add_oid_text_to_control(), add_string_resource_to_control(), add_text_with_paraformat_to_control(), detail_dlg_proc(), display_app_usages(), display_cert_usages(), set_cert_name_string(), set_cert_validity_period(), and user_notice_dlg_proc().

◆ add_v1_field()

static void add_v1_field ( HWND  hwnd,
struct detail_data data,
const struct v1_field field 
)
static

Definition at line 2820 of file main.c.

2822{
2823 WCHAR *val = field->format(data->pCertViewInfo->pCertContext);
2824
2825 if (val)
2826 {
2828 field->create_detailed_value, NULL);
2830 }
2831}

Referenced by add_v1_fields().

◆ add_v1_fields()

static void add_v1_fields ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 2844 of file main.c.

2845{
2846 unsigned int i;
2847 PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2848
2849 /* The last item in v1_fields is the public key, which is not in the loop
2850 * because it's a special case.
2851 */
2852 for (i = 0; i < ARRAY_SIZE(v1_fields) - 1; i++)
2854 if (cert->pCertInfo->SubjectPublicKeyInfo.PublicKey.cbData)
2856}
static const struct v1_field v1_fields[]
Definition: main.c:2833
static void add_v1_field(HWND hwnd, struct detail_data *data, const struct v1_field *field)
Definition: main.c:2820

Referenced by add_all_fields().

◆ apply_general_changes()

static void apply_general_changes ( HWND  hwnd)
static

Definition at line 3536 of file main.c.

3537{
3539 struct edit_cert_data *data =
3541
3547 {
3548 /* Setting a NULL usage removes the enhanced key usage property. */
3550 }
3552 {
3553 CERT_ENHKEY_USAGE usage = { 0, NULL };
3554
3556 }
3558 {
3560 CERT_ENHKEY_USAGE usage = { 0, NULL };
3561 int purposes = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0), i;
3562 LVITEMW item;
3563
3564 item.mask = LVIF_STATE | LVIF_PARAM;
3565 item.iSubItem = 0;
3566 item.stateMask = LVIS_STATEIMAGEMASK;
3567 for (i = 0; i < purposes; i++)
3568 {
3569 item.iItem = i;
3570 if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item))
3571 {
3572 int state = item.state >> 12;
3573
3575 {
3577
3578 if (usage.cUsageIdentifier)
3579 usage.rgpszUsageIdentifier =
3581 usage.rgpszUsageIdentifier,
3582 (usage.cUsageIdentifier + 1) * sizeof(LPSTR));
3583 else
3584 usage.rgpszUsageIdentifier =
3585 HeapAlloc(GetProcessHeap(), 0, sizeof(LPSTR));
3586 if (usage.rgpszUsageIdentifier)
3587 usage.rgpszUsageIdentifier[usage.cUsageIdentifier++] =
3588 (LPSTR)info->pszOID;
3589 }
3590 }
3591 }
3593 HeapFree(GetProcessHeap(), 0, usage.rgpszUsageIdentifier);
3594 }
3596 if (data->pfPropertiesChanged)
3597 *data->pfPropertiesChanged = TRUE;
3598}
#define IDC_DESCRIPTION
Definition: resource.h:129
#define IDC_ENABLE_SELECTED_PURPOSES
Definition: cryptuires.h:237
#define IDC_ENABLE_ALL_PURPOSES
Definition: cryptuires.h:235
#define IDC_FRIENDLY_NAME
Definition: cryptuires.h:233
#define IDC_DISABLE_ALL_PURPOSES
Definition: cryptuires.h:236
BOOL WINAPI CertSetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext, PCERT_ENHKEY_USAGE pUsage)
Definition: cert.c:2952
#define MAX_DESCRIPTION
Definition: main.c:3534
static void set_cert_string_property(PCCERT_CONTEXT cert, DWORD prop, LPWSTR str)
Definition: main.c:3509
static BOOL CALLBACK refresh_propsheet_pages(HWND hwnd, LPARAM lParam)
Definition: main.c:3526
if(dx< 0)
Definition: linetemp.h:194
#define LVM_GETITEMW
Definition: commctrl.h:2390
#define CERT_DESCRIPTION_PROP_ID
Definition: wincrypt.h:2699
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
HWND WINAPI GetParent(_In_ HWND)

Referenced by cert_properties_general_dlg_proc().

◆ cert_mgr_advanced_dlg_proc()

static LRESULT CALLBACK cert_mgr_advanced_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 722 of file main.c.

724{
725 switch (msg)
726 {
727 case WM_INITDIALOG:
728 {
729 RECT rc;
732 HIMAGELIST imageList;
733 LPSTR disabledUsages;
734
735 GetWindowRect(lv, &rc);
736 column.mask = LVCF_WIDTH;
737 column.cx = rc.right - rc.left;
739 imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 4, 0);
740 if (imageList)
741 {
742 HBITMAP bmp;
743 COLORREF backColor = RGB(255, 0, 255);
744
746 ImageList_AddMasked(imageList, bmp, backColor);
748 ImageList_SetBkColor(imageList, CLR_NONE);
751 }
753 if ((disabledUsages = get_cert_mgr_usages()))
754 {
755 LPSTR ptr, comma;
756
757 for (ptr = disabledUsages, comma = strchr(ptr, ','); ptr && *ptr;
758 ptr = comma ? comma + 1 : NULL,
759 comma = ptr ? strchr(ptr, ',') : NULL)
760 {
762
763 if (comma)
764 *comma = 0;
765 if ((index = find_oid_in_list(lv, ptr)) != -1)
767 }
768 HeapFree(GetProcessHeap(), 0, disabledUsages);
769 }
770 break;
771 }
772 case WM_NOTIFY:
773 {
774 NMHDR *hdr = (NMHDR *)lp;
775 NMITEMACTIVATE *nm;
776
777 switch (hdr->code)
778 {
779 case NM_CLICK:
780 nm = (NMITEMACTIVATE *)lp;
781 toggle_usage(hwnd, nm->iItem);
783 break;
784 }
785 break;
786 }
787 case WM_COMMAND:
788 switch (wp)
789 {
790 case IDOK:
792#ifndef __REACTOS__
794#endif
796 break;
797 case IDCANCEL:
798#ifndef __REACTOS__
800#endif
802 break;
803 }
804 break;
805 }
806 return 0;
807}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define index(s, c)
Definition: various.h:29
#define IDB_CHECKS
Definition: cryptuires.h:208
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2889
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static void toggle_usage(HWND hwnd, int iItem)
Definition: main.c:615
static LPSTR get_cert_mgr_usages(void)
Definition: main.c:179
static void add_known_usages_to_list(HWND lv, CheckBitmapIndex state)
Definition: main.c:601
static void save_cert_mgr_usages(HWND hwnd)
Definition: main.c:662
static LONG_PTR find_oid_in_list(HWND lv, LPCSTR oid)
Definition: main.c:637
#define RGB(r, g, b)
Definition: precomp.h:71
pKey DeleteObject()
GLuint index
Definition: glext.h:6031
char hdr[14]
Definition: iptest.cpp:33
BITMAP bmp
Definition: alphablend.c:62
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PSM_CHANGED
Definition: prsht.h:164
#define ILC_COLOR4
Definition: commctrl.h:354
#define CLR_NONE
Definition: commctrl.h:319
#define LVM_SETIMAGELIST
Definition: commctrl.h:2303
#define NM_CLICK
Definition: commctrl.h:130
#define ILC_MASK
Definition: commctrl.h:351
#define LVSIL_STATE
Definition: commctrl.h:2300
#define WM_NOTIFY
Definition: richedit.h:61
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2194

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_clear_cert_selection()

static void cert_mgr_clear_cert_selection ( HWND  hwnd)
static

Definition at line 809 of file main.c.

810{
815 (LPARAM)empty);
817}
#define IDC_MGR_EXPORT
Definition: cryptuires.h:260
#define IDC_MGR_VIEW
Definition: cryptuires.h:264
#define IDC_MGR_REMOVE
Definition: cryptuires.h:261
#define IDC_MGR_PURPOSES
Definition: cryptuires.h:263
static const WCHAR empty[]
Definition: main.c:47
static void refresh_store_certs(HWND hwnd)
Definition: main.c:570
#define WM_SETTEXT
Definition: winuser.h:1617
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)

Referenced by cert_mgr_dlg_proc(), and cert_mgr_do_remove().

◆ cert_mgr_current_store()

static HCERTSTORE cert_mgr_current_store ( HWND  hwnd)
static

Definition at line 555 of file main.c.

556{
558
559 return cert_mgr_index_to_store(tab, SendMessageW(tab, TCM_GETCURSEL, 0, 0));
560}
#define IDC_MGR_STORES
Definition: cryptuires.h:257
static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
Definition: main.c:546
#define TCM_GETCURSEL
Definition: commctrl.h:4062

Referenced by cert_mgr_dlg_proc(), and refresh_store_certs().

◆ cert_mgr_dlg_proc()

static LRESULT CALLBACK cert_mgr_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 1119 of file main.c.

1121{
1122 struct CertMgrData *data;
1123
1124 switch (msg)
1125 {
1126 case WM_INITDIALOG:
1127 {
1128 PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr =
1131
1132 data = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CertMgrData));
1133 if (!data)
1134 return 0;
1135 data->imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 2, 0);
1136 if (data->imageList)
1137 {
1138 HBITMAP bmp;
1139 COLORREF backColor = RGB(255, 0, 255);
1140
1142 ImageList_AddMasked(data->imageList, bmp, backColor);
1144 ImageList_SetBkColor(data->imageList, CLR_NONE);
1146 LVSIL_SMALL, (LPARAM)data->imageList);
1147 }
1149 data->title = pCryptUICertMgr->pwszTitle;
1150
1153 if (pCryptUICertMgr->pwszTitle)
1155 (LPARAM)pCryptUICertMgr->pwszTitle);
1156 show_cert_stores(hwnd, pCryptUICertMgr->dwFlags, data);
1158 break;
1159 }
1160#ifdef __REACTOS__
1161 case WM_DESTROY:
1166 break;
1167#endif
1168 case WM_NOTIFY:
1169 {
1170 NMHDR *hdr = (NMHDR *)lp;
1171
1172 switch (hdr->code)
1173 {
1174 case TCN_SELCHANGE:
1176 break;
1177 case LVN_ITEMCHANGED:
1178 {
1179 NMITEMACTIVATE *nm = (NMITEMACTIVATE*)lp;
1181 int numSelected = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1182
1183 EnableWindow(GetDlgItem(hwnd, IDC_MGR_EXPORT), numSelected > 0);
1184 EnableWindow(GetDlgItem(hwnd, IDC_MGR_REMOVE), numSelected > 0);
1185 EnableWindow(GetDlgItem(hwnd, IDC_MGR_VIEW), numSelected == 1);
1186 if (numSelected == 1)
1188 else
1190 (LPARAM)empty);
1191 break;
1192 }
1193 case NM_DBLCLK:
1194 show_selected_cert(hwnd, ((NMITEMACTIVATE *)lp)->iItem);
1195 break;
1196 case LVN_KEYDOWN:
1197 {
1198 NMLVKEYDOWN *lvk = (NMLVKEYDOWN *)lp;
1199
1200 if (lvk->wVKey == VK_DELETE)
1202 break;
1203 }
1204 case LVN_COLUMNCLICK:
1205 {
1206 NMLISTVIEW *nmlv = (NMLISTVIEW *)lp;
1208
1209 /* FIXME: doesn't support swapping sort order between ascending
1210 * and descending.
1211 */
1212 switch (nmlv->iSubItem)
1213 {
1214 case 0:
1217 break;
1218 case 1:
1221 break;
1222 case 2:
1225 break;
1226 case 3:
1229 break;
1230 }
1231 break;
1232 }
1233 }
1234 break;
1235 }
1236 case WM_COMMAND:
1237 switch (wp)
1238 {
1241 break;
1242 case IDC_MGR_IMPORT:
1243 if (CryptUIWizImport(0, hwnd, NULL, NULL,
1246 break;
1247 case IDC_MGR_ADVANCED:
1250 {
1252 int index, len;
1253 LPWSTR curString = NULL;
1254
1256 if (index >= 0)
1257 {
1259 curString = HeapAlloc(GetProcessHeap(), 0,
1260 (len + 1) * sizeof(WCHAR));
1261 SendMessageW(cb, CB_GETLBTEXT, index, (LPARAM)curString);
1262 }
1265 if (curString)
1266 {
1268 (LPARAM)curString);
1269 if (index >= 0)
1271 HeapFree(GetProcessHeap(), 0, curString);
1272 }
1274 }
1275 break;
1276 case IDC_MGR_VIEW:
1277 {
1281
1282 if (selection >= 0)
1284 break;
1285 }
1286 case IDC_MGR_EXPORT:
1288 break;
1289 case IDC_MGR_REMOVE:
1291 break;
1292 case IDCANCEL:
1293#ifndef __REACTOS__
1297 ImageList_Destroy(data->imageList);
1299#endif
1301 break;
1302 }
1303 break;
1304 }
1305 return 0;
1306}
const struct _CRYPTUI_CERT_MGR_STRUCT * PCCRYPTUI_CERT_MGR_STRUCT
Definition: cryptuiapi.h:59
#define IDC_MGR_ADVANCED
Definition: cryptuires.h:262
#define IDD_CERT_MGR_ADVANCED
Definition: cryptuires.h:195
#define IDC_MGR_PURPOSE_SELECTION
Definition: cryptuires.h:256
#define IDB_SMALL_ICONS
Definition: cryptuires.h:204
#define IDC_MGR_IMPORT
Definition: cryptuires.h:259
int selection
Definition: ctm.c:92
static void cert_mgr_clear_cert_selection(HWND hwnd)
Definition: main.c:809
BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore)
Definition: main.c:5557
static void initialize_purpose_selection(HWND hwnd)
Definition: main.c:220
static int CALLBACK cert_mgr_sort_by_issuer(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1100
static LRESULT CALLBACK cert_mgr_advanced_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: main.c:722
static int CALLBACK cert_mgr_sort_by_friendly_name(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1113
static void show_store_certs(HWND hwnd, HCERTSTORE store)
Definition: main.c:353
static void close_stores(HWND tab)
Definition: main.c:562
static HCERTSTORE cert_mgr_current_store(HWND hwnd)
Definition: main.c:555
static void cert_mgr_do_export(HWND hwnd)
Definition: main.c:1016
static void cert_mgr_do_remove(HWND hwnd)
Definition: main.c:970
static void show_selected_cert(HWND hwnd, int index)
Definition: main.c:833
static void cert_mgr_show_cert_usages(HWND hwnd, int index)
Definition: main.c:956
static int CALLBACK cert_mgr_sort_by_date(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1105
static void show_cert_stores(HWND hwnd, DWORD dwFlags, struct CertMgrData *data)
Definition: main.c:494
static void add_cert_columns(HWND hwnd)
Definition: main.c:75
static int CALLBACK cert_mgr_sort_by_subject(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1095
static void free_certs(HWND lv)
Definition: main.c:531
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define LVN_COLUMNCLICK
Definition: commctrl.h:3139
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define LVM_GETNEXTITEM
Definition: commctrl.h:2433
#define TCN_SELCHANGE
Definition: commctrl.h:4132
#define LVN_KEYDOWN
Definition: commctrl.h:3184
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2708
#define LVM_SORTITEMSEX
Definition: commctrl.h:2800
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
#define LVM_SORTITEMS
Definition: commctrl.h:2702
#define CB_GETLBTEXTLEN
Definition: winuser.h:1953
#define CB_GETLBTEXT
Definition: winuser.h:1952
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define CB_SETCURSEL
Definition: winuser.h:1961
#define CB_RESETCONTENT
Definition: winuser.h:1959
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1940
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define VK_DELETE
Definition: winuser.h:2233
#define WM_DESTROY
Definition: winuser.h:1609
#define CB_GETCURSEL
Definition: winuser.h:1943

Referenced by CryptUIDlgCertMgr().

◆ cert_mgr_do_export()

static void cert_mgr_do_export ( HWND  hwnd)
static

Definition at line 1016 of file main.c.

1017{
1019 int selectionCount = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1020
1021 if (selectionCount == 1)
1022 {
1025
1026 if (selection >= 0)
1027 {
1029
1030 if (cert)
1031 {
1033
1034 info.dwSize = sizeof(info);
1035 info.pwszExportFileName = NULL;
1036 info.dwSubjectChoice = CRYPTUI_WIZ_EXPORT_CERT_CONTEXT;
1037 info.u.pCertContext = cert;
1038 info.cStores = 0;
1040 }
1041 }
1042 }
1043 else if (selectionCount > 1)
1044 {
1047
1048 if (store)
1049 {
1051 int selection = -1;
1052
1053 info.dwSize = sizeof(info);
1054 info.pwszExportFileName = NULL;
1055 info.dwSubjectChoice =
1057 info.u.hCertStore = store;
1058 info.cStores = 0;
1059 do {
1062 if (selection >= 0)
1063 {
1065 selection);
1066
1069 }
1070 } while (selection >= 0);
1072 CertCloseStore(store, 0);
1073 }
1074 }
1075}
#define CRYPTUI_WIZ_EXPORT_CERT_CONTEXT
Definition: cryptuiapi.h:258
#define CRYPTUI_WIZ_EXPORT_CERT_STORE_CERTIFICATES_ONLY
Definition: cryptuiapi.h:262
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:286
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:819
BOOL WINAPI CryptUIWizExport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, void *pvoid)
Definition: main.c:6988
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_do_remove()

static void cert_mgr_do_remove ( HWND  hwnd)
static

Definition at line 970 of file main.c.

971{
973 TCM_GETCURSEL, 0, 0);
974 struct CertMgrData *data =
976
977 if (tabIndex < data->nStores)
978 {
981 LPCWSTR pTitle;
982 int warningID;
983
984 if (SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0) > 1)
985 warningID = data->stores[tabIndex].removePluralWarning;
986 else
987 warningID = data->stores[tabIndex].removeWarning;
988 if (data->title)
989 pTitle = data->title;
990 else
991 {
993 pTitle = title;
994 }
996 if (MessageBoxW(hwnd, warning, pTitle, MB_YESNO) == IDYES)
997 {
998 int selection = -1;
999
1000 do {
1003 if (selection >= 0)
1004 {
1006 selection);
1007
1009 }
1010 } while (selection >= 0);
1012 }
1013 }
1014}
#define IDS_CERT_MGR
Definition: cryptuires.h:118
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
Definition: store.c:943
#define warning(s)
Definition: debug.h:83
DWORD nStores
Definition: main.c:490
#define MB_YESNO
Definition: winuser.h:817
#define IDYES
Definition: winuser.h:835
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_index_to_cert()

static PCCERT_CONTEXT cert_mgr_index_to_cert ( HWND  hwnd,
int  index 
)
static

Definition at line 819 of file main.c.

820{
823
824 item.mask = LVIF_PARAM;
825 item.iItem = index;
826 item.iSubItem = 0;
828 (LPARAM)&item))
829 cert = (PCCERT_CONTEXT)item.lParam;
830 return cert;
831}
const CERT_CONTEXT * PCCERT_CONTEXT
Definition: wincrypt.h:485

Referenced by cert_mgr_do_export(), cert_mgr_do_remove(), cert_mgr_show_cert_usages(), and show_selected_cert().

◆ cert_mgr_index_to_store()

static HCERTSTORE cert_mgr_index_to_store ( HWND  tab,
int  index 
)
static

Definition at line 546 of file main.c.

547{
549
550 item.mask = TCIF_PARAM;
552 return (HCERTSTORE)item.lParam;
553}
#define TCIF_PARAM
Definition: commctrl.h:3974
#define TCM_GETITEMW
Definition: commctrl.h:4033

Referenced by cert_mgr_current_store(), cert_mgr_dlg_proc(), and close_stores().

◆ cert_mgr_show_cert_usages()

static void cert_mgr_show_cert_usages ( HWND  hwnd,
int  index 
)
static

Definition at line 956 of file main.c.

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_sort_by_date()

static int CALLBACK cert_mgr_sort_by_date ( LPARAM  lp1,
LPARAM  lp2,
LPARAM  lp 
)
static

Definition at line 1105 of file main.c.

1106{
1109 return CompareFileTime(&cert1->pCertInfo->NotAfter,
1110 &cert2->pCertInfo->NotAfter);
1111}
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
static const BYTE cert2[]
Definition: message.c:844
static const BYTE cert1[]
Definition: message.c:828

Referenced by cert_mgr_dlg_proc(), and select_cert_dlg_proc().

◆ cert_mgr_sort_by_friendly_name()

static int CALLBACK cert_mgr_sort_by_friendly_name ( LPARAM  lp1,
LPARAM  lp2,
LPARAM  lp 
)
static

Definition at line 1113 of file main.c.

1115{
1116 return cert_mgr_sort_by_text((HWND)lp, 3, lp1, lp2);
1117}
static int cert_mgr_sort_by_text(HWND lv, int col, int index1, int index2)
Definition: main.c:1077

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_sort_by_issuer()

static int CALLBACK cert_mgr_sort_by_issuer ( LPARAM  lp1,
LPARAM  lp2,
LPARAM  lp 
)
static

Definition at line 1100 of file main.c.

1101{
1102 return cert_mgr_sort_by_text((HWND)lp, 1, lp1, lp2);
1103}

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_sort_by_subject()

static int CALLBACK cert_mgr_sort_by_subject ( LPARAM  lp1,
LPARAM  lp2,
LPARAM  lp 
)
static

Definition at line 1095 of file main.c.

1096{
1097 return cert_mgr_sort_by_text((HWND)lp, 0, lp1, lp2);
1098}

Referenced by cert_mgr_dlg_proc(), and show_store_certs().

◆ cert_mgr_sort_by_text()

static int cert_mgr_sort_by_text ( HWND  lv,
int  col,
int  index1,
int  index2 
)
static

Definition at line 1077 of file main.c.

1078{
1079 LVITEMW item;
1080 WCHAR buf1[MAX_STRING_LEN];
1081 WCHAR buf2[MAX_STRING_LEN];
1082
1083 item.cchTextMax = ARRAY_SIZE(buf1);
1084 item.mask = LVIF_TEXT;
1085 item.pszText = buf1;
1086 item.iItem = index1;
1087 item.iSubItem = col;
1089 item.pszText = buf2;
1090 item.iItem = index2;
1092 return lstrcmpW(buf1, buf2);
1093}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242

Referenced by cert_mgr_sort_by_friendly_name(), cert_mgr_sort_by_issuer(), cert_mgr_sort_by_subject(), and select_cert_sort_by_text().

◆ cert_prop_sheet_proc()

static int CALLBACK cert_prop_sheet_proc ( HWND  hwnd,
UINT  msg,
LPARAM  lp 
)
static

Definition at line 4286 of file main.c.

4287{
4288 RECT rc;
4289
4290 TRACE("(%p, %08x, %08lx)\n", hwnd, msg, lp);
4291
4292 switch (msg)
4293 {
4294 case PSCB_INITIALIZED:
4295 /* Get cancel button's position.. */
4297 MapWindowPoints( 0, hwnd, (POINT *)&rc, 2 );
4298 /* hide the cancel button.. */
4300 /* and move the OK button to the cancel button's original position. */
4301 SetWindowPos(GetDlgItem(hwnd, IDOK), 0, rc.left, rc.top, 0, 0,
4303 break;
4304 }
4305 return 0;
4306}
#define PSCB_INITIALIZED
Definition: prsht.h:75
LONG top
Definition: windef.h:307
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define SWP_NOREDRAW
Definition: winuser.h:1246
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1245
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by show_cert_dialog().

◆ cert_properties_general_callback()

static UINT CALLBACK cert_properties_general_callback ( HWND  hwnd,
UINT  msg,
PROPSHEETPAGEW page 
)
static

Definition at line 3701 of file main.c.

3703{
3704 HWND lv;
3705 int cItem, i;
3706 struct edit_cert_data *data;
3707
3708 switch (msg)
3709 {
3710 case PSPCB_RELEASE:
3712 cItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
3713 for (i = 0; i < cItem; i++)
3714 {
3715 LVITEMW item;
3716
3717 item.mask = LVIF_PARAM;
3718 item.iItem = i;
3719 item.iSubItem = 0;
3720 if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item) && item.lParam)
3721 {
3723
3724 if (info->cbSize == sizeof(CRYPT_OID_INFO) && !info->dwGroupId)
3725 {
3726 HeapFree(GetProcessHeap(), 0, (LPSTR)info->pszOID);
3728 }
3729 }
3730 }
3732 if (data)
3733 {
3734#ifndef __REACTOS__
3735 ImageList_Destroy(data->imageList);
3736#endif
3738 }
3739 break;
3740 }
3741 return 1;
3742}
#define PSPCB_RELEASE
Definition: prsht.h:37
struct _CRYPT_OID_INFO * PCRYPT_OID_INFO

Referenced by show_edit_cert_properties_dialog().

◆ cert_properties_general_dlg_proc()

static LRESULT CALLBACK cert_properties_general_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 3600 of file main.c.

3602{
3604
3605 TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd, msg, wp, lp);
3606
3607 switch (msg)
3608 {
3609 case WM_INITDIALOG:
3610 {
3612 struct detail_data *detailData;
3613 struct edit_cert_data *editData;
3614
3615 page = (PROPSHEETPAGEW *)lp;
3616 detailData = (struct detail_data *)page->lParam;
3621 editData = HeapAlloc(GetProcessHeap(), 0,
3622 sizeof(struct edit_cert_data));
3623 if (editData)
3624 {
3625 editData->imageList = ImageList_Create(16, 16,
3626 ILC_COLOR4 | ILC_MASK, 4, 0);
3627 if (editData->imageList)
3628 {
3629 HBITMAP bmp;
3630 COLORREF backColor = RGB(255, 0, 255);
3631
3633 ImageList_AddMasked(editData->imageList, bmp, backColor);
3636 }
3637 editData->cert = detailData->pCertViewInfo->pCertContext;
3638 editData->pfPropertiesChanged = detailData->pfPropertiesChanged;
3641 }
3642 break;
3643 }
3644 case WM_NOTIFY:
3645 {
3646 NMHDR *hdr = (NMHDR *)lp;
3647 NMITEMACTIVATE *nm;
3648
3649 switch (hdr->code)
3650 {
3651 case NM_CLICK:
3652 nm = (NMITEMACTIVATE *)lp;
3653 toggle_usage(hwnd, nm->iItem);
3655 break;
3656 case PSN_APPLY:
3658 break;
3659 }
3660 break;
3661 }
3662 case WM_COMMAND:
3663 switch (HIWORD(wp))
3664 {
3665 case EN_CHANGE:
3667 if (LOWORD(wp) == IDC_DESCRIPTION)
3668 {
3669 /* Show/hide scroll bar on description depending on how much
3670 * text it has.
3671 */
3674
3676 }
3677 break;
3678 case BN_CLICKED:
3679 switch (LOWORD(wp))
3680 {
3681 case IDC_ADD_PURPOSE:
3686 break;
3692 break;
3693 }
3694 break;
3695 }
3696 break;
3697 }
3698 return 0;
3699}
#define IDD_ADD_CERT_PURPOSE
Definition: cryptuires.h:188
#define IDC_ADD_PURPOSE
Definition: cryptuires.h:239
#define MAX_FRIENDLY_NAME
Definition: main.c:3533
static LRESULT CALLBACK add_purpose_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: main.c:3227
static void select_purposes(HWND hwnd, PurposeSelection selection)
Definition: main.c:3384
static void set_general_cert_properties(HWND hwnd, struct edit_cert_data *data)
Definition: main.c:3489
static void apply_general_changes(HWND hwnd)
Definition: main.c:3536
#define PSN_APPLY
Definition: prsht.h:117
BOOL * pfPropertiesChanged
Definition: main.c:2749
PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo
Definition: main.c:2748
HIMAGELIST imageList
Definition: main.c:3407
BOOL * pfPropertiesChanged
Definition: main.c:3406
PCCERT_CONTEXT cert
Definition: main.c:3405
Definition: module.h:576
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by show_edit_cert_properties_dialog().

◆ check_context_type()

static BOOL check_context_type ( DWORD  dwFlags,
DWORD  type 
)
static

Definition at line 4655 of file main.c.

4656{
4657 BOOL ret;
4658
4659 if (dwFlags &
4662 {
4663 switch (type)
4664 {
4668 break;
4672 break;
4676 break;
4677 default:
4678 /* The remaining types contain more than one type, so allow
4679 * any combination.
4680 */
4681 ret = TRUE;
4682 }
4683 }
4684 else
4685 {
4686 /* No allowed types specified, so any type is allowed */
4687 ret = TRUE;
4688 }
4689 if (!ret)
4691 return ret;
4692}
#define CRYPTUI_WIZ_IMPORT_ALLOW_CRL
Definition: cryptuiapi.h:330
#define CRYPTUI_WIZ_IMPORT_ALLOW_CTL
Definition: cryptuiapi.h:331
#define CRYPTUI_WIZ_IMPORT_ALLOW_CERT
Definition: cryptuiapi.h:329
#define E_INVALIDARG
Definition: ddrawi.h:101
#define SetLastError(x)
Definition: compat.h:752
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define CERT_QUERY_CONTENT_SERIALIZED_CERT
Definition: wincrypt.h:3533
#define CERT_QUERY_CONTENT_CRL
Definition: wincrypt.h:3531
#define CERT_QUERY_CONTENT_CTL
Definition: wincrypt.h:3530
#define CERT_QUERY_CONTENT_SERIALIZED_CTL
Definition: wincrypt.h:3534
#define CERT_QUERY_CONTENT_SERIALIZED_CRL
Definition: wincrypt.h:3535
#define CERT_QUERY_CONTENT_CERT
Definition: wincrypt.h:3529

Referenced by do_import().

◆ check_store_context_type()

static BOOL check_store_context_type ( DWORD  dwFlags,
HCERTSTORE  store 
)
static

Definition at line 4720 of file main.c.

4721{
4722 BOOL ret;
4723
4724 if (dwFlags &
4727 {
4730 PCCTL_CONTEXT ctl;
4731
4732 ret = TRUE;
4733 if ((cert = CertEnumCertificatesInStore(store, NULL)))
4734 {
4737 ret = FALSE;
4738 }
4739 if (ret && (crl = CertEnumCRLsInStore(store, NULL)))
4740 {
4743 ret = FALSE;
4744 }
4745 if (ret && (ctl = CertEnumCTLsInStore(store, NULL)))
4746 {
4747 CertFreeCTLContext(ctl);
4749 ret = FALSE;
4750 }
4751 }
4752 else
4753 ret = TRUE;
4754 if (!ret)
4756 return ret;
4757}
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:371
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:386
BOOL WINAPI CertFreeCTLContext(PCCTL_CONTEXT pCTLContext)
Definition: ctl.c:499
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev)
Definition: ctl.c:200
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
Definition: store.c:1101
static const BYTE crl[]
Definition: message.c:864

Referenced by import_store(), and import_validate_filename().

◆ choose_store_for_cert()

static HCERTSTORE choose_store_for_cert ( PCCERT_CONTEXT  cert)
static

Definition at line 4560 of file main.c.

4561{
4562 LPCWSTR storeName;
4563
4564 if (is_ca_cert(cert, TRUE))
4565 storeName = ca;
4566 else
4567 storeName = addressBook;
4570}
static const WCHAR ca[]
Definition: main.c:455
static const WCHAR addressBook[]
Definition: main.c:453
static BOOL is_ca_cert(PCCERT_CONTEXT cert, BOOL defaultIfNotSpecified)
Definition: main.c:4522
#define CERT_STORE_PROV_SYSTEM_W
Definition: wincrypt.h:2259
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324

Referenced by import_cert().

◆ close_stores()

static void close_stores ( HWND  tab)
static

Definition at line 562 of file main.c.

563{
564 int i, tabs = SendMessageW(tab, TCM_GETITEMCOUNT, 0, 0);
565
566 for (i = 0; i < tabs; i++)
568}
#define TCM_GETITEMCOUNT
Definition: commctrl.h:3968

Referenced by cert_mgr_dlg_proc().

◆ convert_usages_str_to_usage()

static CERT_ENHKEY_USAGE * convert_usages_str_to_usage ( LPSTR  usageStr)
static

Definition at line 279 of file main.c.

280{
282 sizeof(CERT_ENHKEY_USAGE));
283
284 if (usage)
285 {
286 LPSTR ptr, comma;
287
288 for (ptr = usageStr, comma = strchr(ptr, ','); usage && ptr && *ptr;
289 ptr = comma ? comma + 1 : NULL,
290 comma = ptr ? strchr(ptr, ',') : NULL)
291 {
292 if (comma)
293 *comma = 0;
295 }
296 }
297 return usage;
298}
static CERT_ENHKEY_USAGE * add_oid_to_usage(CERT_ENHKEY_USAGE *usage, LPSTR oid)
Definition: main.c:260

Referenced by create_advanced_filter().

◆ create_advanced_filter()

static CERT_ENHKEY_USAGE * create_advanced_filter ( void  )
static

Definition at line 300 of file main.c.

301{
302 CERT_ENHKEY_USAGE *advancedUsage = HeapAlloc(GetProcessHeap(),
304
305 if (advancedUsage)
306 {
308
310 {
311 LPSTR disabledUsagesStr;
312
313 if ((disabledUsagesStr = get_cert_mgr_usages()))
314 {
315 CERT_ENHKEY_USAGE *disabledUsages =
316 convert_usages_str_to_usage(disabledUsagesStr);
317
318 if (disabledUsages)
319 {
321
322 for (ptr = usages; advancedUsage && *ptr; ptr++)
323 {
324 DWORD i;
325 BOOL disabled = FALSE;
326
327 for (i = 0; !disabled &&
328 i < disabledUsages->cUsageIdentifier; i++)
329 if (!strcmp(disabledUsages->rgpszUsageIdentifier[i],
330 (*ptr)->pszOID))
331 disabled = TRUE;
332 if (!disabled)
333 advancedUsage = add_oid_to_usage(advancedUsage,
334 (LPSTR)(*ptr)->pszOID);
335 }
336 /* The individual strings are pointers to disabledUsagesStr,
337 * so they're freed when it is.
338 */
340 disabledUsages->rgpszUsageIdentifier);
341 HeapFree(GetProcessHeap(), 0, disabledUsages);
342 }
343 HeapFree(GetProcessHeap(), 0, disabledUsagesStr);
344 }
346 }
347 }
348 return advancedUsage;
349}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static CERT_ENHKEY_USAGE * convert_usages_str_to_usage(LPSTR usageStr)
Definition: main.c:279
DWORD cUsageIdentifier
Definition: wincrypt.h:719
LPSTR * rgpszUsageIdentifier
Definition: wincrypt.h:720

Referenced by show_store_certs().

◆ create_cert_details_list()

static void create_cert_details_list ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 3143 of file main.c.

3144{
3148}
static void create_show_list(HWND hwnd, struct detail_data *data)
Definition: main.c:3097
static void set_fields_selection(HWND hwnd, struct detail_data *data, int sel)
Definition: main.c:3132
static void create_listview_columns(HWND hwnd)
Definition: main.c:3114

Referenced by detail_dlg_proc().

◆ create_listview_columns()

static void create_listview_columns ( HWND  hwnd)
static

Definition at line 3114 of file main.c.

3115{
3117 RECT rc;
3120
3122 GetWindowRect(lv, &rc);
3124 column.mask = LVCF_WIDTH | LVCF_TEXT;
3125 column.cx = (rc.right - rc.left) / 2 - 2;
3126 column.pszText = buf;
3130}
#define IDS_FIELD
Definition: cryptuires.h:43
#define IDC_DETAIL_LIST
Definition: cryptuires.h:220
#define IDS_VALUE
Definition: resource.h:26

Referenced by create_cert_details_list().

◆ create_show_list()

static void create_show_list ( HWND  hwnd,
struct detail_data data 
)
static

Definition at line 3097 of file main.c.

3098{
3101 int i;
3102
3103 for (i = 0; i < ARRAY_SIZE(listItems); i++)
3104 {
3105 int index;
3106
3110 }
3112}
#define IDC_DETAIL_SELECT
Definition: cryptuires.h:219
static const struct selection_list_item listItems[]
Definition: main.c:3089
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define CB_INSERTSTRING
Definition: winuser.h:1957

Referenced by create_cert_details_list().

◆ crypt_format_extension()

static WCHAR * crypt_format_extension ( const CERT_EXTENSION ext,
DWORD  formatStrType 
)
static

Definition at line 2858 of file main.c.

2859{
2860 WCHAR *str = NULL;
2861 DWORD size;
2862
2863 if (CryptFormatObject(X509_ASN_ENCODING, 0, formatStrType, NULL,
2864 ext->pszObjId, ext->Value.pbData, ext->Value.cbData, NULL, &size))
2865 {
2867 CryptFormatObject(X509_ASN_ENCODING, 0, formatStrType, NULL,
2868 ext->pszObjId, ext->Value.pbData, ext->Value.cbData, str, &size);
2869 }
2870 return str;
2871}
BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, DWORD *pcbFormat)
Definition: object.c:2549
GLsizeiptr size
Definition: glext.h:5919
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297

Referenced by add_cert_extension_detail(), field_format_detailed_extension(), and format_enhanced_key_usage_value().

◆ CryptUIDlgCertMgr()

BOOL WINAPI CryptUIDlgCertMgr ( PCCRYPTUI_CERT_MGR_STRUCT  pCryptUICertMgr)

Definition at line 1311 of file main.c.

1312{
1313 TRACE("(%p)\n", pCryptUICertMgr);
1314
1315 if (pCryptUICertMgr->dwSize != sizeof(CRYPTUI_CERT_MGR_STRUCT))
1316 {
1317 WARN("unexpected size %d\n", pCryptUICertMgr->dwSize);
1319 return FALSE;
1320 }
1322 pCryptUICertMgr->hwndParent, cert_mgr_dlg_proc, (LPARAM)pCryptUICertMgr);
1323 return TRUE;
1324}
#define WARN(fmt,...)
Definition: debug.h:115
#define IDD_CERT_MGR
Definition: cryptuires.h:194
static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: main.c:1119

Referenced by display_cert_manager(), and OpenPersonalTrustDBDialog().

◆ CryptUIDlgSelectCertificateA()

PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateA ( PCCRYPTUI_SELECTCERTIFICATE_STRUCTA  pcsc)

Definition at line 7537 of file main.c.

7538{
7541 LPWSTR title = NULL, display_str = NULL;
7542 PROPSHEETPAGEW *pages = NULL;
7543
7544 TRACE("%p\n", pcsc);
7545
7546 if (pcsc->dwSize != sizeof(*pcsc) && pcsc->dwSize != sizeof(*pcsc) - sizeof(HCERTSTORE))
7547 {
7548 WARN("unexpected size %d\n", pcsc->dwSize);
7550 return NULL;
7551 }
7552 memcpy(&selCertInfo, pcsc, pcsc->dwSize);
7553 if (pcsc->szTitle)
7554 {
7555 if (!(title = strdupAtoW( pcsc->szTitle ))) goto error;
7556 selCertInfo.szTitle = title;
7557 }
7558 if (pcsc->szDisplayString)
7559 {
7560 if (!(display_str = strdupAtoW( pcsc->szDisplayString ))) goto error;
7561 selCertInfo.szDisplayString = display_str;
7562 }
7563 if (pcsc->cPropSheetPages)
7564 {
7566 if (!pages)
7567 goto error;
7568 selCertInfo.rgPropSheetPages = pages;
7569 }
7570 cert = CryptUIDlgSelectCertificateW(&selCertInfo);
7571error:
7573 HeapFree(GetProcessHeap(), 0, display_str);
7574 if (pcsc->cPropSheetPages)
7576 return cert;
7577}
PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateW(PCCRYPTUI_SELECTCERTIFICATE_STRUCTW pcsc)
Definition: main.c:7438
static void free_prop_sheet_pages(PROPSHEETPAGEW *pages, DWORD num)
Definition: main.c:7459
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
static PROPSHEETPAGEW * prop_sheet_pages_AtoW(LPCPROPSHEETPAGEA pages, DWORD num)
Definition: main.c:7480
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCPROPSHEETPAGEA rgPropSheetPages
Definition: cryptuiapi.h:363
LPCPROPSHEETPAGEW rgPropSheetPages
Definition: cryptuiapi.h:385

◆ CryptUIDlgSelectCertificateFromStore()

PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateFromStore ( HCERTSTORE  hCertStore,
HWND  hwnd,
LPCWSTR  pwszTitle,
LPCWSTR  pwszDisplayString,
DWORD  dwDontUseColumn,
DWORD  dwFlags,
void pvReserved 
)

Definition at line 7579 of file main.c.

7582{
7584
7585 TRACE("%p %p %s %s %x %x %p\n", hCertStore, hwnd, debugstr_w(pwszTitle), debugstr_w(pwszDisplayString), dwDontUseColumn, dwFlags, pvReserved);
7586
7587 memset(&sc, 0, sizeof(sc));
7588
7589 sc.dwSize = sizeof(sc);
7590 sc.hwndParent = hwnd;
7591 sc.dwFlags = dwFlags;
7592 sc.szTitle = pwszTitle;
7593 sc.szDisplayString = pwszDisplayString;
7594 sc.dwDontUseColumn = dwDontUseColumn;
7595 sc.cDisplayStores = 1;
7596 sc.rghDisplayStores = &hCertStore;
7597 return CryptUIDlgSelectCertificateW(&sc);
7598}
#define debugstr_w
Definition: kernel32.h:32
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
#define memset(x, y, z)
Definition: compat.h:39

◆ CryptUIDlgSelectCertificateW()

PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificateW ( PCCRYPTUI_SELECTCERTIFICATE_STRUCTW  pcsc)

Definition at line 7438 of file main.c.

7439{
7440 struct SelectCertParam param;
7441
7442 TRACE("%p\n", pcsc);
7443
7444 if (pcsc->dwSize != sizeof(*pcsc) && pcsc->dwSize != sizeof(*pcsc) - sizeof(HCERTSTORE))
7445 {
7446 WARN("unexpected size %d\n", pcsc->dwSize);
7448 return NULL;
7449 }
7451 FIXME("ignoring CRYPTUI_SELECTCERT_MULTISELECT\n");
7452 param.pcsc = pcsc;
7453 param.cert = NULL;