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

I_RpcServerInqLocalConnAddress

関数
接続のローカル側アドレスを問い合わせる内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

RPC_STATUS I_RpcServerInqLocalConnAddress(
    void* Binding,
    void* Buffer,
    DWORD* BufferSize,
    DWORD* AddressFormat
);

パラメーター

名前方向
Bindingvoid*inout
Buffervoid*inout
BufferSizeDWORD*inout
AddressFormatDWORD*inout

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS I_RpcServerInqLocalConnAddress(
    void* Binding,
    void* Buffer,
    DWORD* BufferSize,
    DWORD* AddressFormat
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int I_RpcServerInqLocalConnAddress(
    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_RpcServerInqLocalConnAddress(
    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_RpcServerInqLocalConnAddress 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_RpcServerInqLocalConnAddress = ctypes.windll.rpcrt4.I_RpcServerInqLocalConnAddress
I_RpcServerInqLocalConnAddress.restype = ctypes.c_int
I_RpcServerInqLocalConnAddress.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_RpcServerInqLocalConnAddress = Fiddle::Function.new(
  lib['I_RpcServerInqLocalConnAddress'],
  [
    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_RpcServerInqLocalConnAddress(
        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_RpcServerInqLocalConnAddress(IntPtr Binding, IntPtr Buffer, ref uint BufferSize, ref uint AddressFormat);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcServerInqLocalConnAddress' -Namespace Win32 -PassThru
# $api::I_RpcServerInqLocalConnAddress(Binding, Buffer, BufferSize, AddressFormat)
#uselib "RPCRT4.dll"
#func global I_RpcServerInqLocalConnAddress "I_RpcServerInqLocalConnAddress" sptr, sptr, sptr, sptr
; I_RpcServerInqLocalConnAddress 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_RpcServerInqLocalConnAddress "I_RpcServerInqLocalConnAddress" sptr, sptr, var, var
; res = I_RpcServerInqLocalConnAddress(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 方式にも切替可。
出力引数:
; RPC_STATUS I_RpcServerInqLocalConnAddress(void* Binding, void* Buffer, DWORD* BufferSize, DWORD* AddressFormat)
#uselib "RPCRT4.dll"
#cfunc global I_RpcServerInqLocalConnAddress "I_RpcServerInqLocalConnAddress" intptr, intptr, var, var
; res = I_RpcServerInqLocalConnAddress(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 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcServerInqLocalConnAddress = rpcrt4.NewProc("I_RpcServerInqLocalConnAddress")
)

// Binding (void* in/out), Buffer (void* in/out), BufferSize (DWORD* in/out), AddressFormat (DWORD* in/out)
r1, _, err := procI_RpcServerInqLocalConnAddress.Call(
	uintptr(Binding),
	uintptr(Buffer),
	uintptr(BufferSize),
	uintptr(AddressFormat),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function I_RpcServerInqLocalConnAddress(
  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_RpcServerInqLocalConnAddress';
result := DllCall("RPCRT4\I_RpcServerInqLocalConnAddress"
    , "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_RpcServerInqLocalConnAddress(Binding, Buffer, BufferSize, AddressFormat) = DLL("RPCRT4.dll", "int I_RpcServerInqLocalConnAddress(void*, void*, void*, void*)")
# 呼び出し: I_RpcServerInqLocalConnAddress(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)。