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

ResUtilGroupsEqual

関数
二つのクラスタグループが同一かを判定する。
DLLRESUTILS.dll呼出規約winapi

シグネチャ

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

DWORD ResUtilGroupsEqual(
    HGROUP hSelf,
    HGROUP hGroup,
    BOOL* pEqual
);

パラメーター

名前方向説明
hSelfHGROUPin比較元となるクラスターグループのハンドル。
hGroupHGROUPin比較先となるクラスターグループのハンドル。
pEqualBOOL*inout両グループが同一かどうかの判定結果を受け取る変数へのポインター。

戻り値の型: DWORD

各言語での呼び出し定義

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

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

ResUtilGroupsEqual = ctypes.windll.resutils.ResUtilGroupsEqual
ResUtilGroupsEqual.restype = wintypes.DWORD
ResUtilGroupsEqual.argtypes = [
    ctypes.c_ssize_t,  # hSelf : HGROUP
    ctypes.c_ssize_t,  # hGroup : HGROUP
    ctypes.c_void_p,  # pEqual : BOOL* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilGroupsEqual = Fiddle::Function.new(
  lib['ResUtilGroupsEqual'],
  [
    Fiddle::TYPE_INTPTR_T,  # hSelf : HGROUP
    Fiddle::TYPE_INTPTR_T,  # hGroup : HGROUP
    Fiddle::TYPE_VOIDP,  # pEqual : BOOL* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilGroupsEqual(
        hSelf: isize,  // HGROUP
        hGroup: isize,  // HGROUP
        pEqual: *mut i32  // BOOL* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilGroupsEqual(IntPtr hSelf, IntPtr hGroup, ref bool pEqual);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilGroupsEqual' -Namespace Win32 -PassThru
# $api::ResUtilGroupsEqual(hSelf, hGroup, pEqual)
#uselib "RESUTILS.dll"
#func global ResUtilGroupsEqual "ResUtilGroupsEqual" sptr, sptr, sptr
; ResUtilGroupsEqual hSelf, hGroup, varptr(pEqual)   ; 戻り値は stat
; hSelf : HGROUP -> "sptr"
; hGroup : HGROUP -> "sptr"
; pEqual : BOOL* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RESUTILS.dll"
#cfunc global ResUtilGroupsEqual "ResUtilGroupsEqual" sptr, sptr, var
; res = ResUtilGroupsEqual(hSelf, hGroup, pEqual)
; hSelf : HGROUP -> "sptr"
; hGroup : HGROUP -> "sptr"
; pEqual : BOOL* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ResUtilGroupsEqual(HGROUP hSelf, HGROUP hGroup, BOOL* pEqual)
#uselib "RESUTILS.dll"
#cfunc global ResUtilGroupsEqual "ResUtilGroupsEqual" intptr, intptr, var
; res = ResUtilGroupsEqual(hSelf, hGroup, pEqual)
; hSelf : HGROUP -> "intptr"
; hGroup : HGROUP -> "intptr"
; pEqual : BOOL* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilGroupsEqual = resutils.NewProc("ResUtilGroupsEqual")
)

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

extern "resutils" fn ResUtilGroupsEqual(
    hSelf: isize, // HGROUP
    hGroup: isize, // HGROUP
    pEqual: [*c]i32 // BOOL* in/out
) callconv(std.os.windows.WINAPI) u32;
proc ResUtilGroupsEqual(
    hSelf: int,  # HGROUP
    hGroup: int,  # HGROUP
    pEqual: ptr int32  # BOOL* in/out
): uint32 {.importc: "ResUtilGroupsEqual", stdcall, dynlib: "RESUTILS.dll".}
pragma(lib, "resutils");
extern(Windows)
uint ResUtilGroupsEqual(
    ptrdiff_t hSelf,   // HGROUP
    ptrdiff_t hGroup,   // HGROUP
    int* pEqual   // BOOL* in/out
);
ccall((:ResUtilGroupsEqual, "RESUTILS.dll"), stdcall, UInt32,
      (Int, Int, Ptr{Int32}),
      hSelf, hGroup, pEqual)
# hSelf : HGROUP -> Int
# hGroup : HGROUP -> Int
# pEqual : BOOL* in/out -> Ptr{Int32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t ResUtilGroupsEqual(
    intptr_t hSelf,
    intptr_t hGroup,
    int32_t* pEqual);
]]
local resutils = ffi.load("resutils")
-- resutils.ResUtilGroupsEqual(hSelf, hGroup, pEqual)
-- hSelf : HGROUP
-- hGroup : HGROUP
-- pEqual : BOOL* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('RESUTILS.dll');
const ResUtilGroupsEqual = lib.func('__stdcall', 'ResUtilGroupsEqual', 'uint32_t', ['intptr_t', 'intptr_t', 'int32_t *']);
// ResUtilGroupsEqual(hSelf, hGroup, pEqual)
// hSelf : HGROUP -> 'intptr_t'
// hGroup : HGROUP -> 'intptr_t'
// pEqual : BOOL* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("RESUTILS.dll", {
  ResUtilGroupsEqual: { parameters: ["isize", "isize", "pointer"], result: "u32" },
});
// lib.symbols.ResUtilGroupsEqual(hSelf, hGroup, pEqual)
// hSelf : HGROUP -> "isize"
// hGroup : HGROUP -> "isize"
// pEqual : BOOL* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t ResUtilGroupsEqual(
    intptr_t hSelf,
    intptr_t hGroup,
    int32_t* pEqual);
C, "RESUTILS.dll");
// $ffi->ResUtilGroupsEqual(hSelf, hGroup, pEqual);
// hSelf : HGROUP
// hGroup : HGROUP
// pEqual : BOOL* in/out
// 構造体/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 Resutils extends StdCallLibrary {
    Resutils INSTANCE = Native.load("resutils", Resutils.class);
    int ResUtilGroupsEqual(
        long hSelf,   // HGROUP
        long hGroup,   // HGROUP
        IntByReference pEqual   // BOOL* in/out
    );
}
@[Link("resutils")]
lib LibRESUTILS
  fun ResUtilGroupsEqual = ResUtilGroupsEqual(
    hSelf : LibC::SSizeT,   # HGROUP
    hGroup : LibC::SSizeT,   # HGROUP
    pEqual : Int32*   # BOOL* in/out
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ResUtilGroupsEqualNative = Uint32 Function(IntPtr, IntPtr, Pointer<Int32>);
typedef ResUtilGroupsEqualDart = int Function(int, int, Pointer<Int32>);
final ResUtilGroupsEqual = DynamicLibrary.open('RESUTILS.dll')
    .lookupFunction<ResUtilGroupsEqualNative, ResUtilGroupsEqualDart>('ResUtilGroupsEqual');
// hSelf : HGROUP -> IntPtr
// hGroup : HGROUP -> IntPtr
// pEqual : BOOL* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ResUtilGroupsEqual(
  hSelf: NativeInt;   // HGROUP
  hGroup: NativeInt;   // HGROUP
  pEqual: Pointer   // BOOL* in/out
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilGroupsEqual';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ResUtilGroupsEqual"
  c_ResUtilGroupsEqual :: CIntPtr -> CIntPtr -> Ptr CInt -> IO Word32
-- hSelf : HGROUP -> CIntPtr
-- hGroup : HGROUP -> CIntPtr
-- pEqual : BOOL* in/out -> Ptr CInt
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let resutilgroupsequal =
  foreign "ResUtilGroupsEqual"
    (intptr_t @-> intptr_t @-> (ptr int32_t) @-> returning uint32_t)
(* hSelf : HGROUP -> intptr_t *)
(* hGroup : HGROUP -> intptr_t *)
(* pEqual : BOOL* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library resutils (t "RESUTILS.dll"))
(cffi:use-foreign-library resutils)

(cffi:defcfun ("ResUtilGroupsEqual" res-util-groups-equal :convention :stdcall) :uint32
  (h-self :int64)   ; HGROUP
  (h-group :int64)   ; HGROUP
  (p-equal :pointer))   ; BOOL* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ResUtilGroupsEqual = Win32::API::More->new('RESUTILS',
    'DWORD ResUtilGroupsEqual(LPARAM hSelf, LPARAM hGroup, LPVOID pEqual)');
# my $ret = $ResUtilGroupsEqual->Call($hSelf, $hGroup, $pEqual);
# hSelf : HGROUP -> LPARAM
# hGroup : HGROUP -> LPARAM
# pEqual : BOOL* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。