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

MprAdminDeregisterConnectionNotification

関数
接続状態変化通知の登録を解除する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprAdminDeregisterConnectionNotification(
    INT_PTR hMprServer,
    HANDLE hEventNotification
);

パラメーター

名前方向説明
hMprServerINT_PTRinMprAdminServerConnectで取得したRRASサーバー接続ハンドル。ローカルはNULL可。
hEventNotificationHANDLEin登録解除する、以前に登録した通知用イベントオブジェクトのハンドル。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprAdminDeregisterConnectionNotification(
    INT_PTR hMprServer,
    HANDLE hEventNotification
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminDeregisterConnectionNotification(
    IntPtr hMprServer,   // INT_PTR
    IntPtr hEventNotification   // HANDLE
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprAdminDeregisterConnectionNotification(
    hMprServer As IntPtr,   ' INT_PTR
    hEventNotification As IntPtr   ' HANDLE
) As UInteger
End Function
' hMprServer : INT_PTR
' hEventNotification : HANDLE
Declare PtrSafe Function MprAdminDeregisterConnectionNotification Lib "mprapi" ( _
    ByVal hMprServer As LongPtr, _
    ByVal hEventNotification As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MprAdminDeregisterConnectionNotification = ctypes.windll.mprapi.MprAdminDeregisterConnectionNotification
MprAdminDeregisterConnectionNotification.restype = wintypes.DWORD
MprAdminDeregisterConnectionNotification.argtypes = [
    ctypes.c_ssize_t,  # hMprServer : INT_PTR
    wintypes.HANDLE,  # hEventNotification : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminDeregisterConnectionNotification = mprapi.NewProc("MprAdminDeregisterConnectionNotification")
)

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

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

typedef MprAdminDeregisterConnectionNotificationNative = Uint32 Function(IntPtr, Pointer<Void>);
typedef MprAdminDeregisterConnectionNotificationDart = int Function(int, Pointer<Void>);
final MprAdminDeregisterConnectionNotification = DynamicLibrary.open('MPRAPI.dll')
    .lookupFunction<MprAdminDeregisterConnectionNotificationNative, MprAdminDeregisterConnectionNotificationDart>('MprAdminDeregisterConnectionNotification');
// hMprServer : INT_PTR -> IntPtr
// hEventNotification : HANDLE -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function MprAdminDeregisterConnectionNotification(
  hMprServer: NativeInt;   // INT_PTR
  hEventNotification: THandle   // HANDLE
): DWORD; stdcall;
  external 'MPRAPI.dll' name 'MprAdminDeregisterConnectionNotification';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "MprAdminDeregisterConnectionNotification"
  c_MprAdminDeregisterConnectionNotification :: CIntPtr -> Ptr () -> IO Word32
-- hMprServer : INT_PTR -> CIntPtr
-- hEventNotification : HANDLE -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let mpradminderegisterconnectionnotification =
  foreign "MprAdminDeregisterConnectionNotification"
    (intptr_t @-> (ptr void) @-> returning uint32_t)
(* hMprServer : INT_PTR -> intptr_t *)
(* hEventNotification : HANDLE -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library mprapi (t "MPRAPI.dll"))
(cffi:use-foreign-library mprapi)

(cffi:defcfun ("MprAdminDeregisterConnectionNotification" mpr-admin-deregister-connection-notification :convention :stdcall) :uint32
  (h-mpr-server :int64)   ; INT_PTR
  (h-event-notification :pointer))   ; HANDLE
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $MprAdminDeregisterConnectionNotification = Win32::API::More->new('MPRAPI',
    'DWORD MprAdminDeregisterConnectionNotification(LPARAM hMprServer, HANDLE hEventNotification)');
# my $ret = $MprAdminDeregisterConnectionNotification->Call($hMprServer, $hEventNotification);
# hMprServer : INT_PTR -> LPARAM
# hEventNotification : HANDLE -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。