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

RemoveCrossClusterGroupSetDependency

関数
別クラスターのグループセットへの依存関係を削除する。
DLLCLUSAPI.dll呼出規約winapi

シグネチャ

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

DWORD RemoveCrossClusterGroupSetDependency(
    HGROUPSET hDependentGroupSet,
    LPCWSTR lpRemoteClusterName,
    LPCWSTR lpRemoteGroupSetName
);

パラメーター

名前方向
hDependentGroupSetHGROUPSETin
lpRemoteClusterNameLPCWSTRin
lpRemoteGroupSetNameLPCWSTRin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD RemoveCrossClusterGroupSetDependency(
    HGROUPSET hDependentGroupSet,
    LPCWSTR lpRemoteClusterName,
    LPCWSTR lpRemoteGroupSetName
);
[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern uint RemoveCrossClusterGroupSetDependency(
    IntPtr hDependentGroupSet,   // HGROUPSET
    [MarshalAs(UnmanagedType.LPWStr)] string lpRemoteClusterName,   // LPCWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string lpRemoteGroupSetName   // LPCWSTR
);
<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function RemoveCrossClusterGroupSetDependency(
    hDependentGroupSet As IntPtr,   ' HGROUPSET
    <MarshalAs(UnmanagedType.LPWStr)> lpRemoteClusterName As String,   ' LPCWSTR
    <MarshalAs(UnmanagedType.LPWStr)> lpRemoteGroupSetName As String   ' LPCWSTR
) As UInteger
End Function
' hDependentGroupSet : HGROUPSET
' lpRemoteClusterName : LPCWSTR
' lpRemoteGroupSetName : LPCWSTR
Declare PtrSafe Function RemoveCrossClusterGroupSetDependency Lib "clusapi" ( _
    ByVal hDependentGroupSet As LongPtr, _
    ByVal lpRemoteClusterName As LongPtr, _
    ByVal lpRemoteGroupSetName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RemoveCrossClusterGroupSetDependency = ctypes.windll.clusapi.RemoveCrossClusterGroupSetDependency
RemoveCrossClusterGroupSetDependency.restype = wintypes.DWORD
RemoveCrossClusterGroupSetDependency.argtypes = [
    ctypes.c_ssize_t,  # hDependentGroupSet : HGROUPSET
    wintypes.LPCWSTR,  # lpRemoteClusterName : LPCWSTR
    wintypes.LPCWSTR,  # lpRemoteGroupSetName : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
RemoveCrossClusterGroupSetDependency = Fiddle::Function.new(
  lib['RemoveCrossClusterGroupSetDependency'],
  [
    Fiddle::TYPE_INTPTR_T,  # hDependentGroupSet : HGROUPSET
    Fiddle::TYPE_VOIDP,  # lpRemoteClusterName : LPCWSTR
    Fiddle::TYPE_VOIDP,  # lpRemoteGroupSetName : LPCWSTR
  ],
  -Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn RemoveCrossClusterGroupSetDependency(
        hDependentGroupSet: isize,  // HGROUPSET
        lpRemoteClusterName: *const u16,  // LPCWSTR
        lpRemoteGroupSetName: *const u16  // LPCWSTR
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern uint RemoveCrossClusterGroupSetDependency(IntPtr hDependentGroupSet, [MarshalAs(UnmanagedType.LPWStr)] string lpRemoteClusterName, [MarshalAs(UnmanagedType.LPWStr)] string lpRemoteGroupSetName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_RemoveCrossClusterGroupSetDependency' -Namespace Win32 -PassThru
# $api::RemoveCrossClusterGroupSetDependency(hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName)
#uselib "CLUSAPI.dll"
#func global RemoveCrossClusterGroupSetDependency "RemoveCrossClusterGroupSetDependency" sptr, sptr, sptr
; RemoveCrossClusterGroupSetDependency hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName   ; 戻り値は stat
; hDependentGroupSet : HGROUPSET -> "sptr"
; lpRemoteClusterName : LPCWSTR -> "sptr"
; lpRemoteGroupSetName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CLUSAPI.dll"
#cfunc global RemoveCrossClusterGroupSetDependency "RemoveCrossClusterGroupSetDependency" sptr, wstr, wstr
; res = RemoveCrossClusterGroupSetDependency(hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName)
; hDependentGroupSet : HGROUPSET -> "sptr"
; lpRemoteClusterName : LPCWSTR -> "wstr"
; lpRemoteGroupSetName : LPCWSTR -> "wstr"
; DWORD RemoveCrossClusterGroupSetDependency(HGROUPSET hDependentGroupSet, LPCWSTR lpRemoteClusterName, LPCWSTR lpRemoteGroupSetName)
#uselib "CLUSAPI.dll"
#cfunc global RemoveCrossClusterGroupSetDependency "RemoveCrossClusterGroupSetDependency" intptr, wstr, wstr
; res = RemoveCrossClusterGroupSetDependency(hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName)
; hDependentGroupSet : HGROUPSET -> "intptr"
; lpRemoteClusterName : LPCWSTR -> "wstr"
; lpRemoteGroupSetName : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procRemoveCrossClusterGroupSetDependency = clusapi.NewProc("RemoveCrossClusterGroupSetDependency")
)

// hDependentGroupSet (HGROUPSET), lpRemoteClusterName (LPCWSTR), lpRemoteGroupSetName (LPCWSTR)
r1, _, err := procRemoveCrossClusterGroupSetDependency.Call(
	uintptr(hDependentGroupSet),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpRemoteClusterName))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpRemoteGroupSetName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function RemoveCrossClusterGroupSetDependency(
  hDependentGroupSet: NativeInt;   // HGROUPSET
  lpRemoteClusterName: PWideChar;   // LPCWSTR
  lpRemoteGroupSetName: PWideChar   // LPCWSTR
): DWORD; stdcall;
  external 'CLUSAPI.dll' name 'RemoveCrossClusterGroupSetDependency';
result := DllCall("CLUSAPI\RemoveCrossClusterGroupSetDependency"
    , "Ptr", hDependentGroupSet   ; HGROUPSET
    , "WStr", lpRemoteClusterName   ; LPCWSTR
    , "WStr", lpRemoteGroupSetName   ; LPCWSTR
    , "UInt")   ; return: DWORD
●RemoveCrossClusterGroupSetDependency(hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName) = DLL("CLUSAPI.dll", "dword RemoveCrossClusterGroupSetDependency(int, char*, char*)")
# 呼び出し: RemoveCrossClusterGroupSetDependency(hDependentGroupSet, lpRemoteClusterName, lpRemoteGroupSetName)
# hDependentGroupSet : HGROUPSET -> "int"
# lpRemoteClusterName : LPCWSTR -> "char*"
# lpRemoteGroupSetName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。