ホーム › System.Rpc › I_RpcServerInqRemoteConnAddress
I_RpcServerInqRemoteConnAddress
関数接続のリモート側アドレスを問い合わせる内部関数。
シグネチャ
// RPCRT4.dll
#include <windows.h>
RPC_STATUS I_RpcServerInqRemoteConnAddress(
void* Binding,
void* Buffer,
DWORD* BufferSize,
DWORD* AddressFormat
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Binding | void* | inout |
| Buffer | void* | inout |
| BufferSize | DWORD* | inout |
| AddressFormat | DWORD* | inout |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
RPC_STATUS I_RpcServerInqRemoteConnAddress(
void* Binding,
void* Buffer,
DWORD* BufferSize,
DWORD* AddressFormat
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int I_RpcServerInqRemoteConnAddress(
IntPtr Binding, // void* in/out
IntPtr Buffer, // void* in/out
ref uint BufferSize, // DWORD* in/out
ref uint AddressFormat // DWORD* in/out
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function I_RpcServerInqRemoteConnAddress(
Binding As IntPtr, ' void* in/out
Buffer As IntPtr, ' void* in/out
ByRef BufferSize As UInteger, ' DWORD* in/out
ByRef AddressFormat As UInteger ' DWORD* in/out
) As Integer
End Function' Binding : void* in/out
' Buffer : void* in/out
' BufferSize : DWORD* in/out
' AddressFormat : DWORD* in/out
Declare PtrSafe Function I_RpcServerInqRemoteConnAddress Lib "rpcrt4" ( _
ByVal Binding As LongPtr, _
ByVal Buffer As LongPtr, _
ByRef BufferSize As Long, _
ByRef AddressFormat As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
I_RpcServerInqRemoteConnAddress = ctypes.windll.rpcrt4.I_RpcServerInqRemoteConnAddress
I_RpcServerInqRemoteConnAddress.restype = ctypes.c_int
I_RpcServerInqRemoteConnAddress.argtypes = [
ctypes.POINTER(None), # Binding : void* in/out
ctypes.POINTER(None), # Buffer : void* in/out
ctypes.POINTER(wintypes.DWORD), # BufferSize : DWORD* in/out
ctypes.POINTER(wintypes.DWORD), # AddressFormat : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcServerInqRemoteConnAddress = Fiddle::Function.new(
lib['I_RpcServerInqRemoteConnAddress'],
[
Fiddle::TYPE_VOIDP, # Binding : void* in/out
Fiddle::TYPE_VOIDP, # Buffer : void* in/out
Fiddle::TYPE_VOIDP, # BufferSize : DWORD* in/out
Fiddle::TYPE_VOIDP, # AddressFormat : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn I_RpcServerInqRemoteConnAddress(
Binding: *mut (), // void* in/out
Buffer: *mut (), // void* in/out
BufferSize: *mut u32, // DWORD* in/out
AddressFormat: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int I_RpcServerInqRemoteConnAddress(IntPtr Binding, IntPtr Buffer, ref uint BufferSize, ref uint AddressFormat);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcServerInqRemoteConnAddress' -Namespace Win32 -PassThru
# $api::I_RpcServerInqRemoteConnAddress(Binding, Buffer, BufferSize, AddressFormat)#uselib "RPCRT4.dll"
#func global I_RpcServerInqRemoteConnAddress "I_RpcServerInqRemoteConnAddress" sptr, sptr, sptr, sptr
; I_RpcServerInqRemoteConnAddress Binding, Buffer, varptr(BufferSize), varptr(AddressFormat) ; 戻り値は stat
; Binding : void* in/out -> "sptr"
; Buffer : void* in/out -> "sptr"
; BufferSize : DWORD* in/out -> "sptr"
; AddressFormat : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global I_RpcServerInqRemoteConnAddress "I_RpcServerInqRemoteConnAddress" sptr, sptr, var, var ; res = I_RpcServerInqRemoteConnAddress(Binding, Buffer, BufferSize, AddressFormat) ; Binding : void* in/out -> "sptr" ; Buffer : void* in/out -> "sptr" ; BufferSize : DWORD* in/out -> "var" ; AddressFormat : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global I_RpcServerInqRemoteConnAddress "I_RpcServerInqRemoteConnAddress" sptr, sptr, sptr, sptr ; res = I_RpcServerInqRemoteConnAddress(Binding, Buffer, varptr(BufferSize), varptr(AddressFormat)) ; Binding : void* in/out -> "sptr" ; Buffer : void* in/out -> "sptr" ; BufferSize : DWORD* in/out -> "sptr" ; AddressFormat : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS I_RpcServerInqRemoteConnAddress(void* Binding, void* Buffer, DWORD* BufferSize, DWORD* AddressFormat) #uselib "RPCRT4.dll" #cfunc global I_RpcServerInqRemoteConnAddress "I_RpcServerInqRemoteConnAddress" intptr, intptr, var, var ; res = I_RpcServerInqRemoteConnAddress(Binding, Buffer, BufferSize, AddressFormat) ; Binding : void* in/out -> "intptr" ; Buffer : void* in/out -> "intptr" ; BufferSize : DWORD* in/out -> "var" ; AddressFormat : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS I_RpcServerInqRemoteConnAddress(void* Binding, void* Buffer, DWORD* BufferSize, DWORD* AddressFormat) #uselib "RPCRT4.dll" #cfunc global I_RpcServerInqRemoteConnAddress "I_RpcServerInqRemoteConnAddress" intptr, intptr, intptr, intptr ; res = I_RpcServerInqRemoteConnAddress(Binding, Buffer, varptr(BufferSize), varptr(AddressFormat)) ; Binding : void* in/out -> "intptr" ; Buffer : void* in/out -> "intptr" ; BufferSize : DWORD* in/out -> "intptr" ; AddressFormat : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procI_RpcServerInqRemoteConnAddress = rpcrt4.NewProc("I_RpcServerInqRemoteConnAddress")
)
// Binding (void* in/out), Buffer (void* in/out), BufferSize (DWORD* in/out), AddressFormat (DWORD* in/out)
r1, _, err := procI_RpcServerInqRemoteConnAddress.Call(
uintptr(Binding),
uintptr(Buffer),
uintptr(BufferSize),
uintptr(AddressFormat),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction I_RpcServerInqRemoteConnAddress(
Binding: Pointer; // void* in/out
Buffer: Pointer; // void* in/out
BufferSize: Pointer; // DWORD* in/out
AddressFormat: Pointer // DWORD* in/out
): Integer; stdcall;
external 'RPCRT4.dll' name 'I_RpcServerInqRemoteConnAddress';result := DllCall("RPCRT4\I_RpcServerInqRemoteConnAddress"
, "Ptr", Binding ; void* in/out
, "Ptr", Buffer ; void* in/out
, "Ptr", BufferSize ; DWORD* in/out
, "Ptr", AddressFormat ; DWORD* in/out
, "Int") ; return: RPC_STATUS●I_RpcServerInqRemoteConnAddress(Binding, Buffer, BufferSize, AddressFormat) = DLL("RPCRT4.dll", "int I_RpcServerInqRemoteConnAddress(void*, void*, void*, void*)")
# 呼び出し: I_RpcServerInqRemoteConnAddress(Binding, Buffer, BufferSize, AddressFormat)
# Binding : void* in/out -> "void*"
# Buffer : void* in/out -> "void*"
# BufferSize : DWORD* in/out -> "void*"
# AddressFormat : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。