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

JET_RECPOS2

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

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。
centriesLTDeprecatedDWORD4+4+4現在位置より小さいエントリ数(非推奨の32ビット版)。
centriesInRangeDeprecatedDWORD4+8+8範囲内のエントリ数(非推奨の32ビット版)。
centriesTotalDeprecatedDWORD4+12+12全エントリ数(非推奨の32ビット版)。
centriesLTULONGLONG8+16+16現在位置より小さい(前方の)エントリ数の概算(64ビット)。
centriesTotalULONGLONG8+24+24インデックス内の総エントリ数の概算(64ビット)。

各言語での定義

#include <windows.h>

// JET_RECPOS2  (x64 32 / x86 32 バイト)
#pragma pack(push, 4)
typedef struct JET_RECPOS2 {
    DWORD cbStruct;
    DWORD centriesLTDeprecated;
    DWORD centriesInRangeDeprecated;
    DWORD centriesTotalDeprecated;
    ULONGLONG centriesLT;
    ULONGLONG centriesTotal;
} JET_RECPOS2;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct JET_RECPOS2
{
    public uint cbStruct;
    public uint centriesLTDeprecated;
    public uint centriesInRangeDeprecated;
    public uint centriesTotalDeprecated;
    public ulong centriesLT;
    public ulong centriesTotal;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure JET_RECPOS2
    Public cbStruct As UInteger
    Public centriesLTDeprecated As UInteger
    Public centriesInRangeDeprecated As UInteger
    Public centriesTotalDeprecated As UInteger
    Public centriesLT As ULong
    Public centriesTotal As ULong
End Structure
import ctypes
from ctypes import wintypes

class JET_RECPOS2(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("centriesLTDeprecated", wintypes.DWORD),
        ("centriesInRangeDeprecated", wintypes.DWORD),
        ("centriesTotalDeprecated", wintypes.DWORD),
        ("centriesLT", ctypes.c_ulonglong),
        ("centriesTotal", ctypes.c_ulonglong),
    ]
#[repr(C, packed(4))]
pub struct JET_RECPOS2 {
    pub cbStruct: u32,
    pub centriesLTDeprecated: u32,
    pub centriesInRangeDeprecated: u32,
    pub centriesTotalDeprecated: u32,
    pub centriesLT: u64,
    pub centriesTotal: u64,
}
import "golang.org/x/sys/windows"

type JET_RECPOS2 struct {
	cbStruct uint32
	centriesLTDeprecated uint32
	centriesInRangeDeprecated uint32
	centriesTotalDeprecated uint32
	centriesLT uint64
	centriesTotal uint64
}
type
  JET_RECPOS2 = packed record
    cbStruct: DWORD;
    centriesLTDeprecated: DWORD;
    centriesInRangeDeprecated: DWORD;
    centriesTotalDeprecated: DWORD;
    centriesLT: UInt64;
    centriesTotal: UInt64;
  end;
const JET_RECPOS2 = extern struct {
    cbStruct: u32,
    centriesLTDeprecated: u32,
    centriesInRangeDeprecated: u32,
    centriesTotalDeprecated: u32,
    centriesLT: u64,
    centriesTotal: u64,
};
type
  JET_RECPOS2 {.packed.} = object
    cbStruct: uint32
    centriesLTDeprecated: uint32
    centriesInRangeDeprecated: uint32
    centriesTotalDeprecated: uint32
    centriesLT: uint64
    centriesTotal: uint64
align(4)
struct JET_RECPOS2
{
    uint cbStruct;
    uint centriesLTDeprecated;
    uint centriesInRangeDeprecated;
    uint centriesTotalDeprecated;
    ulong centriesLT;
    ulong centriesTotal;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_RECPOS2 サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; centriesLTDeprecated : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; centriesInRangeDeprecated : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; centriesTotalDeprecated : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; centriesLT : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; centriesTotal : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_RECPOS2, pack=4
    #field int cbStruct
    #field int centriesLTDeprecated
    #field int centriesInRangeDeprecated
    #field int centriesTotalDeprecated
    #field int64 centriesLT
    #field int64 centriesTotal
#endstruct

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