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

I_RpcServerInqTransportType

関数
サーバーのトランスポート種別を問い合わせる内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

RPC_STATUS I_RpcServerInqTransportType(
    DWORD* Type
);

パラメーター

名前方向
TypeDWORD*inout

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

I_RpcServerInqTransportType = ctypes.windll.rpcrt4.I_RpcServerInqTransportType
I_RpcServerInqTransportType.restype = ctypes.c_int
I_RpcServerInqTransportType.argtypes = [
    ctypes.POINTER(wintypes.DWORD),  # Type : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcServerInqTransportType = Fiddle::Function.new(
  lib['I_RpcServerInqTransportType'],
  [
    Fiddle::TYPE_VOIDP,  # Type : DWORD* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn I_RpcServerInqTransportType(
        Type: *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_RpcServerInqTransportType(ref uint Type);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcServerInqTransportType' -Namespace Win32 -PassThru
# $api::I_RpcServerInqTransportType(Type)
#uselib "RPCRT4.dll"
#func global I_RpcServerInqTransportType "I_RpcServerInqTransportType" sptr
; I_RpcServerInqTransportType varptr(Type)   ; 戻り値は stat
; Type : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RPCRT4.dll"
#cfunc global I_RpcServerInqTransportType "I_RpcServerInqTransportType" var
; res = I_RpcServerInqTransportType(Type)
; Type : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; RPC_STATUS I_RpcServerInqTransportType(DWORD* Type)
#uselib "RPCRT4.dll"
#cfunc global I_RpcServerInqTransportType "I_RpcServerInqTransportType" var
; res = I_RpcServerInqTransportType(Type)
; Type : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcServerInqTransportType = rpcrt4.NewProc("I_RpcServerInqTransportType")
)

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