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

SECURE_ELEMENT_NFCC_CAPABILITIES

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

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

フィールド

フィールドサイズx64x86説明
cbMaxRoutingTableSizeWORD2+0+0NFCコントローラがサポートする最大ルーティングテーブルサイズ。
IsAidRoutingSupportedBOOLEAN1+2+2AIDベースのルーティングをサポートするか否か。TRUEで対応。
IsProtocolRoutingSupportedBOOLEAN1+3+3プロトコルベースのルーティング対応可否を示す。
IsTechRoutingSupportedBOOLEAN1+4+4RF技術ベースのルーティング対応可否を示す。

各言語での定義

#include <windows.h>

// SECURE_ELEMENT_NFCC_CAPABILITIES  (x64 6 / x86 6 バイト)
typedef struct SECURE_ELEMENT_NFCC_CAPABILITIES {
    WORD cbMaxRoutingTableSize;
    BOOLEAN IsAidRoutingSupported;
    BOOLEAN IsProtocolRoutingSupported;
    BOOLEAN IsTechRoutingSupported;
} SECURE_ELEMENT_NFCC_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECURE_ELEMENT_NFCC_CAPABILITIES
{
    public ushort cbMaxRoutingTableSize;
    [MarshalAs(UnmanagedType.U1)] public bool IsAidRoutingSupported;
    [MarshalAs(UnmanagedType.U1)] public bool IsProtocolRoutingSupported;
    [MarshalAs(UnmanagedType.U1)] public bool IsTechRoutingSupported;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECURE_ELEMENT_NFCC_CAPABILITIES
    Public cbMaxRoutingTableSize As UShort
    <MarshalAs(UnmanagedType.U1)> Public IsAidRoutingSupported As Boolean
    <MarshalAs(UnmanagedType.U1)> Public IsProtocolRoutingSupported As Boolean
    <MarshalAs(UnmanagedType.U1)> Public IsTechRoutingSupported As Boolean
End Structure
import ctypes
from ctypes import wintypes

class SECURE_ELEMENT_NFCC_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("cbMaxRoutingTableSize", ctypes.c_ushort),
        ("IsAidRoutingSupported", ctypes.c_byte),
        ("IsProtocolRoutingSupported", ctypes.c_byte),
        ("IsTechRoutingSupported", ctypes.c_byte),
    ]
#[repr(C)]
pub struct SECURE_ELEMENT_NFCC_CAPABILITIES {
    pub cbMaxRoutingTableSize: u16,
    pub IsAidRoutingSupported: u8,
    pub IsProtocolRoutingSupported: u8,
    pub IsTechRoutingSupported: u8,
}
import "golang.org/x/sys/windows"

type SECURE_ELEMENT_NFCC_CAPABILITIES struct {
	cbMaxRoutingTableSize uint16
	IsAidRoutingSupported byte
	IsProtocolRoutingSupported byte
	IsTechRoutingSupported byte
}
type
  SECURE_ELEMENT_NFCC_CAPABILITIES = record
    cbMaxRoutingTableSize: Word;
    IsAidRoutingSupported: ByteBool;
    IsProtocolRoutingSupported: ByteBool;
    IsTechRoutingSupported: ByteBool;
  end;
const SECURE_ELEMENT_NFCC_CAPABILITIES = extern struct {
    cbMaxRoutingTableSize: u16,
    IsAidRoutingSupported: u8,
    IsProtocolRoutingSupported: u8,
    IsTechRoutingSupported: u8,
};
type
  SECURE_ELEMENT_NFCC_CAPABILITIES {.bycopy.} = object
    cbMaxRoutingTableSize: uint16
    IsAidRoutingSupported: uint8
    IsProtocolRoutingSupported: uint8
    IsTechRoutingSupported: uint8
struct SECURE_ELEMENT_NFCC_CAPABILITIES
{
    ushort cbMaxRoutingTableSize;
    ubyte IsAidRoutingSupported;
    ubyte IsProtocolRoutingSupported;
    ubyte IsTechRoutingSupported;
}

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_NFCC_CAPABILITIES サイズ: 6 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 6 / 4 切り上げ)
; cbMaxRoutingTableSize : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; IsAidRoutingSupported : BOOLEAN (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; IsProtocolRoutingSupported : BOOLEAN (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; IsTechRoutingSupported : BOOLEAN (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SECURE_ELEMENT_NFCC_CAPABILITIES
    #field short cbMaxRoutingTableSize
    #field bool1 IsAidRoutingSupported
    #field bool1 IsProtocolRoutingSupported
    #field bool1 IsTechRoutingSupported
#endstruct

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