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

FDIDestroy

関数
FDIコンテキストを破棄しリソースを解放する。
DLLCabinet.dll呼出規約cdecl対応OSWindows 2000 以降

シグネチャ

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

BOOL FDIDestroy(
    void* hfdi
);

パラメーター

名前方向
hfdivoid*in

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL FDIDestroy(
    void* hfdi
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Cabinet.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern bool FDIDestroy(
    IntPtr hfdi   // void*
);
<DllImport("Cabinet.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function FDIDestroy(
    hfdi As IntPtr   ' void*
) As Boolean
End Function
' hfdi : void*
Declare PtrSafe Function FDIDestroy Lib "cabinet" ( _
    ByVal hfdi As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FDIDestroy = ctypes.cdll.cabinet.FDIDestroy
FDIDestroy.restype = wintypes.BOOL
FDIDestroy.argtypes = [
    ctypes.POINTER(None),  # hfdi : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	cabinet = windows.NewLazySystemDLL("Cabinet.dll")
	procFDIDestroy = cabinet.NewProc("FDIDestroy")
)

// hfdi (void*)
r1, _, err := procFDIDestroy.Call(
	uintptr(hfdi),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function FDIDestroy(
  hfdi: Pointer   // void*
): BOOL; cdecl;
  external 'Cabinet.dll' name 'FDIDestroy';
result := DllCall("Cabinet\FDIDestroy"
    , "Ptr", hfdi   ; void*
    , "Cdecl Int")   ; return: BOOL
●FDIDestroy(hfdi) = DLL("Cabinet.dll", "bool FDIDestroy(void*)")
# 呼び出し: FDIDestroy(hfdi)
# hfdi : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。