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

I_RpcBindingIsServerLocal

関数
サーバーがローカルかどうかをバインディングから判定する内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

RPC_STATUS I_RpcBindingIsServerLocal(
    void* Binding,
    DWORD* ServerLocalFlag
);

パラメーター

名前方向
Bindingvoid*in
ServerLocalFlagDWORD*out

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

I_RpcBindingIsServerLocal = ctypes.windll.rpcrt4.I_RpcBindingIsServerLocal
I_RpcBindingIsServerLocal.restype = ctypes.c_int
I_RpcBindingIsServerLocal.argtypes = [
    ctypes.POINTER(None),  # Binding : void*
    ctypes.POINTER(wintypes.DWORD),  # ServerLocalFlag : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcBindingIsServerLocal = Fiddle::Function.new(
  lib['I_RpcBindingIsServerLocal'],
  [
    Fiddle::TYPE_VOIDP,  # Binding : void*
    Fiddle::TYPE_VOIDP,  # ServerLocalFlag : DWORD* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn I_RpcBindingIsServerLocal(
        Binding: *mut (),  // void*
        ServerLocalFlag: *mut u32  // DWORD* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int I_RpcBindingIsServerLocal(IntPtr Binding, out uint ServerLocalFlag);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcBindingIsServerLocal' -Namespace Win32 -PassThru
# $api::I_RpcBindingIsServerLocal(Binding, ServerLocalFlag)
#uselib "RPCRT4.dll"
#func global I_RpcBindingIsServerLocal "I_RpcBindingIsServerLocal" sptr, sptr
; I_RpcBindingIsServerLocal Binding, varptr(ServerLocalFlag)   ; 戻り値は stat
; Binding : void* -> "sptr"
; ServerLocalFlag : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RPCRT4.dll"
#cfunc global I_RpcBindingIsServerLocal "I_RpcBindingIsServerLocal" sptr, var
; res = I_RpcBindingIsServerLocal(Binding, ServerLocalFlag)
; Binding : void* -> "sptr"
; ServerLocalFlag : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; RPC_STATUS I_RpcBindingIsServerLocal(void* Binding, DWORD* ServerLocalFlag)
#uselib "RPCRT4.dll"
#cfunc global I_RpcBindingIsServerLocal "I_RpcBindingIsServerLocal" intptr, var
; res = I_RpcBindingIsServerLocal(Binding, ServerLocalFlag)
; Binding : void* -> "intptr"
; ServerLocalFlag : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcBindingIsServerLocal = rpcrt4.NewProc("I_RpcBindingIsServerLocal")
)

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