ホーム › Networking.WindowsWebServices › WS_XML_QNAME
WS_XML_QNAME
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| localName | WS_XML_STRING | 32/16 | +0 | +0 | 修飾名のローカル部分(要素名)を表すXML文字列。 |
| ns | WS_XML_STRING | 32/16 | +32 | +16 | 修飾名の名前空間URIを表すXML文字列。 |
各言語での定義
#include <windows.h>
// WS_XML_STRING (x64 32 / x86 16 バイト)
typedef struct WS_XML_STRING {
DWORD length;
BYTE* bytes;
WS_XML_DICTIONARY* dictionary;
DWORD id;
} WS_XML_STRING;
// WS_XML_QNAME (x64 64 / x86 32 バイト)
typedef struct WS_XML_QNAME {
WS_XML_STRING localName;
WS_XML_STRING ns;
} WS_XML_QNAME;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_XML_STRING
{
public uint length;
public IntPtr bytes;
public IntPtr dictionary;
public uint id;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_XML_QNAME
{
public WS_XML_STRING localName;
public WS_XML_STRING ns;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_XML_STRING
Public length As UInteger
Public bytes As IntPtr
Public dictionary As IntPtr
Public id As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_XML_QNAME
Public localName As WS_XML_STRING
Public ns As WS_XML_STRING
End Structureimport ctypes
from ctypes import wintypes
class WS_XML_STRING(ctypes.Structure):
_fields_ = [
("length", wintypes.DWORD),
("bytes", ctypes.c_void_p),
("dictionary", ctypes.c_void_p),
("id", wintypes.DWORD),
]
class WS_XML_QNAME(ctypes.Structure):
_fields_ = [
("localName", WS_XML_STRING),
("ns", WS_XML_STRING),
]#[repr(C)]
pub struct WS_XML_STRING {
pub length: u32,
pub bytes: *mut core::ffi::c_void,
pub dictionary: *mut core::ffi::c_void,
pub id: u32,
}
#[repr(C)]
pub struct WS_XML_QNAME {
pub localName: WS_XML_STRING,
pub ns: WS_XML_STRING,
}import "golang.org/x/sys/windows"
type WS_XML_STRING struct {
length uint32
bytes uintptr
dictionary uintptr
id uint32
}
type WS_XML_QNAME struct {
localName WS_XML_STRING
ns WS_XML_STRING
}type
WS_XML_STRING = record
length: DWORD;
bytes: Pointer;
dictionary: Pointer;
id: DWORD;
end;
WS_XML_QNAME = record
localName: WS_XML_STRING;
ns: WS_XML_STRING;
end;const WS_XML_STRING = extern struct {
length: u32,
bytes: ?*anyopaque,
dictionary: ?*anyopaque,
id: u32,
};
const WS_XML_QNAME = extern struct {
localName: WS_XML_STRING,
ns: WS_XML_STRING,
};type
WS_XML_STRING {.bycopy.} = object
length: uint32
bytes: pointer
dictionary: pointer
id: uint32
WS_XML_QNAME {.bycopy.} = object
localName: WS_XML_STRING
ns: WS_XML_STRINGstruct WS_XML_STRING
{
uint length;
void* bytes;
void* dictionary;
uint id;
}
struct WS_XML_QNAME
{
WS_XML_STRING localName;
WS_XML_STRING ns;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_XML_QNAME サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; localName : WS_XML_STRING (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ns : WS_XML_STRING (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_XML_QNAME サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; localName : WS_XML_STRING (+0, 32byte) varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; ns : WS_XML_STRING (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WS_XML_STRING
#field int length
#field intptr bytes
#field intptr dictionary
#field int id
#endstruct
#defstruct global WS_XML_QNAME
#field WS_XML_STRING localName
#field WS_XML_STRING ns
#endstruct
stdim st, WS_XML_QNAME ; NSTRUCT 変数を確保