Merge trunk HEAD (46152)
[reactos.git] / include / psdk / ktmtypes.h
1
2 #ifndef _KTMTYPES_
3 #define _KTMTYPES_
4
5 #define TRANSACTION_MANAGER_VOLATILE 0x00000001
6 #define TRANSACTION_MANAGER_COMMIT_DEFAULT 0x00000000
7 #define TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME 0x00000002
8 #define TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES 0x00000004
9 #define TRANSACTION_MANAGER_COMMIT_LOWEST 0x00000008
10 #define TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY 0x00000010
11 #define TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS 0x00000020
12 #define TRANSACTION_MANAGER_MAXIMUM_OPTION 0x0000003F
13
14 #define TRANSACTION_DO_NOT_PROMOTE 0x00000001
15 #define TRANSACTION_MAXIMUM_OPTION 0x00000001
16
17 #define RESOURCE_MANAGER_VOLATILE 0x00000001
18 #define RESOURCE_MANAGER_COMMUNICATION 0x00000002
19 #define RESOURCE_MANAGER_MAXIMUM_OPTION 0x00000003
20
21 #define CRM_PROTOCOL_EXPLICIT_MARSHAL_ONLY 0x00000001
22 #define CRM_PROTOCOL_DYNAMIC_MARSHAL_INFO 0x00000002
23 #define CRM_PROTOCOL_MAXIMUM_OPTION 0x00000003
24
25 #define ENLISTMENT_SUPERIOR 0x00000001
26 #define ENLISTMENT_MAXIMUM_OPTION 0x00000001
27
28 #define TRANSACTION_NOTIFY_MASK 0x3FFFFFFF
29 #define TRANSACTION_NOTIFY_PREPREPARE 0x00000001
30 #define TRANSACTION_NOTIFY_PREPARE 0x00000002
31 #define TRANSACTION_NOTIFY_COMMIT 0x00000004
32 #define TRANSACTION_NOTIFY_ROLLBACK 0x00000008
33 #define TRANSACTION_NOTIFY_PREPREPARE_COMPLETE 0x00000010
34 #define TRANSACTION_NOTIFY_PREPARE_COMPLETE 0x00000020
35 #define TRANSACTION_NOTIFY_COMMIT_COMPLETE 0x00000040
36 #define TRANSACTION_NOTIFY_ROLLBACK_COMPLETE 0x00000080
37 #define TRANSACTION_NOTIFY_RECOVER 0x00000100
38 #define TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT 0x00000200
39 #define TRANSACTION_NOTIFY_DELEGATE_COMMIT 0x00000400
40 #define TRANSACTION_NOTIFY_RECOVER_QUERY 0x00000800
41 #define TRANSACTION_NOTIFY_ENLIST_PREPREPARE 0x00001000
42 #define TRANSACTION_NOTIFY_LAST_RECOVER 0x00002000
43 #define TRANSACTION_NOTIFY_INDOUBT 0x00004000
44 #define TRANSACTION_NOTIFY_PROPAGATE_PULL 0x00008000
45 #define TRANSACTION_NOTIFY_PROPAGATE_PUSH 0x00010000
46 #define TRANSACTION_NOTIFY_MARSHAL 0x00020000
47 #define TRANSACTION_NOTIFY_ENLIST_MASK 0x00040000
48 #define TRANSACTION_NOTIFY_RM_DISCONNECTED 0x01000000
49 #define TRANSACTION_NOTIFY_TM_ONLINE 0x02000000
50 #define TRANSACTION_NOTIFY_COMMIT_REQUEST 0x04000000
51 #define TRANSACTION_NOTIFY_PROMOTE 0x08000000
52 #define TRANSACTION_NOTIFY_PROMOTE_NEW 0x10000000
53 #define TRANSACTION_NOTIFY_REQUEST_OUTCOME 0x20000000
54
55 #define TRANSACTION_NOTIFY_COMMIT_FINALIZE 0x40000000
56
57 #define TRANSACTIONMANAGER_OBJECT_PATH L"\\TransactionManager\\"
58 #define TRANSACTION_OBJECT_PATH L"\\Transaction\\"
59 #define ENLISTMENT_OBJECT_PATH L"\\Enlistment\\"
60 #define RESOURCE_MANAGER_OBJECT_PATH L"\\ResourceManager\\"
61
62 #define TRANSACTIONMANAGER_OBJECT_NAME_LENGTH_IN_BYTES (sizeof(TRANSACTIONMANAGER_OBJECT_PATH)+(38*sizeof(WCHAR)))
63 #define TRANSACTION_OBJECT_NAME_LENGTH_IN_BYTES (sizeof(TRANSACTION_OBJECT_PATH)+(38*sizeof(WCHAR)))
64 #define ENLISTMENT_OBJECT_NAME_LENGTH_IN_BYTES (sizeof(ENLISTMENT_OBJECT_PATH)+(38*sizeof(WCHAR)))
65 #define RESOURCE_MANAGER_OBJECT_NAME_LENGTH_IN_BYTES (sizeof(RESOURCE_MANAGER_OBJECT_PATH)+(38*sizeof(WCHAR)))
66
67 #define TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED 0x1
68
69 #define KTM_MARSHAL_BLOB_VERSION_MAJOR 1
70 #define KTM_MARSHAL_BLOB_VERSION_MINOR 1
71
72 #define MAX_TRANSACTION_DESCRIPTION_LENGTH 64
73 #define MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH 64
74
75 typedef GUID UOW, *PUOW;
76 typedef GUID CRM_PROTOCOL_ID, *PCRM_PROTOCOL_ID;
77 typedef ULONG NOTIFICATION_MASK;
78 typedef ULONG SAVEPOINT_ID, *PSAVEPOINT_ID;
79
80 typedef struct _TRANSACTION_NOTIFICATION {
81 PVOID TransactionKey;
82 ULONG TransactionNotification;
83 LARGE_INTEGER TmVirtualClock;
84 ULONG ArgumentLength;
85 } TRANSACTION_NOTIFICATION, *PTRANSACTION_NOTIFICATION;
86
87 typedef struct _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT {
88 GUID EnlistmentId;
89 #if defined(__cplusplus)
90 ::UOW UOW;
91 #else
92 UOW UOW;
93 #endif
94 } TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT, *PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT;
95
96 typedef struct _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT {
97 GUID TmIdentity;
98 ULONG Flags;
99 } TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT, *PTRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT;
100
101 typedef struct _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT {
102 SAVEPOINT_ID SavepointId;
103 } TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT, *PTRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT;
104
105 typedef struct _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT {
106 ULONG PropagationCookie;
107 GUID UOW;
108 GUID TmIdentity;
109 ULONG BufferLength;
110 } TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT, *PTRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT,
111 TRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT, *PTRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT;
112
113 typedef struct _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT {
114 ULONG MarshalCookie;
115 GUID UOW;
116 } TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT, *PTRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT;
117
118 typedef struct _KCRM_MARSHAL_HEADER {
119 ULONG VersionMajor;
120 ULONG VersionMinor;
121 ULONG NumProtocols;
122 ULONG Unused;
123 } KCRM_MARSHAL_HEADER, *PKCRM_MARSHAL_HEADER, *RESTRICTED_POINTER PRKCRM_MARSHAL_HEADER;
124
125 typedef struct _KCRM_TRANSACTION_BLOB {
126 #if defined(__cplusplus)
127 ::UOW UOW;
128 #else
129 UOW UOW;
130 #endif
131 GUID TmIdentity;
132 ULONG IsolationLevel;
133 ULONG IsolationFlags;
134 ULONG Timeout;
135 WCHAR Description[MAX_TRANSACTION_DESCRIPTION_LENGTH];
136 } KCRM_TRANSACTION_BLOB, *PKCRM_TRANSACTION_BLOB, *RESTRICTED_POINTER PRKCRM_TRANSACTION_BLOB;
137
138 typedef struct _KCRM_PROTOCOL_BLOB {
139 CRM_PROTOCOL_ID ProtocolId;
140 ULONG StaticInfoLength;
141 ULONG TransactionIdInfoLength;
142 ULONG Unused1;
143 ULONG Unused2;
144 } KCRM_PROTOCOL_BLOB, *PKCRM_PROTOCOL_BLOB, *RESTRICTED_POINTER PRKCRM_PROTOCOL_BLOB;
145
146 #endif /* _KTMTYPES_ */
147