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