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

HTTP_FILTER_VERSION

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

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

フィールド

フィールドサイズx64x86説明
dwServerFilterVersionDWORD4+0+0サーバーがサポートするフィルタ仕様バージョンを示すDWORDである。
dwFilterVersionDWORD4+4+4フィルタが要求する仕様バージョンを示すDWORDである。
lpszFilterDescCHAR257+8+8フィルタの説明文字列を格納するCHAR配列である。
dwFlagsDWORD4+268+268フィルタが通知を受けるイベント種別と優先度を示すフラグ(SF_NOTIFY_*)を示すDWORDである。

各言語での定義

#include <windows.h>

// HTTP_FILTER_VERSION  (x64 272 / x86 272 バイト)
typedef struct HTTP_FILTER_VERSION {
    DWORD dwServerFilterVersion;
    DWORD dwFilterVersion;
    CHAR lpszFilterDesc[257];
    DWORD dwFlags;
} HTTP_FILTER_VERSION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HTTP_FILTER_VERSION
{
    public uint dwServerFilterVersion;
    public uint dwFilterVersion;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 257)] public sbyte[] lpszFilterDesc;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HTTP_FILTER_VERSION
    Public dwServerFilterVersion As UInteger
    Public dwFilterVersion As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=257)> Public lpszFilterDesc() As SByte
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class HTTP_FILTER_VERSION(ctypes.Structure):
    _fields_ = [
        ("dwServerFilterVersion", wintypes.DWORD),
        ("dwFilterVersion", wintypes.DWORD),
        ("lpszFilterDesc", ctypes.c_byte * 257),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct HTTP_FILTER_VERSION {
    pub dwServerFilterVersion: u32,
    pub dwFilterVersion: u32,
    pub lpszFilterDesc: [i8; 257],
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type HTTP_FILTER_VERSION struct {
	dwServerFilterVersion uint32
	dwFilterVersion uint32
	lpszFilterDesc [257]int8
	dwFlags uint32
}
type
  HTTP_FILTER_VERSION = record
    dwServerFilterVersion: DWORD;
    dwFilterVersion: DWORD;
    lpszFilterDesc: array[0..256] of Shortint;
    dwFlags: DWORD;
  end;
const HTTP_FILTER_VERSION = extern struct {
    dwServerFilterVersion: u32,
    dwFilterVersion: u32,
    lpszFilterDesc: [257]i8,
    dwFlags: u32,
};
type
  HTTP_FILTER_VERSION {.bycopy.} = object
    dwServerFilterVersion: uint32
    dwFilterVersion: uint32
    lpszFilterDesc: array[257, int8]
    dwFlags: uint32
struct HTTP_FILTER_VERSION
{
    uint dwServerFilterVersion;
    uint dwFilterVersion;
    byte[257] lpszFilterDesc;
    uint dwFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HTTP_FILTER_VERSION サイズ: 272 バイト(x64)
dim st, 68    ; 4byte整数×68(構造体サイズ 272 / 4 切り上げ)
; dwServerFilterVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFilterVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; lpszFilterDesc : CHAR (+8, 257byte)  varptr(st)+8 を基点に操作(257byte:入れ子/配列)
; dwFlags : DWORD (+268, 4byte)  st.67 = 値  /  値 = st.67   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HTTP_FILTER_VERSION
    #field int dwServerFilterVersion
    #field int dwFilterVersion
    #field byte lpszFilterDesc 257
    #field int dwFlags
#endstruct

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