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

TPM_WNF_PROVISIONING

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

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

フィールド

フィールドサイズx64x86説明
statusDWORD4+0+0TPMプロビジョニングの状態を示す値。
messageBYTE28+4+4プロビジョニングに関する付随メッセージを格納するバイト配列。

各言語での定義

#include <windows.h>

// TPM_WNF_PROVISIONING  (x64 32 / x86 32 バイト)
typedef struct TPM_WNF_PROVISIONING {
    DWORD status;
    BYTE message[28];
} TPM_WNF_PROVISIONING;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TPM_WNF_PROVISIONING
{
    public uint status;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] public byte[] message;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TPM_WNF_PROVISIONING
    Public status As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=28)> Public message() As Byte
End Structure
import ctypes
from ctypes import wintypes

class TPM_WNF_PROVISIONING(ctypes.Structure):
    _fields_ = [
        ("status", wintypes.DWORD),
        ("message", ctypes.c_ubyte * 28),
    ]
#[repr(C)]
pub struct TPM_WNF_PROVISIONING {
    pub status: u32,
    pub message: [u8; 28],
}
import "golang.org/x/sys/windows"

type TPM_WNF_PROVISIONING struct {
	status uint32
	message [28]byte
}
type
  TPM_WNF_PROVISIONING = record
    status: DWORD;
    message: array[0..27] of Byte;
  end;
const TPM_WNF_PROVISIONING = extern struct {
    status: u32,
    message: [28]u8,
};
type
  TPM_WNF_PROVISIONING {.bycopy.} = object
    status: uint32
    message: array[28, uint8]
struct TPM_WNF_PROVISIONING
{
    uint status;
    ubyte[28] message;
}

HSP用 定義

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

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

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