ホーム › System.Wmi › MI_QualifierDecl
MI_QualifierDecl
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| name | WORD* | 8/4 | +0 | +0 | 修飾子名へのワイド文字列ポインタ。 |
| type | DWORD | 4 | +8 | +4 | 修飾子値のMI型を示す値。 |
| scope | DWORD | 4 | +12 | +8 | 修飾子が適用可能なスコープを示すフラグ。 |
| flavor | DWORD | 4 | +16 | +12 | 修飾子のフレーバー(継承・上書き可否など)を示すフラグ。 |
| subscript | DWORD | 4 | +20 | +16 | 配列型修飾子の要素数。非配列は0。 |
| value | void* | 8/4 | +24 | +20 | 修飾子の既定値へのポインタ。なければNULL。 |
各言語での定義
#include <windows.h>
// MI_QualifierDecl (x64 32 / x86 24 バイト)
typedef struct MI_QualifierDecl {
WORD* name;
DWORD type;
DWORD scope;
DWORD flavor;
DWORD subscript;
void* value;
} MI_QualifierDecl;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_QualifierDecl
{
public IntPtr name;
public uint type;
public uint scope;
public uint flavor;
public uint subscript;
public IntPtr value;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_QualifierDecl
Public name As IntPtr
Public type As UInteger
Public scope As UInteger
Public flavor As UInteger
Public subscript As UInteger
Public value As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MI_QualifierDecl(ctypes.Structure):
_fields_ = [
("name", ctypes.c_void_p),
("type", wintypes.DWORD),
("scope", wintypes.DWORD),
("flavor", wintypes.DWORD),
("subscript", wintypes.DWORD),
("value", ctypes.c_void_p),
]#[repr(C)]
pub struct MI_QualifierDecl {
pub name: *mut core::ffi::c_void,
pub type: u32,
pub scope: u32,
pub flavor: u32,
pub subscript: u32,
pub value: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type MI_QualifierDecl struct {
name uintptr
type uint32
scope uint32
flavor uint32
subscript uint32
value uintptr
}type
MI_QualifierDecl = record
name: Pointer;
type: DWORD;
scope: DWORD;
flavor: DWORD;
subscript: DWORD;
value: Pointer;
end;const MI_QualifierDecl = extern struct {
name: ?*anyopaque,
type: u32,
scope: u32,
flavor: u32,
subscript: u32,
value: ?*anyopaque,
};type
MI_QualifierDecl {.bycopy.} = object
name: pointer
type: uint32
scope: uint32
flavor: uint32
subscript: uint32
value: pointerstruct MI_QualifierDecl
{
void* name;
uint type;
uint scope;
uint flavor;
uint subscript;
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_QualifierDecl サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; name : WORD* (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; type : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; scope : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; flavor : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; subscript : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; value : void* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_QualifierDecl サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 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 も可)
; scope : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; flavor : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; subscript : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; value : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_QualifierDecl
#field intptr name
#field int type
#field int scope
#field int flavor
#field int subscript
#field intptr value
#endstruct
stdim st, MI_QualifierDecl ; NSTRUCT 変数を確保
st->type = 100
mes "type=" + st->type