ReactOS  0.4.14-dev-114-gc8cbd56
main.c File Reference
#include "config.h"
#include <stdarg.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 "wine/unicode.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 23 of file main.c.

◆ CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE

#define CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE   0x00000001

Definition at line 1333 of file main.c.

◆ MAX_DESCRIPTION

#define MAX_DESCRIPTION   255

Definition at line 3522 of file main.c.

◆ MAX_FRIENDLY_NAME

#define MAX_FRIENDLY_NAME   40

Definition at line 3521 of file main.c.

◆ MAX_PURPOSE

#define MAX_PURPOSE   255

Definition at line 3213 of file main.c.

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   512

Definition at line 75 of file main.c.

◆ MY_INDENT

#define MY_INDENT   200

Definition at line 1877 of file main.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 24 of file main.c.

◆ WM_REFRESH_VIEW

#define WM_REFRESH_VIEW   WM_USER + 0

Definition at line 3512 of file main.c.

Typedef Documentation

◆ add_fields_func

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

Definition at line 2742 of file main.c.

◆ create_detailed_value_func

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

Definition at line 2744 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 2583 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 1329 of file main.c.

◆ prop_to_value_func

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

Definition at line 2991 of file main.c.

Enumeration Type Documentation

◆ CheckBitmapIndex

Enumerator
CheckBitmapIndexUnchecked 
CheckBitmapIndexChecked 
CheckBitmapIndexDisabledUnchecked 
CheckBitmapIndexDisabledChecked 

Definition at line 581 of file main.c.

◆ PurposeFilter

Enumerator
PurposeFilterShowAll 
PurposeFilterShowAdvanced 
PurposeFilterShowOID 

Definition at line 216 of file main.c.

◆ PurposeSelection

Enumerator
PurposeEnableAll 
PurposeDisableAll 
PurposeEnableSelected 

Definition at line 3366 of file main.c.

Function Documentation

◆ add_all_extensions()

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

Definition at line 2971 of file main.c.

2972 {
2973  DWORD i;
2974  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2975 
2976  for (i = 0; i < cert->pCertInfo->cExtension; i++)
2977  add_cert_extension_detail(hwnd, data, &cert->pCertInfo->rgExtension[i]);
2978 }
static void add_cert_extension_detail(HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
Definition: main.c:2942
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by add_all_fields().

◆ add_all_fields()

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

Definition at line 3064 of file main.c.

3065 {
3069 }
static void add_all_extensions(HWND hwnd, struct detail_data *data)
Definition: main.c:2971
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void add_properties(HWND hwnd, struct detail_data *data)
Definition: main.c:3023
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static void add_v1_fields(HWND hwnd, struct detail_data *data)
Definition: main.c:2832

◆ add_cert_columns()

static void add_cert_columns ( HWND  hwnd)
static

Definition at line 77 of file main.c.

78 {
80  RECT rc;
83 
85  GetWindowRect(lv, &rc);
87  column.mask = LVCF_WIDTH | LVCF_TEXT;
88  column.cx = (rc.right - rc.left) * 29 / 100 - 2;
89  column.pszText = buf;
93  column.cx = (rc.right - rc.left) * 16 / 100 - 2;
96  column.cx = (rc.right - rc.left) * 23 / 100 - 1;
99 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVCF_TEXT
Definition: commctrl.h:2560
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2706
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define IDS_ISSUER_COLUMN
Definition: cryptuires.h:101
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2604
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
#define IDS_SUBJECT_COLUMN
Definition: cryptuires.h:100
#define IDS_EXPIRATION_COLUMN
Definition: cryptuires.h:102
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_FRIENDLY_NAME_COLUMN
Definition: cryptuires.h:103
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2696
HINSTANCE hInstance
Definition: main.c:36
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAX_STRING_LEN
Definition: main.c:75
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664

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 2942 of file main.c.

2944 {
2946  ext->pszObjId, 0);
2948 
2949  if (oidInfo)
2952  else
2953  {
2954  DWORD len = strlen(ext->pszObjId);
2955  LPWSTR oidW = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
2956 
2957  if (oidW)
2958  {
2959  DWORD i;
2960 
2961  for (i = 0; i <= len; i++)
2962  oidW[i] = ext->pszObjId[i];
2965  HeapFree(GetProcessHeap(), 0, oidW);
2966  }
2967  }
2968  HeapFree(GetProcessHeap(), 0, val);
2969 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static WCHAR * crypt_format_extension(const CERT_EXTENSION *ext, DWORD formatStrType)
Definition: main.c:2846
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static struct list oidInfo
Definition: oid.c:1206
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
char ext[3]
Definition: mkdosfs.c:358
GLuint GLfloat * val
Definition: glext.h:7180
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static WCHAR * field_format_detailed_extension(PCCERT_CONTEXT cert, void *param)
Definition: main.c:2931
GLenum GLsizei len
Definition: glext.h:6722
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702
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:2771
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1799
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

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 1780 of file main.c.

1782 {
1784 
1785  if (name)
1786  {
1787  /* Don't include NULL-terminator in output */
1788  DWORD len = lstrlenW(name);
1789 
1791  HeapFree(GetProcessHeap(), 0, name);
1792  }
1793 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:407
#define GetProcessHeap()
Definition: compat.h:395
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721
Definition: name.c:36
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR get_cert_name_string(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags)
Definition: main.c:1764
#define HeapFree(x, y, z)
Definition: compat.h:394
_In_ PCCERT_CONTEXT pCertContext
Definition: wincrypt.h:4840

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 7045 of file main.c.

7047 {
7048  DWORD len;
7049  LVITEMW item;
7050  WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
7051  WCHAR buf[80];
7052  SYSTEMTIME sysTime;
7053  LPWSTR none, usages;
7054 
7055  item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT;
7056  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
7057  item.iSubItem = 0;
7058  item.iImage = 0;
7060  if (!item.iItem)
7061  {
7062  item.mask |= LVIF_STATE;
7063  item.state = LVIS_SELECTED;
7064  item.stateMask = -1;
7065  }
7067  {
7069  if (len > *allocatedLen)
7070  {
7071  HeapFree(GetProcessHeap(), 0, *str);
7072  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7073  if (*str)
7074  *allocatedLen = len;
7075  }
7076  if (*str)
7077  {
7079  item.pszText = *str;
7081  }
7082  item.mask = LVIF_TEXT;
7083  ++item.iSubItem;
7084  }
7086  {
7088  NULL, 0);
7089  if (len > *allocatedLen)
7090  {
7091  HeapFree(GetProcessHeap(), 0, *str);
7092  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7093  if (*str)
7094  *allocatedLen = len;
7095  }
7096  if (*str)
7097  {
7099  *str, len);
7100  item.pszText = *str;
7101  if (!item.iSubItem)
7103  else
7104  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7105  }
7106  item.mask = LVIF_TEXT;
7107  ++item.iSubItem;
7108  }
7110  {
7112  if (usages)
7113  {
7114  item.pszText = usages;
7115  if (!item.iSubItem)
7117  else
7118  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7120  }
7121  item.mask = LVIF_TEXT;
7122  ++item.iSubItem;
7123  }
7125  {
7128  if (len > *allocatedLen)
7129  {
7130  HeapFree(GetProcessHeap(), 0, *str);
7131  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7132  if (*str)
7133  *allocatedLen = len;
7134  }
7135  if (*str)
7136  {
7138  item.pszText = none;
7139  else
7140  item.pszText = *str;
7141  if (!item.iSubItem)
7143  else
7144  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7145  }
7146  item.mask = LVIF_TEXT;
7147  ++item.iSubItem;
7148  }
7150  {
7152  FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
7153  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, buf, ARRAY_SIZE(buf));
7154  item.pszText = buf;
7155  if (!item.iSubItem)
7157  else
7158  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7159  item.mask = LVIF_TEXT;
7160  ++item.iSubItem;
7161  }
7163  {
7164  static int show_fixme;
7165  if (!show_fixme++)
7166  FIXME("showing location is not implemented\n");
7168  if (!item.iSubItem)
7170  else
7171  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7172  }
7173 }
#define CRYPTUI_SELECT_LOCATION_COLUMN
Definition: cryptuiapi.h:39
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CERT_NAME_ISSUER_FLAG
Definition: wincrypt.h:3506
#define CERT_NAME_SIMPLE_DISPLAY_TYPE
Definition: wincrypt.h:3500
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define LVIF_TEXT
Definition: commctrl.h:2281
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:551
#define CRYPTUI_SELECT_INTENDEDUSE_COLUMN
Definition: cryptuiapi.h:37
#define IDS_FRIENDLY_NAME_NONE
Definition: cryptuires.h:119
#define FIXME(fmt,...)
Definition: debug.h:110
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2291
#define CRYPTUI_SELECT_ISSUEDBY_COLUMN
Definition: cryptuiapi.h:36
#define CRYPTUI_SELECT_FRIENDLYNAME_COLUMN
Definition: cryptuiapi.h:38
LONG_PTR LPARAM
Definition: windef.h:208
static BYTE cert[]
Definition: msg.c:1437
#define CERT_FRIENDLY_NAME_PROP_ID
Definition: wincrypt.h:2697
#define IDS_NO_IMPL
Definition: cryptuires.h:181
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LVIF_IMAGE
Definition: commctrl.h:2282
#define LOCALE_SYSTEM_DEFAULT
unsigned long DWORD
Definition: ntddk_ex.h:95
HINSTANCE hInstance
Definition: main.c:36
GLbitfield flags
Definition: glext.h:7161
#define LOCALE_SSHORTDATE
Definition: winnls.h:60
GLenum GLsizei len
Definition: glext.h:6722
#define CRYPTUI_SELECT_EXPIRATION_COLUMN
Definition: cryptuiapi.h:40
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2659
static ATOM item
Definition: dde.c:856
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CRYPTUI_SELECT_ISSUEDTO_COLUMN
Definition: cryptuiapi.h:35
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:360
static void get_cert_usages(PCCERT_CONTEXT cert, LPWSTR *str)
Definition: main.c:848
#define LVIF_PARAM
Definition: commctrl.h:2283
DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString)
Definition: str.c:1228
static PCCRYPT_OID_INFO ** usages
Definition: softpub.c:81
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2284
#define HeapFree(x, y, z)
Definition: compat.h:394

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 101 of file main.c.

103 {
104  DWORD len;
105  LVITEMW item;
106  WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
107  WCHAR date[80];
108  SYSTEMTIME sysTime;
109  LPWSTR none;
110 
111  item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT;
112  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
113  item.iSubItem = 0;
114  item.iImage = 0;
117  NULL, 0);
118  if (len > *allocatedLen)
119  {
120  HeapFree(GetProcessHeap(), 0, *str);
121  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
122  if (*str)
123  *allocatedLen = len;
124  }
125  if (*str)
126  {
128  *str, len);
129  item.pszText = *str;
131  }
132 
133  item.mask = LVIF_TEXT;
136  if (len > *allocatedLen)
137  {
138  HeapFree(GetProcessHeap(), 0, *str);
139  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
140  if (*str)
141  *allocatedLen = len;
142  }
143  if (*str)
144  {
147  item.pszText = *str;
148  item.iSubItem = 1;
150  }
151 
153  FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
154  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
155  item.pszText = date;
156  item.iSubItem = 2;
158 
160  NULL, &len))
162  if (len > *allocatedLen)
163  {
164  HeapFree(GetProcessHeap(), 0, *str);
165  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
166  if (*str)
167  *allocatedLen = len;
168  }
169  if (*str)
170  {
172  *str, &len))
173  item.pszText = none;
174  else
175  item.pszText = *str;
176  item.iSubItem = 3;
178  }
179 }
#define CERT_NAME_ISSUER_FLAG
Definition: wincrypt.h:3506
#define CERT_NAME_SIMPLE_DISPLAY_TYPE
Definition: wincrypt.h:3500
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define LVIF_TEXT
Definition: commctrl.h:2281
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:551
#define IDS_FRIENDLY_NAME_NONE
Definition: cryptuires.h:119
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static BYTE cert[]
Definition: msg.c:1437
#define CERT_FRIENDLY_NAME_PROP_ID
Definition: wincrypt.h:2697
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LVIF_IMAGE
Definition: commctrl.h:2282
#define LOCALE_SYSTEM_DEFAULT
unsigned long DWORD
Definition: ntddk_ex.h:95
HINSTANCE hInstance
Definition: main.c:36
#define LOCALE_SSHORTDATE
Definition: winnls.h:60
GLenum GLsizei len
Definition: glext.h:6722
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2659
static ATOM item
Definition: dde.c:856
#define ARRAY_SIZE(a)
Definition: main.h:24
__u16 date
Definition: mkdosfs.c:366
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:360
#define LVIF_PARAM
Definition: commctrl.h:2283
DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString)
Definition: str.c:1228
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by show_store_certs().

◆ add_critical_extensions()

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

Definition at line 2980 of file main.c.

2981 {
2982  DWORD i;
2983  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2984 
2985  for (i = 0; i < cert->pCertInfo->cExtension; i++)
2986  if (cert->pCertInfo->rgExtension[i].fCritical)
2988  &cert->pCertInfo->rgExtension[i]);
2989 }
static void add_cert_extension_detail(HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
Definition: main.c:2942
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ add_date_string_to_control()

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

Definition at line 2397 of file main.c.

2398 {
2399  WCHAR dateFmt[80]; /* sufficient for all versions of LOCALE_SSHORTDATE */
2400  WCHAR date[80];
2401  SYSTEMTIME sysTime;
2402 
2404  FileTimeToSystemTime(fileTime, &sysTime);
2405  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
2407 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:407
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
SYSTEMTIME fileTime
Definition: main.cpp:57
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LOCALE_SYSTEM_DEFAULT
#define LOCALE_SSHORTDATE
Definition: winnls.h:60
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
#define ARRAY_SIZE(a)
Definition: main.h:24
__u16 date
Definition: mkdosfs.c:366
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721

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 2771 of file main.c.

2773 {
2774  LVITEMW item;
2775  int iItem = SendMessageW(hwnd, LVM_GETITEMCOUNT, 0, 0);
2776 
2777  item.mask = LVIF_TEXT | LVIF_PARAM;
2778  item.iItem = iItem;
2779  item.iSubItem = 0;
2780  item.pszText = field;
2781  item.lParam = (LPARAM)data;
2783  if (value)
2784  {
2785  item.pszText = value;
2786  item.iSubItem = 1;
2788  }
2790 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
LONG_PTR LPARAM
Definition: windef.h:208
static void add_field_value_data(struct detail_data *data, create_detailed_value_func create, void *param)
Definition: main.c:2753
Definition: parser.c:43
GLfloat param
Definition: glext.h:5796
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei const GLfloat * value
Definition: glext.h:6069
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2659
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVIF_PARAM
Definition: commctrl.h:2283
static const struct access_res create[16]
Definition: package.c:7720

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 2753 of file main.c.

2755 {
2756  if (data->cFields)
2757  data->fields = HeapReAlloc(GetProcessHeap(), 0, data->fields,
2758  (data->cFields + 1) * sizeof(struct field_value_data));
2759  else
2760  data->fields = HeapAlloc(GetProcessHeap(), 0,
2761  sizeof(struct field_value_data));
2762  if (data->fields)
2763  {
2764  data->fields[data->cFields].create = create;
2765  data->fields[data->cFields].detailed_value = NULL;
2766  data->fields[data->cFields].param = param;
2767  data->cFields++;
2768  }
2769 }
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLfloat param
Definition: glext.h:5796
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define HeapReAlloc
Definition: compat.h:393
static const struct access_res create[16]
Definition: package.c:7720

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 1795 of file main.c.

1796 {
1797  HRESULT hr;
1798  IRichEditOle *richEditOle = NULL;
1799  IOleObject *object = NULL;
1800  CLSID clsid;
1801  LPOLECACHE oleCache = NULL;
1802  FORMATETC formatEtc;
1803  DWORD conn;
1804  IDataObject *dataObject = NULL;
1805  HBITMAP bitmap = NULL;
1806  STGMEDIUM stgm;
1807  IOleClientSite *clientSite = NULL;
1808  REOBJECT reObject;
1809 
1810  TRACE("(%p, %d)\n", hwnd, id);
1811 
1812  SendMessageW(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&richEditOle);
1813  if (!richEditOle)
1814  goto end;
1816  (void**)&object);
1817  if (FAILED(hr))
1818  goto end;
1819  hr = IOleObject_GetUserClassID(object, &clsid);
1820  if (FAILED(hr))
1821  goto end;
1822  hr = IOleObject_QueryInterface(object, &IID_IOleCache, (void**)&oleCache);
1823  if (FAILED(hr))
1824  goto end;
1825  formatEtc.cfFormat = CF_BITMAP;
1826  formatEtc.ptd = NULL;
1827  formatEtc.dwAspect = DVASPECT_CONTENT;
1828  formatEtc.lindex = -1;
1829  formatEtc.tymed = TYMED_GDI;
1830  hr = IOleCache_Cache(oleCache, &formatEtc, 0, &conn);
1831  if (FAILED(hr))
1832  goto end;
1833  hr = IOleObject_QueryInterface(object, &IID_IDataObject,
1834  (void**)&dataObject);
1835  if (FAILED(hr))
1836  goto end;
1837  hr = IRichEditOle_GetClientSite(richEditOle, &clientSite);
1838  if (FAILED(hr))
1839  goto end;
1842  if (!bitmap)
1843  goto end;
1844  stgm.tymed = TYMED_GDI;
1845  stgm.u.hBitmap = bitmap;
1846  stgm.pUnkForRelease = NULL;
1847  hr = IDataObject_SetData(dataObject, &formatEtc, &stgm, TRUE);
1848  if (FAILED(hr))
1849  goto end;
1850 
1851  reObject.cbStruct = sizeof(reObject);
1852  reObject.cp = REO_CP_SELECTION;
1853  reObject.clsid = clsid;
1854  reObject.poleobj = object;
1855  reObject.pstg = NULL;
1856  reObject.polesite = clientSite;
1857  reObject.sizel.cx = reObject.sizel.cy = 0;
1858  reObject.dvaspect = DVASPECT_CONTENT;
1859  reObject.dwFlags = 0;
1860  reObject.dwUser = 0;
1861 
1862  IRichEditOle_InsertObject(richEditOle, &reObject);
1863 
1864 end:
1865  if (clientSite)
1866  IOleClientSite_Release(clientSite);
1867  if (dataObject)
1868  IDataObject_Release(dataObject);
1869  if (oleCache)
1870  IOleCache_Release(oleCache);
1871  if (object)
1872  IOleObject_Release(object);
1873  if (richEditOle)
1874  IRichEditOle_Release(richEditOle);
1875 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
RECO_DRAG struct _reobject REOBJECT
#define EM_GETOLEINTERFACE
Definition: richedit.h:93
const GUID IID_IDataObject
GLuint GLuint end
Definition: gl.h:1545
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define CF_BITMAP
Definition: constants.h:397
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
const GUID IID_IOleObject
Definition: uimain.c:88
#define TRACE(s)
Definition: solgame.cpp:4
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define CLSID_NULL
Definition: guiddef.h:99
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HINSTANCE hInstance
Definition: main.c:36
REFCLSID clsid
Definition: msctf.c:84
#define LR_LOADTRANSPARENT
Definition: winuser.h:1083
HRESULT WINAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMAGE_BITMAP
Definition: winuser.h:211
static HBITMAP bitmap
Definition: clipboard.c:1344
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
void * object
Definition: jmemsys.h:48
const GUID IID_IOleCache

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 588 of file main.c.

590 {
591  LVITEMW item;
592 
593  item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
595  item.stateMask = LVIS_STATEIMAGEMASK;
596  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
597  item.iSubItem = 0;
598  item.lParam = (LPARAM)info;
599  item.pszText = (LPWSTR)info->pwszName;
601 }
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
LONG_PTR LPARAM
Definition: windef.h:208
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2298
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2300
static int state
Definition: maze.c:121
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVIF_PARAM
Definition: commctrl.h:2283
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2284

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 603 of file main.c.

604 {
606 
608  {
610 
611  for (ptr = usages; *ptr; ptr++)
612  add_known_usage(lv, *ptr, state);
614  }
615 }
BOOL WINAPI WTHelperGetKnownUsages(DWORD action, PCCRYPT_OID_INFO **usages)
static PVOID ptr
Definition: dispmode.c:27
static int state
Definition: maze.c:121
static void add_known_usage(HWND lv, PCCRYPT_OID_INFO info, CheckBitmapIndex state)
Definition: main.c:588
static PCCRYPT_OID_INFO ** usages
Definition: softpub.c:81

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 1979 of file main.c.

1980 {
1981  struct OIDToString *entry;
1982  WCHAR nl = '\n';
1983  PARAFORMAT2 parFmt;
1984 
1985  parFmt.cbSize = sizeof(parFmt);
1986  parFmt.dwMask = PFM_STARTINDENT;
1987  parFmt.dxStartIndent = MY_INDENT * 3;
1988  if ((entry = findSupportedOID(oid)))
1989  {
1990  WCHAR *str, *linebreak, *ptr;
1991  BOOL multiline = FALSE;
1992  int len;
1993 
1994  len = LoadStringW(hInstance, entry->id, (LPWSTR)&str, 0);
1995  ptr = str;
1996  do {
1997  if ((linebreak = memchrW(ptr, '\n', len)))
1998  {
2000 
2001  multiline = TRUE;
2002  /* The source string contains a newline, which the richedit
2003  * control won't find since it's interpreted as a paragraph
2004  * break. Therefore copy up to the newline. lstrcpynW always
2005  * NULL-terminates, so pass one more than the length of the
2006  * source line so the copy includes the entire line and the
2007  * NULL-terminator.
2008  */
2009  lstrcpynW(copy, ptr, linebreak - ptr + 1);
2011  linebreak - ptr, &parFmt);
2012  ptr = linebreak + 1;
2014  }
2015  else if (multiline && *ptr)
2016  {
2017  /* Add the last line */
2019  len - (ptr - str), &parFmt);
2021  }
2022  } while (linebreak);
2023  if (!multiline)
2024  {
2027  }
2028  }
2029  else
2030  {
2031  WCHAR *oidW = HeapAlloc(GetProcessHeap(), 0,
2032  (strlen(oid) + 1) * sizeof(WCHAR));
2033 
2034  if (oidW)
2035  {
2036  LPCSTR src;
2037  WCHAR *dst;
2038 
2039  for (src = oid, dst = oidW; *src; src++, dst++)
2040  *dst = *src;
2041  *dst = 0;
2043  &parFmt);
2045  HeapFree(GetProcessHeap(), 0, oidW);
2046  }
2047  }
2048 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static struct OIDToString * findSupportedOID(LPCSTR oid)
Definition: main.c:1962
const WCHAR * text
Definition: package.c:1827
#define lstrlenW
Definition: compat.h:407
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define lstrcpynW
Definition: compat.h:397
unsigned int BOOL
Definition: ntddk_ex.h:94
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
LONG dxStartIndent
Definition: richedit.h:670
#define PFM_STARTINDENT
Definition: richedit.h:838
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD dwMask
Definition: richedit.h:667
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MY_INDENT
Definition: main.c:1877
HINSTANCE hInstance
Definition: main.c:36
uint32_t entry
Definition: isohybrid.c:63
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
#define MAX_STRING_LEN
Definition: main.c:75
GLenum GLenum dst
Definition: glext.h:6340
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1747
UINT cbSize
Definition: richedit.h:666
WCHAR * LPWSTR
Definition: xmlstorage.h:184
WINE_UNICODE_INLINE WCHAR * memchrW(const WCHAR *ptr, WCHAR ch, size_t n)
Definition: unicode.h:295
#define HeapFree(x, y, z)
Definition: compat.h:394
LPCSTR oid
Definition: main.c:1898

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 1879 of file main.c.

1880 {
1881  WCHAR nl = '\n';
1883  PARAFORMAT2 parFmt;
1884 
1885  parFmt.cbSize = sizeof(parFmt);
1886  parFmt.dwMask = PFM_STARTINDENT;
1887  parFmt.dxStartIndent = MY_INDENT * 3;
1888  if (oidInfo)
1889  {
1891  lstrlenW(oidInfo->pwszName), &parFmt);
1893  }
1894 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:407
static struct list oidInfo
Definition: oid.c:1206
LONG dxStartIndent
Definition: richedit.h:670
#define PFM_STARTINDENT
Definition: richedit.h:838
DWORD dwMask
Definition: richedit.h:667
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MY_INDENT
Definition: main.c:1877
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1747
UINT cbSize
Definition: richedit.h:666
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1799
LPCSTR oid
Definition: main.c:1898

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 262 of file main.c.

263 {
264  if (!usage->cUsageIdentifier)
265  usage->rgpszUsageIdentifier = HeapAlloc(GetProcessHeap(), 0,
266  sizeof(LPSTR));
267  else
268  usage->rgpszUsageIdentifier = HeapReAlloc(GetProcessHeap(), 0,
269  usage->rgpszUsageIdentifier,
270  (usage->cUsageIdentifier + 1) * sizeof(LPSTR));
271  if (usage->rgpszUsageIdentifier)
272  usage->rgpszUsageIdentifier[usage->cUsageIdentifier++] = oid;
273  else
274  {
276  usage = NULL;
277  }
278  return usage;
279 }
int usage(char *argv0)
Definition: main.c:44
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define HeapReAlloc
Definition: compat.h:393
#define HeapFree(x, y, z)
Definition: compat.h:394
LPCSTR oid
Definition: main.c:1898

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 3023 of file main.c.

3024 {
3025  DWORD i;
3026  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
3027 
3028  for (i = 0; i < ARRAY_SIZE(prop_id_map); i++)
3029  {
3030  DWORD cb;
3031 
3033  &cb))
3034  {
3035  BYTE *pb;
3036  WCHAR *val = NULL;
3037 
3038  /* FIXME: MS adds a separate value for the signature hash
3039  * algorithm.
3040  */
3041  pb = HeapAlloc(GetProcessHeap(), 0, cb);
3042  if (pb)
3043  {
3045  prop_id_map[i].prop, pb, &cb))
3046  {
3047  if (prop_id_map[i].prop_is_string)
3048  {
3049  val = (LPWSTR)pb;
3050  /* Don't double-free pb */
3051  pb = NULL;
3052  }
3053  else
3054  val = prop_id_map[i].prop_to_value(pb, cb);
3055  }
3056  HeapFree(GetProcessHeap(), 0, pb);
3057  }
3059  NULL, NULL);
3060  }
3061  }
3062 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
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
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:551
smooth NULL
Definition: ftsmooth.c:416
static BYTE cert[]
Definition: msg.c:1437
GLuint GLfloat * val
Definition: glext.h:7180
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char BYTE
Definition: mem.h:68
#define ARRAY_SIZE(a)
Definition: main.h:24
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:2792
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
static const struct prop_id_to_string_id prop_id_map[]
Definition: main.c:3015

Referenced by add_all_fields().

◆ add_purpose()

static void add_purpose ( HWND  hwnd,
LPCSTR  oid 
)
static

Definition at line 3138 of file main.c.

3139 {
3142  sizeof(CRYPT_OID_INFO));
3143 
3144  if (info)
3145  {
3146  char *oidCopy = HeapAlloc(GetProcessHeap(), 0, strlen(oid) + 1);
3147 
3148  if (oidCopy)
3149  {
3150  LVITEMA item;
3151 
3152  strcpy(oidCopy, oid);
3153  info->cbSize = sizeof(CRYPT_OID_INFO);
3154  info->pszOID = oidCopy;
3155  item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
3157  item.stateMask = LVIS_STATEIMAGEMASK;
3158  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
3159  item.iSubItem = 0;
3160  item.lParam = (LPARAM)info;
3161  item.pszText = oidCopy;
3163  }
3164  else
3165  HeapFree(GetProcessHeap(), 0, info);
3166  }
3167 }
struct _CRYPT_OID_INFO CRYPT_OID_INFO
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVM_INSERTITEMA
Definition: commctrl.h:2375
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
LONG_PTR LPARAM
Definition: windef.h:208
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2298
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2300
#define IDC_CERTIFICATE_USAGES
Definition: cryptuires.h:238
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define LVIF_PARAM
Definition: commctrl.h:2283
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define LVIF_STATE
Definition: commctrl.h:2284
#define HeapFree(x, y, z)
Definition: compat.h:394
LPCSTR oid
Definition: main.c:1898

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 3215 of file main.c.

3217 {
3218  LRESULT ret = 0;
3219  char buf[MAX_PURPOSE + 1];
3220 
3221  switch (msg)
3222  {
3223  case WM_INITDIALOG:
3225  MAX_PURPOSE, 0);
3228  break;
3229  case WM_COMMAND:
3230  switch (HIWORD(wp))
3231  {
3232  case EN_CHANGE:
3233  if (LOWORD(wp) == IDC_NEW_PURPOSE)
3234  {
3235  /* Show/hide scroll bar on description depending on how much
3236  * text it has.
3237  */
3240 
3242  }
3243  break;
3244  case BN_CLICKED:
3245  switch (LOWORD(wp))
3246  {
3247  case IDOK:
3249  (LPARAM)buf);
3250  if (!buf[0])
3251  {
3252  /* An empty purpose is the same as cancelling */
3254  ret = TRUE;
3255  }
3256  else if (!is_valid_oid(buf))
3257  {
3259 
3263  }
3264  else if (is_oid_in_list(
3266  {
3268 
3270  ARRAY_SIZE(error));
3273  }
3274  else
3275  {
3277 
3279  EndDialog(hwnd, wp);
3280  ret = TRUE;
3281  }
3282  break;
3283  case IDCANCEL:
3284  EndDialog(hwnd, wp);
3285  ret = TRUE;
3286  break;
3287  }
3288  break;
3289  }
3290  break;
3291  }
3292  return ret;
3293 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define error(str)
Definition: mkdosfs.c:1605
#define SB_VERT
Definition: winuser.h:553
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
#define WM_GETTEXT
Definition: winuser.h:1600
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
HANDLE HWND
Definition: compat.h:13
#define GetWindowLongPtrW
Definition: winuser.h:4730
const char * description
Definition: directx.c:2497
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define MAX_PURPOSE
Definition: main.c:3213
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CERTIFICATE_PURPOSE_EXISTS
Definition: cryptuires.h:64
eMaj lines
Definition: tritemp.h:206
#define IDC_NEW_PURPOSE
Definition: cryptuires.h:241
r parent
Definition: btrfs.c:2897
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define BN_CLICKED
Definition: winuser.h:1907
HINSTANCE hInstance
Definition: main.c:36
#define IDS_CERTIFICATE_PROPERTIES
Definition: cryptuires.h:62
int ret
#define IDS_CERTIFICATE_PURPOSE_ERROR
Definition: cryptuires.h:63
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
#define WM_COMMAND
Definition: winuser.h:1722
static void add_purpose(HWND hwnd, LPCSTR oid)
Definition: main.c:3138
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAX_STRING_LEN
Definition: main.c:75
#define MB_OK
Definition: winuser.h:784
#define msg(x)
Definition: auth_time.c:54
#define HIWORD(l)
Definition: typedefs.h:246
static BOOL is_valid_oid(LPCSTR oid)
Definition: main.c:3169
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_INITDIALOG
Definition: winuser.h:1721
static char title[]
Definition: ps.c:92
#define LOWORD(l)
Definition: pedump.c:82
static BOOL is_oid_in_list(HWND hwnd, LPCSTR oid)
Definition: main.c:3207
#define EM_GETLINECOUNT
Definition: winuser.h:1974
#define EN_CHANGE
Definition: winuser.h:2004

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 7175 of file main.c.

7177 {
7179  BOOL select = FALSE;
7180  DWORD allocatedLen = 0;
7181  LPWSTR str = NULL;
7182 
7183  do {
7185  if (cert && (!filter || filter(cert, &select, callback_data)))
7186  add_cert_to_list(lv, cert, flags, &allocatedLen, &str);
7187  } while (cert);
7188  HeapFree(GetProcessHeap(), 0, str);
7189 }
LPCWSTR filter
Definition: main.c:4911
static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *allocatedLen, LPWSTR *str)
Definition: main.c:7045
unsigned int BOOL
Definition: ntddk_ex.h:94
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
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static BYTE cert[]
Definition: msg.c:1437
#define GetProcessHeap()
Definition: compat.h:395
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
Definition: store.c:928
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
#define HeapFree(x, y, z)
Definition: compat.h:394

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 2792 of file main.c.

2794 {
2796 
2799 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLfloat param
Definition: glext.h:5796
HINSTANCE hInstance
Definition: main.c:36
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MAX_STRING_LEN
Definition: main.c:75
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:2771
static const struct access_res create[16]
Definition: package.c:7720

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 1738 of file main.c.

1739 {
1740  LPWSTR str;
1741  LONG len;
1742 
1743  len = LoadStringW(hInstance, id, (LPWSTR)&str, 0);
1745 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
long LONG
Definition: pedump.c:60
const WCHAR * str
HINSTANCE hInstance
Definition: main.c:36
GLenum GLsizei len
Definition: glext.h:6722
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

Definition at line 1754 of file main.c.

1756 {
1757  LPWSTR str;
1758  LONG len;
1759 
1760  len = LoadStringW(hInstance, id, (LPWSTR)&str, 0);
1762 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
long LONG
Definition: pedump.c:60
const WCHAR * str
HINSTANCE hInstance
Definition: main.c:36
GLenum GLsizei len
Definition: glext.h:6722
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1747
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: dsound.c:943

Referenced by display_app_usages(), display_cert_usages(), set_cert_info(), set_cert_name_string(), set_cert_validity_period(), and set_policy_text().

◆ add_text_with_paraformat_to_control()

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

Definition at line 1747 of file main.c.

1749 {
1752 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const WCHAR * text
Definition: package.c:1827
#define EM_SETPARAFORMAT
Definition: richedit.h:104
LONG_PTR LPARAM
Definition: windef.h:208
GLenum GLsizei len
Definition: glext.h:6722
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void add_unformatted_text_to_control(HWND hwnd, LPCWSTR text, LONG len)
Definition: main.c:1721
Definition: dsound.c:943

Referenced by add_local_oid_text_to_control(), add_oid_text_to_control(), and add_string_resource_with_paraformat_to_control().

◆ add_unformatted_text_to_control()

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

Definition at line 1721 of file main.c.

1722 {
1723  struct ReadStringStruct string;
1724  EDITSTREAM editstream;
1725 
1726  TRACE("(%p, %s)\n", hwnd, debugstr_wn(text, len));
1727 
1728  string.buf = text;
1729  string.pos = 0;
1730  string.len = len;
1731  editstream.dwCookie = (DWORD_PTR)&string;
1732  editstream.dwError = 0;
1733  editstream.pfnCallback = read_text_callback;
1735  (LPARAM)&editstream);
1736 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define DWORD_PTR
Definition: treelist.c:76
const WCHAR * text
Definition: package.c:1827
#define SFF_SELECTION
Definition: richedit.h:979
LONG_PTR LPARAM
Definition: windef.h:208
#define EM_STREAMIN
Definition: richedit.h:106
#define SF_TEXT
Definition: richedit.h:720
#define TRACE(s)
Definition: solgame.cpp:4
static DWORD CALLBACK read_text_callback(DWORD_PTR dwCookie, LPBYTE buf, LONG cb, LONG *pcb)
Definition: main.c:1707
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_wn
Definition: kernel32.h:33
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SF_UNICODE
Definition: richedit.h:724

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 2808 of file main.c.

2810 {
2811  WCHAR *val = field->format(data->pCertViewInfo->pCertContext);
2812 
2813  if (val)
2814  {
2816  field->create_detailed_value, NULL);
2817  HeapFree(GetProcessHeap(), 0, val);
2818  }
2819 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
#define GetProcessHeap()
Definition: compat.h:395
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: parser.c:43
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
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:2792
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by add_v1_fields().

◆ add_v1_fields()

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

Definition at line 2832 of file main.c.

2833 {
2834  unsigned int i;
2835  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2836 
2837  /* The last item in v1_fields is the public key, which is not in the loop
2838  * because it's a special case.
2839  */
2840  for (i = 0; i < ARRAY_SIZE(v1_fields) - 1; i++)
2842  if (cert->pCertInfo->SubjectPublicKeyInfo.PublicKey.cbData)
2844 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void add_v1_field(HWND hwnd, struct detail_data *data, const struct v1_field *field)
Definition: main.c:2808
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
static const struct v1_field v1_fields[]
Definition: main.c:2821
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by add_all_fields().

◆ apply_general_changes()

static void apply_general_changes ( HWND  hwnd)
static

Definition at line 3524 of file main.c.

3525 {
3526  WCHAR buf[MAX_DESCRIPTION + 1];
3527  struct edit_cert_data *data =
3529 
3535  {
3536  /* Setting a NULL usage removes the enhanced key usage property. */
3538  }
3540  {
3541  CERT_ENHKEY_USAGE usage = { 0, NULL };
3542 
3544  }
3546  {
3548  CERT_ENHKEY_USAGE usage = { 0, NULL };
3549  int purposes = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0), i;
3550  LVITEMW item;
3551 
3552  item.mask = LVIF_STATE | LVIF_PARAM;
3553  item.iSubItem = 0;
3554  item.stateMask = LVIS_STATEIMAGEMASK;
3555  for (i = 0; i < purposes; i++)
3556  {
3557  item.iItem = i;
3558  if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item))
3559  {
3560  int state = item.state >> 12;
3561 
3563  {
3564  CRYPT_OID_INFO *info = (CRYPT_OID_INFO *)item.lParam;
3565 
3566  if (usage.cUsageIdentifier)
3567  usage.rgpszUsageIdentifier =
3569  usage.rgpszUsageIdentifier,
3570  (usage.cUsageIdentifier + 1) * sizeof(LPSTR));
3571  else
3572  usage.rgpszUsageIdentifier =
3573  HeapAlloc(GetProcessHeap(), 0, sizeof(LPSTR));
3574  if (usage.rgpszUsageIdentifier)
3575  usage.rgpszUsageIdentifier[usage.cUsageIdentifier++] =
3576  (LPSTR)info->pszOID;
3577  }
3578  }
3579  }
3581  HeapFree(GetProcessHeap(), 0, usage.rgpszUsageIdentifier);
3582  }
3584  if (data->pfPropertiesChanged)
3585  *data->pfPropertiesChanged = TRUE;
3586 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_ENABLE_ALL_PURPOSES
Definition: cryptuires.h:235
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void set_cert_string_property(PCCERT_CONTEXT cert, DWORD prop, LPWSTR str)
Definition: main.c:3497
#define WM_GETTEXT
Definition: winuser.h:1600
#define GetWindowLongPtrW
Definition: winuser.h:4730
char * LPSTR
Definition: xmlstorage.h:182
#define IDC_ENABLE_SELECTED_PURPOSES
Definition: cryptuires.h:237
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
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CERT_FRIENDLY_NAME_PROP_ID
Definition: wincrypt.h:2697
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2298
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI CertSetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext, PCERT_ENHKEY_USAGE pUsage)
Definition: cert.c:2952
if(!(yy_init))
Definition: macro.lex.yy.c:714
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_DESCRIPTION
Definition: resource.h:131
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define IDC_DISABLE_ALL_PURPOSES
Definition: cryptuires.h:236
#define DWLP_USER
Definition: winuser.h:866
#define IDC_CERTIFICATE_USAGES
Definition: cryptuires.h:238
static int state
Definition: maze.c:121
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define MAX_DESCRIPTION
Definition: main.c:3522
HWND WINAPI GetParent(_In_ HWND)
static ATOM item
Definition: dde.c:856
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HeapReAlloc
Definition: compat.h:393
#define IDC_FRIENDLY_NAME
Definition: cryptuires.h:233
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define LVIF_PARAM
Definition: commctrl.h:2283
#define CERT_DESCRIPTION_PROP_ID
Definition: wincrypt.h:2699
#define LVIF_STATE
Definition: commctrl.h:2284
static BOOL CALLBACK refresh_propsheet_pages(HWND hwnd, LPARAM lParam)
Definition: main.c:3514
#define HeapFree(x, y, z)
Definition: compat.h:394

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 724 of file main.c.

726 {
727  switch (msg)
728  {
729  case WM_INITDIALOG:
730  {
731  RECT rc;
735  LPSTR disabledUsages;
736 
737  GetWindowRect(lv, &rc);
738  column.mask = LVCF_WIDTH;
739  column.cx = rc.right - rc.left;
741  imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 4, 0);
742  if (imageList)
743  {
744  HBITMAP bmp;
745  COLORREF backColor = RGB(255, 0, 255);
746 
748  ImageList_AddMasked(imageList, bmp, backColor);
749  DeleteObject(bmp);
753  }
755  if ((disabledUsages = get_cert_mgr_usages()))
756  {
757  LPSTR ptr, comma;
758 
759  for (ptr = disabledUsages, comma = strchr(ptr, ','); ptr && *ptr;
760  ptr = comma ? comma + 1 : NULL,
761  comma = ptr ? strchr(ptr, ',') : NULL)
762  {
763  LONG_PTR index;
764 
765  if (comma)
766  *comma = 0;
767  if ((index = find_oid_in_list(lv, ptr)) != -1)
769  }
770  HeapFree(GetProcessHeap(), 0, disabledUsages);
771  }
772  break;
773  }
774  case WM_NOTIFY:
775  {
776  NMHDR *hdr = (NMHDR *)lp;
777  NMITEMACTIVATE *nm;
778 
779  switch (hdr->code)
780  {
781  case NM_CLICK:
782  nm = (NMITEMACTIVATE *)lp;
783  toggle_usage(hwnd, nm->iItem);
785  break;
786  }
787  break;
788  }
789  case WM_COMMAND:
790  switch (wp)
791  {
792  case IDOK:
795  EndDialog(hwnd, IDOK);
796  break;
797  case IDCANCEL:
800  break;
801  }
802  break;
803  }
804  return 0;
805 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDOK
Definition: winuser.h:824
char hdr[14]
Definition: iptest.cpp:33
#define LVSIL_STATE
Definition: commctrl.h:2272
#define LVCF_WIDTH
Definition: commctrl.h:2559
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2889
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4730
LONG left
Definition: windef.h:291
char * LPSTR
Definition: xmlstorage.h:182
LONG right
Definition: windef.h:293
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static void save_cert_mgr_usages(HWND hwnd)
Definition: main.c:664
#define ILC_COLOR4
Definition: commctrl.h:339
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2604
static LPSTR get_cert_mgr_usages(void)
Definition: main.c:181
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CLR_NONE
Definition: commctrl.h:304
GLuint index
Definition: glext.h:6031
static void toggle_usage(HWND hwnd, int iItem)
Definition: main.c:617
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD COLORREF
Definition: windef.h:285
#define RGB(r, g, b)
Definition: wingdi.h:2935
#define IDB_CHECKS
Definition: cryptuires.h:208
HINSTANCE hInstance
Definition: main.c:36
BITMAP bmp
Definition: alphablend.c:62
#define index(s, c)
Definition: various.h:29
#define DWLP_USER
Definition: winuser.h:866
#define IDC_CERTIFICATE_USAGES
Definition: cryptuires.h:238
#define ILC_MASK
Definition: commctrl.h:336
#define WM_COMMAND
Definition: winuser.h:1722
static LONG_PTR find_oid_in_list(HWND lv, LPCSTR oid)
Definition: main.c:639
#define NM_CLICK
Definition: commctrl.h:130
static void add_known_usages_to_list(HWND lv, CheckBitmapIndex state)
Definition: main.c:603
#define LVM_SETIMAGELIST
Definition: commctrl.h:2275
HWND WINAPI GetParent(_In_ HWND)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PSM_CHANGED
Definition: prsht.h:164
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
#define SetWindowLongPtrW
Definition: winuser.h:5247
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
HIMAGELIST imageList
Definition: main.c:3395

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_clear_cert_selection()

static void cert_mgr_clear_cert_selection ( HWND  hwnd)
static

Definition at line 807 of file main.c.

808 {
813  (LPARAM)empty);
815 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_MGR_EXPORT
Definition: cryptuires.h:260
static const WCHAR empty[]
Definition: main.c:49
#define IDC_MGR_REMOVE
Definition: cryptuires.h:261
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_MGR_PURPOSES
Definition: cryptuires.h:263
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
static void refresh_store_certs(HWND hwnd)
Definition: main.c:572
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_MGR_VIEW
Definition: cryptuires.h:264

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 557 of file main.c.

558 {
560 
561  return cert_mgr_index_to_store(tab, SendMessageW(tab, TCM_GETCURSEL, 0, 0));
562 }
#define TCM_GETCURSEL
Definition: commctrl.h:4034
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
Definition: main.c:548
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_MGR_STORES
Definition: cryptuires.h:257

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 1117 of file main.c.

1119 {
1120  struct CertMgrData *data;
1121 
1122  switch (msg)
1123  {
1124  case WM_INITDIALOG:
1125  {
1126  PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr =
1129 
1130  data = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CertMgrData));
1131  if (!data)
1132  return 0;
1133  data->imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 2, 0);
1134  if (data->imageList)
1135  {
1136  HBITMAP bmp;
1137  COLORREF backColor = RGB(255, 0, 255);
1138 
1140  ImageList_AddMasked(data->imageList, bmp, backColor);
1141  DeleteObject(bmp);
1142  ImageList_SetBkColor(data->imageList, CLR_NONE);
1144  LVSIL_SMALL, (LPARAM)data->imageList);
1145  }
1147  data->title = pCryptUICertMgr->pwszTitle;
1148 
1151  if (pCryptUICertMgr->pwszTitle)
1153  (LPARAM)pCryptUICertMgr->pwszTitle);
1154  show_cert_stores(hwnd, pCryptUICertMgr->dwFlags, data);
1156  break;
1157  }
1158  case WM_NOTIFY:
1159  {
1160  NMHDR *hdr = (NMHDR *)lp;
1161 
1162  switch (hdr->code)
1163  {
1164  case TCN_SELCHANGE:
1166  break;
1167  case LVN_ITEMCHANGED:
1168  {
1169  NMITEMACTIVATE *nm = (NMITEMACTIVATE*)lp;
1171  int numSelected = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1172 
1173  EnableWindow(GetDlgItem(hwnd, IDC_MGR_EXPORT), numSelected > 0);
1174  EnableWindow(GetDlgItem(hwnd, IDC_MGR_REMOVE), numSelected > 0);
1175  EnableWindow(GetDlgItem(hwnd, IDC_MGR_VIEW), numSelected == 1);
1176  if (numSelected == 1)
1178  else
1180  (LPARAM)empty);
1181  break;
1182  }
1183  case NM_DBLCLK:
1184  show_selected_cert(hwnd, ((NMITEMACTIVATE *)lp)->iItem);
1185  break;
1186  case LVN_KEYDOWN:
1187  {
1188  NMLVKEYDOWN *lvk = (NMLVKEYDOWN *)lp;
1189 
1190  if (lvk->wVKey == VK_DELETE)
1192  break;
1193  }
1194  case LVN_COLUMNCLICK:
1195  {
1196  NMLISTVIEW *nmlv = (NMLISTVIEW *)lp;
1198 
1199  /* FIXME: doesn't support swapping sort order between ascending
1200  * and descending.
1201  */
1202  switch (nmlv->iSubItem)
1203  {
1204  case 0:
1207  break;
1208  case 1:
1211  break;
1212  case 2:
1213  SendMessageW(lv, LVM_SORTITEMS, 0,
1215  break;
1216  case 3:
1219  break;
1220  }
1221  break;
1222  }
1223  }
1224  break;
1225  }
1226  case WM_COMMAND:
1227  switch (wp)
1228  {
1229  case ((CBN_SELCHANGE << 16) | IDC_MGR_PURPOSE_SELECTION):
1231  break;
1232  case IDC_MGR_IMPORT:
1233  if (CryptUIWizImport(0, hwnd, NULL, NULL,
1236  break;
1237  case IDC_MGR_ADVANCED:
1240  {
1242  int index, len;
1243  LPWSTR curString = NULL;
1244 
1245  index = SendMessageW(cb, CB_GETCURSEL, 0, 0);
1246  if (index >= 0)
1247  {
1249  curString = HeapAlloc(GetProcessHeap(), 0,
1250  (len + 1) * sizeof(WCHAR));
1251  SendMessageW(cb, CB_GETLBTEXT, index, (LPARAM)curString);
1252  }
1255  if (curString)
1256  {
1258  (LPARAM)curString);
1259  if (index >= 0)
1261  HeapFree(GetProcessHeap(), 0, curString);
1262  }
1264  }
1265  break;
1266  case IDC_MGR_VIEW:
1267  {
1269  int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1,
1270  LVNI_SELECTED);
1271 
1272  if (selection >= 0)
1274  break;
1275  }
1276  case IDC_MGR_EXPORT:
1278  break;
1279  case IDC_MGR_REMOVE:
1281  break;
1282  case IDCANCEL:
1286  ImageList_Destroy(data->imageList);
1287  HeapFree(GetProcessHeap(), 0, data);
1289  break;
1290  }
1291  break;
1292  }
1293  return 0;
1294 }
#define IDC_MGR_IMPORT
Definition: cryptuires.h:259
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETLBTEXTLEN
Definition: winuser.h:1935
static void cert_mgr_clear_cert_selection(HWND hwnd)
Definition: main.c:807
#define IDOK
Definition: winuser.h:824
char hdr[14]
Definition: iptest.cpp:33
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2680
#define LVSIL_SMALL
Definition: commctrl.h:2271
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2889
static int CALLBACK cert_mgr_sort_by_subject(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1093
#define IDC_MGR_EXPORT
Definition: cryptuires.h:260
#define CB_GETLBTEXT
Definition: winuser.h:1934
static const WCHAR empty[]
Definition: main.c:49
#define IDD_CERT_MGR_ADVANCED
Definition: cryptuires.h:195
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
static void cert_mgr_do_remove(HWND hwnd)
Definition: main.c:968
static void cert_mgr_do_export(HWND hwnd)
Definition: main.c:1014
static void add_cert_columns(HWND hwnd)
Definition: main.c:77
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define LVM_SORTITEMS
Definition: commctrl.h:2674
#define LVNI_SELECTED
Definition: commctrl.h:2396
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4730
static int CALLBACK cert_mgr_sort_by_date(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1103
#define CB_GETCURSEL
Definition: winuser.h:1925
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
int selection
Definition: ctm.c:92
#define ILC_COLOR4
Definition: commctrl.h:339
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
static void show_selected_cert(HWND hwnd, int index)
Definition: main.c:831
#define IDC_MGR_PURPOSE_SELECTION
Definition: cryptuires.h:256
#define LVN_KEYDOWN
Definition: commctrl.h:3156
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define IDC_MGR_REMOVE
Definition: cryptuires.h:261
#define LVM_SORTITEMSEX
Definition: commctrl.h:2772
static LRESULT CALLBACK cert_mgr_advanced_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: main.c:724
smooth NULL
Definition: ftsmooth.c:416
static void cert_mgr_show_cert_usages(HWND hwnd, int index)
Definition: main.c:954
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
const struct _CRYPTUI_CERT_MGR_STRUCT * PCCRYPTUI_CERT_MGR_STRUCT
Definition: cryptuiapi.h:59
#define CLR_NONE
Definition: commctrl.h:304
GLuint index
Definition: glext.h:6031
#define WM_SETTEXT
Definition: winuser.h:1599
#define CB_RESETCONTENT
Definition: winuser.h:1941
#define VK_DELETE
Definition: winuser.h:2208
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4300
static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
Definition: main.c:548
#define TCN_SELCHANGE
Definition: commctrl.h:4104
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD COLORREF
Definition: windef.h:285
static void close_stores(HWND tab)
Definition: main.c:564
#define RGB(r, g, b)
Definition: wingdi.h:2935
#define IDC_MGR_PURPOSES
Definition: cryptuires.h:263
static void free_certs(HWND lv)
Definition: main.c:533
static HCERTSTORE cert_mgr_current_store(HWND hwnd)
Definition: main.c:557
HINSTANCE hInstance
Definition: main.c:36
static DWORD cb
Definition: integrity.c:41
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BITMAP bmp
Definition: alphablend.c:62
#define index(s, c)
Definition: various.h:29
#define DWLP_USER
Definition: winuser.h:866
#define ILC_MASK
Definition: commctrl.h:336
GLenum GLsizei len
Definition: glext.h:6722
#define IDC_MGR_ADVANCED
Definition: cryptuires.h:262
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LVM_SETIMAGELIST
Definition: commctrl.h:2275
#define NM_DBLCLK
Definition: commctrl.h:131
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
static void refresh_store_certs(HWND hwnd)
Definition: main.c:572
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int CALLBACK cert_mgr_sort_by_issuer(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1098
#define LVN_COLUMNCLICK
Definition: commctrl.h:3111
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore)
Definition: main.c:5538
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
#define SetWindowLongPtrW
Definition: winuser.h:5247
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
#define IDC_MGR_STORES
Definition: cryptuires.h:257
#define WM_INITDIALOG
Definition: winuser.h:1721
static void initialize_purpose_selection(HWND hwnd)
Definition: main.c:222
static void show_cert_stores(HWND hwnd, DWORD dwFlags, struct CertMgrData *data)
Definition: main.c:496
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
#define IDB_SMALL_ICONS
Definition: cryptuires.h:204
static void show_store_certs(HWND hwnd, HCERTSTORE store)
Definition: main.c:355
static int CALLBACK cert_mgr_sort_by_friendly_name(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1111
#define IDC_MGR_VIEW
Definition: cryptuires.h:264
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by CryptUIDlgCertMgr().

◆ cert_mgr_do_export()

static void cert_mgr_do_export ( HWND  hwnd)
static

Definition at line 1014 of file main.c.

1015 {
1017  int selectionCount = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1018 
1019  if (selectionCount == 1)
1020  {
1021  int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1,
1022  LVNI_SELECTED);
1023 
1024  if (selection >= 0)
1025  {
1027 
1028  if (cert)
1029  {
1031 
1032  info.dwSize = sizeof(info);
1033  info.pwszExportFileName = NULL;
1034  info.dwSubjectChoice = CRYPTUI_WIZ_EXPORT_CERT_CONTEXT;
1035  info.u.pCertContext = cert;
1036  info.cStores = 0;
1038  }
1039  }
1040  }
1041  else if (selectionCount > 1)
1042  {
1045 
1046  if (store)
1047  {
1049  int selection = -1;
1050 
1051  info.dwSize = sizeof(info);
1052  info.pwszExportFileName = NULL;
1053  info.dwSubjectChoice =
1055  info.u.hCertStore = store;
1056  info.cStores = 0;
1057  do {
1059  LVNI_SELECTED);
1060  if (selection >= 0)
1061  {
1063  selection);
1064 
1067  }
1068  } while (selection >= 0);
1070  CertCloseStore(store, 0);
1071  }
1072  }
1073 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2680
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:286
#define LVNI_SELECTED
Definition: commctrl.h:2396
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:817
int selection
Definition: ctm.c:92
struct _test_info info[]
Definition: SetCursorPos.c:19
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
static BYTE cert[]
Definition: msg.c:1437
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI CryptUIWizExport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, void *pvoid)
Definition: main.c:6969
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
#define CRYPTUI_WIZ_EXPORT_CERT_STORE_CERTIFICATES_ONLY
Definition: cryptuiapi.h:262
#define CRYPTUI_WIZ_EXPORT_CERT_CONTEXT
Definition: cryptuiapi.h:258
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
#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 968 of file main.c.

969 {
970  int tabIndex = SendMessageW(GetDlgItem(hwnd, IDC_MGR_STORES),
971  TCM_GETCURSEL, 0, 0);
972  struct CertMgrData *data =
974 
975  if (tabIndex < data->nStores)
976  {
979  LPCWSTR pTitle;
980  int warningID;
981 
982  if (SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0) > 1)
983  warningID = data->stores[tabIndex].removePluralWarning;
984  else
985  warningID = data->stores[tabIndex].removeWarning;
986  if (data->title)
987  pTitle = data->title;
988  else
989  {
991  pTitle = title;
992  }
994  if (MessageBoxW(hwnd, warning, pTitle, MB_YESNO) == IDYES)
995  {
996  int selection = -1;
997 
998  do {
1000  LVNI_SELECTED);
1001  if (selection >= 0)
1002  {
1004  selection);
1005 
1007  }
1008  } while (selection >= 0);
1010  }
1011  }
1012 }
#define TCM_GETCURSEL
Definition: commctrl.h:4034
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void cert_mgr_clear_cert_selection(HWND hwnd)
Definition: main.c:807
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2680
#define IDYES
Definition: winuser.h:829
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVNI_SELECTED
Definition: commctrl.h:2396
#define GetWindowLongPtrW
Definition: winuser.h:4730
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:817
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int selection
Definition: ctm.c:92
DWORD nStores
Definition: main.c:492
#define MB_YESNO
Definition: winuser.h:811
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
Definition: store.c:943
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
static BYTE cert[]
Definition: msg.c:1437
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hInstance
Definition: main.c:36
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define DWLP_USER
Definition: winuser.h:866
#define IDS_CERT_MGR
Definition: cryptuires.h:118
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAX_STRING_LEN
Definition: main.c:75
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
#define IDC_MGR_STORES
Definition: cryptuires.h:257
static char title[]
Definition: ps.c:92
#define warning(s)
Definition: debug.h:71

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 817 of file main.c.

818 {
820  LVITEMW item;
821 
822  item.mask = LVIF_PARAM;
823  item.iItem = index;
824  item.iSubItem = 0;
826  (LPARAM)&item))
827  cert = (PCCERT_CONTEXT)item.lParam;
828  return cert;
829 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_MGR_CERTS
Definition: cryptuires.h:258
static BYTE cert[]
Definition: msg.c:1437
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
const CERT_CONTEXT * PCCERT_CONTEXT
Definition: wincrypt.h:485
#define index(s, c)
Definition: various.h:29
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define LVIF_PARAM
Definition: commctrl.h:2283

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 548 of file main.c.

549 {
550  TCITEMW item;
551 
552  item.mask = TCIF_PARAM;
554  return (HCERTSTORE)item.lParam;
555 }
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define TCIF_PARAM
Definition: commctrl.h:3946
static ATOM item
Definition: dde.c:856
#define TCM_GETITEMW
Definition: commctrl.h:4005
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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 954 of file main.c.

955 {
958  LPWSTR str = NULL;
959 
961  if (str)
962  {
964  HeapFree(GetProcessHeap(), 0, str);
965  }
966 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const WCHAR * text
Definition: package.c:1827
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:817
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static BYTE cert[]
Definition: msg.c:1437
GLuint index
Definition: glext.h:6031
#define WM_SETTEXT
Definition: winuser.h:1599
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_MGR_PURPOSES
Definition: cryptuires.h:263
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void get_cert_usages(PCCERT_CONTEXT cert, LPWSTR *str)
Definition: main.c:848
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

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 1103 of file main.c.

1104 {
1107  return CompareFileTime(&cert1->pCertInfo->NotAfter,
1108  &cert2->pCertInfo->NotAfter);
1109 }
static const BYTE cert1[]
Definition: message.c:828
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
const CERT_CONTEXT * PCCERT_CONTEXT
Definition: wincrypt.h:485
static const BYTE cert2[]
Definition: message.c:844

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 1111 of file main.c.

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

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 1098 of file main.c.

1099 {
1100  return cert_mgr_sort_by_text((HWND)lp, 1, lp1, lp2);
1101 }
static int cert_mgr_sort_by_text(HWND lv, int col, int index1, int index2)
Definition: main.c:1075

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 1093 of file main.c.

1094 {
1095  return cert_mgr_sort_by_text((HWND)lp, 0, lp1, lp2);
1096 }
static int cert_mgr_sort_by_text(HWND lv, int col, int index1, int index2)
Definition: main.c:1075

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 1075 of file main.c.

1076 {
1077  LVITEMW item;
1078  WCHAR buf1[MAX_STRING_LEN];
1079  WCHAR buf2[MAX_STRING_LEN];
1080 
1081  item.cchTextMax = ARRAY_SIZE(buf1);
1082  item.mask = LVIF_TEXT;
1083