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

CTL_VERIFY_USAGE_STATUS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト単位)。
dwErrorDWORD4+4+4検証結果のエラーコード。0は成功。
dwFlagsDWORD4+8+8検証状態を示すフラグ。
ppCtlCTL_CONTEXT**8/4+16+12検証に使われたCTLコンテキストへのポインタのアドレス。
dwCtlEntryIndexDWORD4+24+16対象がCTL内で見つかったエントリのインデックス。
ppSignerCERT_CONTEXT**8/4+32+20CTL署名者の証明書コンテキストへのポインタのアドレス。
dwSignerIndexDWORD4+40+24署名者のインデックス。

各言語での定義

#include <windows.h>

// CTL_VERIFY_USAGE_STATUS  (x64 48 / x86 28 バイト)
typedef struct CTL_VERIFY_USAGE_STATUS {
    DWORD cbSize;
    DWORD dwError;
    DWORD dwFlags;
    CTL_CONTEXT** ppCtl;
    DWORD dwCtlEntryIndex;
    CERT_CONTEXT** ppSigner;
    DWORD dwSignerIndex;
} CTL_VERIFY_USAGE_STATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CTL_VERIFY_USAGE_STATUS
{
    public uint cbSize;
    public uint dwError;
    public uint dwFlags;
    public IntPtr ppCtl;
    public uint dwCtlEntryIndex;
    public IntPtr ppSigner;
    public uint dwSignerIndex;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CTL_VERIFY_USAGE_STATUS
    Public cbSize As UInteger
    Public dwError As UInteger
    Public dwFlags As UInteger
    Public ppCtl As IntPtr
    Public dwCtlEntryIndex As UInteger
    Public ppSigner As IntPtr
    Public dwSignerIndex As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CTL_VERIFY_USAGE_STATUS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwError", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("ppCtl", ctypes.c_void_p),
        ("dwCtlEntryIndex", wintypes.DWORD),
        ("ppSigner", ctypes.c_void_p),
        ("dwSignerIndex", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CTL_VERIFY_USAGE_STATUS {
    pub cbSize: u32,
    pub dwError: u32,
    pub dwFlags: u32,
    pub ppCtl: *mut core::ffi::c_void,
    pub dwCtlEntryIndex: u32,
    pub ppSigner: *mut core::ffi::c_void,
    pub dwSignerIndex: u32,
}
import "golang.org/x/sys/windows"

type CTL_VERIFY_USAGE_STATUS struct {
	cbSize uint32
	dwError uint32
	dwFlags uint32
	ppCtl uintptr
	dwCtlEntryIndex uint32
	ppSigner uintptr
	dwSignerIndex uint32
}
type
  CTL_VERIFY_USAGE_STATUS = record
    cbSize: DWORD;
    dwError: DWORD;
    dwFlags: DWORD;
    ppCtl: Pointer;
    dwCtlEntryIndex: DWORD;
    ppSigner: Pointer;
    dwSignerIndex: DWORD;
  end;
const CTL_VERIFY_USAGE_STATUS = extern struct {
    cbSize: u32,
    dwError: u32,
    dwFlags: u32,
    ppCtl: ?*anyopaque,
    dwCtlEntryIndex: u32,
    ppSigner: ?*anyopaque,
    dwSignerIndex: u32,
};
type
  CTL_VERIFY_USAGE_STATUS {.bycopy.} = object
    cbSize: uint32
    dwError: uint32
    dwFlags: uint32
    ppCtl: pointer
    dwCtlEntryIndex: uint32
    ppSigner: pointer
    dwSignerIndex: uint32
struct CTL_VERIFY_USAGE_STATUS
{
    uint cbSize;
    uint dwError;
    uint dwFlags;
    void* ppCtl;
    uint dwCtlEntryIndex;
    void* ppSigner;
    uint dwSignerIndex;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CTL_VERIFY_USAGE_STATUS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwError : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ppCtl : CTL_CONTEXT** (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; dwCtlEntryIndex : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ppSigner : CERT_CONTEXT** (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; dwSignerIndex : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CTL_VERIFY_USAGE_STATUS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwError : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ppCtl : CTL_CONTEXT** (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwCtlEntryIndex : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ppSigner : CERT_CONTEXT** (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; dwSignerIndex : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CTL_VERIFY_USAGE_STATUS
    #field int cbSize
    #field int dwError
    #field int dwFlags
    #field intptr ppCtl
    #field int dwCtlEntryIndex
    #field intptr ppSigner
    #field int dwSignerIndex
#endstruct

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