ホーム › Networking.Clustering › OpenClusterGroupSet
OpenClusterGroupSet
関数既存のクラスターグループセットを開く。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
HGROUPSET OpenClusterGroupSet(
HCLUSTER hCluster,
LPCWSTR lpszGroupSetName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hCluster | HCLUSTER | in |
| lpszGroupSetName | LPCWSTR | in |
戻り値の型: HGROUPSET
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
HGROUPSET OpenClusterGroupSet(
HCLUSTER hCluster,
LPCWSTR lpszGroupSetName
);[DllImport("CLUSAPI.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr OpenClusterGroupSet(
IntPtr hCluster, // HCLUSTER
[MarshalAs(UnmanagedType.LPWStr)] string lpszGroupSetName // LPCWSTR
);<DllImport("CLUSAPI.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function OpenClusterGroupSet(
hCluster As IntPtr, ' HCLUSTER
<MarshalAs(UnmanagedType.LPWStr)> lpszGroupSetName As String ' LPCWSTR
) As IntPtr
End Function' hCluster : HCLUSTER
' lpszGroupSetName : LPCWSTR
Declare PtrSafe Function OpenClusterGroupSet Lib "clusapi" ( _
ByVal hCluster As LongPtr, _
ByVal lpszGroupSetName As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
OpenClusterGroupSet = ctypes.windll.clusapi.OpenClusterGroupSet
OpenClusterGroupSet.restype = ctypes.c_ssize_t
OpenClusterGroupSet.argtypes = [
ctypes.c_ssize_t, # hCluster : HCLUSTER
wintypes.LPCWSTR, # lpszGroupSetName : LPCWSTR
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
OpenClusterGroupSet = Fiddle::Function.new(
lib['OpenClusterGroupSet'],
[
Fiddle::TYPE_INTPTR_T, # hCluster : HCLUSTER
Fiddle::TYPE_VOIDP, # lpszGroupSetName : LPCWSTR
],
Fiddle::TYPE_INTPTR_T)#[link(name = "clusapi")]
extern "system" {
fn OpenClusterGroupSet(
hCluster: isize, // HCLUSTER
lpszGroupSetName: *const u16 // LPCWSTR
) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CLUSAPI.dll", SetLastError = true)]
public static extern IntPtr OpenClusterGroupSet(IntPtr hCluster, [MarshalAs(UnmanagedType.LPWStr)] string lpszGroupSetName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_OpenClusterGroupSet' -Namespace Win32 -PassThru
# $api::OpenClusterGroupSet(hCluster, lpszGroupSetName)#uselib "CLUSAPI.dll"
#func global OpenClusterGroupSet "OpenClusterGroupSet" sptr, sptr
; OpenClusterGroupSet hCluster, lpszGroupSetName ; 戻り値は stat
; hCluster : HCLUSTER -> "sptr"
; lpszGroupSetName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CLUSAPI.dll"
#cfunc global OpenClusterGroupSet "OpenClusterGroupSet" sptr, wstr
; res = OpenClusterGroupSet(hCluster, lpszGroupSetName)
; hCluster : HCLUSTER -> "sptr"
; lpszGroupSetName : LPCWSTR -> "wstr"; HGROUPSET OpenClusterGroupSet(HCLUSTER hCluster, LPCWSTR lpszGroupSetName)
#uselib "CLUSAPI.dll"
#cfunc global OpenClusterGroupSet "OpenClusterGroupSet" intptr, wstr
; res = OpenClusterGroupSet(hCluster, lpszGroupSetName)
; hCluster : HCLUSTER -> "intptr"
; lpszGroupSetName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procOpenClusterGroupSet = clusapi.NewProc("OpenClusterGroupSet")
)
// hCluster (HCLUSTER), lpszGroupSetName (LPCWSTR)
r1, _, err := procOpenClusterGroupSet.Call(
uintptr(hCluster),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszGroupSetName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HGROUPSETfunction OpenClusterGroupSet(
hCluster: NativeInt; // HCLUSTER
lpszGroupSetName: PWideChar // LPCWSTR
): NativeInt; stdcall;
external 'CLUSAPI.dll' name 'OpenClusterGroupSet';result := DllCall("CLUSAPI\OpenClusterGroupSet"
, "Ptr", hCluster ; HCLUSTER
, "WStr", lpszGroupSetName ; LPCWSTR
, "Ptr") ; return: HGROUPSET●OpenClusterGroupSet(hCluster, lpszGroupSetName) = DLL("CLUSAPI.dll", "int OpenClusterGroupSet(int, char*)")
# 呼び出し: OpenClusterGroupSet(hCluster, lpszGroupSetName)
# hCluster : HCLUSTER -> "int"
# lpszGroupSetName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。