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