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

FilterUnload

関数
指定したミニフィルタードライバーをアンロードする。
DLLFLTLIB.dll呼出規約winapi

シグネチャ

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

HRESULT FilterUnload(
    LPCWSTR lpFilterName
);

パラメーター

名前方向
lpFilterNameLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT FilterUnload(
    LPCWSTR lpFilterName
);
[DllImport("FLTLIB.dll", ExactSpelling = true)]
static extern int FilterUnload(
    [MarshalAs(UnmanagedType.LPWStr)] string lpFilterName   // LPCWSTR
);
<DllImport("FLTLIB.dll", ExactSpelling:=True)>
Public Shared Function FilterUnload(
    <MarshalAs(UnmanagedType.LPWStr)> lpFilterName As String   ' LPCWSTR
) As Integer
End Function
' lpFilterName : LPCWSTR
Declare PtrSafe Function FilterUnload Lib "fltlib" ( _
    ByVal lpFilterName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FilterUnload = ctypes.windll.fltlib.FilterUnload
FilterUnload.restype = ctypes.c_int
FilterUnload.argtypes = [
    wintypes.LPCWSTR,  # lpFilterName : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('FLTLIB.dll')
FilterUnload = Fiddle::Function.new(
  lib['FilterUnload'],
  [
    Fiddle::TYPE_VOIDP,  # lpFilterName : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "fltlib")]
extern "system" {
    fn FilterUnload(
        lpFilterName: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("FLTLIB.dll")]
public static extern int FilterUnload([MarshalAs(UnmanagedType.LPWStr)] string lpFilterName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'FLTLIB_FilterUnload' -Namespace Win32 -PassThru
# $api::FilterUnload(lpFilterName)
#uselib "FLTLIB.dll"
#func global FilterUnload "FilterUnload" sptr
; FilterUnload lpFilterName   ; 戻り値は stat
; lpFilterName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "FLTLIB.dll"
#cfunc global FilterUnload "FilterUnload" wstr
; res = FilterUnload(lpFilterName)
; lpFilterName : LPCWSTR -> "wstr"
; HRESULT FilterUnload(LPCWSTR lpFilterName)
#uselib "FLTLIB.dll"
#cfunc global FilterUnload "FilterUnload" wstr
; res = FilterUnload(lpFilterName)
; lpFilterName : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	fltlib = windows.NewLazySystemDLL("FLTLIB.dll")
	procFilterUnload = fltlib.NewProc("FilterUnload")
)

// lpFilterName (LPCWSTR)
r1, _, err := procFilterUnload.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpFilterName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function FilterUnload(
  lpFilterName: PWideChar   // LPCWSTR
): Integer; stdcall;
  external 'FLTLIB.dll' name 'FilterUnload';
result := DllCall("FLTLIB\FilterUnload"
    , "WStr", lpFilterName   ; LPCWSTR
    , "Int")   ; return: HRESULT
●FilterUnload(lpFilterName) = DLL("FLTLIB.dll", "int FilterUnload(char*)")
# 呼び出し: FilterUnload(lpFilterName)
# lpFilterName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。