ホーム › System.HostComputeSystem › HcsDestroyLayer
HcsDestroyLayer
関数コンテナイメージのレイヤーを破棄する。
シグネチャ
// computestorage.dll
#include <windows.h>
HRESULT HcsDestroyLayer(
LPCWSTR layerPath
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| layerPath | LPCWSTR | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// computestorage.dll
#include <windows.h>
HRESULT HcsDestroyLayer(
LPCWSTR layerPath
);[DllImport("computestorage.dll", ExactSpelling = true)]
static extern int HcsDestroyLayer(
[MarshalAs(UnmanagedType.LPWStr)] string layerPath // LPCWSTR
);<DllImport("computestorage.dll", ExactSpelling:=True)>
Public Shared Function HcsDestroyLayer(
<MarshalAs(UnmanagedType.LPWStr)> layerPath As String ' LPCWSTR
) As Integer
End Function' layerPath : LPCWSTR
Declare PtrSafe Function HcsDestroyLayer 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
HcsDestroyLayer = ctypes.windll.computestorage.HcsDestroyLayer
HcsDestroyLayer.restype = ctypes.c_int
HcsDestroyLayer.argtypes = [
wintypes.LPCWSTR, # layerPath : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('computestorage.dll')
HcsDestroyLayer = Fiddle::Function.new(
lib['HcsDestroyLayer'],
[
Fiddle::TYPE_VOIDP, # layerPath : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "computestorage")]
extern "system" {
fn HcsDestroyLayer(
layerPath: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("computestorage.dll")]
public static extern int HcsDestroyLayer([MarshalAs(UnmanagedType.LPWStr)] string layerPath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'computestorage_HcsDestroyLayer' -Namespace Win32 -PassThru
# $api::HcsDestroyLayer(layerPath)#uselib "computestorage.dll"
#func global HcsDestroyLayer "HcsDestroyLayer" sptr
; HcsDestroyLayer layerPath ; 戻り値は stat
; layerPath : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "computestorage.dll"
#cfunc global HcsDestroyLayer "HcsDestroyLayer" wstr
; res = HcsDestroyLayer(layerPath)
; layerPath : LPCWSTR -> "wstr"; HRESULT HcsDestroyLayer(LPCWSTR layerPath)
#uselib "computestorage.dll"
#cfunc global HcsDestroyLayer "HcsDestroyLayer" wstr
; res = HcsDestroyLayer(layerPath)
; layerPath : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
computestorage = windows.NewLazySystemDLL("computestorage.dll")
procHcsDestroyLayer = computestorage.NewProc("HcsDestroyLayer")
)
// layerPath (LPCWSTR)
r1, _, err := procHcsDestroyLayer.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(layerPath))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction HcsDestroyLayer(
layerPath: PWideChar // LPCWSTR
): Integer; stdcall;
external 'computestorage.dll' name 'HcsDestroyLayer';result := DllCall("computestorage\HcsDestroyLayer"
, "WStr", layerPath ; LPCWSTR
, "Int") ; return: HRESULT●HcsDestroyLayer(layerPath) = DLL("computestorage.dll", "int HcsDestroyLayer(char*)")
# 呼び出し: HcsDestroyLayer(layerPath)
# layerPath : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。