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

MI_FeatureDecl

構造体
サイズx64: 32 バイト / x86: 20 バイト

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

フィールド

フィールドサイズx64x86説明
flagsDWORD4+0+0機能(プロパティ・メソッド・パラメータ共通基底)の属性フラグ。
codeDWORD4+4+4機能を識別するハッシュコード。
nameWORD*8/4+8+8機能名へのワイド文字列ポインタ。
qualifiersMI_Qualifier**8/4+16+12機能に付与された修飾子配列へのポインタ。
numQualifiersDWORD4+24+16修飾子配列の要素数。

各言語での定義

#include <windows.h>

// MI_FeatureDecl  (x64 32 / x86 20 バイト)
typedef struct MI_FeatureDecl {
    DWORD flags;
    DWORD code;
    WORD* name;
    MI_Qualifier** qualifiers;
    DWORD numQualifiers;
} MI_FeatureDecl;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_FeatureDecl
{
    public uint flags;
    public uint code;
    public IntPtr name;
    public IntPtr qualifiers;
    public uint numQualifiers;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_FeatureDecl
    Public flags As UInteger
    Public code As UInteger
    Public name As IntPtr
    Public qualifiers As IntPtr
    Public numQualifiers As UInteger
End Structure
import ctypes
from ctypes import wintypes

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

type MI_FeatureDecl struct {
	flags uint32
	code uint32
	name uintptr
	qualifiers uintptr
	numQualifiers uint32
}
type
  MI_FeatureDecl = record
    flags: DWORD;
    code: DWORD;
    name: Pointer;
    qualifiers: Pointer;
    numQualifiers: DWORD;
  end;
const MI_FeatureDecl = extern struct {
    flags: u32,
    code: u32,
    name: ?*anyopaque,
    qualifiers: ?*anyopaque,
    numQualifiers: u32,
};
type
  MI_FeatureDecl {.bycopy.} = object
    flags: uint32
    code: uint32
    name: pointer
    qualifiers: pointer
    numQualifiers: uint32
struct MI_FeatureDecl
{
    uint flags;
    uint code;
    void* name;
    void* qualifiers;
    uint numQualifiers;
}

HSP用 定義

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

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

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