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