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

Go to the source code of this file.

Classes

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

Macros

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

Typedefs

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

Enumerations

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

Functions

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

Variables

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

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file main.c.

◆ CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE

#define CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE   0x00000001

Definition at line 1331 of file main.c.

◆ MAX_DESCRIPTION

#define MAX_DESCRIPTION   255

Definition at line 3520 of file main.c.

◆ MAX_FRIENDLY_NAME

#define MAX_FRIENDLY_NAME   40

Definition at line 3519 of file main.c.

◆ MAX_PURPOSE

#define MAX_PURPOSE   255

Definition at line 3211 of file main.c.

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   512

Definition at line 73 of file main.c.

◆ MY_INDENT

#define MY_INDENT   200

Definition at line 1875 of file main.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 23 of file main.c.

◆ WM_REFRESH_VIEW

#define WM_REFRESH_VIEW   WM_USER + 0

Definition at line 3510 of file main.c.

Typedef Documentation

◆ add_fields_func

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

Definition at line 2740 of file main.c.

◆ create_detailed_value_func

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

Definition at line 2742 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 2581 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 1327 of file main.c.

◆ prop_to_value_func

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

Definition at line 2989 of file main.c.

Enumeration Type Documentation

◆ CheckBitmapIndex

Enumerator
CheckBitmapIndexUnchecked 
CheckBitmapIndexChecked 
CheckBitmapIndexDisabledUnchecked 
CheckBitmapIndexDisabledChecked 

Definition at line 579 of file main.c.

◆ PurposeFilter

Enumerator
PurposeFilterShowAll 
PurposeFilterShowAdvanced 
PurposeFilterShowOID 

Definition at line 214 of file main.c.

◆ PurposeSelection

Enumerator
PurposeEnableAll 
PurposeDisableAll 
PurposeEnableSelected 

Definition at line 3364 of file main.c.

Function Documentation

◆ add_all_extensions()

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

Definition at line 2969 of file main.c.

2970 {
2971  DWORD i;
2972  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2973 
2974  for (i = 0; i < cert->pCertInfo->cExtension; i++)
2975  add_cert_extension_detail(hwnd, data, &cert->pCertInfo->rgExtension[i]);
2976 }
static void add_cert_extension_detail(HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
Definition: main.c:2940
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 3062 of file main.c.

3063 {
3067 }
static void add_all_extensions(HWND hwnd, struct detail_data *data)
Definition: main.c:2969
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void add_properties(HWND hwnd, struct detail_data *data)
Definition: main.c:3021
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:2830

◆ add_cert_columns()

static void add_cert_columns ( HWND  hwnd)
static

Definition at line 75 of file main.c.

76 {
78  RECT rc;
81 
83  GetWindowRect(lv, &rc);
85  column.mask = LVCF_WIDTH | LVCF_TEXT;
86  column.cx = (rc.right - rc.left) * 29 / 100 - 2;
87  column.pszText = buf;
91  column.cx = (rc.right - rc.left) * 16 / 100 - 2;
94  column.cx = (rc.right - rc.left) * 23 / 100 - 1;
97 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#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:2628
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:2720
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:73
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 2940 of file main.c.

2942 {
2944  ext->pszObjId, 0);
2946 
2947  if (oidInfo)
2950  else
2951  {
2952  DWORD len = strlen(ext->pszObjId);
2953  LPWSTR oidW = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
2954 
2955  if (oidW)
2956  {
2957  DWORD i;
2958 
2959  for (i = 0; i <= len; i++)
2960  oidW[i] = ext->pszObjId[i];
2963  HeapFree(GetProcessHeap(), 0, oidW);
2964  }
2965  }
2966  HeapFree(GetProcessHeap(), 0, val);
2967 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static WCHAR * crypt_format_extension(const CERT_EXTENSION *ext, DWORD formatStrType)
Definition: main.c:2844
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:403
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:2929
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:2769
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:402

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

1780 {
1782 
1783  if (name)
1784  {
1785  /* Don't include NULL-terminator in output */
1786  DWORD len = lstrlenW(name);
1787 
1789  HeapFree(GetProcessHeap(), 0, name);
1790  }
1791 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:415
#define GetProcessHeap()
Definition: compat.h:403
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:1719
Definition: name.c:38
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LPWSTR get_cert_name_string(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags)
Definition: main.c:1762
#define HeapFree(x, y, z)
Definition: compat.h:402
_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 7043 of file main.c.

7045 {
7046  DWORD len;
7047  LVITEMW item;
7048  WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
7049  WCHAR buf[80];
7050  SYSTEMTIME sysTime;
7051  LPWSTR none, usages;
7052 
7053  item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT;
7054  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
7055  item.iSubItem = 0;
7056  item.iImage = 0;
7058  if (!item.iItem)
7059  {
7060  item.mask |= LVIF_STATE;
7061  item.state = LVIS_SELECTED;
7062  item.stateMask = -1;
7063  }
7065  {
7067  if (len > *allocatedLen)
7068  {
7069  HeapFree(GetProcessHeap(), 0, *str);
7070  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7071  if (*str)
7072  *allocatedLen = len;
7073  }
7074  if (*str)
7075  {
7077  item.pszText = *str;
7079  }
7080  item.mask = LVIF_TEXT;
7081  ++item.iSubItem;
7082  }
7084  {
7086  NULL, 0);
7087  if (len > *allocatedLen)
7088  {
7089  HeapFree(GetProcessHeap(), 0, *str);
7090  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7091  if (*str)
7092  *allocatedLen = len;
7093  }
7094  if (*str)
7095  {
7097  *str, len);
7098  item.pszText = *str;
7099  if (!item.iSubItem)
7101  else
7102  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7103  }
7104  item.mask = LVIF_TEXT;
7105  ++item.iSubItem;
7106  }
7108  {
7110  if (usages)
7111  {
7112  item.pszText = usages;
7113  if (!item.iSubItem)
7115  else
7116  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7118  }
7119  item.mask = LVIF_TEXT;
7120  ++item.iSubItem;
7121  }
7123  {
7126  if (len > *allocatedLen)
7127  {
7128  HeapFree(GetProcessHeap(), 0, *str);
7129  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
7130  if (*str)
7131  *allocatedLen = len;
7132  }
7133  if (*str)
7134  {
7136  item.pszText = none;
7137  else
7138  item.pszText = *str;
7139  if (!item.iSubItem)
7141  else
7142  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7143  }
7144  item.mask = LVIF_TEXT;
7145  ++item.iSubItem;
7146  }
7148  {
7150  FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
7151  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, buf, ARRAY_SIZE(buf));
7152  item.pszText = buf;
7153  if (!item.iSubItem)
7155  else
7156  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7157  item.mask = LVIF_TEXT;
7158  ++item.iSubItem;
7159  }
7161  {
7162  static int show_fixme;
7163  if (!show_fixme++)
7164  FIXME("showing location is not implemented\n");
7166  if (!item.iSubItem)
7168  else
7169  SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item);
7170  }
7171 }
#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:2305
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:2302
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2315
#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:188
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LVIF_IMAGE
Definition: commctrl.h:2306
#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:2400
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2683
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:846
#define LVIF_PARAM
Definition: commctrl.h:2307
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:2308
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by add_store_certs().

◆ add_cert_to_view()

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

Definition at line 99 of file main.c.

101 {
102  DWORD len;
103  LVITEMW item;
104  WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */
105  WCHAR date[80];
106  SYSTEMTIME sysTime;
107  LPWSTR none;
108 
109  item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT;
110  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
111  item.iSubItem = 0;
112  item.iImage = 0;
115  NULL, 0);
116  if (len > *allocatedLen)
117  {
118  HeapFree(GetProcessHeap(), 0, *str);
119  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
120  if (*str)
121  *allocatedLen = len;
122  }
123  if (*str)
124  {
126  *str, len);
127  item.pszText = *str;
129  }
130 
131  item.mask = LVIF_TEXT;
134  if (len > *allocatedLen)
135  {
136  HeapFree(GetProcessHeap(), 0, *str);
137  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
138  if (*str)
139  *allocatedLen = len;
140  }
141  if (*str)
142  {
145  item.pszText = *str;
146  item.iSubItem = 1;
148  }
149 
151  FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
152  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
153  item.pszText = date;
154  item.iSubItem = 2;
156 
158  NULL, &len))
160  if (len > *allocatedLen)
161  {
162  HeapFree(GetProcessHeap(), 0, *str);
163  *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
164  if (*str)
165  *allocatedLen = len;
166  }
167  if (*str)
168  {
170  *str, &len))
171  item.pszText = none;
172  else
173  item.pszText = *str;
174  item.iSubItem = 3;
176  }
177 }
#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:2305
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:2302
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:188
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LVIF_IMAGE
Definition: commctrl.h:2306
#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:2400
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2683
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:2307
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:402

Referenced by show_store_certs().

◆ add_critical_extensions()

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

Definition at line 2978 of file main.c.

2979 {
2980  DWORD i;
2981  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2982 
2983  for (i = 0; i < cert->pCertInfo->cExtension; i++)
2984  if (cert->pCertInfo->rgExtension[i].fCritical)
2986  &cert->pCertInfo->rgExtension[i]);
2987 }
static void add_cert_extension_detail(HWND hwnd, struct detail_data *data, PCERT_EXTENSION ext)
Definition: main.c:2940
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 2395 of file main.c.

2396 {
2397  WCHAR dateFmt[80]; /* sufficient for all versions of LOCALE_SSHORTDATE */
2398  WCHAR date[80];
2399  SYSTEMTIME sysTime;
2400 
2402  FileTimeToSystemTime(fileTime, &sysTime);
2403  GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
2405 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:415
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:188
__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:1719

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

2771 {
2772  LVITEMW item;
2773  int iItem = SendMessageW(hwnd, LVM_GETITEMCOUNT, 0, 0);
2774 
2775  item.mask = LVIF_TEXT | LVIF_PARAM;
2776  item.iItem = iItem;
2777  item.iSubItem = 0;
2778  item.pszText = field;
2779  item.lParam = (LPARAM)data;
2781  if (value)
2782  {
2783  item.pszText = value;
2784  item.iSubItem = 1;
2786  }
2788 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2302
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:2751
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:2400
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2683
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVIF_PARAM
Definition: commctrl.h:2307
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 2751 of file main.c.

2753 {
2754  if (data->cFields)
2755  data->fields = HeapReAlloc(GetProcessHeap(), 0, data->fields,
2756  (data->cFields + 1) * sizeof(struct field_value_data));
2757  else
2758  data->fields = HeapAlloc(GetProcessHeap(), 0,
2759  sizeof(struct field_value_data));
2760  if (data->fields)
2761  {
2762  data->fields[data->cFields].create = create;
2763  data->fields[data->cFields].detailed_value = NULL;
2764  data->fields[data->cFields].param = param;
2765  data->cFields++;
2766  }
2767 }
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
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:401
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 1793 of file main.c.

1794 {
1795  HRESULT hr;
1796  IRichEditOle *richEditOle = NULL;
1797  IOleObject *object = NULL;
1798  CLSID clsid;
1799  LPOLECACHE oleCache = NULL;
1800  FORMATETC formatEtc;
1801  DWORD conn;
1802  IDataObject *dataObject = NULL;
1803  HBITMAP bitmap = NULL;
1804  STGMEDIUM stgm;
1805  IOleClientSite *clientSite = NULL;
1806  REOBJECT reObject;
1807 
1808  TRACE("(%p, %d)\n", hwnd, id);
1809 
1810  SendMessageW(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&richEditOle);
1811  if (!richEditOle)
1812  goto end;
1814  (void**)&object);
1815  if (FAILED(hr))
1816  goto end;
1817  hr = IOleObject_GetUserClassID(object, &clsid);
1818  if (FAILED(hr))
1819  goto end;
1820  hr = IOleObject_QueryInterface(object, &IID_IOleCache, (void**)&oleCache);
1821  if (FAILED(hr))
1822  goto end;
1823  formatEtc.cfFormat = CF_BITMAP;
1824  formatEtc.ptd = NULL;
1825  formatEtc.dwAspect = DVASPECT_CONTENT;
1826  formatEtc.lindex = -1;
1827  formatEtc.tymed = TYMED_GDI;
1828  hr = IOleCache_Cache(oleCache, &formatEtc, 0, &conn);
1829  if (FAILED(hr))
1830  goto end;
1831  hr = IOleObject_QueryInterface(object, &IID_IDataObject,
1832  (void**)&dataObject);
1833  if (FAILED(hr))
1834  goto end;
1835  hr = IRichEditOle_GetClientSite(richEditOle, &clientSite);
1836  if (FAILED(hr))
1837  goto end;
1840  if (!bitmap)
1841  goto end;
1842  stgm.tymed = TYMED_GDI;
1843  stgm.u.hBitmap = bitmap;
1844  stgm.pUnkForRelease = NULL;
1845  hr = IDataObject_SetData(dataObject, &formatEtc, &stgm, TRUE);
1846  if (FAILED(hr))
1847  goto end;
1848 
1849  reObject.cbStruct = sizeof(reObject);
1850  reObject.cp = REO_CP_SELECTION;
1851  reObject.clsid = clsid;
1852  reObject.poleobj = object;
1853  reObject.pstg = NULL;
1854  reObject.polesite = clientSite;
1855  reObject.sizel.cx = reObject.sizel.cy = 0;
1856  reObject.dvaspect = DVASPECT_CONTENT;
1857  reObject.dwFlags = 0;
1858  reObject.dwUser = 0;
1859 
1860  IRichEditOle_InsertObject(richEditOle, &reObject);
1861 
1862 end:
1863  if (clientSite)
1864  IOleClientSite_Release(clientSite);
1865  if (dataObject)
1866  IDataObject_Release(dataObject);
1867  if (oleCache)
1868  IOleCache_Release(oleCache);
1869  if (object)
1870  IOleObject_Release(object);
1871  if (richEditOle)
1872  IRichEditOle_Release(richEditOle);
1873 }
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:82
#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 586 of file main.c.

588 {
589  LVITEMW item;
590 
591  item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
593  item.stateMask = LVIS_STATEIMAGEMASK;
594  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
595  item.iSubItem = 0;
596  item.lParam = (LPARAM)info;
597  item.pszText = (LPWSTR)info->pwszName;
599 }
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2302
LONG_PTR LPARAM
Definition: windef.h:208
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2322
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2324
static int state
Definition: maze.c:121
#define LVM_INSERTITEMW
Definition: commctrl.h:2400
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVIF_PARAM
Definition: commctrl.h:2307
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2308

Referenced by add_known_usages_to_list(), and show_cert_usages().

◆ add_known_usages_to_list()

static void add_known_usages_to_list ( HWND  lv,
CheckBitmapIndex  state 
)
static

Definition at line 601 of file main.c.

602 {
604 
606  {
608 
609  for (ptr = usages; *ptr; ptr++)
610  add_known_usage(lv, *ptr, state);
612  }
613 }
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:586
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 1977 of file main.c.

1978 {
1979  struct OIDToString *entry;
1980  WCHAR nl = '\n';
1981  PARAFORMAT2 parFmt;
1982 
1983  parFmt.cbSize = sizeof(parFmt);
1984  parFmt.dwMask = PFM_STARTINDENT;
1985  parFmt.dxStartIndent = MY_INDENT * 3;
1986  if ((entry = findSupportedOID(oid)))
1987  {
1988  WCHAR *str, *linebreak, *ptr;
1989  BOOL multiline = FALSE;
1990  int len;
1991 
1992  len = LoadStringW(hInstance, entry->id, (LPWSTR)&str, 0);
1993  ptr = str;
1994  do {
1995  if ((linebreak = wmemchr(ptr, '\n', len)))
1996  {
1998 
1999  multiline = TRUE;
2000  /* The source string contains a newline, which the richedit
2001  * control won't find since it's interpreted as a paragraph
2002  * break. Therefore copy up to the newline. lstrcpynW always
2003  * NULL-terminates, so pass one more than the length of the
2004  * source line so the copy includes the entire line and the
2005  * NULL-terminator.
2006  */
2007  lstrcpynW(copy, ptr, linebreak - ptr + 1);
2009  linebreak - ptr, &parFmt);
2010  ptr = linebreak + 1;
2012  }
2013  else if (multiline && *ptr)
2014  {
2015  /* Add the last line */
2017  len - (ptr - str), &parFmt);
2019  }
2020  } while (linebreak);
2021  if (!multiline)
2022  {
2025  }
2026  }
2027  else
2028  {
2029  WCHAR *oidW = HeapAlloc(GetProcessHeap(), 0,
2030  (strlen(oid) + 1) * sizeof(WCHAR));
2031 
2032  if (oidW)
2033  {
2034  LPCSTR src;
2035  WCHAR *dst;
2036 
2037  for (src = oid, dst = oidW; *src; src++, dst++)
2038  *dst = *src;
2039  *dst = 0;
2041  &parFmt);
2043  HeapFree(GetProcessHeap(), 0, oidW);
2044  }
2045  }
2046 }
#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:1960
const WCHAR * text
Definition: package.c:1827
#define lstrlenW
Definition: compat.h:415
_CONST_RETURN wchar_t *__cdecl wmemchr(_In_reads_(_N) const wchar_t *_S, _In_ wchar_t _C, _In_ size_t _N)
Definition: wchar.h:2536
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:405
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MY_INDENT
Definition: main.c:1875
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:73
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:1719
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1745
UINT cbSize
Definition: richedit.h:666
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402
LPCSTR oid
Definition: main.c:1896

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

1878 {
1879  WCHAR nl = '\n';
1881  PARAFORMAT2 parFmt;
1882 
1883  parFmt.cbSize = sizeof(parFmt);
1884  parFmt.dwMask = PFM_STARTINDENT;
1885  parFmt.dxStartIndent = MY_INDENT * 3;
1886  if (oidInfo)
1887  {
1889  lstrlenW(oidInfo->pwszName), &parFmt);
1891  }
1892 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define lstrlenW
Definition: compat.h:415
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:1875
#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:1719
static void add_text_with_paraformat_to_control(HWND hwnd, LPCWSTR text, LONG len, const PARAFORMAT2 *fmt)
Definition: main.c:1745
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:1896

Referenced by display_app_usages(), and display_cert_usages().

◆ add_oid_to_usage()

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

Definition at line 260 of file main.c.

261 {
262  if (!usage->cUsageIdentifier)
263  usage->rgpszUsageIdentifier = HeapAlloc(GetProcessHeap(), 0,
264  sizeof(LPSTR));
265  else
266  usage->rgpszUsageIdentifier = HeapReAlloc(GetProcessHeap(), 0,
267  usage->rgpszUsageIdentifier,
268  (usage->cUsageIdentifier + 1) * sizeof(LPSTR));
269  if (usage->rgpszUsageIdentifier)
270  usage->rgpszUsageIdentifier[usage->cUsageIdentifier++] = oid;
271  else
272  {
274  usage = NULL;
275  }
276  return usage;
277 }
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define HeapReAlloc
Definition: compat.h:401
#define HeapFree(x, y, z)
Definition: compat.h:402
LPCSTR oid
Definition: main.c:1896

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

3022 {
3023  DWORD i;
3024  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
3025 
3026  for (i = 0; i < ARRAY_SIZE(prop_id_map); i++)
3027  {
3028  DWORD cb;
3029 
3031  &cb))
3032  {
3033  BYTE *pb;
3034  WCHAR *val = NULL;
3035 
3036  /* FIXME: MS adds a separate value for the signature hash
3037  * algorithm.
3038  */
3039  pb = HeapAlloc(GetProcessHeap(), 0, cb);
3040  if (pb)
3041  {
3043  prop_id_map[i].prop, pb, &cb))
3044  {
3045  if (prop_id_map[i].prop_is_string)
3046  {
3047  val = (LPWSTR)pb;
3048  /* Don't double-free pb */
3049  pb = NULL;
3050  }
3051  else
3052  val = prop_id_map[i].prop_to_value(pb, cb);
3053  }
3054  HeapFree(GetProcessHeap(), 0, pb);
3055  }
3057  NULL, NULL);
3058  }
3059  }
3060 }
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:403
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
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:2790
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402
static const struct prop_id_to_string_id prop_id_map[]
Definition: main.c:3013

Referenced by add_all_fields().

◆ add_purpose()

static void add_purpose ( HWND  hwnd,
LPCSTR  oid 
)
static

Definition at line 3136 of file main.c.

3137 {
3140  sizeof(CRYPT_OID_INFO));
3141 
3142  if (info)
3143  {
3144  char *oidCopy = HeapAlloc(GetProcessHeap(), 0, strlen(oid) + 1);
3145 
3146  if (oidCopy)
3147  {
3148  LVITEMA item;
3149 
3150  strcpy(oidCopy, oid);
3151  info->cbSize = sizeof(CRYPT_OID_INFO);
3152  info->pszOID = oidCopy;
3153  item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
3155  item.stateMask = LVIS_STATEIMAGEMASK;
3156  item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0);
3157  item.iSubItem = 0;
3158  item.lParam = (LPARAM)info;
3159  item.pszText = oidCopy;
3161  }
3162  else
3163  HeapFree(GetProcessHeap(), 0, info);
3164  }
3165 }
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:2305
#define LVM_INSERTITEMA
Definition: commctrl.h:2399
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2302
LONG_PTR LPARAM
Definition: windef.h:208
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2322
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2324
#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:2307
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define LVIF_STATE
Definition: commctrl.h:2308
#define HeapFree(x, y, z)
Definition: compat.h:402
LPCSTR oid
Definition: main.c:1896

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

3215 {
3216  LRESULT ret = 0;
3217  char buf[MAX_PURPOSE + 1];
3218 
3219  switch (msg)
3220  {
3221  case WM_INITDIALOG:
3223  MAX_PURPOSE, 0);
3226  break;
3227  case WM_COMMAND:
3228  switch (HIWORD(wp))
3229  {
3230  case EN_CHANGE:
3231  if (LOWORD(wp) == IDC_NEW_PURPOSE)
3232  {
3233  /* Show/hide scroll bar on description depending on how much
3234  * text it has.
3235  */
3238 
3240  }
3241  break;
3242  case BN_CLICKED:
3243  switch (LOWORD(wp))
3244  {
3245  case IDOK:
3247  (LPARAM)buf);
3248  if (!buf[0])
3249  {
3250  /* An empty purpose is the same as cancelling */
3252  ret = TRUE;
3253  }
3254  else if (!is_valid_oid(buf))
3255  {
3257 
3261  }
3262  else if (is_oid_in_list(
3264  {
3266 
3268  ARRAY_SIZE(error));
3271  }
3272  else
3273  {
3275 
3277  EndDialog(hwnd, wp);
3278  ret = TRUE;
3279  }
3280  break;
3281  case IDCANCEL:
3282  EndDialog(hwnd, wp);
3283  ret = TRUE;
3284  break;
3285  }
3286  break;
3287  }
3288  break;
3289  }
3290  return ret;
3291 }
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:4804
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:3211
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:2869
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:3136
#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:73
#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:3167
#define SetWindowLongPtrW
Definition: winuser.h:5321
#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:3205
#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 7173 of file main.c.

7175 {
7177  BOOL select = FALSE;
7178  DWORD allocatedLen = 0;
7179  LPWSTR str = NULL;
7180 
7181  do {
7183  if (cert && (!filter || filter(cert, &select, callback_data)))
7184  add_cert_to_list(lv, cert, flags, &allocatedLen, &str);
7185  } while (cert);
7186  HeapFree(GetProcessHeap(), 0, str);
7187 }
LPCWSTR filter
Definition: main.c:4909
static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *allocatedLen, LPWSTR *str)
Definition: main.c:7043
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:403
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:402

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

2792 {
2794 
2797 }
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:73
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:2769
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 1736 of file main.c.

1737 {
1738  LPWSTR str;
1739  LONG len;
1740 
1741  len = LoadStringW(hInstance, id, (LPWSTR)&str, 0);
1743 }
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:1719
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 1752 of file main.c.

1754 {
1755  LPWSTR str;
1756  LONG len;
1757 
1758  len = LoadStringW(hInstance, id, (LPWSTR)&str, 0);
1760 }
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:1745
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 1745 of file main.c.

1747 {
1750 }
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:1719
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 1719 of file main.c.

1720 {
1721  struct ReadStringStruct string;
1722  EDITSTREAM editstream;
1723 
1724  TRACE("(%p, %s)\n", hwnd, debugstr_wn(text, len));
1725 
1726  string.buf = text;
1727  string.pos = 0;
1728  string.len = len;
1729  editstream.dwCookie = (DWORD_PTR)&string;
1730  editstream.dwError = 0;
1731  editstream.pfnCallback = read_text_callback;
1733  (LPARAM)&editstream);
1734 }
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:1705
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 2806 of file main.c.

2808 {
2809  WCHAR *val = field->format(data->pCertViewInfo->pCertContext);
2810 
2811  if (val)
2812  {
2814  field->create_detailed_value, NULL);
2815  HeapFree(GetProcessHeap(), 0, val);
2816  }
2817 }
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:403
__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:2790
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by add_v1_fields().

◆ add_v1_fields()

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

Definition at line 2830 of file main.c.

2831 {
2832  unsigned int i;
2833  PCCERT_CONTEXT cert = data->pCertViewInfo->pCertContext;
2834 
2835  /* The last item in v1_fields is the public key, which is not in the loop
2836  * because it's a special case.
2837  */
2838  for (i = 0; i < ARRAY_SIZE(v1_fields) - 1; i++)
2840  if (cert->pCertInfo->SubjectPublicKeyInfo.PublicKey.cbData)
2842 }
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:2806
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:2819
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 3522 of file main.c.

3523 {
3524  WCHAR buf[MAX_DESCRIPTION + 1];
3525  struct edit_cert_data *data =
3527 
3533  {
3534  /* Setting a NULL usage removes the enhanced key usage property. */
3536  }
3538  {
3539  CERT_ENHKEY_USAGE usage = { 0, NULL };
3540 
3542  }
3544  {
3546  CERT_ENHKEY_USAGE usage = { 0, NULL };
3547  int purposes = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0), i;
3548  LVITEMW item;
3549 
3550  item.mask = LVIF_STATE | LVIF_PARAM;
3551  item.iSubItem = 0;
3552  item.stateMask = LVIS_STATEIMAGEMASK;
3553  for (i = 0; i < purposes; i++)
3554  {
3555  item.iItem = i;
3556  if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item))
3557  {
3558  int state = item.state >> 12;
3559 
3561  {
3562  CRYPT_OID_INFO *info = (CRYPT_OID_INFO *)item.lParam;
3563 
3564  if (usage.cUsageIdentifier)
3565  usage.rgpszUsageIdentifier =
3567  usage.rgpszUsageIdentifier,
3568  (usage.cUsageIdentifier + 1) * sizeof(LPSTR));
3569  else
3570  usage.rgpszUsageIdentifier =
3571  HeapAlloc(GetProcessHeap(), 0, sizeof(LPSTR));
3572  if (usage.rgpszUsageIdentifier)
3573  usage.rgpszUsageIdentifier[usage.cUsageIdentifier++] =
3574  (LPSTR)info->pszOID;
3575  }
3576  }
3577  }
3579  HeapFree(GetProcessHeap(), 0, usage.rgpszUsageIdentifier);
3580  }
3582  if (data->pfPropertiesChanged)
3583  *data->pfPropertiesChanged = TRUE;
3584 }
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:3495
#define WM_GETTEXT
Definition: winuser.h:1600
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:2302
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:2322
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define GetProcessHeap()
Definition: compat.h:403
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:3520
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:401
#define IDC_FRIENDLY_NAME
Definition: cryptuires.h:233
#define LVM_GETITEMW
Definition: commctrl.h:2386
#define LVIF_PARAM
Definition: commctrl.h:2307
#define CERT_DESCRIPTION_PROP_ID
Definition: wincrypt.h:2699
#define LVIF_STATE
Definition: commctrl.h:2308
static BOOL CALLBACK refresh_propsheet_pages(HWND hwnd, LPARAM lParam)
Definition: main.c:3512
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by cert_properties_general_dlg_proc().

◆ cert_mgr_advanced_dlg_proc()

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

Definition at line 722 of file main.c.

724 {
725  switch (msg)
726  {
727  case WM_INITDIALOG:
728  {
729  RECT rc;
733  LPSTR disabledUsages;
734 
735  GetWindowRect(lv, &rc);
736  column.mask = LVCF_WIDTH;
737  column.cx = rc.right - rc.left;
739  imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 4, 0);
740  if (imageList)
741  {
742  HBITMAP bmp;
743  COLORREF backColor = RGB(255, 0, 255);
744 
746  ImageList_AddMasked(imageList, bmp, backColor);
747  DeleteObject(bmp);
751  }
753  if ((disabledUsages = get_cert_mgr_usages()))
754  {
755  LPSTR ptr, comma;
756 
757  for (ptr = disabledUsages, comma = strchr(ptr, ','); ptr && *ptr;
758  ptr = comma ? comma + 1 : NULL,
759  comma = ptr ? strchr(ptr, ',') : NULL)
760  {
761  LONG_PTR index;
762 
763  if (comma)
764  *comma = 0;
765  if ((index = find_oid_in_list(lv, ptr)) != -1)
767  }
768  HeapFree(GetProcessHeap(), 0, disabledUsages);
769  }
770  break;
771  }
772  case WM_NOTIFY:
773  {
774  NMHDR *hdr = (NMHDR *)lp;
775  NMITEMACTIVATE *nm;
776 
777  switch (hdr->code)
778  {
779  case NM_CLICK:
780  nm = (NMITEMACTIVATE *)lp;
781  toggle_usage(hwnd, nm->iItem);
783  break;
784  }
785  break;
786  }
787  case WM_COMMAND:
788  switch (wp)
789  {
790  case IDOK:
793  EndDialog(hwnd, IDOK);
794  break;
795  case IDCANCEL:
798  break;
799  }
800  break;
801  }
802  return 0;
803 }
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:2296
#define LVCF_WIDTH
Definition: commctrl.h:2583
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:4804
LONG left
Definition: windef.h:306
char * LPSTR
Definition: xmlstorage.h:182
LONG right
Definition: windef.h:308
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static void save_cert_mgr_usages(HWND hwnd)
Definition: main.c:662
#define ILC_COLOR4
Definition: commctrl.h:350
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:2628
static LPSTR get_cert_mgr_usages(void)
Definition: main.c:179
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:315
GLuint index
Definition: glext.h:6031
static void toggle_usage(HWND hwnd, int iItem)
Definition: main.c:615
#define GetProcessHeap()
Definition: compat.h:403
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD COLORREF
Definition: windef.h:300
#define RGB(r, g, b)
Definition: wingdi.h:2939
#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:347
#define WM_COMMAND
Definition: winuser.h:1722
static LONG_PTR find_oid_in_list(HWND lv, LPCSTR oid)
Definition: main.c:637
#define NM_CLICK
Definition: commctrl.h:130
static void add_known_usages_to_list(HWND lv, CheckBitmapIndex state)
Definition: main.c:601
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
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:5321
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:402
#define WM_NOTIFY
Definition: richedit.h:61
HIMAGELIST imageList
Definition: main.c:3393

Referenced by cert_mgr_dlg_proc().

◆ cert_mgr_clear_cert_selection()

static void cert_mgr_clear_cert_selection ( HWND  hwnd)
static

Definition at line 805 of file main.c.

806 {
811  (LPARAM)empty);
813 }
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:47
#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:570
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 555 of file main.c.

556 {
558 
559  return cert_mgr_index_to_store(tab, SendMessageW(tab, TCM_GETCURSEL, 0, 0));
560 }
#define TCM_GETCURSEL
Definition: commctrl.h:4058
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
Definition: main.c:546
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 1115 of file main.c.

1117 {
1118  struct CertMgrData *data;
1119 
1120  switch (msg)
1121  {
1122  case WM_INITDIALOG:
1123  {
1124  PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr =
1127 
1128  data = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CertMgrData));
1129  if (!data)
1130  return 0;
1131  data->imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 2, 0);
1132  if (data->imageList)
1133  {
1134  HBITMAP bmp;
1135  COLORREF backColor = RGB(255, 0, 255);
1136 
1138  ImageList_AddMasked(data->imageList, bmp, backColor);
1139  DeleteObject(bmp);
1140  ImageList_SetBkColor(data->imageList, CLR_NONE);
1142  LVSIL_SMALL, (LPARAM)data->imageList);
1143  }
1145  data->title = pCryptUICertMgr->pwszTitle;
1146 
1149  if (pCryptUICertMgr->pwszTitle)
1151  (LPARAM)pCryptUICertMgr->pwszTitle);
1152  show_cert_stores(hwnd, pCryptUICertMgr->dwFlags, data);
1154  break;
1155  }
1156  case WM_NOTIFY:
1157  {
1158  NMHDR *hdr = (NMHDR *)lp;
1159 
1160  switch (hdr->code)
1161  {
1162  case TCN_SELCHANGE:
1164  break;
1165  case LVN_ITEMCHANGED:
1166  {
1167  NMITEMACTIVATE *nm = (NMITEMACTIVATE*)lp;
1169  int numSelected = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1170 
1171  EnableWindow(GetDlgItem(hwnd, IDC_MGR_EXPORT), numSelected > 0);
1172  EnableWindow(GetDlgItem(hwnd, IDC_MGR_REMOVE), numSelected > 0);
1173  EnableWindow(GetDlgItem(hwnd, IDC_MGR_VIEW), numSelected == 1);
1174  if (numSelected == 1)
1176  else
1178  (LPARAM)empty);
1179  break;
1180  }
1181  case NM_DBLCLK:
1182  show_selected_cert(hwnd, ((NMITEMACTIVATE *)lp)->iItem);
1183  break;
1184  case LVN_KEYDOWN:
1185  {
1186  NMLVKEYDOWN *lvk = (NMLVKEYDOWN *)lp;
1187 
1188  if (lvk->wVKey == VK_DELETE)
1190  break;
1191  }
1192  case LVN_COLUMNCLICK:
1193  {
1194  NMLISTVIEW *nmlv = (NMLISTVIEW *)lp;
1196 
1197  /* FIXME: doesn't support swapping sort order between ascending
1198  * and descending.
1199  */
1200  switch (nmlv->iSubItem)
1201  {
1202  case 0:
1205  break;
1206  case 1:
1209  break;
1210  case 2:
1211  SendMessageW(lv, LVM_SORTITEMS, 0,
1213  break;
1214  case 3:
1217  break;
1218  }
1219  break;
1220  }
1221  }
1222  break;
1223  }
1224  case WM_COMMAND:
1225  switch (wp)
1226  {
1227  case ((CBN_SELCHANGE << 16) | IDC_MGR_PURPOSE_SELECTION):
1229  break;
1230  case IDC_MGR_IMPORT:
1231  if (CryptUIWizImport(0, hwnd, NULL, NULL,
1234  break;
1235  case IDC_MGR_ADVANCED:
1238  {
1240  int index, len;
1241  LPWSTR curString = NULL;
1242 
1243  index = SendMessageW(cb, CB_GETCURSEL, 0, 0);
1244  if (index >= 0)
1245  {
1247  curString = HeapAlloc(GetProcessHeap(), 0,
1248  (len + 1) * sizeof(WCHAR));
1249  SendMessageW(cb, CB_GETLBTEXT, index, (LPARAM)curString);
1250  }
1253  if (curString)
1254  {
1256  (LPARAM)curString);
1257  if (index >= 0)
1259  HeapFree(GetProcessHeap(), 0, curString);
1260  }
1262  }
1263  break;
1264  case IDC_MGR_VIEW:
1265  {
1267  int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1,
1268  LVNI_SELECTED);
1269 
1270  if (selection >= 0)
1272  break;
1273  }
1274  case IDC_MGR_EXPORT:
1276  break;
1277  case IDC_MGR_REMOVE:
1279  break;
1280  case IDCANCEL:
1284  ImageList_Destroy(data->imageList);
1285  HeapFree(GetProcessHeap(), 0, data);
1287  break;
1288  }
1289  break;
1290  }
1291  return 0;
1292 }
#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:805
#define IDOK
Definition: winuser.h:824
char hdr[14]
Definition: iptest.cpp:33
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2704
#define LVSIL_SMALL
Definition: commctrl.h:2295
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:1091
#define IDC_MGR_EXPORT
Definition: cryptuires.h:260
#define CB_GETLBTEXT
Definition: winuser.h:1934
static const WCHAR empty[]
Definition: main.c:47
#define IDD_CERT_MGR_ADVANCED
Definition: cryptuires.h:195
#define LVN_ITEMCHANGED
Definition: commctrl.h:3127
static void cert_mgr_do_remove(HWND hwnd)
Definition: main.c:966
static void cert_mgr_do_export(HWND hwnd)
Definition: main.c:1012
static void add_cert_columns(HWND hwnd)
Definition: main.c:75
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define LVM_SORTITEMS
Definition: commctrl.h:2698
#define LVNI_SELECTED
Definition: commctrl.h:2420
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
static int CALLBACK cert_mgr_sort_by_date(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1101
#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:350
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
static void show_selected_cert(HWND hwnd, int index)
Definition: main.c:829
#define IDC_MGR_PURPOSE_SELECTION
Definition: cryptuires.h:256
#define LVN_KEYDOWN
Definition: commctrl.h:3180
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:2796
static LRESULT CALLBACK cert_mgr_advanced_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: main.c:722
smooth NULL
Definition: ftsmooth.c:416
static void cert_mgr_show_cert_usages(HWND hwnd, int index)
Definition: main.c:952
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:315
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:4374
static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
Definition: main.c:546
#define TCN_SELCHANGE
Definition: commctrl.h:4128
#define GetProcessHeap()
Definition: compat.h:403
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:300
static void close_stores(HWND tab)
Definition: main.c:562
#define RGB(r, g, b)
Definition: wingdi.h:2939
#define IDC_MGR_PURPOSES
Definition: cryptuires.h:263
static void free_certs(HWND lv)
Definition: main.c:531
static HCERTSTORE cert_mgr_current_store(HWND hwnd)
Definition: main.c:555
HINSTANCE hInstance
Definition: main.c:36
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:347
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:2299
#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:570
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:1096
#define LVN_COLUMNCLICK
Definition: commctrl.h:3135
#define CBN_SELCHANGE
Definition: winuser.h:1961
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
#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:5536
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
#define SetWindowLongPtrW
Definition: winuser.h:5321
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:2429
#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:220
static void show_cert_stores(HWND hwnd, DWORD dwFlags, struct CertMgrData *data)
Definition: main.c:494
#define HeapFree(x, y, z)
Definition: compat.h:402
#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:353
static int CALLBACK cert_mgr_sort_by_friendly_name(LPARAM lp1, LPARAM lp2, LPARAM lp)
Definition: main.c:1109
#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 1012 of file main.c.

1013 {
1015  int selectionCount = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0);
1016 
1017  if (selectionCount == 1)
1018  {
1019  int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1,
1020  LVNI_SELECTED);
1021 
1022  if (selection >= 0)
1023  {
1025 
1026  if (cert)
1027  {
1029 
1030  info.dwSize = sizeof(info);
1031  info.pwszExportFileName = NULL;
1032  info.dwSubjectChoice = CRYPTUI_WIZ_EXPORT_CERT_CONTEXT;
1033  info.u.pCertContext = cert;
1034  info.cStores = 0;
1036  }
1037  }
1038  }
1039  else if (selectionCount > 1)
1040  {
1043 
1044  if (store)
1045  {
1047  int selection = -1;
1048 
1049  info.dwSize = sizeof(info);
1050  info.pwszExportFileName = NULL;
1051  info.dwSubjectChoice =
1053  info.u.hCertStore = store;
1054  info.cStores = 0;
1055  do {
1057  LVNI_SELECTED);
1058  if (selection >= 0)
1059  {
1061  selection);
1062 
1065  }
1066  } while (selection >= 0);
1068  CertCloseStore(store, 0);
1069  }
1070  }
1071 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2704
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:286
#define LVNI_SELECTED
Definition: commctrl.h:2420
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:815
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:6967
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:2429
#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 966 of file main.c.

967 {
968  int tabIndex = SendMessageW(GetDlgItem(hwnd, IDC_MGR_STORES),
969  TCM_GETCURSEL, 0, 0);
970  struct CertMgrData *data =
972 
973  if (tabIndex < data->nStores)
974  {
977  LPCWSTR pTitle;
978  int warningID;
979 
980  if (SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0) > 1)
981  warningID = data->stores[tabIndex].removePluralWarning;
982  else
983  warningID = data->stores[tabIndex].removeWarning;
984  if (data->title)
985  pTitle = data->title;
986  else
987  {
989  pTitle = title;
990  }
992  if (MessageBoxW(hwnd, warning, pTitle, MB_YESNO) == IDYES)
993  {
994  int selection = -1;
995 
996  do {
998  LVNI_SELECTED);
999  if (selection >= 0)
1000  {
1002  selection);
1003 
1005  }
1006  } while (selection >= 0);
1008  }
1009  }
1010 }
#define TCM_GETCURSEL
Definition: commctrl.h:4058
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void cert_mgr_clear_cert_selection(HWND hwnd)
Definition: main.c:805
#define LVM_GETSELECTEDCOUNT
Definition: commctrl.h:2704
#define IDYES
Definition: winuser.h:829
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVNI_SELECTED
Definition: commctrl.h:2420
#define GetWindowLongPtrW
Definition: winuser.h:4804
static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index)
Definition: main.c:815
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:490
#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:73
#define LVM_GETNEXTITEM
Definition: commctrl.h:2429
#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 815 of file main.c.

816 {
818  LVITEMW item;
819 
820  item.mask = LVIF_PARAM;
821  item.iItem = index;
822  item.iSubItem = 0;
824  (LPARAM)&item))
825  cert = (PCCERT_CONTEXT)item.lParam;
826  return cert;
827 }
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:2386
#define LVIF_PARAM
Definition: commctrl.h:2307

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

◆ cert_mgr_index_to_store()

static HCERTSTORE cert_mgr_index_to_store ( HWND  tab,
int  index 
)
static

Definition at line 546 of file main.c.

547 {
548  TCITEMW item;
549 
550  item.mask = TCIF_PARAM;
552  return (HCERTSTORE)item.lParam;
553 }
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define TCIF_PARAM
Definition: commctrl.h:3970
static ATOM item
Definition: dde.c:856
#define TCM_GETITEMW
Definition: commctrl.h:4029
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 952 of file main.c.

953 {
956  LPWSTR str = NULL;
957 
959  if (str)
960  {
962  HeapFree(GetProcessHeap(), 0, str);
963  }
964 }
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:815
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:403
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:846
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402

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

1102 {
1105  return CompareFileTime(&cert1->pCertInfo->NotAfter,
1106  &cert2->pCertInfo->NotAfter);
1107 }
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 1109 of file main.c.

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

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

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

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

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

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

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