ホーム › System.Wmi › MI_OperationFT
MI_OperationFT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Close | INT_PTR | 8/4 | +0 | +0 | 操作ハンドルを閉じます。 MI_Operation_Close を参照してください。 |
| Cancel | INT_PTR | 8/4 | +8 | +4 | 実行中の操作をキャンセルします。 MI_Operation_Cancel を参照してください。 |
| GetSession | INT_PTR | 8/4 | +16 | +8 | 操作に関連付けられたセッションを取得します。 MI_Operation_GetSession を参照してください。 |
| GetInstance | INT_PTR | 8/4 | +24 | +12 | インスタンス操作の同期的な結果を取得します。 MI_Operation_GetInstance を参照してください。 |
| GetIndication | INT_PTR | 8/4 | +32 | +16 | サブスクリプションから同期的に結果を取得します。 MI_Operation_GetIndication を参照してください。 |
| GetClass | INT_PTR | 8/4 | +40 | +20 | 操作ハンドルを閉じます。 MI_Operation_Close を参照してください。 |
公式ドキュメント
MI_Operation 構造体で使用されるサポート構造体です。これらの構造体を操作するには、名前が "MI_Operation_" で始まる関数を使用します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// MI_OperationFT (x64 48 / x86 24 バイト)
typedef struct MI_OperationFT {
INT_PTR Close;
INT_PTR Cancel;
INT_PTR GetSession;
INT_PTR GetInstance;
INT_PTR GetIndication;
INT_PTR GetClass;
} MI_OperationFT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_OperationFT
{
public IntPtr Close;
public IntPtr Cancel;
public IntPtr GetSession;
public IntPtr GetInstance;
public IntPtr GetIndication;
public IntPtr GetClass;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_OperationFT
Public Close As IntPtr
Public Cancel As IntPtr
Public GetSession As IntPtr
Public GetInstance As IntPtr
Public GetIndication As IntPtr
Public GetClass As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MI_OperationFT(ctypes.Structure):
_fields_ = [
("Close", ctypes.c_ssize_t),
("Cancel", ctypes.c_ssize_t),
("GetSession", ctypes.c_ssize_t),
("GetInstance", ctypes.c_ssize_t),
("GetIndication", ctypes.c_ssize_t),
("GetClass", ctypes.c_ssize_t),
]#[repr(C)]
pub struct MI_OperationFT {
pub Close: isize,
pub Cancel: isize,
pub GetSession: isize,
pub GetInstance: isize,
pub GetIndication: isize,
pub GetClass: isize,
}import "golang.org/x/sys/windows"
type MI_OperationFT struct {
Close uintptr
Cancel uintptr
GetSession uintptr
GetInstance uintptr
GetIndication uintptr
GetClass uintptr
}type
MI_OperationFT = record
Close: NativeInt;
Cancel: NativeInt;
GetSession: NativeInt;
GetInstance: NativeInt;
GetIndication: NativeInt;
GetClass: NativeInt;
end;const MI_OperationFT = extern struct {
Close: isize,
Cancel: isize,
GetSession: isize,
GetInstance: isize,
GetIndication: isize,
GetClass: isize,
};type
MI_OperationFT {.bycopy.} = object
Close: int
Cancel: int
GetSession: int
GetInstance: int
GetIndication: int
GetClass: intstruct MI_OperationFT
{
ptrdiff_t Close;
ptrdiff_t Cancel;
ptrdiff_t GetSession;
ptrdiff_t GetInstance;
ptrdiff_t GetIndication;
ptrdiff_t GetClass;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MI_OperationFT サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Close : INT_PTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Cancel : INT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GetSession : INT_PTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GetInstance : INT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GetIndication : INT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; GetClass : INT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_OperationFT サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Close : INT_PTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Cancel : INT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; GetSession : INT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; GetInstance : INT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetIndication : INT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; GetClass : INT_PTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_OperationFT
#field intptr Close
#field intptr Cancel
#field intptr GetSession
#field intptr GetInstance
#field intptr GetIndication
#field intptr GetClass
#endstruct
stdim st, MI_OperationFT ; NSTRUCT 変数を確保
st->Close = 100
mes "Close=" + st->Close