ホーム › Networking.HttpServer › HTTP_LOGGING_INFO
HTTP_LOGGING_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Flags | HTTP_PROPERTY_FLAGS | 4 | +0 | +0 | プロパティの有効状態を示すHTTP_PROPERTY_FLAGSである。 |
| LoggingFlags | DWORD | 4 | +4 | +4 | ログ動作を制御するフラグである。 |
| SoftwareName | LPWSTR | 8/4 | +8 | +8 | ログに記録するソフトウェア名を示すワイド文字列ポインターである。 |
| SoftwareNameLength | WORD | 2 | +16 | +12 | SoftwareNameの文字数(WORD)である。 |
| DirectoryNameLength | WORD | 2 | +18 | +14 | DirectoryNameの文字数(WORD)である。 |
| DirectoryName | LPWSTR | 8/4 | +24 | +16 | ログ出力先ディレクトリのパスを示すワイド文字列ポインターである。 |
| Format | HTTP_LOGGING_TYPE | 4 | +32 | +20 | ログ形式を示すHTTP_LOGGING_TYPE列挙値である。W3C等を表す。 |
| Fields | DWORD | 4 | +36 | +24 | 記録するログフィールドを示すビットフラグである。 |
| pExtFields | void* | 8/4 | +40 | +28 | 拡張フィールド定義へのポインターである。未使用時はNULL可。 |
| NumOfExtFields | WORD | 2 | +48 | +32 | 拡張フィールドの数(WORD)である。 |
| MaxRecordSize | WORD | 2 | +50 | +34 | 1レコードの最大バイトサイズ(WORD)である。 |
| RolloverType | HTTP_LOGGING_ROLLOVER_TYPE | 4 | +52 | +36 | ログファイルのローテーション方式を示すHTTP_LOGGING_ROLLOVER_TYPE列挙値である。 |
| RolloverSize | DWORD | 4 | +56 | +40 | サイズベースローテーション時のしきい値をバイト単位で示す値である。 |
| pSecurityDescriptor | PSECURITY_DESCRIPTOR | 8/4 | +64 | +44 | ログファイルに適用するセキュリティ記述子へのポインターである。未使用時はNULL可。 |
各言語での定義
#include <windows.h>
// HTTP_PROPERTY_FLAGS (x64 4 / x86 4 バイト)
typedef struct HTTP_PROPERTY_FLAGS {
DWORD _bitfield;
} HTTP_PROPERTY_FLAGS;
// HTTP_LOGGING_INFO (x64 72 / x86 48 バイト)
typedef struct HTTP_LOGGING_INFO {
HTTP_PROPERTY_FLAGS Flags;
DWORD LoggingFlags;
LPWSTR SoftwareName;
WORD SoftwareNameLength;
WORD DirectoryNameLength;
LPWSTR DirectoryName;
HTTP_LOGGING_TYPE Format;
DWORD Fields;
void* pExtFields;
WORD NumOfExtFields;
WORD MaxRecordSize;
HTTP_LOGGING_ROLLOVER_TYPE RolloverType;
DWORD RolloverSize;
PSECURITY_DESCRIPTOR pSecurityDescriptor;
} HTTP_LOGGING_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HTTP_PROPERTY_FLAGS
{
public uint _bitfield;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HTTP_LOGGING_INFO
{
public HTTP_PROPERTY_FLAGS Flags;
public uint LoggingFlags;
public IntPtr SoftwareName;
public ushort SoftwareNameLength;
public ushort DirectoryNameLength;
public IntPtr DirectoryName;
public int Format;
public uint Fields;
public IntPtr pExtFields;
public ushort NumOfExtFields;
public ushort MaxRecordSize;
public int RolloverType;
public uint RolloverSize;
public IntPtr pSecurityDescriptor;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HTTP_PROPERTY_FLAGS
Public _bitfield As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HTTP_LOGGING_INFO
Public Flags As HTTP_PROPERTY_FLAGS
Public LoggingFlags As UInteger
Public SoftwareName As IntPtr
Public SoftwareNameLength As UShort
Public DirectoryNameLength As UShort
Public DirectoryName As IntPtr
Public Format As Integer
Public Fields As UInteger
Public pExtFields As IntPtr
Public NumOfExtFields As UShort
Public MaxRecordSize As UShort
Public RolloverType As Integer
Public RolloverSize As UInteger
Public pSecurityDescriptor As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class HTTP_PROPERTY_FLAGS(ctypes.Structure):
_fields_ = [
("_bitfield", wintypes.DWORD),
]
class HTTP_LOGGING_INFO(ctypes.Structure):
_fields_ = [
("Flags", HTTP_PROPERTY_FLAGS),
("LoggingFlags", wintypes.DWORD),
("SoftwareName", ctypes.c_void_p),
("SoftwareNameLength", ctypes.c_ushort),
("DirectoryNameLength", ctypes.c_ushort),
("DirectoryName", ctypes.c_void_p),
("Format", ctypes.c_int),
("Fields", wintypes.DWORD),
("pExtFields", ctypes.c_void_p),
("NumOfExtFields", ctypes.c_ushort),
("MaxRecordSize", ctypes.c_ushort),
("RolloverType", ctypes.c_int),
("RolloverSize", wintypes.DWORD),
("pSecurityDescriptor", ctypes.c_void_p),
]#[repr(C)]
pub struct HTTP_PROPERTY_FLAGS {
pub _bitfield: u32,
}
#[repr(C)]
pub struct HTTP_LOGGING_INFO {
pub Flags: HTTP_PROPERTY_FLAGS,
pub LoggingFlags: u32,
pub SoftwareName: *mut core::ffi::c_void,
pub SoftwareNameLength: u16,
pub DirectoryNameLength: u16,
pub DirectoryName: *mut core::ffi::c_void,
pub Format: i32,
pub Fields: u32,
pub pExtFields: *mut core::ffi::c_void,
pub NumOfExtFields: u16,
pub MaxRecordSize: u16,
pub RolloverType: i32,
pub RolloverSize: u32,
pub pSecurityDescriptor: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type HTTP_PROPERTY_FLAGS struct {
_bitfield uint32
}
type HTTP_LOGGING_INFO struct {
Flags HTTP_PROPERTY_FLAGS
LoggingFlags uint32
SoftwareName uintptr
SoftwareNameLength uint16
DirectoryNameLength uint16
DirectoryName uintptr
Format int32
Fields uint32
pExtFields uintptr
NumOfExtFields uint16
MaxRecordSize uint16
RolloverType int32
RolloverSize uint32
pSecurityDescriptor uintptr
}type
HTTP_PROPERTY_FLAGS = record
_bitfield: DWORD;
end;
HTTP_LOGGING_INFO = record
Flags: HTTP_PROPERTY_FLAGS;
LoggingFlags: DWORD;
SoftwareName: Pointer;
SoftwareNameLength: Word;
DirectoryNameLength: Word;
DirectoryName: Pointer;
Format: Integer;
Fields: DWORD;
pExtFields: Pointer;
NumOfExtFields: Word;
MaxRecordSize: Word;
RolloverType: Integer;
RolloverSize: DWORD;
pSecurityDescriptor: Pointer;
end;const HTTP_PROPERTY_FLAGS = extern struct {
_bitfield: u32,
};
const HTTP_LOGGING_INFO = extern struct {
Flags: HTTP_PROPERTY_FLAGS,
LoggingFlags: u32,
SoftwareName: ?*anyopaque,
SoftwareNameLength: u16,
DirectoryNameLength: u16,
DirectoryName: ?*anyopaque,
Format: i32,
Fields: u32,
pExtFields: ?*anyopaque,
NumOfExtFields: u16,
MaxRecordSize: u16,
RolloverType: i32,
RolloverSize: u32,
pSecurityDescriptor: ?*anyopaque,
};type
HTTP_PROPERTY_FLAGS {.bycopy.} = object
_bitfield: uint32
HTTP_LOGGING_INFO {.bycopy.} = object
Flags: HTTP_PROPERTY_FLAGS
LoggingFlags: uint32
SoftwareName: pointer
SoftwareNameLength: uint16
DirectoryNameLength: uint16
DirectoryName: pointer
Format: int32
Fields: uint32
pExtFields: pointer
NumOfExtFields: uint16
MaxRecordSize: uint16
RolloverType: int32
RolloverSize: uint32
pSecurityDescriptor: pointerstruct HTTP_PROPERTY_FLAGS
{
uint _bitfield;
}
struct HTTP_LOGGING_INFO
{
HTTP_PROPERTY_FLAGS Flags;
uint LoggingFlags;
void* SoftwareName;
ushort SoftwareNameLength;
ushort DirectoryNameLength;
void* DirectoryName;
int Format;
uint Fields;
void* pExtFields;
ushort NumOfExtFields;
ushort MaxRecordSize;
int RolloverType;
uint RolloverSize;
void* pSecurityDescriptor;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HTTP_LOGGING_INFO サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Flags : HTTP_PROPERTY_FLAGS (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; LoggingFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SoftwareName : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SoftwareNameLength : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; DirectoryNameLength : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; DirectoryName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Format : HTTP_LOGGING_TYPE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Fields : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pExtFields : void* (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; NumOfExtFields : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; MaxRecordSize : WORD (+34, 2byte) wpoke st,34,値 / 値 = wpeek(st,34)
; RolloverType : HTTP_LOGGING_ROLLOVER_TYPE (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; RolloverSize : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pSecurityDescriptor : PSECURITY_DESCRIPTOR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HTTP_LOGGING_INFO サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; Flags : HTTP_PROPERTY_FLAGS (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; LoggingFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SoftwareName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SoftwareNameLength : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; DirectoryNameLength : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; DirectoryName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Format : HTTP_LOGGING_TYPE (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Fields : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pExtFields : void* (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; NumOfExtFields : WORD (+48, 2byte) wpoke st,48,値 / 値 = wpeek(st,48)
; MaxRecordSize : WORD (+50, 2byte) wpoke st,50,値 / 値 = wpeek(st,50)
; RolloverType : HTTP_LOGGING_ROLLOVER_TYPE (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; RolloverSize : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; pSecurityDescriptor : PSECURITY_DESCRIPTOR (+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 どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global HTTP_PROPERTY_FLAGS
#field int _bitfield
#endstruct
#defstruct global HTTP_LOGGING_INFO
#field HTTP_PROPERTY_FLAGS Flags
#field int LoggingFlags
#field intptr SoftwareName
#field short SoftwareNameLength
#field short DirectoryNameLength
#field intptr DirectoryName
#field int Format
#field int Fields
#field intptr pExtFields
#field short NumOfExtFields
#field short MaxRecordSize
#field int RolloverType
#field int RolloverSize
#field intptr pSecurityDescriptor
#endstruct
stdim st, HTTP_LOGGING_INFO ; NSTRUCT 変数を確保
st->LoggingFlags = 100
mes "LoggingFlags=" + st->LoggingFlags