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

ReadLogNotification

関数
CLFSログ管理通知を読み取る。
DLLclfsw32.dll呼出規約winapiSetLastErrorあり対応OSWindows Vista 以降

シグネチャ

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

BOOL ReadLogNotification(
    HANDLE hLog,
    CLFS_MGMT_NOTIFICATION* pNotification,
    OVERLAPPED* lpOverlapped
);

パラメーター

名前方向
hLogHANDLEin
pNotificationCLFS_MGMT_NOTIFICATION*inout
lpOverlappedOVERLAPPED*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL ReadLogNotification(
    HANDLE hLog,
    CLFS_MGMT_NOTIFICATION* pNotification,
    OVERLAPPED* lpOverlapped
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("clfsw32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool ReadLogNotification(
    IntPtr hLog,   // HANDLE
    IntPtr pNotification,   // CLFS_MGMT_NOTIFICATION* in/out
    IntPtr lpOverlapped   // OVERLAPPED* in/out
);
<DllImport("clfsw32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function ReadLogNotification(
    hLog As IntPtr,   ' HANDLE
    pNotification As IntPtr,   ' CLFS_MGMT_NOTIFICATION* in/out
    lpOverlapped As IntPtr   ' OVERLAPPED* in/out
) As Boolean
End Function
' hLog : HANDLE
' pNotification : CLFS_MGMT_NOTIFICATION* in/out
' lpOverlapped : OVERLAPPED* in/out
Declare PtrSafe Function ReadLogNotification Lib "clfsw32" ( _
    ByVal hLog As LongPtr, _
    ByVal pNotification As LongPtr, _
    ByVal lpOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ReadLogNotification = ctypes.windll.clfsw32.ReadLogNotification
ReadLogNotification.restype = wintypes.BOOL
ReadLogNotification.argtypes = [
    wintypes.HANDLE,  # hLog : HANDLE
    ctypes.c_void_p,  # pNotification : CLFS_MGMT_NOTIFICATION* in/out
    ctypes.c_void_p,  # lpOverlapped : OVERLAPPED* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('clfsw32.dll')
ReadLogNotification = Fiddle::Function.new(
  lib['ReadLogNotification'],
  [
    Fiddle::TYPE_VOIDP,  # hLog : HANDLE
    Fiddle::TYPE_VOIDP,  # pNotification : CLFS_MGMT_NOTIFICATION* in/out
    Fiddle::TYPE_VOIDP,  # lpOverlapped : OVERLAPPED* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "clfsw32")]
extern "system" {
    fn ReadLogNotification(
        hLog: *mut core::ffi::c_void,  // HANDLE
        pNotification: *mut CLFS_MGMT_NOTIFICATION,  // CLFS_MGMT_NOTIFICATION* in/out
        lpOverlapped: *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 ReadLogNotification(IntPtr hLog, IntPtr pNotification, IntPtr lpOverlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'clfsw32_ReadLogNotification' -Namespace Win32 -PassThru
# $api::ReadLogNotification(hLog, pNotification, lpOverlapped)
#uselib "clfsw32.dll"
#func global ReadLogNotification "ReadLogNotification" sptr, sptr, sptr
; ReadLogNotification hLog, varptr(pNotification), varptr(lpOverlapped)   ; 戻り値は stat
; hLog : HANDLE -> "sptr"
; pNotification : CLFS_MGMT_NOTIFICATION* in/out -> "sptr"
; lpOverlapped : OVERLAPPED* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "clfsw32.dll"
#cfunc global ReadLogNotification "ReadLogNotification" sptr, var, var
; res = ReadLogNotification(hLog, pNotification, lpOverlapped)
; hLog : HANDLE -> "sptr"
; pNotification : CLFS_MGMT_NOTIFICATION* in/out -> "var"
; lpOverlapped : OVERLAPPED* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL ReadLogNotification(HANDLE hLog, CLFS_MGMT_NOTIFICATION* pNotification, OVERLAPPED* lpOverlapped)
#uselib "clfsw32.dll"
#cfunc global ReadLogNotification "ReadLogNotification" intptr, var, var
; res = ReadLogNotification(hLog, pNotification, lpOverlapped)
; hLog : HANDLE -> "intptr"
; pNotification : CLFS_MGMT_NOTIFICATION* in/out -> "var"
; lpOverlapped : OVERLAPPED* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clfsw32 = windows.NewLazySystemDLL("clfsw32.dll")
	procReadLogNotification = clfsw32.NewProc("ReadLogNotification")
)

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