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

ClusterRegCreateReadBatch

関数
クラスタレジストリの読み取りバッチを作成する。
DLLCLUSAPI.dll呼出規約winapi対応OSwindowsserver2012

シグネチャ

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

INT ClusterRegCreateReadBatch(
    HKEY hKey,
    HREGREADBATCH* phRegReadBatch
);

パラメーター

名前方向
hKeyHKEYin
phRegReadBatchHREGREADBATCH*out

戻り値の型: INT

各言語での呼び出し定義

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

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

ClusterRegCreateReadBatch = ctypes.windll.clusapi.ClusterRegCreateReadBatch
ClusterRegCreateReadBatch.restype = ctypes.c_int
ClusterRegCreateReadBatch.argtypes = [
    wintypes.HANDLE,  # hKey : HKEY
    ctypes.c_void_p,  # phRegReadBatch : HREGREADBATCH* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procClusterRegCreateReadBatch = clusapi.NewProc("ClusterRegCreateReadBatch")
)

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