EXP_SZ_LINK
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | このデータブロックのバイトサイズ。 |
| dwSignature | DWORD | 4 | +4 | +4 | データブロックを識別するシグネチャ値。 |
| szTarget | CHAR | 260 | +8 | +8 | 展開可能なターゲットパス文字列(ANSI固定長配列)。 |
| swzTarget | WCHAR | 520 | +268 | +268 | 展開可能なターゲットパス文字列(Unicode固定長配列)。 |
各言語での定義
#include <windows.h>
// EXP_SZ_LINK (x64 788 / x86 788 バイト)
#pragma pack(push, 1)
typedef struct EXP_SZ_LINK {
DWORD cbSize;
DWORD dwSignature;
CHAR szTarget[260];
WCHAR swzTarget[260];
} EXP_SZ_LINK;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct EXP_SZ_LINK
{
public uint cbSize;
public uint dwSignature;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] public sbyte[] szTarget;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string swzTarget;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure EXP_SZ_LINK
Public cbSize As UInteger
Public dwSignature As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=260)> Public szTarget() As SByte
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public swzTarget As String
End Structureimport ctypes
from ctypes import wintypes
class EXP_SZ_LINK(ctypes.Structure):
_pack_ = 1
_fields_ = [
("cbSize", wintypes.DWORD),
("dwSignature", wintypes.DWORD),
("szTarget", ctypes.c_byte * 260),
("swzTarget", ctypes.c_wchar * 260),
]#[repr(C, packed(1))]
pub struct EXP_SZ_LINK {
pub cbSize: u32,
pub dwSignature: u32,
pub szTarget: [i8; 260],
pub swzTarget: [u16; 260],
}import "golang.org/x/sys/windows"
type EXP_SZ_LINK struct {
cbSize uint32
dwSignature uint32
szTarget [260]int8
swzTarget [260]uint16
}type
EXP_SZ_LINK = packed record
cbSize: DWORD;
dwSignature: DWORD;
szTarget: array[0..259] of Shortint;
swzTarget: array[0..259] of WideChar;
end;const EXP_SZ_LINK = extern struct {
cbSize: u32,
dwSignature: u32,
szTarget: [260]i8,
swzTarget: [260]u16,
};type
EXP_SZ_LINK {.packed.} = object
cbSize: uint32
dwSignature: uint32
szTarget: array[260, int8]
swzTarget: array[260, uint16]align(1)
struct EXP_SZ_LINK
{
uint cbSize;
uint dwSignature;
byte[260] szTarget;
wchar[260] swzTarget;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EXP_SZ_LINK サイズ: 788 バイト(x64)
dim st, 197 ; 4byte整数×197(構造体サイズ 788 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwSignature : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szTarget : CHAR (+8, 260byte) varptr(st)+8 を基点に操作(260byte:入れ子/配列)
; swzTarget : WCHAR (+268, 520byte) varptr(st)+268 を基点に操作(520byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EXP_SZ_LINK, pack=1
#field int cbSize
#field int dwSignature
#field byte szTarget 260
#field wchar swzTarget 260
#endstruct
stdim st, EXP_SZ_LINK ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize