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

CONFIG_CI_PROV_INFO_RESULT

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

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

フィールド

フィールドサイズx64x86説明
hrHRESULT4+0+0コード整合性(CI)検証のHRESULT結果コード。
dwResultDWORD4+4+4検証結果のコードを表す。
dwPolicyIndexDWORD4+8+8判定に適用されたポリシーのインデックス。
fIsExplicitDenyBOOLEAN1+12+12明示的な拒否によるものかを示すフラグ。

各言語での定義

#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;
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;
}
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
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),
    ]
#[repr(C)]
pub struct CONFIG_CI_PROV_INFO_RESULT {
    pub hr: i32,
    pub dwResult: u32,
    pub dwPolicyIndex: u32,
    pub fIsExplicitDeny: u8,
}
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_RESULT = record
    hr: Integer;
    dwResult: DWORD;
    dwPolicyIndex: DWORD;
    fIsExplicitDeny: ByteBool;
  end;
const CONFIG_CI_PROV_INFO_RESULT = extern struct {
    hr: i32,
    dwResult: u32,
    dwPolicyIndex: u32,
    fIsExplicitDeny: u8,
};
type
  CONFIG_CI_PROV_INFO_RESULT {.bycopy.} = object
    hr: int32
    dwResult: uint32
    dwPolicyIndex: uint32
    fIsExplicitDeny: uint8
struct CONFIG_CI_PROV_INFO_RESULT
{
    int hr;
    uint dwResult;
    uint dwPolicyIndex;
    ubyte fIsExplicitDeny;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CONFIG_CI_PROV_INFO_RESULT サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; hr : HRESULT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwResult : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwPolicyIndex : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fIsExplicitDeny : BOOLEAN (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CONFIG_CI_PROV_INFO_RESULT
    #field int hr
    #field int dwResult
    #field int dwPolicyIndex
    #field bool1 fIsExplicitDeny
#endstruct

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