Win32 API 日本語リファレンス
ホームNetworking.Clustering › ClusterRegCloseKey

ClusterRegCloseKey

関数
クラスターレジストリキーのハンドルを閉じる。
DLLCLUSAPI.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

INT ClusterRegCloseKey(
    HKEY hKey
);

パラメーター

名前方向
hKeyHKEYin

戻り値の型: INT

各言語での呼び出し定義

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

INT ClusterRegCloseKey(
    HKEY hKey
);
[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern int ClusterRegCloseKey(
    IntPtr hKey   // HKEY
);
<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function ClusterRegCloseKey(
    hKey As IntPtr   ' HKEY
) As Integer
End Function
' hKey : HKEY
Declare PtrSafe Function ClusterRegCloseKey Lib "clusapi" ( _
    ByVal hKey As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ClusterRegCloseKey = ctypes.windll.clusapi.ClusterRegCloseKey
ClusterRegCloseKey.restype = ctypes.c_int
ClusterRegCloseKey.argtypes = [
    wintypes.HANDLE,  # hKey : HKEY
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
ClusterRegCloseKey = Fiddle::Function.new(
  lib['ClusterRegCloseKey'],
  [
    Fiddle::TYPE_VOIDP,  # hKey : HKEY
  ],
  Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn ClusterRegCloseKey(
        hKey: *mut core::ffi::c_void  // HKEY
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern int ClusterRegCloseKey(IntPtr hKey);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_ClusterRegCloseKey' -Namespace Win32 -PassThru
# $api::ClusterRegCloseKey(hKey)
#uselib "CLUSAPI.dll"
#func global ClusterRegCloseKey "ClusterRegCloseKey" sptr
; ClusterRegCloseKey hKey   ; 戻り値は stat
; hKey : HKEY -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CLUSAPI.dll"
#cfunc global ClusterRegCloseKey "ClusterRegCloseKey" sptr
; res = ClusterRegCloseKey(hKey)
; hKey : HKEY -> "sptr"
; INT ClusterRegCloseKey(HKEY hKey)
#uselib "CLUSAPI.dll"
#cfunc global ClusterRegCloseKey "ClusterRegCloseKey" intptr
; res = ClusterRegCloseKey(hKey)
; hKey : HKEY -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procClusterRegCloseKey = clusapi.NewProc("ClusterRegCloseKey")
)

// hKey (HKEY)
r1, _, err := procClusterRegCloseKey.Call(
	uintptr(hKey),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ClusterRegCloseKey(
  hKey: THandle   // HKEY
): Integer; stdcall;
  external 'CLUSAPI.dll' name 'ClusterRegCloseKey';
result := DllCall("CLUSAPI\ClusterRegCloseKey"
    , "Ptr", hKey   ; HKEY
    , "Int")   ; return: INT
●ClusterRegCloseKey(hKey) = DLL("CLUSAPI.dll", "int ClusterRegCloseKey(void*)")
# 呼び出し: ClusterRegCloseKey(hKey)
# hKey : HKEY -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。