ホーム › Storage.Jet › JetIndexRecordCount
JetIndexRecordCount
関数現在のインデックス範囲内のレコード数を数える。
シグネチャ
// ESENT.dll
#include <windows.h>
INT JetIndexRecordCount(
JET_SESID sesid,
JET_TABLEID tableid,
DWORD* pcrec,
DWORD crecMax
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| sesid | JET_SESID | in |
| tableid | JET_TABLEID | in |
| pcrec | DWORD* | out |
| crecMax | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// ESENT.dll
#include <windows.h>
INT JetIndexRecordCount(
JET_SESID sesid,
JET_TABLEID tableid,
DWORD* pcrec,
DWORD crecMax
);[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetIndexRecordCount(
UIntPtr sesid, // JET_SESID
UIntPtr tableid, // JET_TABLEID
out uint pcrec, // DWORD* out
uint crecMax // DWORD
);<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetIndexRecordCount(
sesid As UIntPtr, ' JET_SESID
tableid As UIntPtr, ' JET_TABLEID
<Out> ByRef pcrec As UInteger, ' DWORD* out
crecMax As UInteger ' DWORD
) As Integer
End Function' sesid : JET_SESID
' tableid : JET_TABLEID
' pcrec : DWORD* out
' crecMax : DWORD
Declare PtrSafe Function JetIndexRecordCount Lib "esent" ( _
ByVal sesid As LongPtr, _
ByVal tableid As LongPtr, _
ByRef pcrec As Long, _
ByVal crecMax As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JetIndexRecordCount = ctypes.windll.esent.JetIndexRecordCount
JetIndexRecordCount.restype = ctypes.c_int
JetIndexRecordCount.argtypes = [
ctypes.c_size_t, # sesid : JET_SESID
ctypes.c_size_t, # tableid : JET_TABLEID
ctypes.POINTER(wintypes.DWORD), # pcrec : DWORD* out
wintypes.DWORD, # crecMax : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ESENT.dll')
JetIndexRecordCount = Fiddle::Function.new(
lib['JetIndexRecordCount'],
[
Fiddle::TYPE_UINTPTR_T, # sesid : JET_SESID
Fiddle::TYPE_UINTPTR_T, # tableid : JET_TABLEID
Fiddle::TYPE_VOIDP, # pcrec : DWORD* out
-Fiddle::TYPE_INT, # crecMax : DWORD
],
Fiddle::TYPE_INT)#[link(name = "esent")]
extern "system" {
fn JetIndexRecordCount(
sesid: usize, // JET_SESID
tableid: usize, // JET_TABLEID
pcrec: *mut u32, // DWORD* out
crecMax: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetIndexRecordCount(UIntPtr sesid, UIntPtr tableid, out uint pcrec, uint crecMax);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetIndexRecordCount' -Namespace Win32 -PassThru
# $api::JetIndexRecordCount(sesid, tableid, pcrec, crecMax)#uselib "ESENT.dll"
#func global JetIndexRecordCount "JetIndexRecordCount" sptr, sptr, sptr, sptr
; JetIndexRecordCount sesid, tableid, varptr(pcrec), crecMax ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pcrec : DWORD* out -> "sptr"
; crecMax : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ESENT.dll" #cfunc global JetIndexRecordCount "JetIndexRecordCount" sptr, sptr, var, int ; res = JetIndexRecordCount(sesid, tableid, pcrec, crecMax) ; sesid : JET_SESID -> "sptr" ; tableid : JET_TABLEID -> "sptr" ; pcrec : DWORD* out -> "var" ; crecMax : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ESENT.dll" #cfunc global JetIndexRecordCount "JetIndexRecordCount" sptr, sptr, sptr, int ; res = JetIndexRecordCount(sesid, tableid, varptr(pcrec), crecMax) ; sesid : JET_SESID -> "sptr" ; tableid : JET_TABLEID -> "sptr" ; pcrec : DWORD* out -> "sptr" ; crecMax : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT JetIndexRecordCount(JET_SESID sesid, JET_TABLEID tableid, DWORD* pcrec, DWORD crecMax) #uselib "ESENT.dll" #cfunc global JetIndexRecordCount "JetIndexRecordCount" intptr, intptr, var, int ; res = JetIndexRecordCount(sesid, tableid, pcrec, crecMax) ; sesid : JET_SESID -> "intptr" ; tableid : JET_TABLEID -> "intptr" ; pcrec : DWORD* out -> "var" ; crecMax : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT JetIndexRecordCount(JET_SESID sesid, JET_TABLEID tableid, DWORD* pcrec, DWORD crecMax) #uselib "ESENT.dll" #cfunc global JetIndexRecordCount "JetIndexRecordCount" intptr, intptr, intptr, int ; res = JetIndexRecordCount(sesid, tableid, varptr(pcrec), crecMax) ; sesid : JET_SESID -> "intptr" ; tableid : JET_TABLEID -> "intptr" ; pcrec : DWORD* out -> "intptr" ; crecMax : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
esent = windows.NewLazySystemDLL("ESENT.dll")
procJetIndexRecordCount = esent.NewProc("JetIndexRecordCount")
)
// sesid (JET_SESID), tableid (JET_TABLEID), pcrec (DWORD* out), crecMax (DWORD)
r1, _, err := procJetIndexRecordCount.Call(
uintptr(sesid),
uintptr(tableid),
uintptr(pcrec),
uintptr(crecMax),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction JetIndexRecordCount(
sesid: NativeUInt; // JET_SESID
tableid: NativeUInt; // JET_TABLEID
pcrec: Pointer; // DWORD* out
crecMax: DWORD // DWORD
): Integer; stdcall;
external 'ESENT.dll' name 'JetIndexRecordCount';result := DllCall("ESENT\JetIndexRecordCount"
, "UPtr", sesid ; JET_SESID
, "UPtr", tableid ; JET_TABLEID
, "Ptr", pcrec ; DWORD* out
, "UInt", crecMax ; DWORD
, "Int") ; return: INT●JetIndexRecordCount(sesid, tableid, pcrec, crecMax) = DLL("ESENT.dll", "int JetIndexRecordCount(int, int, void*, dword)")
# 呼び出し: JetIndexRecordCount(sesid, tableid, pcrec, crecMax)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# pcrec : DWORD* out -> "void*"
# crecMax : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。