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

WS_CHANNEL_DECODER

構造体
サイズx64: 56 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
createContextvoid*8/4+0+0各デコーダ生成時にコールバックへ渡されるユーザー定義のコンテキストポインタ。
createDecoderCallbackWS_CREATE_DECODER_CALLBACK8/4+8+4新しいデコーダインスタンスを生成するコールバック関数。
decoderGetContentTypeCallbackWS_DECODER_GET_CONTENT_TYPE_CALLBACK8/4+16+8受信メッセージのContent-Typeを処理するコールバック関数。
decoderStartCallbackWS_DECODER_START_CALLBACK8/4+24+12メッセージのデコード開始を通知するコールバック関数。
decoderDecodeCallbackWS_DECODER_DECODE_CALLBACK8/4+32+16受信バイト列をデコードするコールバック関数。
decoderEndCallbackWS_DECODER_END_CALLBACK8/4+40+20メッセージのデコード完了を通知するコールバック関数。
freeDecoderCallbackWS_FREE_DECODER_CALLBACK8/4+48+24デコーダインスタンスを解放するコールバック関数。

各言語での定義

#include <windows.h>

// WS_CHANNEL_DECODER  (x64 56 / x86 28 バイト)
typedef struct WS_CHANNEL_DECODER {
    void* createContext;
    WS_CREATE_DECODER_CALLBACK createDecoderCallback;
    WS_DECODER_GET_CONTENT_TYPE_CALLBACK decoderGetContentTypeCallback;
    WS_DECODER_START_CALLBACK decoderStartCallback;
    WS_DECODER_DECODE_CALLBACK decoderDecodeCallback;
    WS_DECODER_END_CALLBACK decoderEndCallback;
    WS_FREE_DECODER_CALLBACK freeDecoderCallback;
} WS_CHANNEL_DECODER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_CHANNEL_DECODER
{
    public IntPtr createContext;
    public IntPtr createDecoderCallback;
    public IntPtr decoderGetContentTypeCallback;
    public IntPtr decoderStartCallback;
    public IntPtr decoderDecodeCallback;
    public IntPtr decoderEndCallback;
    public IntPtr freeDecoderCallback;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_CHANNEL_DECODER
    Public createContext As IntPtr
    Public createDecoderCallback As IntPtr
    Public decoderGetContentTypeCallback As IntPtr
    Public decoderStartCallback As IntPtr
    Public decoderDecodeCallback As IntPtr
    Public decoderEndCallback As IntPtr
    Public freeDecoderCallback As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WS_CHANNEL_DECODER(ctypes.Structure):
    _fields_ = [
        ("createContext", ctypes.c_void_p),
        ("createDecoderCallback", ctypes.c_void_p),
        ("decoderGetContentTypeCallback", ctypes.c_void_p),
        ("decoderStartCallback", ctypes.c_void_p),
        ("decoderDecodeCallback", ctypes.c_void_p),
        ("decoderEndCallback", ctypes.c_void_p),
        ("freeDecoderCallback", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WS_CHANNEL_DECODER {
    pub createContext: *mut core::ffi::c_void,
    pub createDecoderCallback: *mut core::ffi::c_void,
    pub decoderGetContentTypeCallback: *mut core::ffi::c_void,
    pub decoderStartCallback: *mut core::ffi::c_void,
    pub decoderDecodeCallback: *mut core::ffi::c_void,
    pub decoderEndCallback: *mut core::ffi::c_void,
    pub freeDecoderCallback: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WS_CHANNEL_DECODER struct {
	createContext uintptr
	createDecoderCallback uintptr
	decoderGetContentTypeCallback uintptr
	decoderStartCallback uintptr
	decoderDecodeCallback uintptr
	decoderEndCallback uintptr
	freeDecoderCallback uintptr
}
type
  WS_CHANNEL_DECODER = record
    createContext: Pointer;
    createDecoderCallback: Pointer;
    decoderGetContentTypeCallback: Pointer;
    decoderStartCallback: Pointer;
    decoderDecodeCallback: Pointer;
    decoderEndCallback: Pointer;
    freeDecoderCallback: Pointer;
  end;
const WS_CHANNEL_DECODER = extern struct {
    createContext: ?*anyopaque,
    createDecoderCallback: ?*anyopaque,
    decoderGetContentTypeCallback: ?*anyopaque,
    decoderStartCallback: ?*anyopaque,
    decoderDecodeCallback: ?*anyopaque,
    decoderEndCallback: ?*anyopaque,
    freeDecoderCallback: ?*anyopaque,
};
type
  WS_CHANNEL_DECODER {.bycopy.} = object
    createContext: pointer
    createDecoderCallback: pointer
    decoderGetContentTypeCallback: pointer
    decoderStartCallback: pointer
    decoderDecodeCallback: pointer
    decoderEndCallback: pointer
    freeDecoderCallback: pointer
struct WS_CHANNEL_DECODER
{
    void* createContext;
    void* createDecoderCallback;
    void* decoderGetContentTypeCallback;
    void* decoderStartCallback;
    void* decoderDecodeCallback;
    void* decoderEndCallback;
    void* freeDecoderCallback;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_CHANNEL_DECODER サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; createContext : void* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; createDecoderCallback : WS_CREATE_DECODER_CALLBACK (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; decoderGetContentTypeCallback : WS_DECODER_GET_CONTENT_TYPE_CALLBACK (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; decoderStartCallback : WS_DECODER_START_CALLBACK (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; decoderDecodeCallback : WS_DECODER_DECODE_CALLBACK (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; decoderEndCallback : WS_DECODER_END_CALLBACK (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; freeDecoderCallback : WS_FREE_DECODER_CALLBACK (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_CHANNEL_DECODER サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; createContext : void* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; createDecoderCallback : WS_CREATE_DECODER_CALLBACK (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; decoderGetContentTypeCallback : WS_DECODER_GET_CONTENT_TYPE_CALLBACK (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; decoderStartCallback : WS_DECODER_START_CALLBACK (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; decoderDecodeCallback : WS_DECODER_DECODE_CALLBACK (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; decoderEndCallback : WS_DECODER_END_CALLBACK (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; freeDecoderCallback : WS_FREE_DECODER_CALLBACK (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WS_CHANNEL_DECODER
    #field intptr createContext
    #field intptr createDecoderCallback
    #field intptr decoderGetContentTypeCallback
    #field intptr decoderStartCallback
    #field intptr decoderDecodeCallback
    #field intptr decoderEndCallback
    #field intptr freeDecoderCallback
#endstruct

stdim st, WS_CHANNEL_DECODER        ; NSTRUCT 変数を確保