[2/4] include: added transact.idl

Daniel Jeliński djelinski1 at gmail.com
Tue Apr 30 16:45:13 CDT 2013


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130430/6b506188/attachment.html>
-------------- next part --------------
From 228bbc73fc8ad8f77f128c2b15313b6bc4e651cc Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Tue, 30 Apr 2013 20:47:50 +0200
Subject: [PATCH 2/4] include: added transact.idl

---
 .gitignore           |    1 +
 include/Makefile.in  |    1 +
 include/transact.idl |  310 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 312 insertions(+), 0 deletions(-)
 create mode 100644 include/transact.idl

diff --git a/.gitignore b/.gitignore
index b13b6be..9cb851b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -246,6 +246,7 @@ include/structuredquerycondition.h
 include/textstor.h
 include/tlogstg.h
 include/tom.h
+include/transact.h
 include/uiautomationclient.h
 include/uiautomationcore.h
 include/unknwn.h
diff --git a/include/Makefile.in b/include/Makefile.in
index 9589c34..39821d2 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -98,6 +98,7 @@ PUBLIC_IDL_H_SRCS = \
 	textstor.idl \
 	tlogstg.idl \
 	tom.idl \
+	transact.idl \
 	uiautomationclient.idl \
 	uiautomationcore.idl \
 	unknwn.idl \
diff --git a/include/transact.idl b/include/transact.idl
new file mode 100644
index 0000000..bdf2055
--- /dev/null
+++ b/include/transact.idl
@@ -0,0 +1,310 @@
+import "unknwn.idl";
+
+interface ITransaction;
+interface ITransactionDispenser;
+interface ITransactionOptions;
+interface ITransactionOutcomeEvents;
+interface ITransactionCompletionEvents;
+
+/*==========================================================================
+ * Transaction related types
+ *==========================================================================*/
+
+[local,pointer_default(unique)]
+interface BasicTransactionTypes
+    {
+
+    typedef struct BOID {
+        byte rgb[16];
+        } BOID;
+
+    cpp_quote("#define BOID_NULL (*((BOID*)(&IID_NULL)))")
+
+    /* change the following two line together */
+    cpp_quote("#ifndef MAX_TRAN_DESC_DEFINED")        /* conflicts with uimsg.h. This is temporary work around */
+    cpp_quote("#define MAX_TRAN_DESC_DEFINED")
+    typedef enum TX_MISC_CONSTANTS
+        {
+        MAX_TRAN_DESC                   = 40
+        } TX_MISC_CONSTANTS;
+    cpp_quote("#endif")
+
+    /* Unit Of Work. */
+
+    typedef BOID XACTUOW;
+
+    /* Data type for isolation level values. */
+
+    typedef LONG ISOLEVEL;
+
+    /* Constants that specifiy isolation level of a transaction. */
+
+    typedef enum ISOLATIONLEVEL {
+        ISOLATIONLEVEL_UNSPECIFIED      = 0xFFFFFFFF,
+        ISOLATIONLEVEL_CHAOS            = 0x00000010,
+        ISOLATIONLEVEL_READUNCOMMITTED  = 0x00000100,
+        ISOLATIONLEVEL_BROWSE           = 0x00000100,   /* Synonym for _READUNCOMITTED */
+        ISOLATIONLEVEL_CURSORSTABILITY  = 0x00001000,
+        ISOLATIONLEVEL_READCOMMITTED    = 0x00001000,   /* Synonym for _CURSORSTABILITY */
+        ISOLATIONLEVEL_REPEATABLEREAD   = 0x00010000,
+        ISOLATIONLEVEL_SERIALIZABLE     = 0x00100000,
+        ISOLATIONLEVEL_ISOLATED         = 0x00100000,   /* Synonym for _SERIALIZABLE */
+        } ISOLATIONLEVEL;
+
+    /* Transaction information structure, used in ITransaction */
+
+    typedef struct XACTTRANSINFO {
+        XACTUOW     uow;                        /* The current unit of work */
+        ISOLEVEL    isoLevel;                   /* The isolation level for the current UOW */
+        ULONG       isoFlags;                   /* Values from ISOFLAG enumeration */
+        DWORD       grfTCSupported;             /* Flags indicating capabilities */
+        DWORD       grfRMSupported;             /*       ... of this transaction wrt */
+        DWORD       grfTCSupportedRetaining;    /*       ... parameters to Commit */
+        DWORD       grfRMSupportedRetaining;    /*       ... */
+        } XACTTRANSINFO;
+
+    typedef struct XACTSTATS {
+        ULONG       cOpen;              /* The number of currently extant transactions. */
+        ULONG       cCommitting;        /* The number of transactions which are proceding towards committing. */
+        ULONG       cCommitted;         /* The number of transactions that are have been committed. */
+        ULONG       cAborting;          /* The number of transactions which are in the process of aborting. */
+        ULONG       cAborted;           /* The number of transactions that are have been aborted. */
+        ULONG       cInDoubt;           /* The number of transactions which are presently in doubt. */
+        ULONG       cHeuristicDecision; /* The number of transactions that have completed by heuristic decision. */
+        FILETIME    timeTransactionsUp; /* The amount of time that this transaction service has been up. */
+        } XACTSTATS;
+
+    /* @enum ISOFLAG | Used in <t XACTTRANSINFO> and <i ITransactionDispenser>. */
+
+    typedef enum ISOFLAG {
+        ISOFLAG_RETAIN_COMMIT_DC    = 1,    /* Use just one of ISOFLAG_RETAIN_COMMIT values */
+        ISOFLAG_RETAIN_COMMIT       = 2,
+        ISOFLAG_RETAIN_COMMIT_NO    = 3,
+        ISOFLAG_RETAIN_ABORT_DC     = 4,    /* Use just one of ISOFLAG_RETAIN_ABORT values */
+        ISOFLAG_RETAIN_ABORT        = 8,
+        ISOFLAG_RETAIN_ABORT_NO     = 12,
+        ISOFLAG_RETAIN_DONTCARE     = ISOFLAG_RETAIN_COMMIT_DC | ISOFLAG_RETAIN_ABORT_DC,
+        ISOFLAG_RETAIN_BOTH         = ISOFLAG_RETAIN_COMMIT    | ISOFLAG_RETAIN_ABORT,
+        ISOFLAG_RETAIN_NONE         = ISOFLAG_RETAIN_COMMIT_NO | ISOFLAG_RETAIN_ABORT_NO,
+        ISOFLAG_OPTIMISTIC          = 16,
+        ISOFLAG_READONLY            = 32
+        } ISOFLAG;
+
+    /* Used in ITransactionDispenser
+     * A bit field of 32 bits; be sure to mask before comparing. */
+
+    typedef enum XACTTC {
+        XACTTC_SYNC_PHASEONE    = 1,
+        XACTTC_SYNC_PHASETWO    = 2,
+        XACTTC_SYNC             = 2,    /* nb alias for XACTTC_SYNC_PHASETWO */
+        XACTTC_ASYNC_PHASEONE   = 4,
+        XACTTC_ASYNC            = 4     /* nb alias for XACTTC_ASYNC_PHASEONE */
+        } XACTTC;
+
+    /* Used in ITransactionDispenser
+     * A bit field of 32 bits; be sure to mask before comparing. */
+
+    typedef enum XACTRM {
+        XACTRM_OPTIMISTICLASTWINS = 1,
+        XACTRM_NOREADONLYPREPARES = 2,
+        } XACTRM;
+
+    typedef enum XACTCONST {
+        XACTCONST_TIMEOUTINFINITE = 0,
+        } XACTCONST;
+
+    typedef enum XACTHEURISTIC {
+        XACTHEURISTIC_ABORT     = 1,
+        XACTHEURISTIC_COMMIT    = 2,
+        XACTHEURISTIC_DAMAGE    = 3,
+        XACTHEURISTIC_DANGER    = 4,
+        } XACTHEURISTIC;
+
+    typedef enum XACTSTAT {
+        XACTSTAT_NONE               = 0x00000000,
+        XACTSTAT_OPENNORMAL         = 0x00000001,
+        XACTSTAT_OPENREFUSED        = 0x00000002,
+        XACTSTAT_PREPARING          = 0x00000004,
+        XACTSTAT_PREPARED           = 0x00000008,
+        XACTSTAT_PREPARERETAINING   = 0x00000010,
+        XACTSTAT_PREPARERETAINED    = 0x00000020,
+        XACTSTAT_COMMITTING         = 0x00000040,
+        XACTSTAT_COMMITRETAINING    = 0x00000080,
+        XACTSTAT_ABORTING           = 0x00000100,
+        XACTSTAT_ABORTED            = 0x00000200,
+        XACTSTAT_COMMITTED          = 0x00000400,
+        XACTSTAT_HEURISTIC_ABORT    = 0x00000800,
+        XACTSTAT_HEURISTIC_COMMIT   = 0x00001000,
+        XACTSTAT_HEURISTIC_DAMAGE   = 0x00002000,
+        XACTSTAT_HEURISTIC_DANGER   = 0x00004000,
+        XACTSTAT_FORCED_ABORT       = 0x00008000,
+        XACTSTAT_FORCED_COMMIT      = 0x00010000,
+        XACTSTAT_INDOUBT            = 0x00020000,
+        XACTSTAT_CLOSED             = 0x00040000,
+        XACTSTAT_OPEN               = 0x00000003,
+        XACTSTAT_NOTPREPARED        = 0x0007FFC3,
+        XACTSTAT_ALL                = 0x0007FFFF,
+        } XACTSTAT;
+
+    typedef struct XACTOPT {                        /* Transaction configuration options */
+        ULONG       ulTimeout;                      /* timeout in milliseconds */
+        char        szDescription[MAX_TRAN_DESC];   /* description string for admin tools */
+        } XACTOPT;
+
+    /*
+     *==========================================================================
+     * Error code definitions for all transaction related functionality.
+     *==========================================================================
+     */
+    /*
+    typedef enum XACT_E {
+        XACT_E_FIRST                = 0x8004D000,
+        XACT_E_LAST                 = 0x8004D022,
+        XACT_S_FIRST                = 0x0004D000,
+        XACT_S_LAST                 = 0x0004D009,
+
+        XACT_E_ALREADYOTHERSINGLEPHASE = 0x8004D000,
+        XACT_E_CANTRETAIN           = 0x8004D001,
+        XACT_E_COMMITFAILED         = 0x8004D002,
+        XACT_E_COMMITPREVENTED      = 0x8004D003,
+        XACT_E_HEURISTICABORT       = 0x8004D004,
+        XACT_E_HEURISTICCOMMIT      = 0x8004D005,
+        XACT_E_HEURISTICDAMAGE      = 0x8004D006,
+        XACT_E_HEURISTICDANGER      = 0x8004D007,
+        XACT_E_ISOLATIONLEVEL       = 0x8004D008,
+        XACT_E_NOASYNC              = 0x8004D009,
+        XACT_E_NOENLIST             = 0x8004D00A,
+        XACT_E_NOISORETAIN          = 0x8004D00B,
+        XACT_E_NORESOURCE           = 0x8004D00C,
+        XACT_E_NOTCURRENT           = 0x8004D00D,
+        XACT_E_NOTRANSACTION        = 0x8004D00E,
+        XACT_E_NOTSUPPORTED         = 0x8004D00F,
+        XACT_E_UNKNOWNRMGRID        = 0x8004D010,
+        XACT_E_WRONGSTATE           = 0x8004D011,
+        XACT_E_WRONGUOW             = 0x8004D012,
+        XACT_E_XTIONEXISTS          = 0x8004D013,
+        XACT_E_NOIMPORTOBJECT       = 0x8004D014,
+        XACT_E_INVALIDCOOKIE        = 0x8004D015,
+        XACT_E_INDOUBT              = 0x8004D016,
+        XACT_E_NOTIMEOUT            = 0x8004D017,
+        XACT_E_ALREADYINPROGRESS    = 0x8004D018,
+        XACT_E_ABORTED              = 0x8004D019,
+        XACT_E_LOGFULL              = 0x8004D01A,
+        XACT_E_TMNOTAVAILABLE       = 0x8004D01B,
+        XACT_E_CONNECTION_DOWN      = 0x8004D01C,
+        XACT_E_CONNECTION_DENIED    = 0x8004D01D,
+        XACT_E_REENLISTTIMEOUT      = 0x8004D01E,
+        XACT_E_TIP_CONNECT_FAILED   = 0x8004D01F,
+        XACT_E_TIP_PROTOCOL_ERROR   = 0x8004D020,
+        XACT_E_TIP_PULL_FAILED      = 0x8004D021,
+        XACT_E_DEST_TMNOTAVAILABLE  = 0x8004D022,
+
+        // TXF log & CRM
+
+        XACT_E_CLERKNOTFOUND        = 0x8004d080,
+        XACT_E_CLERKEXISTS          = 0x8004d081,
+        XACT_E_RECOVERYINPROGRESS   = 0x8004d082,
+        XACT_E_TRANSACTIONCLOSED    = 0x8004d083,
+        XACT_E_INVALIDLSN           = 0x8004d084,
+        XACT_E_REPLAYREQUEST        = 0x8004d085,
+
+        XACT_S_ASYNC                = 0x0004D000,
+        XACT_S_DEFECT               = 0x0004D001,
+        XACT_S_READONLY             = 0x0004D002,
+        XACT_S_SOMENORETAIN         = 0x0004D003,
+        XACT_S_OKINFORM             = 0x0004D004,
+        XACT_S_MADECHANGESCONTENT   = 0x0004D005,
+        XACT_S_MADECHANGESINFORM    = 0x0004D006,
+        XACT_S_ALLNORETAIN          = 0x0004D007,
+        XACT_S_ABORTING             = 0x0004D008,
+        XACT_S_SINGLEPHASE          = 0x0004D009,
+        } XACT_E;
+*/
+    }
+
+
+/*
+ *==========================================================================
+ * Basic transaction interfaces
+ *==========================================================================
+ */
+
+/* Transaction interface, single phase */
+
+[object,uuid(0fb15084-af41-11ce-bd2b-204c4f4f5020), pointer_default(unique)]
+interface ITransaction : IUnknown {
+
+    HRESULT Commit
+        (
+        [in] BOOL  fRetaining,
+        [in] DWORD grfTC,
+        [in] DWORD grfRM
+        );
+    HRESULT Abort
+        (
+        [in, unique] BOID* pboidReason,
+        [in]         BOOL  fRetaining,
+        [in]         BOOL  fAsync
+        );
+    HRESULT GetTransactionInfo
+        (
+        [out] XACTTRANSINFO* pinfo
+        );
+    }
+
+/* Interface by which new transactions are commonly created */
+
+[object,uuid(3A6AD9E1-23B9-11cf-AD60-00AA00A74CCD),pointer_default(unique)]
+interface ITransactionDispenser : IUnknown {
+    HRESULT GetOptionsObject
+        (
+        [out] ITransactionOptions** ppOptions
+        );
+    HRESULT BeginTransaction
+        (
+        [in, unique]    IUnknown*      punkOuter,             /* controlling unknown */
+        [in]            ISOLEVEL       isoLevel,              /* isolation level for xtion */
+        [in]            ULONG          isoFlags,              /* values from ISOFLAG enumeration */
+        [in, unique]    ITransactionOptions* pOptions,        /* pointer retrieved from previous GetOptions */
+        [out]           ITransaction** ppTransaction
+        );
+    }
+
+[object,uuid(3A6AD9E0-23B9-11cf-AD60-00AA00A74CCD),pointer_default(unique)]
+interface ITransactionOptions : IUnknown {
+    HRESULT SetOptions
+        (
+        [in]  XACTOPT* pOptions
+        );
+    HRESULT GetOptions
+        (
+        [in,out]  XACTOPT* pOptions
+        );
+    }
+
+[object,uuid(3A6AD9E2-23B9-11cf-AD60-00AA00A74CCD),pointer_default(unique)]
+interface ITransactionOutcomeEvents : IUnknown {
+    HRESULT Committed
+        (
+        [in]            BOOL       fRetaining,
+        [in, unique]    XACTUOW*   pNewUOW,
+        [in]            HRESULT    hr
+        );
+    HRESULT Aborted
+        (
+        [in, unique]    BOID*      pboidReason,
+        [in]            BOOL       fRetaining,
+        [in, unique]    XACTUOW*   pNewUOW,
+        [in]            HRESULT    hr
+        );
+    HRESULT HeuristicDecision
+        (
+        [in]            DWORD      dwDecision,
+        [in, unique]    BOID*      pboidReason,
+        [in]            HRESULT    hr
+        );
+    HRESULT Indoubt
+        (
+            void
+        );
+    }
-- 
1.7.5.4


More information about the wine-patches mailing list