ホーム › NetworkManagement.Rras › RtmMarkDestForChangeNotification
RtmMarkDestForChangeNotification
関数指定した宛先を変更通知の対象としてマーク設定する。
シグネチャ
// rtm.dll
#include <windows.h>
DWORD RtmMarkDestForChangeNotification(
INT_PTR RtmRegHandle,
INT_PTR NotifyHandle,
INT_PTR DestHandle,
BOOL MarkDest
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| RtmRegHandle | INT_PTR | in | RTMクライアント登録ハンドル。 |
| NotifyHandle | INT_PTR | in | 対象の変更通知ハンドル。 |
| DestHandle | INT_PTR | in | 変更通知対象としてマークする宛先ハンドル。 |
| MarkDest | BOOL | in | TRUEでマーク追加、FALSEでマーク解除を指定するBOOL。 |
戻り値の型: DWORD
各言語での呼び出し定義
// rtm.dll
#include <windows.h>
DWORD RtmMarkDestForChangeNotification(
INT_PTR RtmRegHandle,
INT_PTR NotifyHandle,
INT_PTR DestHandle,
BOOL MarkDest
);[DllImport("rtm.dll", ExactSpelling = true)]
static extern uint RtmMarkDestForChangeNotification(
IntPtr RtmRegHandle, // INT_PTR
IntPtr NotifyHandle, // INT_PTR
IntPtr DestHandle, // INT_PTR
bool MarkDest // BOOL
);<DllImport("rtm.dll", ExactSpelling:=True)>
Public Shared Function RtmMarkDestForChangeNotification(
RtmRegHandle As IntPtr, ' INT_PTR
NotifyHandle As IntPtr, ' INT_PTR
DestHandle As IntPtr, ' INT_PTR
MarkDest As Boolean ' BOOL
) As UInteger
End Function' RtmRegHandle : INT_PTR
' NotifyHandle : INT_PTR
' DestHandle : INT_PTR
' MarkDest : BOOL
Declare PtrSafe Function RtmMarkDestForChangeNotification Lib "rtm" ( _
ByVal RtmRegHandle As LongPtr, _
ByVal NotifyHandle As LongPtr, _
ByVal DestHandle As LongPtr, _
ByVal MarkDest As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RtmMarkDestForChangeNotification = ctypes.windll.rtm.RtmMarkDestForChangeNotification
RtmMarkDestForChangeNotification.restype = wintypes.DWORD
RtmMarkDestForChangeNotification.argtypes = [
ctypes.c_ssize_t, # RtmRegHandle : INT_PTR
ctypes.c_ssize_t, # NotifyHandle : INT_PTR
ctypes.c_ssize_t, # DestHandle : INT_PTR
wintypes.BOOL, # MarkDest : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('rtm.dll')
RtmMarkDestForChangeNotification = Fiddle::Function.new(
lib['RtmMarkDestForChangeNotification'],
[
Fiddle::TYPE_INTPTR_T, # RtmRegHandle : INT_PTR
Fiddle::TYPE_INTPTR_T, # NotifyHandle : INT_PTR
Fiddle::TYPE_INTPTR_T, # DestHandle : INT_PTR
Fiddle::TYPE_INT, # MarkDest : BOOL
],
-Fiddle::TYPE_INT)#[link(name = "rtm")]
extern "system" {
fn RtmMarkDestForChangeNotification(
RtmRegHandle: isize, // INT_PTR
NotifyHandle: isize, // INT_PTR
DestHandle: isize, // INT_PTR
MarkDest: i32 // BOOL
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("rtm.dll")]
public static extern uint RtmMarkDestForChangeNotification(IntPtr RtmRegHandle, IntPtr NotifyHandle, IntPtr DestHandle, bool MarkDest);
"@
$api = Add-Type -MemberDefinition $sig -Name 'rtm_RtmMarkDestForChangeNotification' -Namespace Win32 -PassThru
# $api::RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)#uselib "rtm.dll"
#func global RtmMarkDestForChangeNotification "RtmMarkDestForChangeNotification" sptr, sptr, sptr, sptr
; RtmMarkDestForChangeNotification RtmRegHandle, NotifyHandle, DestHandle, MarkDest ; 戻り値は stat
; RtmRegHandle : INT_PTR -> "sptr"
; NotifyHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; MarkDest : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "rtm.dll"
#cfunc global RtmMarkDestForChangeNotification "RtmMarkDestForChangeNotification" sptr, sptr, sptr, int
; res = RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
; RtmRegHandle : INT_PTR -> "sptr"
; NotifyHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; MarkDest : BOOL -> "int"; DWORD RtmMarkDestForChangeNotification(INT_PTR RtmRegHandle, INT_PTR NotifyHandle, INT_PTR DestHandle, BOOL MarkDest)
#uselib "rtm.dll"
#cfunc global RtmMarkDestForChangeNotification "RtmMarkDestForChangeNotification" intptr, intptr, intptr, int
; res = RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
; RtmRegHandle : INT_PTR -> "intptr"
; NotifyHandle : INT_PTR -> "intptr"
; DestHandle : INT_PTR -> "intptr"
; MarkDest : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rtm = windows.NewLazySystemDLL("rtm.dll")
procRtmMarkDestForChangeNotification = rtm.NewProc("RtmMarkDestForChangeNotification")
)
// RtmRegHandle (INT_PTR), NotifyHandle (INT_PTR), DestHandle (INT_PTR), MarkDest (BOOL)
r1, _, err := procRtmMarkDestForChangeNotification.Call(
uintptr(RtmRegHandle),
uintptr(NotifyHandle),
uintptr(DestHandle),
uintptr(MarkDest),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction RtmMarkDestForChangeNotification(
RtmRegHandle: NativeInt; // INT_PTR
NotifyHandle: NativeInt; // INT_PTR
DestHandle: NativeInt; // INT_PTR
MarkDest: BOOL // BOOL
): DWORD; stdcall;
external 'rtm.dll' name 'RtmMarkDestForChangeNotification';result := DllCall("rtm\RtmMarkDestForChangeNotification"
, "Ptr", RtmRegHandle ; INT_PTR
, "Ptr", NotifyHandle ; INT_PTR
, "Ptr", DestHandle ; INT_PTR
, "Int", MarkDest ; BOOL
, "UInt") ; return: DWORD●RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest) = DLL("rtm.dll", "dword RtmMarkDestForChangeNotification(int, int, int, bool)")
# 呼び出し: RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
# RtmRegHandle : INT_PTR -> "int"
# NotifyHandle : INT_PTR -> "int"
# DestHandle : INT_PTR -> "int"
# MarkDest : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rtm" fn RtmMarkDestForChangeNotification(
RtmRegHandle: isize, // INT_PTR
NotifyHandle: isize, // INT_PTR
DestHandle: isize, // INT_PTR
MarkDest: i32 // BOOL
) callconv(std.os.windows.WINAPI) u32;proc RtmMarkDestForChangeNotification(
RtmRegHandle: int, # INT_PTR
NotifyHandle: int, # INT_PTR
DestHandle: int, # INT_PTR
MarkDest: int32 # BOOL
): uint32 {.importc: "RtmMarkDestForChangeNotification", stdcall, dynlib: "rtm.dll".}pragma(lib, "rtm");
extern(Windows)
uint RtmMarkDestForChangeNotification(
ptrdiff_t RtmRegHandle, // INT_PTR
ptrdiff_t NotifyHandle, // INT_PTR
ptrdiff_t DestHandle, // INT_PTR
int MarkDest // BOOL
);ccall((:RtmMarkDestForChangeNotification, "rtm.dll"), stdcall, UInt32,
(Int, Int, Int, Int32),
RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
# RtmRegHandle : INT_PTR -> Int
# NotifyHandle : INT_PTR -> Int
# DestHandle : INT_PTR -> Int
# MarkDest : BOOL -> Int32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t RtmMarkDestForChangeNotification(
intptr_t RtmRegHandle,
intptr_t NotifyHandle,
intptr_t DestHandle,
int32_t MarkDest);
]]
local rtm = ffi.load("rtm")
-- rtm.RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
-- RtmRegHandle : INT_PTR
-- NotifyHandle : INT_PTR
-- DestHandle : INT_PTR
-- MarkDest : BOOL
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('rtm.dll');
const RtmMarkDestForChangeNotification = lib.func('__stdcall', 'RtmMarkDestForChangeNotification', 'uint32_t', ['intptr_t', 'intptr_t', 'intptr_t', 'int32_t']);
// RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
// RtmRegHandle : INT_PTR -> 'intptr_t'
// NotifyHandle : INT_PTR -> 'intptr_t'
// DestHandle : INT_PTR -> 'intptr_t'
// MarkDest : BOOL -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("rtm.dll", {
RtmMarkDestForChangeNotification: { parameters: ["isize", "isize", "isize", "i32"], result: "u32" },
});
// lib.symbols.RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest)
// RtmRegHandle : INT_PTR -> "isize"
// NotifyHandle : INT_PTR -> "isize"
// DestHandle : INT_PTR -> "isize"
// MarkDest : BOOL -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t RtmMarkDestForChangeNotification(
intptr_t RtmRegHandle,
intptr_t NotifyHandle,
intptr_t DestHandle,
int32_t MarkDest);
C, "rtm.dll");
// $ffi->RtmMarkDestForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, MarkDest);
// RtmRegHandle : INT_PTR
// NotifyHandle : INT_PTR
// DestHandle : INT_PTR
// MarkDest : BOOL
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Rtm extends StdCallLibrary {
Rtm INSTANCE = Native.load("rtm", Rtm.class);
int RtmMarkDestForChangeNotification(
long RtmRegHandle, // INT_PTR
long NotifyHandle, // INT_PTR
long DestHandle, // INT_PTR
boolean MarkDest // BOOL
);
}@[Link("rtm")]
lib Librtm
fun RtmMarkDestForChangeNotification = RtmMarkDestForChangeNotification(
RtmRegHandle : LibC::SSizeT, # INT_PTR
NotifyHandle : LibC::SSizeT, # INT_PTR
DestHandle : LibC::SSizeT, # INT_PTR
MarkDest : Int32 # BOOL
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RtmMarkDestForChangeNotificationNative = Uint32 Function(IntPtr, IntPtr, IntPtr, Int32);
typedef RtmMarkDestForChangeNotificationDart = int Function(int, int, int, int);
final RtmMarkDestForChangeNotification = DynamicLibrary.open('rtm.dll')
.lookupFunction<RtmMarkDestForChangeNotificationNative, RtmMarkDestForChangeNotificationDart>('RtmMarkDestForChangeNotification');
// RtmRegHandle : INT_PTR -> IntPtr
// NotifyHandle : INT_PTR -> IntPtr
// DestHandle : INT_PTR -> IntPtr
// MarkDest : BOOL -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RtmMarkDestForChangeNotification(
RtmRegHandle: NativeInt; // INT_PTR
NotifyHandle: NativeInt; // INT_PTR
DestHandle: NativeInt; // INT_PTR
MarkDest: BOOL // BOOL
): DWORD; stdcall;
external 'rtm.dll' name 'RtmMarkDestForChangeNotification';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RtmMarkDestForChangeNotification"
c_RtmMarkDestForChangeNotification :: CIntPtr -> CIntPtr -> CIntPtr -> CInt -> IO Word32
-- RtmRegHandle : INT_PTR -> CIntPtr
-- NotifyHandle : INT_PTR -> CIntPtr
-- DestHandle : INT_PTR -> CIntPtr
-- MarkDest : BOOL -> CInt
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rtmmarkdestforchangenotification =
foreign "RtmMarkDestForChangeNotification"
(intptr_t @-> intptr_t @-> intptr_t @-> int32_t @-> returning uint32_t)
(* RtmRegHandle : INT_PTR -> intptr_t *)
(* NotifyHandle : INT_PTR -> intptr_t *)
(* DestHandle : INT_PTR -> intptr_t *)
(* MarkDest : BOOL -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rtm (t "rtm.dll"))
(cffi:use-foreign-library rtm)
(cffi:defcfun ("RtmMarkDestForChangeNotification" rtm-mark-dest-for-change-notification :convention :stdcall) :uint32
(rtm-reg-handle :int64) ; INT_PTR
(notify-handle :int64) ; INT_PTR
(dest-handle :int64) ; INT_PTR
(mark-dest :int32)) ; BOOL
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RtmMarkDestForChangeNotification = Win32::API::More->new('rtm',
'DWORD RtmMarkDestForChangeNotification(LPARAM RtmRegHandle, LPARAM NotifyHandle, LPARAM DestHandle, BOOL MarkDest)');
# my $ret = $RtmMarkDestForChangeNotification->Call($RtmRegHandle, $NotifyHandle, $DestHandle, $MarkDest);
# RtmRegHandle : INT_PTR -> LPARAM
# NotifyHandle : INT_PTR -> LPARAM
# DestHandle : INT_PTR -> LPARAM
# MarkDest : BOOL -> BOOL
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。