Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

336 lines
16 KiB

  1. /*
  2. @doc ADVANCED QUEUEING DATA TYPES
  3. @module aqadmtyp.h | Data types used in advanced queueing interfaces
  4. */
  5. /*++/
  6. Copyright (c) 1999 Microsoft Corporation
  7. Module Name:
  8. aqadmtyp.h
  9. Abstract:
  10. This module defines data types used in advanced queueing interfaces
  11. --*/
  12. #ifndef __AQADMTYP_H__
  13. #define __AQADMTYP_H__
  14. #ifdef __midl
  15. #define MIDL(x) x
  16. #else
  17. #define MIDL(x)
  18. #endif
  19. // max *required* size of buffer returned by implementor of QAPI
  20. // If the size of the requested information exceeds this constant,
  21. // then QAPI *may* truncate the buffer.
  22. #define QUEUE_ADMIN_MAX_BUFFER_REQUIRED 200
  23. // @enum QUEUE_ADMIN_VERSIONS | Enum specify current and supported
  24. // queue admin versions.
  25. // @emem CURRENT_QUEUE_ADMIN_VERSION | The current queue admin version
  26. // that all structures should have this value in their dwVersion field.
  27. typedef enum tagQUEUE_ADMIN_VERSIONS {
  28. CURRENT_QUEUE_ADMIN_VERSION = 4,
  29. } QUEUE_ADMIN_VERSIONS;
  30. //
  31. // @struct MESSAGE_FILTER | Structure describing criteria for selecting
  32. // messages
  33. // @field DWORD | dwVersion | Version of MESSAGE_FILTER struct - must be CURRENT_QUEUE_ADMIN_VERSION
  34. // @field DWORD | fFlags | <t MESSAGE_FILTER_FLAGS> indicating which
  35. // fields of filter are specified
  36. // @field LPCWSTR | szMessageId | Message ID, as returned in a MESSAGE_INFO
  37. // struct
  38. // @field LPCWSTR | szMessageSender | Messages sent by this sender match
  39. // @field LPCWSTR | szMessageRecipient | Messages sent to this recipient match
  40. // @field DWORD | dwLargerThanSize | Messages larger than this value match
  41. // @field SYSTEMTIME | stOlderThan | Messages older than this value match
  42. //
  43. typedef struct tagMESSAGE_FILTER {
  44. DWORD dwVersion;
  45. DWORD fFlags;
  46. MIDL([string]) LPCWSTR szMessageId;
  47. MIDL([string]) LPCWSTR szMessageSender;
  48. MIDL([string]) LPCWSTR szMessageRecipient;
  49. DWORD dwLargerThanSize;
  50. SYSTEMTIME stOlderThan;
  51. } MESSAGE_FILTER, *PMESSAGE_FILTER;
  52. // @enum MESSAGE_FILTER_FLAGS | Type specifying the type of filter
  53. // requested. These are bitflags and can be OR'd together.
  54. // @emem MF_MESSAGEID | The <e MESSAGE_FILTER.szMessageId> is specified
  55. // @emem MF_SENDER | The <e MESSAGE_FILTER.szMessageSender> is specified
  56. // @emem MF_RECIPIENT | The <e MESSAGE_FILTER.szMessageRecipient> is specified
  57. // @emem MF_SIZE | The <e MESSAGE_FILTER.dwLargerThanSize> is specified
  58. // @emem MF_TIME | The <e MESSAGE_FILTER.stOlderThan> is specified
  59. // @emem MF_FROZEN | The <e MESSAGE_FILTER.fFrozen> is specified
  60. // @emem MF_FAILED | Selects messages that have had a failed delivery attempt
  61. // @emem MF_INVERTSENSE | If set, indicates that the negation of the filter
  62. // @emem MF_ALL | Select all messages
  63. typedef enum tagMESSAGE_FILTER_FLAGS {
  64. MF_MESSAGEID = 0x00000001,
  65. MF_SENDER = 0x00000002,
  66. MF_RECIPIENT = 0x00000004,
  67. MF_SIZE = 0x00000008,
  68. MF_TIME = 0x00000010,
  69. MF_FROZEN = 0x00000020,
  70. MF_FAILED = 0x00000100,
  71. MF_ALL = 0x40000000,
  72. MF_INVERTSENSE = 0x80000000
  73. } MESSAGE_FILTER_FLAGS;
  74. // @enum MESSAGE_ACTION | Type specifying possible administrative actions
  75. // that may be applied to messages in a virtual server, link, or queue
  76. // @emem MA_DELETE | Remove message from the virtual server, link, or queue
  77. // @emem MA_DELETE_SILENT | Remove message without generating an NDR
  78. // @emem MA_FREEZE | Freeze the message in the virtual server, link, or queue
  79. // @emem MA_THAW | Un-freeze the message in the virtual server, link, or queue
  80. // @emem MA_COUNT | Null operation, does not affect messages, but does return count.
  81. typedef enum tagMESSAGE_ACTION {
  82. MA_THAW_GLOBAL = 0x00000001,
  83. MA_COUNT = 0x00000002,
  84. MA_FREEZE_GLOBAL = 0x00000004,
  85. MA_DELETE = 0x00000008,
  86. MA_DELETE_SILENT = 0x00000010
  87. } MESSAGE_ACTION;
  88. // @enum MESSAGE_ENUM_FILTER_TYPE | Type specifying the type of filter
  89. // requested. These are bitflags and can be OR'd together.
  90. // @emem MEF_FIRST_N_MESSAGES | Return the first
  91. // <e MESSAGE_ENUM_FILTER.cMessages> messages
  92. // @emem MEF_N_LARGEST_MESSAGES | Return the largest
  93. // <e MESSAGE_ENUM_FILTER.cMessages> messages
  94. // @emem MEF_N_OLDEST_MESSAGES | Return the oldest
  95. // <e MESSAGE_ENUM_FILTER.cMessages> messages
  96. // @emem MF_SENDER | The <e MESSAGE_ENUM_FILTER.szMessageSender> is specified
  97. // @emem MF_RECIPIENT | The <e MESSAGE_ENUM_FILTER.szMessageRecipient> is specified
  98. // @emem MEF_OLDER_THAN | Return messages older than
  99. // <e MESSAGE_ENUM_FILTER.stDate>
  100. // @emem MEF_LARGER_THAN | Return messages larger than
  101. // <e MESSAGE_ENUM_FILTER.cbSize> bytes
  102. // @emem MEF_FROZEN | Return messages that are frozen
  103. // @emem MEF_INVERTSENSE | Invert the meaning of the filter
  104. // @emem MEF_ALL | Select all messages
  105. // @emem MEF_FAILED | Return only messages that have had failed delivery
  106. // attempts.
  107. typedef enum tagMESSAGE_ENUM_FILTER_TYPE {
  108. MEF_FIRST_N_MESSAGES = 0x00000001,
  109. MEF_SENDER = 0x00000002,
  110. MEF_RECIPIENT = 0x00000004,
  111. MEF_LARGER_THAN = 0x00000008,
  112. MEF_OLDER_THAN = 0x00000010,
  113. MEF_FROZEN = 0x00000020,
  114. MEF_N_LARGEST_MESSAGES = 0x00000040,
  115. MEF_N_OLDEST_MESSAGES = 0x00000080,
  116. MEF_FAILED = 0x00000100,
  117. MEF_ALL = 0x40000000,
  118. MEF_INVERTSENSE = 0x80000000,
  119. } MESSAGE_ENUM_FILTER_TYPE;
  120. // @struct MESSAGE_ENUM_FILTER | Structure describing criteria for enumerating
  121. // messages
  122. // @field DWORD | dwVersion | Version of filter - must be CURRENT_QUEUE_ADMIN_VERSION
  123. // @field MESSAGE_ENUM_FILTER_TYPE | mefType | <t MESSAGE_ENUM_FILTER_TYPE> Flags for filter.
  124. // @field DWORD | cMessages | Number of messages to return
  125. // @field DWORD | cbSize | Size parameter of messages
  126. // @field DWORD | cSkipMessages | Number of messages at front of queue to skip.
  127. // This is provided to allow "paged" queries to the server.
  128. // @field SYSTEMTIME | stDate | Date/Time parameter of messages
  129. typedef struct tagMESSAGE_ENUM_FILTER {
  130. DWORD dwVersion;
  131. DWORD mefType;
  132. DWORD cMessages;
  133. DWORD cbSize;
  134. DWORD cSkipMessages;
  135. SYSTEMTIME stDate;
  136. MIDL([string]) LPCWSTR szMessageSender;
  137. MIDL([string]) LPCWSTR szMessageRecipient;
  138. } MESSAGE_ENUM_FILTER, *PMESSAGE_ENUM_FILTER;
  139. // @enum LINK_INFO_FLAGS | Type specifying the state of the link
  140. // @emem LI_ACTIVE | Link has an active connection transferring mail
  141. // @emem LI_READY | Link is ready for a connection, but there are no connections
  142. // @emem LI_RETRY | Link is waiting for the retry interval to elapse
  143. // @emem LI_SCHEDULED | Link is waiting for the next scheduled time
  144. // @emem LI_REMOTE | Link is to be activated by remote server. A connection
  145. // will not be made unless requested by a remote server.
  146. // @emem LI_FROZEN | Link was frozen by administrative action
  147. // @emem LI_TYPE_REMOTE_DELIVERY | Messages on link are being delivered
  148. // remotely. This is the default type of link.
  149. // @emem LI_TYPE_LOCAL_DELIVERY | Messages on this link are being delivered
  150. // locally.
  151. // @emem LI_TYPE_PENDING_CAT | Messages on this link are pending message
  152. // categorization.
  153. // @emem LI_TYPE_PENDING_ROUTING | Messages on this link have not been routed
  154. // to their next hop.
  155. // @emem LI_TYPE_CURRENTLY_UNREACHABLE | Messages on this link do not have an
  156. // available route to their final destination. This is due to transient
  157. // network or server errors. These messages will be retried when a route
  158. // becomes available.
  159. // @emem LI_TYPE_INTERNAL | This link is an internal link not described
  160. // by the above.
  161. typedef enum tagLINK_INFO_FLAGS {
  162. LI_ACTIVE = 0x00000001,
  163. LI_READY = 0x00000002,
  164. LI_RETRY = 0x00000004,
  165. LI_SCHEDULED = 0x00000008,
  166. LI_REMOTE = 0x00000010,
  167. LI_FROZEN = 0x00000020,
  168. LI_TYPE_REMOTE_DELIVERY = 0x00000100,
  169. LI_TYPE_LOCAL_DELIVERY = 0x00000200,
  170. LI_TYPE_PENDING_ROUTING = 0x00000400,
  171. LI_TYPE_PENDING_CAT = 0x00000800,
  172. LI_TYPE_CURRENTLY_UNREACHABLE = 0x00001000,
  173. LI_TYPE_DEFERRED_DELIVERY = 0x00002000,
  174. LI_TYPE_INTERNAL = 0x00004000,
  175. LI_TYPE_PENDING_SUBMIT = 0x00008000,
  176. } LINK_INFO_FLAGS;
  177. // @enum LINK_ACTION | Actions that can be applied to a link
  178. // @emem LA_KICK | Force a connection to be made for this link.
  179. // This will even work for connections pending retry or a scheduled connection.
  180. // @emem LA_FREEZE | Prevent outbound connections from being made for a link
  181. // @emem LA_THAW | Undo a previous admin freeze action.
  182. typedef enum tagLINK_ACTION {
  183. LA_INTERNAL = 0x00000000,
  184. LA_KICK = 0x00000001,
  185. LA_FREEZE = 0x00000020,
  186. LA_THAW = 0x00000040,
  187. } LINK_ACTION;
  188. //
  189. // @struct LINK_INFO | Structure describing state of a virtual server AQ link
  190. // @field DWORD | dwVersion | Version of LINK_INFO structure - will be CURRENT_QUEUE_ADMIN_VERSION
  191. // @field LPWSTR | szLinkName | Name of next-hop
  192. // @field DWORD | cMessages | Number of messages queued up for this link
  193. // @field DWORD | fStateFlags | <t LINK_INFO_FLAGS> indicating Link State
  194. // @field SYSTEMTIME | stNextScheduledConnection | The time at which the next
  195. // connection will be attempted.
  196. // @field SYSTEMTIME | stOldestMessage | The oldest message on this link
  197. // @field ULARGE_INTEGER | cbLinkVolume | Total number of bytes on link
  198. // @field LPWSTR | szLinkDN | DN associated with this link by routing. Can be NULL.
  199. // @field LPWSTR | szExtendedStateInfo | If present, this provides additional state
  200. // information about why a link is in <t LI_RETRY> state.
  201. // @field DWORD | dwSupportedLinkActions | Tells which <t LINK_ACTIONS> are supported
  202. // by this link.
  203. typedef struct tagLINK_INFO {
  204. DWORD dwVersion;
  205. MIDL([string]) LPWSTR szLinkName;
  206. DWORD cMessages;
  207. DWORD fStateFlags;
  208. SYSTEMTIME stNextScheduledConnection;
  209. SYSTEMTIME stOldestMessage;
  210. ULARGE_INTEGER cbLinkVolume;
  211. MIDL([string]) LPWSTR szLinkDN;
  212. MIDL([string]) LPWSTR szExtendedStateInfo;
  213. DWORD dwSupportedLinkActions;
  214. } LINK_INFO, *PLINK_INFO;
  215. //
  216. // @struct QUEUE_INFO | Structure describing state of a virtual server link
  217. // queue
  218. // @field DWORD | dwVersion | Version of LINK_INFO structure - will be CURRENT_QUEUE_ADMIN_VERSION
  219. // @field LPWSTR | szQueueName | Name of queue
  220. // @field LPWSTR | szLinkName | Name of link that is servicing this queue
  221. // @field DWORD | cMessages | Number of messages on this queue
  222. // @field ULARGE_INTEGER | cbQueueVolume | Total number of bytes on queue
  223. // @field DWORD | dwMsgEnumFlagsSupported | The types of message enumeration supported
  224. typedef struct tagQUEUE_INFO {
  225. DWORD dwVersion;
  226. MIDL([string]) LPWSTR szQueueName;
  227. MIDL([string]) LPWSTR szLinkName;
  228. DWORD cMessages;
  229. ULARGE_INTEGER cbQueueVolume;
  230. DWORD dwMsgEnumFlagsSupported;
  231. } QUEUE_INFO, *PQUEUE_INFO;
  232. //
  233. // @enum AQ_MESSAGE_FLAGS | Flags describing message properties
  234. // @flag MP_HIGH | High Priority Message
  235. // @flag MP_NORMAL | Normal Priority Message
  236. // @flag MP_LOW | Low Priority Message
  237. // @flag MP_MSG_FROZEN | Message has been frozen by admin.
  238. // @flag MP_MSG_RETRY | Delivery has been attempted and failed at least once
  239. // for this message.
  240. // @flag MP_MSG_CONTENT_AVAILABLE | The content for this message can be
  241. // accessed through the QAPI.
  242. typedef enum tagAQ_MESSAGE_FLAGS {
  243. MP_HIGH = 0x00000001,
  244. MP_NORMAL = 0x00000002,
  245. MP_LOW = 0x00000004,
  246. MP_MSG_FROZEN = 0x00000008,
  247. MP_MSG_RETRY = 0x00000010,
  248. MP_MSG_CONTENT_AVAILABLE = 0x00000020,
  249. } AQ_MESSAGE_FLAGS;
  250. // @struct MESSAGE_INFO | Structure describing a single mail message
  251. // @field DWORD | dwVersion | Version of LINK_INFO structure - will be CURRENT_QUEUE_ADMIN_VERSION
  252. // @field LPWSTR | szMessageId | Message ID
  253. // @field LPWSTR | szSender | Sender Address, from "From:" header
  254. // @field LPWSTR | szSubject | Message Subject
  255. // @field DWORD | cRecipients | Number of recipients
  256. // @field LPWSTR | szRecipients | Recipient Addresses, from "To:" header
  257. // @field DWORD | cCCRecipients | Number of CC recipients
  258. // @field LPWSTR | szCCRecipients | CC Recipient Addresses, from "CC:" header
  259. // @field DWORD | cBCCRecipients | Number of BCC recipients
  260. // @field LPWSTR | szBCCRecipients | BCC Recipient Addresses, from "BCC:" header
  261. // @field DWORD | cbMessageSize | size of message in bytes
  262. // @field DWORD | fMsgFlags | <t AQ_MESSAGE_FLAGS> describing message properties.
  263. // @field SYSTEMTIME | stSubmission | Time of message submission
  264. // @field SYSTEMTIME | stReceived | Time message was received by this server
  265. // @field SYSTEMTIME | stExpiry | Time message will expire by if not delivered
  266. // to all recipients, thus generating an NDR
  267. // @field DWORD | cFailures | The number of failured delivery attempts for
  268. // this message
  269. // @field DWORD | cEnvRecipients | The number of envelope recipeints
  270. // @field DWORD | cbEnvRecipients | The size in bytes of the envelope recipients
  271. // @field WCHAR * | mszEnvRecipients | A multi-string UNICODE buffer containing
  272. // a NULL-terminated string for each recipient. The buffer itself is terminated
  273. // by an additional NULL. Each recipient string will be formatted in the proxy
  274. // address format of 'addr-type ":" address'. The addr-type should match
  275. // the address type found in the DS (ie SMTP). The address should be returned
  276. // in it's native format.
  277. typedef struct tagMESSAGE_INFO {
  278. DWORD dwVersion;
  279. MIDL([string]) LPWSTR szMessageId;
  280. MIDL([string]) LPWSTR szSender;
  281. MIDL([string]) LPWSTR szSubject;
  282. DWORD cRecipients;
  283. MIDL([string]) LPWSTR szRecipients;
  284. DWORD cCCRecipients;
  285. MIDL([string]) LPWSTR szCCRecipients;
  286. DWORD cBCCRecipients;
  287. MIDL([string]) LPWSTR szBCCRecipients;
  288. DWORD fMsgFlags;
  289. DWORD cbMessageSize;
  290. SYSTEMTIME stSubmission;
  291. SYSTEMTIME stReceived;
  292. SYSTEMTIME stExpiry;
  293. DWORD cFailures;
  294. DWORD cEnvRecipients;
  295. DWORD cbEnvRecipients;
  296. MIDL([size_is(cbEnvRecipients/sizeof(WCHAR))]) WCHAR *mszEnvRecipients;
  297. } MESSAGE_INFO, *PMESSAGE_INFO;
  298. typedef enum tagQUEUELINK_TYPE {
  299. QLT_QUEUE,
  300. QLT_LINK,
  301. QLT_NONE
  302. } QUEUELINK_TYPE;
  303. typedef struct tagQUEUELINK_ID {
  304. GUID uuid;
  305. MIDL([string]) LPWSTR szName;
  306. DWORD dwId;
  307. QUEUELINK_TYPE qltType;
  308. } QUEUELINK_ID;
  309. #endif