Win32 API 日本語リファレンス
ホームGraphics.Printing › CONFIG_INFO_DATA_1

CONFIG_INFO_DATA_1

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

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

フィールド

フィールドサイズx64x86説明
ReservedBYTE128+0+0予約バイト配列。
dwVersionDWORD4+128+128構造体のバージョン番号。

各言語での定義

#include <windows.h>

// CONFIG_INFO_DATA_1  (x64 132 / x86 132 バイト)
typedef struct CONFIG_INFO_DATA_1 {
    BYTE Reserved[128];
    DWORD dwVersion;
} CONFIG_INFO_DATA_1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CONFIG_INFO_DATA_1
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] public byte[] Reserved;
    public uint dwVersion;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CONFIG_INFO_DATA_1
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=128)> Public Reserved() As Byte
    Public dwVersion As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CONFIG_INFO_DATA_1(ctypes.Structure):
    _fields_ = [
        ("Reserved", ctypes.c_ubyte * 128),
        ("dwVersion", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CONFIG_INFO_DATA_1 {
    pub Reserved: [u8; 128],
    pub dwVersion: u32,
}
import "golang.org/x/sys/windows"

type CONFIG_INFO_DATA_1 struct {
	Reserved [128]byte
	dwVersion uint32
}
type
  CONFIG_INFO_DATA_1 = record
    Reserved: array[0..127] of Byte;
    dwVersion: DWORD;
  end;
const CONFIG_INFO_DATA_1 = extern struct {
    Reserved: [128]u8,
    dwVersion: u32,
};
type
  CONFIG_INFO_DATA_1 {.bycopy.} = object
    Reserved: array[128, uint8]
    dwVersion: uint32
struct CONFIG_INFO_DATA_1
{
    ubyte[128] Reserved;
    uint dwVersion;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CONFIG_INFO_DATA_1 サイズ: 132 バイト(x64)
dim st, 33    ; 4byte整数×33(構造体サイズ 132 / 4 切り上げ)
; Reserved : BYTE (+0, 128byte)  varptr(st)+0 を基点に操作(128byte:入れ子/配列)
; dwVersion : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CONFIG_INFO_DATA_1
    #field byte Reserved 128
    #field int dwVersion
#endstruct

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