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