ifndef _KTMTYPES_
define _KTMTYPES_

UOW			typedef GUID
CRM_PROTOCOL_ID		typedef GUID
PUOW			typedef ptr GUID
PCRM_PROTOCOL_ID	typedef ptr GUID

TRANSACTION_MANAGER_VOLATILE		equ 0x00000001
TRANSACTION_MANAGER_COMMIT_DEFAULT	equ 0x00000000
TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME equ 0x00000002
TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES equ 0x00000004
TRANSACTION_MANAGER_COMMIT_LOWEST	equ 0x00000008
TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY equ 0x00000010
TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS equ 0x00000020
TRANSACTION_MANAGER_MAXIMUM_OPTION	equ 0x0000003F
TRANSACTION_DO_NOT_PROMOTE		equ 0x00000001
TRANSACTION_MAXIMUM_OPTION		equ 0x00000001

RESOURCE_MANAGER_VOLATILE		equ 0x00000001
RESOURCE_MANAGER_COMMUNICATION		equ 0x00000002
RESOURCE_MANAGER_MAXIMUM_OPTION		equ 0x00000003

CRM_PROTOCOL_EXPLICIT_MARSHAL_ONLY	equ 0x00000001
CRM_PROTOCOL_DYNAMIC_MARSHAL_INFO	equ 0x00000002
CRM_PROTOCOL_MAXIMUM_OPTION		equ 0x00000003

ENLISTMENT_SUPERIOR			equ 0x00000001
ENLISTMENT_MAXIMUM_OPTION		equ 0x00000001

NOTIFICATION_MASK			typedef ULONG

TRANSACTION_NOTIFY_MASK			equ 0x3FFFFFFF
TRANSACTION_NOTIFY_PREPREPARE		equ 0x00000001
TRANSACTION_NOTIFY_PREPARE		equ 0x00000002
TRANSACTION_NOTIFY_COMMIT		equ 0x00000004
TRANSACTION_NOTIFY_ROLLBACK		equ 0x00000008
TRANSACTION_NOTIFY_PREPREPARE_COMPLETE	equ 0x00000010
TRANSACTION_NOTIFY_PREPARE_COMPLETE	equ 0x00000020
TRANSACTION_NOTIFY_COMMIT_COMPLETE	equ 0x00000040
TRANSACTION_NOTIFY_ROLLBACK_COMPLETE	equ 0x00000080
TRANSACTION_NOTIFY_RECOVER		equ 0x00000100
TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT	equ 0x00000200
TRANSACTION_NOTIFY_DELEGATE_COMMIT	equ 0x00000400
TRANSACTION_NOTIFY_RECOVER_QUERY	equ 0x00000800
TRANSACTION_NOTIFY_ENLIST_PREPREPARE	equ 0x00001000
TRANSACTION_NOTIFY_LAST_RECOVER		equ 0x00002000
TRANSACTION_NOTIFY_INDOUBT		equ 0x00004000
TRANSACTION_NOTIFY_PROPAGATE_PULL	equ 0x00008000
TRANSACTION_NOTIFY_PROPAGATE_PUSH	equ 0x00010000
TRANSACTION_NOTIFY_MARSHAL		equ 0x00020000
TRANSACTION_NOTIFY_ENLIST_MASK		equ 0x00040000
TRANSACTION_NOTIFY_RM_DISCONNECTED	equ 0x01000000
TRANSACTION_NOTIFY_TM_ONLINE		equ 0x02000000
TRANSACTION_NOTIFY_COMMIT_REQUEST	equ 0x04000000
TRANSACTION_NOTIFY_PROMOTE		equ 0x08000000
TRANSACTION_NOTIFY_PROMOTE_NEW		equ 0x10000000
TRANSACTION_NOTIFY_REQUEST_OUTCOME	equ 0x20000000
TRANSACTION_NOTIFY_COMMIT_FINALIZE	equ 0x40000000

TRANSACTIONMANAGER_OBJECT_PATH		equ <L"\\TransactionManager\\">
TRANSACTION_OBJECT_PATH			equ <L"\\Transaction\\">
ENLISTMENT_OBJECT_PATH			equ <L"\\Enlistment\\">
RESOURCE_MANAGER_OBJECT_PATH		equ <L"\\ResourceManager\\">

TRANSACTIONMANAGER_OBJECT_NAME_LENGTH_IN_BYTES	equ ((20*WCHAR)+(38*WCHAR))
TRANSACTION_OBJECT_NAME_LENGTH_IN_BYTES		equ ((13*WCHAR)+(38*WCHAR))
ENLISTMENT_OBJECT_NAME_LENGTH_IN_BYTES		equ ((12*WCHAR)+(38*WCHAR))
RESOURCE_MANAGER_OBJECT_NAME_LENGTH_IN_BYTES	equ ((17*WCHAR)+(38*WCHAR))

TRANSACTION_NOTIFICATION	STRUC
TransactionKey			PVOID ?
TransactionNotification		ULONG ?
TmVirtualClock			LARGE_INTEGER <>
ArgumentLength			ULONG ?
TRANSACTION_NOTIFICATION	ENDS
PTRANSACTION_NOTIFICATION	typedef ptr TRANSACTION_NOTIFICATION

TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT  STRUC
EnlistmentId			GUID <>
UOW				UOW <>
TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT ENDS
PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT

TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED equ 0x1

TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT  STRUC
TmIdentity			GUID <>
Flags				ULONG ?
TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT ENDS
PTRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT

SAVEPOINT_ID		typedef ULONG
PSAVEPOINT_ID		typedef ptr ULONG

TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT  STRUC
SavepointId		SAVEPOINT_ID ?
TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT ENDS
PTRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT

TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT  STRUC
PropagationCookie	ULONG ?
UOW			GUID <>
TmIdentity		GUID <>
BufferLength		ULONG ?
TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT ENDS
PTRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT

TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT  STRUC
MarshalCookie		ULONG ?
UOW			GUID <>
TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT ENDS
PTRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT

TRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT  typedef TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT
PTRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT typedef ptr TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT


KTM_MARSHAL_BLOB_VERSION_MAJOR		equ 1
KTM_MARSHAL_BLOB_VERSION_MINOR		equ 1

MAX_TRANSACTION_DESCRIPTION_LENGTH	equ 64
MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH	equ 64

KCRM_MARSHAL_HEADER	STRUC
VersionMajor		dd ?
VersionMinor		dd ?
NumProtocols		dd ?
Unused			dd ?
KCRM_MARSHAL_HEADER	ENDS
PKCRM_MARSHAL_HEADER	typedef ptr KCRM_MARSHAL_HEADER
;RESTRICTED_POINTER
PRKCRM_MARSHAL_HEADER	typedef ptr KCRM_MARSHAL_HEADER

KCRM_TRANSACTION_BLOB	STRUC
UOW			UOW <>
TmIdentity		GUID <>
IsolationLevel		dd ?
IsolationFlags		dd ?
Timeout			dd ?
Description		dw MAX_TRANSACTION_DESCRIPTION_LENGTH dup(?)
KCRM_TRANSACTION_BLOB	ENDS
PKCRM_TRANSACTION_BLOB	typedef ptr KCRM_TRANSACTION_BLOB
;RESTRICTED_POINTER
PRKCRM_TRANSACTION_BLOB typedef ptr KCRM_TRANSACTION_BLOB

KCRM_PROTOCOL_BLOB	STRUC
ProtocolId		CRM_PROTOCOL_ID <>
StaticInfoLength	dd ?
TransactionIdInfoLength dd ?
Unused1			dd ?
Unused2			dd ?
KCRM_PROTOCOL_BLOB	ENDS
PKCRM_PROTOCOL_BLOB	typedef ptr KCRM_PROTOCOL_BLOB
;RESTRICTED_POINTER
PRKCRM_PROTOCOL_BLOB	typedef ptr KCRM_PROTOCOL_BLOB

endif

