Win32 API 日本語リファレンス
ホームSystem.Wmi › MI_OperationFT

MI_OperationFT

構造体
サイズx64: 48 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
CloseINT_PTR8/4+0+0操作を閉じてリソースを解放する関数ポインタ。
CancelINT_PTR8/4+8+4進行中の操作をキャンセルする関数ポインタ。
GetSessionINT_PTR8/4+16+8操作を発行したセッションを取得する関数ポインタ。
GetInstanceINT_PTR8/4+24+12操作結果からインスタンスを取得する関数ポインタ。
GetIndicationINT_PTR8/4+32+16操作結果からインディケーションを取得する関数ポインタ。
GetClassINT_PTR8/4+40+20操作結果からクラスを取得する関数ポインタ。

各言語での定義

#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 Structure
import 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: int
struct 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