Win32 API 日本語リファレンス
ホームSystem.Iis › HSE_TF_INFO

HSE_TF_INFO

構造体
サイズx64: 72 バイト / x86: 44 バイト

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

フィールド

フィールドサイズx64x86説明
pfnHseIOPFN_HSE_IO_COMPLETION8/4+0+0I/O完了時に呼ばれるコールバック関数ポインタである。NULL可。
pContextvoid*8/4+8+4コールバックに渡される任意のコンテキストポインタである。
hFileHANDLE8/4+16+8送信するファイルのハンドルを示すHANDLEである。
pszStatusCodeLPSTR8/4+24+12応答のステータスコード文字列を示すLPSTRである。
BytesToWriteDWORD4+32+16送信するバイト数を示すDWORD。0でファイル全体を送る。
OffsetDWORD4+36+20送信開始のファイルオフセットをバイト単位で示すDWORDである。
pHeadvoid*8/4+40+24本体の前に送るヘッダデータへのポインタである。NULL可。
HeadLengthDWORD4+48+28ヘッダデータのバイト長を示すDWORDである。
pTailvoid*8/4+56+32本体の後に送るトレーラデータへのポインタである。NULL可。
TailLengthDWORD4+64+36トレーラデータのバイト長を示すDWORDである。
dwFlagsDWORD4+68+40転送動作を制御するフラグ(HSE_IO_*)を示すDWORDである。

各言語での定義

#include <windows.h>

// HSE_TF_INFO  (x64 72 / x86 44 バイト)
typedef struct HSE_TF_INFO {
    PFN_HSE_IO_COMPLETION pfnHseIO;
    void* pContext;
    HANDLE hFile;
    LPSTR pszStatusCode;
    DWORD BytesToWrite;
    DWORD Offset;
    void* pHead;
    DWORD HeadLength;
    void* pTail;
    DWORD TailLength;
    DWORD dwFlags;
} HSE_TF_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HSE_TF_INFO
{
    public IntPtr pfnHseIO;
    public IntPtr pContext;
    public IntPtr hFile;
    public IntPtr pszStatusCode;
    public uint BytesToWrite;
    public uint Offset;
    public IntPtr pHead;
    public uint HeadLength;
    public IntPtr pTail;
    public uint TailLength;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HSE_TF_INFO
    Public pfnHseIO As IntPtr
    Public pContext As IntPtr
    Public hFile As IntPtr
    Public pszStatusCode As IntPtr
    Public BytesToWrite As UInteger
    Public Offset As UInteger
    Public pHead As IntPtr
    Public HeadLength As UInteger
    Public pTail As IntPtr
    Public TailLength As UInteger
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class HSE_TF_INFO(ctypes.Structure):
    _fields_ = [
        ("pfnHseIO", ctypes.c_void_p),
        ("pContext", ctypes.c_void_p),
        ("hFile", ctypes.c_void_p),
        ("pszStatusCode", ctypes.c_void_p),
        ("BytesToWrite", wintypes.DWORD),
        ("Offset", wintypes.DWORD),
        ("pHead", ctypes.c_void_p),
        ("HeadLength", wintypes.DWORD),
        ("pTail", ctypes.c_void_p),
        ("TailLength", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct HSE_TF_INFO {
    pub pfnHseIO: *mut core::ffi::c_void,
    pub pContext: *mut core::ffi::c_void,
    pub hFile: *mut core::ffi::c_void,
    pub pszStatusCode: *mut core::ffi::c_void,
    pub BytesToWrite: u32,
    pub Offset: u32,
    pub pHead: *mut core::ffi::c_void,
    pub HeadLength: u32,
    pub pTail: *mut core::ffi::c_void,
    pub TailLength: u32,
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type HSE_TF_INFO struct {
	pfnHseIO uintptr
	pContext uintptr
	hFile uintptr
	pszStatusCode uintptr
	BytesToWrite uint32
	Offset uint32
	pHead uintptr
	HeadLength uint32
	pTail uintptr
	TailLength uint32
	dwFlags uint32
}
type
  HSE_TF_INFO = record
    pfnHseIO: Pointer;
    pContext: Pointer;
    hFile: Pointer;
    pszStatusCode: Pointer;
    BytesToWrite: DWORD;
    Offset: DWORD;
    pHead: Pointer;
    HeadLength: DWORD;
    pTail: Pointer;
    TailLength: DWORD;
    dwFlags: DWORD;
  end;
const HSE_TF_INFO = extern struct {
    pfnHseIO: ?*anyopaque,
    pContext: ?*anyopaque,
    hFile: ?*anyopaque,
    pszStatusCode: ?*anyopaque,
    BytesToWrite: u32,
    Offset: u32,
    pHead: ?*anyopaque,
    HeadLength: u32,
    pTail: ?*anyopaque,
    TailLength: u32,
    dwFlags: u32,
};
type
  HSE_TF_INFO {.bycopy.} = object
    pfnHseIO: pointer
    pContext: pointer
    hFile: pointer
    pszStatusCode: pointer
    BytesToWrite: uint32
    Offset: uint32
    pHead: pointer
    HeadLength: uint32
    pTail: pointer
    TailLength: uint32
    dwFlags: uint32
struct HSE_TF_INFO
{
    void* pfnHseIO;
    void* pContext;
    void* hFile;
    void* pszStatusCode;
    uint BytesToWrite;
    uint Offset;
    void* pHead;
    uint HeadLength;
    void* pTail;
    uint TailLength;
    uint dwFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HSE_TF_INFO サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; pfnHseIO : PFN_HSE_IO_COMPLETION (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pContext : void* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; hFile : HANDLE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pszStatusCode : LPSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; BytesToWrite : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Offset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pHead : void* (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; HeadLength : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pTail : void* (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; TailLength : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwFlags : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HSE_TF_INFO サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; pfnHseIO : PFN_HSE_IO_COMPLETION (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pContext : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hFile : HANDLE (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pszStatusCode : LPSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; BytesToWrite : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Offset : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pHead : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; HeadLength : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pTail : void* (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; TailLength : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwFlags : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HSE_TF_INFO
    #field intptr pfnHseIO
    #field intptr pContext
    #field intptr hFile
    #field intptr pszStatusCode
    #field int BytesToWrite
    #field int Offset
    #field intptr pHead
    #field int HeadLength
    #field intptr pTail
    #field int TailLength
    #field int dwFlags
#endstruct

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