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

RtmGetEntityInfo

関数
指定エンティティの情報を取得する。
DLLrtm.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD RtmGetEntityInfo(
    INT_PTR RtmRegHandle,
    INT_PTR EntityHandle,
    RTM_ENTITY_INFO* EntityInfo
);

パラメーター

名前方向
RtmRegHandleINT_PTRin
EntityHandleINT_PTRin
EntityInfoRTM_ENTITY_INFO*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

RtmGetEntityInfo = ctypes.windll.rtm.RtmGetEntityInfo
RtmGetEntityInfo.restype = wintypes.DWORD
RtmGetEntityInfo.argtypes = [
    ctypes.c_ssize_t,  # RtmRegHandle : INT_PTR
    ctypes.c_ssize_t,  # EntityHandle : INT_PTR
    ctypes.c_void_p,  # EntityInfo : RTM_ENTITY_INFO* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('rtm.dll')
RtmGetEntityInfo = Fiddle::Function.new(
  lib['RtmGetEntityInfo'],
  [
    Fiddle::TYPE_INTPTR_T,  # RtmRegHandle : INT_PTR
    Fiddle::TYPE_INTPTR_T,  # EntityHandle : INT_PTR
    Fiddle::TYPE_VOIDP,  # EntityInfo : RTM_ENTITY_INFO* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "rtm")]
extern "system" {
    fn RtmGetEntityInfo(
        RtmRegHandle: isize,  // INT_PTR
        EntityHandle: isize,  // INT_PTR
        EntityInfo: *mut RTM_ENTITY_INFO  // RTM_ENTITY_INFO* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("rtm.dll")]
public static extern uint RtmGetEntityInfo(IntPtr RtmRegHandle, IntPtr EntityHandle, IntPtr EntityInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'rtm_RtmGetEntityInfo' -Namespace Win32 -PassThru
# $api::RtmGetEntityInfo(RtmRegHandle, EntityHandle, EntityInfo)
#uselib "rtm.dll"
#func global RtmGetEntityInfo "RtmGetEntityInfo" sptr, sptr, sptr
; RtmGetEntityInfo RtmRegHandle, EntityHandle, varptr(EntityInfo)   ; 戻り値は stat
; RtmRegHandle : INT_PTR -> "sptr"
; EntityHandle : INT_PTR -> "sptr"
; EntityInfo : RTM_ENTITY_INFO* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "rtm.dll"
#cfunc global RtmGetEntityInfo "RtmGetEntityInfo" sptr, sptr, var
; res = RtmGetEntityInfo(RtmRegHandle, EntityHandle, EntityInfo)
; RtmRegHandle : INT_PTR -> "sptr"
; EntityHandle : INT_PTR -> "sptr"
; EntityInfo : RTM_ENTITY_INFO* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD RtmGetEntityInfo(INT_PTR RtmRegHandle, INT_PTR EntityHandle, RTM_ENTITY_INFO* EntityInfo)
#uselib "rtm.dll"
#cfunc global RtmGetEntityInfo "RtmGetEntityInfo" intptr, intptr, var
; res = RtmGetEntityInfo(RtmRegHandle, EntityHandle, EntityInfo)
; RtmRegHandle : INT_PTR -> "intptr"
; EntityHandle : INT_PTR -> "intptr"
; EntityInfo : RTM_ENTITY_INFO* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rtm = windows.NewLazySystemDLL("rtm.dll")
	procRtmGetEntityInfo = rtm.NewProc("RtmGetEntityInfo")
)

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