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

OLE_TM_CONFIG_PARAMS_V2

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

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

フィールド

フィールドサイズx64x86説明
dwVersionDWORD4+0+0構成パラメータのバージョン。V2を示す。
dwcConcurrencyHintDWORD4+4+4トランザクションマネージャの並行処理ヒント数。
applicationTypeAPPLICATIONTYPE4+8+8アプリケーションの種類(APPLICATIONTYPE)。
clusterResourceIdGUID16+12+12クラスタリソースを識別するGUID。

各言語での定義

#include <windows.h>

// OLE_TM_CONFIG_PARAMS_V2  (x64 28 / x86 28 バイト)
typedef struct OLE_TM_CONFIG_PARAMS_V2 {
    DWORD dwVersion;
    DWORD dwcConcurrencyHint;
    APPLICATIONTYPE applicationType;
    GUID clusterResourceId;
} OLE_TM_CONFIG_PARAMS_V2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OLE_TM_CONFIG_PARAMS_V2
{
    public uint dwVersion;
    public uint dwcConcurrencyHint;
    public int applicationType;
    public Guid clusterResourceId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OLE_TM_CONFIG_PARAMS_V2
    Public dwVersion As UInteger
    Public dwcConcurrencyHint As UInteger
    Public applicationType As Integer
    Public clusterResourceId As Guid
End Structure
import ctypes
from ctypes import wintypes

class OLE_TM_CONFIG_PARAMS_V2(ctypes.Structure):
    _fields_ = [
        ("dwVersion", wintypes.DWORD),
        ("dwcConcurrencyHint", wintypes.DWORD),
        ("applicationType", ctypes.c_int),
        ("clusterResourceId", GUID),
    ]
#[repr(C)]
pub struct OLE_TM_CONFIG_PARAMS_V2 {
    pub dwVersion: u32,
    pub dwcConcurrencyHint: u32,
    pub applicationType: i32,
    pub clusterResourceId: GUID,
}
import "golang.org/x/sys/windows"

type OLE_TM_CONFIG_PARAMS_V2 struct {
	dwVersion uint32
	dwcConcurrencyHint uint32
	applicationType int32
	clusterResourceId windows.GUID
}
type
  OLE_TM_CONFIG_PARAMS_V2 = record
    dwVersion: DWORD;
    dwcConcurrencyHint: DWORD;
    applicationType: Integer;
    clusterResourceId: TGUID;
  end;
const OLE_TM_CONFIG_PARAMS_V2 = extern struct {
    dwVersion: u32,
    dwcConcurrencyHint: u32,
    applicationType: i32,
    clusterResourceId: GUID,
};
type
  OLE_TM_CONFIG_PARAMS_V2 {.bycopy.} = object
    dwVersion: uint32
    dwcConcurrencyHint: uint32
    applicationType: int32
    clusterResourceId: GUID
struct OLE_TM_CONFIG_PARAMS_V2
{
    uint dwVersion;
    uint dwcConcurrencyHint;
    int applicationType;
    GUID clusterResourceId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OLE_TM_CONFIG_PARAMS_V2 サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwcConcurrencyHint : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; applicationType : APPLICATIONTYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; clusterResourceId : GUID (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global OLE_TM_CONFIG_PARAMS_V2
    #field int dwVersion
    #field int dwcConcurrencyHint
    #field int applicationType
    #field GUID clusterResourceId
#endstruct

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