PUBAPPINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| dwMask | DWORD | 4 | +4 | +4 | 有効なメンバーを示すマスクフラグ。 |
| pszSource | LPWSTR | 8/4 | +8 | +8 | アプリケーションの配布元(ソース)。NULL 可。 |
| stAssigned | SYSTEMTIME | 16 | +16 | +12 | アプリが割り当てられた日時(SYSTEMTIME)。 |
| stPublished | SYSTEMTIME | 16 | +32 | +28 | アプリが公開された日時(SYSTEMTIME)。 |
| stScheduled | SYSTEMTIME | 16 | +48 | +44 | インストールが予定された日時(SYSTEMTIME)。 |
| stExpire | SYSTEMTIME | 16 | +64 | +60 | アプリの有効期限となる日時(SYSTEMTIME)。 |
各言語での定義
#include <windows.h>
// SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
// PUBAPPINFO (x64 80 / x86 76 バイト)
typedef struct PUBAPPINFO {
DWORD cbSize;
DWORD dwMask;
LPWSTR pszSource;
SYSTEMTIME stAssigned;
SYSTEMTIME stPublished;
SYSTEMTIME stScheduled;
SYSTEMTIME stExpire;
} PUBAPPINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PUBAPPINFO
{
public uint cbSize;
public uint dwMask;
public IntPtr pszSource;
public SYSTEMTIME stAssigned;
public SYSTEMTIME stPublished;
public SYSTEMTIME stScheduled;
public SYSTEMTIME stExpire;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PUBAPPINFO
Public cbSize As UInteger
Public dwMask As UInteger
Public pszSource As IntPtr
Public stAssigned As SYSTEMTIME
Public stPublished As SYSTEMTIME
Public stScheduled As SYSTEMTIME
Public stExpire As SYSTEMTIME
End Structureimport ctypes
from ctypes import wintypes
class SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]
class PUBAPPINFO(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwMask", wintypes.DWORD),
("pszSource", ctypes.c_void_p),
("stAssigned", SYSTEMTIME),
("stPublished", SYSTEMTIME),
("stScheduled", SYSTEMTIME),
("stExpire", SYSTEMTIME),
]#[repr(C)]
pub struct SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}
#[repr(C)]
pub struct PUBAPPINFO {
pub cbSize: u32,
pub dwMask: u32,
pub pszSource: *mut core::ffi::c_void,
pub stAssigned: SYSTEMTIME,
pub stPublished: SYSTEMTIME,
pub stScheduled: SYSTEMTIME,
pub stExpire: SYSTEMTIME,
}import "golang.org/x/sys/windows"
type SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}
type PUBAPPINFO struct {
cbSize uint32
dwMask uint32
pszSource uintptr
stAssigned SYSTEMTIME
stPublished SYSTEMTIME
stScheduled SYSTEMTIME
stExpire SYSTEMTIME
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
PUBAPPINFO = record
cbSize: DWORD;
dwMask: DWORD;
pszSource: Pointer;
stAssigned: SYSTEMTIME;
stPublished: SYSTEMTIME;
stScheduled: SYSTEMTIME;
stExpire: SYSTEMTIME;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const PUBAPPINFO = extern struct {
cbSize: u32,
dwMask: u32,
pszSource: ?*anyopaque,
stAssigned: SYSTEMTIME,
stPublished: SYSTEMTIME,
stScheduled: SYSTEMTIME,
stExpire: SYSTEMTIME,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
PUBAPPINFO {.bycopy.} = object
cbSize: uint32
dwMask: uint32
pszSource: pointer
stAssigned: SYSTEMTIME
stPublished: SYSTEMTIME
stScheduled: SYSTEMTIME
stExpire: SYSTEMTIMEstruct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct PUBAPPINFO
{
uint cbSize;
uint dwMask;
void* pszSource;
SYSTEMTIME stAssigned;
SYSTEMTIME stPublished;
SYSTEMTIME stScheduled;
SYSTEMTIME stExpire;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PUBAPPINFO サイズ: 76 バイト(x86)
dim st, 19 ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszSource : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; stAssigned : SYSTEMTIME (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; stPublished : SYSTEMTIME (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; stScheduled : SYSTEMTIME (+44, 16byte) varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; stExpire : SYSTEMTIME (+60, 16byte) varptr(st)+60 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PUBAPPINFO サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszSource : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; stAssigned : SYSTEMTIME (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; stPublished : SYSTEMTIME (+32, 16byte) varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; stScheduled : SYSTEMTIME (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; stExpire : SYSTEMTIME (+64, 16byte) varptr(st)+64 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
#defstruct global PUBAPPINFO
#field int cbSize
#field int dwMask
#field intptr pszSource
#field SYSTEMTIME stAssigned
#field SYSTEMTIME stPublished
#field SYSTEMTIME stScheduled
#field SYSTEMTIME stExpire
#endstruct
stdim st, PUBAPPINFO ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize