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

JET_THREADSTATS

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

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。
cPageReferencedDWORD4+4+4操作中に参照されたデータベースページ数。
cPageReadDWORD4+8+8ディスクから読み込まれたページ数。
cPagePrereadDWORD4+12+12先読みされたページ数。
cPageDirtiedDWORD4+16+16新たにダーティ(変更)にされたページ数。
cPageRedirtiedDWORD4+20+20既にダーティだったページが再変更された数。
cLogRecordDWORD4+24+24生成されたログレコード数。
cbLogRecordDWORD4+28+28生成されたログレコードの総バイト数。

各言語での定義

#include <windows.h>

// JET_THREADSTATS  (x64 32 / x86 32 バイト)
typedef struct JET_THREADSTATS {
    DWORD cbStruct;
    DWORD cPageReferenced;
    DWORD cPageRead;
    DWORD cPagePreread;
    DWORD cPageDirtied;
    DWORD cPageRedirtied;
    DWORD cLogRecord;
    DWORD cbLogRecord;
} JET_THREADSTATS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_THREADSTATS
{
    public uint cbStruct;
    public uint cPageReferenced;
    public uint cPageRead;
    public uint cPagePreread;
    public uint cPageDirtied;
    public uint cPageRedirtied;
    public uint cLogRecord;
    public uint cbLogRecord;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_THREADSTATS
    Public cbStruct As UInteger
    Public cPageReferenced As UInteger
    Public cPageRead As UInteger
    Public cPagePreread As UInteger
    Public cPageDirtied As UInteger
    Public cPageRedirtied As UInteger
    Public cLogRecord As UInteger
    Public cbLogRecord As UInteger
End Structure
import ctypes
from ctypes import wintypes

class JET_THREADSTATS(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("cPageReferenced", wintypes.DWORD),
        ("cPageRead", wintypes.DWORD),
        ("cPagePreread", wintypes.DWORD),
        ("cPageDirtied", wintypes.DWORD),
        ("cPageRedirtied", wintypes.DWORD),
        ("cLogRecord", wintypes.DWORD),
        ("cbLogRecord", wintypes.DWORD),
    ]
#[repr(C)]
pub struct JET_THREADSTATS {
    pub cbStruct: u32,
    pub cPageReferenced: u32,
    pub cPageRead: u32,
    pub cPagePreread: u32,
    pub cPageDirtied: u32,
    pub cPageRedirtied: u32,
    pub cLogRecord: u32,
    pub cbLogRecord: u32,
}
import "golang.org/x/sys/windows"

type JET_THREADSTATS struct {
	cbStruct uint32
	cPageReferenced uint32
	cPageRead uint32
	cPagePreread uint32
	cPageDirtied uint32
	cPageRedirtied uint32
	cLogRecord uint32
	cbLogRecord uint32
}
type
  JET_THREADSTATS = record
    cbStruct: DWORD;
    cPageReferenced: DWORD;
    cPageRead: DWORD;
    cPagePreread: DWORD;
    cPageDirtied: DWORD;
    cPageRedirtied: DWORD;
    cLogRecord: DWORD;
    cbLogRecord: DWORD;
  end;
const JET_THREADSTATS = extern struct {
    cbStruct: u32,
    cPageReferenced: u32,
    cPageRead: u32,
    cPagePreread: u32,
    cPageDirtied: u32,
    cPageRedirtied: u32,
    cLogRecord: u32,
    cbLogRecord: u32,
};
type
  JET_THREADSTATS {.bycopy.} = object
    cbStruct: uint32
    cPageReferenced: uint32
    cPageRead: uint32
    cPagePreread: uint32
    cPageDirtied: uint32
    cPageRedirtied: uint32
    cLogRecord: uint32
    cbLogRecord: uint32
struct JET_THREADSTATS
{
    uint cbStruct;
    uint cPageReferenced;
    uint cPageRead;
    uint cPagePreread;
    uint cPageDirtied;
    uint cPageRedirtied;
    uint cLogRecord;
    uint cbLogRecord;
}

HSP用 定義

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

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

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