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