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

POST_PROCESS_PARAMETERS

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

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

フィールド

フィールドサイズx64x86説明
pszSessionIdLPWSTR8/4+0+0FTPセッションを一意に識別するセッションID文字列である。
pszSiteNameLPWSTR8/4+8+4対象FTPサイト名を示す文字列である。
pszUserNameLPWSTR8/4+16+8認証されたユーザー名を示す文字列である。
pszHostNameLPWSTR8/4+24+12接続ホスト名を示す文字列である。
pszRemoteIpAddressLPWSTR8/4+32+16リモート(クライアント)IPアドレスを示す文字列である。
dwRemoteIpPortDWORD4+40+20リモート(クライアント)ポート番号を示すDWORDである。
pszLocalIpAddressLPWSTR8/4+48+24ローカル(サーバー)IPアドレスを示す文字列である。
dwLocalIpPortDWORD4+56+28ローカル(サーバー)ポート番号を示すDWORDである。
BytesSentULONGLONG8+64+32今回の処理での送信バイト数を示すULONGLONGである。
BytesReceivedULONGLONG8+72+40今回の処理での受信バイト数を示すULONGLONGである。
pszCommandLPWSTR8/4+80+48実行されたFTPコマンドを示す文字列である。
pszCommandParametersLPWSTR8/4+88+52FTPコマンドのパラメータを示す文字列である。
pszFullPathLPWSTR8/4+96+56対象の論理フルパスを示す文字列である。
pszPhysicalPathLPWSTR8/4+104+60対象の物理パスを示す文字列である。
FtpStatusDWORD4+112+64FTP応答ステータスコードを示すDWORDである。
FtpSubStatusDWORD4+116+68FTPサブステータスコードを示すDWORDである。
hrStatusHRESULT4+120+72処理結果を示すHRESULTである。
SessionStartTimeFILETIME8+124+76セッション開始時刻を示すFILETIMEである。
BytesSentPerSessionULONGLONG8+136+88セッション中の累積送信バイト数を示すULONGLONGである。
BytesReceivedPerSessionULONGLONG8+144+96セッション中の累積受信バイト数を示すULONGLONGである。

各言語での定義

#include <windows.h>

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// POST_PROCESS_PARAMETERS  (x64 152 / x86 104 バイト)
typedef struct POST_PROCESS_PARAMETERS {
    LPWSTR pszSessionId;
    LPWSTR pszSiteName;
    LPWSTR pszUserName;
    LPWSTR pszHostName;
    LPWSTR pszRemoteIpAddress;
    DWORD dwRemoteIpPort;
    LPWSTR pszLocalIpAddress;
    DWORD dwLocalIpPort;
    ULONGLONG BytesSent;
    ULONGLONG BytesReceived;
    LPWSTR pszCommand;
    LPWSTR pszCommandParameters;
    LPWSTR pszFullPath;
    LPWSTR pszPhysicalPath;
    DWORD FtpStatus;
    DWORD FtpSubStatus;
    HRESULT hrStatus;
    FILETIME SessionStartTime;
    ULONGLONG BytesSentPerSession;
    ULONGLONG BytesReceivedPerSession;
} POST_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 POST_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 ulong BytesSent;
    public ulong BytesReceived;
    public IntPtr pszCommand;
    public IntPtr pszCommandParameters;
    public IntPtr pszFullPath;
    public IntPtr pszPhysicalPath;
    public uint FtpStatus;
    public uint FtpSubStatus;
    public int hrStatus;
    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 POST_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 BytesSent As ULong
    Public BytesReceived As ULong
    Public pszCommand As IntPtr
    Public pszCommandParameters As IntPtr
    Public pszFullPath As IntPtr
    Public pszPhysicalPath As IntPtr
    Public FtpStatus As UInteger
    Public FtpSubStatus As UInteger
    Public hrStatus As Integer
    Public SessionStartTime As FILETIME
    Public BytesSentPerSession As ULong
    Public BytesReceivedPerSession As ULong
End Structure
import ctypes
from ctypes import wintypes

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class POST_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),
        ("BytesSent", ctypes.c_ulonglong),
        ("BytesReceived", ctypes.c_ulonglong),
        ("pszCommand", ctypes.c_void_p),
        ("pszCommandParameters", ctypes.c_void_p),
        ("pszFullPath", ctypes.c_void_p),
        ("pszPhysicalPath", ctypes.c_void_p),
        ("FtpStatus", wintypes.DWORD),
        ("FtpSubStatus", wintypes.DWORD),
        ("hrStatus", ctypes.c_int),
        ("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 POST_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 BytesSent: u64,
    pub BytesReceived: u64,
    pub pszCommand: *mut core::ffi::c_void,
    pub pszCommandParameters: *mut core::ffi::c_void,
    pub pszFullPath: *mut core::ffi::c_void,
    pub pszPhysicalPath: *mut core::ffi::c_void,
    pub FtpStatus: u32,
    pub FtpSubStatus: u32,
    pub hrStatus: i32,
    pub SessionStartTime: FILETIME,
    pub BytesSentPerSession: u64,
    pub BytesReceivedPerSession: u64,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type POST_PROCESS_PARAMETERS struct {
	pszSessionId uintptr
	pszSiteName uintptr
	pszUserName uintptr
	pszHostName uintptr
	pszRemoteIpAddress uintptr
	dwRemoteIpPort uint32
	pszLocalIpAddress uintptr
	dwLocalIpPort uint32
	BytesSent uint64
	BytesReceived uint64
	pszCommand uintptr
	pszCommandParameters uintptr
	pszFullPath uintptr
	pszPhysicalPath uintptr
	FtpStatus uint32
	FtpSubStatus uint32
	hrStatus int32
	SessionStartTime FILETIME
	BytesSentPerSession uint64
	BytesReceivedPerSession uint64
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  POST_PROCESS_PARAMETERS = record
    pszSessionId: Pointer;
    pszSiteName: Pointer;
    pszUserName: Pointer;
    pszHostName: Pointer;
    pszRemoteIpAddress: Pointer;
    dwRemoteIpPort: DWORD;
    pszLocalIpAddress: Pointer;
    dwLocalIpPort: DWORD;
    BytesSent: UInt64;
    BytesReceived: UInt64;
    pszCommand: Pointer;
    pszCommandParameters: Pointer;
    pszFullPath: Pointer;
    pszPhysicalPath: Pointer;
    FtpStatus: DWORD;
    FtpSubStatus: DWORD;
    hrStatus: Integer;
    SessionStartTime: FILETIME;
    BytesSentPerSession: UInt64;
    BytesReceivedPerSession: UInt64;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const POST_PROCESS_PARAMETERS = extern struct {
    pszSessionId: ?*anyopaque,
    pszSiteName: ?*anyopaque,
    pszUserName: ?*anyopaque,
    pszHostName: ?*anyopaque,
    pszRemoteIpAddress: ?*anyopaque,
    dwRemoteIpPort: u32,
    pszLocalIpAddress: ?*anyopaque,
    dwLocalIpPort: u32,
    BytesSent: u64,
    BytesReceived: u64,
    pszCommand: ?*anyopaque,
    pszCommandParameters: ?*anyopaque,
    pszFullPath: ?*anyopaque,
    pszPhysicalPath: ?*anyopaque,
    FtpStatus: u32,
    FtpSubStatus: u32,
    hrStatus: i32,
    SessionStartTime: FILETIME,
    BytesSentPerSession: u64,
    BytesReceivedPerSession: u64,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  POST_PROCESS_PARAMETERS {.bycopy.} = object
    pszSessionId: pointer
    pszSiteName: pointer
    pszUserName: pointer
    pszHostName: pointer
    pszRemoteIpAddress: pointer
    dwRemoteIpPort: uint32
    pszLocalIpAddress: pointer
    dwLocalIpPort: uint32
    BytesSent: uint64
    BytesReceived: uint64
    pszCommand: pointer
    pszCommandParameters: pointer
    pszFullPath: pointer
    pszPhysicalPath: pointer
    FtpStatus: uint32
    FtpSubStatus: uint32
    hrStatus: int32
    SessionStartTime: FILETIME
    BytesSentPerSession: uint64
    BytesReceivedPerSession: uint64
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct POST_PROCESS_PARAMETERS
{
    void* pszSessionId;
    void* pszSiteName;
    void* pszUserName;
    void* pszHostName;
    void* pszRemoteIpAddress;
    uint dwRemoteIpPort;
    void* pszLocalIpAddress;
    uint dwLocalIpPort;
    ulong BytesSent;
    ulong BytesReceived;
    void* pszCommand;
    void* pszCommandParameters;
    void* pszFullPath;
    void* pszPhysicalPath;
    uint FtpStatus;
    uint FtpSubStatus;
    int hrStatus;
    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 レイアウト)
; POST_PROCESS_PARAMETERS サイズ: 104 バイト(x86)
dim st, 26    ; 4byte整数×26(構造体サイズ 104 / 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 も可)
; BytesSent : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; BytesReceived : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pszCommand : LPWSTR (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pszCommandParameters : LPWSTR (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; pszFullPath : LPWSTR (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; pszPhysicalPath : LPWSTR (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; FtpStatus : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; FtpSubStatus : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; hrStatus : HRESULT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; SessionStartTime : FILETIME (+76, 8byte)  varptr(st)+76 を基点に操作(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 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POST_PROCESS_PARAMETERS サイズ: 152 バイト(x64)
dim st, 38    ; 4byte整数×38(構造体サイズ 152 / 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 も可)
; BytesSent : ULONGLONG (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; BytesReceived : ULONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; pszCommand : LPWSTR (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; pszCommandParameters : LPWSTR (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pszFullPath : LPWSTR (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; pszPhysicalPath : LPWSTR (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; FtpStatus : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; FtpSubStatus : DWORD (+116, 4byte)  st.29 = 値  /  値 = st.29   (lpoke/lpeek も可)
; hrStatus : HRESULT (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; SessionStartTime : FILETIME (+124, 8byte)  varptr(st)+124 を基点に操作(8byte:入れ子/配列)
; BytesSentPerSession : ULONGLONG (+136, 8byte)  qpoke st,136,値 / qpeek(st,136)  ※IronHSPのみ。3.7/3.8は lpoke st,136,下位 : lpoke st,140,上位
; BytesReceivedPerSession : ULONGLONG (+144, 8byte)  qpoke st,144,値 / qpeek(st,144)  ※IronHSPのみ。3.7/3.8は lpoke st,144,下位 : lpoke st,148,上位
; ※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 POST_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 int64 BytesSent
    #field int64 BytesReceived
    #field intptr pszCommand
    #field intptr pszCommandParameters
    #field intptr pszFullPath
    #field intptr pszPhysicalPath
    #field int FtpStatus
    #field int FtpSubStatus
    #field int hrStatus
    #field FILETIME SessionStartTime
    #field int64 BytesSentPerSession
    #field int64 BytesReceivedPerSession
#endstruct

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