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