ホーム › Security.Cryptography.UI › CERT_SELECT_STRUCT_W
CERT_SELECT_STRUCT_W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位サイズ。呼び出し前に設定する。 |
| hwndParent | HWND | 8/4 | +8 | +4 | ダイアログの親ウィンドウハンドル。NULL可。 |
| hInstance | HINSTANCE | 8/4 | +16 | +8 | テンプレートを含むモジュールのインスタンスハンドル。 |
| pTemplateName | LPWSTR | 8/4 | +24 | +12 | ダイアログテンプレート名を示すワイド文字列。NULL可。 |
| dwFlags | CERT_SELECT_STRUCT_FLAGS | 4 | +32 | +16 | 証明書選択ダイアログの動作を制御するフラグ。 |
| szTitle | LPWSTR | 8/4 | +40 | +20 | ダイアログのタイトルを示すワイド文字列。NULL可。 |
| cCertStore | DWORD | 4 | +48 | +24 | arrayCertStore配列の証明書ストア数。 |
| arrayCertStore | HCERTSTORE* | 8/4 | +56 | +28 | 選択候補となる証明書ストアハンドルの配列。 |
| szPurposeOid | LPSTR | 8/4 | +64 | +32 | 証明書の用途を絞り込むOIDのANSI文字列。NULL可。 |
| cCertContext | DWORD | 4 | +72 | +36 | 選択された証明書コンテキストの数(出力)。 |
| arrayCertContext | CERT_CONTEXT** | 8/4 | +80 | +40 | 選択された証明書コンテキストの配列(出力)。 |
| lCustData | LPARAM | 8/4 | +88 | +44 | コールバックに渡されるユーザー定義データ。 |
| pfnHook | PFNCMHOOKPROC | 8/4 | +96 | +48 | ダイアログのフックプロシージャ。NULL可。 |
| pfnFilter | PFNCMFILTERPROC | 8/4 | +104 | +52 | 証明書フィルタコールバック。NULL可。 |
| szHelpFileName | LPWSTR | 8/4 | +112 | +56 | ヘルプファイル名を示すワイド文字列。NULL可。 |
| dwHelpId | DWORD | 4 | +120 | +60 | ヘルプトピックの識別子。 |
| hprov | UINT_PTR | 8/4 | +128 | +64 | 暗号化サービスプロバイダーのハンドル。 |
各言語での定義
#include <windows.h>
// CERT_SELECT_STRUCT_W (x64 136 / x86 68 バイト)
typedef struct CERT_SELECT_STRUCT_W {
DWORD dwSize;
HWND hwndParent;
HINSTANCE hInstance;
LPWSTR pTemplateName;
CERT_SELECT_STRUCT_FLAGS dwFlags;
LPWSTR szTitle;
DWORD cCertStore;
HCERTSTORE* arrayCertStore;
LPSTR szPurposeOid;
DWORD cCertContext;
CERT_CONTEXT** arrayCertContext;
LPARAM lCustData;
PFNCMHOOKPROC pfnHook;
PFNCMFILTERPROC pfnFilter;
LPWSTR szHelpFileName;
DWORD dwHelpId;
UINT_PTR hprov;
} CERT_SELECT_STRUCT_W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CERT_SELECT_STRUCT_W
{
public uint dwSize;
public IntPtr hwndParent;
public IntPtr hInstance;
public IntPtr pTemplateName;
public uint dwFlags;
public IntPtr szTitle;
public uint cCertStore;
public IntPtr arrayCertStore;
public IntPtr szPurposeOid;
public uint cCertContext;
public IntPtr arrayCertContext;
public IntPtr lCustData;
public IntPtr pfnHook;
public IntPtr pfnFilter;
public IntPtr szHelpFileName;
public uint dwHelpId;
public UIntPtr hprov;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CERT_SELECT_STRUCT_W
Public dwSize As UInteger
Public hwndParent As IntPtr
Public hInstance As IntPtr
Public pTemplateName As IntPtr
Public dwFlags As UInteger
Public szTitle As IntPtr
Public cCertStore As UInteger
Public arrayCertStore As IntPtr
Public szPurposeOid As IntPtr
Public cCertContext As UInteger
Public arrayCertContext As IntPtr
Public lCustData As IntPtr
Public pfnHook As IntPtr
Public pfnFilter As IntPtr
Public szHelpFileName As IntPtr
Public dwHelpId As UInteger
Public hprov As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class CERT_SELECT_STRUCT_W(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("hwndParent", ctypes.c_void_p),
("hInstance", ctypes.c_void_p),
("pTemplateName", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
("szTitle", ctypes.c_void_p),
("cCertStore", wintypes.DWORD),
("arrayCertStore", ctypes.c_void_p),
("szPurposeOid", ctypes.c_void_p),
("cCertContext", wintypes.DWORD),
("arrayCertContext", ctypes.c_void_p),
("lCustData", ctypes.c_ssize_t),
("pfnHook", ctypes.c_void_p),
("pfnFilter", ctypes.c_void_p),
("szHelpFileName", ctypes.c_void_p),
("dwHelpId", wintypes.DWORD),
("hprov", ctypes.c_size_t),
]#[repr(C)]
pub struct CERT_SELECT_STRUCT_W {
pub dwSize: u32,
pub hwndParent: *mut core::ffi::c_void,
pub hInstance: *mut core::ffi::c_void,
pub pTemplateName: *mut core::ffi::c_void,
pub dwFlags: u32,
pub szTitle: *mut core::ffi::c_void,
pub cCertStore: u32,
pub arrayCertStore: *mut core::ffi::c_void,
pub szPurposeOid: *mut core::ffi::c_void,
pub cCertContext: u32,
pub arrayCertContext: *mut core::ffi::c_void,
pub lCustData: isize,
pub pfnHook: *mut core::ffi::c_void,
pub pfnFilter: *mut core::ffi::c_void,
pub szHelpFileName: *mut core::ffi::c_void,
pub dwHelpId: u32,
pub hprov: usize,
}import "golang.org/x/sys/windows"
type CERT_SELECT_STRUCT_W struct {
dwSize uint32
hwndParent uintptr
hInstance uintptr
pTemplateName uintptr
dwFlags uint32
szTitle uintptr
cCertStore uint32
arrayCertStore uintptr
szPurposeOid uintptr
cCertContext uint32
arrayCertContext uintptr
lCustData uintptr
pfnHook uintptr
pfnFilter uintptr
szHelpFileName uintptr
dwHelpId uint32
hprov uintptr
}type
CERT_SELECT_STRUCT_W = record
dwSize: DWORD;
hwndParent: Pointer;
hInstance: Pointer;
pTemplateName: Pointer;
dwFlags: DWORD;
szTitle: Pointer;
cCertStore: DWORD;
arrayCertStore: Pointer;
szPurposeOid: Pointer;
cCertContext: DWORD;
arrayCertContext: Pointer;
lCustData: NativeInt;
pfnHook: Pointer;
pfnFilter: Pointer;
szHelpFileName: Pointer;
dwHelpId: DWORD;
hprov: NativeUInt;
end;const CERT_SELECT_STRUCT_W = extern struct {
dwSize: u32,
hwndParent: ?*anyopaque,
hInstance: ?*anyopaque,
pTemplateName: ?*anyopaque,
dwFlags: u32,
szTitle: ?*anyopaque,
cCertStore: u32,
arrayCertStore: ?*anyopaque,
szPurposeOid: ?*anyopaque,
cCertContext: u32,
arrayCertContext: ?*anyopaque,
lCustData: isize,
pfnHook: ?*anyopaque,
pfnFilter: ?*anyopaque,
szHelpFileName: ?*anyopaque,
dwHelpId: u32,
hprov: usize,
};type
CERT_SELECT_STRUCT_W {.bycopy.} = object
dwSize: uint32
hwndParent: pointer
hInstance: pointer
pTemplateName: pointer
dwFlags: uint32
szTitle: pointer
cCertStore: uint32
arrayCertStore: pointer
szPurposeOid: pointer
cCertContext: uint32
arrayCertContext: pointer
lCustData: int
pfnHook: pointer
pfnFilter: pointer
szHelpFileName: pointer
dwHelpId: uint32
hprov: uintstruct CERT_SELECT_STRUCT_W
{
uint dwSize;
void* hwndParent;
void* hInstance;
void* pTemplateName;
uint dwFlags;
void* szTitle;
uint cCertStore;
void* arrayCertStore;
void* szPurposeOid;
uint cCertContext;
void* arrayCertContext;
ptrdiff_t lCustData;
void* pfnHook;
void* pfnFilter;
void* szHelpFileName;
uint dwHelpId;
size_t hprov;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CERT_SELECT_STRUCT_W サイズ: 68 バイト(x86)
dim st, 17 ; 4byte整数×17(構造体サイズ 68 / 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 も可)
; pTemplateName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFlags : CERT_SELECT_STRUCT_FLAGS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; szTitle : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; cCertStore : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; arrayCertStore : HCERTSTORE* (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; szPurposeOid : LPSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cCertContext : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; arrayCertContext : CERT_CONTEXT** (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; lCustData : LPARAM (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; pfnHook : PFNCMHOOKPROC (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pfnFilter : PFNCMFILTERPROC (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; szHelpFileName : LPWSTR (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; dwHelpId : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; hprov : UINT_PTR (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CERT_SELECT_STRUCT_W サイズ: 136 バイト(x64)
dim st, 34 ; 4byte整数×34(構造体サイズ 136 / 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,上位
; pTemplateName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwFlags : CERT_SELECT_STRUCT_FLAGS (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; szTitle : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cCertStore : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; arrayCertStore : HCERTSTORE* (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; szPurposeOid : LPSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; cCertContext : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; arrayCertContext : CERT_CONTEXT** (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; lCustData : LPARAM (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pfnHook : PFNCMHOOKPROC (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; pfnFilter : PFNCMFILTERPROC (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; szHelpFileName : LPWSTR (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; dwHelpId : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; hprov : UINT_PTR (+128, 8byte) qpoke st,128,値 / qpeek(st,128) ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CERT_SELECT_STRUCT_W
#field int dwSize
#field intptr hwndParent
#field intptr hInstance
#field intptr pTemplateName
#field int dwFlags
#field intptr szTitle
#field int cCertStore
#field intptr arrayCertStore
#field intptr szPurposeOid
#field int cCertContext
#field intptr arrayCertContext
#field intptr lCustData
#field intptr pfnHook
#field intptr pfnFilter
#field intptr szHelpFileName
#field int dwHelpId
#field intptr hprov
#endstruct
stdim st, CERT_SELECT_STRUCT_W ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize