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

FilterGetInformation

関数
指定したファイルシステムフィルターの情報を取得する。
DLLFLTLIB.dll呼出規約winapi

シグネチャ

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

HRESULT FilterGetInformation(
    HFILTER hFilter,
    FILTER_INFORMATION_CLASS dwInformationClass,
    void* lpBuffer,
    DWORD dwBufferSize,
    DWORD* lpBytesReturned
);

パラメーター

名前方向
hFilterHFILTERin
dwInformationClassFILTER_INFORMATION_CLASSin
lpBuffervoid*out
dwBufferSizeDWORDin
lpBytesReturnedDWORD*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT FilterGetInformation(
    HFILTER hFilter,
    FILTER_INFORMATION_CLASS dwInformationClass,
    void* lpBuffer,
    DWORD dwBufferSize,
    DWORD* lpBytesReturned
);
[DllImport("FLTLIB.dll", ExactSpelling = true)]
static extern int FilterGetInformation(
    IntPtr hFilter,   // HFILTER
    int dwInformationClass,   // FILTER_INFORMATION_CLASS
    IntPtr lpBuffer,   // void* out
    uint dwBufferSize,   // DWORD
    out uint lpBytesReturned   // DWORD* out
);
<DllImport("FLTLIB.dll", ExactSpelling:=True)>
Public Shared Function FilterGetInformation(
    hFilter As IntPtr,   ' HFILTER
    dwInformationClass As Integer,   ' FILTER_INFORMATION_CLASS
    lpBuffer As IntPtr,   ' void* out
    dwBufferSize As UInteger,   ' DWORD
    <Out> ByRef lpBytesReturned As UInteger   ' DWORD* out
) As Integer
End Function
' hFilter : HFILTER
' dwInformationClass : FILTER_INFORMATION_CLASS
' lpBuffer : void* out
' dwBufferSize : DWORD
' lpBytesReturned : DWORD* out
Declare PtrSafe Function FilterGetInformation Lib "fltlib" ( _
    ByVal hFilter As LongPtr, _
    ByVal dwInformationClass As Long, _
    ByVal lpBuffer As LongPtr, _
    ByVal dwBufferSize As Long, _
    ByRef lpBytesReturned As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FilterGetInformation = ctypes.windll.fltlib.FilterGetInformation
FilterGetInformation.restype = ctypes.c_int
FilterGetInformation.argtypes = [
    ctypes.c_ssize_t,  # hFilter : HFILTER
    ctypes.c_int,  # dwInformationClass : FILTER_INFORMATION_CLASS
    ctypes.POINTER(None),  # lpBuffer : void* out
    wintypes.DWORD,  # dwBufferSize : DWORD
    ctypes.POINTER(wintypes.DWORD),  # lpBytesReturned : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	fltlib = windows.NewLazySystemDLL("FLTLIB.dll")
	procFilterGetInformation = fltlib.NewProc("FilterGetInformation")
)

// hFilter (HFILTER), dwInformationClass (FILTER_INFORMATION_CLASS), lpBuffer (void* out), dwBufferSize (DWORD), lpBytesReturned (DWORD* out)
r1, _, err := procFilterGetInformation.Call(
	uintptr(hFilter),
	uintptr(dwInformationClass),
	uintptr(lpBuffer),
	uintptr(dwBufferSize),
	uintptr(lpBytesReturned),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function FilterGetInformation(
  hFilter: NativeInt;   // HFILTER
  dwInformationClass: Integer;   // FILTER_INFORMATION_CLASS
  lpBuffer: Pointer;   // void* out
  dwBufferSize: DWORD;   // DWORD
  lpBytesReturned: Pointer   // DWORD* out
): Integer; stdcall;
  external 'FLTLIB.dll' name 'FilterGetInformation';
result := DllCall("FLTLIB\FilterGetInformation"
    , "Ptr", hFilter   ; HFILTER
    , "Int", dwInformationClass   ; FILTER_INFORMATION_CLASS
    , "Ptr", lpBuffer   ; void* out
    , "UInt", dwBufferSize   ; DWORD
    , "Ptr", lpBytesReturned   ; DWORD* out
    , "Int")   ; return: HRESULT
●FilterGetInformation(hFilter, dwInformationClass, lpBuffer, dwBufferSize, lpBytesReturned) = DLL("FLTLIB.dll", "int FilterGetInformation(int, int, void*, dword, void*)")
# 呼び出し: FilterGetInformation(hFilter, dwInformationClass, lpBuffer, dwBufferSize, lpBytesReturned)
# hFilter : HFILTER -> "int"
# dwInformationClass : FILTER_INFORMATION_CLASS -> "int"
# lpBuffer : void* out -> "void*"
# dwBufferSize : DWORD -> "dword"
# lpBytesReturned : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。