ホーム › System.Rpc › I_RpcBindingInqDynamicEndpointW
I_RpcBindingInqDynamicEndpointW
関数バインディングの動的エンドポイントを問い合わせる内部関数(Unicode版)。
シグネチャ
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS I_RpcBindingInqDynamicEndpointW(
void* Binding,
LPWSTR* DynamicEndpoint
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Binding | void* | in |
| DynamicEndpoint | LPWSTR* | out |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS I_RpcBindingInqDynamicEndpointW(
void* Binding,
LPWSTR* DynamicEndpoint
);[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int I_RpcBindingInqDynamicEndpointW(
IntPtr Binding, // void*
IntPtr DynamicEndpoint // LPWSTR* out
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function I_RpcBindingInqDynamicEndpointW(
Binding As IntPtr, ' void*
DynamicEndpoint As IntPtr ' LPWSTR* out
) As Integer
End Function' Binding : void*
' DynamicEndpoint : LPWSTR* out
Declare PtrSafe Function I_RpcBindingInqDynamicEndpointW Lib "rpcrt4" ( _
ByVal Binding As LongPtr, _
ByVal DynamicEndpoint 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
I_RpcBindingInqDynamicEndpointW = ctypes.windll.rpcrt4.I_RpcBindingInqDynamicEndpointW
I_RpcBindingInqDynamicEndpointW.restype = ctypes.c_int
I_RpcBindingInqDynamicEndpointW.argtypes = [
ctypes.POINTER(None), # Binding : void*
ctypes.c_void_p, # DynamicEndpoint : LPWSTR* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcBindingInqDynamicEndpointW = Fiddle::Function.new(
lib['I_RpcBindingInqDynamicEndpointW'],
[
Fiddle::TYPE_VOIDP, # Binding : void*
Fiddle::TYPE_VOIDP, # DynamicEndpoint : LPWSTR* out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rpcrt4")]
extern "system" {
fn I_RpcBindingInqDynamicEndpointW(
Binding: *mut (), // void*
DynamicEndpoint: *mut *mut u16 // LPWSTR* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode)]
public static extern int I_RpcBindingInqDynamicEndpointW(IntPtr Binding, IntPtr DynamicEndpoint);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcBindingInqDynamicEndpointW' -Namespace Win32 -PassThru
# $api::I_RpcBindingInqDynamicEndpointW(Binding, DynamicEndpoint)#uselib "RPCRT4.dll"
#func global I_RpcBindingInqDynamicEndpointW "I_RpcBindingInqDynamicEndpointW" wptr, wptr
; I_RpcBindingInqDynamicEndpointW Binding, varptr(DynamicEndpoint) ; 戻り値は stat
; Binding : void* -> "wptr"
; DynamicEndpoint : LPWSTR* out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global I_RpcBindingInqDynamicEndpointW "I_RpcBindingInqDynamicEndpointW" sptr, var ; res = I_RpcBindingInqDynamicEndpointW(Binding, DynamicEndpoint) ; Binding : void* -> "sptr" ; DynamicEndpoint : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global I_RpcBindingInqDynamicEndpointW "I_RpcBindingInqDynamicEndpointW" sptr, sptr ; res = I_RpcBindingInqDynamicEndpointW(Binding, varptr(DynamicEndpoint)) ; Binding : void* -> "sptr" ; DynamicEndpoint : LPWSTR* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS I_RpcBindingInqDynamicEndpointW(void* Binding, LPWSTR* DynamicEndpoint) #uselib "RPCRT4.dll" #cfunc global I_RpcBindingInqDynamicEndpointW "I_RpcBindingInqDynamicEndpointW" intptr, var ; res = I_RpcBindingInqDynamicEndpointW(Binding, DynamicEndpoint) ; Binding : void* -> "intptr" ; DynamicEndpoint : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS I_RpcBindingInqDynamicEndpointW(void* Binding, LPWSTR* DynamicEndpoint) #uselib "RPCRT4.dll" #cfunc global I_RpcBindingInqDynamicEndpointW "I_RpcBindingInqDynamicEndpointW" intptr, intptr ; res = I_RpcBindingInqDynamicEndpointW(Binding, varptr(DynamicEndpoint)) ; Binding : void* -> "intptr" ; DynamicEndpoint : LPWSTR* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procI_RpcBindingInqDynamicEndpointW = rpcrt4.NewProc("I_RpcBindingInqDynamicEndpointW")
)
// Binding (void*), DynamicEndpoint (LPWSTR* out)
r1, _, err := procI_RpcBindingInqDynamicEndpointW.Call(
uintptr(Binding),
uintptr(DynamicEndpoint),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction I_RpcBindingInqDynamicEndpointW(
Binding: Pointer; // void*
DynamicEndpoint: PPWideChar // LPWSTR* out
): Integer; stdcall;
external 'RPCRT4.dll' name 'I_RpcBindingInqDynamicEndpointW';result := DllCall("RPCRT4\I_RpcBindingInqDynamicEndpointW"
, "Ptr", Binding ; void*
, "Ptr", DynamicEndpoint ; LPWSTR* out
, "Int") ; return: RPC_STATUS●I_RpcBindingInqDynamicEndpointW(Binding, DynamicEndpoint) = DLL("RPCRT4.dll", "int I_RpcBindingInqDynamicEndpointW(void*, void*)")
# 呼び出し: I_RpcBindingInqDynamicEndpointW(Binding, DynamicEndpoint)
# Binding : void* -> "void*"
# DynamicEndpoint : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。