ホーム › System.AddressBook › __UPV
__UPV
共用体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| i | SHORT | 2 | +0 | +0 |
| l | INT | 4 | +0 | +0 |
| ul | DWORD | 4 | +0 | +0 |
| flt | FLOAT | 4 | +0 | +0 |
| dbl | DOUBLE | 8 | +0 | +0 |
| b | WORD | 2 | +0 | +0 |
| cur | CY | 8 | +0 | +0 |
| at | DOUBLE | 8 | +0 | +0 |
| ft | FILETIME | 8 | +0 | +0 |
| lpszA | LPSTR | 8/4 | +0 | +0 |
| bin | SBinary | 16/8 | +0 | +0 |
| lpszW | LPWSTR | 8/4 | +0 | +0 |
| lpguid | GUID* | 8/4 | +0 | +0 |
| li | LONGLONG | 8 | +0 | +0 |
| MVi | SShortArray | 16/8 | +0 | +0 |
| MVl | SLongArray | 16/8 | +0 | +0 |
| MVflt | SRealArray | 16/8 | +0 | +0 |
| MVdbl | SDoubleArray | 16/8 | +0 | +0 |
| MVcur | SCurrencyArray | 16/8 | +0 | +0 |
| MVat | SAppTimeArray | 16/8 | +0 | +0 |
| MVft | SDateTimeArray | 16/8 | +0 | +0 |
| MVbin | SBinaryArray | 16/8 | +0 | +0 |
| MVszA | SLPSTRArray | 16/8 | +0 | +0 |
| MVszW | SWStringArray | 16/8 | +0 | +0 |
| MVguid | SGuidArray | 16/8 | +0 | +0 |
| MVli | SLargeIntegerArray | 16/8 | +0 | +0 |
| err | INT | 4 | +0 | +0 |
| x | INT | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// CY (x64 8 / x86 8 バイト)
typedef struct CY {
_Anonymous_e__Struct Anonymous;
LONGLONG int64;
} CY;
// FILETIME (x64 8 / x86 8 バイト)
typedef struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
// SBinary (x64 16 / x86 8 バイト)
typedef struct SBinary {
DWORD cb;
BYTE* lpb;
} SBinary;
// SShortArray (x64 16 / x86 8 バイト)
typedef struct SShortArray {
DWORD cValues;
SHORT* lpi;
} SShortArray;
// SLongArray (x64 16 / x86 8 バイト)
typedef struct SLongArray {
DWORD cValues;
INT* lpl;
} SLongArray;
// SRealArray (x64 16 / x86 8 バイト)
typedef struct SRealArray {
DWORD cValues;
FLOAT* lpflt;
} SRealArray;
// SDoubleArray (x64 16 / x86 8 バイト)
typedef struct SDoubleArray {
DWORD cValues;
DOUBLE* lpdbl;
} SDoubleArray;
// SCurrencyArray (x64 16 / x86 8 バイト)
typedef struct SCurrencyArray {
DWORD cValues;
CY* lpcur;
} SCurrencyArray;
// SAppTimeArray (x64 16 / x86 8 バイト)
typedef struct SAppTimeArray {
DWORD cValues;
DOUBLE* lpat;
} SAppTimeArray;
// SDateTimeArray (x64 16 / x86 8 バイト)
typedef struct SDateTimeArray {
DWORD cValues;
FILETIME* lpft;
} SDateTimeArray;
// SBinaryArray (x64 16 / x86 8 バイト)
typedef struct SBinaryArray {
DWORD cValues;
SBinary* lpbin;
} SBinaryArray;
// SLPSTRArray (x64 16 / x86 8 バイト)
typedef struct SLPSTRArray {
DWORD cValues;
LPSTR* lppszA;
} SLPSTRArray;
// SWStringArray (x64 16 / x86 8 バイト)
typedef struct SWStringArray {
DWORD cValues;
LPWSTR* lppszW;
} SWStringArray;
// SGuidArray (x64 16 / x86 8 バイト)
typedef struct SGuidArray {
DWORD cValues;
GUID* lpguid;
} SGuidArray;
// SLargeIntegerArray (x64 16 / x86 8 バイト)
typedef struct SLargeIntegerArray {
DWORD cValues;
LONGLONG* lpli;
} SLargeIntegerArray;
// __UPV (x64 16 / x86 8 バイト)
typedef struct __UPV {
SHORT i;
INT l;
DWORD ul;
FLOAT flt;
DOUBLE dbl;
WORD b;
CY cur;
DOUBLE at;
FILETIME ft;
LPSTR lpszA;
SBinary bin;
LPWSTR lpszW;
GUID* lpguid;
LONGLONG li;
SShortArray MVi;
SLongArray MVl;
SRealArray MVflt;
SDoubleArray MVdbl;
SCurrencyArray MVcur;
SAppTimeArray MVat;
SDateTimeArray MVft;
SBinaryArray MVbin;
SLPSTRArray MVszA;
SWStringArray MVszW;
SGuidArray MVguid;
SLargeIntegerArray MVli;
INT err;
INT x;
} __UPV;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CY
{
public _Anonymous_e__Struct Anonymous;
public long int64;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SBinary
{
public uint cb;
public IntPtr lpb;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SShortArray
{
public uint cValues;
public IntPtr lpi;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SLongArray
{
public uint cValues;
public IntPtr lpl;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SRealArray
{
public uint cValues;
public IntPtr lpflt;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SDoubleArray
{
public uint cValues;
public IntPtr lpdbl;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCurrencyArray
{
public uint cValues;
public IntPtr lpcur;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SAppTimeArray
{
public uint cValues;
public IntPtr lpat;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SDateTimeArray
{
public uint cValues;
public IntPtr lpft;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SBinaryArray
{
public uint cValues;
public IntPtr lpbin;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SLPSTRArray
{
public uint cValues;
public IntPtr lppszA;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SWStringArray
{
public uint cValues;
public IntPtr lppszW;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SGuidArray
{
public uint cValues;
public IntPtr lpguid;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SLargeIntegerArray
{
public uint cValues;
public IntPtr lpli;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct __UPV
{
public short i;
public int l;
public uint ul;
public float flt;
public double dbl;
public ushort b;
public CY cur;
public double at;
public FILETIME ft;
public IntPtr lpszA;
public SBinary bin;
public IntPtr lpszW;
public IntPtr lpguid;
public long li;
public SShortArray MVi;
public SLongArray MVl;
public SRealArray MVflt;
public SDoubleArray MVdbl;
public SCurrencyArray MVcur;
public SAppTimeArray MVat;
public SDateTimeArray MVft;
public SBinaryArray MVbin;
public SLPSTRArray MVszA;
public SWStringArray MVszW;
public SGuidArray MVguid;
public SLargeIntegerArray MVli;
public int err;
public int x;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CY
Public Anonymous As _Anonymous_e__Struct
Public int64 As Long
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SBinary
Public cb As UInteger
Public lpb As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SShortArray
Public cValues As UInteger
Public lpi As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SLongArray
Public cValues As UInteger
Public lpl As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SRealArray
Public cValues As UInteger
Public lpflt As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SDoubleArray
Public cValues As UInteger
Public lpdbl As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCurrencyArray
Public cValues As UInteger
Public lpcur As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SAppTimeArray
Public cValues As UInteger
Public lpat As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SDateTimeArray
Public cValues As UInteger
Public lpft As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SBinaryArray
Public cValues As UInteger
Public lpbin As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SLPSTRArray
Public cValues As UInteger
Public lppszA As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SWStringArray
Public cValues As UInteger
Public lppszW As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SGuidArray
Public cValues As UInteger
Public lpguid As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SLargeIntegerArray
Public cValues As UInteger
Public lpli As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure __UPV
Public i As Short
Public l As Integer
Public ul As UInteger
Public flt As Single
Public dbl As Double
Public b As UShort
Public cur As CY
Public at As Double
Public ft As FILETIME
Public lpszA As IntPtr
Public bin As SBinary
Public lpszW As IntPtr
Public lpguid As IntPtr
Public li As Long
Public MVi As SShortArray
Public MVl As SLongArray
Public MVflt As SRealArray
Public MVdbl As SDoubleArray
Public MVcur As SCurrencyArray
Public MVat As SAppTimeArray
Public MVft As SDateTimeArray
Public MVbin As SBinaryArray
Public MVszA As SLPSTRArray
Public MVszW As SWStringArray
Public MVguid As SGuidArray
Public MVli As SLargeIntegerArray
Public err As Integer
Public x As Integer
End Structureimport ctypes
from ctypes import wintypes
class CY(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Struct),
("int64", ctypes.c_longlong),
]
class FILETIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class SBinary(ctypes.Structure):
_fields_ = [
("cb", wintypes.DWORD),
("lpb", ctypes.c_void_p),
]
class SShortArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpi", ctypes.c_void_p),
]
class SLongArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpl", ctypes.c_void_p),
]
class SRealArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpflt", ctypes.c_void_p),
]
class SDoubleArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpdbl", ctypes.c_void_p),
]
class SCurrencyArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpcur", ctypes.c_void_p),
]
class SAppTimeArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpat", ctypes.c_void_p),
]
class SDateTimeArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpft", ctypes.c_void_p),
]
class SBinaryArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpbin", ctypes.c_void_p),
]
class SLPSTRArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lppszA", ctypes.c_void_p),
]
class SWStringArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lppszW", ctypes.c_void_p),
]
class SGuidArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpguid", ctypes.c_void_p),
]
class SLargeIntegerArray(ctypes.Structure):
_fields_ = [
("cValues", wintypes.DWORD),
("lpli", ctypes.c_void_p),
]
class __UPV(ctypes.Structure):
_fields_ = [
("i", ctypes.c_short),
("l", ctypes.c_int),
("ul", wintypes.DWORD),
("flt", ctypes.c_float),
("dbl", ctypes.c_double),
("b", ctypes.c_ushort),
("cur", CY),
("at", ctypes.c_double),
("ft", FILETIME),
("lpszA", ctypes.c_void_p),
("bin", SBinary),
("lpszW", ctypes.c_void_p),
("lpguid", ctypes.c_void_p),
("li", ctypes.c_longlong),
("MVi", SShortArray),
("MVl", SLongArray),
("MVflt", SRealArray),
("MVdbl", SDoubleArray),
("MVcur", SCurrencyArray),
("MVat", SAppTimeArray),
("MVft", SDateTimeArray),
("MVbin", SBinaryArray),
("MVszA", SLPSTRArray),
("MVszW", SWStringArray),
("MVguid", SGuidArray),
("MVli", SLargeIntegerArray),
("err", ctypes.c_int),
("x", ctypes.c_int),
]#[repr(C)]
pub struct CY {
pub Anonymous: _Anonymous_e__Struct,
pub int64: i64,
}
#[repr(C)]
pub struct FILETIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct SBinary {
pub cb: u32,
pub lpb: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SShortArray {
pub cValues: u32,
pub lpi: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SLongArray {
pub cValues: u32,
pub lpl: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SRealArray {
pub cValues: u32,
pub lpflt: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SDoubleArray {
pub cValues: u32,
pub lpdbl: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SCurrencyArray {
pub cValues: u32,
pub lpcur: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SAppTimeArray {
pub cValues: u32,
pub lpat: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SDateTimeArray {
pub cValues: u32,
pub lpft: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SBinaryArray {
pub cValues: u32,
pub lpbin: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SLPSTRArray {
pub cValues: u32,
pub lppszA: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SWStringArray {
pub cValues: u32,
pub lppszW: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SGuidArray {
pub cValues: u32,
pub lpguid: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct SLargeIntegerArray {
pub cValues: u32,
pub lpli: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct __UPV {
pub i: i16,
pub l: i32,
pub ul: u32,
pub flt: f32,
pub dbl: f64,
pub b: u16,
pub cur: CY,
pub at: f64,
pub ft: FILETIME,
pub lpszA: *mut core::ffi::c_void,
pub bin: SBinary,
pub lpszW: *mut core::ffi::c_void,
pub lpguid: *mut core::ffi::c_void,
pub li: i64,
pub MVi: SShortArray,
pub MVl: SLongArray,
pub MVflt: SRealArray,
pub MVdbl: SDoubleArray,
pub MVcur: SCurrencyArray,
pub MVat: SAppTimeArray,
pub MVft: SDateTimeArray,
pub MVbin: SBinaryArray,
pub MVszA: SLPSTRArray,
pub MVszW: SWStringArray,
pub MVguid: SGuidArray,
pub MVli: SLargeIntegerArray,
pub err: i32,
pub x: i32,
}import "golang.org/x/sys/windows"
type CY struct {
Anonymous _Anonymous_e__Struct
int64 int64
}
type FILETIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type SBinary struct {
cb uint32
lpb uintptr
}
type SShortArray struct {
cValues uint32
lpi uintptr
}
type SLongArray struct {
cValues uint32
lpl uintptr
}
type SRealArray struct {
cValues uint32
lpflt uintptr
}
type SDoubleArray struct {
cValues uint32
lpdbl uintptr
}
type SCurrencyArray struct {
cValues uint32
lpcur uintptr
}
type SAppTimeArray struct {
cValues uint32
lpat uintptr
}
type SDateTimeArray struct {
cValues uint32
lpft uintptr
}
type SBinaryArray struct {
cValues uint32
lpbin uintptr
}
type SLPSTRArray struct {
cValues uint32
lppszA uintptr
}
type SWStringArray struct {
cValues uint32
lppszW uintptr
}
type SGuidArray struct {
cValues uint32
lpguid uintptr
}
type SLargeIntegerArray struct {
cValues uint32
lpli uintptr
}
type __UPV struct {
i int16
l int32
ul uint32
flt float32
dbl float64
b uint16
cur CY
at float64
ft FILETIME
lpszA uintptr
bin SBinary
lpszW uintptr
lpguid uintptr
li int64
MVi SShortArray
MVl SLongArray
MVflt SRealArray
MVdbl SDoubleArray
MVcur SCurrencyArray
MVat SAppTimeArray
MVft SDateTimeArray
MVbin SBinaryArray
MVszA SLPSTRArray
MVszW SWStringArray
MVguid SGuidArray
MVli SLargeIntegerArray
err int32
x int32
}type
CY = record
Anonymous: _Anonymous_e__Struct;
int64: Int64;
end;
FILETIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
SBinary = record
cb: DWORD;
lpb: Pointer;
end;
SShortArray = record
cValues: DWORD;
lpi: Pointer;
end;
SLongArray = record
cValues: DWORD;
lpl: Pointer;
end;
SRealArray = record
cValues: DWORD;
lpflt: Pointer;
end;
SDoubleArray = record
cValues: DWORD;
lpdbl: Pointer;
end;
SCurrencyArray = record
cValues: DWORD;
lpcur: Pointer;
end;
SAppTimeArray = record
cValues: DWORD;
lpat: Pointer;
end;
SDateTimeArray = record
cValues: DWORD;
lpft: Pointer;
end;
SBinaryArray = record
cValues: DWORD;
lpbin: Pointer;
end;
SLPSTRArray = record
cValues: DWORD;
lppszA: Pointer;
end;
SWStringArray = record
cValues: DWORD;
lppszW: Pointer;
end;
SGuidArray = record
cValues: DWORD;
lpguid: Pointer;
end;
SLargeIntegerArray = record
cValues: DWORD;
lpli: Pointer;
end;
__UPV = record
i: Smallint;
l: Integer;
ul: DWORD;
flt: Single;
dbl: Double;
b: Word;
cur: CY;
at: Double;
ft: FILETIME;
lpszA: Pointer;
bin: SBinary;
lpszW: Pointer;
lpguid: Pointer;
li: Int64;
MVi: SShortArray;
MVl: SLongArray;
MVflt: SRealArray;
MVdbl: SDoubleArray;
MVcur: SCurrencyArray;
MVat: SAppTimeArray;
MVft: SDateTimeArray;
MVbin: SBinaryArray;
MVszA: SLPSTRArray;
MVszW: SWStringArray;
MVguid: SGuidArray;
MVli: SLargeIntegerArray;
err: Integer;
x: Integer;
end;const CY = extern struct {
Anonymous: _Anonymous_e__Struct,
int64: i64,
};
const FILETIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const SBinary = extern struct {
cb: u32,
lpb: ?*anyopaque,
};
const SShortArray = extern struct {
cValues: u32,
lpi: ?*anyopaque,
};
const SLongArray = extern struct {
cValues: u32,
lpl: ?*anyopaque,
};
const SRealArray = extern struct {
cValues: u32,
lpflt: ?*anyopaque,
};
const SDoubleArray = extern struct {
cValues: u32,
lpdbl: ?*anyopaque,
};
const SCurrencyArray = extern struct {
cValues: u32,
lpcur: ?*anyopaque,
};
const SAppTimeArray = extern struct {
cValues: u32,
lpat: ?*anyopaque,
};
const SDateTimeArray = extern struct {
cValues: u32,
lpft: ?*anyopaque,
};
const SBinaryArray = extern struct {
cValues: u32,
lpbin: ?*anyopaque,
};
const SLPSTRArray = extern struct {
cValues: u32,
lppszA: ?*anyopaque,
};
const SWStringArray = extern struct {
cValues: u32,
lppszW: ?*anyopaque,
};
const SGuidArray = extern struct {
cValues: u32,
lpguid: ?*anyopaque,
};
const SLargeIntegerArray = extern struct {
cValues: u32,
lpli: ?*anyopaque,
};
const __UPV = extern struct {
i: i16,
l: i32,
ul: u32,
flt: f32,
dbl: f64,
b: u16,
cur: CY,
at: f64,
ft: FILETIME,
lpszA: ?*anyopaque,
bin: SBinary,
lpszW: ?*anyopaque,
lpguid: ?*anyopaque,
li: i64,
MVi: SShortArray,
MVl: SLongArray,
MVflt: SRealArray,
MVdbl: SDoubleArray,
MVcur: SCurrencyArray,
MVat: SAppTimeArray,
MVft: SDateTimeArray,
MVbin: SBinaryArray,
MVszA: SLPSTRArray,
MVszW: SWStringArray,
MVguid: SGuidArray,
MVli: SLargeIntegerArray,
err: i32,
x: i32,
};type
CY {.bycopy.} = object
Anonymous: _Anonymous_e__Struct
int64: int64
FILETIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
SBinary {.bycopy.} = object
cb: uint32
lpb: pointer
SShortArray {.bycopy.} = object
cValues: uint32
lpi: pointer
SLongArray {.bycopy.} = object
cValues: uint32
lpl: pointer
SRealArray {.bycopy.} = object
cValues: uint32
lpflt: pointer
SDoubleArray {.bycopy.} = object
cValues: uint32
lpdbl: pointer
SCurrencyArray {.bycopy.} = object
cValues: uint32
lpcur: pointer
SAppTimeArray {.bycopy.} = object
cValues: uint32
lpat: pointer
SDateTimeArray {.bycopy.} = object
cValues: uint32
lpft: pointer
SBinaryArray {.bycopy.} = object
cValues: uint32
lpbin: pointer
SLPSTRArray {.bycopy.} = object
cValues: uint32
lppszA: pointer
SWStringArray {.bycopy.} = object
cValues: uint32
lppszW: pointer
SGuidArray {.bycopy.} = object
cValues: uint32
lpguid: pointer
SLargeIntegerArray {.bycopy.} = object
cValues: uint32
lpli: pointer
__UPV {.bycopy.} = object
i: int16
l: int32
ul: uint32
flt: float32
dbl: float64
b: uint16
cur: CY
at: float64
ft: FILETIME
lpszA: pointer
bin: SBinary
lpszW: pointer
lpguid: pointer
li: int64
MVi: SShortArray
MVl: SLongArray
MVflt: SRealArray
MVdbl: SDoubleArray
MVcur: SCurrencyArray
MVat: SAppTimeArray
MVft: SDateTimeArray
MVbin: SBinaryArray
MVszA: SLPSTRArray
MVszW: SWStringArray
MVguid: SGuidArray
MVli: SLargeIntegerArray
err: int32
x: int32struct CY
{
_Anonymous_e__Struct Anonymous;
long int64;
}
struct FILETIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct SBinary
{
uint cb;
void* lpb;
}
struct SShortArray
{
uint cValues;
void* lpi;
}
struct SLongArray
{
uint cValues;
void* lpl;
}
struct SRealArray
{
uint cValues;
void* lpflt;
}
struct SDoubleArray
{
uint cValues;
void* lpdbl;
}
struct SCurrencyArray
{
uint cValues;
void* lpcur;
}
struct SAppTimeArray
{
uint cValues;
void* lpat;
}
struct SDateTimeArray
{
uint cValues;
void* lpft;
}
struct SBinaryArray
{
uint cValues;
void* lpbin;
}
struct SLPSTRArray
{
uint cValues;
void* lppszA;
}
struct SWStringArray
{
uint cValues;
void* lppszW;
}
struct SGuidArray
{
uint cValues;
void* lpguid;
}
struct SLargeIntegerArray
{
uint cValues;
void* lpli;
}
struct __UPV
{
short i;
int l;
uint ul;
float flt;
double dbl;
ushort b;
CY cur;
double at;
FILETIME ft;
void* lpszA;
SBinary bin;
void* lpszW;
void* lpguid;
long li;
SShortArray MVi;
SLongArray MVl;
SRealArray MVflt;
SDoubleArray MVdbl;
SCurrencyArray MVcur;
SAppTimeArray MVat;
SDateTimeArray MVft;
SBinaryArray MVbin;
SLPSTRArray MVszA;
SWStringArray MVszW;
SGuidArray MVguid;
SLargeIntegerArray MVli;
int err;
int x;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; __UPV サイズ: 8 バイト(x86)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; i : SHORT (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; l : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ul : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flt : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dbl : DOUBLE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; b : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; cur : CY (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; at : DOUBLE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; ft : FILETIME (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpszA : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; bin : SBinary (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpszW : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpguid : GUID* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; li : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MVi : SShortArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVl : SLongArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVflt : SRealArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVdbl : SDoubleArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVcur : SCurrencyArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVat : SAppTimeArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVft : SDateTimeArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVbin : SBinaryArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVszA : SLPSTRArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVszW : SWStringArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVguid : SGuidArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MVli : SLargeIntegerArray (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; err : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; x : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; __UPV サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; i : SHORT (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; l : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ul : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flt : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dbl : DOUBLE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; b : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; cur : CY (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; at : DOUBLE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; ft : FILETIME (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpszA : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; bin : SBinary (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; lpszW : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; lpguid : GUID* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; li : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MVi : SShortArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVl : SLongArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVflt : SRealArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVdbl : SDoubleArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVcur : SCurrencyArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVat : SAppTimeArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVft : SDateTimeArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVbin : SBinaryArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVszA : SLPSTRArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVszW : SWStringArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVguid : SGuidArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MVli : SLargeIntegerArray (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; err : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; x : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global SBinary
#field int cb
#field intptr lpb
#endstruct
#defstruct global SShortArray
#field int cValues
#field intptr lpi
#endstruct
#defstruct global SLongArray
#field int cValues
#field intptr lpl
#endstruct
#defstruct global SRealArray
#field int cValues
#field intptr lpflt
#endstruct
#defstruct global SDoubleArray
#field int cValues
#field intptr lpdbl
#endstruct
#defstruct global SCurrencyArray
#field int cValues
#field intptr lpcur
#endstruct
#defstruct global SAppTimeArray
#field int cValues
#field intptr lpat
#endstruct
#defstruct global SDateTimeArray
#field int cValues
#field intptr lpft
#endstruct
#defstruct global SBinaryArray
#field int cValues
#field intptr lpbin
#endstruct
#defstruct global SLPSTRArray
#field int cValues
#field intptr lppszA
#endstruct
#defstruct global SWStringArray
#field int cValues
#field intptr lppszW
#endstruct
#defstruct global SGuidArray
#field int cValues
#field intptr lpguid
#endstruct
#defstruct global SLargeIntegerArray
#field int cValues
#field intptr lpli
#endstruct
#defstruct global __UPV
#field short i
#field int l
#field int ul
#field float flt
#field double dbl
#field short b
#field byte cur 8
#field double at
#field FILETIME ft
#field intptr lpszA
#field SBinary bin
#field intptr lpszW
#field intptr lpguid
#field int64 li
#field SShortArray MVi
#field SLongArray MVl
#field SRealArray MVflt
#field SDoubleArray MVdbl
#field SCurrencyArray MVcur
#field SAppTimeArray MVat
#field SDateTimeArray MVft
#field SBinaryArray MVbin
#field SLPSTRArray MVszA
#field SWStringArray MVszW
#field SGuidArray MVguid
#field SLargeIntegerArray MVli
#field int err
#field int x
#endstruct
stdim st, __UPV ; NSTRUCT 変数を確保
st->i = 100
mes "i=" + st->i
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。