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

JetSetTableSequential

関数
テーブルへのシーケンシャルアクセスを有効化する。
DLLESENT.dll呼出規約winapi

シグネチャ

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

INT JetSetTableSequential(
    JET_SESID sesid,
    JET_TABLEID tableid,
    DWORD grbit
);

パラメーター

名前方向
sesidJET_SESIDin
tableidJET_TABLEIDin
grbitDWORDin

戻り値の型: INT

各言語での呼び出し定義

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

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

JetSetTableSequential = ctypes.windll.esent.JetSetTableSequential
JetSetTableSequential.restype = ctypes.c_int
JetSetTableSequential.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    ctypes.c_size_t,  # tableid : JET_TABLEID
    wintypes.DWORD,  # grbit : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetSetTableSequential = esent.NewProc("JetSetTableSequential")
)

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