ホーム › System.Ioctl › SCM_PD_PROPERTY_QUERY
SCM_PD_PROPERTY_QUERY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | この構造体のバージョン番号。 |
| Size | DWORD | 4 | +4 | +4 | この構造体のバイト単位のサイズ。 |
| PropertyId | SCM_PD_PROPERTY_ID | 4 | +8 | +8 | 問い合わせる物理デバイスプロパティの識別子。 |
| QueryType | SCM_PD_QUERY_TYPE | 4 | +12 | +12 | クエリ種別を示す列挙値。標準データか存在確認かなど。 |
| AdditionalParameters | BYTE | 1 | +16 | +16 | プロパティ固有の追加パラメータ。可変長領域。 |
各言語での定義
#include <windows.h>
// SCM_PD_PROPERTY_QUERY (x64 20 / x86 20 バイト)
typedef struct SCM_PD_PROPERTY_QUERY {
DWORD Version;
DWORD Size;
SCM_PD_PROPERTY_ID PropertyId;
SCM_PD_QUERY_TYPE QueryType;
BYTE AdditionalParameters[1];
} SCM_PD_PROPERTY_QUERY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCM_PD_PROPERTY_QUERY
{
public uint Version;
public uint Size;
public int PropertyId;
public int QueryType;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] AdditionalParameters;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCM_PD_PROPERTY_QUERY
Public Version As UInteger
Public Size As UInteger
Public PropertyId As Integer
Public QueryType As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public AdditionalParameters() As Byte
End Structureimport ctypes
from ctypes import wintypes
class SCM_PD_PROPERTY_QUERY(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Size", wintypes.DWORD),
("PropertyId", ctypes.c_int),
("QueryType", ctypes.c_int),
("AdditionalParameters", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct SCM_PD_PROPERTY_QUERY {
pub Version: u32,
pub Size: u32,
pub PropertyId: i32,
pub QueryType: i32,
pub AdditionalParameters: [u8; 1],
}import "golang.org/x/sys/windows"
type SCM_PD_PROPERTY_QUERY struct {
Version uint32
Size uint32
PropertyId int32
QueryType int32
AdditionalParameters [1]byte
}type
SCM_PD_PROPERTY_QUERY = record
Version: DWORD;
Size: DWORD;
PropertyId: Integer;
QueryType: Integer;
AdditionalParameters: array[0..0] of Byte;
end;const SCM_PD_PROPERTY_QUERY = extern struct {
Version: u32,
Size: u32,
PropertyId: i32,
QueryType: i32,
AdditionalParameters: [1]u8,
};type
SCM_PD_PROPERTY_QUERY {.bycopy.} = object
Version: uint32
Size: uint32
PropertyId: int32
QueryType: int32
AdditionalParameters: array[1, uint8]struct SCM_PD_PROPERTY_QUERY
{
uint Version;
uint Size;
int PropertyId;
int QueryType;
ubyte[1] AdditionalParameters;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCM_PD_PROPERTY_QUERY サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; PropertyId : SCM_PD_PROPERTY_ID (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; QueryType : SCM_PD_QUERY_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; AdditionalParameters : BYTE (+16, 1byte) varptr(st)+16 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCM_PD_PROPERTY_QUERY
#field int Version
#field int Size
#field int PropertyId
#field int QueryType
#field byte AdditionalParameters 1
#endstruct
stdim st, SCM_PD_PROPERTY_QUERY ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version