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