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