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

JetInit

関数
ESEデータベースエンジンのインスタンスを初期化する。
DLLESENT.dll呼出規約winapi

シグネチャ

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

INT JetInit(
    JET_INSTANCE* pinstance   // optional
);

パラメーター

名前方向
pinstanceJET_INSTANCE*inoutoptional

戻り値の型: INT

各言語での呼び出し定義

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

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

JetInit = ctypes.windll.esent.JetInit
JetInit.restype = ctypes.c_int
JetInit.argtypes = [
    ctypes.c_void_p,  # pinstance : JET_INSTANCE* optional, in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetInit = esent.NewProc("JetInit")
)

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