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

LsnIncrement

関数
ログシーケンス番号を一つ増分して返す。
DLLclfsw32.dll呼出規約winapi

シグネチャ

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

CLS_LSN LsnIncrement(
    CLS_LSN* plsn
);

パラメーター

名前方向
plsnCLS_LSN*in

戻り値の型: CLS_LSN

各言語での呼び出し定義

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

CLS_LSN LsnIncrement(
    CLS_LSN* plsn
);
[DllImport("clfsw32.dll", ExactSpelling = true)]
static extern CLS_LSN LsnIncrement(
    IntPtr plsn   // CLS_LSN*
);
<DllImport("clfsw32.dll", ExactSpelling:=True)>
Public Shared Function LsnIncrement(
    plsn As IntPtr   ' CLS_LSN*
) As CLS_LSN
End Function
' plsn : CLS_LSN*
Declare PtrSafe Function LsnIncrement Lib "clfsw32" ( _
    ByVal plsn As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

LsnIncrement = ctypes.windll.clfsw32.LsnIncrement
LsnIncrement.restype = ctypes.c_void_p
LsnIncrement.argtypes = [
    ctypes.c_void_p,  # plsn : CLS_LSN*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('clfsw32.dll')
LsnIncrement = Fiddle::Function.new(
  lib['LsnIncrement'],
  [
    Fiddle::TYPE_VOIDP,  # plsn : CLS_LSN*
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "clfsw32")]
extern "system" {
    fn LsnIncrement(
        plsn: *mut CLS_LSN  // CLS_LSN*
    ) -> CLS_LSN;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("clfsw32.dll")]
public static extern CLS_LSN LsnIncrement(IntPtr plsn);
"@
$api = Add-Type -MemberDefinition $sig -Name 'clfsw32_LsnIncrement' -Namespace Win32 -PassThru
# $api::LsnIncrement(plsn)
#uselib "clfsw32.dll"
#func global LsnIncrement "LsnIncrement" sptr
; LsnIncrement varptr(plsn)   ; 戻り値は stat
; plsn : CLS_LSN* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "clfsw32.dll"
#cfunc global LsnIncrement "LsnIncrement" var
; res = LsnIncrement(plsn)
; plsn : CLS_LSN* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CLS_LSN LsnIncrement(CLS_LSN* plsn)
#uselib "clfsw32.dll"
#cfunc global LsnIncrement "LsnIncrement" var
; res = LsnIncrement(plsn)
; plsn : CLS_LSN* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clfsw32 = windows.NewLazySystemDLL("clfsw32.dll")
	procLsnIncrement = clfsw32.NewProc("LsnIncrement")
)

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