Win32 API 日本語リファレンス
ホームSecurity.WinTrust › CONFIG_CI_PROV_INFO

CONFIG_CI_PROV_INFO

構造体
サイズx64: 48 バイト / x86: 36 バイト

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0本構造体のバイトサイズ。
dwPoliciesDWORD4+4+4pPolicies配列に含まれるポリシー数。
pPoliciesCRYPT_INTEGER_BLOB*8/4+8+8適用するコード整合性ポリシーのBLOB配列へのポインタ。
resultCONFIG_CI_PROV_INFO_RESULT16+16+12コード整合性検証の結果情報を保持する構造体。
dwScenarioDWORD4+32+28検証シナリオの種別を表す。
result2CONFIG_CI_PROV_INFO_RESULT2*8/4+40+32拡張検証結果情報構造体へのポインタ。NULL可。

各言語での定義

#include <windows.h>

// CONFIG_CI_PROV_INFO_RESULT  (x64 16 / x86 16 バイト)
typedef struct CONFIG_CI_PROV_INFO_RESULT {
    HRESULT hr;
    DWORD dwResult;
    DWORD dwPolicyIndex;
    BOOLEAN fIsExplicitDeny;
} CONFIG_CI_PROV_INFO_RESULT;

// CONFIG_CI_PROV_INFO  (x64 48 / x86 36 バイト)
typedef struct CONFIG_CI_PROV_INFO {
    DWORD cbSize;
    DWORD dwPolicies;
    CRYPT_INTEGER_BLOB* pPolicies;
    CONFIG_CI_PROV_INFO_RESULT result;
    DWORD dwScenario;
    CONFIG_CI_PROV_INFO_RESULT2* result2;
} CONFIG_CI_PROV_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CONFIG_CI_PROV_INFO_RESULT
{
    public int hr;
    public uint dwResult;
    public uint dwPolicyIndex;
    [MarshalAs(UnmanagedType.U1)] public bool fIsExplicitDeny;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CONFIG_CI_PROV_INFO
{
    public uint cbSize;
    public uint dwPolicies;
    public IntPtr pPolicies;
    public CONFIG_CI_PROV_INFO_RESULT result;
    public uint dwScenario;
    public IntPtr result2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CONFIG_CI_PROV_INFO_RESULT
    Public hr As Integer
    Public dwResult As UInteger
    Public dwPolicyIndex As UInteger
    <MarshalAs(UnmanagedType.U1)> Public fIsExplicitDeny As Boolean
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CONFIG_CI_PROV_INFO
    Public cbSize As UInteger
    Public dwPolicies As UInteger
    Public pPolicies As IntPtr
    Public result As CONFIG_CI_PROV_INFO_RESULT
    Public dwScenario As UInteger
    Public result2 As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CONFIG_CI_PROV_INFO_RESULT(ctypes.Structure):
    _fields_ = [
        ("hr", ctypes.c_int),
        ("dwResult", wintypes.DWORD),
        ("dwPolicyIndex", wintypes.DWORD),
        ("fIsExplicitDeny", ctypes.c_byte),
    ]

class CONFIG_CI_PROV_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwPolicies", wintypes.DWORD),
        ("pPolicies", ctypes.c_void_p),
        ("result", CONFIG_CI_PROV_INFO_RESULT),
        ("dwScenario", wintypes.DWORD),
        ("result2", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CONFIG_CI_PROV_INFO_RESULT {
    pub hr: i32,
    pub dwResult: u32,
    pub dwPolicyIndex: u32,
    pub fIsExplicitDeny: u8,
}

#[repr(C)]
pub struct CONFIG_CI_PROV_INFO {
    pub cbSize: u32,
    pub dwPolicies: u32,
    pub pPolicies: *mut core::ffi::c_void,
    pub result: CONFIG_CI_PROV_INFO_RESULT,
    pub dwScenario: u32,
    pub result2: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CONFIG_CI_PROV_INFO_RESULT struct {
	hr int32
	dwResult uint32
	dwPolicyIndex uint32
	fIsExplicitDeny byte
}

type CONFIG_CI_PROV_INFO struct {
	cbSize uint32
	dwPolicies uint32
	pPolicies uintptr
	result CONFIG_CI_PROV_INFO_RESULT
	dwScenario uint32
	result2 uintptr
}
type
  CONFIG_CI_PROV_INFO_RESULT = record
    hr: Integer;
    dwResult: DWORD;
    dwPolicyIndex: DWORD;
    fIsExplicitDeny: ByteBool;
  end;

  CONFIG_CI_PROV_INFO = record
    cbSize: DWORD;
    dwPolicies: DWORD;
    pPolicies: Pointer;
    result: CONFIG_CI_PROV_INFO_RESULT;
    dwScenario: DWORD;
    result2: Pointer;
  end;
const CONFIG_CI_PROV_INFO_RESULT = extern struct {
    hr: i32,
    dwResult: u32,
    dwPolicyIndex: u32,
    fIsExplicitDeny: u8,
};

const CONFIG_CI_PROV_INFO = extern struct {
    cbSize: u32,
    dwPolicies: u32,
    pPolicies: ?*anyopaque,
    result: CONFIG_CI_PROV_INFO_RESULT,
    dwScenario: u32,
    result2: ?*anyopaque,
};
type
  CONFIG_CI_PROV_INFO_RESULT {.bycopy.} = object
    hr: int32
    dwResult: uint32
    dwPolicyIndex: uint32
    fIsExplicitDeny: uint8

  CONFIG_CI_PROV_INFO {.bycopy.} = object
    cbSize: uint32
    dwPolicies: uint32
    pPolicies: pointer
    result: CONFIG_CI_PROV_INFO_RESULT
    dwScenario: uint32
    result2: pointer
struct CONFIG_CI_PROV_INFO_RESULT
{
    int hr;
    uint dwResult;
    uint dwPolicyIndex;
    ubyte fIsExplicitDeny;
}

struct CONFIG_CI_PROV_INFO
{
    uint cbSize;
    uint dwPolicies;
    void* pPolicies;
    CONFIG_CI_PROV_INFO_RESULT result;
    uint dwScenario;
    void* result2;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CONFIG_CI_PROV_INFO サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwPolicies : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pPolicies : CRYPT_INTEGER_BLOB* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; result : CONFIG_CI_PROV_INFO_RESULT (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; dwScenario : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; result2 : CONFIG_CI_PROV_INFO_RESULT2* (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CONFIG_CI_PROV_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwPolicies : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pPolicies : CRYPT_INTEGER_BLOB* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; result : CONFIG_CI_PROV_INFO_RESULT (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; dwScenario : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; result2 : CONFIG_CI_PROV_INFO_RESULT2* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CONFIG_CI_PROV_INFO_RESULT
    #field int hr
    #field int dwResult
    #field int dwPolicyIndex
    #field bool1 fIsExplicitDeny
#endstruct

#defstruct global CONFIG_CI_PROV_INFO
    #field int cbSize
    #field int dwPolicies
    #field intptr pPolicies
    #field CONFIG_CI_PROV_INFO_RESULT result
    #field int dwScenario
    #field intptr result2
#endstruct

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