ホーム › System.Wmi › MI_ClassDecl
MI_ClassDecl
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| flags | DWORD | 4 | +0 | +0 | クラス宣言の属性を示すフラグ群。 |
| code | DWORD | 4 | +4 | +4 | クラスを識別するハッシュコード。 |
| name | WORD* | 8/4 | +8 | +8 | クラス名へのワイド文字列ポインタ。 |
| qualifiers | MI_Qualifier** | 8/4 | +16 | +12 | クラスの修飾子配列へのポインタ。 |
| numQualifiers | DWORD | 4 | +24 | +16 | 修飾子配列の要素数。 |
| properties | MI_PropertyDecl** | 8/4 | +32 | +20 | プロパティ宣言配列へのポインタ。 |
| numProperties | DWORD | 4 | +40 | +24 | プロパティ宣言の数。 |
| size | DWORD | 4 | +44 | +28 | クラスインスタンスのメモリサイズ(バイト)。 |
| superClass | WORD* | 8/4 | +48 | +32 | 親クラス名へのワイド文字列ポインタ。NULL可。 |
| superClassDecl | MI_ClassDecl* | 8/4 | +56 | +36 | 親クラス宣言へのポインタ。継承がなければNULL。 |
| methods | MI_MethodDecl** | 8/4 | +64 | +40 | メソッド宣言配列へのポインタ。 |
| numMethods | DWORD | 4 | +72 | +44 | メソッド宣言の数。 |
| schema | MI_SchemaDecl* | 8/4 | +80 | +48 | このクラスを含むスキーマ宣言へのポインタ。 |
| providerFT | MI_ProviderFT* | 8/4 | +88 | +52 | このクラスを実装するプロバイダーの関数テーブル。 |
| owningClass | MI_Class* | 8/4 | +96 | +56 | このクラス宣言を所有するMI_Classへのポインタ。 |
各言語での定義
#include <windows.h>
// MI_ClassDecl (x64 104 / x86 60 バイト)
typedef struct MI_ClassDecl {
DWORD flags;
DWORD code;
WORD* name;
MI_Qualifier** qualifiers;
DWORD numQualifiers;
MI_PropertyDecl** properties;
DWORD numProperties;
DWORD size;
WORD* superClass;
MI_ClassDecl* superClassDecl;
MI_MethodDecl** methods;
DWORD numMethods;
MI_SchemaDecl* schema;
MI_ProviderFT* providerFT;
MI_Class* owningClass;
} MI_ClassDecl;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_ClassDecl
{
public uint flags;
public uint code;
public IntPtr name;
public IntPtr qualifiers;
public uint numQualifiers;
public IntPtr properties;
public uint numProperties;
public uint size;
public IntPtr superClass;
public IntPtr superClassDecl;
public IntPtr methods;
public uint numMethods;
public IntPtr schema;
public IntPtr providerFT;
public IntPtr owningClass;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_ClassDecl
Public flags As UInteger
Public code As UInteger
Public name As IntPtr
Public qualifiers As IntPtr
Public numQualifiers As UInteger
Public properties As IntPtr
Public numProperties As UInteger
Public size As UInteger
Public superClass As IntPtr
Public superClassDecl As IntPtr
Public methods As IntPtr
Public numMethods As UInteger
Public schema As IntPtr
Public providerFT As IntPtr
Public owningClass As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MI_ClassDecl(ctypes.Structure):
_fields_ = [
("flags", wintypes.DWORD),
("code", wintypes.DWORD),
("name", ctypes.c_void_p),
("qualifiers", ctypes.c_void_p),
("numQualifiers", wintypes.DWORD),
("properties", ctypes.c_void_p),
("numProperties", wintypes.DWORD),
("size", wintypes.DWORD),
("superClass", ctypes.c_void_p),
("superClassDecl", ctypes.c_void_p),
("methods", ctypes.c_void_p),
("numMethods", wintypes.DWORD),
("schema", ctypes.c_void_p),
("providerFT", ctypes.c_void_p),
("owningClass", ctypes.c_void_p),
]#[repr(C)]
pub struct MI_ClassDecl {
pub flags: u32,
pub code: u32,
pub name: *mut core::ffi::c_void,
pub qualifiers: *mut core::ffi::c_void,
pub numQualifiers: u32,
pub properties: *mut core::ffi::c_void,
pub numProperties: u32,
pub size: u32,
pub superClass: *mut core::ffi::c_void,
pub superClassDecl: *mut core::ffi::c_void,
pub methods: *mut core::ffi::c_void,
pub numMethods: u32,
pub schema: *mut core::ffi::c_void,
pub providerFT: *mut core::ffi::c_void,
pub owningClass: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type MI_ClassDecl struct {
flags uint32
code uint32
name uintptr
qualifiers uintptr
numQualifiers uint32
properties uintptr
numProperties uint32
size uint32
superClass uintptr
superClassDecl uintptr
methods uintptr
numMethods uint32
schema uintptr
providerFT uintptr
owningClass uintptr
}type
MI_ClassDecl = record
flags: DWORD;
code: DWORD;
name: Pointer;
qualifiers: Pointer;
numQualifiers: DWORD;
properties: Pointer;
numProperties: DWORD;
size: DWORD;
superClass: Pointer;
superClassDecl: Pointer;
methods: Pointer;
numMethods: DWORD;
schema: Pointer;
providerFT: Pointer;
owningClass: Pointer;
end;const MI_ClassDecl = extern struct {
flags: u32,
code: u32,
name: ?*anyopaque,
qualifiers: ?*anyopaque,
numQualifiers: u32,
properties: ?*anyopaque,
numProperties: u32,
size: u32,
superClass: ?*anyopaque,
superClassDecl: ?*anyopaque,
methods: ?*anyopaque,
numMethods: u32,
schema: ?*anyopaque,
providerFT: ?*anyopaque,
owningClass: ?*anyopaque,
};type
MI_ClassDecl {.bycopy.} = object
flags: uint32
code: uint32
name: pointer
qualifiers: pointer
numQualifiers: uint32
properties: pointer
numProperties: uint32
size: uint32
superClass: pointer
superClassDecl: pointer
methods: pointer
numMethods: uint32
schema: pointer
providerFT: pointer
owningClass: pointerstruct MI_ClassDecl
{
uint flags;
uint code;
void* name;
void* qualifiers;
uint numQualifiers;
void* properties;
uint numProperties;
uint size;
void* superClass;
void* superClassDecl;
void* methods;
uint numMethods;
void* schema;
void* providerFT;
void* owningClass;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MI_ClassDecl サイズ: 60 バイト(x86)
dim st, 15 ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; code : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; name : WORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; qualifiers : MI_Qualifier** (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; numQualifiers : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; properties : MI_PropertyDecl** (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; numProperties : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; size : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; superClass : WORD* (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; superClassDecl : MI_ClassDecl* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; methods : MI_MethodDecl** (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; numMethods : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; schema : MI_SchemaDecl* (+48, 4byte) varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; providerFT : MI_ProviderFT* (+52, 4byte) varptr(st)+52 を基点に操作(4byte:入れ子/配列)
; owningClass : MI_Class* (+56, 4byte) varptr(st)+56 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_ClassDecl サイズ: 104 バイト(x64)
dim st, 26 ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; code : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; name : WORD* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; qualifiers : MI_Qualifier** (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; numQualifiers : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; properties : MI_PropertyDecl** (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; numProperties : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; size : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; superClass : WORD* (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; superClassDecl : MI_ClassDecl* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; methods : MI_MethodDecl** (+64, 8byte) varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; numMethods : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; schema : MI_SchemaDecl* (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; providerFT : MI_ProviderFT* (+88, 8byte) varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; owningClass : MI_Class* (+96, 8byte) varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_ClassDecl
#field int flags
#field int code
#field intptr name
#field intptr qualifiers
#field int numQualifiers
#field intptr properties
#field int numProperties
#field int size
#field intptr superClass
#field intptr superClassDecl
#field intptr methods
#field int numMethods
#field intptr schema
#field intptr providerFT
#field intptr owningClass
#endstruct
stdim st, MI_ClassDecl ; NSTRUCT 変数を確保
st->flags = 100
mes "flags=" + st->flags