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

CERT_REVOCATION_STATUS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト単位)。呼び出し前に設定が必要。
dwIndexDWORD4+4+4失効した証明書の配列内インデックス。
dwErrorDWORD4+8+8失効確認のエラーコード。0は成功。
dwReasonCERT_REVOCATION_STATUS_REASON4+12+12失効理由を示すコード。
fHasFreshnessTimeBOOL4+16+16dwFreshnessTimeが有効かを示すブール値。
dwFreshnessTimeDWORD4+20+20失効情報の鮮度(秒単位)。fHasFreshnessTimeがTRUEで有効。

各言語での定義

#include <windows.h>

// CERT_REVOCATION_STATUS  (x64 24 / x86 24 バイト)
typedef struct CERT_REVOCATION_STATUS {
    DWORD cbSize;
    DWORD dwIndex;
    DWORD dwError;
    CERT_REVOCATION_STATUS_REASON dwReason;
    BOOL fHasFreshnessTime;
    DWORD dwFreshnessTime;
} CERT_REVOCATION_STATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CERT_REVOCATION_STATUS
{
    public uint cbSize;
    public uint dwIndex;
    public uint dwError;
    public uint dwReason;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasFreshnessTime;
    public uint dwFreshnessTime;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CERT_REVOCATION_STATUS
    Public cbSize As UInteger
    Public dwIndex As UInteger
    Public dwError As UInteger
    Public dwReason As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public fHasFreshnessTime As Boolean
    Public dwFreshnessTime As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CERT_REVOCATION_STATUS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwIndex", wintypes.DWORD),
        ("dwError", wintypes.DWORD),
        ("dwReason", wintypes.DWORD),
        ("fHasFreshnessTime", wintypes.BOOL),
        ("dwFreshnessTime", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CERT_REVOCATION_STATUS {
    pub cbSize: u32,
    pub dwIndex: u32,
    pub dwError: u32,
    pub dwReason: u32,
    pub fHasFreshnessTime: i32,
    pub dwFreshnessTime: u32,
}
import "golang.org/x/sys/windows"

type CERT_REVOCATION_STATUS struct {
	cbSize uint32
	dwIndex uint32
	dwError uint32
	dwReason uint32
	fHasFreshnessTime int32
	dwFreshnessTime uint32
}
type
  CERT_REVOCATION_STATUS = record
    cbSize: DWORD;
    dwIndex: DWORD;
    dwError: DWORD;
    dwReason: DWORD;
    fHasFreshnessTime: BOOL;
    dwFreshnessTime: DWORD;
  end;
const CERT_REVOCATION_STATUS = extern struct {
    cbSize: u32,
    dwIndex: u32,
    dwError: u32,
    dwReason: u32,
    fHasFreshnessTime: i32,
    dwFreshnessTime: u32,
};
type
  CERT_REVOCATION_STATUS {.bycopy.} = object
    cbSize: uint32
    dwIndex: uint32
    dwError: uint32
    dwReason: uint32
    fHasFreshnessTime: int32
    dwFreshnessTime: uint32
struct CERT_REVOCATION_STATUS
{
    uint cbSize;
    uint dwIndex;
    uint dwError;
    uint dwReason;
    int fHasFreshnessTime;
    uint dwFreshnessTime;
}

HSP用 定義

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

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

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