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

MI_Qualifier

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

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

フィールド

フィールドサイズx64x86説明
nameWORD*8/4+0+0修飾子名へのワイド文字列ポインタ。
typeDWORD4+8+4修飾子値のMI型を示す値。
flavorDWORD4+12+8修飾子のフレーバー(継承・上書き等)を示すフラグ。
valuevoid*8/4+16+12修飾子の値へのポインタ。

各言語での定義

#include <windows.h>

// MI_Qualifier  (x64 24 / x86 16 バイト)
typedef struct MI_Qualifier {
    WORD* name;
    DWORD type;
    DWORD flavor;
    void* value;
} MI_Qualifier;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_Qualifier
{
    public IntPtr name;
    public uint type;
    public uint flavor;
    public IntPtr value;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_Qualifier
    Public name As IntPtr
    Public type As UInteger
    Public flavor As UInteger
    Public value As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class MI_Qualifier(ctypes.Structure):
    _fields_ = [
        ("name", ctypes.c_void_p),
        ("type", wintypes.DWORD),
        ("flavor", wintypes.DWORD),
        ("value", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct MI_Qualifier {
    pub name: *mut core::ffi::c_void,
    pub type: u32,
    pub flavor: u32,
    pub value: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type MI_Qualifier struct {
	name uintptr
	type uint32
	flavor uint32
	value uintptr
}
type
  MI_Qualifier = record
    name: Pointer;
    type: DWORD;
    flavor: DWORD;
    value: Pointer;
  end;
const MI_Qualifier = extern struct {
    name: ?*anyopaque,
    type: u32,
    flavor: u32,
    value: ?*anyopaque,
};
type
  MI_Qualifier {.bycopy.} = object
    name: pointer
    type: uint32
    flavor: uint32
    value: pointer
struct MI_Qualifier
{
    void* name;
    uint type;
    uint flavor;
    void* value;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MI_Qualifier サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; name : WORD* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; type : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; flavor : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; value : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_Qualifier サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; name : WORD* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; type : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; flavor : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; value : void* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_Qualifier
    #field intptr name
    #field int type
    #field int flavor
    #field intptr value
#endstruct

stdim st, MI_Qualifier        ; NSTRUCT 変数を確保
st->type = 100
mes "type=" + st->type