Win32 API 日本語リファレンス
ホームNetworking.Clustering › POST_UPGRADE_VERSION_INFO

POST_UPGRADE_VERSION_INFO

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

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

フィールド

フィールドサイズx64x86説明
newMajorVersionDWORD4+0+0アップグレード後のメジャーバージョン番号である。
newUpgradeVersionDWORD4+4+4アップグレード後のアップグレードバージョン番号である。
oldMajorVersionDWORD4+8+8アップグレード前のメジャーバージョン番号である。
oldUpgradeVersionDWORD4+12+12アップグレード前のアップグレードバージョン番号である。
reservedDWORD4+16+16予約フィールドである。将来の拡張用で通常は0である。

各言語での定義

#include <windows.h>

// POST_UPGRADE_VERSION_INFO  (x64 20 / x86 20 バイト)
typedef struct POST_UPGRADE_VERSION_INFO {
    DWORD newMajorVersion;
    DWORD newUpgradeVersion;
    DWORD oldMajorVersion;
    DWORD oldUpgradeVersion;
    DWORD reserved;
} POST_UPGRADE_VERSION_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POST_UPGRADE_VERSION_INFO
{
    public uint newMajorVersion;
    public uint newUpgradeVersion;
    public uint oldMajorVersion;
    public uint oldUpgradeVersion;
    public uint reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POST_UPGRADE_VERSION_INFO
    Public newMajorVersion As UInteger
    Public newUpgradeVersion As UInteger
    Public oldMajorVersion As UInteger
    Public oldUpgradeVersion As UInteger
    Public reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POST_UPGRADE_VERSION_INFO(ctypes.Structure):
    _fields_ = [
        ("newMajorVersion", wintypes.DWORD),
        ("newUpgradeVersion", wintypes.DWORD),
        ("oldMajorVersion", wintypes.DWORD),
        ("oldUpgradeVersion", wintypes.DWORD),
        ("reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POST_UPGRADE_VERSION_INFO {
    pub newMajorVersion: u32,
    pub newUpgradeVersion: u32,
    pub oldMajorVersion: u32,
    pub oldUpgradeVersion: u32,
    pub reserved: u32,
}
import "golang.org/x/sys/windows"

type POST_UPGRADE_VERSION_INFO struct {
	newMajorVersion uint32
	newUpgradeVersion uint32
	oldMajorVersion uint32
	oldUpgradeVersion uint32
	reserved uint32
}
type
  POST_UPGRADE_VERSION_INFO = record
    newMajorVersion: DWORD;
    newUpgradeVersion: DWORD;
    oldMajorVersion: DWORD;
    oldUpgradeVersion: DWORD;
    reserved: DWORD;
  end;
const POST_UPGRADE_VERSION_INFO = extern struct {
    newMajorVersion: u32,
    newUpgradeVersion: u32,
    oldMajorVersion: u32,
    oldUpgradeVersion: u32,
    reserved: u32,
};
type
  POST_UPGRADE_VERSION_INFO {.bycopy.} = object
    newMajorVersion: uint32
    newUpgradeVersion: uint32
    oldMajorVersion: uint32
    oldUpgradeVersion: uint32
    reserved: uint32
struct POST_UPGRADE_VERSION_INFO
{
    uint newMajorVersion;
    uint newUpgradeVersion;
    uint oldMajorVersion;
    uint oldUpgradeVersion;
    uint reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POST_UPGRADE_VERSION_INFO サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; newMajorVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; newUpgradeVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; oldMajorVersion : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; oldUpgradeVersion : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; reserved : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global POST_UPGRADE_VERSION_INFO
    #field int newMajorVersion
    #field int newUpgradeVersion
    #field int oldMajorVersion
    #field int oldUpgradeVersion
    #field int reserved
#endstruct

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