ホーム › Networking.Clustering › ClusapiSetReasonHandler
ClusapiSetReasonHandler
関数クラスターAPIの操作理由を記録するハンドラーを設定する。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
CLUSAPI_REASON_HANDLER* ClusapiSetReasonHandler(
CLUSAPI_REASON_HANDLER* lpHandler
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpHandler | CLUSAPI_REASON_HANDLER* | in |
戻り値の型: CLUSAPI_REASON_HANDLER*
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
CLUSAPI_REASON_HANDLER* ClusapiSetReasonHandler(
CLUSAPI_REASON_HANDLER* lpHandler
);[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern IntPtr ClusapiSetReasonHandler(
IntPtr lpHandler // CLUSAPI_REASON_HANDLER*
);<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function ClusapiSetReasonHandler(
lpHandler As IntPtr ' CLUSAPI_REASON_HANDLER*
) As IntPtr
End Function' lpHandler : CLUSAPI_REASON_HANDLER*
Declare PtrSafe Function ClusapiSetReasonHandler Lib "clusapi" ( _
ByVal lpHandler As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ClusapiSetReasonHandler = ctypes.windll.clusapi.ClusapiSetReasonHandler
ClusapiSetReasonHandler.restype = ctypes.c_void_p
ClusapiSetReasonHandler.argtypes = [
ctypes.c_void_p, # lpHandler : CLUSAPI_REASON_HANDLER*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
ClusapiSetReasonHandler = Fiddle::Function.new(
lib['ClusapiSetReasonHandler'],
[
Fiddle::TYPE_VOIDP, # lpHandler : CLUSAPI_REASON_HANDLER*
],
Fiddle::TYPE_VOIDP)#[link(name = "clusapi")]
extern "system" {
fn ClusapiSetReasonHandler(
lpHandler: *mut CLUSAPI_REASON_HANDLER // CLUSAPI_REASON_HANDLER*
) -> *mut CLUSAPI_REASON_HANDLER;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern IntPtr ClusapiSetReasonHandler(IntPtr lpHandler);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_ClusapiSetReasonHandler' -Namespace Win32 -PassThru
# $api::ClusapiSetReasonHandler(lpHandler)#uselib "CLUSAPI.dll"
#func global ClusapiSetReasonHandler "ClusapiSetReasonHandler" sptr
; ClusapiSetReasonHandler varptr(lpHandler) ; 戻り値は stat
; lpHandler : CLUSAPI_REASON_HANDLER* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "CLUSAPI.dll" #cfunc global ClusapiSetReasonHandler "ClusapiSetReasonHandler" var ; res = ClusapiSetReasonHandler(lpHandler) ; lpHandler : CLUSAPI_REASON_HANDLER* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "CLUSAPI.dll" #cfunc global ClusapiSetReasonHandler "ClusapiSetReasonHandler" sptr ; res = ClusapiSetReasonHandler(varptr(lpHandler)) ; lpHandler : CLUSAPI_REASON_HANDLER* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; CLUSAPI_REASON_HANDLER* ClusapiSetReasonHandler(CLUSAPI_REASON_HANDLER* lpHandler) #uselib "CLUSAPI.dll" #cfunc global ClusapiSetReasonHandler "ClusapiSetReasonHandler" var ; res = ClusapiSetReasonHandler(lpHandler) ; lpHandler : CLUSAPI_REASON_HANDLER* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; CLUSAPI_REASON_HANDLER* ClusapiSetReasonHandler(CLUSAPI_REASON_HANDLER* lpHandler) #uselib "CLUSAPI.dll" #cfunc global ClusapiSetReasonHandler "ClusapiSetReasonHandler" intptr ; res = ClusapiSetReasonHandler(varptr(lpHandler)) ; lpHandler : CLUSAPI_REASON_HANDLER* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procClusapiSetReasonHandler = clusapi.NewProc("ClusapiSetReasonHandler")
)
// lpHandler (CLUSAPI_REASON_HANDLER*)
r1, _, err := procClusapiSetReasonHandler.Call(
uintptr(lpHandler),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CLUSAPI_REASON_HANDLER*function ClusapiSetReasonHandler(
lpHandler: Pointer // CLUSAPI_REASON_HANDLER*
): Pointer; stdcall;
external 'CLUSAPI.dll' name 'ClusapiSetReasonHandler';result := DllCall("CLUSAPI\ClusapiSetReasonHandler"
, "Ptr", lpHandler ; CLUSAPI_REASON_HANDLER*
, "Ptr") ; return: CLUSAPI_REASON_HANDLER*●ClusapiSetReasonHandler(lpHandler) = DLL("CLUSAPI.dll", "void* ClusapiSetReasonHandler(void*)")
# 呼び出し: ClusapiSetReasonHandler(lpHandler)
# lpHandler : CLUSAPI_REASON_HANDLER* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。