ホーム › Storage.InstallableFileSystems › FilterAttachAtAltitude
FilterAttachAtAltitude
関数指定の高度でミニフィルターをボリュームにアタッチする。
シグネチャ
// FLTLIB.dll
#include <windows.h>
HRESULT FilterAttachAtAltitude(
LPCWSTR lpFilterName,
LPCWSTR lpVolumeName,
LPCWSTR lpAltitude,
LPCWSTR lpInstanceName, // optional
DWORD dwCreatedInstanceNameLength, // optional
LPWSTR lpCreatedInstanceName // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpFilterName | LPCWSTR | in |
| lpVolumeName | LPCWSTR | in |
| lpAltitude | LPCWSTR | in |
| lpInstanceName | LPCWSTR | inoptional |
| dwCreatedInstanceNameLength | DWORD | inoptional |
| lpCreatedInstanceName | LPWSTR | outoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// FLTLIB.dll
#include <windows.h>
HRESULT FilterAttachAtAltitude(
LPCWSTR lpFilterName,
LPCWSTR lpVolumeName,
LPCWSTR lpAltitude,
LPCWSTR lpInstanceName, // optional
DWORD dwCreatedInstanceNameLength, // optional
LPWSTR lpCreatedInstanceName // optional
);[DllImport("FLTLIB.dll", ExactSpelling = true)]
static extern int FilterAttachAtAltitude(
[MarshalAs(UnmanagedType.LPWStr)] string lpFilterName, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpVolumeName, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpAltitude, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpInstanceName, // LPCWSTR optional
uint dwCreatedInstanceNameLength, // DWORD optional
[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder lpCreatedInstanceName // LPWSTR optional, out
);<DllImport("FLTLIB.dll", ExactSpelling:=True)>
Public Shared Function FilterAttachAtAltitude(
<MarshalAs(UnmanagedType.LPWStr)> lpFilterName As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpVolumeName As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpAltitude As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpInstanceName As String, ' LPCWSTR optional
dwCreatedInstanceNameLength As UInteger, ' DWORD optional
<MarshalAs(UnmanagedType.LPWStr)> lpCreatedInstanceName As System.Text.StringBuilder ' LPWSTR optional, out
) As Integer
End Function' lpFilterName : LPCWSTR
' lpVolumeName : LPCWSTR
' lpAltitude : LPCWSTR
' lpInstanceName : LPCWSTR optional
' dwCreatedInstanceNameLength : DWORD optional
' lpCreatedInstanceName : LPWSTR optional, out
Declare PtrSafe Function FilterAttachAtAltitude Lib "fltlib" ( _
ByVal lpFilterName As LongPtr, _
ByVal lpVolumeName As LongPtr, _
ByVal lpAltitude As LongPtr, _
ByVal lpInstanceName As LongPtr, _
ByVal dwCreatedInstanceNameLength As Long, _
ByVal lpCreatedInstanceName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FilterAttachAtAltitude = ctypes.windll.fltlib.FilterAttachAtAltitude
FilterAttachAtAltitude.restype = ctypes.c_int
FilterAttachAtAltitude.argtypes = [
wintypes.LPCWSTR, # lpFilterName : LPCWSTR
wintypes.LPCWSTR, # lpVolumeName : LPCWSTR
wintypes.LPCWSTR, # lpAltitude : LPCWSTR
wintypes.LPCWSTR, # lpInstanceName : LPCWSTR optional
wintypes.DWORD, # dwCreatedInstanceNameLength : DWORD optional
wintypes.LPWSTR, # lpCreatedInstanceName : LPWSTR optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('FLTLIB.dll')
FilterAttachAtAltitude = Fiddle::Function.new(
lib['FilterAttachAtAltitude'],
[
Fiddle::TYPE_VOIDP, # lpFilterName : LPCWSTR
Fiddle::TYPE_VOIDP, # lpVolumeName : LPCWSTR
Fiddle::TYPE_VOIDP, # lpAltitude : LPCWSTR
Fiddle::TYPE_VOIDP, # lpInstanceName : LPCWSTR optional
-Fiddle::TYPE_INT, # dwCreatedInstanceNameLength : DWORD optional
Fiddle::TYPE_VOIDP, # lpCreatedInstanceName : LPWSTR optional, out
],
Fiddle::TYPE_INT)#[link(name = "fltlib")]
extern "system" {
fn FilterAttachAtAltitude(
lpFilterName: *const u16, // LPCWSTR
lpVolumeName: *const u16, // LPCWSTR
lpAltitude: *const u16, // LPCWSTR
lpInstanceName: *const u16, // LPCWSTR optional
dwCreatedInstanceNameLength: u32, // DWORD optional
lpCreatedInstanceName: *mut u16 // LPWSTR optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("FLTLIB.dll")]
public static extern int FilterAttachAtAltitude([MarshalAs(UnmanagedType.LPWStr)] string lpFilterName, [MarshalAs(UnmanagedType.LPWStr)] string lpVolumeName, [MarshalAs(UnmanagedType.LPWStr)] string lpAltitude, [MarshalAs(UnmanagedType.LPWStr)] string lpInstanceName, uint dwCreatedInstanceNameLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder lpCreatedInstanceName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'FLTLIB_FilterAttachAtAltitude' -Namespace Win32 -PassThru
# $api::FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)#uselib "FLTLIB.dll"
#func global FilterAttachAtAltitude "FilterAttachAtAltitude" sptr, sptr, sptr, sptr, sptr, sptr
; FilterAttachAtAltitude lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, varptr(lpCreatedInstanceName) ; 戻り値は stat
; lpFilterName : LPCWSTR -> "sptr"
; lpVolumeName : LPCWSTR -> "sptr"
; lpAltitude : LPCWSTR -> "sptr"
; lpInstanceName : LPCWSTR optional -> "sptr"
; dwCreatedInstanceNameLength : DWORD optional -> "sptr"
; lpCreatedInstanceName : LPWSTR optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "FLTLIB.dll" #cfunc global FilterAttachAtAltitude "FilterAttachAtAltitude" wstr, wstr, wstr, wstr, int, var ; res = FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName) ; lpFilterName : LPCWSTR -> "wstr" ; lpVolumeName : LPCWSTR -> "wstr" ; lpAltitude : LPCWSTR -> "wstr" ; lpInstanceName : LPCWSTR optional -> "wstr" ; dwCreatedInstanceNameLength : DWORD optional -> "int" ; lpCreatedInstanceName : LPWSTR optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "FLTLIB.dll" #cfunc global FilterAttachAtAltitude "FilterAttachAtAltitude" wstr, wstr, wstr, wstr, int, sptr ; res = FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, varptr(lpCreatedInstanceName)) ; lpFilterName : LPCWSTR -> "wstr" ; lpVolumeName : LPCWSTR -> "wstr" ; lpAltitude : LPCWSTR -> "wstr" ; lpInstanceName : LPCWSTR optional -> "wstr" ; dwCreatedInstanceNameLength : DWORD optional -> "int" ; lpCreatedInstanceName : LPWSTR optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT FilterAttachAtAltitude(LPCWSTR lpFilterName, LPCWSTR lpVolumeName, LPCWSTR lpAltitude, LPCWSTR lpInstanceName, DWORD dwCreatedInstanceNameLength, LPWSTR lpCreatedInstanceName) #uselib "FLTLIB.dll" #cfunc global FilterAttachAtAltitude "FilterAttachAtAltitude" wstr, wstr, wstr, wstr, int, var ; res = FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName) ; lpFilterName : LPCWSTR -> "wstr" ; lpVolumeName : LPCWSTR -> "wstr" ; lpAltitude : LPCWSTR -> "wstr" ; lpInstanceName : LPCWSTR optional -> "wstr" ; dwCreatedInstanceNameLength : DWORD optional -> "int" ; lpCreatedInstanceName : LPWSTR optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT FilterAttachAtAltitude(LPCWSTR lpFilterName, LPCWSTR lpVolumeName, LPCWSTR lpAltitude, LPCWSTR lpInstanceName, DWORD dwCreatedInstanceNameLength, LPWSTR lpCreatedInstanceName) #uselib "FLTLIB.dll" #cfunc global FilterAttachAtAltitude "FilterAttachAtAltitude" wstr, wstr, wstr, wstr, int, intptr ; res = FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, varptr(lpCreatedInstanceName)) ; lpFilterName : LPCWSTR -> "wstr" ; lpVolumeName : LPCWSTR -> "wstr" ; lpAltitude : LPCWSTR -> "wstr" ; lpInstanceName : LPCWSTR optional -> "wstr" ; dwCreatedInstanceNameLength : DWORD optional -> "int" ; lpCreatedInstanceName : LPWSTR optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
fltlib = windows.NewLazySystemDLL("FLTLIB.dll")
procFilterAttachAtAltitude = fltlib.NewProc("FilterAttachAtAltitude")
)
// lpFilterName (LPCWSTR), lpVolumeName (LPCWSTR), lpAltitude (LPCWSTR), lpInstanceName (LPCWSTR optional), dwCreatedInstanceNameLength (DWORD optional), lpCreatedInstanceName (LPWSTR optional, out)
r1, _, err := procFilterAttachAtAltitude.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpFilterName))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpVolumeName))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpAltitude))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpInstanceName))),
uintptr(dwCreatedInstanceNameLength),
uintptr(lpCreatedInstanceName),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction FilterAttachAtAltitude(
lpFilterName: PWideChar; // LPCWSTR
lpVolumeName: PWideChar; // LPCWSTR
lpAltitude: PWideChar; // LPCWSTR
lpInstanceName: PWideChar; // LPCWSTR optional
dwCreatedInstanceNameLength: DWORD; // DWORD optional
lpCreatedInstanceName: PWideChar // LPWSTR optional, out
): Integer; stdcall;
external 'FLTLIB.dll' name 'FilterAttachAtAltitude';result := DllCall("FLTLIB\FilterAttachAtAltitude"
, "WStr", lpFilterName ; LPCWSTR
, "WStr", lpVolumeName ; LPCWSTR
, "WStr", lpAltitude ; LPCWSTR
, "WStr", lpInstanceName ; LPCWSTR optional
, "UInt", dwCreatedInstanceNameLength ; DWORD optional
, "Ptr", lpCreatedInstanceName ; LPWSTR optional, out
, "Int") ; return: HRESULT●FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName) = DLL("FLTLIB.dll", "int FilterAttachAtAltitude(char*, char*, char*, char*, dword, char*)")
# 呼び出し: FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)
# lpFilterName : LPCWSTR -> "char*"
# lpVolumeName : LPCWSTR -> "char*"
# lpAltitude : LPCWSTR -> "char*"
# lpInstanceName : LPCWSTR optional -> "char*"
# dwCreatedInstanceNameLength : DWORD optional -> "dword"
# lpCreatedInstanceName : LPWSTR optional, out -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。