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

NFC_SE_LIST

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

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

フィールド

フィールドサイズx64x86説明
NumberOfEndpointsDWORD4+0+0EndpointList内のセキュアエレメント数を表す。
EndpointListNFC_SE_INFO16/8+8+4NFC_SE_INFOの可変長配列の先頭要素。

各言語での定義

#include <windows.h>

// NFC_SE_INFO  (x64 16 / x86 8 バイト)
typedef struct NFC_SE_INFO {
    INT_PTR hSecureElement;
    SECURE_ELEMENT_TYPE eSecureElementType;
} NFC_SE_INFO;

// NFC_SE_LIST  (x64 24 / x86 12 バイト)
typedef struct NFC_SE_LIST {
    DWORD NumberOfEndpoints;
    NFC_SE_INFO EndpointList[1];
} NFC_SE_LIST;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NFC_SE_INFO
{
    public IntPtr hSecureElement;
    public int eSecureElementType;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NFC_SE_LIST
{
    public uint NumberOfEndpoints;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public NFC_SE_INFO[] EndpointList;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NFC_SE_INFO
    Public hSecureElement As IntPtr
    Public eSecureElementType As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NFC_SE_LIST
    Public NumberOfEndpoints As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public EndpointList() As NFC_SE_INFO
End Structure
import ctypes
from ctypes import wintypes

class NFC_SE_INFO(ctypes.Structure):
    _fields_ = [
        ("hSecureElement", ctypes.c_ssize_t),
        ("eSecureElementType", ctypes.c_int),
    ]

class NFC_SE_LIST(ctypes.Structure):
    _fields_ = [
        ("NumberOfEndpoints", wintypes.DWORD),
        ("EndpointList", NFC_SE_INFO * 1),
    ]
#[repr(C)]
pub struct NFC_SE_INFO {
    pub hSecureElement: isize,
    pub eSecureElementType: i32,
}

#[repr(C)]
pub struct NFC_SE_LIST {
    pub NumberOfEndpoints: u32,
    pub EndpointList: [NFC_SE_INFO; 1],
}
import "golang.org/x/sys/windows"

type NFC_SE_INFO struct {
	hSecureElement uintptr
	eSecureElementType int32
}

type NFC_SE_LIST struct {
	NumberOfEndpoints uint32
	EndpointList [1]NFC_SE_INFO
}
type
  NFC_SE_INFO = record
    hSecureElement: NativeInt;
    eSecureElementType: Integer;
  end;

  NFC_SE_LIST = record
    NumberOfEndpoints: DWORD;
    EndpointList: array[0..0] of NFC_SE_INFO;
  end;
const NFC_SE_INFO = extern struct {
    hSecureElement: isize,
    eSecureElementType: i32,
};

const NFC_SE_LIST = extern struct {
    NumberOfEndpoints: u32,
    EndpointList: [1]NFC_SE_INFO,
};
type
  NFC_SE_INFO {.bycopy.} = object
    hSecureElement: int
    eSecureElementType: int32

  NFC_SE_LIST {.bycopy.} = object
    NumberOfEndpoints: uint32
    EndpointList: array[1, NFC_SE_INFO]
struct NFC_SE_INFO
{
    ptrdiff_t hSecureElement;
    int eSecureElementType;
}

struct NFC_SE_LIST
{
    uint NumberOfEndpoints;
    NFC_SE_INFO[1] EndpointList;
}

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

#defstruct global NFC_SE_LIST
    #field int NumberOfEndpoints
    #field NFC_SE_INFO EndpointList 1
#endstruct

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