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