Win32 API 日本語リファレンス
ホームNetworkManagement.Rras › RtmHoldDestination

RtmHoldDestination

関数
指定した宛先を一定時間ホールドダウン状態に保持する。
DLLrtm.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD RtmHoldDestination(
    INT_PTR RtmRegHandle,
    INT_PTR DestHandle,
    DWORD TargetViews,
    DWORD HoldTime
);

パラメーター

名前方向
RtmRegHandleINT_PTRin
DestHandleINT_PTRin
TargetViewsDWORDin
HoldTimeDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD RtmHoldDestination(
    INT_PTR RtmRegHandle,
    INT_PTR DestHandle,
    DWORD TargetViews,
    DWORD HoldTime
);
[DllImport("rtm.dll", ExactSpelling = true)]
static extern uint RtmHoldDestination(
    IntPtr RtmRegHandle,   // INT_PTR
    IntPtr DestHandle,   // INT_PTR
    uint TargetViews,   // DWORD
    uint HoldTime   // DWORD
);
<DllImport("rtm.dll", ExactSpelling:=True)>
Public Shared Function RtmHoldDestination(
    RtmRegHandle As IntPtr,   ' INT_PTR
    DestHandle As IntPtr,   ' INT_PTR
    TargetViews As UInteger,   ' DWORD
    HoldTime As UInteger   ' DWORD
) As UInteger
End Function
' RtmRegHandle : INT_PTR
' DestHandle : INT_PTR
' TargetViews : DWORD
' HoldTime : DWORD
Declare PtrSafe Function RtmHoldDestination Lib "rtm" ( _
    ByVal RtmRegHandle As LongPtr, _
    ByVal DestHandle As LongPtr, _
    ByVal TargetViews As Long, _
    ByVal HoldTime As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RtmHoldDestination = ctypes.windll.rtm.RtmHoldDestination
RtmHoldDestination.restype = wintypes.DWORD
RtmHoldDestination.argtypes = [
    ctypes.c_ssize_t,  # RtmRegHandle : INT_PTR
    ctypes.c_ssize_t,  # DestHandle : INT_PTR
    wintypes.DWORD,  # TargetViews : DWORD
    wintypes.DWORD,  # HoldTime : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('rtm.dll')
RtmHoldDestination = Fiddle::Function.new(
  lib['RtmHoldDestination'],
  [
    Fiddle::TYPE_INTPTR_T,  # RtmRegHandle : INT_PTR
    Fiddle::TYPE_INTPTR_T,  # DestHandle : INT_PTR
    -Fiddle::TYPE_INT,  # TargetViews : DWORD
    -Fiddle::TYPE_INT,  # HoldTime : DWORD
  ],
  -Fiddle::TYPE_INT)
#[link(name = "rtm")]
extern "system" {
    fn RtmHoldDestination(
        RtmRegHandle: isize,  // INT_PTR
        DestHandle: isize,  // INT_PTR
        TargetViews: u32,  // DWORD
        HoldTime: u32  // DWORD
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("rtm.dll")]
public static extern uint RtmHoldDestination(IntPtr RtmRegHandle, IntPtr DestHandle, uint TargetViews, uint HoldTime);
"@
$api = Add-Type -MemberDefinition $sig -Name 'rtm_RtmHoldDestination' -Namespace Win32 -PassThru
# $api::RtmHoldDestination(RtmRegHandle, DestHandle, TargetViews, HoldTime)
#uselib "rtm.dll"
#func global RtmHoldDestination "RtmHoldDestination" sptr, sptr, sptr, sptr
; RtmHoldDestination RtmRegHandle, DestHandle, TargetViews, HoldTime   ; 戻り値は stat
; RtmRegHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; TargetViews : DWORD -> "sptr"
; HoldTime : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "rtm.dll"
#cfunc global RtmHoldDestination "RtmHoldDestination" sptr, sptr, int, int
; res = RtmHoldDestination(RtmRegHandle, DestHandle, TargetViews, HoldTime)
; RtmRegHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; TargetViews : DWORD -> "int"
; HoldTime : DWORD -> "int"
; DWORD RtmHoldDestination(INT_PTR RtmRegHandle, INT_PTR DestHandle, DWORD TargetViews, DWORD HoldTime)
#uselib "rtm.dll"
#cfunc global RtmHoldDestination "RtmHoldDestination" intptr, intptr, int, int
; res = RtmHoldDestination(RtmRegHandle, DestHandle, TargetViews, HoldTime)
; RtmRegHandle : INT_PTR -> "intptr"
; DestHandle : INT_PTR -> "intptr"
; TargetViews : DWORD -> "int"
; HoldTime : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rtm = windows.NewLazySystemDLL("rtm.dll")
	procRtmHoldDestination = rtm.NewProc("RtmHoldDestination")
)

// RtmRegHandle (INT_PTR), DestHandle (INT_PTR), TargetViews (DWORD), HoldTime (DWORD)
r1, _, err := procRtmHoldDestination.Call(
	uintptr(RtmRegHandle),
	uintptr(DestHandle),
	uintptr(TargetViews),
	uintptr(HoldTime),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function RtmHoldDestination(
  RtmRegHandle: NativeInt;   // INT_PTR
  DestHandle: NativeInt;   // INT_PTR
  TargetViews: DWORD;   // DWORD
  HoldTime: DWORD   // DWORD
): DWORD; stdcall;
  external 'rtm.dll' name 'RtmHoldDestination';
result := DllCall("rtm\RtmHoldDestination"
    , "Ptr", RtmRegHandle   ; INT_PTR
    , "Ptr", DestHandle   ; INT_PTR
    , "UInt", TargetViews   ; DWORD
    , "UInt", HoldTime   ; DWORD
    , "UInt")   ; return: DWORD
●RtmHoldDestination(RtmRegHandle, DestHandle, TargetViews, HoldTime) = DLL("rtm.dll", "dword RtmHoldDestination(int, int, dword, dword)")
# 呼び出し: RtmHoldDestination(RtmRegHandle, DestHandle, TargetViews, HoldTime)
# RtmRegHandle : INT_PTR -> "int"
# DestHandle : INT_PTR -> "int"
# TargetViews : DWORD -> "dword"
# HoldTime : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。