ホーム › Networking.WindowsWebServices › WS_FIELD_DESCRIPTION
WS_FIELD_DESCRIPTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| mapping | WS_FIELD_MAPPING | 4 | +0 | +0 | フィールドをXML上の要素・属性等のどれに対応付けるかを示すマッピング種別。 |
| localName | WS_XML_STRING* | 8/4 | +8 | +4 | 対応するXML要素/属性のローカル名へのポインタ。NULL可。 |
| ns | WS_XML_STRING* | 8/4 | +16 | +8 | 対応するXML要素/属性の名前空間URIへのポインタ。NULL可。 |
| type | WS_TYPE | 4 | +24 | +12 | フィールドのデータ型を示す列挙値。 |
| typeDescription | void* | 8/4 | +32 | +16 | 型固有の詳細記述へのポインタ。型がtypeに依存する。NULL可。 |
| offset | DWORD | 4 | +40 | +20 | 構造体先頭からこのフィールドまでのバイトオフセット。 |
| options | DWORD | 4 | +44 | +24 | フィールドの動作を制御するフラグ(任意/NULL許容等)の組み合わせ。 |
| defaultValue | WS_DEFAULT_VALUE* | 8/4 | +48 | +28 | フィールド省略時に用いる既定値記述へのポインタ。NULL可。 |
| countOffset | DWORD | 4 | +56 | +32 | 配列要素数を格納するフィールドのバイトオフセット(繰り返しフィールド用)。 |
| itemLocalName | WS_XML_STRING* | 8/4 | +64 | +36 | 繰り返し項目のXMLローカル名へのポインタ。NULL可。 |
| itemNs | WS_XML_STRING* | 8/4 | +72 | +40 | 繰り返し項目のXML名前空間URIへのポインタ。NULL可。 |
| itemRange | WS_ITEM_RANGE* | 8/4 | +80 | +44 | 許容する繰り返し項目数の範囲へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// WS_FIELD_DESCRIPTION (x64 88 / x86 48 バイト)
typedef struct WS_FIELD_DESCRIPTION {
WS_FIELD_MAPPING mapping;
WS_XML_STRING* localName;
WS_XML_STRING* ns;
WS_TYPE type;
void* typeDescription;
DWORD offset;
DWORD options;
WS_DEFAULT_VALUE* defaultValue;
DWORD countOffset;
WS_XML_STRING* itemLocalName;
WS_XML_STRING* itemNs;
WS_ITEM_RANGE* itemRange;
} WS_FIELD_DESCRIPTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_FIELD_DESCRIPTION
{
public int mapping;
public IntPtr localName;
public IntPtr ns;
public int type;
public IntPtr typeDescription;
public uint offset;
public uint options;
public IntPtr defaultValue;
public uint countOffset;
public IntPtr itemLocalName;
public IntPtr itemNs;
public IntPtr itemRange;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_FIELD_DESCRIPTION
Public mapping As Integer
Public localName As IntPtr
Public ns As IntPtr
Public type As Integer
Public typeDescription As IntPtr
Public offset As UInteger
Public options As UInteger
Public defaultValue As IntPtr
Public countOffset As UInteger
Public itemLocalName As IntPtr
Public itemNs As IntPtr
Public itemRange As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WS_FIELD_DESCRIPTION(ctypes.Structure):
_fields_ = [
("mapping", ctypes.c_int),
("localName", ctypes.c_void_p),
("ns", ctypes.c_void_p),
("type", ctypes.c_int),
("typeDescription", ctypes.c_void_p),
("offset", wintypes.DWORD),
("options", wintypes.DWORD),
("defaultValue", ctypes.c_void_p),
("countOffset", wintypes.DWORD),
("itemLocalName", ctypes.c_void_p),
("itemNs", ctypes.c_void_p),
("itemRange", ctypes.c_void_p),
]#[repr(C)]
pub struct WS_FIELD_DESCRIPTION {
pub mapping: i32,
pub localName: *mut core::ffi::c_void,
pub ns: *mut core::ffi::c_void,
pub type: i32,
pub typeDescription: *mut core::ffi::c_void,
pub offset: u32,
pub options: u32,
pub defaultValue: *mut core::ffi::c_void,
pub countOffset: u32,
pub itemLocalName: *mut core::ffi::c_void,
pub itemNs: *mut core::ffi::c_void,
pub itemRange: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WS_FIELD_DESCRIPTION struct {
mapping int32
localName uintptr
ns uintptr
type int32
typeDescription uintptr
offset uint32
options uint32
defaultValue uintptr
countOffset uint32
itemLocalName uintptr
itemNs uintptr
itemRange uintptr
}type
WS_FIELD_DESCRIPTION = record
mapping: Integer;
localName: Pointer;
ns: Pointer;
type: Integer;
typeDescription: Pointer;
offset: DWORD;
options: DWORD;
defaultValue: Pointer;
countOffset: DWORD;
itemLocalName: Pointer;
itemNs: Pointer;
itemRange: Pointer;
end;const WS_FIELD_DESCRIPTION = extern struct {
mapping: i32,
localName: ?*anyopaque,
ns: ?*anyopaque,
type: i32,
typeDescription: ?*anyopaque,
offset: u32,
options: u32,
defaultValue: ?*anyopaque,
countOffset: u32,
itemLocalName: ?*anyopaque,
itemNs: ?*anyopaque,
itemRange: ?*anyopaque,
};type
WS_FIELD_DESCRIPTION {.bycopy.} = object
mapping: int32
localName: pointer
ns: pointer
type: int32
typeDescription: pointer
offset: uint32
options: uint32
defaultValue: pointer
countOffset: uint32
itemLocalName: pointer
itemNs: pointer
itemRange: pointerstruct WS_FIELD_DESCRIPTION
{
int mapping;
void* localName;
void* ns;
int type;
void* typeDescription;
uint offset;
uint options;
void* defaultValue;
uint countOffset;
void* itemLocalName;
void* itemNs;
void* itemRange;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_FIELD_DESCRIPTION サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; mapping : WS_FIELD_MAPPING (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; localName : WS_XML_STRING* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ns : WS_XML_STRING* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; type : WS_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; typeDescription : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; offset : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; options : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; defaultValue : WS_DEFAULT_VALUE* (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; countOffset : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; itemLocalName : WS_XML_STRING* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; itemNs : WS_XML_STRING* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; itemRange : WS_ITEM_RANGE* (+44, 4byte) varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_FIELD_DESCRIPTION サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; mapping : WS_FIELD_MAPPING (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; localName : WS_XML_STRING* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ns : WS_XML_STRING* (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; type : WS_TYPE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; typeDescription : void* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; offset : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; options : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; defaultValue : WS_DEFAULT_VALUE* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; countOffset : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; itemLocalName : WS_XML_STRING* (+64, 8byte) varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; itemNs : WS_XML_STRING* (+72, 8byte) varptr(st)+72 を基点に操作(8byte:入れ子/配列)
; itemRange : WS_ITEM_RANGE* (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WS_FIELD_DESCRIPTION
#field int mapping
#field intptr localName
#field intptr ns
#field int type
#field intptr typeDescription
#field int offset
#field int options
#field intptr defaultValue
#field int countOffset
#field intptr itemLocalName
#field intptr itemNs
#field intptr itemRange
#endstruct
stdim st, WS_FIELD_DESCRIPTION ; NSTRUCT 変数を確保
st->mapping = 100
mes "mapping=" + st->mapping