ホーム › Networking.WindowsWebServices › WS_ELEMENT_DESCRIPTION
WS_ELEMENT_DESCRIPTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| elementLocalName | WS_XML_STRING* | 8/4 | +0 | +0 | 対象要素のローカル名を表すXML文字列へのポインタ。NULL可。 |
| elementNs | WS_XML_STRING* | 8/4 | +8 | +4 | 対象要素の名前空間URIを表すXML文字列へのポインタ。NULL可。 |
| type | WS_TYPE | 4 | +16 | +8 | 要素にマップされるデータ型を示す列挙値。 |
| typeDescription | void* | 8/4 | +24 | +12 | 型に対応する詳細な型記述構造体へのポインタ。 |
各言語での定義
#include <windows.h>
// WS_ELEMENT_DESCRIPTION (x64 32 / x86 16 バイト)
typedef struct WS_ELEMENT_DESCRIPTION {
WS_XML_STRING* elementLocalName;
WS_XML_STRING* elementNs;
WS_TYPE type;
void* typeDescription;
} WS_ELEMENT_DESCRIPTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_ELEMENT_DESCRIPTION
{
public IntPtr elementLocalName;
public IntPtr elementNs;
public int type;
public IntPtr typeDescription;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_ELEMENT_DESCRIPTION
Public elementLocalName As IntPtr
Public elementNs As IntPtr
Public type As Integer
Public typeDescription As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WS_ELEMENT_DESCRIPTION(ctypes.Structure):
_fields_ = [
("elementLocalName", ctypes.c_void_p),
("elementNs", ctypes.c_void_p),
("type", ctypes.c_int),
("typeDescription", ctypes.c_void_p),
]#[repr(C)]
pub struct WS_ELEMENT_DESCRIPTION {
pub elementLocalName: *mut core::ffi::c_void,
pub elementNs: *mut core::ffi::c_void,
pub type: i32,
pub typeDescription: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WS_ELEMENT_DESCRIPTION struct {
elementLocalName uintptr
elementNs uintptr
type int32
typeDescription uintptr
}type
WS_ELEMENT_DESCRIPTION = record
elementLocalName: Pointer;
elementNs: Pointer;
type: Integer;
typeDescription: Pointer;
end;const WS_ELEMENT_DESCRIPTION = extern struct {
elementLocalName: ?*anyopaque,
elementNs: ?*anyopaque,
type: i32,
typeDescription: ?*anyopaque,
};type
WS_ELEMENT_DESCRIPTION {.bycopy.} = object
elementLocalName: pointer
elementNs: pointer
type: int32
typeDescription: pointerstruct WS_ELEMENT_DESCRIPTION
{
void* elementLocalName;
void* elementNs;
int type;
void* typeDescription;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_ELEMENT_DESCRIPTION サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; elementLocalName : WS_XML_STRING* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; elementNs : WS_XML_STRING* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; type : WS_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; typeDescription : void* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_ELEMENT_DESCRIPTION サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; elementLocalName : WS_XML_STRING* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; elementNs : WS_XML_STRING* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; type : WS_TYPE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; typeDescription : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WS_ELEMENT_DESCRIPTION
#field intptr elementLocalName
#field intptr elementNs
#field int type
#field intptr typeDescription
#endstruct
stdim st, WS_ELEMENT_DESCRIPTION ; NSTRUCT 変数を確保
st->type = 100
mes "type=" + st->type