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

ClusterRegBatchReadCommand

関数
バッチ通知から次のコマンド内容を読み取る。
DLLCLUSAPI.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

INT ClusterRegBatchReadCommand(
    HREGBATCHNOTIFICATION hBatchNotification,
    CLUSTER_BATCH_COMMAND* pBatchCommand
);

パラメーター

名前方向
hBatchNotificationHREGBATCHNOTIFICATIONin
pBatchCommandCLUSTER_BATCH_COMMAND*out

戻り値の型: INT

各言語での呼び出し定義

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

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

ClusterRegBatchReadCommand = ctypes.windll.clusapi.ClusterRegBatchReadCommand
ClusterRegBatchReadCommand.restype = ctypes.c_int
ClusterRegBatchReadCommand.argtypes = [
    ctypes.c_ssize_t,  # hBatchNotification : HREGBATCHNOTIFICATION
    ctypes.c_void_p,  # pBatchCommand : CLUSTER_BATCH_COMMAND* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
ClusterRegBatchReadCommand = Fiddle::Function.new(
  lib['ClusterRegBatchReadCommand'],
  [
    Fiddle::TYPE_INTPTR_T,  # hBatchNotification : HREGBATCHNOTIFICATION
    Fiddle::TYPE_VOIDP,  # pBatchCommand : CLUSTER_BATCH_COMMAND* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn ClusterRegBatchReadCommand(
        hBatchNotification: isize,  // HREGBATCHNOTIFICATION
        pBatchCommand: *mut CLUSTER_BATCH_COMMAND  // CLUSTER_BATCH_COMMAND* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern int ClusterRegBatchReadCommand(IntPtr hBatchNotification, IntPtr pBatchCommand);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_ClusterRegBatchReadCommand' -Namespace Win32 -PassThru
# $api::ClusterRegBatchReadCommand(hBatchNotification, pBatchCommand)
#uselib "CLUSAPI.dll"
#func global ClusterRegBatchReadCommand "ClusterRegBatchReadCommand" sptr, sptr
; ClusterRegBatchReadCommand hBatchNotification, varptr(pBatchCommand)   ; 戻り値は stat
; hBatchNotification : HREGBATCHNOTIFICATION -> "sptr"
; pBatchCommand : CLUSTER_BATCH_COMMAND* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "CLUSAPI.dll"
#cfunc global ClusterRegBatchReadCommand "ClusterRegBatchReadCommand" sptr, var
; res = ClusterRegBatchReadCommand(hBatchNotification, pBatchCommand)
; hBatchNotification : HREGBATCHNOTIFICATION -> "sptr"
; pBatchCommand : CLUSTER_BATCH_COMMAND* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT ClusterRegBatchReadCommand(HREGBATCHNOTIFICATION hBatchNotification, CLUSTER_BATCH_COMMAND* pBatchCommand)
#uselib "CLUSAPI.dll"
#cfunc global ClusterRegBatchReadCommand "ClusterRegBatchReadCommand" intptr, var
; res = ClusterRegBatchReadCommand(hBatchNotification, pBatchCommand)
; hBatchNotification : HREGBATCHNOTIFICATION -> "intptr"
; pBatchCommand : CLUSTER_BATCH_COMMAND* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procClusterRegBatchReadCommand = clusapi.NewProc("ClusterRegBatchReadCommand")
)

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