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

SWbemAnalysisMatrix

構造体
サイズx64: 40 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
m_uVersionDWORD4+0+0この構造体のバージョン番号。
m_uMatrixTypeDWORD4+4+4マトリックスの種類を示す値。
m_pszPropertyLPWSTR8/4+8+8このマトリックスが対象とするプロパティ名。
m_uPropertyTypeDWORD4+16+12プロパティの型を示す値。
m_uEntriesDWORD4+20+16マトリックスのエントリ数。
m_pValuesvoid**8/4+24+20各エントリの値へのポインタ配列。
m_pbTruthTableBOOL*8/4+32+24各値の真偽を示す真理値表配列へのポインタ。

各言語での定義

#include <windows.h>

// SWbemAnalysisMatrix  (x64 40 / x86 28 バイト)
typedef struct SWbemAnalysisMatrix {
    DWORD m_uVersion;
    DWORD m_uMatrixType;
    LPWSTR m_pszProperty;
    DWORD m_uPropertyType;
    DWORD m_uEntries;
    void** m_pValues;
    BOOL* m_pbTruthTable;
} SWbemAnalysisMatrix;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SWbemAnalysisMatrix
{
    public uint m_uVersion;
    public uint m_uMatrixType;
    public IntPtr m_pszProperty;
    public uint m_uPropertyType;
    public uint m_uEntries;
    public IntPtr m_pValues;
    [MarshalAs(UnmanagedType.Bool)] public bool m_pbTruthTable;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SWbemAnalysisMatrix
    Public m_uVersion As UInteger
    Public m_uMatrixType As UInteger
    Public m_pszProperty As IntPtr
    Public m_uPropertyType As UInteger
    Public m_uEntries As UInteger
    Public m_pValues As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public m_pbTruthTable As Boolean
End Structure
import ctypes
from ctypes import wintypes

class SWbemAnalysisMatrix(ctypes.Structure):
    _fields_ = [
        ("m_uVersion", wintypes.DWORD),
        ("m_uMatrixType", wintypes.DWORD),
        ("m_pszProperty", ctypes.c_void_p),
        ("m_uPropertyType", wintypes.DWORD),
        ("m_uEntries", wintypes.DWORD),
        ("m_pValues", ctypes.c_void_p),
        ("m_pbTruthTable", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct SWbemAnalysisMatrix {
    pub m_uVersion: u32,
    pub m_uMatrixType: u32,
    pub m_pszProperty: *mut core::ffi::c_void,
    pub m_uPropertyType: u32,
    pub m_uEntries: u32,
    pub m_pValues: *mut core::ffi::c_void,
    pub m_pbTruthTable: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type SWbemAnalysisMatrix struct {
	m_uVersion uint32
	m_uMatrixType uint32
	m_pszProperty uintptr
	m_uPropertyType uint32
	m_uEntries uint32
	m_pValues uintptr
	m_pbTruthTable uintptr
}
type
  SWbemAnalysisMatrix = record
    m_uVersion: DWORD;
    m_uMatrixType: DWORD;
    m_pszProperty: Pointer;
    m_uPropertyType: DWORD;
    m_uEntries: DWORD;
    m_pValues: Pointer;
    m_pbTruthTable: Pointer;
  end;
const SWbemAnalysisMatrix = extern struct {
    m_uVersion: u32,
    m_uMatrixType: u32,
    m_pszProperty: ?*anyopaque,
    m_uPropertyType: u32,
    m_uEntries: u32,
    m_pValues: ?*anyopaque,
    m_pbTruthTable: ?*anyopaque,
};
type
  SWbemAnalysisMatrix {.bycopy.} = object
    m_uVersion: uint32
    m_uMatrixType: uint32
    m_pszProperty: pointer
    m_uPropertyType: uint32
    m_uEntries: uint32
    m_pValues: pointer
    m_pbTruthTable: pointer
struct SWbemAnalysisMatrix
{
    uint m_uVersion;
    uint m_uMatrixType;
    void* m_pszProperty;
    uint m_uPropertyType;
    uint m_uEntries;
    void* m_pValues;
    void* m_pbTruthTable;
}

HSP用 定義

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

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

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