Win32 API 日本語リファレンス
ホームDevices.Nfc › NFC_SE_ROUTING_TABLE

NFC_SE_ROUTING_TABLE

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

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

フィールド

フィールドサイズx64x86説明
NumberOfEntriesDWORD4+0+0TableEntries内のルーティングエントリ数を表す。
TableEntriesNFC_SE_ROUTING_TABLE_ENTRY40/32+8+4NFC_SE_ROUTING_TABLE_ENTRYの可変長配列の先頭。

各言語での定義

#include <windows.h>

// NFC_SE_ROUTING_TABLE_ENTRY  (x64 40 / x86 32 バイト)
typedef struct NFC_SE_ROUTING_TABLE_ENTRY {
    SECURE_ELEMENT_ROUTING_TYPE eRoutingType;
    _Anonymous_e__Union Anonymous;
} NFC_SE_ROUTING_TABLE_ENTRY;

// NFC_SE_ROUTING_TABLE  (x64 48 / x86 36 バイト)
typedef struct NFC_SE_ROUTING_TABLE {
    DWORD NumberOfEntries;
    NFC_SE_ROUTING_TABLE_ENTRY TableEntries[1];
} NFC_SE_ROUTING_TABLE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NFC_SE_ROUTING_TABLE_ENTRY
{
    public int eRoutingType;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NFC_SE_ROUTING_TABLE
{
    public uint NumberOfEntries;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public NFC_SE_ROUTING_TABLE_ENTRY[] TableEntries;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NFC_SE_ROUTING_TABLE_ENTRY
    Public eRoutingType As Integer
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NFC_SE_ROUTING_TABLE
    Public NumberOfEntries As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public TableEntries() As NFC_SE_ROUTING_TABLE_ENTRY
End Structure
import ctypes
from ctypes import wintypes

class NFC_SE_ROUTING_TABLE_ENTRY(ctypes.Structure):
    _fields_ = [
        ("eRoutingType", ctypes.c_int),
        ("Anonymous", _Anonymous_e__Union),
    ]

class NFC_SE_ROUTING_TABLE(ctypes.Structure):
    _fields_ = [
        ("NumberOfEntries", wintypes.DWORD),
        ("TableEntries", NFC_SE_ROUTING_TABLE_ENTRY * 1),
    ]
#[repr(C)]
pub struct NFC_SE_ROUTING_TABLE_ENTRY {
    pub eRoutingType: i32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct NFC_SE_ROUTING_TABLE {
    pub NumberOfEntries: u32,
    pub TableEntries: [NFC_SE_ROUTING_TABLE_ENTRY; 1],
}
import "golang.org/x/sys/windows"

type NFC_SE_ROUTING_TABLE_ENTRY struct {
	eRoutingType int32
	Anonymous _Anonymous_e__Union
}

type NFC_SE_ROUTING_TABLE struct {
	NumberOfEntries uint32
	TableEntries [1]NFC_SE_ROUTING_TABLE_ENTRY
}
type
  NFC_SE_ROUTING_TABLE_ENTRY = record
    eRoutingType: Integer;
    Anonymous: _Anonymous_e__Union;
  end;

  NFC_SE_ROUTING_TABLE = record
    NumberOfEntries: DWORD;
    TableEntries: array[0..0] of NFC_SE_ROUTING_TABLE_ENTRY;
  end;
const NFC_SE_ROUTING_TABLE_ENTRY = extern struct {
    eRoutingType: i32,
    Anonymous: _Anonymous_e__Union,
};

const NFC_SE_ROUTING_TABLE = extern struct {
    NumberOfEntries: u32,
    TableEntries: [1]NFC_SE_ROUTING_TABLE_ENTRY,
};
type
  NFC_SE_ROUTING_TABLE_ENTRY {.bycopy.} = object
    eRoutingType: int32
    Anonymous: _Anonymous_e__Union

  NFC_SE_ROUTING_TABLE {.bycopy.} = object
    NumberOfEntries: uint32
    TableEntries: array[1, NFC_SE_ROUTING_TABLE_ENTRY]
struct NFC_SE_ROUTING_TABLE_ENTRY
{
    int eRoutingType;
    _Anonymous_e__Union Anonymous;
}

struct NFC_SE_ROUTING_TABLE
{
    uint NumberOfEntries;
    NFC_SE_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整数の配列変数で操作します。(x86 レイアウト)
; NFC_SE_ROUTING_TABLE サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; NumberOfEntries : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TableEntries : NFC_SE_ROUTING_TABLE_ENTRY (+4, 32byte)  varptr(st)+4 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NFC_SE_ROUTING_TABLE サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; NumberOfEntries : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TableEntries : NFC_SE_ROUTING_TABLE_ENTRY (+8, 40byte)  varptr(st)+8 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NFC_SE_ROUTING_TABLE_ENTRY
    #field int eRoutingType
    #field byte Anonymous 32
#endstruct

#defstruct global NFC_SE_ROUTING_TABLE
    #field int NumberOfEntries
    #field NFC_SE_ROUTING_TABLE_ENTRY TableEntries 1
#endstruct

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