ホーム › System.Rpc › MIDL_INTERCEPTION_INFO
MIDL_INTERCEPTION_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | インターセプション情報構造体のバージョン番号。 |
| ProcString | BYTE* | 8/4 | +8 | +4 | プロシージャを記述するNDRフォーマット文字列へのポインタ。 |
| ProcFormatOffsetTable | WORD* | 8/4 | +16 | +8 | 各プロシージャのフォーマット文字列オフセットを格納するWORD配列へのポインタ。 |
| ProcCount | DWORD | 4 | +24 | +12 | プロシージャの個数。 |
| TypeString | BYTE* | 8/4 | +32 | +16 | 型を記述するNDRフォーマット文字列へのポインタ。 |
各言語での定義
#include <windows.h>
// MIDL_INTERCEPTION_INFO (x64 40 / x86 20 バイト)
typedef struct MIDL_INTERCEPTION_INFO {
DWORD Version;
BYTE* ProcString;
WORD* ProcFormatOffsetTable;
DWORD ProcCount;
BYTE* TypeString;
} MIDL_INTERCEPTION_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIDL_INTERCEPTION_INFO
{
public uint Version;
public IntPtr ProcString;
public IntPtr ProcFormatOffsetTable;
public uint ProcCount;
public IntPtr TypeString;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIDL_INTERCEPTION_INFO
Public Version As UInteger
Public ProcString As IntPtr
Public ProcFormatOffsetTable As IntPtr
Public ProcCount As UInteger
Public TypeString As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MIDL_INTERCEPTION_INFO(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("ProcString", ctypes.c_void_p),
("ProcFormatOffsetTable", ctypes.c_void_p),
("ProcCount", wintypes.DWORD),
("TypeString", ctypes.c_void_p),
]#[repr(C)]
pub struct MIDL_INTERCEPTION_INFO {
pub Version: u32,
pub ProcString: *mut core::ffi::c_void,
pub ProcFormatOffsetTable: *mut core::ffi::c_void,
pub ProcCount: u32,
pub TypeString: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type MIDL_INTERCEPTION_INFO struct {
Version uint32
ProcString uintptr
ProcFormatOffsetTable uintptr
ProcCount uint32
TypeString uintptr
}type
MIDL_INTERCEPTION_INFO = record
Version: DWORD;
ProcString: Pointer;
ProcFormatOffsetTable: Pointer;
ProcCount: DWORD;
TypeString: Pointer;
end;const MIDL_INTERCEPTION_INFO = extern struct {
Version: u32,
ProcString: ?*anyopaque,
ProcFormatOffsetTable: ?*anyopaque,
ProcCount: u32,
TypeString: ?*anyopaque,
};type
MIDL_INTERCEPTION_INFO {.bycopy.} = object
Version: uint32
ProcString: pointer
ProcFormatOffsetTable: pointer
ProcCount: uint32
TypeString: pointerstruct MIDL_INTERCEPTION_INFO
{
uint Version;
void* ProcString;
void* ProcFormatOffsetTable;
uint ProcCount;
void* TypeString;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MIDL_INTERCEPTION_INFO サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ProcString : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ProcFormatOffsetTable : WORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ProcCount : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; TypeString : BYTE* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIDL_INTERCEPTION_INFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ProcString : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ProcFormatOffsetTable : WORD* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ProcCount : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; TypeString : BYTE* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIDL_INTERCEPTION_INFO
#field int Version
#field intptr ProcString
#field intptr ProcFormatOffsetTable
#field int ProcCount
#field intptr TypeString
#endstruct
stdim st, MIDL_INTERCEPTION_INFO ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version