ホーム › Security.Credentials › READER_SEL_RESPONSE
READER_SEL_RESPONSE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbReaderNameOffset | DWORD | 4 | +0 | +0 | 応答内のリーダー名へのバイトオフセット。 |
| cchReaderNameLength | DWORD | 4 | +4 | +4 | リーダー名の文字数。 |
| cbCardNameOffset | DWORD | 4 | +8 | +8 | 応答内のカード名へのバイトオフセット。 |
| cchCardNameLength | DWORD | 4 | +12 | +12 | カード名の文字数。 |
各言語での定義
#include <windows.h>
// READER_SEL_RESPONSE (x64 16 / x86 16 バイト)
typedef struct READER_SEL_RESPONSE {
DWORD cbReaderNameOffset;
DWORD cchReaderNameLength;
DWORD cbCardNameOffset;
DWORD cchCardNameLength;
} READER_SEL_RESPONSE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct READER_SEL_RESPONSE
{
public uint cbReaderNameOffset;
public uint cchReaderNameLength;
public uint cbCardNameOffset;
public uint cchCardNameLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure READER_SEL_RESPONSE
Public cbReaderNameOffset As UInteger
Public cchReaderNameLength As UInteger
Public cbCardNameOffset As UInteger
Public cchCardNameLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class READER_SEL_RESPONSE(ctypes.Structure):
_fields_ = [
("cbReaderNameOffset", wintypes.DWORD),
("cchReaderNameLength", wintypes.DWORD),
("cbCardNameOffset", wintypes.DWORD),
("cchCardNameLength", wintypes.DWORD),
]#[repr(C)]
pub struct READER_SEL_RESPONSE {
pub cbReaderNameOffset: u32,
pub cchReaderNameLength: u32,
pub cbCardNameOffset: u32,
pub cchCardNameLength: u32,
}import "golang.org/x/sys/windows"
type READER_SEL_RESPONSE struct {
cbReaderNameOffset uint32
cchReaderNameLength uint32
cbCardNameOffset uint32
cchCardNameLength uint32
}type
READER_SEL_RESPONSE = record
cbReaderNameOffset: DWORD;
cchReaderNameLength: DWORD;
cbCardNameOffset: DWORD;
cchCardNameLength: DWORD;
end;const READER_SEL_RESPONSE = extern struct {
cbReaderNameOffset: u32,
cchReaderNameLength: u32,
cbCardNameOffset: u32,
cchCardNameLength: u32,
};type
READER_SEL_RESPONSE {.bycopy.} = object
cbReaderNameOffset: uint32
cchReaderNameLength: uint32
cbCardNameOffset: uint32
cchCardNameLength: uint32struct READER_SEL_RESPONSE
{
uint cbReaderNameOffset;
uint cchReaderNameLength;
uint cbCardNameOffset;
uint cchCardNameLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; READER_SEL_RESPONSE サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cbReaderNameOffset : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cchReaderNameLength : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cbCardNameOffset : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cchCardNameLength : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global READER_SEL_RESPONSE
#field int cbReaderNameOffset
#field int cchReaderNameLength
#field int cbCardNameOffset
#field int cchCardNameLength
#endstruct
stdim st, READER_SEL_RESPONSE ; NSTRUCT 変数を確保
st->cbReaderNameOffset = 100
mes "cbReaderNameOffset=" + st->cbReaderNameOffset