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