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