GetNotificationResourceManagerAsync
関数シグネチャ
// ktmw32.dll
#include <windows.h>
BOOL GetNotificationResourceManagerAsync(
HANDLE ResourceManagerHandle,
TRANSACTION_NOTIFICATION* TransactionNotification,
DWORD TransactionNotificationLength,
DWORD* ReturnLength,
OVERLAPPED* lpOverlapped
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ResourceManagerHandle | HANDLE | in | リソースマネージャーへのハンドル。 |
| TransactionNotification | TRANSACTION_NOTIFICATION* | inout | 最初に利用可能な通知を受け取る TRANSACTION_NOTIFICATION 構造体へのポインター。 |
| TransactionNotificationLength | DWORD | in | TransactionNotification バッファーのサイズ (バイト単位)。 |
| ReturnLength | DWORD* | inout | TransactionNotification パラメーターによって受信された通知の実際のサイズを受け取る変数へのポインター。 |
| lpOverlapped | OVERLAPPED* | inout | 非同期操作に必要な OVERLAPPED 構造体へのポインター。 |
戻り値の型: BOOL
公式ドキュメント
リソースマネージャー (RM) に対する非同期通知を要求して受信します。この関数は、トランザクションの状態が変化したときに通知を受信するために RM レジスターによって使用されます。
戻り値
関数が成功すると、戻り値は 0 以外になります。
関数が失敗すると、戻り値は 0 になります。拡張エラー情報を取得するには、 GetLastError 関数を呼び出します。
次の一覧は、発生し得るエラーコードを示しています:
解説(Remarks)
すべてのリソースマネージャーは、後で ReadOnlyEnlistment を呼び出してエンリストメントを読み取り専用としてマークする場合であっても、 TRANSACTION_NOTIFY_PREPREPARE、 TRANSACTION_NOTIFY_PREPARE、および TRANSACTION_NOTIFY_COMMIT の各通知を受信するように登録する必要があります。リソースマネージャーは TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT をサポートできますが、 マルチフェーズの pre-prepare、prepare、および commit の各通知もサポートする必要があります。リソースマネージャーが受信できるすべての通知の一覧については、 TRANSACTION_NOTIFICATION を参照してください。
リソースマネージャー (RM) は、KTM が通知を配信する際に使用する複数のバッファーを提供するために、この関数を複数回呼び出すことができます。この関数の呼び出し回数は、RM が処理している負荷の大きさに依存します。
この関数は、 SetResourceManagerCompletionPort 関数を呼び出した後に呼び出す必要があります。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// ktmw32.dll
#include <windows.h>
BOOL GetNotificationResourceManagerAsync(
HANDLE ResourceManagerHandle,
TRANSACTION_NOTIFICATION* TransactionNotification,
DWORD TransactionNotificationLength,
DWORD* ReturnLength,
OVERLAPPED* lpOverlapped
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ktmw32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool GetNotificationResourceManagerAsync(
IntPtr ResourceManagerHandle, // HANDLE
IntPtr TransactionNotification, // TRANSACTION_NOTIFICATION* in/out
uint TransactionNotificationLength, // DWORD
ref uint ReturnLength, // DWORD* in/out
IntPtr lpOverlapped // OVERLAPPED* in/out
);<DllImport("ktmw32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function GetNotificationResourceManagerAsync(
ResourceManagerHandle As IntPtr, ' HANDLE
TransactionNotification As IntPtr, ' TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength As UInteger, ' DWORD
ByRef ReturnLength As UInteger, ' DWORD* in/out
lpOverlapped As IntPtr ' OVERLAPPED* in/out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' ResourceManagerHandle : HANDLE
' TransactionNotification : TRANSACTION_NOTIFICATION* in/out
' TransactionNotificationLength : DWORD
' ReturnLength : DWORD* in/out
' lpOverlapped : OVERLAPPED* in/out
Declare PtrSafe Function GetNotificationResourceManagerAsync Lib "ktmw32" ( _
ByVal ResourceManagerHandle As LongPtr, _
ByVal TransactionNotification As LongPtr, _
ByVal TransactionNotificationLength As Long, _
ByRef ReturnLength As Long, _
ByVal lpOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetNotificationResourceManagerAsync = ctypes.windll.ktmw32.GetNotificationResourceManagerAsync
GetNotificationResourceManagerAsync.restype = wintypes.BOOL
GetNotificationResourceManagerAsync.argtypes = [
wintypes.HANDLE, # ResourceManagerHandle : HANDLE
ctypes.c_void_p, # TransactionNotification : TRANSACTION_NOTIFICATION* in/out
wintypes.DWORD, # TransactionNotificationLength : DWORD
ctypes.POINTER(wintypes.DWORD), # ReturnLength : DWORD* in/out
ctypes.c_void_p, # lpOverlapped : OVERLAPPED* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ktmw32.dll')
GetNotificationResourceManagerAsync = Fiddle::Function.new(
lib['GetNotificationResourceManagerAsync'],
[
Fiddle::TYPE_VOIDP, # ResourceManagerHandle : HANDLE
Fiddle::TYPE_VOIDP, # TransactionNotification : TRANSACTION_NOTIFICATION* in/out
-Fiddle::TYPE_INT, # TransactionNotificationLength : DWORD
Fiddle::TYPE_VOIDP, # ReturnLength : DWORD* in/out
Fiddle::TYPE_VOIDP, # lpOverlapped : OVERLAPPED* in/out
],
Fiddle::TYPE_INT)#[link(name = "ktmw32")]
extern "system" {
fn GetNotificationResourceManagerAsync(
ResourceManagerHandle: *mut core::ffi::c_void, // HANDLE
TransactionNotification: *mut TRANSACTION_NOTIFICATION, // TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength: u32, // DWORD
ReturnLength: *mut u32, // DWORD* in/out
lpOverlapped: *mut OVERLAPPED // OVERLAPPED* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ktmw32.dll", SetLastError = true)]
public static extern bool GetNotificationResourceManagerAsync(IntPtr ResourceManagerHandle, IntPtr TransactionNotification, uint TransactionNotificationLength, ref uint ReturnLength, IntPtr lpOverlapped);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ktmw32_GetNotificationResourceManagerAsync' -Namespace Win32 -PassThru
# $api::GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)#uselib "ktmw32.dll"
#func global GetNotificationResourceManagerAsync "GetNotificationResourceManagerAsync" sptr, sptr, sptr, sptr, sptr
; GetNotificationResourceManagerAsync ResourceManagerHandle, varptr(TransactionNotification), TransactionNotificationLength, varptr(ReturnLength), varptr(lpOverlapped) ; 戻り値は stat
; ResourceManagerHandle : HANDLE -> "sptr"
; TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "sptr"
; TransactionNotificationLength : DWORD -> "sptr"
; ReturnLength : DWORD* in/out -> "sptr"
; lpOverlapped : OVERLAPPED* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ktmw32.dll" #cfunc global GetNotificationResourceManagerAsync "GetNotificationResourceManagerAsync" sptr, var, int, var, var ; res = GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped) ; ResourceManagerHandle : HANDLE -> "sptr" ; TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "var" ; TransactionNotificationLength : DWORD -> "int" ; ReturnLength : DWORD* in/out -> "var" ; lpOverlapped : OVERLAPPED* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ktmw32.dll" #cfunc global GetNotificationResourceManagerAsync "GetNotificationResourceManagerAsync" sptr, sptr, int, sptr, sptr ; res = GetNotificationResourceManagerAsync(ResourceManagerHandle, varptr(TransactionNotification), TransactionNotificationLength, varptr(ReturnLength), varptr(lpOverlapped)) ; ResourceManagerHandle : HANDLE -> "sptr" ; TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "sptr" ; TransactionNotificationLength : DWORD -> "int" ; ReturnLength : DWORD* in/out -> "sptr" ; lpOverlapped : OVERLAPPED* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; BOOL GetNotificationResourceManagerAsync(HANDLE ResourceManagerHandle, TRANSACTION_NOTIFICATION* TransactionNotification, DWORD TransactionNotificationLength, DWORD* ReturnLength, OVERLAPPED* lpOverlapped) #uselib "ktmw32.dll" #cfunc global GetNotificationResourceManagerAsync "GetNotificationResourceManagerAsync" intptr, var, int, var, var ; res = GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped) ; ResourceManagerHandle : HANDLE -> "intptr" ; TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "var" ; TransactionNotificationLength : DWORD -> "int" ; ReturnLength : DWORD* in/out -> "var" ; lpOverlapped : OVERLAPPED* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL GetNotificationResourceManagerAsync(HANDLE ResourceManagerHandle, TRANSACTION_NOTIFICATION* TransactionNotification, DWORD TransactionNotificationLength, DWORD* ReturnLength, OVERLAPPED* lpOverlapped) #uselib "ktmw32.dll" #cfunc global GetNotificationResourceManagerAsync "GetNotificationResourceManagerAsync" intptr, intptr, int, intptr, intptr ; res = GetNotificationResourceManagerAsync(ResourceManagerHandle, varptr(TransactionNotification), TransactionNotificationLength, varptr(ReturnLength), varptr(lpOverlapped)) ; ResourceManagerHandle : HANDLE -> "intptr" ; TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "intptr" ; TransactionNotificationLength : DWORD -> "int" ; ReturnLength : DWORD* in/out -> "intptr" ; lpOverlapped : OVERLAPPED* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ktmw32 = windows.NewLazySystemDLL("ktmw32.dll")
procGetNotificationResourceManagerAsync = ktmw32.NewProc("GetNotificationResourceManagerAsync")
)
// ResourceManagerHandle (HANDLE), TransactionNotification (TRANSACTION_NOTIFICATION* in/out), TransactionNotificationLength (DWORD), ReturnLength (DWORD* in/out), lpOverlapped (OVERLAPPED* in/out)
r1, _, err := procGetNotificationResourceManagerAsync.Call(
uintptr(ResourceManagerHandle),
uintptr(TransactionNotification),
uintptr(TransactionNotificationLength),
uintptr(ReturnLength),
uintptr(lpOverlapped),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction GetNotificationResourceManagerAsync(
ResourceManagerHandle: THandle; // HANDLE
TransactionNotification: Pointer; // TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength: DWORD; // DWORD
ReturnLength: Pointer; // DWORD* in/out
lpOverlapped: Pointer // OVERLAPPED* in/out
): BOOL; stdcall;
external 'ktmw32.dll' name 'GetNotificationResourceManagerAsync';result := DllCall("ktmw32\GetNotificationResourceManagerAsync"
, "Ptr", ResourceManagerHandle ; HANDLE
, "Ptr", TransactionNotification ; TRANSACTION_NOTIFICATION* in/out
, "UInt", TransactionNotificationLength ; DWORD
, "Ptr", ReturnLength ; DWORD* in/out
, "Ptr", lpOverlapped ; OVERLAPPED* in/out
, "Int") ; return: BOOL●GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped) = DLL("ktmw32.dll", "bool GetNotificationResourceManagerAsync(void*, void*, dword, void*, void*)")
# 呼び出し: GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)
# ResourceManagerHandle : HANDLE -> "void*"
# TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "void*"
# TransactionNotificationLength : DWORD -> "dword"
# ReturnLength : DWORD* in/out -> "void*"
# lpOverlapped : OVERLAPPED* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "ktmw32" fn GetNotificationResourceManagerAsync(
ResourceManagerHandle: ?*anyopaque, // HANDLE
TransactionNotification: [*c]TRANSACTION_NOTIFICATION, // TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength: u32, // DWORD
ReturnLength: [*c]u32, // DWORD* in/out
lpOverlapped: [*c]OVERLAPPED // OVERLAPPED* in/out
) callconv(std.os.windows.WINAPI) i32;proc GetNotificationResourceManagerAsync(
ResourceManagerHandle: pointer, # HANDLE
TransactionNotification: ptr TRANSACTION_NOTIFICATION, # TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength: uint32, # DWORD
ReturnLength: ptr uint32, # DWORD* in/out
lpOverlapped: ptr OVERLAPPED # OVERLAPPED* in/out
): int32 {.importc: "GetNotificationResourceManagerAsync", stdcall, dynlib: "ktmw32.dll".}pragma(lib, "ktmw32");
extern(Windows)
int GetNotificationResourceManagerAsync(
void* ResourceManagerHandle, // HANDLE
TRANSACTION_NOTIFICATION* TransactionNotification, // TRANSACTION_NOTIFICATION* in/out
uint TransactionNotificationLength, // DWORD
uint* ReturnLength, // DWORD* in/out
OVERLAPPED* lpOverlapped // OVERLAPPED* in/out
);ccall((:GetNotificationResourceManagerAsync, "ktmw32.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{TRANSACTION_NOTIFICATION}, UInt32, Ptr{UInt32}, Ptr{OVERLAPPED}),
ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)
# ResourceManagerHandle : HANDLE -> Ptr{Cvoid}
# TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> Ptr{TRANSACTION_NOTIFICATION}
# TransactionNotificationLength : DWORD -> UInt32
# ReturnLength : DWORD* in/out -> Ptr{UInt32}
# lpOverlapped : OVERLAPPED* in/out -> Ptr{OVERLAPPED}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GetNotificationResourceManagerAsync(
void* ResourceManagerHandle,
void* TransactionNotification,
uint32_t TransactionNotificationLength,
uint32_t* ReturnLength,
void* lpOverlapped);
]]
local ktmw32 = ffi.load("ktmw32")
-- ktmw32.GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)
-- ResourceManagerHandle : HANDLE
-- TransactionNotification : TRANSACTION_NOTIFICATION* in/out
-- TransactionNotificationLength : DWORD
-- ReturnLength : DWORD* in/out
-- lpOverlapped : OVERLAPPED* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('ktmw32.dll');
const GetNotificationResourceManagerAsync = lib.func('__stdcall', 'GetNotificationResourceManagerAsync', 'int32_t', ['void *', 'void *', 'uint32_t', 'uint32_t *', 'void *']);
// GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)
// ResourceManagerHandle : HANDLE -> 'void *'
// TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> 'void *'
// TransactionNotificationLength : DWORD -> 'uint32_t'
// ReturnLength : DWORD* in/out -> 'uint32_t *'
// lpOverlapped : OVERLAPPED* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("ktmw32.dll", {
GetNotificationResourceManagerAsync: { parameters: ["pointer", "pointer", "u32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped)
// ResourceManagerHandle : HANDLE -> "pointer"
// TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> "pointer"
// TransactionNotificationLength : DWORD -> "u32"
// ReturnLength : DWORD* in/out -> "pointer"
// lpOverlapped : OVERLAPPED* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GetNotificationResourceManagerAsync(
void* ResourceManagerHandle,
void* TransactionNotification,
uint32_t TransactionNotificationLength,
uint32_t* ReturnLength,
void* lpOverlapped);
C, "ktmw32.dll");
// $ffi->GetNotificationResourceManagerAsync(ResourceManagerHandle, TransactionNotification, TransactionNotificationLength, ReturnLength, lpOverlapped);
// ResourceManagerHandle : HANDLE
// TransactionNotification : TRANSACTION_NOTIFICATION* in/out
// TransactionNotificationLength : DWORD
// ReturnLength : DWORD* in/out
// lpOverlapped : OVERLAPPED* 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 Ktmw32 extends StdCallLibrary {
Ktmw32 INSTANCE = Native.load("ktmw32", Ktmw32.class);
boolean GetNotificationResourceManagerAsync(
Pointer ResourceManagerHandle, // HANDLE
Pointer TransactionNotification, // TRANSACTION_NOTIFICATION* in/out
int TransactionNotificationLength, // DWORD
IntByReference ReturnLength, // DWORD* in/out
Pointer lpOverlapped // OVERLAPPED* in/out
);
}@[Link("ktmw32")]
lib Libktmw32
fun GetNotificationResourceManagerAsync = GetNotificationResourceManagerAsync(
ResourceManagerHandle : Void*, # HANDLE
TransactionNotification : TRANSACTION_NOTIFICATION*, # TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength : UInt32, # DWORD
ReturnLength : UInt32*, # DWORD* in/out
lpOverlapped : OVERLAPPED* # OVERLAPPED* in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GetNotificationResourceManagerAsyncNative = Int32 Function(Pointer<Void>, Pointer<Void>, Uint32, Pointer<Uint32>, Pointer<Void>);
typedef GetNotificationResourceManagerAsyncDart = int Function(Pointer<Void>, Pointer<Void>, int, Pointer<Uint32>, Pointer<Void>);
final GetNotificationResourceManagerAsync = DynamicLibrary.open('ktmw32.dll')
.lookupFunction<GetNotificationResourceManagerAsyncNative, GetNotificationResourceManagerAsyncDart>('GetNotificationResourceManagerAsync');
// ResourceManagerHandle : HANDLE -> Pointer<Void>
// TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> Pointer<Void>
// TransactionNotificationLength : DWORD -> Uint32
// ReturnLength : DWORD* in/out -> Pointer<Uint32>
// lpOverlapped : OVERLAPPED* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GetNotificationResourceManagerAsync(
ResourceManagerHandle: THandle; // HANDLE
TransactionNotification: Pointer; // TRANSACTION_NOTIFICATION* in/out
TransactionNotificationLength: DWORD; // DWORD
ReturnLength: Pointer; // DWORD* in/out
lpOverlapped: Pointer // OVERLAPPED* in/out
): BOOL; stdcall;
external 'ktmw32.dll' name 'GetNotificationResourceManagerAsync';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GetNotificationResourceManagerAsync"
c_GetNotificationResourceManagerAsync :: Ptr () -> Ptr () -> Word32 -> Ptr Word32 -> Ptr () -> IO CInt
-- ResourceManagerHandle : HANDLE -> Ptr ()
-- TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> Ptr ()
-- TransactionNotificationLength : DWORD -> Word32
-- ReturnLength : DWORD* in/out -> Ptr Word32
-- lpOverlapped : OVERLAPPED* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let getnotificationresourcemanagerasync =
foreign "GetNotificationResourceManagerAsync"
((ptr void) @-> (ptr void) @-> uint32_t @-> (ptr uint32_t) @-> (ptr void) @-> returning int32_t)
(* ResourceManagerHandle : HANDLE -> (ptr void) *)
(* TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> (ptr void) *)
(* TransactionNotificationLength : DWORD -> uint32_t *)
(* ReturnLength : DWORD* in/out -> (ptr uint32_t) *)
(* lpOverlapped : OVERLAPPED* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library ktmw32 (t "ktmw32.dll"))
(cffi:use-foreign-library ktmw32)
(cffi:defcfun ("GetNotificationResourceManagerAsync" get-notification-resource-manager-async :convention :stdcall) :int32
(resource-manager-handle :pointer) ; HANDLE
(transaction-notification :pointer) ; TRANSACTION_NOTIFICATION* in/out
(transaction-notification-length :uint32) ; DWORD
(return-length :pointer) ; DWORD* in/out
(lp-overlapped :pointer)) ; OVERLAPPED* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GetNotificationResourceManagerAsync = Win32::API::More->new('ktmw32',
'BOOL GetNotificationResourceManagerAsync(HANDLE ResourceManagerHandle, LPVOID TransactionNotification, DWORD TransactionNotificationLength, LPVOID ReturnLength, LPVOID lpOverlapped)');
# my $ret = $GetNotificationResourceManagerAsync->Call($ResourceManagerHandle, $TransactionNotification, $TransactionNotificationLength, $ReturnLength, $lpOverlapped);
# ResourceManagerHandle : HANDLE -> HANDLE
# TransactionNotification : TRANSACTION_NOTIFICATION* in/out -> LPVOID
# TransactionNotificationLength : DWORD -> DWORD
# ReturnLength : DWORD* in/out -> LPVOID
# lpOverlapped : OVERLAPPED* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
- f CreateEnlistment — リソースマネージャーをトランザクションに加入させエンリストメントを作成する。
- f SetResourceManagerCompletionPort — KTMリソースマネージャーにI/O完了ポートを関連付ける。
- s TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT