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

RpcEpResolveBinding

関数
エンドポイントマッパーでバインディングを解決する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcEpResolveBinding(
    void* Binding,
    void* IfSpec
);

パラメーター

名前方向
Bindingvoid*in
IfSpecvoid*in

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcEpResolveBinding(
    void* Binding,
    void* IfSpec
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcEpResolveBinding(
    IntPtr Binding,   // void*
    IntPtr IfSpec   // void*
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcEpResolveBinding(
    Binding As IntPtr,   ' void*
    IfSpec As IntPtr   ' void*
) As Integer
End Function
' Binding : void*
' IfSpec : void*
Declare PtrSafe Function RpcEpResolveBinding Lib "rpcrt4" ( _
    ByVal Binding As LongPtr, _
    ByVal IfSpec As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcEpResolveBinding = ctypes.windll.rpcrt4.RpcEpResolveBinding
RpcEpResolveBinding.restype = ctypes.c_int
RpcEpResolveBinding.argtypes = [
    ctypes.POINTER(None),  # Binding : void*
    ctypes.POINTER(None),  # IfSpec : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
RpcEpResolveBinding = Fiddle::Function.new(
  lib['RpcEpResolveBinding'],
  [
    Fiddle::TYPE_VOIDP,  # Binding : void*
    Fiddle::TYPE_VOIDP,  # IfSpec : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn RpcEpResolveBinding(
        Binding: *mut (),  // void*
        IfSpec: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int RpcEpResolveBinding(IntPtr Binding, IntPtr IfSpec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcEpResolveBinding' -Namespace Win32 -PassThru
# $api::RpcEpResolveBinding(Binding, IfSpec)
#uselib "RPCRT4.dll"
#func global RpcEpResolveBinding "RpcEpResolveBinding" sptr, sptr
; RpcEpResolveBinding Binding, IfSpec   ; 戻り値は stat
; Binding : void* -> "sptr"
; IfSpec : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RPCRT4.dll"
#cfunc global RpcEpResolveBinding "RpcEpResolveBinding" sptr, sptr
; res = RpcEpResolveBinding(Binding, IfSpec)
; Binding : void* -> "sptr"
; IfSpec : void* -> "sptr"
; RPC_STATUS RpcEpResolveBinding(void* Binding, void* IfSpec)
#uselib "RPCRT4.dll"
#cfunc global RpcEpResolveBinding "RpcEpResolveBinding" intptr, intptr
; res = RpcEpResolveBinding(Binding, IfSpec)
; Binding : void* -> "intptr"
; IfSpec : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcEpResolveBinding = rpcrt4.NewProc("RpcEpResolveBinding")
)

// Binding (void*), IfSpec (void*)
r1, _, err := procRpcEpResolveBinding.Call(
	uintptr(Binding),
	uintptr(IfSpec),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcEpResolveBinding(
  Binding: Pointer;   // void*
  IfSpec: Pointer   // void*
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcEpResolveBinding';
result := DllCall("RPCRT4\RpcEpResolveBinding"
    , "Ptr", Binding   ; void*
    , "Ptr", IfSpec   ; void*
    , "Int")   ; return: RPC_STATUS
●RpcEpResolveBinding(Binding, IfSpec) = DLL("RPCRT4.dll", "int RpcEpResolveBinding(void*, void*)")
# 呼び出し: RpcEpResolveBinding(Binding, IfSpec)
# Binding : void* -> "void*"
# IfSpec : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。