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

JET_BKINFO

構造体
サイズx64: 40 バイト / x86: 32 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
lgposMarkJET_LGPOS8+0+0バックアップ位置を示すログ位置JET_LGPOS。
Anonymous_Anonymous_e__Union24/16+8+8バックアップ時刻情報を保持する無名共用体(JET_LOGTIME/JET_BKLOGTIME)。
genLowDWORD4+32+24バックアップに含まれる最小ログ生成番号。
genHighDWORD4+36+28バックアップに含まれる最大ログ生成番号。

共用体: _Anonymous_e__Union x64 24B / x86 16B

フィールドサイズx64x86
logtimeMarkJET_LOGTIME24/16+0+0
bklogtimeMarkJET_BKLOGTIME24/16+0+0

各言語での定義

#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_BKINFO  (x64 40 / x86 32 バイト)
#pragma pack(push, 1)
typedef struct JET_BKINFO {
    JET_LGPOS lgposMark;
    _Anonymous_e__Union Anonymous;
    DWORD genLow;
    DWORD genHigh;
} JET_BKINFO;
#pragma pack(pop)
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, Pack = 1, CharSet = CharSet.Unicode)]
public struct JET_BKINFO
{
    public JET_LGPOS lgposMark;
    public _Anonymous_e__Union Anonymous;
    public uint genLow;
    public uint genHigh;
}
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, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure JET_BKINFO
    Public lgposMark As JET_LGPOS
    Public Anonymous As _Anonymous_e__Union
    Public genLow As UInteger
    Public genHigh As UInteger
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_BKINFO(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("lgposMark", JET_LGPOS),
        ("Anonymous", _Anonymous_e__Union),
        ("genLow", wintypes.DWORD),
        ("genHigh", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct JET_LGPOS {
    pub ib: u16,
    pub isec: u16,
    pub lGeneration: i32,
}

#[repr(C, packed(1))]
pub struct JET_BKINFO {
    pub lgposMark: JET_LGPOS,
    pub Anonymous: _Anonymous_e__Union,
    pub genLow: u32,
    pub genHigh: u32,
}
import "golang.org/x/sys/windows"

type JET_LGPOS struct {
	ib uint16
	isec uint16
	lGeneration int32
}

type JET_BKINFO struct {
	lgposMark JET_LGPOS
	Anonymous _Anonymous_e__Union
	genLow uint32
	genHigh uint32
}
type
  JET_LGPOS = packed record
    ib: Word;
    isec: Word;
    lGeneration: Integer;
  end;

  JET_BKINFO = packed record
    lgposMark: JET_LGPOS;
    Anonymous: _Anonymous_e__Union;
    genLow: DWORD;
    genHigh: DWORD;
  end;
const JET_LGPOS = extern struct {
    ib: u16,
    isec: u16,
    lGeneration: i32,
};

const JET_BKINFO = extern struct {
    lgposMark: JET_LGPOS,
    Anonymous: _Anonymous_e__Union,
    genLow: u32,
    genHigh: u32,
};
type
  JET_LGPOS {.packed.} = object
    ib: uint16
    isec: uint16
    lGeneration: int32

  JET_BKINFO {.packed.} = object
    lgposMark: JET_LGPOS
    Anonymous: _Anonymous_e__Union
    genLow: uint32
    genHigh: uint32
align(1)
struct JET_LGPOS
{
    ushort ib;
    ushort isec;
    int lGeneration;
}

align(1)
struct JET_BKINFO
{
    JET_LGPOS lgposMark;
    _Anonymous_e__Union Anonymous;
    uint genLow;
    uint genHigh;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_BKINFO サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; lgposMark : JET_LGPOS (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; genLow : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; genHigh : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_BKINFO サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lgposMark : JET_LGPOS (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+8, 24byte)  varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; genLow : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; genHigh : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※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_BKINFO, pack=1
    #field JET_LGPOS lgposMark
    #field byte Anonymous 24
    #field int genLow
    #field int genHigh
#endstruct

stdim st, JET_BKINFO        ; NSTRUCT 変数を確保
st->genLow = 100
mes "genLow=" + st->genLow
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。