Win32 API 日本語リファレンス
ホームNetworking.WindowsWebServices › WS_XML_WRITER_MTOM_ENCODING

WS_XML_WRITER_MTOM_ENCODING

構造体
サイズx64: 80 バイト / x86: 40 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
encodingWS_XML_WRITER_ENCODING4+0+0エンコード種別情報を保持する基底WS_XML_WRITER_ENCODING。
textEncodingWS_XML_WRITER_ENCODING*8/4+8+4MTOMのルートパートで用いるテキストエンコードへのポインタ。
writeMimeHeaderBOOL4+16+8MIMEヘッダーを出力するかを示す論理値。
boundaryWS_STRING16/8+24+12MIMEマルチパートの境界文字列。
startInfoWS_STRING16/8+40+20MIMEのstart-info(コンテンツ種別)を表す文字列。
startUriWS_STRING16/8+56+28ルートパートを識別するstart URI文字列。
maxInlineByteCountDWORD4+72+36MIMEパートとして分離せずインライン化する最大バイト数。

各言語での定義

#include <windows.h>

// WS_XML_WRITER_ENCODING  (x64 4 / x86 4 バイト)
typedef struct WS_XML_WRITER_ENCODING {
    WS_XML_WRITER_ENCODING_TYPE encodingType;
} WS_XML_WRITER_ENCODING;

// WS_STRING  (x64 16 / x86 8 バイト)
typedef struct WS_STRING {
    DWORD length;
    LPWSTR chars;
} WS_STRING;

// WS_XML_WRITER_MTOM_ENCODING  (x64 80 / x86 40 バイト)
typedef struct WS_XML_WRITER_MTOM_ENCODING {
    WS_XML_WRITER_ENCODING encoding;
    WS_XML_WRITER_ENCODING* textEncoding;
    BOOL writeMimeHeader;
    WS_STRING boundary;
    WS_STRING startInfo;
    WS_STRING startUri;
    DWORD maxInlineByteCount;
} WS_XML_WRITER_MTOM_ENCODING;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_XML_WRITER_ENCODING
{
    public int encodingType;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_STRING
{
    public uint length;
    public IntPtr chars;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_XML_WRITER_MTOM_ENCODING
{
    public WS_XML_WRITER_ENCODING encoding;
    public IntPtr textEncoding;
    [MarshalAs(UnmanagedType.Bool)] public bool writeMimeHeader;
    public WS_STRING boundary;
    public WS_STRING startInfo;
    public WS_STRING startUri;
    public uint maxInlineByteCount;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_XML_WRITER_ENCODING
    Public encodingType As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_STRING
    Public length As UInteger
    Public chars As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_XML_WRITER_MTOM_ENCODING
    Public encoding As WS_XML_WRITER_ENCODING
    Public textEncoding As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public writeMimeHeader As Boolean
    Public boundary As WS_STRING
    Public startInfo As WS_STRING
    Public startUri As WS_STRING
    Public maxInlineByteCount As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WS_XML_WRITER_ENCODING(ctypes.Structure):
    _fields_ = [
        ("encodingType", ctypes.c_int),
    ]

class WS_STRING(ctypes.Structure):
    _fields_ = [
        ("length", wintypes.DWORD),
        ("chars", ctypes.c_void_p),
    ]

class WS_XML_WRITER_MTOM_ENCODING(ctypes.Structure):
    _fields_ = [
        ("encoding", WS_XML_WRITER_ENCODING),
        ("textEncoding", ctypes.c_void_p),
        ("writeMimeHeader", wintypes.BOOL),
        ("boundary", WS_STRING),
        ("startInfo", WS_STRING),
        ("startUri", WS_STRING),
        ("maxInlineByteCount", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WS_XML_WRITER_ENCODING {
    pub encodingType: i32,
}

#[repr(C)]
pub struct WS_STRING {
    pub length: u32,
    pub chars: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct WS_XML_WRITER_MTOM_ENCODING {
    pub encoding: WS_XML_WRITER_ENCODING,
    pub textEncoding: *mut core::ffi::c_void,
    pub writeMimeHeader: i32,
    pub boundary: WS_STRING,
    pub startInfo: WS_STRING,
    pub startUri: WS_STRING,
    pub maxInlineByteCount: u32,
}
import "golang.org/x/sys/windows"

type WS_XML_WRITER_ENCODING struct {
	encodingType int32
}

type WS_STRING struct {
	length uint32
	chars uintptr
}

type WS_XML_WRITER_MTOM_ENCODING struct {
	encoding WS_XML_WRITER_ENCODING
	textEncoding uintptr
	writeMimeHeader int32
	boundary WS_STRING
	startInfo WS_STRING
	startUri WS_STRING
	maxInlineByteCount uint32
}
type
  WS_XML_WRITER_ENCODING = record
    encodingType: Integer;
  end;

  WS_STRING = record
    length: DWORD;
    chars: Pointer;
  end;

  WS_XML_WRITER_MTOM_ENCODING = record
    encoding: WS_XML_WRITER_ENCODING;
    textEncoding: Pointer;
    writeMimeHeader: BOOL;
    boundary: WS_STRING;
    startInfo: WS_STRING;
    startUri: WS_STRING;
    maxInlineByteCount: DWORD;
  end;
const WS_XML_WRITER_ENCODING = extern struct {
    encodingType: i32,
};

const WS_STRING = extern struct {
    length: u32,
    chars: ?*anyopaque,
};

const WS_XML_WRITER_MTOM_ENCODING = extern struct {
    encoding: WS_XML_WRITER_ENCODING,
    textEncoding: ?*anyopaque,
    writeMimeHeader: i32,
    boundary: WS_STRING,
    startInfo: WS_STRING,
    startUri: WS_STRING,
    maxInlineByteCount: u32,
};
type
  WS_XML_WRITER_ENCODING {.bycopy.} = object
    encodingType: int32

  WS_STRING {.bycopy.} = object
    length: uint32
    chars: pointer

  WS_XML_WRITER_MTOM_ENCODING {.bycopy.} = object
    encoding: WS_XML_WRITER_ENCODING
    textEncoding: pointer
    writeMimeHeader: int32
    boundary: WS_STRING
    startInfo: WS_STRING
    startUri: WS_STRING
    maxInlineByteCount: uint32
struct WS_XML_WRITER_ENCODING
{
    int encodingType;
}

struct WS_STRING
{
    uint length;
    void* chars;
}

struct WS_XML_WRITER_MTOM_ENCODING
{
    WS_XML_WRITER_ENCODING encoding;
    void* textEncoding;
    int writeMimeHeader;
    WS_STRING boundary;
    WS_STRING startInfo;
    WS_STRING startUri;
    uint maxInlineByteCount;
}

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_WRITER_MTOM_ENCODING サイズ: 40 バイト(x86)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; encoding : WS_XML_WRITER_ENCODING (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; textEncoding : WS_XML_WRITER_ENCODING* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; writeMimeHeader : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; boundary : WS_STRING (+12, 8byte)  varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; startInfo : WS_STRING (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; startUri : WS_STRING (+28, 8byte)  varptr(st)+28 を基点に操作(8byte:入れ子/配列)
; maxInlineByteCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_XML_WRITER_MTOM_ENCODING サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; encoding : WS_XML_WRITER_ENCODING (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; textEncoding : WS_XML_WRITER_ENCODING* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; writeMimeHeader : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; boundary : WS_STRING (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; startInfo : WS_STRING (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; startUri : WS_STRING (+56, 16byte)  varptr(st)+56 を基点に操作(16byte:入れ子/配列)
; maxInlineByteCount : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WS_XML_WRITER_ENCODING
    #field int encodingType
#endstruct

#defstruct global WS_STRING
    #field int length
    #field intptr chars
#endstruct

#defstruct global WS_XML_WRITER_MTOM_ENCODING
    #field WS_XML_WRITER_ENCODING encoding
    #field intptr textEncoding
    #field bool writeMimeHeader
    #field WS_STRING boundary
    #field WS_STRING startInfo
    #field WS_STRING startUri
    #field int maxInlineByteCount
#endstruct

stdim st, WS_XML_WRITER_MTOM_ENCODING        ; NSTRUCT 変数を確保
st->writeMimeHeader = 100
mes "writeMimeHeader=" + st->writeMimeHeader