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

FilterAttachAtAltitude

関数
指定の高度でミニフィルターをボリュームにアタッチする。
DLLFLTLIB.dll呼出規約winapi

シグネチャ

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

HRESULT FilterAttachAtAltitude(
    LPCWSTR lpFilterName,
    LPCWSTR lpVolumeName,
    LPCWSTR lpAltitude,
    LPCWSTR lpInstanceName,   // optional
    DWORD dwCreatedInstanceNameLength,   // optional
    LPWSTR lpCreatedInstanceName   // optional
);

パラメーター

名前方向説明
lpFilterNameLPCWSTRinアタッチするミニフィルターのサービス名を指す。
lpVolumeNameLPCWSTRinアタッチ先のボリューム名を指す。
lpAltitudeLPCWSTRinアタッチ位置を示す高度(アルティチュード)文字列を指す。
lpInstanceNameLPCWSTRinoptional作成するインスタンスの名前を指す。NULL可。
dwCreatedInstanceNameLengthDWORDinoptionallpCreatedInstanceNameバッファの長さを文字数で指定する。
lpCreatedInstanceNameLPWSTRoutoptional生成されたインスタンス名を受け取るバッファを指す。NULL可。

戻り値の型: 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 方式にも切替可。
出力引数:
; 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 方式にも切替可。
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   // HRESULT
function 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)。
const std = @import("std");

extern "fltlib" fn FilterAttachAtAltitude(
    lpFilterName: [*c]const u16, // LPCWSTR
    lpVolumeName: [*c]const u16, // LPCWSTR
    lpAltitude: [*c]const u16, // LPCWSTR
    lpInstanceName: [*c]const u16, // LPCWSTR optional
    dwCreatedInstanceNameLength: u32, // DWORD optional
    lpCreatedInstanceName: [*c]u16 // LPWSTR optional, out
) callconv(std.os.windows.WINAPI) i32;
proc FilterAttachAtAltitude(
    lpFilterName: WideCString,  # LPCWSTR
    lpVolumeName: WideCString,  # LPCWSTR
    lpAltitude: WideCString,  # LPCWSTR
    lpInstanceName: WideCString,  # LPCWSTR optional
    dwCreatedInstanceNameLength: uint32,  # DWORD optional
    lpCreatedInstanceName: ptr uint16  # LPWSTR optional, out
): int32 {.importc: "FilterAttachAtAltitude", stdcall, dynlib: "FLTLIB.dll".}
pragma(lib, "fltlib");
extern(Windows)
int FilterAttachAtAltitude(
    const(wchar)* lpFilterName,   // LPCWSTR
    const(wchar)* lpVolumeName,   // LPCWSTR
    const(wchar)* lpAltitude,   // LPCWSTR
    const(wchar)* lpInstanceName,   // LPCWSTR optional
    uint dwCreatedInstanceNameLength,   // DWORD optional
    wchar* lpCreatedInstanceName   // LPWSTR optional, out
);
ccall((:FilterAttachAtAltitude, "FLTLIB.dll"), stdcall, Int32,
      (Cwstring, Cwstring, Cwstring, Cwstring, UInt32, Ptr{UInt16}),
      lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)
# lpFilterName : LPCWSTR -> Cwstring
# lpVolumeName : LPCWSTR -> Cwstring
# lpAltitude : LPCWSTR -> Cwstring
# lpInstanceName : LPCWSTR optional -> Cwstring
# dwCreatedInstanceNameLength : DWORD optional -> UInt32
# lpCreatedInstanceName : LPWSTR optional, out -> Ptr{UInt16}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t FilterAttachAtAltitude(
    const uint16_t* lpFilterName,
    const uint16_t* lpVolumeName,
    const uint16_t* lpAltitude,
    const uint16_t* lpInstanceName,
    uint32_t dwCreatedInstanceNameLength,
    uint16_t* lpCreatedInstanceName);
]]
local fltlib = ffi.load("fltlib")
-- fltlib.FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)
-- lpFilterName : LPCWSTR
-- lpVolumeName : LPCWSTR
-- lpAltitude : LPCWSTR
-- lpInstanceName : LPCWSTR optional
-- dwCreatedInstanceNameLength : DWORD optional
-- lpCreatedInstanceName : LPWSTR optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('FLTLIB.dll');
const FilterAttachAtAltitude = lib.func('__stdcall', 'FilterAttachAtAltitude', 'int32_t', ['str16', 'str16', 'str16', 'str16', 'uint32_t', 'uint16_t *']);
// FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)
// lpFilterName : LPCWSTR -> 'str16'
// lpVolumeName : LPCWSTR -> 'str16'
// lpAltitude : LPCWSTR -> 'str16'
// lpInstanceName : LPCWSTR optional -> 'str16'
// dwCreatedInstanceNameLength : DWORD optional -> 'uint32_t'
// lpCreatedInstanceName : LPWSTR optional, out -> 'uint16_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("FLTLIB.dll", {
  FilterAttachAtAltitude: { parameters: ["buffer", "buffer", "buffer", "buffer", "u32", "buffer"], result: "i32" },
});
// lib.symbols.FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName)
// lpFilterName : LPCWSTR -> "buffer"
// lpVolumeName : LPCWSTR -> "buffer"
// lpAltitude : LPCWSTR -> "buffer"
// lpInstanceName : LPCWSTR optional -> "buffer"
// dwCreatedInstanceNameLength : DWORD optional -> "u32"
// lpCreatedInstanceName : LPWSTR optional, out -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t FilterAttachAtAltitude(
    const uint16_t* lpFilterName,
    const uint16_t* lpVolumeName,
    const uint16_t* lpAltitude,
    const uint16_t* lpInstanceName,
    uint32_t dwCreatedInstanceNameLength,
    uint16_t* lpCreatedInstanceName);
C, "FLTLIB.dll");
// $ffi->FilterAttachAtAltitude(lpFilterName, lpVolumeName, lpAltitude, lpInstanceName, dwCreatedInstanceNameLength, lpCreatedInstanceName);
// lpFilterName : LPCWSTR
// lpVolumeName : LPCWSTR
// lpAltitude : LPCWSTR
// lpInstanceName : LPCWSTR optional
// dwCreatedInstanceNameLength : DWORD optional
// lpCreatedInstanceName : LPWSTR optional, out
// 構造体/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 FilterAttachAtAltitude(
        WString lpFilterName,   // LPCWSTR
        WString lpVolumeName,   // LPCWSTR
        WString lpAltitude,   // LPCWSTR
        WString lpInstanceName,   // LPCWSTR optional
        int dwCreatedInstanceNameLength,   // DWORD optional
        char[] lpCreatedInstanceName   // LPWSTR optional, out
    );
}
@[Link("fltlib")]
lib LibFLTLIB
  fun FilterAttachAtAltitude = FilterAttachAtAltitude(
    lpFilterName : UInt16*,   # LPCWSTR
    lpVolumeName : UInt16*,   # LPCWSTR
    lpAltitude : UInt16*,   # LPCWSTR
    lpInstanceName : UInt16*,   # LPCWSTR optional
    dwCreatedInstanceNameLength : UInt32,   # DWORD optional
    lpCreatedInstanceName : UInt16*   # LPWSTR optional, out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef FilterAttachAtAltitudeNative = Int32 Function(Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, Uint32, Pointer<Utf16>);
typedef FilterAttachAtAltitudeDart = int Function(Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, int, Pointer<Utf16>);
final FilterAttachAtAltitude = DynamicLibrary.open('FLTLIB.dll')
    .lookupFunction<FilterAttachAtAltitudeNative, FilterAttachAtAltitudeDart>('FilterAttachAtAltitude');
// lpFilterName : LPCWSTR -> Pointer<Utf16>
// lpVolumeName : LPCWSTR -> Pointer<Utf16>
// lpAltitude : LPCWSTR -> Pointer<Utf16>
// lpInstanceName : LPCWSTR optional -> Pointer<Utf16>
// dwCreatedInstanceNameLength : DWORD optional -> Uint32
// lpCreatedInstanceName : LPWSTR optional, out -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function 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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "FilterAttachAtAltitude"
  c_FilterAttachAtAltitude :: CWString -> CWString -> CWString -> CWString -> Word32 -> CWString -> IO Int32
-- lpFilterName : LPCWSTR -> CWString
-- lpVolumeName : LPCWSTR -> CWString
-- lpAltitude : LPCWSTR -> CWString
-- lpInstanceName : LPCWSTR optional -> CWString
-- dwCreatedInstanceNameLength : DWORD optional -> Word32
-- lpCreatedInstanceName : LPWSTR optional, out -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let filterattachataltitude =
  foreign "FilterAttachAtAltitude"
    ((ptr uint16_t) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> uint32_t @-> (ptr uint16_t) @-> returning int32_t)
(* lpFilterName : LPCWSTR -> (ptr uint16_t) *)
(* lpVolumeName : LPCWSTR -> (ptr uint16_t) *)
(* lpAltitude : LPCWSTR -> (ptr uint16_t) *)
(* lpInstanceName : LPCWSTR optional -> (ptr uint16_t) *)
(* dwCreatedInstanceNameLength : DWORD optional -> uint32_t *)
(* lpCreatedInstanceName : LPWSTR optional, out -> (ptr uint16_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library fltlib (t "FLTLIB.dll"))
(cffi:use-foreign-library fltlib)

(cffi:defcfun ("FilterAttachAtAltitude" filter-attach-at-altitude :convention :stdcall) :int32
  (lp-filter-name (:string :encoding :utf-16le))   ; LPCWSTR
  (lp-volume-name (:string :encoding :utf-16le))   ; LPCWSTR
  (lp-altitude (:string :encoding :utf-16le))   ; LPCWSTR
  (lp-instance-name (:string :encoding :utf-16le))   ; LPCWSTR optional
  (dw-created-instance-name-length :uint32)   ; DWORD optional
  (lp-created-instance-name :pointer))   ; LPWSTR optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $FilterAttachAtAltitude = Win32::API::More->new('FLTLIB',
    'int FilterAttachAtAltitude(LPCWSTR lpFilterName, LPCWSTR lpVolumeName, LPCWSTR lpAltitude, LPCWSTR lpInstanceName, DWORD dwCreatedInstanceNameLength, LPWSTR lpCreatedInstanceName)');
# my $ret = $FilterAttachAtAltitude->Call($lpFilterName, $lpVolumeName, $lpAltitude, $lpInstanceName, $dwCreatedInstanceNameLength, $lpCreatedInstanceName);
# lpFilterName : LPCWSTR -> LPCWSTR
# lpVolumeName : LPCWSTR -> LPCWSTR
# lpAltitude : LPCWSTR -> LPCWSTR
# lpInstanceName : LPCWSTR optional -> LPCWSTR
# dwCreatedInstanceNameLength : DWORD optional -> DWORD
# lpCreatedInstanceName : LPWSTR optional, out -> LPWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。