ホーム › Storage.InstallableFileSystems › FilterInstanceClose
FilterInstanceClose
関数ミニフィルターインスタンスの通信ハンドルを閉じる。
シグネチャ
// FLTLIB.dll
#include <windows.h>
HRESULT FilterInstanceClose(
HFILTER_INSTANCE hInstance
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hInstance | HFILTER_INSTANCE | in | 閉じるフィルターインスタンスハンドル。FilterInstanceCreateで取得したもの。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// FLTLIB.dll
#include <windows.h>
HRESULT FilterInstanceClose(
HFILTER_INSTANCE hInstance
);[DllImport("FLTLIB.dll", ExactSpelling = true)]
static extern int FilterInstanceClose(
IntPtr hInstance // HFILTER_INSTANCE
);<DllImport("FLTLIB.dll", ExactSpelling:=True)>
Public Shared Function FilterInstanceClose(
hInstance As IntPtr ' HFILTER_INSTANCE
) As Integer
End Function' hInstance : HFILTER_INSTANCE
Declare PtrSafe Function FilterInstanceClose Lib "fltlib" ( _
ByVal hInstance As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FilterInstanceClose = ctypes.windll.fltlib.FilterInstanceClose
FilterInstanceClose.restype = ctypes.c_int
FilterInstanceClose.argtypes = [
ctypes.c_ssize_t, # hInstance : HFILTER_INSTANCE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('FLTLIB.dll')
FilterInstanceClose = Fiddle::Function.new(
lib['FilterInstanceClose'],
[
Fiddle::TYPE_INTPTR_T, # hInstance : HFILTER_INSTANCE
],
Fiddle::TYPE_INT)#[link(name = "fltlib")]
extern "system" {
fn FilterInstanceClose(
hInstance: isize // HFILTER_INSTANCE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("FLTLIB.dll")]
public static extern int FilterInstanceClose(IntPtr hInstance);
"@
$api = Add-Type -MemberDefinition $sig -Name 'FLTLIB_FilterInstanceClose' -Namespace Win32 -PassThru
# $api::FilterInstanceClose(hInstance)#uselib "FLTLIB.dll"
#func global FilterInstanceClose "FilterInstanceClose" sptr
; FilterInstanceClose hInstance ; 戻り値は stat
; hInstance : HFILTER_INSTANCE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "FLTLIB.dll"
#cfunc global FilterInstanceClose "FilterInstanceClose" sptr
; res = FilterInstanceClose(hInstance)
; hInstance : HFILTER_INSTANCE -> "sptr"; HRESULT FilterInstanceClose(HFILTER_INSTANCE hInstance)
#uselib "FLTLIB.dll"
#cfunc global FilterInstanceClose "FilterInstanceClose" intptr
; res = FilterInstanceClose(hInstance)
; hInstance : HFILTER_INSTANCE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
fltlib = windows.NewLazySystemDLL("FLTLIB.dll")
procFilterInstanceClose = fltlib.NewProc("FilterInstanceClose")
)
// hInstance (HFILTER_INSTANCE)
r1, _, err := procFilterInstanceClose.Call(
uintptr(hInstance),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction FilterInstanceClose(
hInstance: NativeInt // HFILTER_INSTANCE
): Integer; stdcall;
external 'FLTLIB.dll' name 'FilterInstanceClose';result := DllCall("FLTLIB\FilterInstanceClose"
, "Ptr", hInstance ; HFILTER_INSTANCE
, "Int") ; return: HRESULT●FilterInstanceClose(hInstance) = DLL("FLTLIB.dll", "int FilterInstanceClose(int)")
# 呼び出し: FilterInstanceClose(hInstance)
# hInstance : HFILTER_INSTANCE -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "fltlib" fn FilterInstanceClose(
hInstance: isize // HFILTER_INSTANCE
) callconv(std.os.windows.WINAPI) i32;proc FilterInstanceClose(
hInstance: int # HFILTER_INSTANCE
): int32 {.importc: "FilterInstanceClose", stdcall, dynlib: "FLTLIB.dll".}pragma(lib, "fltlib");
extern(Windows)
int FilterInstanceClose(
ptrdiff_t hInstance // HFILTER_INSTANCE
);ccall((:FilterInstanceClose, "FLTLIB.dll"), stdcall, Int32,
(Int,),
hInstance)
# hInstance : HFILTER_INSTANCE -> Int
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t FilterInstanceClose(
intptr_t hInstance);
]]
local fltlib = ffi.load("fltlib")
-- fltlib.FilterInstanceClose(hInstance)
-- hInstance : HFILTER_INSTANCE
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('FLTLIB.dll');
const FilterInstanceClose = lib.func('__stdcall', 'FilterInstanceClose', 'int32_t', ['intptr_t']);
// FilterInstanceClose(hInstance)
// hInstance : HFILTER_INSTANCE -> 'intptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("FLTLIB.dll", {
FilterInstanceClose: { parameters: ["isize"], result: "i32" },
});
// lib.symbols.FilterInstanceClose(hInstance)
// hInstance : HFILTER_INSTANCE -> "isize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t FilterInstanceClose(
intptr_t hInstance);
C, "FLTLIB.dll");
// $ffi->FilterInstanceClose(hInstance);
// hInstance : HFILTER_INSTANCE
// 構造体/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 Fltlib extends StdCallLibrary {
Fltlib INSTANCE = Native.load("fltlib", Fltlib.class);
int FilterInstanceClose(
long hInstance // HFILTER_INSTANCE
);
}@[Link("fltlib")]
lib LibFLTLIB
fun FilterInstanceClose = FilterInstanceClose(
hInstance : LibC::SSizeT # HFILTER_INSTANCE
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef FilterInstanceCloseNative = Int32 Function(IntPtr);
typedef FilterInstanceCloseDart = int Function(int);
final FilterInstanceClose = DynamicLibrary.open('FLTLIB.dll')
.lookupFunction<FilterInstanceCloseNative, FilterInstanceCloseDart>('FilterInstanceClose');
// hInstance : HFILTER_INSTANCE -> IntPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function FilterInstanceClose(
hInstance: NativeInt // HFILTER_INSTANCE
): Integer; stdcall;
external 'FLTLIB.dll' name 'FilterInstanceClose';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "FilterInstanceClose"
c_FilterInstanceClose :: CIntPtr -> IO Int32
-- hInstance : HFILTER_INSTANCE -> CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let filterinstanceclose =
foreign "FilterInstanceClose"
(intptr_t @-> returning int32_t)
(* hInstance : HFILTER_INSTANCE -> intptr_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library fltlib (t "FLTLIB.dll"))
(cffi:use-foreign-library fltlib)
(cffi:defcfun ("FilterInstanceClose" filter-instance-close :convention :stdcall) :int32
(h-instance :int64)) ; HFILTER_INSTANCE
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $FilterInstanceClose = Win32::API::More->new('FLTLIB',
'int FilterInstanceClose(LPARAM hInstance)');
# my $ret = $FilterInstanceClose->Call($hInstance);
# hInstance : HFILTER_INSTANCE -> LPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。