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

TRANSACTION_PROPERTIES_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
IsolationLevelDWORD4+0+0トランザクションの分離レベルを示す値。現状は予約され0を指定する。
IsolationFlagsDWORD4+4+4分離動作を制御するフラグのビットマスク。
TimeoutLONGLONG8+8+8トランザクションのタイムアウト時間。100ナノ秒単位のLONGLONGで指定する。
OutcomeDWORD4+16+16トランザクションの最終結果(コミット/中止など)を示す値。
DescriptionLengthDWORD4+20+20Descriptionに格納される説明文字列のバイト長。
DescriptionWCHAR2+24+24トランザクションの説明文字列を表す可変長WCHAR配列の先頭。

各言語での定義

#include <windows.h>

// TRANSACTION_PROPERTIES_INFORMATION  (x64 32 / x86 32 バイト)
typedef struct TRANSACTION_PROPERTIES_INFORMATION {
    DWORD IsolationLevel;
    DWORD IsolationFlags;
    LONGLONG Timeout;
    DWORD Outcome;
    DWORD DescriptionLength;
    WCHAR Description[1];
} TRANSACTION_PROPERTIES_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSACTION_PROPERTIES_INFORMATION
{
    public uint IsolationLevel;
    public uint IsolationFlags;
    public long Timeout;
    public uint Outcome;
    public uint DescriptionLength;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string Description;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSACTION_PROPERTIES_INFORMATION
    Public IsolationLevel As UInteger
    Public IsolationFlags As UInteger
    Public Timeout As Long
    Public Outcome As UInteger
    Public DescriptionLength As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public Description As String
End Structure
import ctypes
from ctypes import wintypes

class TRANSACTION_PROPERTIES_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("IsolationLevel", wintypes.DWORD),
        ("IsolationFlags", wintypes.DWORD),
        ("Timeout", ctypes.c_longlong),
        ("Outcome", wintypes.DWORD),
        ("DescriptionLength", wintypes.DWORD),
        ("Description", ctypes.c_wchar * 1),
    ]
#[repr(C)]
pub struct TRANSACTION_PROPERTIES_INFORMATION {
    pub IsolationLevel: u32,
    pub IsolationFlags: u32,
    pub Timeout: i64,
    pub Outcome: u32,
    pub DescriptionLength: u32,
    pub Description: [u16; 1],
}
import "golang.org/x/sys/windows"

type TRANSACTION_PROPERTIES_INFORMATION struct {
	IsolationLevel uint32
	IsolationFlags uint32
	Timeout int64
	Outcome uint32
	DescriptionLength uint32
	Description [1]uint16
}
type
  TRANSACTION_PROPERTIES_INFORMATION = record
    IsolationLevel: DWORD;
    IsolationFlags: DWORD;
    Timeout: Int64;
    Outcome: DWORD;
    DescriptionLength: DWORD;
    Description: array[0..0] of WideChar;
  end;
const TRANSACTION_PROPERTIES_INFORMATION = extern struct {
    IsolationLevel: u32,
    IsolationFlags: u32,
    Timeout: i64,
    Outcome: u32,
    DescriptionLength: u32,
    Description: [1]u16,
};
type
  TRANSACTION_PROPERTIES_INFORMATION {.bycopy.} = object
    IsolationLevel: uint32
    IsolationFlags: uint32
    Timeout: int64
    Outcome: uint32
    DescriptionLength: uint32
    Description: array[1, uint16]
struct TRANSACTION_PROPERTIES_INFORMATION
{
    uint IsolationLevel;
    uint IsolationFlags;
    long Timeout;
    uint Outcome;
    uint DescriptionLength;
    wchar[1] Description;
}

HSP用 定義

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

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

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