ホーム › Networking.Clustering › RESUTIL_PROPERTY_ITEM
RESUTIL_PROPERTY_ITEM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Name | LPWSTR | 8/4 | +0 | +0 | プロパティの表示名を示すワイド文字列ポインターである。 |
| KeyName | LPWSTR | 8/4 | +8 | +4 | レジストリ等で使うプロパティのキー名を示すワイド文字列ポインターである。 |
| Format | DWORD | 4 | +16 | +8 | プロパティ値の形式を示すCLUSPROP_FORMAT値である。DWORDや文字列等を表す。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +24 | +12 | 形式に応じた既定値・最小値・最大値を保持する無名共用体である。 |
| Minimum | DWORD | 4 | +32 | +16 | プロパティ値の最小値である。 |
| Maximum | DWORD | 4 | +36 | +20 | プロパティ値の最大値である。 |
| Flags | DWORD | 4 | +40 | +24 | プロパティの属性を示すRESUTIL_PROPITEM_*フラグである。 |
| Offset | DWORD | 4 | +44 | +28 | プロパティ値を格納する構造体内のバイトオフセットである。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| DefaultPtr | UINT_PTR | 8/4 | +0 | +0 |
| Default | DWORD | 4 | +0 | +0 |
| lpDefault | void* | 8/4 | +0 | +0 |
| LargeIntData | RESUTIL_LARGEINT_DATA* | 8/4 | +0 | +0 |
| ULargeIntData | RESUTIL_ULARGEINT_DATA* | 8/4 | +0 | +0 |
| FileTimeData | RESUTIL_FILETIME_DATA* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// RESUTIL_PROPERTY_ITEM (x64 48 / x86 32 バイト)
typedef struct RESUTIL_PROPERTY_ITEM {
LPWSTR Name;
LPWSTR KeyName;
DWORD Format;
_Anonymous_e__Union Anonymous;
DWORD Minimum;
DWORD Maximum;
DWORD Flags;
DWORD Offset;
} RESUTIL_PROPERTY_ITEM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RESUTIL_PROPERTY_ITEM
{
public IntPtr Name;
public IntPtr KeyName;
public uint Format;
public _Anonymous_e__Union Anonymous;
public uint Minimum;
public uint Maximum;
public uint Flags;
public uint Offset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RESUTIL_PROPERTY_ITEM
Public Name As IntPtr
Public KeyName As IntPtr
Public Format As UInteger
Public Anonymous As _Anonymous_e__Union
Public Minimum As UInteger
Public Maximum As UInteger
Public Flags As UInteger
Public Offset As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RESUTIL_PROPERTY_ITEM(ctypes.Structure):
_fields_ = [
("Name", ctypes.c_void_p),
("KeyName", ctypes.c_void_p),
("Format", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
("Minimum", wintypes.DWORD),
("Maximum", wintypes.DWORD),
("Flags", wintypes.DWORD),
("Offset", wintypes.DWORD),
]#[repr(C)]
pub struct RESUTIL_PROPERTY_ITEM {
pub Name: *mut core::ffi::c_void,
pub KeyName: *mut core::ffi::c_void,
pub Format: u32,
pub Anonymous: _Anonymous_e__Union,
pub Minimum: u32,
pub Maximum: u32,
pub Flags: u32,
pub Offset: u32,
}import "golang.org/x/sys/windows"
type RESUTIL_PROPERTY_ITEM struct {
Name uintptr
KeyName uintptr
Format uint32
Anonymous _Anonymous_e__Union
Minimum uint32
Maximum uint32
Flags uint32
Offset uint32
}type
RESUTIL_PROPERTY_ITEM = record
Name: Pointer;
KeyName: Pointer;
Format: DWORD;
Anonymous: _Anonymous_e__Union;
Minimum: DWORD;
Maximum: DWORD;
Flags: DWORD;
Offset: DWORD;
end;const RESUTIL_PROPERTY_ITEM = extern struct {
Name: ?*anyopaque,
KeyName: ?*anyopaque,
Format: u32,
Anonymous: _Anonymous_e__Union,
Minimum: u32,
Maximum: u32,
Flags: u32,
Offset: u32,
};type
RESUTIL_PROPERTY_ITEM {.bycopy.} = object
Name: pointer
KeyName: pointer
Format: uint32
Anonymous: _Anonymous_e__Union
Minimum: uint32
Maximum: uint32
Flags: uint32
Offset: uint32struct RESUTIL_PROPERTY_ITEM
{
void* Name;
void* KeyName;
uint Format;
_Anonymous_e__Union Anonymous;
uint Minimum;
uint Maximum;
uint Flags;
uint Offset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RESUTIL_PROPERTY_ITEM サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Name : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; KeyName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Format : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; Minimum : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Maximum : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Flags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Offset : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RESUTIL_PROPERTY_ITEM サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Name : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; KeyName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Format : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; Minimum : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Maximum : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Flags : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; Offset : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RESUTIL_PROPERTY_ITEM
#field intptr Name
#field intptr KeyName
#field int Format
#field byte Anonymous 8
#field int Minimum
#field int Maximum
#field int Flags
#field int Offset
#endstruct
stdim st, RESUTIL_PROPERTY_ITEM ; NSTRUCT 変数を確保
st->Format = 100
mes "Format=" + st->Format
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。