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

DLLVERSIONINFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズをバイト単位で指定する。
dwMajorVersionDWORD4+4+4DLL のメジャーバージョン番号。
dwMinorVersionDWORD4+8+8DLL のマイナーバージョン番号。
dwBuildNumberDWORD4+12+12DLL のビルド番号。
dwPlatformIDDWORD4+16+16DLL の対象プラットフォーム識別子(DLLVER_PLATFORM_ 系)。

各言語での定義

#include <windows.h>

// DLLVERSIONINFO  (x64 20 / x86 20 バイト)
typedef struct DLLVERSIONINFO {
    DWORD cbSize;
    DWORD dwMajorVersion;
    DWORD dwMinorVersion;
    DWORD dwBuildNumber;
    DWORD dwPlatformID;
} DLLVERSIONINFO;
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;
}
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
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),
    ]
#[repr(C)]
pub struct DLLVERSIONINFO {
    pub cbSize: u32,
    pub dwMajorVersion: u32,
    pub dwMinorVersion: u32,
    pub dwBuildNumber: u32,
    pub dwPlatformID: u32,
}
import "golang.org/x/sys/windows"

type DLLVERSIONINFO struct {
	cbSize uint32
	dwMajorVersion uint32
	dwMinorVersion uint32
	dwBuildNumber uint32
	dwPlatformID uint32
}
type
  DLLVERSIONINFO = record
    cbSize: DWORD;
    dwMajorVersion: DWORD;
    dwMinorVersion: DWORD;
    dwBuildNumber: DWORD;
    dwPlatformID: DWORD;
  end;
const DLLVERSIONINFO = extern struct {
    cbSize: u32,
    dwMajorVersion: u32,
    dwMinorVersion: u32,
    dwBuildNumber: u32,
    dwPlatformID: u32,
};
type
  DLLVERSIONINFO {.bycopy.} = object
    cbSize: uint32
    dwMajorVersion: uint32
    dwMinorVersion: uint32
    dwBuildNumber: uint32
    dwPlatformID: uint32
struct DLLVERSIONINFO
{
    uint cbSize;
    uint dwMajorVersion;
    uint dwMinorVersion;
    uint dwBuildNumber;
    uint dwPlatformID;
}

HSP用 定義

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

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

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