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

DeleteEnclave

関数
指定したアドレスのエンクレーブを削除し解放する。
DLLapi-ms-win-core-enclave-l1-1-1.dll呼出規約winapiSetLastErrorあり対応OSWindows 10 以降

シグネチャ

// api-ms-win-core-enclave-l1-1-1.dll
#include <windows.h>

BOOL DeleteEnclave(
    void* lpAddress
);

パラメーター

名前方向説明
lpAddressvoid*in削除して仮想アドレス空間を解放する対象エンクレーブの基底アドレス。

戻り値の型: BOOL

各言語での呼び出し定義

// api-ms-win-core-enclave-l1-1-1.dll
#include <windows.h>

BOOL DeleteEnclave(
    void* lpAddress
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-enclave-l1-1-1.dll", SetLastError = true, ExactSpelling = true)]
static extern bool DeleteEnclave(
    IntPtr lpAddress   // void*
);
<DllImport("api-ms-win-core-enclave-l1-1-1.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function DeleteEnclave(
    lpAddress As IntPtr   ' void*
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' lpAddress : void*
Declare PtrSafe Function DeleteEnclave Lib "api-ms-win-core-enclave-l1-1-1" ( _
    ByVal lpAddress As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DeleteEnclave = ctypes.windll.LoadLibrary("api-ms-win-core-enclave-l1-1-1.dll").DeleteEnclave
DeleteEnclave.restype = wintypes.BOOL
DeleteEnclave.argtypes = [
    ctypes.POINTER(None),  # lpAddress : void*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-enclave-l1-1-1.dll')
DeleteEnclave = Fiddle::Function.new(
  lib['DeleteEnclave'],
  [
    Fiddle::TYPE_VOIDP,  # lpAddress : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-core-enclave-l1-1-1")]
extern "system" {
    fn DeleteEnclave(
        lpAddress: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-enclave-l1-1-1.dll", SetLastError = true)]
public static extern bool DeleteEnclave(IntPtr lpAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-enclave-l1-1-1_DeleteEnclave' -Namespace Win32 -PassThru
# $api::DeleteEnclave(lpAddress)
#uselib "api-ms-win-core-enclave-l1-1-1.dll"
#func global DeleteEnclave "DeleteEnclave" sptr
; DeleteEnclave lpAddress   ; 戻り値は stat
; lpAddress : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-core-enclave-l1-1-1.dll"
#cfunc global DeleteEnclave "DeleteEnclave" sptr
; res = DeleteEnclave(lpAddress)
; lpAddress : void* -> "sptr"
; BOOL DeleteEnclave(void* lpAddress)
#uselib "api-ms-win-core-enclave-l1-1-1.dll"
#cfunc global DeleteEnclave "DeleteEnclave" intptr
; res = DeleteEnclave(lpAddress)
; lpAddress : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_enclave_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-enclave-l1-1-1.dll")
	procDeleteEnclave = api_ms_win_core_enclave_l1_1_1.NewProc("DeleteEnclave")
)

// lpAddress (void*)
r1, _, err := procDeleteEnclave.Call(
	uintptr(lpAddress),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function DeleteEnclave(
  lpAddress: Pointer   // void*
): BOOL; stdcall;
  external 'api-ms-win-core-enclave-l1-1-1.dll' name 'DeleteEnclave';
result := DllCall("api-ms-win-core-enclave-l1-1-1\DeleteEnclave"
    , "Ptr", lpAddress   ; void*
    , "Int")   ; return: BOOL
●DeleteEnclave(lpAddress) = DLL("api-ms-win-core-enclave-l1-1-1.dll", "bool DeleteEnclave(void*)")
# 呼び出し: DeleteEnclave(lpAddress)
# lpAddress : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "api-ms-win-core-enclave-l1-1-1" fn DeleteEnclave(
    lpAddress: ?*anyopaque // void*
) callconv(std.os.windows.WINAPI) i32;
proc DeleteEnclave(
    lpAddress: pointer  # void*
): int32 {.importc: "DeleteEnclave", stdcall, dynlib: "api-ms-win-core-enclave-l1-1-1.dll".}
pragma(lib, "api-ms-win-core-enclave-l1-1-1");
extern(Windows)
int DeleteEnclave(
    void* lpAddress   // void*
);
ccall((:DeleteEnclave, "api-ms-win-core-enclave-l1-1-1.dll"), stdcall, Int32,
      (Ptr{Cvoid},),
      lpAddress)
# lpAddress : void* -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t DeleteEnclave(
    void* lpAddress);
]]
local api-ms-win-core-enclave-l1-1-1 = ffi.load("api-ms-win-core-enclave-l1-1-1")
-- api-ms-win-core-enclave-l1-1-1.DeleteEnclave(lpAddress)
-- lpAddress : void*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('api-ms-win-core-enclave-l1-1-1.dll');
const DeleteEnclave = lib.func('__stdcall', 'DeleteEnclave', 'int32_t', ['void *']);
// DeleteEnclave(lpAddress)
// lpAddress : void* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("api-ms-win-core-enclave-l1-1-1.dll", {
  DeleteEnclave: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.DeleteEnclave(lpAddress)
// lpAddress : void* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t DeleteEnclave(
    void* lpAddress);
C, "api-ms-win-core-enclave-l1-1-1.dll");
// $ffi->DeleteEnclave(lpAddress);
// lpAddress : void*
// 構造体/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 Api-ms-win-core-enclave-l1-1-1 extends StdCallLibrary {
    Api-ms-win-core-enclave-l1-1-1 INSTANCE = Native.load("api-ms-win-core-enclave-l1-1-1", Api-ms-win-core-enclave-l1-1-1.class);
    boolean DeleteEnclave(
        Pointer lpAddress   // void*
    );
}
@[Link("api-ms-win-core-enclave-l1-1-1")]
lib Libapi-ms-win-core-enclave-l1-1-1
  fun DeleteEnclave = DeleteEnclave(
    lpAddress : Void*   # void*
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef DeleteEnclaveNative = Int32 Function(Pointer<Void>);
typedef DeleteEnclaveDart = int Function(Pointer<Void>);
final DeleteEnclave = DynamicLibrary.open('api-ms-win-core-enclave-l1-1-1.dll')
    .lookupFunction<DeleteEnclaveNative, DeleteEnclaveDart>('DeleteEnclave');
// lpAddress : void* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function DeleteEnclave(
  lpAddress: Pointer   // void*
): BOOL; stdcall;
  external 'api-ms-win-core-enclave-l1-1-1.dll' name 'DeleteEnclave';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "DeleteEnclave"
  c_DeleteEnclave :: Ptr () -> IO CInt
-- lpAddress : void* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let deleteenclave =
  foreign "DeleteEnclave"
    ((ptr void) @-> returning int32_t)
(* lpAddress : void* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library api-ms-win-core-enclave-l1-1-1 (t "api-ms-win-core-enclave-l1-1-1.dll"))
(cffi:use-foreign-library api-ms-win-core-enclave-l1-1-1)

(cffi:defcfun ("DeleteEnclave" delete-enclave :convention :stdcall) :int32
  (lp-address :pointer))   ; void*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $DeleteEnclave = Win32::API::More->new('api-ms-win-core-enclave-l1-1-1',
    'BOOL DeleteEnclave(LPVOID lpAddress)');
# my $ret = $DeleteEnclave->Call($lpAddress);
# lpAddress : void* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。