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