Win32 API 日本語リファレンス
ホームSystem.HostComputeSystem › HcsDetachLayerStorageFilter

HcsDetachLayerStorageFilter

関数
レイヤーからストレージフィルターをデタッチする。
DLLcomputestorage.dll呼出規約winapi

シグネチャ

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

HRESULT HcsDetachLayerStorageFilter(
    LPCWSTR layerPath
);

パラメーター

名前方向
layerPathLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HcsDetachLayerStorageFilter = ctypes.windll.computestorage.HcsDetachLayerStorageFilter
HcsDetachLayerStorageFilter.restype = ctypes.c_int
HcsDetachLayerStorageFilter.argtypes = [
    wintypes.LPCWSTR,  # layerPath : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	computestorage = windows.NewLazySystemDLL("computestorage.dll")
	procHcsDetachLayerStorageFilter = computestorage.NewProc("HcsDetachLayerStorageFilter")
)

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