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