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

JET_COMMIT_ID

構造体
サイズx64: 56 バイト / x86: 48 バイトパッキング4

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

フィールド

フィールドサイズx64x86説明
signLogJET_SIGNATURE44/36+0+0ログストリームを識別する署名JET_SIGNATURE。
reservedINT4+44+36予約フィールド。アラインメント用で未使用。
commitIdLONGLONG8+48+40コミット順序を示す単調増加のコミット識別子(64ビット)。

各言語での定義

#include <windows.h>

// 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_SIGNATURE  (x64 44 / x86 36 バイト)
#pragma pack(push, 1)
typedef struct JET_SIGNATURE {
    DWORD ulRandom;
    JET_LOGTIME logtimeCreate;
    CHAR szComputerName[16];
} JET_SIGNATURE;
#pragma pack(pop)

// JET_COMMIT_ID  (x64 56 / x86 48 バイト)
#pragma pack(push, 4)
typedef struct JET_COMMIT_ID {
    JET_SIGNATURE signLog;
    INT reserved;
    LONGLONG commitId;
} JET_COMMIT_ID;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[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, Pack = 1, CharSet = CharSet.Unicode)]
public struct JET_SIGNATURE
{
    public uint ulRandom;
    public JET_LOGTIME logtimeCreate;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] szComputerName;
}

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct JET_COMMIT_ID
{
    public JET_SIGNATURE signLog;
    public int reserved;
    public long commitId;
}
Imports System.Runtime.InteropServices

<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, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure JET_SIGNATURE
    Public ulRandom As UInteger
    Public logtimeCreate As JET_LOGTIME
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public szComputerName() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure JET_COMMIT_ID
    Public signLog As JET_SIGNATURE
    Public reserved As Integer
    Public commitId As Long
End Structure
import ctypes
from ctypes import wintypes

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_SIGNATURE(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("ulRandom", wintypes.DWORD),
        ("logtimeCreate", JET_LOGTIME),
        ("szComputerName", ctypes.c_byte * 16),
    ]

class JET_COMMIT_ID(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("signLog", JET_SIGNATURE),
        ("reserved", ctypes.c_int),
        ("commitId", ctypes.c_longlong),
    ]
#[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, packed(1))]
pub struct JET_SIGNATURE {
    pub ulRandom: u32,
    pub logtimeCreate: JET_LOGTIME,
    pub szComputerName: [i8; 16],
}

#[repr(C, packed(4))]
pub struct JET_COMMIT_ID {
    pub signLog: JET_SIGNATURE,
    pub reserved: i32,
    pub commitId: i64,
}
import "golang.org/x/sys/windows"

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_SIGNATURE struct {
	ulRandom uint32
	logtimeCreate JET_LOGTIME
	szComputerName [16]int8
}

type JET_COMMIT_ID struct {
	signLog JET_SIGNATURE
	reserved int32
	commitId int64
}
type
  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_SIGNATURE = packed record
    ulRandom: DWORD;
    logtimeCreate: JET_LOGTIME;
    szComputerName: array[0..15] of Shortint;
  end;

  JET_COMMIT_ID = packed record
    signLog: JET_SIGNATURE;
    reserved: Integer;
    commitId: Int64;
  end;
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_SIGNATURE = extern struct {
    ulRandom: u32,
    logtimeCreate: JET_LOGTIME,
    szComputerName: [16]i8,
};

const JET_COMMIT_ID = extern struct {
    signLog: JET_SIGNATURE,
    reserved: i32,
    commitId: i64,
};
type
  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_SIGNATURE {.packed.} = object
    ulRandom: uint32
    logtimeCreate: JET_LOGTIME
    szComputerName: array[16, int8]

  JET_COMMIT_ID {.packed.} = object
    signLog: JET_SIGNATURE
    reserved: int32
    commitId: int64
struct JET_LOGTIME
{
    byte bSeconds;
    byte bMinutes;
    byte bHours;
    byte bDay;
    byte bMonth;
    byte bYear;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
}

align(1)
struct JET_SIGNATURE
{
    uint ulRandom;
    JET_LOGTIME logtimeCreate;
    byte[16] szComputerName;
}

align(4)
struct JET_COMMIT_ID
{
    JET_SIGNATURE signLog;
    int reserved;
    long commitId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_COMMIT_ID サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; signLog : JET_SIGNATURE (+0, 36byte)  varptr(st)+0 を基点に操作(36byte:入れ子/配列)
; reserved : INT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; commitId : LONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_COMMIT_ID サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; signLog : JET_SIGNATURE (+0, 44byte)  varptr(st)+0 を基点に操作(44byte:入れ子/配列)
; reserved : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; commitId : LONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#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_SIGNATURE, pack=1
    #field int ulRandom
    #field JET_LOGTIME logtimeCreate
    #field char szComputerName 16
#endstruct

#defstruct global JET_COMMIT_ID, pack=4
    #field JET_SIGNATURE signLog
    #field int reserved
    #field int64 commitId
#endstruct

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