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

RtmGetEntityMethods

関数
指定エンティティがエクスポートするメソッドを取得する。
DLLrtm.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD RtmGetEntityMethods(
    INT_PTR RtmRegHandle,
    INT_PTR EntityHandle,
    DWORD* NumMethods,
    RTM_ENTITY_EXPORT_METHOD* ExptMethods
);

パラメーター

名前方向
RtmRegHandleINT_PTRin
EntityHandleINT_PTRin
NumMethodsDWORD*inout
ExptMethodsRTM_ENTITY_EXPORT_METHOD*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

RtmGetEntityMethods = ctypes.windll.rtm.RtmGetEntityMethods
RtmGetEntityMethods.restype = wintypes.DWORD
RtmGetEntityMethods.argtypes = [
    ctypes.c_ssize_t,  # RtmRegHandle : INT_PTR
    ctypes.c_ssize_t,  # EntityHandle : INT_PTR
    ctypes.POINTER(wintypes.DWORD),  # NumMethods : DWORD* in/out
    ctypes.c_void_p,  # ExptMethods : RTM_ENTITY_EXPORT_METHOD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rtm = windows.NewLazySystemDLL("rtm.dll")
	procRtmGetEntityMethods = rtm.NewProc("RtmGetEntityMethods")
)

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