ホーム › Networking.Clustering › ClusterRegCreateBatch
ClusterRegCreateBatch
関数クラスタレジストリ操作用のバッチを作成する。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
INT ClusterRegCreateBatch(
HKEY hKey, // optional
HREGBATCH* pHREGBATCH
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hKey | HKEY | inoptional |
| pHREGBATCH | HREGBATCH* | out |
戻り値の型: INT
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
INT ClusterRegCreateBatch(
HKEY hKey, // optional
HREGBATCH* pHREGBATCH
);[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern int ClusterRegCreateBatch(
IntPtr hKey, // HKEY optional
out IntPtr pHREGBATCH // HREGBATCH* out
);<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function ClusterRegCreateBatch(
hKey As IntPtr, ' HKEY optional
<Out> ByRef pHREGBATCH As IntPtr ' HREGBATCH* out
) As Integer
End Function' hKey : HKEY optional
' pHREGBATCH : HREGBATCH* out
Declare PtrSafe Function ClusterRegCreateBatch Lib "clusapi" ( _
ByVal hKey As LongPtr, _
ByRef pHREGBATCH As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ClusterRegCreateBatch = ctypes.windll.clusapi.ClusterRegCreateBatch
ClusterRegCreateBatch.restype = ctypes.c_int
ClusterRegCreateBatch.argtypes = [
wintypes.HANDLE, # hKey : HKEY optional
ctypes.c_void_p, # pHREGBATCH : HREGBATCH* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
ClusterRegCreateBatch = Fiddle::Function.new(
lib['ClusterRegCreateBatch'],
[
Fiddle::TYPE_VOIDP, # hKey : HKEY optional
Fiddle::TYPE_VOIDP, # pHREGBATCH : HREGBATCH* out
],
Fiddle::TYPE_INT)#[link(name = "clusapi")]
extern "system" {
fn ClusterRegCreateBatch(
hKey: *mut core::ffi::c_void, // HKEY optional
pHREGBATCH: *mut isize // HREGBATCH* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern int ClusterRegCreateBatch(IntPtr hKey, out IntPtr pHREGBATCH);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_ClusterRegCreateBatch' -Namespace Win32 -PassThru
# $api::ClusterRegCreateBatch(hKey, pHREGBATCH)#uselib "CLUSAPI.dll"
#func global ClusterRegCreateBatch "ClusterRegCreateBatch" sptr, sptr
; ClusterRegCreateBatch hKey, pHREGBATCH ; 戻り値は stat
; hKey : HKEY optional -> "sptr"
; pHREGBATCH : HREGBATCH* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CLUSAPI.dll"
#cfunc global ClusterRegCreateBatch "ClusterRegCreateBatch" sptr, int
; res = ClusterRegCreateBatch(hKey, pHREGBATCH)
; hKey : HKEY optional -> "sptr"
; pHREGBATCH : HREGBATCH* out -> "int"; INT ClusterRegCreateBatch(HKEY hKey, HREGBATCH* pHREGBATCH)
#uselib "CLUSAPI.dll"
#cfunc global ClusterRegCreateBatch "ClusterRegCreateBatch" intptr, int
; res = ClusterRegCreateBatch(hKey, pHREGBATCH)
; hKey : HKEY optional -> "intptr"
; pHREGBATCH : HREGBATCH* out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procClusterRegCreateBatch = clusapi.NewProc("ClusterRegCreateBatch")
)
// hKey (HKEY optional), pHREGBATCH (HREGBATCH* out)
r1, _, err := procClusterRegCreateBatch.Call(
uintptr(hKey),
uintptr(pHREGBATCH),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ClusterRegCreateBatch(
hKey: THandle; // HKEY optional
pHREGBATCH: Pointer // HREGBATCH* out
): Integer; stdcall;
external 'CLUSAPI.dll' name 'ClusterRegCreateBatch';result := DllCall("CLUSAPI\ClusterRegCreateBatch"
, "Ptr", hKey ; HKEY optional
, "Ptr", pHREGBATCH ; HREGBATCH* out
, "Int") ; return: INT●ClusterRegCreateBatch(hKey, pHREGBATCH) = DLL("CLUSAPI.dll", "int ClusterRegCreateBatch(void*, void*)")
# 呼び出し: ClusterRegCreateBatch(hKey, pHREGBATCH)
# hKey : HKEY optional -> "void*"
# pHREGBATCH : HREGBATCH* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。