ホーム › Globalization › UIDNAInfo
UIDNAInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| size | SHORT | 2 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| isTransitionalDifferent | CHAR | 1 | +2 | +2 | 遷移的処理と非遷移的処理で結果が異なる場合に真。 |
| reservedB3 | CHAR | 1 | +3 | +3 | 予約バイトフィールド。 |
| errors | DWORD | 4 | +4 | +4 | IDNA処理で検出したエラーを示すビットフラグ。0なら成功。 |
| reservedI2 | INT | 4 | +8 | +8 | 予約整数フィールド2。 |
| reservedI3 | INT | 4 | +12 | +12 | 予約整数フィールド3。 |
各言語での定義
#include <windows.h>
// UIDNAInfo (x64 16 / x86 16 バイト)
typedef struct UIDNAInfo {
SHORT size;
CHAR isTransitionalDifferent;
CHAR reservedB3;
DWORD errors;
INT reservedI2;
INT reservedI3;
} UIDNAInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UIDNAInfo
{
public short size;
public sbyte isTransitionalDifferent;
public sbyte reservedB3;
public uint errors;
public int reservedI2;
public int reservedI3;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UIDNAInfo
Public size As Short
Public isTransitionalDifferent As SByte
Public reservedB3 As SByte
Public errors As UInteger
Public reservedI2 As Integer
Public reservedI3 As Integer
End Structureimport ctypes
from ctypes import wintypes
class UIDNAInfo(ctypes.Structure):
_fields_ = [
("size", ctypes.c_short),
("isTransitionalDifferent", ctypes.c_byte),
("reservedB3", ctypes.c_byte),
("errors", wintypes.DWORD),
("reservedI2", ctypes.c_int),
("reservedI3", ctypes.c_int),
]#[repr(C)]
pub struct UIDNAInfo {
pub size: i16,
pub isTransitionalDifferent: i8,
pub reservedB3: i8,
pub errors: u32,
pub reservedI2: i32,
pub reservedI3: i32,
}import "golang.org/x/sys/windows"
type UIDNAInfo struct {
size int16
isTransitionalDifferent int8
reservedB3 int8
errors uint32
reservedI2 int32
reservedI3 int32
}type
UIDNAInfo = record
size: Smallint;
isTransitionalDifferent: Shortint;
reservedB3: Shortint;
errors: DWORD;
reservedI2: Integer;
reservedI3: Integer;
end;const UIDNAInfo = extern struct {
size: i16,
isTransitionalDifferent: i8,
reservedB3: i8,
errors: u32,
reservedI2: i32,
reservedI3: i32,
};type
UIDNAInfo {.bycopy.} = object
size: int16
isTransitionalDifferent: int8
reservedB3: int8
errors: uint32
reservedI2: int32
reservedI3: int32struct UIDNAInfo
{
short size;
byte isTransitionalDifferent;
byte reservedB3;
uint errors;
int reservedI2;
int reservedI3;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UIDNAInfo サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; size : SHORT (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; isTransitionalDifferent : CHAR (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; reservedB3 : CHAR (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; errors : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; reservedI2 : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; reservedI3 : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global UIDNAInfo
#field short size
#field byte isTransitionalDifferent
#field byte reservedB3
#field int errors
#field int reservedI2
#field int reservedI3
#endstruct
stdim st, UIDNAInfo ; NSTRUCT 変数を確保
st->size = 100
mes "size=" + st->size