ホーム › System.ApplicationInstallationAndServicing › ASSEMBLY_INFO
ASSEMBLY_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbAssemblyInfo | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| dwAssemblyFlags | DWORD | 4 | +4 | +4 | アセンブリの状態を示すフラグ。ASSEMBLYINFO_FLAG_INSTALLED等。 |
| uliAssemblySizeInKB | ULONGLONG | 8 | +8 | +8 | アセンブリのサイズ(KB単位)。 |
| pszCurrentAssemblyPathBuf | LPWSTR | 8/4 | +16 | +16 | アセンブリのパスを受け取るバッファへのポインタ。 |
| cchBuf | DWORD | 4 | +24 | +20 | pszCurrentAssemblyPathBufバッファの文字数サイズ。 |
各言語での定義
#include <windows.h>
// ASSEMBLY_INFO (x64 32 / x86 24 バイト)
typedef struct ASSEMBLY_INFO {
DWORD cbAssemblyInfo;
DWORD dwAssemblyFlags;
ULONGLONG uliAssemblySizeInKB;
LPWSTR pszCurrentAssemblyPathBuf;
DWORD cchBuf;
} ASSEMBLY_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ASSEMBLY_INFO
{
public uint cbAssemblyInfo;
public uint dwAssemblyFlags;
public ulong uliAssemblySizeInKB;
public IntPtr pszCurrentAssemblyPathBuf;
public uint cchBuf;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ASSEMBLY_INFO
Public cbAssemblyInfo As UInteger
Public dwAssemblyFlags As UInteger
Public uliAssemblySizeInKB As ULong
Public pszCurrentAssemblyPathBuf As IntPtr
Public cchBuf As UInteger
End Structureimport ctypes
from ctypes import wintypes
class ASSEMBLY_INFO(ctypes.Structure):
_fields_ = [
("cbAssemblyInfo", wintypes.DWORD),
("dwAssemblyFlags", wintypes.DWORD),
("uliAssemblySizeInKB", ctypes.c_ulonglong),
("pszCurrentAssemblyPathBuf", ctypes.c_void_p),
("cchBuf", wintypes.DWORD),
]#[repr(C)]
pub struct ASSEMBLY_INFO {
pub cbAssemblyInfo: u32,
pub dwAssemblyFlags: u32,
pub uliAssemblySizeInKB: u64,
pub pszCurrentAssemblyPathBuf: *mut core::ffi::c_void,
pub cchBuf: u32,
}import "golang.org/x/sys/windows"
type ASSEMBLY_INFO struct {
cbAssemblyInfo uint32
dwAssemblyFlags uint32
uliAssemblySizeInKB uint64
pszCurrentAssemblyPathBuf uintptr
cchBuf uint32
}type
ASSEMBLY_INFO = record
cbAssemblyInfo: DWORD;
dwAssemblyFlags: DWORD;
uliAssemblySizeInKB: UInt64;
pszCurrentAssemblyPathBuf: Pointer;
cchBuf: DWORD;
end;const ASSEMBLY_INFO = extern struct {
cbAssemblyInfo: u32,
dwAssemblyFlags: u32,
uliAssemblySizeInKB: u64,
pszCurrentAssemblyPathBuf: ?*anyopaque,
cchBuf: u32,
};type
ASSEMBLY_INFO {.bycopy.} = object
cbAssemblyInfo: uint32
dwAssemblyFlags: uint32
uliAssemblySizeInKB: uint64
pszCurrentAssemblyPathBuf: pointer
cchBuf: uint32struct ASSEMBLY_INFO
{
uint cbAssemblyInfo;
uint dwAssemblyFlags;
ulong uliAssemblySizeInKB;
void* pszCurrentAssemblyPathBuf;
uint cchBuf;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ASSEMBLY_INFO サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbAssemblyInfo : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwAssemblyFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; uliAssemblySizeInKB : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszCurrentAssemblyPathBuf : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; cchBuf : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ASSEMBLY_INFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbAssemblyInfo : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwAssemblyFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; uliAssemblySizeInKB : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszCurrentAssemblyPathBuf : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cchBuf : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ASSEMBLY_INFO
#field int cbAssemblyInfo
#field int dwAssemblyFlags
#field int64 uliAssemblySizeInKB
#field intptr pszCurrentAssemblyPathBuf
#field int cchBuf
#endstruct
stdim st, ASSEMBLY_INFO ; NSTRUCT 変数を確保
st->cbAssemblyInfo = 100
mes "cbAssemblyInfo=" + st->cbAssemblyInfo