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

RtmIsMarkedForChangeNotification

関数
指定した宛先が変更通知の対象としてマーク済みか調べる。
DLLrtm.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD RtmIsMarkedForChangeNotification(
    INT_PTR RtmRegHandle,
    INT_PTR NotifyHandle,
    INT_PTR DestHandle,
    BOOL* DestMarked
);

パラメーター

名前方向説明
RtmRegHandleINT_PTRinRTMクライアント登録ハンドル。
NotifyHandleINT_PTRin対象の変更通知ハンドル。
DestHandleINT_PTRinマーク有無を問い合わせる宛先ハンドル。
DestMarkedBOOL*inout対象宛先が変更通知対象としてマーク済みならTRUEを受け取るBOOLポインタ。

戻り値の型: DWORD

各言語での呼び出し定義

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

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

RtmIsMarkedForChangeNotification = ctypes.windll.rtm.RtmIsMarkedForChangeNotification
RtmIsMarkedForChangeNotification.restype = wintypes.DWORD
RtmIsMarkedForChangeNotification.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,  # DestMarked : BOOL* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rtm = windows.NewLazySystemDLL("rtm.dll")
	procRtmIsMarkedForChangeNotification = rtm.NewProc("RtmIsMarkedForChangeNotification")
)

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

extern "rtm" fn RtmIsMarkedForChangeNotification(
    RtmRegHandle: isize, // INT_PTR
    NotifyHandle: isize, // INT_PTR
    DestHandle: isize, // INT_PTR
    DestMarked: [*c]i32 // BOOL* in/out
) callconv(std.os.windows.WINAPI) u32;
proc RtmIsMarkedForChangeNotification(
    RtmRegHandle: int,  # INT_PTR
    NotifyHandle: int,  # INT_PTR
    DestHandle: int,  # INT_PTR
    DestMarked: ptr int32  # BOOL* in/out
): uint32 {.importc: "RtmIsMarkedForChangeNotification", stdcall, dynlib: "rtm.dll".}
pragma(lib, "rtm");
extern(Windows)
uint RtmIsMarkedForChangeNotification(
    ptrdiff_t RtmRegHandle,   // INT_PTR
    ptrdiff_t NotifyHandle,   // INT_PTR
    ptrdiff_t DestHandle,   // INT_PTR
    int* DestMarked   // BOOL* in/out
);
ccall((:RtmIsMarkedForChangeNotification, "rtm.dll"), stdcall, UInt32,
      (Int, Int, Int, Ptr{Int32}),
      RtmRegHandle, NotifyHandle, DestHandle, DestMarked)
# RtmRegHandle : INT_PTR -> Int
# NotifyHandle : INT_PTR -> Int
# DestHandle : INT_PTR -> Int
# DestMarked : BOOL* in/out -> Ptr{Int32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t RtmIsMarkedForChangeNotification(
    intptr_t RtmRegHandle,
    intptr_t NotifyHandle,
    intptr_t DestHandle,
    int32_t* DestMarked);
]]
local rtm = ffi.load("rtm")
-- rtm.RtmIsMarkedForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, DestMarked)
-- RtmRegHandle : INT_PTR
-- NotifyHandle : INT_PTR
-- DestHandle : INT_PTR
-- DestMarked : BOOL* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('rtm.dll');
const RtmIsMarkedForChangeNotification = lib.func('__stdcall', 'RtmIsMarkedForChangeNotification', 'uint32_t', ['intptr_t', 'intptr_t', 'intptr_t', 'int32_t *']);
// RtmIsMarkedForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, DestMarked)
// RtmRegHandle : INT_PTR -> 'intptr_t'
// NotifyHandle : INT_PTR -> 'intptr_t'
// DestHandle : INT_PTR -> 'intptr_t'
// DestMarked : BOOL* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("rtm.dll", {
  RtmIsMarkedForChangeNotification: { parameters: ["isize", "isize", "isize", "pointer"], result: "u32" },
});
// lib.symbols.RtmIsMarkedForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, DestMarked)
// RtmRegHandle : INT_PTR -> "isize"
// NotifyHandle : INT_PTR -> "isize"
// DestHandle : INT_PTR -> "isize"
// DestMarked : BOOL* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t RtmIsMarkedForChangeNotification(
    intptr_t RtmRegHandle,
    intptr_t NotifyHandle,
    intptr_t DestHandle,
    int32_t* DestMarked);
C, "rtm.dll");
// $ffi->RtmIsMarkedForChangeNotification(RtmRegHandle, NotifyHandle, DestHandle, DestMarked);
// RtmRegHandle : INT_PTR
// NotifyHandle : INT_PTR
// DestHandle : INT_PTR
// DestMarked : BOOL* in/out
// 構造体/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 RtmIsMarkedForChangeNotification(
        long RtmRegHandle,   // INT_PTR
        long NotifyHandle,   // INT_PTR
        long DestHandle,   // INT_PTR
        IntByReference DestMarked   // BOOL* in/out
    );
}
@[Link("rtm")]
lib Librtm
  fun RtmIsMarkedForChangeNotification = RtmIsMarkedForChangeNotification(
    RtmRegHandle : LibC::SSizeT,   # INT_PTR
    NotifyHandle : LibC::SSizeT,   # INT_PTR
    DestHandle : LibC::SSizeT,   # INT_PTR
    DestMarked : Int32*   # BOOL* in/out
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RtmIsMarkedForChangeNotificationNative = Uint32 Function(IntPtr, IntPtr, IntPtr, Pointer<Int32>);
typedef RtmIsMarkedForChangeNotificationDart = int Function(int, int, int, Pointer<Int32>);
final RtmIsMarkedForChangeNotification = DynamicLibrary.open('rtm.dll')
    .lookupFunction<RtmIsMarkedForChangeNotificationNative, RtmIsMarkedForChangeNotificationDart>('RtmIsMarkedForChangeNotification');
// RtmRegHandle : INT_PTR -> IntPtr
// NotifyHandle : INT_PTR -> IntPtr
// DestHandle : INT_PTR -> IntPtr
// DestMarked : BOOL* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RtmIsMarkedForChangeNotification(
  RtmRegHandle: NativeInt;   // INT_PTR
  NotifyHandle: NativeInt;   // INT_PTR
  DestHandle: NativeInt;   // INT_PTR
  DestMarked: Pointer   // BOOL* in/out
): DWORD; stdcall;
  external 'rtm.dll' name 'RtmIsMarkedForChangeNotification';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RtmIsMarkedForChangeNotification"
  c_RtmIsMarkedForChangeNotification :: CIntPtr -> CIntPtr -> CIntPtr -> Ptr CInt -> IO Word32
-- RtmRegHandle : INT_PTR -> CIntPtr
-- NotifyHandle : INT_PTR -> CIntPtr
-- DestHandle : INT_PTR -> CIntPtr
-- DestMarked : BOOL* in/out -> Ptr CInt
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let rtmismarkedforchangenotification =
  foreign "RtmIsMarkedForChangeNotification"
    (intptr_t @-> intptr_t @-> intptr_t @-> (ptr int32_t) @-> returning uint32_t)
(* RtmRegHandle : INT_PTR -> intptr_t *)
(* NotifyHandle : INT_PTR -> intptr_t *)
(* DestHandle : INT_PTR -> intptr_t *)
(* DestMarked : BOOL* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library rtm (t "rtm.dll"))
(cffi:use-foreign-library rtm)

(cffi:defcfun ("RtmIsMarkedForChangeNotification" rtm-is-marked-for-change-notification :convention :stdcall) :uint32
  (rtm-reg-handle :int64)   ; INT_PTR
  (notify-handle :int64)   ; INT_PTR
  (dest-handle :int64)   ; INT_PTR
  (dest-marked :pointer))   ; BOOL* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RtmIsMarkedForChangeNotification = Win32::API::More->new('rtm',
    'DWORD RtmIsMarkedForChangeNotification(LPARAM RtmRegHandle, LPARAM NotifyHandle, LPARAM DestHandle, LPVOID DestMarked)');
# my $ret = $RtmIsMarkedForChangeNotification->Call($RtmRegHandle, $NotifyHandle, $DestHandle, $DestMarked);
# RtmRegHandle : INT_PTR -> LPARAM
# NotifyHandle : INT_PTR -> LPARAM
# DestHandle : INT_PTR -> LPARAM
# DestMarked : BOOL* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。