/*
* Copyright (C) 2013 Daniel JeliĆski
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
import "txcoord.idl";
interface IXATransLookup;
interface IXATransLookup2;
interface IResourceManagerSink;
interface IResourceManager;
interface ILastResourceManager;
interface IResourceManager2;
interface IXAConfig;
/*interface IRMHelper;
interface IXAObtainRMInfo;*/
interface IResourceManagerFactory;
interface IResourceManagerFactory2;
interface IPrepareInfo;
interface IPrepareInfo2;
interface IGetDispenser;
interface ITransactionVoterBallotAsync2;
interface ITransactionVoterNotifyAsync2;
interface ITransactionVoterFactory2;
interface ITransactionPhase0EnlistmentAsync;
interface ITransactionPhase0NotifyAsync;
interface ITransactionPhase0Factory;
interface ITransactionTransmitter;
interface ITransactionTransmitterFactory;
interface ITransactionReceiver;
interface ITransactionReceiverFactory;
interface IDtcLuConfigure;
interface IDtcLuRecovery;
interface IDtcLuRecoveryFactory;
interface IDtcLuRecoveryInitiatedByDtcTransWork;
interface IDtcLuRecoveryInitiatedByDtcStatusWork;
interface IDtcLuRecoveryInitiatedByDtc;
interface IDtcLuRecoveryInitiatedByLuWork;
interface IDtcLuRecoveryInitiatedByLu;
interface IDtcLuRmEnlistment;
interface IDtcLuRmEnlistmentSink;
interface IDtcLuRmEnlistmentFactory;
interface IDtcLuSubordinateDtc;
interface IDtcLuSubordinateDtcSink;
interface IDtcLuSubordinateDtcFactory;
cpp_quote("#define XACTTOMSG(dwXact) (dwXact-0x00040000+0x40000000)")
typedef enum XACT_DTC_CONSTANTS {
XACT_E_CONNECTION_REQUEST_DENIED = 0x8004d100,
XACT_E_TOOMANY_ENLISTMENTS = 0x8004d101,
XACT_E_DUPLICATE_GUID = 0x8004d102,
XACT_E_NOTSINGLEPHASE = 0x8004d103,
XACT_E_RECOVERYALREADYDONE = 0x8004d104,
XACT_E_PROTOCOL = 0x8004d105,
XACT_E_RM_FAILURE = 0x8004d106,
XACT_E_RECOVERY_FAILED = 0x8004d107,
XACT_E_LU_NOT_FOUND = 0x8004d108,
XACT_E_DUPLICATE_LU = 0x8004d109,
XACT_E_LU_NOT_CONNECTED = 0x8004d10a,
XACT_E_DUPLICATE_TRANSID = 0x8004d10b,
XACT_E_LU_BUSY = 0x8004d10c,
XACT_E_LU_NO_RECOVERY_PROCESS = 0x8004d10d,
XACT_E_LU_DOWN = 0x8004d10e,
XACT_E_LU_RECOVERING = 0x8004d10f,
XACT_E_LU_RECOVERY_MISMATCH = 0x8004d110,
XACT_E_RM_UNAVAILABLE = 0x8004d111,
XACT_E_LRMRECOVERYALREADYDONE = 0x8004d112,
XACT_E_NOLASTRESOURCEINTERFACE = 0x8004d113,
XACT_S_NONOTIFY = 0x4d100,
XACT_OK_NONOTIFY = 0x4d101,
dwUSER_MS_SQLSERVER = 0xffff
cpp_quote("#ifndef _XID_T_DEFINED")
cpp_quote("#define _XID_T_DEFINED")
char data[128 ];
} XID;
cpp_quote("#endif")
/* idl doesn't like this type
cpp_quote("#ifndef _XA_SWITCH_T_DEFINED")
cpp_quote("#define _XA_SWITCH_T_DEFINED")
typedef struct xa_switch_t {
char name[32 ];
LONG32 flags;
LONG32 version;
int (__cdecl *xa_open_entry)(char *__MIDL_0004,int __MIDL_0005,LONG32 __MIDL_0006);
int (__cdecl *xa_close_entry)(char *__MIDL_0008,int __MIDL_0009,LONG32 __MIDL_0010);
int (__cdecl *xa_start_entry)(XID *__MIDL_0012,int __MIDL_0013,LONG32 __MIDL_0014);
int (__cdecl *xa_end_entry)(XID *__MIDL_0016,int __MIDL_0017,LONG32 __MIDL_0018);
int (__cdecl *xa_rollback_entry)(XID *__MIDL_0020,int __MIDL_0021,LONG32 __MIDL_0022);
int (__cdecl *xa_prepare_entry)(XID *__MIDL_0024,int __MIDL_0025,LONG32 __MIDL_0026);
int (__cdecl *xa_commit_entry)(XID *__MIDL_0028,int __MIDL_0029,LONG32 __MIDL_0030);
int (__cdecl *xa_recover_entry)(XID *__MIDL_0032,LONG32 __MIDL_0033,int __MIDL_0034,LONG32 __MIDL_0035);
int (__cdecl *xa_forget_entry)(XID *__MIDL_0037,int __MIDL_0038,LONG32 __MIDL_0039);
int (__cdecl *xa_complete_entry)(int *__MIDL_0041,int *__MIDL_0042,int __MIDL_0043,LONG32 __MIDL_0044);
} xa_switch_t;
cpp_quote("#endif")
*/
[
]
interface IXATransLookup : IUnknown {
};
[
]
interface IXATransLookup2 : IUnknown {
};
[
]
interface IResourceManagerSink : IUnknown {
};
[
]
interface IResourceManager : IUnknown {
HRESULT Enlist([in]ITransaction *pTransaction,[in]ITransactionResourceAsync *pRes,[out]XACTUOW *pUOW,[out]LONG *pisoLevel,[out]ITransactionEnlistmentAsync **ppEnlist);
HRESULT Reenlist([in]byte *pPrepInfo,[in]ULONG cbPrepInfo,[in]DWORD lTimeout,[out]XACTSTAT *pXactStat);
HRESULT ReenlistmentComplete(void);
};
[
]
interface ILastResourceManager : IUnknown {
HRESULT RecoveryDone(void);
};
[
]
interface IResourceManager2 : IResourceManager {
HRESULT Enlist2([in]ITransaction *pTransaction,[in]ITransactionResourceAsync *pResAsync,[out]XACTUOW *pUOW,[out]LONG *pisoLevel,[out]XID *pXid,[out]ITransactionEnlistmentAsync **ppEnlist);
};
[
]
};
/* commented out because idl doesn't accept xa_switch_t type
[
object,
uuid(E793F6D1-F53D-11cf-A60D-00A0C905416E)
]
interface IRMHelper : IUnknown {
HRESULT RMCount([in]DWORD dwcTotalNumberOfRMs);
HRESULT RMInfo([in]xa_switch_t *pXa_Switch,[in]BOOL fCDeclCallingConv,[in]char *pszOpenString,[in]char *pszCloseString,[in]GUID guidRMRecovery);
};
[
object,
uuid(E793F6D2-F53D-11cf-A60D-00A0C905416E)
]
interface IXAObtainRMInfo : IUnknown {
HRESULT ObtainRMInfo([in]IRMHelper *pIRMHelper);
};*/
[
]
interface IResourceManagerFactory : IUnknown {
HRESULT Create([in]GUID *pguidRM,[in]CHAR *pszRMName,[in]IResourceManagerSink *pIResMgrSink,[out]IResourceManager **ppResMgr);
};
[
]
interface IResourceManagerFactory2 : IResourceManagerFactory {
HRESULT CreateEx([in]GUID *pguidRM,[in]CHAR *pszRMName,[in]IResourceManagerSink *pIResMgrSink,[in]REFIID riidRequested,[out, iid_is(riidRequested)]void **ppvResMgr);
};
[
]
interface IPrepareInfo : IUnknown {
};
[
]
interface IPrepareInfo2 : IUnknown {
};
[
]
interface IGetDispenser : IUnknown {
};
[
]
interface ITransactionVoterBallotAsync2 : IUnknown {
};
[
]
interface ITransactionVoterNotifyAsync2 : ITransactionOutcomeEvents {
HRESULT VoteRequest(void);
};
[
]
interface ITransactionVoterFactory2 : IUnknown {
HRESULT Create([in]ITransaction *pTransaction,[in]ITransactionVoterNotifyAsync2 *pVoterNotify,[out]ITransactionVoterBallotAsync2 **ppVoterBallot);
};
[
]
interface ITransactionPhase0EnlistmentAsync : IUnknown {
HRESULT WaitForEnlistment(void);
HRESULT Phase0Done(void);
};
[
]
interface ITransactionPhase0NotifyAsync : IUnknown {
};
[
]
interface ITransactionPhase0Factory : IUnknown {
HRESULT Create([in]ITransactionPhase0NotifyAsync *pPhase0Notify,[out]ITransactionPhase0EnlistmentAsync **ppPhase0Enlistment);
};
[
]
interface ITransactionTransmitter : IUnknown {
};
[
]
interface ITransactionTransmitterFactory : IUnknown {
};
[
]
interface ITransactionReceiver : IUnknown {
HRESULT UnmarshalPropagationToken([in]ULONG cbToken,[in]byte *rgbToken,[out]ITransaction **ppTransaction);
};
[
]
interface ITransactionReceiverFactory : IUnknown {
};
[
]
interface IDtcLuConfigure : IUnknown {
};
[
]
interface IDtcLuRecovery : IUnknown {
};
[
]
interface IDtcLuRecoveryFactory : IUnknown {
};
typedef enum _DtcLu_LocalRecovery_Work {
typedef enum _DtcLu_Xln {
DTCLUXLN_COLD = 1,
} DTCLUXLN;
typedef enum _DtcLu_Xln_Confirmation {
typedef enum _DtcLu_Xln_Response {
typedef enum _DtcLu_Xln_Error {
typedef enum _DtcLu_CompareState {
[
]
interface IDtcLuRecoveryInitiatedByDtcTransWork : IUnknown {
HRESULT GetOurXln([out]DTCLUXLN *pXln,[in,out]unsigned char *pOurLogName,[in,out]unsigned char *pRemoteLogName,[out]DWORD *pdwProtocol);
HRESULT HandleTheirXlnResponse([in]DTCLUXLN Xln,[in]unsigned char *pRemoteLogName,[in]DWORD cbRemoteLogName,[in]DWORD dwProtocol,[out]DTCLUXLNCONFIRMATION *pConfirmation);
HRESULT GetOurCompareStates([in,out]unsigned char *pOurTransId,[out]DTCLUCOMPARESTATE *pCompareState);
HRESULT HandleTheirCompareStatesResponse([in]DTCLUCOMPARESTATE CompareState,[out]DTCLUCOMPARESTATESCONFIRMATION *pConfirmation);
HRESULT ConversationLost(void);
};
[
]
interface IDtcLuRecoveryInitiatedByDtcStatusWork : IUnknown {
};
[
]
};
[
]
interface IDtcLuRecoveryInitiatedByLuWork : IUnknown {
HRESULT HandleTheirXln([in]LONG lRecoverySeqNum,[in]DTCLUXLN Xln,[in]unsigned char *pRemoteLogName,[in]DWORD cbRemoteLogName,[in]unsigned char *pOurLogName,[in]DWORD cbOurLogName,[in]DWORD dwProtocol,[out]DTCLUXLNRESPONSE *pResponse);
HRESULT HandleTheirCompareStates([in,out]unsigned char *pRemoteTransId,[in]DWORD cbRemoteTransId,[in]DTCLUCOMPARESTATE CompareState,[out]DTCLUCOMPARESTATESRESPONSE *pResponse,[out]DTCLUCOMPARESTATE *pCompareState);
HRESULT ConversationLost(void);
};
[
]
interface IDtcLuRecoveryInitiatedByLu : IUnknown {
};
[
]
interface IDtcLuRmEnlistment : IUnknown {
HRESULT RequestCommit(void);
};
[
]
interface IDtcLuRmEnlistmentSink : IUnknown {
HRESULT SessionLost(void);
HRESULT RequestCommit(void);
};
[
]
interface IDtcLuRmEnlistmentFactory : IUnknown {
HRESULT Create([in]unsigned char *pucLuPair,[in]DWORD cbLuPair,[in]ITransaction *pITransaction,[in]unsigned char *pTransId,[in]DWORD cbTransId,[in]IDtcLuRmEnlistmentSink *pRmEnlistmentSink,[in,out]IDtcLuRmEnlistment **ppRmEnlistment);
};
[
]
interface IDtcLuSubordinateDtc : IUnknown {
HRESULT RequestCommit(void);
};
[
]
interface IDtcLuSubordinateDtcSink : IUnknown {
HRESULT SessionLost(void);
HRESULT RequestCommit(void);
};
[
]
interface IDtcLuSubordinateDtcFactory : IUnknown {
HRESULT Create([in]unsigned char *pucLuPair,[in]DWORD cbLuPair,[in]IUnknown *punkTransactionOuter,[in]ISOLEVEL isoLevel,[in]ULONG isoFlags,[in]ITransactionOptions *pOptions,[out]ITransaction **ppTransaction,[in]unsigned char *pTransId,[in]DWORD cbTransId,[in]IDtcLuSubordinateDtcSink *pSubordinateDtcSink,[in,out]IDtcLuSubordinateDtc **ppSubordinateDtc);
};
/* these GUIDs were found in mingw header, but without corresponding interface definitions
DEFINE_GUID(IID_IXAResourceManager,0x4131e751,0x1aea,0x11d0,0x94,0x4b,0x00,0xa0,0xc9,0x05,0x41,0x6e);
DEFINE_GUID(IID_IXAResourceManagerFactory,0x4131e750,0x1aea,0x11d0,0x94,0x4b,0x00,0xa0,0xc9,0x05,0x41,0x6e);
DEFINE_GUID(IID_IXATransaction,0x4131e752,0x1aea,0x11d0,0x94,0x4b,0x00,0xa0,0xc9,0x05,0x41,0x6e);
*/