ホーム › Networking.Clustering › CLRES_FUNCTION_TABLE
CLRES_FUNCTION_TABLE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| TableSize | DWORD | 4 | +0 | +0 | 関数テーブルのバイト数である。 |
| Version | DWORD | 4 | +4 | +4 | 関数テーブルのバージョン番号である。V1〜V4のいずれかを示す。 |
| Anonymous | _Anonymous_e__Union | 112/56 | +8 | +8 | バージョンに応じたCLRES_Vn_FUNCTIONSを保持する無名共用体である。 |
共用体: _Anonymous_e__Union x64 112B / x86 56B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| V1Functions | CLRES_V1_FUNCTIONS | 88/44 | +0 | +0 |
| V2Functions | CLRES_V2_FUNCTIONS | 96/48 | +0 | +0 |
| V3Functions | CLRES_V3_FUNCTIONS | 96/48 | +0 | +0 |
| V4Functions | CLRES_V4_FUNCTIONS | 112/56 | +0 | +0 |
各言語での定義
#include <windows.h>
// CLRES_FUNCTION_TABLE (x64 120 / x86 64 バイト)
typedef struct CLRES_FUNCTION_TABLE {
DWORD TableSize;
DWORD Version;
_Anonymous_e__Union Anonymous;
} CLRES_FUNCTION_TABLE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLRES_FUNCTION_TABLE
{
public uint TableSize;
public uint Version;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLRES_FUNCTION_TABLE
Public TableSize As UInteger
Public Version As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class CLRES_FUNCTION_TABLE(ctypes.Structure):
_fields_ = [
("TableSize", wintypes.DWORD),
("Version", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct CLRES_FUNCTION_TABLE {
pub TableSize: u32,
pub Version: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type CLRES_FUNCTION_TABLE struct {
TableSize uint32
Version uint32
Anonymous _Anonymous_e__Union
}type
CLRES_FUNCTION_TABLE = record
TableSize: DWORD;
Version: DWORD;
Anonymous: _Anonymous_e__Union;
end;const CLRES_FUNCTION_TABLE = extern struct {
TableSize: u32,
Version: u32,
Anonymous: _Anonymous_e__Union,
};type
CLRES_FUNCTION_TABLE {.bycopy.} = object
TableSize: uint32
Version: uint32
Anonymous: _Anonymous_e__Unionstruct CLRES_FUNCTION_TABLE
{
uint TableSize;
uint Version;
_Anonymous_e__Union Anonymous;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CLRES_FUNCTION_TABLE サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; TableSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 56byte) varptr(st)+8 を基点に操作(56byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLRES_FUNCTION_TABLE サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; TableSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 112byte) varptr(st)+8 を基点に操作(112byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLRES_FUNCTION_TABLE
#field int TableSize
#field int Version
#field byte Anonymous 112
#endstruct
stdim st, CLRES_FUNCTION_TABLE ; NSTRUCT 変数を確保
st->TableSize = 100
mes "TableSize=" + st->TableSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。