ホーム › Storage.FileSystem › FlushLogToLsn
FlushLogToLsn
関数CLFSログを指定LSNまでフラッシュする。
シグネチャ
// clfsw32.dll
#include <windows.h>
BOOL FlushLogToLsn(
void* pvMarshalContext,
CLS_LSN* plsnFlush,
CLS_LSN* plsnLastFlushed,
OVERLAPPED* pOverlapped
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pvMarshalContext | void* | inout |
| plsnFlush | CLS_LSN* | inout |
| plsnLastFlushed | CLS_LSN* | inout |
| pOverlapped | OVERLAPPED* | inout |
戻り値の型: BOOL
各言語での呼び出し定義
// clfsw32.dll
#include <windows.h>
BOOL FlushLogToLsn(
void* pvMarshalContext,
CLS_LSN* plsnFlush,
CLS_LSN* plsnLastFlushed,
OVERLAPPED* pOverlapped
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("clfsw32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool FlushLogToLsn(
IntPtr pvMarshalContext, // void* in/out
IntPtr plsnFlush, // CLS_LSN* in/out
IntPtr plsnLastFlushed, // CLS_LSN* in/out
IntPtr pOverlapped // OVERLAPPED* in/out
);<DllImport("clfsw32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function FlushLogToLsn(
pvMarshalContext As IntPtr, ' void* in/out
plsnFlush As IntPtr, ' CLS_LSN* in/out
plsnLastFlushed As IntPtr, ' CLS_LSN* in/out
pOverlapped As IntPtr ' OVERLAPPED* in/out
) As Boolean
End Function' pvMarshalContext : void* in/out
' plsnFlush : CLS_LSN* in/out
' plsnLastFlushed : CLS_LSN* in/out
' pOverlapped : OVERLAPPED* in/out
Declare PtrSafe Function FlushLogToLsn Lib "clfsw32" ( _
ByVal pvMarshalContext As LongPtr, _
ByVal plsnFlush As LongPtr, _
ByVal plsnLastFlushed As LongPtr, _
ByVal pOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FlushLogToLsn = ctypes.windll.clfsw32.FlushLogToLsn
FlushLogToLsn.restype = wintypes.BOOL
FlushLogToLsn.argtypes = [
ctypes.POINTER(None), # pvMarshalContext : void* in/out
ctypes.c_void_p, # plsnFlush : CLS_LSN* in/out
ctypes.c_void_p, # plsnLastFlushed : CLS_LSN* in/out
ctypes.c_void_p, # pOverlapped : OVERLAPPED* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('clfsw32.dll')
FlushLogToLsn = Fiddle::Function.new(
lib['FlushLogToLsn'],
[
Fiddle::TYPE_VOIDP, # pvMarshalContext : void* in/out
Fiddle::TYPE_VOIDP, # plsnFlush : CLS_LSN* in/out
Fiddle::TYPE_VOIDP, # plsnLastFlushed : CLS_LSN* in/out
Fiddle::TYPE_VOIDP, # pOverlapped : OVERLAPPED* in/out
],
Fiddle::TYPE_INT)#[link(name = "clfsw32")]
extern "system" {
fn FlushLogToLsn(
pvMarshalContext: *mut (), // void* in/out
plsnFlush: *mut CLS_LSN, // CLS_LSN* in/out
plsnLastFlushed: *mut CLS_LSN, // CLS_LSN* in/out
pOverlapped: *mut OVERLAPPED // OVERLAPPED* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("clfsw32.dll", SetLastError = true)]
public static extern bool FlushLogToLsn(IntPtr pvMarshalContext, IntPtr plsnFlush, IntPtr plsnLastFlushed, IntPtr pOverlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'clfsw32_FlushLogToLsn' -Namespace Win32 -PassThru
# $api::FlushLogToLsn(pvMarshalContext, plsnFlush, plsnLastFlushed, pOverlapped)#uselib "clfsw32.dll"
#func global FlushLogToLsn "FlushLogToLsn" sptr, sptr, sptr, sptr
; FlushLogToLsn pvMarshalContext, varptr(plsnFlush), varptr(plsnLastFlushed), varptr(pOverlapped) ; 戻り値は stat
; pvMarshalContext : void* in/out -> "sptr"
; plsnFlush : CLS_LSN* in/out -> "sptr"
; plsnLastFlushed : CLS_LSN* in/out -> "sptr"
; pOverlapped : OVERLAPPED* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "clfsw32.dll" #cfunc global FlushLogToLsn "FlushLogToLsn" sptr, var, var, var ; res = FlushLogToLsn(pvMarshalContext, plsnFlush, plsnLastFlushed, pOverlapped) ; pvMarshalContext : void* in/out -> "sptr" ; plsnFlush : CLS_LSN* in/out -> "var" ; plsnLastFlushed : CLS_LSN* in/out -> "var" ; pOverlapped : OVERLAPPED* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "clfsw32.dll" #cfunc global FlushLogToLsn "FlushLogToLsn" sptr, sptr, sptr, sptr ; res = FlushLogToLsn(pvMarshalContext, varptr(plsnFlush), varptr(plsnLastFlushed), varptr(pOverlapped)) ; pvMarshalContext : void* in/out -> "sptr" ; plsnFlush : CLS_LSN* in/out -> "sptr" ; plsnLastFlushed : CLS_LSN* in/out -> "sptr" ; pOverlapped : OVERLAPPED* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL FlushLogToLsn(void* pvMarshalContext, CLS_LSN* plsnFlush, CLS_LSN* plsnLastFlushed, OVERLAPPED* pOverlapped) #uselib "clfsw32.dll" #cfunc global FlushLogToLsn "FlushLogToLsn" intptr, var, var, var ; res = FlushLogToLsn(pvMarshalContext, plsnFlush, plsnLastFlushed, pOverlapped) ; pvMarshalContext : void* in/out -> "intptr" ; plsnFlush : CLS_LSN* in/out -> "var" ; plsnLastFlushed : CLS_LSN* in/out -> "var" ; pOverlapped : OVERLAPPED* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL FlushLogToLsn(void* pvMarshalContext, CLS_LSN* plsnFlush, CLS_LSN* plsnLastFlushed, OVERLAPPED* pOverlapped) #uselib "clfsw32.dll" #cfunc global FlushLogToLsn "FlushLogToLsn" intptr, intptr, intptr, intptr ; res = FlushLogToLsn(pvMarshalContext, varptr(plsnFlush), varptr(plsnLastFlushed), varptr(pOverlapped)) ; pvMarshalContext : void* in/out -> "intptr" ; plsnFlush : CLS_LSN* in/out -> "intptr" ; plsnLastFlushed : CLS_LSN* in/out -> "intptr" ; pOverlapped : OVERLAPPED* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clfsw32 = windows.NewLazySystemDLL("clfsw32.dll")
procFlushLogToLsn = clfsw32.NewProc("FlushLogToLsn")
)
// pvMarshalContext (void* in/out), plsnFlush (CLS_LSN* in/out), plsnLastFlushed (CLS_LSN* in/out), pOverlapped (OVERLAPPED* in/out)
r1, _, err := procFlushLogToLsn.Call(
uintptr(pvMarshalContext),
uintptr(plsnFlush),
uintptr(plsnLastFlushed),
uintptr(pOverlapped),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction FlushLogToLsn(
pvMarshalContext: Pointer; // void* in/out
plsnFlush: Pointer; // CLS_LSN* in/out
plsnLastFlushed: Pointer; // CLS_LSN* in/out
pOverlapped: Pointer // OVERLAPPED* in/out
): BOOL; stdcall;
external 'clfsw32.dll' name 'FlushLogToLsn';result := DllCall("clfsw32\FlushLogToLsn"
, "Ptr", pvMarshalContext ; void* in/out
, "Ptr", plsnFlush ; CLS_LSN* in/out
, "Ptr", plsnLastFlushed ; CLS_LSN* in/out
, "Ptr", pOverlapped ; OVERLAPPED* in/out
, "Int") ; return: BOOL●FlushLogToLsn(pvMarshalContext, plsnFlush, plsnLastFlushed, pOverlapped) = DLL("clfsw32.dll", "bool FlushLogToLsn(void*, void*, void*, void*)")
# 呼び出し: FlushLogToLsn(pvMarshalContext, plsnFlush, plsnLastFlushed, pOverlapped)
# pvMarshalContext : void* in/out -> "void*"
# plsnFlush : CLS_LSN* in/out -> "void*"
# plsnLastFlushed : CLS_LSN* in/out -> "void*"
# pOverlapped : OVERLAPPED* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。