RpcServerSubscribeForNotification
関数シグネチャ
// RPCRT4.dll
#include <windows.h>
RPC_STATUS RpcServerSubscribeForNotification(
void* Binding, // optional
RPC_NOTIFICATIONS Notification,
RPC_NOTIFICATION_TYPES NotificationType,
RPC_ASYNC_NOTIFICATION_INFO* NotificationInfo
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| Binding | void* | inoptional | 現在の呼び出しのバインディングハンドルを格納する RPC_BINDING_HANDLE 構造体です。RPC が呼び出しをディスパッチしたスレッドと同じスレッドでこの関数を呼び出す場合、このパラメーターには NULL を指定できます。それ以外の場合は、明示的なバインディングハンドルをこのパラメーターに渡す必要があります。 |
| Notification | RPC_NOTIFICATIONS | in | サーバーが RPC に要求する通知の種類を指定する RPC_NOTIFICATIONS 列挙値のビット単位の組み合わせです。 Windows Vista: 現在、サポートされているのは RpcNotificationClientDisconnect と RpcNotificationCallCancel のみです。このパラメーターにこれら以外の値を指定した場合、RPC_S_CANNOT_SUPPORT エラーコードが返されます。 |
| NotificationType | RPC_NOTIFICATION_TYPES | in | RPC がサーバーに通知する方法を指定する RPC_NOTIFICATION_TYPES 列挙値です。 Windows Vista: RpcNotificationTypeNone はサポートされていません。この値を指定した場合、RPC_S_INVALID_ARG エラーコードが返されます。 |
| NotificationInfo | RPC_ASYNC_NOTIFICATION_INFO* | in | RPC が通知のためにサーバーへ連絡するのに必要な固有の情報を格納する RPC_ASYNC_NOTIFICATION_INFO 共用体へのポインターです。この共用体に格納されるデータは、NotificationType パラメーターに渡された方法に固有のものです。 NotificationTypes に RpcNotificationTypeCallback の方法を指定した場合、共用体の対応するブランチの NotificationRoutine メンバーには、同期呼び出しの場合はバインディングハンドルが、非同期呼び出しの場合は非同期ハンドルが設定されます。 RPC は、この関数の呼び出しが成功した時点でこのパラメーターのコピーを作成します。呼び出し元は、API から制御が戻った後にこのパラメーターを解放または更新できます。 |
戻り値の型: RPC_STATUS
公式ドキュメント
RPC 通知に対してサーバーをサブスクライブします。
戻り値
解説(Remarks)
呼び出し元が RpcNotificationTypeEvent 以外の通知の種類を指定した場合、1 回の呼び出しで RpcNotificationClientDisconnect と RpcNotificationCallCancel の両方の通知をサブスクライブできます。イベントの場合は、この API を 2 回に分けて呼び出す必要があります。
サーバーアプリケーションは、RPC 呼び出しが完了する前に通知のサブスクライブを解除する必要があります。RPC 呼び出しが同期の場合、サーバーが RPC に戻り値を返した時点で完了します。RPC 呼び出しが非同期の場合、サーバーが RpcAsyncCompleteCall または RpcAsyncAbortCall を呼び出したとき、あるいはマネージャールーチンから例外をスローしたときに完了します。サーバーが呼び出しの状態変更通知のサブスクライブ解除に失敗した場合、結果は未定義となり、後になってサーバーがクラッシュする可能性があります。サブスクリプションは 1 つの RPC 呼び出しにのみ適用される点に注意してください。サーバーアプリケーションが複数の呼び出しを監視する必要がある場合は、呼び出しごとに個別にサブスクライブする必要があります。
サーバーアプリケーションは、サブスクライブしていない通知についてシグナルを受け取ることはないと想定できます。複数の通知をサブスクライブしている場合、選択した完了方法が許可していれば、各通知はその完了方法を通じて伝えられます。通知の伝達が許可されていない場合、サーバーアプリケーションは RPC サーバー API のいずれかを呼び出して、クライアントが呼び出しをキャンセルしたか切断したかをテストできます。次の表は、通知の種類 (呼び出しのキャンセルまたはクライアントの切断) が各通知方法にどのように伝えられるかを示しています。
| 通知方法 | イベント/通知の種類 |
|---|---|
| RpcNotificationTypeNone | サブスクリプションには使用できません。 |
| RpcNotificationTypeEvent | 通知の種類は利用できません。 |
| RpcNotificationTypeApc | 通知の種類は APC 関数の Event パラメーターで取得できます。 |
| RpcNotificationTypeIoc | 通知の種類は利用できません。 |
| RpcNotificationTypeCallback | 通知の種類はコールバック関数の Event パラメーターで取得できます。 |
この表は、指定した通知方法を使用して呼び出し元が通知をサブスクライブできるかどうかを示すものではありません。あくまで、通知を受け取ったときに呼び出し元が取得できる情報 (通知の種類など) を示しているだけです。
呼び出し元は、同じバインディングハンドルに対する RpcServerSubscribeForNotification と RpcServerUnsubscribeForNotification の間で同期を取る必要があります。これらが同時に呼び出された場合、結果は未定義となり、通知の消失、余分な通知、通知数の不整合、プロセスのクラッシュ、データの破損、メモリリークが発生する可能性があります。同じバインディングハンドルに対して RpcServerSubscribeForNotification を呼び出すスレッドについても同様の注意が必要です。
同じバインディングハンドルに対して RpcServerSubscribeForNotification と RpcServerUnsubscribeForNotification を呼び出すことはスレッドセーフです。現行の通知では、RPC は 1 回の呼び出しにつき最大 1 回だけサーバーに通知します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
RPC_STATUS RpcServerSubscribeForNotification(
void* Binding, // optional
RPC_NOTIFICATIONS Notification,
RPC_NOTIFICATION_TYPES NotificationType,
RPC_ASYNC_NOTIFICATION_INFO* NotificationInfo
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcServerSubscribeForNotification(
IntPtr Binding, // void* optional
int Notification, // RPC_NOTIFICATIONS
int NotificationType, // RPC_NOTIFICATION_TYPES
IntPtr NotificationInfo // RPC_ASYNC_NOTIFICATION_INFO*
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcServerSubscribeForNotification(
Binding As IntPtr, ' void* optional
Notification As Integer, ' RPC_NOTIFICATIONS
NotificationType As Integer, ' RPC_NOTIFICATION_TYPES
NotificationInfo As IntPtr ' RPC_ASYNC_NOTIFICATION_INFO*
) As Integer
End Function' Binding : void* optional
' Notification : RPC_NOTIFICATIONS
' NotificationType : RPC_NOTIFICATION_TYPES
' NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO*
Declare PtrSafe Function RpcServerSubscribeForNotification Lib "rpcrt4" ( _
ByVal Binding As LongPtr, _
ByVal Notification As Long, _
ByVal NotificationType As Long, _
ByVal NotificationInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcServerSubscribeForNotification = ctypes.windll.rpcrt4.RpcServerSubscribeForNotification
RpcServerSubscribeForNotification.restype = ctypes.c_int
RpcServerSubscribeForNotification.argtypes = [
ctypes.POINTER(None), # Binding : void* optional
ctypes.c_int, # Notification : RPC_NOTIFICATIONS
ctypes.c_int, # NotificationType : RPC_NOTIFICATION_TYPES
ctypes.c_void_p, # NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcServerSubscribeForNotification = Fiddle::Function.new(
lib['RpcServerSubscribeForNotification'],
[
Fiddle::TYPE_VOIDP, # Binding : void* optional
Fiddle::TYPE_INT, # Notification : RPC_NOTIFICATIONS
Fiddle::TYPE_INT, # NotificationType : RPC_NOTIFICATION_TYPES
Fiddle::TYPE_VOIDP, # NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO*
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn RpcServerSubscribeForNotification(
Binding: *mut (), // void* optional
Notification: i32, // RPC_NOTIFICATIONS
NotificationType: i32, // RPC_NOTIFICATION_TYPES
NotificationInfo: *mut RPC_ASYNC_NOTIFICATION_INFO // RPC_ASYNC_NOTIFICATION_INFO*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int RpcServerSubscribeForNotification(IntPtr Binding, int Notification, int NotificationType, IntPtr NotificationInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcServerSubscribeForNotification' -Namespace Win32 -PassThru
# $api::RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo)#uselib "RPCRT4.dll"
#func global RpcServerSubscribeForNotification "RpcServerSubscribeForNotification" sptr, sptr, sptr, sptr
; RpcServerSubscribeForNotification Binding, Notification, NotificationType, varptr(NotificationInfo) ; 戻り値は stat
; Binding : void* optional -> "sptr"
; Notification : RPC_NOTIFICATIONS -> "sptr"
; NotificationType : RPC_NOTIFICATION_TYPES -> "sptr"
; NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RPCRT4.dll" #cfunc global RpcServerSubscribeForNotification "RpcServerSubscribeForNotification" sptr, int, int, var ; res = RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo) ; Binding : void* optional -> "sptr" ; Notification : RPC_NOTIFICATIONS -> "int" ; NotificationType : RPC_NOTIFICATION_TYPES -> "int" ; NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcServerSubscribeForNotification "RpcServerSubscribeForNotification" sptr, int, int, sptr ; res = RpcServerSubscribeForNotification(Binding, Notification, NotificationType, varptr(NotificationInfo)) ; Binding : void* optional -> "sptr" ; Notification : RPC_NOTIFICATIONS -> "int" ; NotificationType : RPC_NOTIFICATION_TYPES -> "int" ; NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; RPC_STATUS RpcServerSubscribeForNotification(void* Binding, RPC_NOTIFICATIONS Notification, RPC_NOTIFICATION_TYPES NotificationType, RPC_ASYNC_NOTIFICATION_INFO* NotificationInfo) #uselib "RPCRT4.dll" #cfunc global RpcServerSubscribeForNotification "RpcServerSubscribeForNotification" intptr, int, int, var ; res = RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo) ; Binding : void* optional -> "intptr" ; Notification : RPC_NOTIFICATIONS -> "int" ; NotificationType : RPC_NOTIFICATION_TYPES -> "int" ; NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcServerSubscribeForNotification(void* Binding, RPC_NOTIFICATIONS Notification, RPC_NOTIFICATION_TYPES NotificationType, RPC_ASYNC_NOTIFICATION_INFO* NotificationInfo) #uselib "RPCRT4.dll" #cfunc global RpcServerSubscribeForNotification "RpcServerSubscribeForNotification" intptr, int, int, intptr ; res = RpcServerSubscribeForNotification(Binding, Notification, NotificationType, varptr(NotificationInfo)) ; Binding : void* optional -> "intptr" ; Notification : RPC_NOTIFICATIONS -> "int" ; NotificationType : RPC_NOTIFICATION_TYPES -> "int" ; NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcServerSubscribeForNotification = rpcrt4.NewProc("RpcServerSubscribeForNotification")
)
// Binding (void* optional), Notification (RPC_NOTIFICATIONS), NotificationType (RPC_NOTIFICATION_TYPES), NotificationInfo (RPC_ASYNC_NOTIFICATION_INFO*)
r1, _, err := procRpcServerSubscribeForNotification.Call(
uintptr(Binding),
uintptr(Notification),
uintptr(NotificationType),
uintptr(NotificationInfo),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcServerSubscribeForNotification(
Binding: Pointer; // void* optional
Notification: Integer; // RPC_NOTIFICATIONS
NotificationType: Integer; // RPC_NOTIFICATION_TYPES
NotificationInfo: Pointer // RPC_ASYNC_NOTIFICATION_INFO*
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcServerSubscribeForNotification';result := DllCall("RPCRT4\RpcServerSubscribeForNotification"
, "Ptr", Binding ; void* optional
, "Int", Notification ; RPC_NOTIFICATIONS
, "Int", NotificationType ; RPC_NOTIFICATION_TYPES
, "Ptr", NotificationInfo ; RPC_ASYNC_NOTIFICATION_INFO*
, "Int") ; return: RPC_STATUS●RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo) = DLL("RPCRT4.dll", "int RpcServerSubscribeForNotification(void*, int, int, void*)")
# 呼び出し: RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo)
# Binding : void* optional -> "void*"
# Notification : RPC_NOTIFICATIONS -> "int"
# NotificationType : RPC_NOTIFICATION_TYPES -> "int"
# NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rpcrt4" fn RpcServerSubscribeForNotification(
Binding: ?*anyopaque, // void* optional
Notification: i32, // RPC_NOTIFICATIONS
NotificationType: i32, // RPC_NOTIFICATION_TYPES
NotificationInfo: [*c]RPC_ASYNC_NOTIFICATION_INFO // RPC_ASYNC_NOTIFICATION_INFO*
) callconv(std.os.windows.WINAPI) i32;proc RpcServerSubscribeForNotification(
Binding: pointer, # void* optional
Notification: int32, # RPC_NOTIFICATIONS
NotificationType: int32, # RPC_NOTIFICATION_TYPES
NotificationInfo: ptr RPC_ASYNC_NOTIFICATION_INFO # RPC_ASYNC_NOTIFICATION_INFO*
): int32 {.importc: "RpcServerSubscribeForNotification", stdcall, dynlib: "RPCRT4.dll".}pragma(lib, "rpcrt4");
extern(Windows)
int RpcServerSubscribeForNotification(
void* Binding, // void* optional
int Notification, // RPC_NOTIFICATIONS
int NotificationType, // RPC_NOTIFICATION_TYPES
RPC_ASYNC_NOTIFICATION_INFO* NotificationInfo // RPC_ASYNC_NOTIFICATION_INFO*
);ccall((:RpcServerSubscribeForNotification, "RPCRT4.dll"), stdcall, Int32,
(Ptr{Cvoid}, Int32, Int32, Ptr{RPC_ASYNC_NOTIFICATION_INFO}),
Binding, Notification, NotificationType, NotificationInfo)
# Binding : void* optional -> Ptr{Cvoid}
# Notification : RPC_NOTIFICATIONS -> Int32
# NotificationType : RPC_NOTIFICATION_TYPES -> Int32
# NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> Ptr{RPC_ASYNC_NOTIFICATION_INFO}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t RpcServerSubscribeForNotification(
void* Binding,
int32_t Notification,
int32_t NotificationType,
void* NotificationInfo);
]]
local rpcrt4 = ffi.load("rpcrt4")
-- rpcrt4.RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo)
-- Binding : void* optional
-- Notification : RPC_NOTIFICATIONS
-- NotificationType : RPC_NOTIFICATION_TYPES
-- NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('RPCRT4.dll');
const RpcServerSubscribeForNotification = lib.func('__stdcall', 'RpcServerSubscribeForNotification', 'int32_t', ['void *', 'int32_t', 'int32_t', 'void *']);
// RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo)
// Binding : void* optional -> 'void *'
// Notification : RPC_NOTIFICATIONS -> 'int32_t'
// NotificationType : RPC_NOTIFICATION_TYPES -> 'int32_t'
// NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("RPCRT4.dll", {
RpcServerSubscribeForNotification: { parameters: ["pointer", "i32", "i32", "pointer"], result: "i32" },
});
// lib.symbols.RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo)
// Binding : void* optional -> "pointer"
// Notification : RPC_NOTIFICATIONS -> "i32"
// NotificationType : RPC_NOTIFICATION_TYPES -> "i32"
// NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t RpcServerSubscribeForNotification(
void* Binding,
int32_t Notification,
int32_t NotificationType,
void* NotificationInfo);
C, "RPCRT4.dll");
// $ffi->RpcServerSubscribeForNotification(Binding, Notification, NotificationType, NotificationInfo);
// Binding : void* optional
// Notification : RPC_NOTIFICATIONS
// NotificationType : RPC_NOTIFICATION_TYPES
// NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO*
// 構造体/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 Rpcrt4 extends StdCallLibrary {
Rpcrt4 INSTANCE = Native.load("rpcrt4", Rpcrt4.class);
int RpcServerSubscribeForNotification(
Pointer Binding, // void* optional
int Notification, // RPC_NOTIFICATIONS
int NotificationType, // RPC_NOTIFICATION_TYPES
Pointer NotificationInfo // RPC_ASYNC_NOTIFICATION_INFO*
);
}@[Link("rpcrt4")]
lib LibRPCRT4
fun RpcServerSubscribeForNotification = RpcServerSubscribeForNotification(
Binding : Void*, # void* optional
Notification : Int32, # RPC_NOTIFICATIONS
NotificationType : Int32, # RPC_NOTIFICATION_TYPES
NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* # RPC_ASYNC_NOTIFICATION_INFO*
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RpcServerSubscribeForNotificationNative = Int32 Function(Pointer<Void>, Int32, Int32, Pointer<Void>);
typedef RpcServerSubscribeForNotificationDart = int Function(Pointer<Void>, int, int, Pointer<Void>);
final RpcServerSubscribeForNotification = DynamicLibrary.open('RPCRT4.dll')
.lookupFunction<RpcServerSubscribeForNotificationNative, RpcServerSubscribeForNotificationDart>('RpcServerSubscribeForNotification');
// Binding : void* optional -> Pointer<Void>
// Notification : RPC_NOTIFICATIONS -> Int32
// NotificationType : RPC_NOTIFICATION_TYPES -> Int32
// NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RpcServerSubscribeForNotification(
Binding: Pointer; // void* optional
Notification: Integer; // RPC_NOTIFICATIONS
NotificationType: Integer; // RPC_NOTIFICATION_TYPES
NotificationInfo: Pointer // RPC_ASYNC_NOTIFICATION_INFO*
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcServerSubscribeForNotification';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RpcServerSubscribeForNotification"
c_RpcServerSubscribeForNotification :: Ptr () -> Int32 -> Int32 -> Ptr () -> IO Int32
-- Binding : void* optional -> Ptr ()
-- Notification : RPC_NOTIFICATIONS -> Int32
-- NotificationType : RPC_NOTIFICATION_TYPES -> Int32
-- NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rpcserversubscribefornotification =
foreign "RpcServerSubscribeForNotification"
((ptr void) @-> int32_t @-> int32_t @-> (ptr void) @-> returning int32_t)
(* Binding : void* optional -> (ptr void) *)
(* Notification : RPC_NOTIFICATIONS -> int32_t *)
(* NotificationType : RPC_NOTIFICATION_TYPES -> int32_t *)
(* NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rpcrt4 (t "RPCRT4.dll"))
(cffi:use-foreign-library rpcrt4)
(cffi:defcfun ("RpcServerSubscribeForNotification" rpc-server-subscribe-for-notification :convention :stdcall) :int32
(binding :pointer) ; void* optional
(notification :int32) ; RPC_NOTIFICATIONS
(notification-type :int32) ; RPC_NOTIFICATION_TYPES
(notification-info :pointer)) ; RPC_ASYNC_NOTIFICATION_INFO*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RpcServerSubscribeForNotification = Win32::API::More->new('RPCRT4',
'int RpcServerSubscribeForNotification(LPVOID Binding, int Notification, int NotificationType, LPVOID NotificationInfo)');
# my $ret = $RpcServerSubscribeForNotification->Call($Binding, $Notification, $NotificationType, $NotificationInfo);
# Binding : void* optional -> LPVOID
# Notification : RPC_NOTIFICATIONS -> int
# NotificationType : RPC_NOTIFICATION_TYPES -> int
# NotificationInfo : RPC_ASYNC_NOTIFICATION_INFO* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
- f RpcServerUnsubscribeForNotification — RPCサーバーのイベント通知購読を解除する。