ホーム › System.Restore › RESTOREPOINTINFOW
RESTOREPOINTINFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwEventType | RESTOREPOINTINFO_EVENT_TYPE | 4 | +0 | +0 | 復元イベントの種別。RESTOREPOINTINFO_EVENT_TYPEで表す。 |
| dwRestorePtType | RESTOREPOINTINFO_TYPE | 4 | +4 | +4 | 復元ポイントの種別。RESTOREPOINTINFO_TYPEで表す。 |
| llSequenceNumber | LONGLONG | 8 | +8 | +8 | 復元ポイントのシーケンス番号。LONGLONGで表す。 |
| szDescription | WCHAR | 512 | +16 | +16 | 復元ポイントの説明。Unicode(WCHAR)の固定長バッファ。 |
各言語での定義
#include <windows.h>
// RESTOREPOINTINFOW (x64 528 / x86 528 バイト)
#pragma pack(push, 1)
typedef struct RESTOREPOINTINFOW {
RESTOREPOINTINFO_EVENT_TYPE dwEventType;
RESTOREPOINTINFO_TYPE dwRestorePtType;
LONGLONG llSequenceNumber;
WCHAR szDescription[256];
} RESTOREPOINTINFOW;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct RESTOREPOINTINFOW
{
public uint dwEventType;
public uint dwRestorePtType;
public long llSequenceNumber;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string szDescription;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure RESTOREPOINTINFOW
Public dwEventType As UInteger
Public dwRestorePtType As UInteger
Public llSequenceNumber As Long
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public szDescription As String
End Structureimport ctypes
from ctypes import wintypes
class RESTOREPOINTINFOW(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwEventType", wintypes.DWORD),
("dwRestorePtType", wintypes.DWORD),
("llSequenceNumber", ctypes.c_longlong),
("szDescription", ctypes.c_wchar * 256),
]#[repr(C, packed(1))]
pub struct RESTOREPOINTINFOW {
pub dwEventType: u32,
pub dwRestorePtType: u32,
pub llSequenceNumber: i64,
pub szDescription: [u16; 256],
}import "golang.org/x/sys/windows"
type RESTOREPOINTINFOW struct {
dwEventType uint32
dwRestorePtType uint32
llSequenceNumber int64
szDescription [256]uint16
}type
RESTOREPOINTINFOW = packed record
dwEventType: DWORD;
dwRestorePtType: DWORD;
llSequenceNumber: Int64;
szDescription: array[0..255] of WideChar;
end;const RESTOREPOINTINFOW = extern struct {
dwEventType: u32,
dwRestorePtType: u32,
llSequenceNumber: i64,
szDescription: [256]u16,
};type
RESTOREPOINTINFOW {.packed.} = object
dwEventType: uint32
dwRestorePtType: uint32
llSequenceNumber: int64
szDescription: array[256, uint16]align(1)
struct RESTOREPOINTINFOW
{
uint dwEventType;
uint dwRestorePtType;
long llSequenceNumber;
wchar[256] szDescription;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RESTOREPOINTINFOW サイズ: 528 バイト(x64)
dim st, 132 ; 4byte整数×132(構造体サイズ 528 / 4 切り上げ)
; dwEventType : RESTOREPOINTINFO_EVENT_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwRestorePtType : RESTOREPOINTINFO_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; llSequenceNumber : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szDescription : WCHAR (+16, 512byte) varptr(st)+16 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RESTOREPOINTINFOW, pack=1
#field int dwEventType
#field int dwRestorePtType
#field int64 llSequenceNumber
#field wchar szDescription 256
#endstruct
stdim st, RESTOREPOINTINFOW ; NSTRUCT 変数を確保
st->dwEventType = 100
mes "dwEventType=" + st->dwEventType