ホーム › Devices.Nfc › SECURE_ELEMENT_ROUTING_TABLE
SECURE_ELEMENT_ROUTING_TABLE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumberOfEntries | DWORD | 4 | +0 | +0 | TableEntries内のルーティングエントリ数を表す。 |
| TableEntries | SECURE_ELEMENT_ROUTING_TABLE_ENTRY | 40 | +4 | +4 | SECURE_ELEMENT_ROUTING_TABLE_ENTRYの可変長配列の先頭。 |
各言語での定義
#include <windows.h>
// SECURE_ELEMENT_ROUTING_TABLE_ENTRY (x64 40 / x86 40 バイト)
typedef struct SECURE_ELEMENT_ROUTING_TABLE_ENTRY {
SECURE_ELEMENT_ROUTING_TYPE eRoutingType;
_Anonymous_e__Union Anonymous;
} SECURE_ELEMENT_ROUTING_TABLE_ENTRY;
// SECURE_ELEMENT_ROUTING_TABLE (x64 44 / x86 44 バイト)
typedef struct SECURE_ELEMENT_ROUTING_TABLE {
DWORD NumberOfEntries;
SECURE_ELEMENT_ROUTING_TABLE_ENTRY TableEntries[1];
} SECURE_ELEMENT_ROUTING_TABLE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECURE_ELEMENT_ROUTING_TABLE_ENTRY
{
public int eRoutingType;
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECURE_ELEMENT_ROUTING_TABLE
{
public uint NumberOfEntries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public SECURE_ELEMENT_ROUTING_TABLE_ENTRY[] TableEntries;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECURE_ELEMENT_ROUTING_TABLE_ENTRY
Public eRoutingType As Integer
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECURE_ELEMENT_ROUTING_TABLE
Public NumberOfEntries As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public TableEntries() As SECURE_ELEMENT_ROUTING_TABLE_ENTRY
End Structureimport ctypes
from ctypes import wintypes
class SECURE_ELEMENT_ROUTING_TABLE_ENTRY(ctypes.Structure):
_fields_ = [
("eRoutingType", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
]
class SECURE_ELEMENT_ROUTING_TABLE(ctypes.Structure):
_fields_ = [
("NumberOfEntries", wintypes.DWORD),
("TableEntries", SECURE_ELEMENT_ROUTING_TABLE_ENTRY * 1),
]#[repr(C)]
pub struct SECURE_ELEMENT_ROUTING_TABLE_ENTRY {
pub eRoutingType: i32,
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct SECURE_ELEMENT_ROUTING_TABLE {
pub NumberOfEntries: u32,
pub TableEntries: [SECURE_ELEMENT_ROUTING_TABLE_ENTRY; 1],
}import "golang.org/x/sys/windows"
type SECURE_ELEMENT_ROUTING_TABLE_ENTRY struct {
eRoutingType int32
Anonymous _Anonymous_e__Union
}
type SECURE_ELEMENT_ROUTING_TABLE struct {
NumberOfEntries uint32
TableEntries [1]SECURE_ELEMENT_ROUTING_TABLE_ENTRY
}type
SECURE_ELEMENT_ROUTING_TABLE_ENTRY = record
eRoutingType: Integer;
Anonymous: _Anonymous_e__Union;
end;
SECURE_ELEMENT_ROUTING_TABLE = record
NumberOfEntries: DWORD;
TableEntries: array[0..0] of SECURE_ELEMENT_ROUTING_TABLE_ENTRY;
end;const SECURE_ELEMENT_ROUTING_TABLE_ENTRY = extern struct {
eRoutingType: i32,
Anonymous: _Anonymous_e__Union,
};
const SECURE_ELEMENT_ROUTING_TABLE = extern struct {
NumberOfEntries: u32,
TableEntries: [1]SECURE_ELEMENT_ROUTING_TABLE_ENTRY,
};type
SECURE_ELEMENT_ROUTING_TABLE_ENTRY {.bycopy.} = object
eRoutingType: int32
Anonymous: _Anonymous_e__Union
SECURE_ELEMENT_ROUTING_TABLE {.bycopy.} = object
NumberOfEntries: uint32
TableEntries: array[1, SECURE_ELEMENT_ROUTING_TABLE_ENTRY]struct SECURE_ELEMENT_ROUTING_TABLE_ENTRY
{
int eRoutingType;
_Anonymous_e__Union Anonymous;
}
struct SECURE_ELEMENT_ROUTING_TABLE
{
uint NumberOfEntries;
SECURE_ELEMENT_ROUTING_TABLE_ENTRY[1] TableEntries;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SECURE_ELEMENT_ROUTING_TABLE サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; NumberOfEntries : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TableEntries : SECURE_ELEMENT_ROUTING_TABLE_ENTRY (+4, 40byte) varptr(st)+4 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SECURE_ELEMENT_ROUTING_TABLE_ENTRY
#field int eRoutingType
#field byte Anonymous 36
#endstruct
#defstruct global SECURE_ELEMENT_ROUTING_TABLE
#field int NumberOfEntries
#field SECURE_ELEMENT_ROUTING_TABLE_ENTRY TableEntries 1
#endstruct
stdim st, SECURE_ELEMENT_ROUTING_TABLE ; NSTRUCT 変数を確保
st->NumberOfEntries = 100
mes "NumberOfEntries=" + st->NumberOfEntries