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

ResUtilGetClusterGroupType

関数
クラスターグループの種別を取得する。
DLLRESUTILS.dll呼出規約winapi

シグネチャ

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

DWORD ResUtilGetClusterGroupType(
    HGROUP hGroup,
    CLUSGROUP_TYPE* groupType
);

パラメーター

名前方向
hGroupHGROUPin
groupTypeCLUSGROUP_TYPE*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ResUtilGetClusterGroupType(
    HGROUP hGroup,
    CLUSGROUP_TYPE* groupType
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilGetClusterGroupType(
    IntPtr hGroup,   // HGROUP
    ref int groupType   // CLUSGROUP_TYPE* in/out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilGetClusterGroupType(
    hGroup As IntPtr,   ' HGROUP
    ByRef groupType As Integer   ' CLUSGROUP_TYPE* in/out
) As UInteger
End Function
' hGroup : HGROUP
' groupType : CLUSGROUP_TYPE* in/out
Declare PtrSafe Function ResUtilGetClusterGroupType Lib "resutils" ( _
    ByVal hGroup As LongPtr, _
    ByRef groupType As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ResUtilGetClusterGroupType = ctypes.windll.resutils.ResUtilGetClusterGroupType
ResUtilGetClusterGroupType.restype = wintypes.DWORD
ResUtilGetClusterGroupType.argtypes = [
    ctypes.c_ssize_t,  # hGroup : HGROUP
    ctypes.c_void_p,  # groupType : CLUSGROUP_TYPE* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilGetClusterGroupType = Fiddle::Function.new(
  lib['ResUtilGetClusterGroupType'],
  [
    Fiddle::TYPE_INTPTR_T,  # hGroup : HGROUP
    Fiddle::TYPE_VOIDP,  # groupType : CLUSGROUP_TYPE* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilGetClusterGroupType(
        hGroup: isize,  // HGROUP
        groupType: *mut i32  // CLUSGROUP_TYPE* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilGetClusterGroupType(IntPtr hGroup, ref int groupType);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilGetClusterGroupType' -Namespace Win32 -PassThru
# $api::ResUtilGetClusterGroupType(hGroup, groupType)
#uselib "RESUTILS.dll"
#func global ResUtilGetClusterGroupType "ResUtilGetClusterGroupType" sptr, sptr
; ResUtilGetClusterGroupType hGroup, groupType   ; 戻り値は stat
; hGroup : HGROUP -> "sptr"
; groupType : CLUSGROUP_TYPE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RESUTILS.dll"
#cfunc global ResUtilGetClusterGroupType "ResUtilGetClusterGroupType" sptr, int
; res = ResUtilGetClusterGroupType(hGroup, groupType)
; hGroup : HGROUP -> "sptr"
; groupType : CLUSGROUP_TYPE* in/out -> "int"
; DWORD ResUtilGetClusterGroupType(HGROUP hGroup, CLUSGROUP_TYPE* groupType)
#uselib "RESUTILS.dll"
#cfunc global ResUtilGetClusterGroupType "ResUtilGetClusterGroupType" intptr, int
; res = ResUtilGetClusterGroupType(hGroup, groupType)
; hGroup : HGROUP -> "intptr"
; groupType : CLUSGROUP_TYPE* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilGetClusterGroupType = resutils.NewProc("ResUtilGetClusterGroupType")
)

// hGroup (HGROUP), groupType (CLUSGROUP_TYPE* in/out)
r1, _, err := procResUtilGetClusterGroupType.Call(
	uintptr(hGroup),
	uintptr(groupType),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ResUtilGetClusterGroupType(
  hGroup: NativeInt;   // HGROUP
  groupType: Pointer   // CLUSGROUP_TYPE* in/out
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilGetClusterGroupType';
result := DllCall("RESUTILS\ResUtilGetClusterGroupType"
    , "Ptr", hGroup   ; HGROUP
    , "Ptr", groupType   ; CLUSGROUP_TYPE* in/out
    , "UInt")   ; return: DWORD
●ResUtilGetClusterGroupType(hGroup, groupType) = DLL("RESUTILS.dll", "dword ResUtilGetClusterGroupType(int, void*)")
# 呼び出し: ResUtilGetClusterGroupType(hGroup, groupType)
# hGroup : HGROUP -> "int"
# groupType : CLUSGROUP_TYPE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。