ホーム › System.Rpc › RpcServerInterfaceGroupCreateW
RpcServerInterfaceGroupCreateW
関数複数のインターフェイスとエンドポイントをまとめたインターフェイスグループを作成する(Unicode版)。
シグネチャ
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcServerInterfaceGroupCreateW(
RPC_INTERFACE_TEMPLATEW* Interfaces,
DWORD NumIfs,
RPC_ENDPOINT_TEMPLATEW* Endpoints,
DWORD NumEndpoints,
DWORD IdlePeriod,
RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn,
void* IdleCallbackContext,
void** IfGroup
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Interfaces | RPC_INTERFACE_TEMPLATEW* | in |
| NumIfs | DWORD | in |
| Endpoints | RPC_ENDPOINT_TEMPLATEW* | in |
| NumEndpoints | DWORD | in |
| IdlePeriod | DWORD | in |
| IdleCallbackFn | RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN | in |
| IdleCallbackContext | void* | in |
| IfGroup | void** | out |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcServerInterfaceGroupCreateW(
RPC_INTERFACE_TEMPLATEW* Interfaces,
DWORD NumIfs,
RPC_ENDPOINT_TEMPLATEW* Endpoints,
DWORD NumEndpoints,
DWORD IdlePeriod,
RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn,
void* IdleCallbackContext,
void** IfGroup
);[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcServerInterfaceGroupCreateW(
IntPtr Interfaces, // RPC_INTERFACE_TEMPLATEW*
uint NumIfs, // DWORD
IntPtr Endpoints, // RPC_ENDPOINT_TEMPLATEW*
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.Unicode, ExactSpelling:=True)>
Public Shared Function RpcServerInterfaceGroupCreateW(
Interfaces As IntPtr, ' RPC_INTERFACE_TEMPLATEW*
NumIfs As UInteger, ' DWORD
Endpoints As IntPtr, ' RPC_ENDPOINT_TEMPLATEW*
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_TEMPLATEW*
' NumIfs : DWORD
' Endpoints : RPC_ENDPOINT_TEMPLATEW*
' NumEndpoints : DWORD
' IdlePeriod : DWORD
' IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN
' IdleCallbackContext : void*
' IfGroup : void** out
Declare PtrSafe Function RpcServerInterfaceGroupCreateW 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
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcServerInterfaceGroupCreateW = ctypes.windll.rpcrt4.RpcServerInterfaceGroupCreateW
RpcServerInterfaceGroupCreateW.restype = ctypes.c_int
RpcServerInterfaceGroupCreateW.argtypes = [
ctypes.c_void_p, # Interfaces : RPC_INTERFACE_TEMPLATEW*
wintypes.DWORD, # NumIfs : DWORD
ctypes.c_void_p, # Endpoints : RPC_ENDPOINT_TEMPLATEW*
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')
RpcServerInterfaceGroupCreateW = Fiddle::Function.new(
lib['RpcServerInterfaceGroupCreateW'],
[
Fiddle::TYPE_VOIDP, # Interfaces : RPC_INTERFACE_TEMPLATEW*
-Fiddle::TYPE_INT, # NumIfs : DWORD
Fiddle::TYPE_VOIDP, # Endpoints : RPC_ENDPOINT_TEMPLATEW*
-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)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rpcrt4")]
extern "system" {
fn RpcServerInterfaceGroupCreateW(
Interfaces: *mut RPC_INTERFACE_TEMPLATEW, // RPC_INTERFACE_TEMPLATEW*
NumIfs: u32, // DWORD
Endpoints: *mut RPC_ENDPOINT_TEMPLATEW, // RPC_ENDPOINT_TEMPLATEW*
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.Unicode)]
public static extern int RpcServerInterfaceGroupCreateW(IntPtr Interfaces, uint NumIfs, IntPtr Endpoints, uint NumEndpoints, uint IdlePeriod, IntPtr IdleCallbackFn, IntPtr IdleCallbackContext, IntPtr IfGroup);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcServerInterfaceGroupCreateW' -Namespace Win32 -PassThru
# $api::RpcServerInterfaceGroupCreateW(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)#uselib "RPCRT4.dll"
#func global RpcServerInterfaceGroupCreateW "RpcServerInterfaceGroupCreateW" wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr
; RpcServerInterfaceGroupCreateW varptr(Interfaces), NumIfs, varptr(Endpoints), NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup ; 戻り値は stat
; Interfaces : RPC_INTERFACE_TEMPLATEW* -> "wptr"
; NumIfs : DWORD -> "wptr"
; Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "wptr"
; NumEndpoints : DWORD -> "wptr"
; IdlePeriod : DWORD -> "wptr"
; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "wptr"
; IdleCallbackContext : void* -> "wptr"
; IfGroup : void** out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global RpcServerInterfaceGroupCreateW "RpcServerInterfaceGroupCreateW" var, int, var, int, int, sptr, sptr, sptr ; res = RpcServerInterfaceGroupCreateW(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) ; Interfaces : RPC_INTERFACE_TEMPLATEW* -> "var" ; NumIfs : DWORD -> "int" ; Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "var" ; NumEndpoints : DWORD -> "int" ; IdlePeriod : DWORD -> "int" ; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "sptr" ; IdleCallbackContext : void* -> "sptr" ; IfGroup : void** out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcServerInterfaceGroupCreateW "RpcServerInterfaceGroupCreateW" sptr, int, sptr, int, int, sptr, sptr, sptr ; res = RpcServerInterfaceGroupCreateW(varptr(Interfaces), NumIfs, varptr(Endpoints), NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) ; Interfaces : RPC_INTERFACE_TEMPLATEW* -> "sptr" ; NumIfs : DWORD -> "int" ; Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "sptr" ; NumEndpoints : DWORD -> "int" ; IdlePeriod : DWORD -> "int" ; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "sptr" ; IdleCallbackContext : void* -> "sptr" ; IfGroup : void** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcServerInterfaceGroupCreateW(RPC_INTERFACE_TEMPLATEW* Interfaces, DWORD NumIfs, RPC_ENDPOINT_TEMPLATEW* Endpoints, DWORD NumEndpoints, DWORD IdlePeriod, RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn, void* IdleCallbackContext, void** IfGroup) #uselib "RPCRT4.dll" #cfunc global RpcServerInterfaceGroupCreateW "RpcServerInterfaceGroupCreateW" var, int, var, int, int, intptr, intptr, intptr ; res = RpcServerInterfaceGroupCreateW(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) ; Interfaces : RPC_INTERFACE_TEMPLATEW* -> "var" ; NumIfs : DWORD -> "int" ; Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "var" ; NumEndpoints : DWORD -> "int" ; IdlePeriod : DWORD -> "int" ; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "intptr" ; IdleCallbackContext : void* -> "intptr" ; IfGroup : void** out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcServerInterfaceGroupCreateW(RPC_INTERFACE_TEMPLATEW* Interfaces, DWORD NumIfs, RPC_ENDPOINT_TEMPLATEW* Endpoints, DWORD NumEndpoints, DWORD IdlePeriod, RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN IdleCallbackFn, void* IdleCallbackContext, void** IfGroup) #uselib "RPCRT4.dll" #cfunc global RpcServerInterfaceGroupCreateW "RpcServerInterfaceGroupCreateW" intptr, int, intptr, int, int, intptr, intptr, intptr ; res = RpcServerInterfaceGroupCreateW(varptr(Interfaces), NumIfs, varptr(Endpoints), NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) ; Interfaces : RPC_INTERFACE_TEMPLATEW* -> "intptr" ; NumIfs : DWORD -> "int" ; Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "intptr" ; NumEndpoints : DWORD -> "int" ; IdlePeriod : DWORD -> "int" ; IdleCallbackFn : RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN -> "intptr" ; IdleCallbackContext : void* -> "intptr" ; IfGroup : void** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcServerInterfaceGroupCreateW = rpcrt4.NewProc("RpcServerInterfaceGroupCreateW")
)
// Interfaces (RPC_INTERFACE_TEMPLATEW*), NumIfs (DWORD), Endpoints (RPC_ENDPOINT_TEMPLATEW*), NumEndpoints (DWORD), IdlePeriod (DWORD), IdleCallbackFn (RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN), IdleCallbackContext (void*), IfGroup (void** out)
r1, _, err := procRpcServerInterfaceGroupCreateW.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_STATUSfunction RpcServerInterfaceGroupCreateW(
Interfaces: Pointer; // RPC_INTERFACE_TEMPLATEW*
NumIfs: DWORD; // DWORD
Endpoints: Pointer; // RPC_ENDPOINT_TEMPLATEW*
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 'RpcServerInterfaceGroupCreateW';result := DllCall("RPCRT4\RpcServerInterfaceGroupCreateW"
, "Ptr", Interfaces ; RPC_INTERFACE_TEMPLATEW*
, "UInt", NumIfs ; DWORD
, "Ptr", Endpoints ; RPC_ENDPOINT_TEMPLATEW*
, "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●RpcServerInterfaceGroupCreateW(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup) = DLL("RPCRT4.dll", "int RpcServerInterfaceGroupCreateW(void*, dword, void*, dword, dword, void*, void*, void*)")
# 呼び出し: RpcServerInterfaceGroupCreateW(Interfaces, NumIfs, Endpoints, NumEndpoints, IdlePeriod, IdleCallbackFn, IdleCallbackContext, IfGroup)
# Interfaces : RPC_INTERFACE_TEMPLATEW* -> "void*"
# NumIfs : DWORD -> "dword"
# Endpoints : RPC_ENDPOINT_TEMPLATEW* -> "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)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。