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

JetGetThreadStats

関数
現在のスレッドのESE性能統計情報を取得する。
DLLESENT.dll呼出規約winapi

シグネチャ

// ESENT.dll
#include <windows.h>

INT JetGetThreadStats(
    void* pvResult,
    DWORD cbMax
);

パラメーター

名前方向
pvResultvoid*out
cbMaxDWORDin

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll
#include <windows.h>

INT JetGetThreadStats(
    void* pvResult,
    DWORD cbMax
);
[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetGetThreadStats(
    IntPtr pvResult,   // void* out
    uint cbMax   // DWORD
);
<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetGetThreadStats(
    pvResult As IntPtr,   ' void* out
    cbMax As UInteger   ' DWORD
) As Integer
End Function
' pvResult : void* out
' cbMax : DWORD
Declare PtrSafe Function JetGetThreadStats Lib "esent" ( _
    ByVal pvResult As LongPtr, _
    ByVal cbMax As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetGetThreadStats = ctypes.windll.esent.JetGetThreadStats
JetGetThreadStats.restype = ctypes.c_int
JetGetThreadStats.argtypes = [
    ctypes.POINTER(None),  # pvResult : void* out
    wintypes.DWORD,  # cbMax : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetGetThreadStats = Fiddle::Function.new(
  lib['JetGetThreadStats'],
  [
    Fiddle::TYPE_VOIDP,  # pvResult : void* out
    -Fiddle::TYPE_INT,  # cbMax : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "esent")]
extern "system" {
    fn JetGetThreadStats(
        pvResult: *mut (),  // void* out
        cbMax: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetGetThreadStats(IntPtr pvResult, uint cbMax);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetGetThreadStats' -Namespace Win32 -PassThru
# $api::JetGetThreadStats(pvResult, cbMax)
#uselib "ESENT.dll"
#func global JetGetThreadStats "JetGetThreadStats" sptr, sptr
; JetGetThreadStats pvResult, cbMax   ; 戻り値は stat
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ESENT.dll"
#cfunc global JetGetThreadStats "JetGetThreadStats" sptr, int
; res = JetGetThreadStats(pvResult, cbMax)
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "int"
; INT JetGetThreadStats(void* pvResult, DWORD cbMax)
#uselib "ESENT.dll"
#cfunc global JetGetThreadStats "JetGetThreadStats" intptr, int
; res = JetGetThreadStats(pvResult, cbMax)
; pvResult : void* out -> "intptr"
; cbMax : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetGetThreadStats = esent.NewProc("JetGetThreadStats")
)

// pvResult (void* out), cbMax (DWORD)
r1, _, err := procJetGetThreadStats.Call(
	uintptr(pvResult),
	uintptr(cbMax),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetGetThreadStats(
  pvResult: Pointer;   // void* out
  cbMax: DWORD   // DWORD
): Integer; stdcall;
  external 'ESENT.dll' name 'JetGetThreadStats';
result := DllCall("ESENT\JetGetThreadStats"
    , "Ptr", pvResult   ; void* out
    , "UInt", cbMax   ; DWORD
    , "Int")   ; return: INT
●JetGetThreadStats(pvResult, cbMax) = DLL("ESENT.dll", "int JetGetThreadStats(void*, dword)")
# 呼び出し: JetGetThreadStats(pvResult, cbMax)
# pvResult : void* out -> "void*"
# cbMax : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。