ホーム › Networking.Clustering › AddClusterGroupSetDependency
AddClusterGroupSetDependency
関数グループセット間の依存関係を追加する。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
DWORD AddClusterGroupSetDependency(
HGROUPSET hDependentGroupSet,
HGROUPSET hProviderGroupSet
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hDependentGroupSet | HGROUPSET | in | 依存する側(従属)のグループセットへのハンドル。 |
| hProviderGroupSet | HGROUPSET | in | 依存される側(プロバイダ)のグループセットへのハンドル。 |
戻り値の型: DWORD
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
DWORD AddClusterGroupSetDependency(
HGROUPSET hDependentGroupSet,
HGROUPSET hProviderGroupSet
);[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern uint AddClusterGroupSetDependency(
IntPtr hDependentGroupSet, // HGROUPSET
IntPtr hProviderGroupSet // HGROUPSET
);<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function AddClusterGroupSetDependency(
hDependentGroupSet As IntPtr, ' HGROUPSET
hProviderGroupSet As IntPtr ' HGROUPSET
) As UInteger
End Function' hDependentGroupSet : HGROUPSET
' hProviderGroupSet : HGROUPSET
Declare PtrSafe Function AddClusterGroupSetDependency Lib "clusapi" ( _
ByVal hDependentGroupSet As LongPtr, _
ByVal hProviderGroupSet As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AddClusterGroupSetDependency = ctypes.windll.clusapi.AddClusterGroupSetDependency
AddClusterGroupSetDependency.restype = wintypes.DWORD
AddClusterGroupSetDependency.argtypes = [
ctypes.c_ssize_t, # hDependentGroupSet : HGROUPSET
ctypes.c_ssize_t, # hProviderGroupSet : HGROUPSET
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
AddClusterGroupSetDependency = Fiddle::Function.new(
lib['AddClusterGroupSetDependency'],
[
Fiddle::TYPE_INTPTR_T, # hDependentGroupSet : HGROUPSET
Fiddle::TYPE_INTPTR_T, # hProviderGroupSet : HGROUPSET
],
-Fiddle::TYPE_INT)#[link(name = "clusapi")]
extern "system" {
fn AddClusterGroupSetDependency(
hDependentGroupSet: isize, // HGROUPSET
hProviderGroupSet: isize // HGROUPSET
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern uint AddClusterGroupSetDependency(IntPtr hDependentGroupSet, IntPtr hProviderGroupSet);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_AddClusterGroupSetDependency' -Namespace Win32 -PassThru
# $api::AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)#uselib "CLUSAPI.dll"
#func global AddClusterGroupSetDependency "AddClusterGroupSetDependency" sptr, sptr
; AddClusterGroupSetDependency hDependentGroupSet, hProviderGroupSet ; 戻り値は stat
; hDependentGroupSet : HGROUPSET -> "sptr"
; hProviderGroupSet : HGROUPSET -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CLUSAPI.dll"
#cfunc global AddClusterGroupSetDependency "AddClusterGroupSetDependency" sptr, sptr
; res = AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
; hDependentGroupSet : HGROUPSET -> "sptr"
; hProviderGroupSet : HGROUPSET -> "sptr"; DWORD AddClusterGroupSetDependency(HGROUPSET hDependentGroupSet, HGROUPSET hProviderGroupSet)
#uselib "CLUSAPI.dll"
#cfunc global AddClusterGroupSetDependency "AddClusterGroupSetDependency" intptr, intptr
; res = AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
; hDependentGroupSet : HGROUPSET -> "intptr"
; hProviderGroupSet : HGROUPSET -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procAddClusterGroupSetDependency = clusapi.NewProc("AddClusterGroupSetDependency")
)
// hDependentGroupSet (HGROUPSET), hProviderGroupSet (HGROUPSET)
r1, _, err := procAddClusterGroupSetDependency.Call(
uintptr(hDependentGroupSet),
uintptr(hProviderGroupSet),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction AddClusterGroupSetDependency(
hDependentGroupSet: NativeInt; // HGROUPSET
hProviderGroupSet: NativeInt // HGROUPSET
): DWORD; stdcall;
external 'CLUSAPI.dll' name 'AddClusterGroupSetDependency';result := DllCall("CLUSAPI\AddClusterGroupSetDependency"
, "Ptr", hDependentGroupSet ; HGROUPSET
, "Ptr", hProviderGroupSet ; HGROUPSET
, "UInt") ; return: DWORD●AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet) = DLL("CLUSAPI.dll", "dword AddClusterGroupSetDependency(int, int)")
# 呼び出し: AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
# hDependentGroupSet : HGROUPSET -> "int"
# hProviderGroupSet : HGROUPSET -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "clusapi" fn AddClusterGroupSetDependency(
hDependentGroupSet: isize, // HGROUPSET
hProviderGroupSet: isize // HGROUPSET
) callconv(std.os.windows.WINAPI) u32;proc AddClusterGroupSetDependency(
hDependentGroupSet: int, # HGROUPSET
hProviderGroupSet: int # HGROUPSET
): uint32 {.importc: "AddClusterGroupSetDependency", stdcall, dynlib: "CLUSAPI.dll".}pragma(lib, "clusapi");
extern(Windows)
uint AddClusterGroupSetDependency(
ptrdiff_t hDependentGroupSet, // HGROUPSET
ptrdiff_t hProviderGroupSet // HGROUPSET
);ccall((:AddClusterGroupSetDependency, "CLUSAPI.dll"), stdcall, UInt32,
(Int, Int),
hDependentGroupSet, hProviderGroupSet)
# hDependentGroupSet : HGROUPSET -> Int
# hProviderGroupSet : HGROUPSET -> Int
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t AddClusterGroupSetDependency(
intptr_t hDependentGroupSet,
intptr_t hProviderGroupSet);
]]
local clusapi = ffi.load("clusapi")
-- clusapi.AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
-- hDependentGroupSet : HGROUPSET
-- hProviderGroupSet : HGROUPSET
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('CLUSAPI.dll');
const AddClusterGroupSetDependency = lib.func('__stdcall', 'AddClusterGroupSetDependency', 'uint32_t', ['intptr_t', 'intptr_t']);
// AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
// hDependentGroupSet : HGROUPSET -> 'intptr_t'
// hProviderGroupSet : HGROUPSET -> 'intptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("CLUSAPI.dll", {
AddClusterGroupSetDependency: { parameters: ["isize", "isize"], result: "u32" },
});
// lib.symbols.AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
// hDependentGroupSet : HGROUPSET -> "isize"
// hProviderGroupSet : HGROUPSET -> "isize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t AddClusterGroupSetDependency(
intptr_t hDependentGroupSet,
intptr_t hProviderGroupSet);
C, "CLUSAPI.dll");
// $ffi->AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet);
// hDependentGroupSet : HGROUPSET
// hProviderGroupSet : HGROUPSET
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Clusapi extends StdCallLibrary {
Clusapi INSTANCE = Native.load("clusapi", Clusapi.class);
int AddClusterGroupSetDependency(
long hDependentGroupSet, // HGROUPSET
long hProviderGroupSet // HGROUPSET
);
}@[Link("clusapi")]
lib LibCLUSAPI
fun AddClusterGroupSetDependency = AddClusterGroupSetDependency(
hDependentGroupSet : LibC::SSizeT, # HGROUPSET
hProviderGroupSet : LibC::SSizeT # HGROUPSET
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef AddClusterGroupSetDependencyNative = Uint32 Function(IntPtr, IntPtr);
typedef AddClusterGroupSetDependencyDart = int Function(int, int);
final AddClusterGroupSetDependency = DynamicLibrary.open('CLUSAPI.dll')
.lookupFunction<AddClusterGroupSetDependencyNative, AddClusterGroupSetDependencyDart>('AddClusterGroupSetDependency');
// hDependentGroupSet : HGROUPSET -> IntPtr
// hProviderGroupSet : HGROUPSET -> IntPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function AddClusterGroupSetDependency(
hDependentGroupSet: NativeInt; // HGROUPSET
hProviderGroupSet: NativeInt // HGROUPSET
): DWORD; stdcall;
external 'CLUSAPI.dll' name 'AddClusterGroupSetDependency';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "AddClusterGroupSetDependency"
c_AddClusterGroupSetDependency :: CIntPtr -> CIntPtr -> IO Word32
-- hDependentGroupSet : HGROUPSET -> CIntPtr
-- hProviderGroupSet : HGROUPSET -> CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let addclustergroupsetdependency =
foreign "AddClusterGroupSetDependency"
(intptr_t @-> intptr_t @-> returning uint32_t)
(* hDependentGroupSet : HGROUPSET -> intptr_t *)
(* hProviderGroupSet : HGROUPSET -> intptr_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library clusapi (t "CLUSAPI.dll"))
(cffi:use-foreign-library clusapi)
(cffi:defcfun ("AddClusterGroupSetDependency" add-cluster-group-set-dependency :convention :stdcall) :uint32
(h-dependent-group-set :int64) ; HGROUPSET
(h-provider-group-set :int64)) ; HGROUPSET
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $AddClusterGroupSetDependency = Win32::API::More->new('CLUSAPI',
'DWORD AddClusterGroupSetDependency(LPARAM hDependentGroupSet, LPARAM hProviderGroupSet)');
# my $ret = $AddClusterGroupSetDependency->Call($hDependentGroupSet, $hProviderGroupSet);
# hDependentGroupSet : HGROUPSET -> LPARAM
# hProviderGroupSet : HGROUPSET -> LPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
類似 API
- f AddClusterGroupSetDependencyEx — 理由を付与してグループセット間の依存関係を追加する。