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

RtmGetChangeStatus

関数
指定した宛先に変更通知が保留中かどうかの状態を取得する。
DLLrtm.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD RtmGetChangeStatus(
    INT_PTR RtmRegHandle,
    INT_PTR NotifyHandle,
    INT_PTR DestHandle,
    BOOL* ChangeStatus
);

パラメーター

名前方向
RtmRegHandleINT_PTRin
NotifyHandleINT_PTRin
DestHandleINT_PTRin
ChangeStatusBOOL*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

RtmGetChangeStatus = ctypes.windll.rtm.RtmGetChangeStatus
RtmGetChangeStatus.restype = wintypes.DWORD
RtmGetChangeStatus.argtypes = [
    ctypes.c_ssize_t,  # RtmRegHandle : INT_PTR
    ctypes.c_ssize_t,  # NotifyHandle : INT_PTR
    ctypes.c_ssize_t,  # DestHandle : INT_PTR
    ctypes.c_void_p,  # ChangeStatus : BOOL* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rtm = windows.NewLazySystemDLL("rtm.dll")
	procRtmGetChangeStatus = rtm.NewProc("RtmGetChangeStatus")
)

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