Win32 API 日本語リファレンス
ホームStorage.Jet › JET_RSTINFO_W

JET_RSTINFO_W

構造体
サイズx64: 64 バイト / x86: 40 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。
rgrstmapJET_RSTMAP_W*8/4+8+4データベースの再配置マップ配列JET_RSTMAP_Wへのポインタ。
crstmapINT4+16+8rgrstmap配列の要素数。
lgposStopJET_LGPOS8+20+12リカバリを停止するログ位置JET_LGPOS(時点復元用)。
logtimeStopJET_LOGTIME24/16+32+20リカバリを停止する時刻JET_LOGTIME(時点復元用)。
pfnStatusJET_PFNSTATUS8/4+56+36進捗を通知するJET_PFNSTATUSコールバック関数ポインタ。NULL可。

各言語での定義

#include <windows.h>

// JET_LGPOS  (x64 8 / x86 8 バイト)
#pragma pack(push, 1)
typedef struct JET_LGPOS {
    WORD ib;
    WORD isec;
    INT lGeneration;
} JET_LGPOS;
#pragma pack(pop)

// JET_LOGTIME  (x64 24 / x86 16 バイト)
typedef struct JET_LOGTIME {
    CHAR bSeconds;
    CHAR bMinutes;
    CHAR bHours;
    CHAR bDay;
    CHAR bMonth;
    CHAR bYear;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
} JET_LOGTIME;

// JET_RSTINFO_W  (x64 64 / x86 40 バイト)
typedef struct JET_RSTINFO_W {
    DWORD cbStruct;
    JET_RSTMAP_W* rgrstmap;
    INT crstmap;
    JET_LGPOS lgposStop;
    JET_LOGTIME logtimeStop;
    JET_PFNSTATUS pfnStatus;
} JET_RSTINFO_W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct JET_LGPOS
{
    public ushort ib;
    public ushort isec;
    public int lGeneration;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_LOGTIME
{
    public sbyte bSeconds;
    public sbyte bMinutes;
    public sbyte bHours;
    public sbyte bDay;
    public sbyte bMonth;
    public sbyte bYear;
    public _Anonymous1_e__Union Anonymous1;
    public _Anonymous2_e__Union Anonymous2;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_RSTINFO_W
{
    public uint cbStruct;
    public IntPtr rgrstmap;
    public int crstmap;
    public JET_LGPOS lgposStop;
    public JET_LOGTIME logtimeStop;
    public IntPtr pfnStatus;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure JET_LGPOS
    Public ib As UShort
    Public isec As UShort
    Public lGeneration As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_LOGTIME
    Public bSeconds As SByte
    Public bMinutes As SByte
    Public bHours As SByte
    Public bDay As SByte
    Public bMonth As SByte
    Public bYear As SByte
    Public Anonymous1 As _Anonymous1_e__Union
    Public Anonymous2 As _Anonymous2_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_RSTINFO_W
    Public cbStruct As UInteger
    Public rgrstmap As IntPtr
    Public crstmap As Integer
    Public lgposStop As JET_LGPOS
    Public logtimeStop As JET_LOGTIME
    Public pfnStatus As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class JET_LGPOS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("ib", ctypes.c_ushort),
        ("isec", ctypes.c_ushort),
        ("lGeneration", ctypes.c_int),
    ]

class JET_LOGTIME(ctypes.Structure):
    _fields_ = [
        ("bSeconds", ctypes.c_byte),
        ("bMinutes", ctypes.c_byte),
        ("bHours", ctypes.c_byte),
        ("bDay", ctypes.c_byte),
        ("bMonth", ctypes.c_byte),
        ("bYear", ctypes.c_byte),
        ("Anonymous1", _Anonymous1_e__Union),
        ("Anonymous2", _Anonymous2_e__Union),
    ]

class JET_RSTINFO_W(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("rgrstmap", ctypes.c_void_p),
        ("crstmap", ctypes.c_int),
        ("lgposStop", JET_LGPOS),
        ("logtimeStop", JET_LOGTIME),
        ("pfnStatus", ctypes.c_void_p),
    ]
#[repr(C, packed(1))]
pub struct JET_LGPOS {
    pub ib: u16,
    pub isec: u16,
    pub lGeneration: i32,
}

#[repr(C)]
pub struct JET_LOGTIME {
    pub bSeconds: i8,
    pub bMinutes: i8,
    pub bHours: i8,
    pub bDay: i8,
    pub bMonth: i8,
    pub bYear: i8,
    pub Anonymous1: _Anonymous1_e__Union,
    pub Anonymous2: _Anonymous2_e__Union,
}

#[repr(C)]
pub struct JET_RSTINFO_W {
    pub cbStruct: u32,
    pub rgrstmap: *mut core::ffi::c_void,
    pub crstmap: i32,
    pub lgposStop: JET_LGPOS,
    pub logtimeStop: JET_LOGTIME,
    pub pfnStatus: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type JET_LGPOS struct {
	ib uint16
	isec uint16
	lGeneration int32
}

type JET_LOGTIME struct {
	bSeconds int8
	bMinutes int8
	bHours int8
	bDay int8
	bMonth int8
	bYear int8
	Anonymous1 _Anonymous1_e__Union
	Anonymous2 _Anonymous2_e__Union
}

type JET_RSTINFO_W struct {
	cbStruct uint32
	rgrstmap uintptr
	crstmap int32
	lgposStop JET_LGPOS
	logtimeStop JET_LOGTIME
	pfnStatus uintptr
}
type
  JET_LGPOS = packed record
    ib: Word;
    isec: Word;
    lGeneration: Integer;
  end;

  JET_LOGTIME = record
    bSeconds: Shortint;
    bMinutes: Shortint;
    bHours: Shortint;
    bDay: Shortint;
    bMonth: Shortint;
    bYear: Shortint;
    Anonymous1: _Anonymous1_e__Union;
    Anonymous2: _Anonymous2_e__Union;
  end;

  JET_RSTINFO_W = record
    cbStruct: DWORD;
    rgrstmap: Pointer;
    crstmap: Integer;
    lgposStop: JET_LGPOS;
    logtimeStop: JET_LOGTIME;
    pfnStatus: Pointer;
  end;
const JET_LGPOS = extern struct {
    ib: u16,
    isec: u16,
    lGeneration: i32,
};

const JET_LOGTIME = extern struct {
    bSeconds: i8,
    bMinutes: i8,
    bHours: i8,
    bDay: i8,
    bMonth: i8,
    bYear: i8,
    Anonymous1: _Anonymous1_e__Union,
    Anonymous2: _Anonymous2_e__Union,
};

const JET_RSTINFO_W = extern struct {
    cbStruct: u32,
    rgrstmap: ?*anyopaque,
    crstmap: i32,
    lgposStop: JET_LGPOS,
    logtimeStop: JET_LOGTIME,
    pfnStatus: ?*anyopaque,
};
type
  JET_LGPOS {.packed.} = object
    ib: uint16
    isec: uint16
    lGeneration: int32

  JET_LOGTIME {.bycopy.} = object
    bSeconds: int8
    bMinutes: int8
    bHours: int8
    bDay: int8
    bMonth: int8
    bYear: int8
    Anonymous1: _Anonymous1_e__Union
    Anonymous2: _Anonymous2_e__Union

  JET_RSTINFO_W {.bycopy.} = object
    cbStruct: uint32
    rgrstmap: pointer
    crstmap: int32
    lgposStop: JET_LGPOS
    logtimeStop: JET_LOGTIME
    pfnStatus: pointer
align(1)
struct JET_LGPOS
{
    ushort ib;
    ushort isec;
    int lGeneration;
}

struct JET_LOGTIME
{
    byte bSeconds;
    byte bMinutes;
    byte bHours;
    byte bDay;
    byte bMonth;
    byte bYear;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
}

struct JET_RSTINFO_W
{
    uint cbStruct;
    void* rgrstmap;
    int crstmap;
    JET_LGPOS lgposStop;
    JET_LOGTIME logtimeStop;
    void* pfnStatus;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_RSTINFO_W サイズ: 40 バイト(x86)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; rgrstmap : JET_RSTMAP_W* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; crstmap : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; lgposStop : JET_LGPOS (+12, 8byte)  varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; logtimeStop : JET_LOGTIME (+20, 16byte)  varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; pfnStatus : JET_PFNSTATUS (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_RSTINFO_W サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; rgrstmap : JET_RSTMAP_W* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; crstmap : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lgposStop : JET_LGPOS (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; logtimeStop : JET_LOGTIME (+32, 24byte)  varptr(st)+32 を基点に操作(24byte:入れ子/配列)
; pfnStatus : JET_PFNSTATUS (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global JET_LGPOS, pack=1
    #field short ib
    #field short isec
    #field int lGeneration
#endstruct

#defstruct global JET_LOGTIME
    #field byte bSeconds
    #field byte bMinutes
    #field byte bHours
    #field byte bDay
    #field byte bMonth
    #field byte bYear
    #field byte Anonymous1 8
    #field byte Anonymous2 8
#endstruct

#defstruct global JET_RSTINFO_W
    #field int cbStruct
    #field intptr rgrstmap
    #field int crstmap
    #field JET_LGPOS lgposStop
    #field JET_LOGTIME logtimeStop
    #field intptr pfnStatus
#endstruct

stdim st, JET_RSTINFO_W        ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct