Win32 API 日本語リファレンス
ホームSystem.Environment › VBS_ENCLAVE_REPORT_PKG_HEADER

VBS_ENCLAVE_REPORT_PKG_HEADER

構造体
サイズx64: 24 バイト / x86: 24 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
PackageSizeDWORD4+0+0レポートパッケージ全体のバイトサイズ。
VersionDWORD4+4+4パッケージフォーマットのバージョン。
SignatureSchemeDWORD4+8+8署名に用いた方式の識別子。
SignedStatementSizeDWORD4+12+12署名対象ステートメントのバイトサイズ。
SignatureSizeDWORD4+16+16署名データのバイトサイズ。
ReservedDWORD4+20+20予約フィールド。0であること。

各言語での定義

#include <windows.h>

// VBS_ENCLAVE_REPORT_PKG_HEADER  (x64 24 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct VBS_ENCLAVE_REPORT_PKG_HEADER {
    DWORD PackageSize;
    DWORD Version;
    DWORD SignatureScheme;
    DWORD SignedStatementSize;
    DWORD SignatureSize;
    DWORD Reserved;
} VBS_ENCLAVE_REPORT_PKG_HEADER;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct VBS_ENCLAVE_REPORT_PKG_HEADER
{
    public uint PackageSize;
    public uint Version;
    public uint SignatureScheme;
    public uint SignedStatementSize;
    public uint SignatureSize;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure VBS_ENCLAVE_REPORT_PKG_HEADER
    Public PackageSize As UInteger
    Public Version As UInteger
    Public SignatureScheme As UInteger
    Public SignedStatementSize As UInteger
    Public SignatureSize As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class VBS_ENCLAVE_REPORT_PKG_HEADER(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("PackageSize", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("SignatureScheme", wintypes.DWORD),
        ("SignedStatementSize", wintypes.DWORD),
        ("SignatureSize", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct VBS_ENCLAVE_REPORT_PKG_HEADER {
    pub PackageSize: u32,
    pub Version: u32,
    pub SignatureScheme: u32,
    pub SignedStatementSize: u32,
    pub SignatureSize: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type VBS_ENCLAVE_REPORT_PKG_HEADER struct {
	PackageSize uint32
	Version uint32
	SignatureScheme uint32
	SignedStatementSize uint32
	SignatureSize uint32
	Reserved uint32
}
type
  VBS_ENCLAVE_REPORT_PKG_HEADER = packed record
    PackageSize: DWORD;
    Version: DWORD;
    SignatureScheme: DWORD;
    SignedStatementSize: DWORD;
    SignatureSize: DWORD;
    Reserved: DWORD;
  end;
const VBS_ENCLAVE_REPORT_PKG_HEADER = extern struct {
    PackageSize: u32,
    Version: u32,
    SignatureScheme: u32,
    SignedStatementSize: u32,
    SignatureSize: u32,
    Reserved: u32,
};
type
  VBS_ENCLAVE_REPORT_PKG_HEADER {.packed.} = object
    PackageSize: uint32
    Version: uint32
    SignatureScheme: uint32
    SignedStatementSize: uint32
    SignatureSize: uint32
    Reserved: uint32
align(1)
struct VBS_ENCLAVE_REPORT_PKG_HEADER
{
    uint PackageSize;
    uint Version;
    uint SignatureScheme;
    uint SignedStatementSize;
    uint SignatureSize;
    uint Reserved;
}

HSP用 定義

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

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

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