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