Win32 API 日本語リファレンス
ホームSecurity.Cryptography.UI › CERT_VIEWPROPERTIES_STRUCT_W

CERT_VIEWPROPERTIES_STRUCT_W

構造体
サイズx64: 160 バイト / x86: 88 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズ (バイト単位) です。
hwndParentHWND8/4+8+4親ウィンドウへのハンドルです。
hInstanceHINSTANCE8/4+16+8モジュールインスタンスへのハンドルです。
dwFlagsCERT_VIEWPROPERTIES_STRUCT_FLAGS4+24+12

次の値のうち 0 個以上のビット単位の組み合わせです。

意味
CM_ENABLEHOOK
1 (0x1)
フック関数が有効であることを指定します。
CM_SHOW_HELP
2 (0x2)
ヘルプファイルを使用することを指定します。
CM_SHOW_HELPICON
4 (0x4)
ヘルプアイコンを使用することを指定します。
CM_ENABLETEMPLATE
8 (0x8)
テンプレートが有効であることを指定します。
CM_HIDE_ADVANCEPAGE
16 (0x10)
Advance タブを表示しないことを指定します。
CM_HIDE_TRUSTPAGE
32 (0x20)
Trust タブを表示しないことを指定します。
CM_NO_NAMECHANGE
64 (0x40)
名前を変更できないことを指定します。
CM_NO_EDITTRUST
128 (0x80)
信頼を編集できないことを指定します。
CM_HIDE_DETAILPAGE
256 (0x100)
Detail タブを表示しないことを指定します。
CM_ADD_CERT_STORES
512 (0x200)
証明書ストアを開くことを指定します。
szTitleLPWSTR8/4+32+16ユーザーインターフェイスのタイトルを表す、NULL で終わる文字列へのポインターです。
pCertContextCERT_CONTEXT*8/4+40+20表示する証明書の証明書コンテキストです。
arrayPurposesLPSTR*8/4+48+24証明書の用途を指定する、NULL で終わる文字列の配列へのポインターです。
cArrayPurposesDWORD4+56+28arrayPurposes 配列の要素数です。この値が 0 の場合、信頼状態は表示されません。
cRootStoresDWORD4+60+32rghstoreRoots 配列の要素数です。
rghstoreRootsHCERTSTORE*8/4+64+36ルート証明書ストアのハンドルの配列です。
cStoresDWORD4+72+40rghstoreCAs 配列の要素数です。
rghstoreCAsHCERTSTORE*8/4+80+44その他の証明書ストアのハンドルの配列です。
cTrustStoresDWORD4+88+48rghstoreTrust 配列の要素数です。
rghstoreTrustHCERTSTORE*8/4+96+52信頼された証明書ストアのハンドルの配列です。
hprovUINT_PTR8/4+104+56検証に使用する 暗号化サービスプロバイダー (CSP) へのハンドルです。
lCustDataLPARAM8/4+112+60カスタムデータとして使用される値です。
dwPadDWORD4+120+64パディングの位置です。
szHelpFileNameLPWSTR8/4+128+68ヘルプファイル名を表す、NULL で終わる文字列へのポインターです。
dwHelpIdDWORD4+136+72ヘルプファイルのトピックの ID です。
nStartPageDWORD4+140+76最初のプロパティページの番号です。
cArrayPropSheetPagesDWORD4+144+80arrayPropSheetPages 配列の要素数です。
arrayPropSheetPagesPROPSHEETPAGEA*8/4+152+84プロパティページを指定する PROPSHEETPAGE 構造体の配列へのポインターです。

公式ドキュメント

[CERT_VIEWPROPERTIES_STRUCT 構造体は、要件セクションに示されているオペレーティングシステムで使用できます。以降のバージョンでは変更または利用できなくなる可能性があります。]

CERT_VIEWPROPERTIES_STRUCT 構造体は、証明書のプロパティを表示するために CertViewProperties 関数を呼び出すときに使用される情報を定義します。

解説(Remarks)

メモ

cryptdlg.h ヘッダーは、UNICODE プリプロセッサ定数の定義に基づいて、この関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして CERT_VIEWPROPERTIES_STRUCT を定義します。エンコーディング中立のエイリアスと、エンコーディング中立でないコードを混在させて使用すると、不一致が生じてコンパイルエラーや実行時エラーの原因となることがあります。詳細については、関数プロトタイプの規則を参照してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// CERT_VIEWPROPERTIES_STRUCT_W  (x64 160 / x86 88 バイト)
typedef struct CERT_VIEWPROPERTIES_STRUCT_W {
    DWORD dwSize;
    HWND hwndParent;
    HINSTANCE hInstance;
    CERT_VIEWPROPERTIES_STRUCT_FLAGS dwFlags;
    LPWSTR szTitle;
    CERT_CONTEXT* pCertContext;
    LPSTR* arrayPurposes;
    DWORD cArrayPurposes;
    DWORD cRootStores;
    HCERTSTORE* rghstoreRoots;
    DWORD cStores;
    HCERTSTORE* rghstoreCAs;
    DWORD cTrustStores;
    HCERTSTORE* rghstoreTrust;
    UINT_PTR hprov;
    LPARAM lCustData;
    DWORD dwPad;
    LPWSTR szHelpFileName;
    DWORD dwHelpId;
    DWORD nStartPage;
    DWORD cArrayPropSheetPages;
    PROPSHEETPAGEA* arrayPropSheetPages;
} CERT_VIEWPROPERTIES_STRUCT_W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CERT_VIEWPROPERTIES_STRUCT_W
{
    public uint dwSize;
    public IntPtr hwndParent;
    public IntPtr hInstance;
    public uint dwFlags;
    public IntPtr szTitle;
    public IntPtr pCertContext;
    public IntPtr arrayPurposes;
    public uint cArrayPurposes;
    public uint cRootStores;
    public IntPtr rghstoreRoots;
    public uint cStores;
    public IntPtr rghstoreCAs;
    public uint cTrustStores;
    public IntPtr rghstoreTrust;
    public UIntPtr hprov;
    public IntPtr lCustData;
    public uint dwPad;
    public IntPtr szHelpFileName;
    public uint dwHelpId;
    public uint nStartPage;
    public uint cArrayPropSheetPages;
    public IntPtr arrayPropSheetPages;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CERT_VIEWPROPERTIES_STRUCT_W
    Public dwSize As UInteger
    Public hwndParent As IntPtr
    Public hInstance As IntPtr
    Public dwFlags As UInteger
    Public szTitle As IntPtr
    Public pCertContext As IntPtr
    Public arrayPurposes As IntPtr
    Public cArrayPurposes As UInteger
    Public cRootStores As UInteger
    Public rghstoreRoots As IntPtr
    Public cStores As UInteger
    Public rghstoreCAs As IntPtr
    Public cTrustStores As UInteger
    Public rghstoreTrust As IntPtr
    Public hprov As UIntPtr
    Public lCustData As IntPtr
    Public dwPad As UInteger
    Public szHelpFileName As IntPtr
    Public dwHelpId As UInteger
    Public nStartPage As UInteger
    Public cArrayPropSheetPages As UInteger
    Public arrayPropSheetPages As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CERT_VIEWPROPERTIES_STRUCT_W(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("hwndParent", ctypes.c_void_p),
        ("hInstance", ctypes.c_void_p),
        ("dwFlags", wintypes.DWORD),
        ("szTitle", ctypes.c_void_p),
        ("pCertContext", ctypes.c_void_p),
        ("arrayPurposes", ctypes.c_void_p),
        ("cArrayPurposes", wintypes.DWORD),
        ("cRootStores", wintypes.DWORD),
        ("rghstoreRoots", ctypes.c_void_p),
        ("cStores", wintypes.DWORD),
        ("rghstoreCAs", ctypes.c_void_p),
        ("cTrustStores", wintypes.DWORD),
        ("rghstoreTrust", ctypes.c_void_p),
        ("hprov", ctypes.c_size_t),
        ("lCustData", ctypes.c_ssize_t),
        ("dwPad", wintypes.DWORD),
        ("szHelpFileName", ctypes.c_void_p),
        ("dwHelpId", wintypes.DWORD),
        ("nStartPage", wintypes.DWORD),
        ("cArrayPropSheetPages", wintypes.DWORD),
        ("arrayPropSheetPages", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CERT_VIEWPROPERTIES_STRUCT_W {
    pub dwSize: u32,
    pub hwndParent: *mut core::ffi::c_void,
    pub hInstance: *mut core::ffi::c_void,
    pub dwFlags: u32,
    pub szTitle: *mut core::ffi::c_void,
    pub pCertContext: *mut core::ffi::c_void,
    pub arrayPurposes: *mut core::ffi::c_void,
    pub cArrayPurposes: u32,
    pub cRootStores: u32,
    pub rghstoreRoots: *mut core::ffi::c_void,
    pub cStores: u32,
    pub rghstoreCAs: *mut core::ffi::c_void,
    pub cTrustStores: u32,
    pub rghstoreTrust: *mut core::ffi::c_void,
    pub hprov: usize,
    pub lCustData: isize,
    pub dwPad: u32,
    pub szHelpFileName: *mut core::ffi::c_void,
    pub dwHelpId: u32,
    pub nStartPage: u32,
    pub cArrayPropSheetPages: u32,
    pub arrayPropSheetPages: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CERT_VIEWPROPERTIES_STRUCT_W struct {
	dwSize uint32
	hwndParent uintptr
	hInstance uintptr
	dwFlags uint32
	szTitle uintptr
	pCertContext uintptr
	arrayPurposes uintptr
	cArrayPurposes uint32
	cRootStores uint32
	rghstoreRoots uintptr
	cStores uint32
	rghstoreCAs uintptr
	cTrustStores uint32
	rghstoreTrust uintptr
	hprov uintptr
	lCustData uintptr
	dwPad uint32
	szHelpFileName uintptr
	dwHelpId uint32
	nStartPage uint32
	cArrayPropSheetPages uint32
	arrayPropSheetPages uintptr
}
type
  CERT_VIEWPROPERTIES_STRUCT_W = record
    dwSize: DWORD;
    hwndParent: Pointer;
    hInstance: Pointer;
    dwFlags: DWORD;
    szTitle: Pointer;
    pCertContext: Pointer;
    arrayPurposes: Pointer;
    cArrayPurposes: DWORD;
    cRootStores: DWORD;
    rghstoreRoots: Pointer;
    cStores: DWORD;
    rghstoreCAs: Pointer;
    cTrustStores: DWORD;
    rghstoreTrust: Pointer;
    hprov: NativeUInt;
    lCustData: NativeInt;
    dwPad: DWORD;
    szHelpFileName: Pointer;
    dwHelpId: DWORD;
    nStartPage: DWORD;
    cArrayPropSheetPages: DWORD;
    arrayPropSheetPages: Pointer;
  end;
const CERT_VIEWPROPERTIES_STRUCT_W = extern struct {
    dwSize: u32,
    hwndParent: ?*anyopaque,
    hInstance: ?*anyopaque,
    dwFlags: u32,
    szTitle: ?*anyopaque,
    pCertContext: ?*anyopaque,
    arrayPurposes: ?*anyopaque,
    cArrayPurposes: u32,
    cRootStores: u32,
    rghstoreRoots: ?*anyopaque,
    cStores: u32,
    rghstoreCAs: ?*anyopaque,
    cTrustStores: u32,
    rghstoreTrust: ?*anyopaque,
    hprov: usize,
    lCustData: isize,
    dwPad: u32,
    szHelpFileName: ?*anyopaque,
    dwHelpId: u32,
    nStartPage: u32,
    cArrayPropSheetPages: u32,
    arrayPropSheetPages: ?*anyopaque,
};
type
  CERT_VIEWPROPERTIES_STRUCT_W {.bycopy.} = object
    dwSize: uint32
    hwndParent: pointer
    hInstance: pointer
    dwFlags: uint32
    szTitle: pointer
    pCertContext: pointer
    arrayPurposes: pointer
    cArrayPurposes: uint32
    cRootStores: uint32
    rghstoreRoots: pointer
    cStores: uint32
    rghstoreCAs: pointer
    cTrustStores: uint32
    rghstoreTrust: pointer
    hprov: uint
    lCustData: int
    dwPad: uint32
    szHelpFileName: pointer
    dwHelpId: uint32
    nStartPage: uint32
    cArrayPropSheetPages: uint32
    arrayPropSheetPages: pointer
struct CERT_VIEWPROPERTIES_STRUCT_W
{
    uint dwSize;
    void* hwndParent;
    void* hInstance;
    uint dwFlags;
    void* szTitle;
    void* pCertContext;
    void* arrayPurposes;
    uint cArrayPurposes;
    uint cRootStores;
    void* rghstoreRoots;
    uint cStores;
    void* rghstoreCAs;
    uint cTrustStores;
    void* rghstoreTrust;
    size_t hprov;
    ptrdiff_t lCustData;
    uint dwPad;
    void* szHelpFileName;
    uint dwHelpId;
    uint nStartPage;
    uint cArrayPropSheetPages;
    void* arrayPropSheetPages;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CERT_VIEWPROPERTIES_STRUCT_W サイズ: 88 バイト(x86)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndParent : HWND (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; hInstance : HINSTANCE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwFlags : CERT_VIEWPROPERTIES_STRUCT_FLAGS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; szTitle : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pCertContext : CERT_CONTEXT* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; arrayPurposes : LPSTR* (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cArrayPurposes : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; cRootStores : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; rghstoreRoots : HCERTSTORE* (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; cStores : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; rghstoreCAs : HCERTSTORE* (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; cTrustStores : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; rghstoreTrust : HCERTSTORE* (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; hprov : UINT_PTR (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; lCustData : LPARAM (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwPad : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; szHelpFileName : LPWSTR (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; dwHelpId : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; nStartPage : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; cArrayPropSheetPages : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; arrayPropSheetPages : PROPSHEETPAGEA* (+84, 4byte)  varptr(st)+84 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CERT_VIEWPROPERTIES_STRUCT_W サイズ: 160 バイト(x64)
dim st, 40    ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndParent : HWND (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hInstance : HINSTANCE (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwFlags : CERT_VIEWPROPERTIES_STRUCT_FLAGS (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; szTitle : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pCertContext : CERT_CONTEXT* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; arrayPurposes : LPSTR* (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; cArrayPurposes : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; cRootStores : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; rghstoreRoots : HCERTSTORE* (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; cStores : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; rghstoreCAs : HCERTSTORE* (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; cTrustStores : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; rghstoreTrust : HCERTSTORE* (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; hprov : UINT_PTR (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; lCustData : LPARAM (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; dwPad : DWORD (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; szHelpFileName : LPWSTR (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; dwHelpId : DWORD (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; nStartPage : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; cArrayPropSheetPages : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; arrayPropSheetPages : PROPSHEETPAGEA* (+152, 8byte)  varptr(st)+152 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CERT_VIEWPROPERTIES_STRUCT_W
    #field int dwSize
    #field intptr hwndParent
    #field intptr hInstance
    #field int dwFlags
    #field intptr szTitle
    #field intptr pCertContext
    #field intptr arrayPurposes
    #field int cArrayPurposes
    #field int cRootStores
    #field intptr rghstoreRoots
    #field int cStores
    #field intptr rghstoreCAs
    #field int cTrustStores
    #field intptr rghstoreTrust
    #field intptr hprov
    #field intptr lCustData
    #field int dwPad
    #field intptr szHelpFileName
    #field int dwHelpId
    #field int nStartPage
    #field int cArrayPropSheetPages
    #field intptr arrayPropSheetPages
#endstruct

stdim st, CERT_VIEWPROPERTIES_STRUCT_W        ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize