Win32 API 日本語リファレンス
ホームSystem.Rpc › RpcServerUnsubscribeForNotification

RpcServerUnsubscribeForNotification

関数
RPCサーバーのイベント通知購読を解除する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

RPC_STATUS RpcServerUnsubscribeForNotification(
    void* Binding,   // optional
    RPC_NOTIFICATIONS Notification,
    DWORD* NotificationsQueued
);

パラメーター

名前方向
Bindingvoid*inoptional
NotificationRPC_NOTIFICATIONSin
NotificationsQueuedDWORD*out

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcServerUnsubscribeForNotification(
    void* Binding,   // optional
    RPC_NOTIFICATIONS Notification,
    DWORD* NotificationsQueued
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcServerUnsubscribeForNotification(
    IntPtr Binding,   // void* optional
    int Notification,   // RPC_NOTIFICATIONS
    out uint NotificationsQueued   // DWORD* out
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcServerUnsubscribeForNotification(
    Binding As IntPtr,   ' void* optional
    Notification As Integer,   ' RPC_NOTIFICATIONS
    <Out> ByRef NotificationsQueued As UInteger   ' DWORD* out
) As Integer
End Function
' Binding : void* optional
' Notification : RPC_NOTIFICATIONS
' NotificationsQueued : DWORD* out
Declare PtrSafe Function RpcServerUnsubscribeForNotification Lib "rpcrt4" ( _
    ByVal Binding As LongPtr, _
    ByVal Notification As Long, _
    ByRef NotificationsQueued As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcServerUnsubscribeForNotification = ctypes.windll.rpcrt4.RpcServerUnsubscribeForNotification
RpcServerUnsubscribeForNotification.restype = ctypes.c_int
RpcServerUnsubscribeForNotification.argtypes = [
    ctypes.POINTER(None),  # Binding : void* optional
    ctypes.c_int,  # Notification : RPC_NOTIFICATIONS
    ctypes.POINTER(wintypes.DWORD),  # NotificationsQueued : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcServerUnsubscribeForNotification = rpcrt4.NewProc("RpcServerUnsubscribeForNotification")
)

// Binding (void* optional), Notification (RPC_NOTIFICATIONS), NotificationsQueued (DWORD* out)
r1, _, err := procRpcServerUnsubscribeForNotification.Call(
	uintptr(Binding),
	uintptr(Notification),
	uintptr(NotificationsQueued),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcServerUnsubscribeForNotification(
  Binding: Pointer;   // void* optional
  Notification: Integer;   // RPC_NOTIFICATIONS
  NotificationsQueued: Pointer   // DWORD* out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcServerUnsubscribeForNotification';
result := DllCall("RPCRT4\RpcServerUnsubscribeForNotification"
    , "Ptr", Binding   ; void* optional
    , "Int", Notification   ; RPC_NOTIFICATIONS
    , "Ptr", NotificationsQueued   ; DWORD* out
    , "Int")   ; return: RPC_STATUS
●RpcServerUnsubscribeForNotification(Binding, Notification, NotificationsQueued) = DLL("RPCRT4.dll", "int RpcServerUnsubscribeForNotification(void*, int, void*)")
# 呼び出し: RpcServerUnsubscribeForNotification(Binding, Notification, NotificationsQueued)
# Binding : void* optional -> "void*"
# Notification : RPC_NOTIFICATIONS -> "int"
# NotificationsQueued : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。