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

CLR_DEBUGGING_VERSION

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

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

フィールド

フィールドサイズx64x86説明
wStructVersionWORD2+0+0この構造体のバージョン番号。現在は0。
wMajorWORD2+2+2CLRのメジャーバージョン番号。
wMinorWORD2+4+4CLRのマイナーバージョン番号。
wBuildWORD2+6+6CLRのビルド番号。
wRevisionWORD2+8+8CLRのリビジョン番号。

各言語での定義

#include <windows.h>

// CLR_DEBUGGING_VERSION  (x64 10 / x86 10 バイト)
typedef struct CLR_DEBUGGING_VERSION {
    WORD wStructVersion;
    WORD wMajor;
    WORD wMinor;
    WORD wBuild;
    WORD wRevision;
} CLR_DEBUGGING_VERSION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLR_DEBUGGING_VERSION
{
    public ushort wStructVersion;
    public ushort wMajor;
    public ushort wMinor;
    public ushort wBuild;
    public ushort wRevision;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLR_DEBUGGING_VERSION
    Public wStructVersion As UShort
    Public wMajor As UShort
    Public wMinor As UShort
    Public wBuild As UShort
    Public wRevision As UShort
End Structure
import ctypes
from ctypes import wintypes

class CLR_DEBUGGING_VERSION(ctypes.Structure):
    _fields_ = [
        ("wStructVersion", ctypes.c_ushort),
        ("wMajor", ctypes.c_ushort),
        ("wMinor", ctypes.c_ushort),
        ("wBuild", ctypes.c_ushort),
        ("wRevision", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct CLR_DEBUGGING_VERSION {
    pub wStructVersion: u16,
    pub wMajor: u16,
    pub wMinor: u16,
    pub wBuild: u16,
    pub wRevision: u16,
}
import "golang.org/x/sys/windows"

type CLR_DEBUGGING_VERSION struct {
	wStructVersion uint16
	wMajor uint16
	wMinor uint16
	wBuild uint16
	wRevision uint16
}
type
  CLR_DEBUGGING_VERSION = record
    wStructVersion: Word;
    wMajor: Word;
    wMinor: Word;
    wBuild: Word;
    wRevision: Word;
  end;
const CLR_DEBUGGING_VERSION = extern struct {
    wStructVersion: u16,
    wMajor: u16,
    wMinor: u16,
    wBuild: u16,
    wRevision: u16,
};
type
  CLR_DEBUGGING_VERSION {.bycopy.} = object
    wStructVersion: uint16
    wMajor: uint16
    wMinor: uint16
    wBuild: uint16
    wRevision: uint16
struct CLR_DEBUGGING_VERSION
{
    ushort wStructVersion;
    ushort wMajor;
    ushort wMinor;
    ushort wBuild;
    ushort wRevision;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLR_DEBUGGING_VERSION サイズ: 10 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 10 / 4 切り上げ)
; wStructVersion : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; wMajor : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; wMinor : WORD (+4, 2byte)  wpoke st,4,値  /  値 = wpeek(st,4)
; wBuild : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; wRevision : WORD (+8, 2byte)  wpoke st,8,値  /  値 = wpeek(st,8)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLR_DEBUGGING_VERSION
    #field short wStructVersion
    #field short wMajor
    #field short wMinor
    #field short wBuild
    #field short wRevision
#endstruct

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