Win32 API 日本語リファレンス
ホームSystem.Rpc › RpcServerInterfaceGroupCreateA

RpcServerInterfaceGroupCreateA

関数
複数のインターフェイスとエンドポイントをまとめたインターフェイスグループを作成する(ANSI版)。
DLLRPCRT4.dll文字セットANSI (-A)呼出規約winapi対応OSwindows8.0

シグネチャ

// RPCRT4.dll  (ANSI / -A)
#include <windows.h>

RPC_STATUS RpcServerInterfaceGroupCreateA(
    RPC_INTERFACE_TEMPLATEA* Interfaces,
    DWORD NumIfs,
    RPC_ENDPOINT_TEMPLATEA* Endpoints,
    DWORD NumEndpoints,
    DWORD IdlePeriod,
    RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn,
    void* IdleCallbackContext,
    void** IfGroup
);

パラメーター

名前方向
InterfacesRPC_INTERFACE_TEMPLATEA*in
NumIfsDWORDin
EndpointsRPC_ENDPOINT_TEMPLATEA*in
NumEndpointsDWORDin
IdlePeriodDWORDin
IdleCallbackFnRPC_INTERFACE_GROUP_IDLE_CALLBACK_FNin
IdleCallbackContextvoid*in
IfGroupvoid**out

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCRT4.dll  (ANSI / -A)
#include <windows.h>

RPC_STATUS RpcServerInterfaceGroupCreateA(
    RPC_INTERFACE_TEMPLATEA* Interfaces,
    DWORD NumIfs,
    RPC_ENDPOINT_TEMPLATEA* Endpoints,
    DWORD NumEndpoints,
    DWORD IdlePeriod,
    RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn,
    void* IdleCallbackContext,
    void** IfGroup
);
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcServerInterfaceGroupCreateA(
    IntPtr Interfaces,   // RPC_INTERFACE_TEMPLATEA*
    uint NumIfs,   // DWORD
    IntPtr Endpoints,   // RPC_ENDPOINT_TEMPLATEA*
    uint NumEndpoints,   // DWORD
    uint IdlePeriod,   // DWORD
    IntPtr IdleCallbackFn,   // RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
    IntPtr IdleCallbackContext,   // void*
    IntPtr IfGroup   // void** out
);
<DllImport("RPCRT4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcServerInterfaceGroupCreateA(
    Interfaces As IntPtr,   ' RPC_INTERFACE_TEMPLATEA*
    NumIfs As UInteger,   ' DWORD
    Endpoints As IntPtr,   ' RPC_ENDPOINT_TEMPLATEA*
    NumEndpoints As UInteger,   ' DWORD
    IdlePeriod As UInteger,   ' DWORD
    IdleCallbackFn As IntPtr,   ' RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
    IdleCallbackContext As IntPtr,   ' void*
    IfGroup As IntPtr   ' void** out
) As Integer
End Function
' Interfaces : RPC_INTERFACE_TEMPLATEA*
' NumIfs : DWORD
' Endpoints : RPC_ENDPOINT_TEMPLATEA*
' NumEndpoints : DWORD
' IdlePeriod : DWORD
' IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
' IdleCallbackContext : void*
' IfGroup : void** out
Declare PtrSafe Function RpcServerInterfaceGroupCreateA Lib "rpcrt4" ( _
    ByVal Interfaces As LongPtr, _
    ByVal NumIfs As Long, _
    ByVal Endpoints As LongPtr, _
    ByVal NumEndpoints As Long, _
    ByVal IdlePeriod As Long, _
    ByVal IdleCallbackFn As LongPtr, _
    ByVal IdleCallbackContext As LongPtr, _
    ByVal IfGroup As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcServerInterfaceGroupCreateA = ctypes.windll.rpcrt4.RpcServerInterfaceGroupCreateA
RpcServerInterfaceGroupCreateA.restype = ctypes.c_int
RpcServerInterfaceGroupCreateA.argtypes = [
    ctypes.c_void_p,  # Interfaces : RPC_INTERFACE_TEMPLATEA*
    wintypes.DWORD,  # NumIfs : DWORD
    ctypes.c_void_p,  # Endpoints : RPC_ENDPOINT_TEMPLATEA*
    wintypes.DWORD,  # NumEndpoints : DWORD
    wintypes.DWORD,  # IdlePeriod : DWORD
    ctypes.c_void_p,  # IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
    ctypes.POINTER(None),  # IdleCallbackContext : void*
    ctypes.c_void_p,  # IfGroup : void** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
RpcServerInterfaceGroupCreateA = Fiddle::Function.new(
  lib['RpcServerInterfaceGroupCreateA'],
  [
    Fiddle::TYPE_VOIDP,  # Interfaces : RPC_INTERFACE_TEMPLATEA*
    -Fiddle::TYPE_INT,  # NumIfs : DWORD
    Fiddle::TYPE_VOIDP,  # Endpoints : RPC_ENDPOINT_TEMPLATEA*
    -Fiddle::TYPE_INT,  # NumEndpoints : DWORD
    -Fiddle::TYPE_INT,  # IdlePeriod : DWORD
    Fiddle::TYPE_VOIDP,  # IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
    Fiddle::TYPE_VOIDP,  # IdleCallbackContext : void*
    Fiddle::TYPE_VOIDP,  # IfGroup : void** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn RpcServerInterfaceGroupCreateA(
        Interfaces: *mut RPC_INTERFACE_TEMPLATEA,  // RPC_INTERFACE_TEMPLATEA*
        NumIfs: u32,  // DWORD
        Endpoints: *mut RPC_ENDPOINT_TEMPLATEA,  // RPC_ENDPOINT_TEMPLATEA*
        NumEndpoints: u32,  // DWORD
        IdlePeriod: u32,  // DWORD
        IdleCallbackFn: *const core::ffi::c_void,  // RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
        IdleCallbackContext: *mut (),  // void*
        IfGroup: *mut *mut ()  // void** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcServerInterfaceGroupCreateA(IntPtr Interfaces, uint NumIfs, IntPtr Endpoints, uint NumEndpoints, uint IdlePeriod, IntPtr IdleCallbackFn, IntPtr IdleCallbackContext, IntPtr IfGroup);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcServerInterfaceGroupCreateA' -Namespace Win32 -PassThru
# $api::RpcServerInterfaceGroupCreateA(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)
#uselib "RPCRT4.dll"
#func global RpcServerInterfaceGroupCreateA "RpcServerInterfaceGroupCreateA" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; RpcServerInterfaceGroupCreateA varptr(Interfaces), NumIfs, varptr(Endpoints), NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup   ; 戻り値は stat
; Interfaces : RPC_INTERFACE_TEMPLATEA* -> "sptr"
; NumIfs : DWORD -> "sptr"
; Endpoints : RPC_ENDPOINT_TEMPLATEA* -> "sptr"
; NumEndpoints : DWORD -> "sptr"
; IdlePeriod : DWORD -> "sptr"
; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "sptr"
; IdleCallbackContext : void* -> "sptr"
; IfGroup : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RPCRT4.dll"
#cfunc global RpcServerInterfaceGroupCreateA "RpcServerInterfaceGroupCreateA" var, int, var, int, int, sptr, sptr, sptr
; res = RpcServerInterfaceGroupCreateA(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)
; Interfaces : RPC_INTERFACE_TEMPLATEA* -> "var"
; NumIfs : DWORD -> "int"
; Endpoints : RPC_ENDPOINT_TEMPLATEA* -> "var"
; NumEndpoints : DWORD -> "int"
; IdlePeriod : DWORD -> "int"
; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "sptr"
; IdleCallbackContext : void* -> "sptr"
; IfGroup : void** out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; RPC_STATUS RpcServerInterfaceGroupCreateA(RPC_INTERFACE_TEMPLATEA* Interfaces, DWORD NumIfs, RPC_ENDPOINT_TEMPLATEA* Endpoints, DWORD NumEndpoints, DWORD IdlePeriod, RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn, void* IdleCallbackContext, void** IfGroup)
#uselib "RPCRT4.dll"
#cfunc global RpcServerInterfaceGroupCreateA "RpcServerInterfaceGroupCreateA" var, int, var, int, int, intptr, intptr, intptr
; res = RpcServerInterfaceGroupCreateA(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)
; Interfaces : RPC_INTERFACE_TEMPLATEA* -> "var"
; NumIfs : DWORD -> "int"
; Endpoints : RPC_ENDPOINT_TEMPLATEA* -> "var"
; NumEndpoints : DWORD -> "int"
; IdlePeriod : DWORD -> "int"
; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "intptr"
; IdleCallbackContext : void* -> "intptr"
; IfGroup : void** out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcServerInterfaceGroupCreateA = rpcrt4.NewProc("RpcServerInterfaceGroupCreateA")
)

// Interfaces (RPC_INTERFACE_TEMPLATEA*), NumIfs (DWORD), Endpoints (RPC_ENDPOINT_TEMPLATEA*), NumEndpoints (DWORD), IdlePeriod (DWORD), IdleCallbackFn (RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN), IdleCallbackContext (void*), IfGroup (void** out)
r1, _, err := procRpcServerInterfaceGroupCreateA.Call(
	uintptr(Interfaces),
	uintptr(NumIfs),
	uintptr(Endpoints),
	uintptr(NumEndpoints),
	uintptr(IdlePeriod),
	uintptr(IdleCallbackFn),
	uintptr(IdleCallbackContext),
	uintptr(IfGroup),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcServerInterfaceGroupCreateA(
  Interfaces: Pointer;   // RPC_INTERFACE_TEMPLATEA*
  NumIfs: DWORD;   // DWORD
  Endpoints: Pointer;   // RPC_ENDPOINT_TEMPLATEA*
  NumEndpoints: DWORD;   // DWORD
  IdlePeriod: DWORD;   // DWORD
  IdleCallbackFn: Pointer;   // RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
  IdleCallbackContext: Pointer;   // void*
  IfGroup: Pointer   // void** out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcServerInterfaceGroupCreateA';
result := DllCall("RPCRT4\RpcServerInterfaceGroupCreateA"
    , "Ptr", Interfaces   ; RPC_INTERFACE_TEMPLATEA*
    , "UInt", NumIfs   ; DWORD
    , "Ptr", Endpoints   ; RPC_ENDPOINT_TEMPLATEA*
    , "UInt", NumEndpoints   ; DWORD
    , "UInt", IdlePeriod   ; DWORD
    , "Ptr", IdleCallbackFn   ; RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
    , "Ptr", IdleCallbackContext   ; void*
    , "Ptr", IfGroup   ; void** out
    , "Int")   ; return: RPC_STATUS
●RpcServerInterfaceGroupCreateA(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) = DLL("RPCRT4.dll", "int RpcServerInterfaceGroupCreateA(void*, dword, void*, dword, dword, void*, void*, void*)")
# 呼び出し: RpcServerInterfaceGroupCreateA(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)
# Interfaces : RPC_INTERFACE_TEMPLATEA* -> "void*"
# NumIfs : DWORD -> "dword"
# Endpoints : RPC_ENDPOINT_TEMPLATEA* -> "void*"
# NumEndpoints : DWORD -> "dword"
# IdlePeriod : DWORD -> "dword"
# IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "void*"
# IdleCallbackContext : void* -> "void*"
# IfGroup : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。