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

ClusterRegCreateBatchNotifyPort

関数
クラスタレジストリバッチ通知ポートを作成する。
DLLCLUSAPI.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

INT ClusterRegCreateBatchNotifyPort(
    HKEY hKey,
    HREGBATCHPORT* phBatchNotifyPort
);

パラメーター

名前方向
hKeyHKEYin
phBatchNotifyPortHREGBATCHPORT*out

戻り値の型: INT

各言語での呼び出し定義

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

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

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

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procClusterRegCreateBatchNotifyPort = clusapi.NewProc("ClusterRegCreateBatchNotifyPort")
)

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