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

LsnRecordSequence

関数
ログシーケンス番号からレコードシーケンスを取得する。
DLLclfsw32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD LsnRecordSequence(
    const CLS_LSN* plsn
);

パラメーター

名前方向説明
plsnCLS_LSN*inレコードシーケンス番号の取得元となる CLFS_LSN 構造体へのポインターです。

戻り値の型: DWORD

公式ドキュメント

指定された LSN に含まれるレコードシーケンス番号を取得します。

戻り値

plsn に含まれるレコードシーケンス番号です。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

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

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

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

var (
	clfsw32 = windows.NewLazySystemDLL("clfsw32.dll")
	procLsnRecordSequence = clfsw32.NewProc("LsnRecordSequence")
)

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

extern "clfsw32" fn LsnRecordSequence(
    plsn: [*c]CLS_LSN // CLS_LSN*
) callconv(std.os.windows.WINAPI) u32;
proc LsnRecordSequence(
    plsn: ptr CLS_LSN  # CLS_LSN*
): uint32 {.importc: "LsnRecordSequence", stdcall, dynlib: "clfsw32.dll".}
pragma(lib, "clfsw32");
extern(Windows)
uint LsnRecordSequence(
    CLS_LSN* plsn   // CLS_LSN*
);
ccall((:LsnRecordSequence, "clfsw32.dll"), stdcall, UInt32,
      (Ptr{CLS_LSN},),
      plsn)
# plsn : CLS_LSN* -> Ptr{CLS_LSN}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t LsnRecordSequence(
    void* plsn);
]]
local clfsw32 = ffi.load("clfsw32")
-- clfsw32.LsnRecordSequence(plsn)
-- plsn : CLS_LSN*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('clfsw32.dll');
const LsnRecordSequence = lib.func('__stdcall', 'LsnRecordSequence', 'uint32_t', ['void *']);
// LsnRecordSequence(plsn)
// plsn : CLS_LSN* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("clfsw32.dll", {
  LsnRecordSequence: { parameters: ["pointer"], result: "u32" },
});
// lib.symbols.LsnRecordSequence(plsn)
// plsn : CLS_LSN* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t LsnRecordSequence(
    void* plsn);
C, "clfsw32.dll");
// $ffi->LsnRecordSequence(plsn);
// plsn : CLS_LSN*
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Clfsw32 extends StdCallLibrary {
    Clfsw32 INSTANCE = Native.load("clfsw32", Clfsw32.class);
    int LsnRecordSequence(
        Pointer plsn   // CLS_LSN*
    );
}
@[Link("clfsw32")]
lib Libclfsw32
  fun LsnRecordSequence = LsnRecordSequence(
    plsn : CLS_LSN*   # CLS_LSN*
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef LsnRecordSequenceNative = Uint32 Function(Pointer<Void>);
typedef LsnRecordSequenceDart = int Function(Pointer<Void>);
final LsnRecordSequence = DynamicLibrary.open('clfsw32.dll')
    .lookupFunction<LsnRecordSequenceNative, LsnRecordSequenceDart>('LsnRecordSequence');
// plsn : CLS_LSN* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function LsnRecordSequence(
  plsn: Pointer   // CLS_LSN*
): DWORD; stdcall;
  external 'clfsw32.dll' name 'LsnRecordSequence';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "LsnRecordSequence"
  c_LsnRecordSequence :: Ptr () -> IO Word32
-- plsn : CLS_LSN* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let lsnrecordsequence =
  foreign "LsnRecordSequence"
    ((ptr void) @-> returning uint32_t)
(* plsn : CLS_LSN* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library clfsw32 (t "clfsw32.dll"))
(cffi:use-foreign-library clfsw32)

(cffi:defcfun ("LsnRecordSequence" lsn-record-sequence :convention :stdcall) :uint32
  (plsn :pointer))   ; CLS_LSN*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $LsnRecordSequence = Win32::API::More->new('clfsw32',
    'DWORD LsnRecordSequence(LPVOID plsn)');
# my $ret = $LsnRecordSequence->Call($plsn);
# plsn : CLS_LSN* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

公式の関連項目
使用する型