Win32 API 日本語リファレンス
ホームUI.Shell › DLLVERSIONINFO2

DLLVERSIONINFO2

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

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

フィールド

フィールドサイズx64x86説明
info1DLLVERSIONINFO20+0+0基本バージョン情報を保持する DLLVERSIONINFO 構造体。
dwFlagsDWORD4+20+20将来の拡張用フラグ。現状は予約。
ullVersionULONGLONG8+24+24ビルド・QFE 番号を含む 64 ビット版の詳細バージョン値。

各言語での定義

#include <windows.h>

// DLLVERSIONINFO  (x64 20 / x86 20 バイト)
typedef struct DLLVERSIONINFO {
    DWORD cbSize;
    DWORD dwMajorVersion;
    DWORD dwMinorVersion;
    DWORD dwBuildNumber;
    DWORD dwPlatformID;
} DLLVERSIONINFO;

// DLLVERSIONINFO2  (x64 32 / x86 32 バイト)
typedef struct DLLVERSIONINFO2 {
    DLLVERSIONINFO info1;
    DWORD dwFlags;
    ULONGLONG ullVersion;
} DLLVERSIONINFO2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DLLVERSIONINFO
{
    public uint cbSize;
    public uint dwMajorVersion;
    public uint dwMinorVersion;
    public uint dwBuildNumber;
    public uint dwPlatformID;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DLLVERSIONINFO2
{
    public DLLVERSIONINFO info1;
    public uint dwFlags;
    public ulong ullVersion;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DLLVERSIONINFO
    Public cbSize As UInteger
    Public dwMajorVersion As UInteger
    Public dwMinorVersion As UInteger
    Public dwBuildNumber As UInteger
    Public dwPlatformID As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DLLVERSIONINFO2
    Public info1 As DLLVERSIONINFO
    Public dwFlags As UInteger
    Public ullVersion As ULong
End Structure
import ctypes
from ctypes import wintypes

class DLLVERSIONINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwMajorVersion", wintypes.DWORD),
        ("dwMinorVersion", wintypes.DWORD),
        ("dwBuildNumber", wintypes.DWORD),
        ("dwPlatformID", wintypes.DWORD),
    ]

class DLLVERSIONINFO2(ctypes.Structure):
    _fields_ = [
        ("info1", DLLVERSIONINFO),
        ("dwFlags", wintypes.DWORD),
        ("ullVersion", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct DLLVERSIONINFO {
    pub cbSize: u32,
    pub dwMajorVersion: u32,
    pub dwMinorVersion: u32,
    pub dwBuildNumber: u32,
    pub dwPlatformID: u32,
}

#[repr(C)]
pub struct DLLVERSIONINFO2 {
    pub info1: DLLVERSIONINFO,
    pub dwFlags: u32,
    pub ullVersion: u64,
}
import "golang.org/x/sys/windows"

type DLLVERSIONINFO struct {
	cbSize uint32
	dwMajorVersion uint32
	dwMinorVersion uint32
	dwBuildNumber uint32
	dwPlatformID uint32
}

type DLLVERSIONINFO2 struct {
	info1 DLLVERSIONINFO
	dwFlags uint32
	ullVersion uint64
}
type
  DLLVERSIONINFO = record
    cbSize: DWORD;
    dwMajorVersion: DWORD;
    dwMinorVersion: DWORD;
    dwBuildNumber: DWORD;
    dwPlatformID: DWORD;
  end;

  DLLVERSIONINFO2 = record
    info1: DLLVERSIONINFO;
    dwFlags: DWORD;
    ullVersion: UInt64;
  end;
const DLLVERSIONINFO = extern struct {
    cbSize: u32,
    dwMajorVersion: u32,
    dwMinorVersion: u32,
    dwBuildNumber: u32,
    dwPlatformID: u32,
};

const DLLVERSIONINFO2 = extern struct {
    info1: DLLVERSIONINFO,
    dwFlags: u32,
    ullVersion: u64,
};
type
  DLLVERSIONINFO {.bycopy.} = object
    cbSize: uint32
    dwMajorVersion: uint32
    dwMinorVersion: uint32
    dwBuildNumber: uint32
    dwPlatformID: uint32

  DLLVERSIONINFO2 {.bycopy.} = object
    info1: DLLVERSIONINFO
    dwFlags: uint32
    ullVersion: uint64
struct DLLVERSIONINFO
{
    uint cbSize;
    uint dwMajorVersion;
    uint dwMinorVersion;
    uint dwBuildNumber;
    uint dwPlatformID;
}

struct DLLVERSIONINFO2
{
    DLLVERSIONINFO info1;
    uint dwFlags;
    ulong ullVersion;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DLLVERSIONINFO2 サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; info1 : DLLVERSIONINFO (+0, 20byte)  varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; dwFlags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ullVersion : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DLLVERSIONINFO
    #field int cbSize
    #field int dwMajorVersion
    #field int dwMinorVersion
    #field int dwBuildNumber
    #field int dwPlatformID
#endstruct

#defstruct global DLLVERSIONINFO2
    #field DLLVERSIONINFO info1
    #field int dwFlags
    #field int64 ullVersion
#endstruct

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