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

I_RpcBindingCopy

関数
ソースのバインディングハンドルを複製する内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

RPC_STATUS I_RpcBindingCopy(
    void* SourceBinding,
    void** DestinationBinding
);

パラメーター

名前方向
SourceBindingvoid*inout
DestinationBindingvoid**inout

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

I_RpcBindingCopy = ctypes.windll.rpcrt4.I_RpcBindingCopy
I_RpcBindingCopy.restype = ctypes.c_int
I_RpcBindingCopy.argtypes = [
    ctypes.POINTER(None),  # SourceBinding : void* in/out
    ctypes.c_void_p,  # DestinationBinding : void** in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcBindingCopy = rpcrt4.NewProc("I_RpcBindingCopy")
)

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