Win32 API 日本語リファレンス
ホームStorage.FileSystem › TRANSACTION_NOTIFICATION

TRANSACTION_NOTIFICATION

構造体
サイズx64: 32 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
TransactionKeyvoid*8/4+0+0通知対象トランザクションを識別するキー。CreateEnlistment時に登録した値。
TransactionNotificationDWORD4+8+4発生した通知の種類を示すフラグ。TRANSACTION_NOTIFY_*。
TmVirtualClockLONGLONG8+16+8トランザクションマネージャの仮想クロック値。
ArgumentLengthDWORD4+24+16本構造体直後に続く引数データのバイト長。

各言語での定義

#include <windows.h>

// TRANSACTION_NOTIFICATION  (x64 32 / x86 24 バイト)
typedef struct TRANSACTION_NOTIFICATION {
    void* TransactionKey;
    DWORD TransactionNotification;
    LONGLONG TmVirtualClock;
    DWORD ArgumentLength;
} TRANSACTION_NOTIFICATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSACTION_NOTIFICATION
{
    public IntPtr TransactionKey;
    public uint TransactionNotification;
    public long TmVirtualClock;
    public uint ArgumentLength;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSACTION_NOTIFICATION
    Public TransactionKey As IntPtr
    Public TransactionNotification As UInteger
    Public TmVirtualClock As Long
    Public ArgumentLength As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TRANSACTION_NOTIFICATION(ctypes.Structure):
    _fields_ = [
        ("TransactionKey", ctypes.c_void_p),
        ("TransactionNotification", wintypes.DWORD),
        ("TmVirtualClock", ctypes.c_longlong),
        ("ArgumentLength", wintypes.DWORD),
    ]
#[repr(C)]
pub struct TRANSACTION_NOTIFICATION {
    pub TransactionKey: *mut core::ffi::c_void,
    pub TransactionNotification: u32,
    pub TmVirtualClock: i64,
    pub ArgumentLength: u32,
}
import "golang.org/x/sys/windows"

type TRANSACTION_NOTIFICATION struct {
	TransactionKey uintptr
	TransactionNotification uint32
	TmVirtualClock int64
	ArgumentLength uint32
}
type
  TRANSACTION_NOTIFICATION = record
    TransactionKey: Pointer;
    TransactionNotification: DWORD;
    TmVirtualClock: Int64;
    ArgumentLength: DWORD;
  end;
const TRANSACTION_NOTIFICATION = extern struct {
    TransactionKey: ?*anyopaque,
    TransactionNotification: u32,
    TmVirtualClock: i64,
    ArgumentLength: u32,
};
type
  TRANSACTION_NOTIFICATION {.bycopy.} = object
    TransactionKey: pointer
    TransactionNotification: uint32
    TmVirtualClock: int64
    ArgumentLength: uint32
struct TRANSACTION_NOTIFICATION
{
    void* TransactionKey;
    uint TransactionNotification;
    long TmVirtualClock;
    uint ArgumentLength;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TRANSACTION_NOTIFICATION サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; TransactionKey : void* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TransactionNotification : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; TmVirtualClock : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ArgumentLength : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRANSACTION_NOTIFICATION サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; TransactionKey : void* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; TransactionNotification : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; TmVirtualClock : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ArgumentLength : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TRANSACTION_NOTIFICATION
    #field intptr TransactionKey
    #field int TransactionNotification
    #field int64 TmVirtualClock
    #field int ArgumentLength
#endstruct

stdim st, TRANSACTION_NOTIFICATION        ; NSTRUCT 変数を確保
st->TransactionNotification = 100
mes "TransactionNotification=" + st->TransactionNotification