ホーム › System.Iis › HTTP_FILTER_CONTEXT
HTTP_FILTER_CONTEXT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズを示すDWORDである。 |
| Revision | DWORD | 4 | +4 | +4 | ISAPIフィルタ仕様のリビジョン番号を示すDWORDである。 |
| ServerContext | void* | 8/4 | +8 | +8 | サーバー内部が使用するコンテキストポインタである。フィルタは変更しない。 |
| ulReserved | DWORD | 4 | +16 | +12 | 予約フィールド。0とする。 |
| fIsSecurePort | BOOL | 4 | +20 | +16 | リクエストがセキュアポート(HTTPS)経由かを示すBOOLである。 |
| pFilterContext | void* | 8/4 | +24 | +20 | フィルタが任意に使えるコンテキストポインタである。NULL可。 |
| GetServerVariable | INT_PTR | 8/4 | +32 | +24 | サーバー変数を取得する関数ポインタ(INT_PTR)である。 |
| AddResponseHeaders | INT_PTR | 8/4 | +40 | +28 | 応答ヘッダを追加する関数ポインタである。 |
| WriteClient | INT_PTR | 8/4 | +48 | +32 | クライアントへデータを書き込む関数ポインタである。 |
| AllocMem | INT_PTR | 8/4 | +56 | +36 | リクエストスコープのメモリを割り当てる関数ポインタである。 |
| ServerSupportFunction | INT_PTR | 8/4 | +64 | +40 | 各種フィルタ支援機能を呼び出す関数ポインタである。 |
各言語での定義
#include <windows.h>
// HTTP_FILTER_CONTEXT (x64 72 / x86 44 バイト)
typedef struct HTTP_FILTER_CONTEXT {
DWORD cbSize;
DWORD Revision;
void* ServerContext;
DWORD ulReserved;
BOOL fIsSecurePort;
void* pFilterContext;
INT_PTR GetServerVariable;
INT_PTR AddResponseHeaders;
INT_PTR WriteClient;
INT_PTR AllocMem;
INT_PTR ServerSupportFunction;
} HTTP_FILTER_CONTEXT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HTTP_FILTER_CONTEXT
{
public uint cbSize;
public uint Revision;
public IntPtr ServerContext;
public uint ulReserved;
[MarshalAs(UnmanagedType.Bool)] public bool fIsSecurePort;
public IntPtr pFilterContext;
public IntPtr GetServerVariable;
public IntPtr AddResponseHeaders;
public IntPtr WriteClient;
public IntPtr AllocMem;
public IntPtr ServerSupportFunction;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HTTP_FILTER_CONTEXT
Public cbSize As UInteger
Public Revision As UInteger
Public ServerContext As IntPtr
Public ulReserved As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fIsSecurePort As Boolean
Public pFilterContext As IntPtr
Public GetServerVariable As IntPtr
Public AddResponseHeaders As IntPtr
Public WriteClient As IntPtr
Public AllocMem As IntPtr
Public ServerSupportFunction As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class HTTP_FILTER_CONTEXT(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("Revision", wintypes.DWORD),
("ServerContext", ctypes.c_void_p),
("ulReserved", wintypes.DWORD),
("fIsSecurePort", wintypes.BOOL),
("pFilterContext", ctypes.c_void_p),
("GetServerVariable", ctypes.c_ssize_t),
("AddResponseHeaders", ctypes.c_ssize_t),
("WriteClient", ctypes.c_ssize_t),
("AllocMem", ctypes.c_ssize_t),
("ServerSupportFunction", ctypes.c_ssize_t),
]#[repr(C)]
pub struct HTTP_FILTER_CONTEXT {
pub cbSize: u32,
pub Revision: u32,
pub ServerContext: *mut core::ffi::c_void,
pub ulReserved: u32,
pub fIsSecurePort: i32,
pub pFilterContext: *mut core::ffi::c_void,
pub GetServerVariable: isize,
pub AddResponseHeaders: isize,
pub WriteClient: isize,
pub AllocMem: isize,
pub ServerSupportFunction: isize,
}import "golang.org/x/sys/windows"
type HTTP_FILTER_CONTEXT struct {
cbSize uint32
Revision uint32
ServerContext uintptr
ulReserved uint32
fIsSecurePort int32
pFilterContext uintptr
GetServerVariable uintptr
AddResponseHeaders uintptr
WriteClient uintptr
AllocMem uintptr
ServerSupportFunction uintptr
}type
HTTP_FILTER_CONTEXT = record
cbSize: DWORD;
Revision: DWORD;
ServerContext: Pointer;
ulReserved: DWORD;
fIsSecurePort: BOOL;
pFilterContext: Pointer;
GetServerVariable: NativeInt;
AddResponseHeaders: NativeInt;
WriteClient: NativeInt;
AllocMem: NativeInt;
ServerSupportFunction: NativeInt;
end;const HTTP_FILTER_CONTEXT = extern struct {
cbSize: u32,
Revision: u32,
ServerContext: ?*anyopaque,
ulReserved: u32,
fIsSecurePort: i32,
pFilterContext: ?*anyopaque,
GetServerVariable: isize,
AddResponseHeaders: isize,
WriteClient: isize,
AllocMem: isize,
ServerSupportFunction: isize,
};type
HTTP_FILTER_CONTEXT {.bycopy.} = object
cbSize: uint32
Revision: uint32
ServerContext: pointer
ulReserved: uint32
fIsSecurePort: int32
pFilterContext: pointer
GetServerVariable: int
AddResponseHeaders: int
WriteClient: int
AllocMem: int
ServerSupportFunction: intstruct HTTP_FILTER_CONTEXT
{
uint cbSize;
uint Revision;
void* ServerContext;
uint ulReserved;
int fIsSecurePort;
void* pFilterContext;
ptrdiff_t GetServerVariable;
ptrdiff_t AddResponseHeaders;
ptrdiff_t WriteClient;
ptrdiff_t AllocMem;
ptrdiff_t ServerSupportFunction;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HTTP_FILTER_CONTEXT サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Revision : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ServerContext : void* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ulReserved : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fIsSecurePort : BOOL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pFilterContext : void* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; GetServerVariable : INT_PTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; AddResponseHeaders : INT_PTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; WriteClient : INT_PTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; AllocMem : INT_PTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ServerSupportFunction : INT_PTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HTTP_FILTER_CONTEXT サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Revision : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ServerContext : void* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ulReserved : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fIsSecurePort : BOOL (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pFilterContext : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetServerVariable : INT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AddResponseHeaders : INT_PTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; WriteClient : INT_PTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; AllocMem : INT_PTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ServerSupportFunction : INT_PTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HTTP_FILTER_CONTEXT
#field int cbSize
#field int Revision
#field intptr ServerContext
#field int ulReserved
#field bool fIsSecurePort
#field intptr pFilterContext
#field intptr GetServerVariable
#field intptr AddResponseHeaders
#field intptr WriteClient
#field intptr AllocMem
#field intptr ServerSupportFunction
#endstruct
stdim st, HTTP_FILTER_CONTEXT ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize