ホーム › Devices.WebServicesOnDevices › WSD_SOAP_MESSAGE
WSD_SOAP_MESSAGE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Header | WSD_SOAP_HEADER | 80/40 | +0 | +0 | SOAPメッセージのヘッダ部。 |
| Body | void* | 8/4 | +80 | +40 | SOAPメッセージのボディデータへのポインタ。 |
| BodyType | WSDXML_TYPE* | 8/4 | +88 | +44 | ボディの型を示すWSDXML型情報。 |
各言語での定義
#include <windows.h>
// WSD_HEADER_RELATESTO (x64 16 / x86 8 バイト)
typedef struct WSD_HEADER_RELATESTO {
WSDXML_NAME* RelationshipType;
LPWSTR MessageID;
} WSD_HEADER_RELATESTO;
// WSD_SOAP_HEADER (x64 80 / x86 40 バイト)
typedef struct WSD_SOAP_HEADER {
LPWSTR To;
LPWSTR Action;
LPWSTR MessageID;
WSD_HEADER_RELATESTO RelatesTo;
WSD_ENDPOINT_REFERENCE* ReplyTo;
WSD_ENDPOINT_REFERENCE* From;
WSD_ENDPOINT_REFERENCE* FaultTo;
WSD_APP_SEQUENCE* AppSequence;
WSDXML_ELEMENT* AnyHeaders;
} WSD_SOAP_HEADER;
// WSD_SOAP_MESSAGE (x64 96 / x86 48 バイト)
typedef struct WSD_SOAP_MESSAGE {
WSD_SOAP_HEADER Header;
void* Body;
WSDXML_TYPE* BodyType;
} WSD_SOAP_MESSAGE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WSD_HEADER_RELATESTO
{
public IntPtr RelationshipType;
public IntPtr MessageID;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WSD_SOAP_HEADER
{
public IntPtr To;
public IntPtr Action;
public IntPtr MessageID;
public WSD_HEADER_RELATESTO RelatesTo;
public IntPtr ReplyTo;
public IntPtr From;
public IntPtr FaultTo;
public IntPtr AppSequence;
public IntPtr AnyHeaders;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WSD_SOAP_MESSAGE
{
public WSD_SOAP_HEADER Header;
public IntPtr Body;
public IntPtr BodyType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WSD_HEADER_RELATESTO
Public RelationshipType As IntPtr
Public MessageID As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WSD_SOAP_HEADER
Public To As IntPtr
Public Action As IntPtr
Public MessageID As IntPtr
Public RelatesTo As WSD_HEADER_RELATESTO
Public ReplyTo As IntPtr
Public From As IntPtr
Public FaultTo As IntPtr
Public AppSequence As IntPtr
Public AnyHeaders As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WSD_SOAP_MESSAGE
Public Header As WSD_SOAP_HEADER
Public Body As IntPtr
Public BodyType As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WSD_HEADER_RELATESTO(ctypes.Structure):
_fields_ = [
("RelationshipType", ctypes.c_void_p),
("MessageID", ctypes.c_void_p),
]
class WSD_SOAP_HEADER(ctypes.Structure):
_fields_ = [
("To", ctypes.c_void_p),
("Action", ctypes.c_void_p),
("MessageID", ctypes.c_void_p),
("RelatesTo", WSD_HEADER_RELATESTO),
("ReplyTo", ctypes.c_void_p),
("From", ctypes.c_void_p),
("FaultTo", ctypes.c_void_p),
("AppSequence", ctypes.c_void_p),
("AnyHeaders", ctypes.c_void_p),
]
class WSD_SOAP_MESSAGE(ctypes.Structure):
_fields_ = [
("Header", WSD_SOAP_HEADER),
("Body", ctypes.c_void_p),
("BodyType", ctypes.c_void_p),
]#[repr(C)]
pub struct WSD_HEADER_RELATESTO {
pub RelationshipType: *mut core::ffi::c_void,
pub MessageID: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct WSD_SOAP_HEADER {
pub To: *mut core::ffi::c_void,
pub Action: *mut core::ffi::c_void,
pub MessageID: *mut core::ffi::c_void,
pub RelatesTo: WSD_HEADER_RELATESTO,
pub ReplyTo: *mut core::ffi::c_void,
pub From: *mut core::ffi::c_void,
pub FaultTo: *mut core::ffi::c_void,
pub AppSequence: *mut core::ffi::c_void,
pub AnyHeaders: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct WSD_SOAP_MESSAGE {
pub Header: WSD_SOAP_HEADER,
pub Body: *mut core::ffi::c_void,
pub BodyType: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WSD_HEADER_RELATESTO struct {
RelationshipType uintptr
MessageID uintptr
}
type WSD_SOAP_HEADER struct {
To uintptr
Action uintptr
MessageID uintptr
RelatesTo WSD_HEADER_RELATESTO
ReplyTo uintptr
From uintptr
FaultTo uintptr
AppSequence uintptr
AnyHeaders uintptr
}
type WSD_SOAP_MESSAGE struct {
Header WSD_SOAP_HEADER
Body uintptr
BodyType uintptr
}type
WSD_HEADER_RELATESTO = record
RelationshipType: Pointer;
MessageID: Pointer;
end;
WSD_SOAP_HEADER = record
To: Pointer;
Action: Pointer;
MessageID: Pointer;
RelatesTo: WSD_HEADER_RELATESTO;
ReplyTo: Pointer;
From: Pointer;
FaultTo: Pointer;
AppSequence: Pointer;
AnyHeaders: Pointer;
end;
WSD_SOAP_MESSAGE = record
Header: WSD_SOAP_HEADER;
Body: Pointer;
BodyType: Pointer;
end;const WSD_HEADER_RELATESTO = extern struct {
RelationshipType: ?*anyopaque,
MessageID: ?*anyopaque,
};
const WSD_SOAP_HEADER = extern struct {
To: ?*anyopaque,
Action: ?*anyopaque,
MessageID: ?*anyopaque,
RelatesTo: WSD_HEADER_RELATESTO,
ReplyTo: ?*anyopaque,
From: ?*anyopaque,
FaultTo: ?*anyopaque,
AppSequence: ?*anyopaque,
AnyHeaders: ?*anyopaque,
};
const WSD_SOAP_MESSAGE = extern struct {
Header: WSD_SOAP_HEADER,
Body: ?*anyopaque,
BodyType: ?*anyopaque,
};type
WSD_HEADER_RELATESTO {.bycopy.} = object
RelationshipType: pointer
MessageID: pointer
WSD_SOAP_HEADER {.bycopy.} = object
To: pointer
Action: pointer
MessageID: pointer
RelatesTo: WSD_HEADER_RELATESTO
ReplyTo: pointer
From: pointer
FaultTo: pointer
AppSequence: pointer
AnyHeaders: pointer
WSD_SOAP_MESSAGE {.bycopy.} = object
Header: WSD_SOAP_HEADER
Body: pointer
BodyType: pointerstruct WSD_HEADER_RELATESTO
{
void* RelationshipType;
void* MessageID;
}
struct WSD_SOAP_HEADER
{
void* To;
void* Action;
void* MessageID;
WSD_HEADER_RELATESTO RelatesTo;
void* ReplyTo;
void* From;
void* FaultTo;
void* AppSequence;
void* AnyHeaders;
}
struct WSD_SOAP_MESSAGE
{
WSD_SOAP_HEADER Header;
void* Body;
void* BodyType;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WSD_SOAP_MESSAGE サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Header : WSD_SOAP_HEADER (+0, 40byte) varptr(st)+0 を基点に操作(40byte:入れ子/配列)
; Body : void* (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; BodyType : WSDXML_TYPE* (+44, 4byte) varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WSD_SOAP_MESSAGE サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; Header : WSD_SOAP_HEADER (+0, 80byte) varptr(st)+0 を基点に操作(80byte:入れ子/配列)
; Body : void* (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; BodyType : WSDXML_TYPE* (+88, 8byte) varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WSD_HEADER_RELATESTO
#field intptr RelationshipType
#field intptr MessageID
#endstruct
#defstruct global WSD_SOAP_HEADER
#field intptr To
#field intptr Action
#field intptr MessageID
#field WSD_HEADER_RELATESTO RelatesTo
#field intptr ReplyTo
#field intptr From
#field intptr FaultTo
#field intptr AppSequence
#field intptr AnyHeaders
#endstruct
#defstruct global WSD_SOAP_MESSAGE
#field WSD_SOAP_HEADER Header
#field intptr Body
#field intptr BodyType
#endstruct
stdim st, WSD_SOAP_MESSAGE ; NSTRUCT 変数を確保