ホーム › System.Iis › PRE_PROCESS_PARAMETERS
PRE_PROCESS_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pszSessionId | LPWSTR | 8/4 | +0 | +0 | FTPセッションを一意に識別するセッションID文字列である。 |
| pszSiteName | LPWSTR | 8/4 | +8 | +4 | 対象FTPサイト名を示す文字列である。 |
| pszUserName | LPWSTR | 8/4 | +16 | +8 | 認証されたユーザー名を示す文字列である。 |
| pszHostName | LPWSTR | 8/4 | +24 | +12 | 接続ホスト名を示す文字列である。 |
| pszRemoteIpAddress | LPWSTR | 8/4 | +32 | +16 | リモート(クライアント)IPアドレスを示す文字列である。 |
| dwRemoteIpPort | DWORD | 4 | +40 | +20 | リモート(クライアント)ポート番号を示すDWORDである。 |
| pszLocalIpAddress | LPWSTR | 8/4 | +48 | +24 | ローカル(サーバー)IPアドレスを示す文字列である。 |
| dwLocalIpPort | DWORD | 4 | +56 | +28 | ローカル(サーバー)ポート番号を示すDWORDである。 |
| pszCommand | LPWSTR | 8/4 | +64 | +32 | 実行されたFTPコマンドを示す文字列である。 |
| pszCommandParameters | LPWSTR | 8/4 | +72 | +36 | FTPコマンドのパラメータを示す文字列である。 |
| SessionStartTime | FILETIME | 8 | +80 | +40 | セッション開始時刻を示すFILETIMEである。 |
| BytesSentPerSession | ULONGLONG | 8 | +88 | +48 | セッション中の累積送信バイト数を示すULONGLONGである。 |
| BytesReceivedPerSession | ULONGLONG | 8 | +96 | +56 | セッション中の累積受信バイト数を示すULONGLONGである。 |
各言語での定義
#include <windows.h>
// FILETIME (x64 8 / x86 8 バイト)
typedef struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
// PRE_PROCESS_PARAMETERS (x64 104 / x86 64 バイト)
typedef struct PRE_PROCESS_PARAMETERS {
LPWSTR pszSessionId;
LPWSTR pszSiteName;
LPWSTR pszUserName;
LPWSTR pszHostName;
LPWSTR pszRemoteIpAddress;
DWORD dwRemoteIpPort;
LPWSTR pszLocalIpAddress;
DWORD dwLocalIpPort;
LPWSTR pszCommand;
LPWSTR pszCommandParameters;
FILETIME SessionStartTime;
ULONGLONG BytesSentPerSession;
ULONGLONG BytesReceivedPerSession;
} PRE_PROCESS_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PRE_PROCESS_PARAMETERS
{
public IntPtr pszSessionId;
public IntPtr pszSiteName;
public IntPtr pszUserName;
public IntPtr pszHostName;
public IntPtr pszRemoteIpAddress;
public uint dwRemoteIpPort;
public IntPtr pszLocalIpAddress;
public uint dwLocalIpPort;
public IntPtr pszCommand;
public IntPtr pszCommandParameters;
public FILETIME SessionStartTime;
public ulong BytesSentPerSession;
public ulong BytesReceivedPerSession;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PRE_PROCESS_PARAMETERS
Public pszSessionId As IntPtr
Public pszSiteName As IntPtr
Public pszUserName As IntPtr
Public pszHostName As IntPtr
Public pszRemoteIpAddress As IntPtr
Public dwRemoteIpPort As UInteger
Public pszLocalIpAddress As IntPtr
Public dwLocalIpPort As UInteger
Public pszCommand As IntPtr
Public pszCommandParameters As IntPtr
Public SessionStartTime As FILETIME
Public BytesSentPerSession As ULong
Public BytesReceivedPerSession As ULong
End Structureimport ctypes
from ctypes import wintypes
class FILETIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class PRE_PROCESS_PARAMETERS(ctypes.Structure):
_fields_ = [
("pszSessionId", ctypes.c_void_p),
("pszSiteName", ctypes.c_void_p),
("pszUserName", ctypes.c_void_p),
("pszHostName", ctypes.c_void_p),
("pszRemoteIpAddress", ctypes.c_void_p),
("dwRemoteIpPort", wintypes.DWORD),
("pszLocalIpAddress", ctypes.c_void_p),
("dwLocalIpPort", wintypes.DWORD),
("pszCommand", ctypes.c_void_p),
("pszCommandParameters", ctypes.c_void_p),
("SessionStartTime", FILETIME),
("BytesSentPerSession", ctypes.c_ulonglong),
("BytesReceivedPerSession", ctypes.c_ulonglong),
]#[repr(C)]
pub struct FILETIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct PRE_PROCESS_PARAMETERS {
pub pszSessionId: *mut core::ffi::c_void,
pub pszSiteName: *mut core::ffi::c_void,
pub pszUserName: *mut core::ffi::c_void,
pub pszHostName: *mut core::ffi::c_void,
pub pszRemoteIpAddress: *mut core::ffi::c_void,
pub dwRemoteIpPort: u32,
pub pszLocalIpAddress: *mut core::ffi::c_void,
pub dwLocalIpPort: u32,
pub pszCommand: *mut core::ffi::c_void,
pub pszCommandParameters: *mut core::ffi::c_void,
pub SessionStartTime: FILETIME,
pub BytesSentPerSession: u64,
pub BytesReceivedPerSession: u64,
}import "golang.org/x/sys/windows"
type FILETIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type PRE_PROCESS_PARAMETERS struct {
pszSessionId uintptr
pszSiteName uintptr
pszUserName uintptr
pszHostName uintptr
pszRemoteIpAddress uintptr
dwRemoteIpPort uint32
pszLocalIpAddress uintptr
dwLocalIpPort uint32
pszCommand uintptr
pszCommandParameters uintptr
SessionStartTime FILETIME
BytesSentPerSession uint64
BytesReceivedPerSession uint64
}type
FILETIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
PRE_PROCESS_PARAMETERS = record
pszSessionId: Pointer;
pszSiteName: Pointer;
pszUserName: Pointer;
pszHostName: Pointer;
pszRemoteIpAddress: Pointer;
dwRemoteIpPort: DWORD;
pszLocalIpAddress: Pointer;
dwLocalIpPort: DWORD;
pszCommand: Pointer;
pszCommandParameters: Pointer;
SessionStartTime: FILETIME;
BytesSentPerSession: UInt64;
BytesReceivedPerSession: UInt64;
end;const FILETIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const PRE_PROCESS_PARAMETERS = extern struct {
pszSessionId: ?*anyopaque,
pszSiteName: ?*anyopaque,
pszUserName: ?*anyopaque,
pszHostName: ?*anyopaque,
pszRemoteIpAddress: ?*anyopaque,
dwRemoteIpPort: u32,
pszLocalIpAddress: ?*anyopaque,
dwLocalIpPort: u32,
pszCommand: ?*anyopaque,
pszCommandParameters: ?*anyopaque,
SessionStartTime: FILETIME,
BytesSentPerSession: u64,
BytesReceivedPerSession: u64,
};type
FILETIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
PRE_PROCESS_PARAMETERS {.bycopy.} = object
pszSessionId: pointer
pszSiteName: pointer
pszUserName: pointer
pszHostName: pointer
pszRemoteIpAddress: pointer
dwRemoteIpPort: uint32
pszLocalIpAddress: pointer
dwLocalIpPort: uint32
pszCommand: pointer
pszCommandParameters: pointer
SessionStartTime: FILETIME
BytesSentPerSession: uint64
BytesReceivedPerSession: uint64struct FILETIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct PRE_PROCESS_PARAMETERS
{
void* pszSessionId;
void* pszSiteName;
void* pszUserName;
void* pszHostName;
void* pszRemoteIpAddress;
uint dwRemoteIpPort;
void* pszLocalIpAddress;
uint dwLocalIpPort;
void* pszCommand;
void* pszCommandParameters;
FILETIME SessionStartTime;
ulong BytesSentPerSession;
ulong BytesReceivedPerSession;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PRE_PROCESS_PARAMETERS サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; pszSessionId : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pszSiteName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszUserName : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszHostName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pszRemoteIpAddress : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwRemoteIpPort : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pszLocalIpAddress : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwLocalIpPort : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pszCommand : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pszCommandParameters : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; SessionStartTime : FILETIME (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; BytesSentPerSession : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; BytesReceivedPerSession : ULONGLONG (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRE_PROCESS_PARAMETERS サイズ: 104 バイト(x64)
dim st, 26 ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; pszSessionId : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pszSiteName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszUserName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pszHostName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pszRemoteIpAddress : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwRemoteIpPort : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pszLocalIpAddress : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwLocalIpPort : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; pszCommand : LPWSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pszCommandParameters : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; SessionStartTime : FILETIME (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; BytesSentPerSession : ULONGLONG (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; BytesReceivedPerSession : ULONGLONG (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global PRE_PROCESS_PARAMETERS
#field intptr pszSessionId
#field intptr pszSiteName
#field intptr pszUserName
#field intptr pszHostName
#field intptr pszRemoteIpAddress
#field int dwRemoteIpPort
#field intptr pszLocalIpAddress
#field int dwLocalIpPort
#field intptr pszCommand
#field intptr pszCommandParameters
#field FILETIME SessionStartTime
#field int64 BytesSentPerSession
#field int64 BytesReceivedPerSession
#endstruct
stdim st, PRE_PROCESS_PARAMETERS ; NSTRUCT 変数を確保
st->dwRemoteIpPort = 100
mes "dwRemoteIpPort=" + st->dwRemoteIpPort