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