ホーム › System.Wmi › MI_Class
MI_Class
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ft | MI_ClassFT* | 8/4 | +0 | +0 | クラス操作用関数テーブルへのポインタ。 |
| classDecl | MI_ClassDecl* | 8/4 | +8 | +4 | このクラスのクラス宣言へのポインタ。 |
| namespaceName | WORD* | 8/4 | +16 | +8 | クラスの名前空間名。NULL可。 |
| serverName | WORD* | 8/4 | +24 | +12 | クラス取得元のサーバー名。NULL可。 |
| reserved | INT_PTR | 32/16 | +32 | +16 | 将来の拡張用の予約フィールド。 |
各言語での定義
#include <windows.h>
// MI_Class (x64 64 / x86 32 バイト)
typedef struct MI_Class {
MI_ClassFT* ft;
MI_ClassDecl* classDecl;
WORD* namespaceName;
WORD* serverName;
INT_PTR reserved[4];
} MI_Class;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_Class
{
public IntPtr ft;
public IntPtr classDecl;
public IntPtr namespaceName;
public IntPtr serverName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public IntPtr[] reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_Class
Public ft As IntPtr
Public classDecl As IntPtr
Public namespaceName As IntPtr
Public serverName As IntPtr
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public reserved() As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MI_Class(ctypes.Structure):
_fields_ = [
("ft", ctypes.c_void_p),
("classDecl", ctypes.c_void_p),
("namespaceName", ctypes.c_void_p),
("serverName", ctypes.c_void_p),
("reserved", ctypes.c_ssize_t * 4),
]#[repr(C)]
pub struct MI_Class {
pub ft: *mut core::ffi::c_void,
pub classDecl: *mut core::ffi::c_void,
pub namespaceName: *mut core::ffi::c_void,
pub serverName: *mut core::ffi::c_void,
pub reserved: [isize; 4],
}import "golang.org/x/sys/windows"
type MI_Class struct {
ft uintptr
classDecl uintptr
namespaceName uintptr
serverName uintptr
reserved [4]uintptr
}type
MI_Class = record
ft: Pointer;
classDecl: Pointer;
namespaceName: Pointer;
serverName: Pointer;
reserved: array[0..3] of NativeInt;
end;const MI_Class = extern struct {
ft: ?*anyopaque,
classDecl: ?*anyopaque,
namespaceName: ?*anyopaque,
serverName: ?*anyopaque,
reserved: [4]isize,
};type
MI_Class {.bycopy.} = object
ft: pointer
classDecl: pointer
namespaceName: pointer
serverName: pointer
reserved: array[4, int]struct MI_Class
{
void* ft;
void* classDecl;
void* namespaceName;
void* serverName;
ptrdiff_t[4] reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MI_Class サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ft : MI_ClassFT* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; classDecl : MI_ClassDecl* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; namespaceName : WORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; serverName : WORD* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; reserved : INT_PTR (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_Class サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ft : MI_ClassFT* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; classDecl : MI_ClassDecl* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; namespaceName : WORD* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; serverName : WORD* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; reserved : INT_PTR (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_Class
#field intptr ft
#field intptr classDecl
#field intptr namespaceName
#field intptr serverName
#field intptr reserved 4
#endstruct
stdim st, MI_Class ; NSTRUCT 変数を確保