ホーム › System.Wmi › MI_ClassFT
MI_ClassFT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| GetClassNameA | INT_PTR | 8/4 | +0 | +0 | クラス名を取得する関数ポインタ。 |
| GetNameSpace | INT_PTR | 8/4 | +8 | +4 | クラスの名前空間を取得する関数ポインタ。 |
| GetServerName | INT_PTR | 8/4 | +16 | +8 | クラス取得元のサーバー名を取得する関数ポインタ。 |
| GetElementCount | INT_PTR | 8/4 | +24 | +12 | クラスの要素(プロパティ)数を取得する関数ポインタ。 |
| GetElement | INT_PTR | 8/4 | +32 | +16 | 名前指定でプロパティ要素を取得する関数ポインタ。 |
| GetElementAt | INT_PTR | 8/4 | +40 | +20 | インデックス指定でプロパティ要素を取得する関数ポインタ。 |
| GetClassQualifierSet | INT_PTR | 8/4 | +48 | +24 | クラスの修飾子セットを取得する関数ポインタ。 |
| GetMethodCount | INT_PTR | 8/4 | +56 | +28 | クラスのメソッド数を取得する関数ポインタ。 |
| GetMethodAt | INT_PTR | 8/4 | +64 | +32 | インデックス指定でメソッドを取得する関数ポインタ。 |
| GetMethod | INT_PTR | 8/4 | +72 | +36 | 名前指定でメソッドを取得する関数ポインタ。 |
| GetParentClassName | INT_PTR | 8/4 | +80 | +40 | 親クラス名を取得する関数ポインタ。 |
| GetParentClass | INT_PTR | 8/4 | +88 | +44 | 親クラス定義を取得する関数ポインタ。 |
| Delete | INT_PTR | 8/4 | +96 | +48 | クラスを削除し領域を解放する関数ポインタ。 |
| Clone | INT_PTR | 8/4 | +104 | +52 | クラスを複製する関数ポインタ。 |
各言語での定義
#include <windows.h>
// MI_ClassFT (x64 112 / x86 56 バイト)
typedef struct MI_ClassFT {
INT_PTR GetClassNameA;
INT_PTR GetNameSpace;
INT_PTR GetServerName;
INT_PTR GetElementCount;
INT_PTR GetElement;
INT_PTR GetElementAt;
INT_PTR GetClassQualifierSet;
INT_PTR GetMethodCount;
INT_PTR GetMethodAt;
INT_PTR GetMethod;
INT_PTR GetParentClassName;
INT_PTR GetParentClass;
INT_PTR Delete;
INT_PTR Clone;
} MI_ClassFT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_ClassFT
{
public IntPtr GetClassNameA;
public IntPtr GetNameSpace;
public IntPtr GetServerName;
public IntPtr GetElementCount;
public IntPtr GetElement;
public IntPtr GetElementAt;
public IntPtr GetClassQualifierSet;
public IntPtr GetMethodCount;
public IntPtr GetMethodAt;
public IntPtr GetMethod;
public IntPtr GetParentClassName;
public IntPtr GetParentClass;
public IntPtr Delete;
public IntPtr Clone;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_ClassFT
Public GetClassNameA As IntPtr
Public GetNameSpace As IntPtr
Public GetServerName As IntPtr
Public GetElementCount As IntPtr
Public GetElement As IntPtr
Public GetElementAt As IntPtr
Public GetClassQualifierSet As IntPtr
Public GetMethodCount As IntPtr
Public GetMethodAt As IntPtr
Public GetMethod As IntPtr
Public GetParentClassName As IntPtr
Public GetParentClass As IntPtr
Public Delete As IntPtr
Public Clone As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MI_ClassFT(ctypes.Structure):
_fields_ = [
("GetClassNameA", ctypes.c_ssize_t),
("GetNameSpace", ctypes.c_ssize_t),
("GetServerName", ctypes.c_ssize_t),
("GetElementCount", ctypes.c_ssize_t),
("GetElement", ctypes.c_ssize_t),
("GetElementAt", ctypes.c_ssize_t),
("GetClassQualifierSet", ctypes.c_ssize_t),
("GetMethodCount", ctypes.c_ssize_t),
("GetMethodAt", ctypes.c_ssize_t),
("GetMethod", ctypes.c_ssize_t),
("GetParentClassName", ctypes.c_ssize_t),
("GetParentClass", ctypes.c_ssize_t),
("Delete", ctypes.c_ssize_t),
("Clone", ctypes.c_ssize_t),
]#[repr(C)]
pub struct MI_ClassFT {
pub GetClassNameA: isize,
pub GetNameSpace: isize,
pub GetServerName: isize,
pub GetElementCount: isize,
pub GetElement: isize,
pub GetElementAt: isize,
pub GetClassQualifierSet: isize,
pub GetMethodCount: isize,
pub GetMethodAt: isize,
pub GetMethod: isize,
pub GetParentClassName: isize,
pub GetParentClass: isize,
pub Delete: isize,
pub Clone: isize,
}import "golang.org/x/sys/windows"
type MI_ClassFT struct {
GetClassNameA uintptr
GetNameSpace uintptr
GetServerName uintptr
GetElementCount uintptr
GetElement uintptr
GetElementAt uintptr
GetClassQualifierSet uintptr
GetMethodCount uintptr
GetMethodAt uintptr
GetMethod uintptr
GetParentClassName uintptr
GetParentClass uintptr
Delete uintptr
Clone uintptr
}type
MI_ClassFT = record
GetClassNameA: NativeInt;
GetNameSpace: NativeInt;
GetServerName: NativeInt;
GetElementCount: NativeInt;
GetElement: NativeInt;
GetElementAt: NativeInt;
GetClassQualifierSet: NativeInt;
GetMethodCount: NativeInt;
GetMethodAt: NativeInt;
GetMethod: NativeInt;
GetParentClassName: NativeInt;
GetParentClass: NativeInt;
Delete: NativeInt;
Clone: NativeInt;
end;const MI_ClassFT = extern struct {
GetClassNameA: isize,
GetNameSpace: isize,
GetServerName: isize,
GetElementCount: isize,
GetElement: isize,
GetElementAt: isize,
GetClassQualifierSet: isize,
GetMethodCount: isize,
GetMethodAt: isize,
GetMethod: isize,
GetParentClassName: isize,
GetParentClass: isize,
Delete: isize,
Clone: isize,
};type
MI_ClassFT {.bycopy.} = object
GetClassNameA: int
GetNameSpace: int
GetServerName: int
GetElementCount: int
GetElement: int
GetElementAt: int
GetClassQualifierSet: int
GetMethodCount: int
GetMethodAt: int
GetMethod: int
GetParentClassName: int
GetParentClass: int
Delete: int
Clone: intstruct MI_ClassFT
{
ptrdiff_t GetClassNameA;
ptrdiff_t GetNameSpace;
ptrdiff_t GetServerName;
ptrdiff_t GetElementCount;
ptrdiff_t GetElement;
ptrdiff_t GetElementAt;
ptrdiff_t GetClassQualifierSet;
ptrdiff_t GetMethodCount;
ptrdiff_t GetMethodAt;
ptrdiff_t GetMethod;
ptrdiff_t GetParentClassName;
ptrdiff_t GetParentClass;
ptrdiff_t Delete;
ptrdiff_t Clone;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MI_ClassFT サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; GetClassNameA : INT_PTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; GetNameSpace : INT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GetServerName : INT_PTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GetElementCount : INT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GetElement : INT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; GetElementAt : INT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; GetClassQualifierSet : INT_PTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; GetMethodCount : INT_PTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; GetMethodAt : INT_PTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; GetMethod : INT_PTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; GetParentClassName : INT_PTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; GetParentClass : INT_PTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Delete : INT_PTR (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Clone : INT_PTR (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_ClassFT サイズ: 112 バイト(x64)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; GetClassNameA : INT_PTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; GetNameSpace : INT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; GetServerName : INT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; GetElementCount : INT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetElement : INT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; GetElementAt : INT_PTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; GetClassQualifierSet : INT_PTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; GetMethodCount : INT_PTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; GetMethodAt : INT_PTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; GetMethod : INT_PTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; GetParentClassName : INT_PTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; GetParentClass : INT_PTR (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; Delete : INT_PTR (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; Clone : INT_PTR (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_ClassFT
#field intptr GetClassNameA
#field intptr GetNameSpace
#field intptr GetServerName
#field intptr GetElementCount
#field intptr GetElement
#field intptr GetElementAt
#field intptr GetClassQualifierSet
#field intptr GetMethodCount
#field intptr GetMethodAt
#field intptr GetMethod
#field intptr GetParentClassName
#field intptr GetParentClass
#field intptr Delete
#field intptr Clone
#endstruct
stdim st, MI_ClassFT ; NSTRUCT 変数を確保
st->GetClassNameA = 100
mes "GetClassNameA=" + st->GetClassNameA