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.

2582 lines
99 KiB

  1. /*
  2. * M A P I D E F S . H
  3. *
  4. * Definitions used by MAPI clients and service providers.
  5. *
  6. * Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  7. */
  8. #ifndef MAPIDEFS_H
  9. #define MAPIDEFS_H
  10. #ifdef WIN32 /* Must include WINDOWS.H on Win32 */
  11. #ifndef _WINDOWS_
  12. #define INC_OLE2 /* Get the OLE2 stuff */
  13. #define INC_RPC /* harmless on Daytona; Chicago needs it */
  14. #define _INC_OLE /* Chicago will include OLE1 without this */
  15. #include <windows.h>
  16. #endif
  17. #ifndef _OLEERROR_H_
  18. #include <objerror.h>
  19. #endif
  20. #ifndef _OBJBASE_H_
  21. #include <objbase.h>
  22. #endif
  23. #endif
  24. #if defined (WIN16) || defined (DOS) || defined (DOS16) || defined (MAC)
  25. #ifndef _COMPOBJ_H_
  26. #include <compobj.h>
  27. #endif
  28. #endif
  29. #ifndef _INC_STDDEF
  30. #include <stddef.h>
  31. #endif
  32. /* Array dimension for structures with variable-sized arrays at the end. */
  33. #ifndef MAPI_DIM
  34. #define MAPI_DIM 1
  35. #endif
  36. /* Provider init type. Force to cdecl always */
  37. #ifndef STDMAPIINITCALLTYPE
  38. #if !defined (_MAC) && defined (WIN32)
  39. #define STDMAPIINITCALLTYPE __cdecl
  40. #else
  41. #define STDMAPIINITCALLTYPE STDMETHODCALLTYPE
  42. #endif
  43. #define STDINITMETHODIMP HRESULT STDMAPIINITCALLTYPE
  44. #define STDINITMETHODIMP_(type) type STDMAPIINITCALLTYPE
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. /* Simple data types */
  50. #if !defined(_NATIVE_WCHAR_T_DEFINED)
  51. typedef unsigned short WCHAR;
  52. #else
  53. typedef wchar_t WCHAR;
  54. #endif
  55. #ifdef UNICODE
  56. typedef WCHAR TCHAR;
  57. #else
  58. typedef char TCHAR;
  59. #endif
  60. typedef WCHAR FAR * LPWSTR;
  61. typedef const WCHAR FAR * LPCWSTR;
  62. typedef TCHAR FAR * LPTSTR;
  63. typedef const TCHAR FAR * LPCTSTR;
  64. typedef BYTE FAR * LPBYTE;
  65. typedef ULONG FAR * LPULONG;
  66. #ifndef __LHANDLE
  67. #define __LHANDLE
  68. typedef unsigned long LHANDLE, FAR * LPLHANDLE;
  69. #endif
  70. #if defined(WIN32) && !defined(_WINNT_)
  71. typedef struct {
  72. DWORD LowPart;
  73. LONG HighPart;
  74. } LARGE_INTEGER;
  75. #endif
  76. #if !defined(_WINBASE_) && !defined(_FILETIME_)
  77. #define _FILETIME_
  78. typedef struct _FILETIME
  79. {
  80. DWORD dwLowDateTime;
  81. DWORD dwHighDateTime;
  82. } FILETIME, FAR * LPFILETIME;
  83. #endif
  84. #ifndef BEGIN_INTERFACE
  85. #define BEGIN_INTERFACE
  86. #endif
  87. /*
  88. * This flag is used in many different MAPI calls to signify that
  89. * the object opened by the call should be modifiable (MAPI_MODIFY).
  90. * If the flag MAPI_MAX_ACCESS is set, the object returned should be
  91. * returned at the maximum access level allowed. An additional
  92. * property available on the object (PR_ACCESS_LEVEL) uses the same
  93. * MAPI_MODIFY flag to say just what this new access level is.
  94. */
  95. #define MAPI_MODIFY ((ULONG) 0x00000001)
  96. /*
  97. * The following flags are used to indicate to the client what access
  98. * level is permissible in the object. They appear in PR_ACCESS in
  99. * message and folder objects as well as in contents and associated
  100. * contents tables
  101. */
  102. #define MAPI_ACCESS_MODIFY ((ULONG) 0x00000001)
  103. #define MAPI_ACCESS_READ ((ULONG) 0x00000002)
  104. #define MAPI_ACCESS_DELETE ((ULONG) 0x00000004)
  105. #define MAPI_ACCESS_CREATE_HIERARCHY ((ULONG) 0x00000008)
  106. #define MAPI_ACCESS_CREATE_CONTENTS ((ULONG) 0x00000010)
  107. #define MAPI_ACCESS_CREATE_ASSOCIATED ((ULONG) 0x00000020)
  108. /*
  109. * The MAPI_UNICODE flag is used in many different MAPI calls to signify
  110. * that strings passed through the interface are in Unicode (a 16-bit
  111. * character set). The default is an 8-bit character set.
  112. *
  113. * The value fMapiUnicode can be used as the 'normal' value for
  114. * that bit, given the application's default character set.
  115. */
  116. #define MAPI_UNICODE ((ULONG) 0x80000000)
  117. #ifdef UNICODE
  118. #define fMapiUnicode MAPI_UNICODE
  119. #else
  120. #define fMapiUnicode 0
  121. #endif
  122. /* successful HRESULT */
  123. #define hrSuccess 0
  124. /* Recipient types */
  125. #ifndef MAPI_ORIG /* also defined in mapi.h */
  126. #define MAPI_ORIG 0 /* Recipient is message originator */
  127. #define MAPI_TO 1 /* Recipient is a primary recipient */
  128. #define MAPI_CC 2 /* Recipient is a copy recipient */
  129. #define MAPI_BCC 3 /* Recipient is blind copy recipient */
  130. #define MAPI_P1 0x10000000 /* Recipient is a P1 resend recipient */
  131. #define MAPI_SUBMITTED 0x80000000 /* Recipient is already processed */
  132. /* #define MAPI_AUTHORIZE 4 recipient is a CMC authorizing user */
  133. /*#define MAPI_DISCRETE 0x10000000 Recipient is a P1 resend recipient */
  134. #endif
  135. /* Bit definitions for abFlags[0] of ENTRYID */
  136. #define MAPI_SHORTTERM 0x80
  137. #define MAPI_NOTRECIP 0x40
  138. #define MAPI_THISSESSION 0x20
  139. #define MAPI_NOW 0x10
  140. #define MAPI_NOTRESERVED 0x08
  141. /* Bit definitions for abFlags[1] of ENTRYID */
  142. #define MAPI_COMPOUND 0x80
  143. /* ENTRYID */
  144. typedef struct
  145. {
  146. BYTE abFlags[4];
  147. BYTE ab[MAPI_DIM];
  148. } ENTRYID, FAR *LPENTRYID;
  149. #define CbNewENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb))
  150. #define CbENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb))
  151. #define SizedENTRYID(_cb, _name) \
  152. struct _ENTRYID_ ## _name \
  153. { \
  154. BYTE abFlags[4]; \
  155. BYTE ab[_cb]; \
  156. } _name
  157. /* Byte-order-independent version of GUID (world-unique identifier) */
  158. typedef struct _MAPIUID
  159. {
  160. BYTE ab[16];
  161. } MAPIUID, FAR * LPMAPIUID;
  162. /* Note: need to include C run-times (memory.h) to use this macro */
  163. #define IsEqualMAPIUID(lpuid1, lpuid2) (!memcmp(lpuid1, lpuid2, sizeof(MAPIUID)))
  164. /* Object type */
  165. #define MAPI_STORE ((ULONG) 0x00000001) /* Message Store */
  166. #define MAPI_ADDRBOOK ((ULONG) 0x00000002) /* Address Book */
  167. #define MAPI_FOLDER ((ULONG) 0x00000003) /* Folder */
  168. #define MAPI_ABCONT ((ULONG) 0x00000004) /* Address Book Container */
  169. #define MAPI_MESSAGE ((ULONG) 0x00000005) /* Message */
  170. #define MAPI_MAILUSER ((ULONG) 0x00000006) /* Individual Recipient */
  171. #define MAPI_ATTACH ((ULONG) 0x00000007) /* Attachment */
  172. #define MAPI_DISTLIST ((ULONG) 0x00000008) /* Distribution List Recipient */
  173. #define MAPI_PROFSECT ((ULONG) 0x00000009) /* Profile Section */
  174. #define MAPI_STATUS ((ULONG) 0x0000000A) /* Status Object */
  175. #define MAPI_SESSION ((ULONG) 0x0000000B) /* Session */
  176. #define MAPI_FORMINFO ((ULONG) 0x0000000C) /* Form Information */
  177. /* Property Types */
  178. #define MV_FLAG 0x1000 /* Multi-value flag */
  179. #define PT_UNSPECIFIED ((ULONG) 0) /* (Reserved for interface use) type doesn't matter to caller */
  180. #define PT_NULL ((ULONG) 1) /* NULL property value */
  181. #define PT_I2 ((ULONG) 2) /* Signed 16-bit value */
  182. #define PT_LONG ((ULONG) 3) /* Signed 32-bit value */
  183. #define PT_R4 ((ULONG) 4) /* 4-byte floating point */
  184. #define PT_DOUBLE ((ULONG) 5) /* Floating point double */
  185. #define PT_CURRENCY ((ULONG) 6) /* Signed 64-bit int (decimal w/ 4 digits right of decimal pt) */
  186. #define PT_APPTIME ((ULONG) 7) /* Application time */
  187. #define PT_ERROR ((ULONG) 10) /* 32-bit error value */
  188. #define PT_BOOLEAN ((ULONG) 11) /* 16-bit boolean (non-zero true) */
  189. #define PT_OBJECT ((ULONG) 13) /* Embedded object in a property */
  190. #define PT_I8 ((ULONG) 20) /* 8-byte signed integer */
  191. #define PT_STRING8 ((ULONG) 30) /* Null terminated 8-bit character string */
  192. #define PT_UNICODE ((ULONG) 31) /* Null terminated Unicode string */
  193. #define PT_SYSTIME ((ULONG) 64) /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
  194. #define PT_CLSID ((ULONG) 72) /* OLE GUID */
  195. #define PT_BINARY ((ULONG) 258) /* Uninterpreted (counted byte array) */
  196. /* Changes are likely to these numbers, and to their structures. */
  197. /* Alternate property type names for ease of use */
  198. #define PT_SHORT PT_I2
  199. #define PT_I4 PT_LONG
  200. #define PT_FLOAT PT_R4
  201. #define PT_R8 PT_DOUBLE
  202. #define PT_LONGLONG PT_I8
  203. /*
  204. * The type of a MAPI-defined string property is indirected, so
  205. * that it defaults to Unicode string on a Unicode platform and to
  206. * String8 on an ANSI or DBCS platform.
  207. *
  208. * Macros are defined here both for the property type, and for the
  209. * field of the property value structure which should be
  210. * dereferenced to obtain the string pointer.
  211. */
  212. #ifdef UNICODE
  213. #define PT_TSTRING PT_UNICODE
  214. #define PT_MV_TSTRING (MV_FLAG|PT_UNICODE)
  215. #define LPSZ lpszW
  216. #define LPPSZ lppszW
  217. #define MVSZ MVszW
  218. #else
  219. #define PT_TSTRING PT_STRING8
  220. #define PT_MV_TSTRING (MV_FLAG|PT_STRING8)
  221. #define LPSZ lpszA
  222. #define LPPSZ lppszA
  223. #define MVSZ MVszA
  224. #endif
  225. /* Property Tags
  226. *
  227. * By convention, MAPI never uses 0 or FFFF as a property ID.
  228. * Use as null values, initializers, sentinels, or what have you.
  229. */
  230. #define PROP_TYPE_MASK ((ULONG)0x0000FFFF) /* Mask for Property type */
  231. #define PROP_TYPE(ulPropTag) (((ULONG)(ulPropTag))&PROP_TYPE_MASK)
  232. #define PROP_ID(ulPropTag) (((ULONG)(ulPropTag))>>16)
  233. #define PROP_TAG(ulPropType,ulPropID) ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType)))
  234. #define PROP_ID_NULL 0
  235. #define PROP_ID_INVALID 0xFFFF
  236. #define PR_NULL PROP_TAG( PT_NULL, PROP_ID_NULL)
  237. #define CHANGE_PROP_TYPE(ulPropTag, ulPropType) \
  238. (((ULONG)0xFFFF0000 & ulPropTag) | ulPropType)
  239. /* Multi-valued Property Types */
  240. #define PT_MV_I2 (MV_FLAG|PT_I2)
  241. #define PT_MV_LONG (MV_FLAG|PT_LONG)
  242. #define PT_MV_R4 (MV_FLAG|PT_R4)
  243. #define PT_MV_DOUBLE (MV_FLAG|PT_DOUBLE)
  244. #define PT_MV_CURRENCY (MV_FLAG|PT_CURRENCY)
  245. #define PT_MV_APPTIME (MV_FLAG|PT_APPTIME)
  246. #define PT_MV_SYSTIME (MV_FLAG|PT_SYSTIME)
  247. #define PT_MV_STRING8 (MV_FLAG|PT_STRING8)
  248. #define PT_MV_BINARY (MV_FLAG|PT_BINARY)
  249. #define PT_MV_UNICODE (MV_FLAG|PT_UNICODE)
  250. #define PT_MV_CLSID (MV_FLAG|PT_CLSID)
  251. #define PT_MV_I8 (MV_FLAG|PT_I8)
  252. /* Alternate property type names for ease of use */
  253. #define PT_MV_SHORT PT_MV_I2
  254. #define PT_MV_I4 PT_MV_LONG
  255. #define PT_MV_FLOAT PT_MV_R4
  256. #define PT_MV_R8 PT_MV_DOUBLE
  257. #define PT_MV_LONGLONG PT_MV_I8
  258. /*
  259. * Property type reserved bits
  260. *
  261. * MV_INSTANCE is used as a flag in table operations to request
  262. * that a multi-valued property be presented as a single-valued
  263. * property appearing in multiple rows.
  264. */
  265. #define MV_INSTANCE 0x2000
  266. #define MVI_FLAG (MV_FLAG | MV_INSTANCE)
  267. #define MVI_PROP(tag) ((tag) | MVI_FLAG)
  268. /* --------------- */
  269. /* Data Structures */
  270. /* --------------- */
  271. /* Property Tag Array */
  272. typedef struct _SPropTagArray
  273. {
  274. ULONG cValues;
  275. ULONG aulPropTag[MAPI_DIM];
  276. } SPropTagArray, FAR * LPSPropTagArray;
  277. #define CbNewSPropTagArray(_ctag) \
  278. (offsetof(SPropTagArray,aulPropTag) + (_ctag)*sizeof(ULONG))
  279. #define CbSPropTagArray(_lparray) \
  280. (offsetof(SPropTagArray,aulPropTag) + \
  281. (UINT)((_lparray)->cValues)*sizeof(ULONG))
  282. /* SPropTagArray */
  283. #define SizedSPropTagArray(_ctag, _name) \
  284. struct _SPropTagArray_ ## _name \
  285. { \
  286. ULONG cValues; \
  287. ULONG aulPropTag[_ctag]; \
  288. } _name
  289. /* -------------- */
  290. /* Property Value */
  291. /* -------------- */
  292. typedef struct _SPropValue SPropValue;
  293. #if !defined(VB_VERSION) && !defined(_OLEAUTO_H_)
  294. /* Don't redefine CURRENCY if Visual Basic or
  295. OLE automation headers are included already */
  296. typedef struct
  297. {
  298. LONG Lo;
  299. LONG Hi;
  300. } CURRENCY;
  301. #endif
  302. typedef struct _SBinary
  303. {
  304. ULONG cb;
  305. LPBYTE lpb;
  306. } SBinary, FAR *LPSBinary;
  307. typedef struct _SShortArray
  308. {
  309. ULONG cValues;
  310. short int FAR *lpi;
  311. } SShortArray;
  312. typedef struct _SGuidArray
  313. {
  314. ULONG cValues;
  315. GUID FAR *lpguid;
  316. } SGuidArray;
  317. typedef struct _SRealArray
  318. {
  319. ULONG cValues;
  320. float FAR *lpflt;
  321. } SRealArray;
  322. typedef struct _SLongArray
  323. {
  324. ULONG cValues;
  325. LONG FAR *lpl;
  326. } SLongArray;
  327. typedef struct _SLargeIntegerArray
  328. {
  329. ULONG cValues;
  330. LARGE_INTEGER FAR *lpli;
  331. } SLargeIntegerArray;
  332. typedef struct _SDateTimeArray
  333. {
  334. ULONG cValues;
  335. FILETIME FAR *lpft;
  336. } SDateTimeArray;
  337. typedef struct _SAppTimeArray
  338. {
  339. ULONG cValues;
  340. double FAR *lpat;
  341. } SAppTimeArray;
  342. typedef struct _SCurrencyArray
  343. {
  344. ULONG cValues;
  345. CURRENCY FAR *lpcur;
  346. } SCurrencyArray;
  347. typedef struct _SBinaryArray
  348. {
  349. ULONG cValues;
  350. SBinary FAR *lpbin;
  351. } SBinaryArray;
  352. typedef struct _SDoubleArray
  353. {
  354. ULONG cValues;
  355. double FAR *lpdbl;
  356. } SDoubleArray;
  357. typedef struct _SWStringArray
  358. {
  359. ULONG cValues;
  360. LPWSTR FAR *lppszW;
  361. } SWStringArray;
  362. typedef struct _SLPSTRArray
  363. {
  364. ULONG cValues;
  365. LPSTR FAR *lppszA;
  366. } SLPSTRArray;
  367. typedef union _PV
  368. {
  369. short int i; /* case PT_I2 */
  370. LONG l; /* case PT_LONG */
  371. ULONG ul; /* alias for PT_LONG */
  372. float flt; /* case PT_R4 */
  373. double dbl; /* case PT_DOUBLE */
  374. unsigned short int b; /* case PT_BOOLEAN */
  375. CURRENCY cur; /* case PT_CURRENCY */
  376. double at; /* case PT_APPTIME */
  377. FILETIME ft; /* case PT_SYSTIME */
  378. LPSTR lpszA; /* case PT_STRING8 */
  379. SBinary bin; /* case PT_BINARY */
  380. LPWSTR lpszW; /* case PT_UNICODE */
  381. LPGUID lpguid; /* case PT_CLSID */
  382. LARGE_INTEGER li; /* case PT_I8 */
  383. SShortArray MVi; /* case PT_MV_I2 */
  384. SLongArray MVl; /* case PT_MV_LONG */
  385. SRealArray MVflt; /* case PT_MV_R4 */
  386. SDoubleArray MVdbl; /* case PT_MV_DOUBLE */
  387. SCurrencyArray MVcur; /* case PT_MV_CURRENCY */
  388. SAppTimeArray MVat; /* case PT_MV_APPTIME */
  389. SDateTimeArray MVft; /* case PT_MV_SYSTIME */
  390. SBinaryArray MVbin; /* case PT_MV_BINARY */
  391. SLPSTRArray MVszA; /* case PT_MV_STRING8 */
  392. SWStringArray MVszW; /* case PT_MV_UNICODE */
  393. SGuidArray MVguid; /* case PT_MV_CLSID */
  394. SLargeIntegerArray MVli; /* case PT_MV_I8 */
  395. SCODE err; /* case PT_ERROR */
  396. LONG x; /* case PT_NULL, PT_OBJECT (no usable value) */
  397. } __UPV;
  398. typedef struct _SPropValue
  399. {
  400. ULONG ulPropTag;
  401. ULONG dwAlignPad;
  402. union _PV Value;
  403. } SPropValue, FAR * LPSPropValue;
  404. /* --------------------------------------------- */
  405. /* Property Problem and Property Problem Arrays */
  406. /* --------------------------------------------- */
  407. typedef struct _SPropProblem
  408. {
  409. ULONG ulIndex;
  410. ULONG ulPropTag;
  411. SCODE scode;
  412. } SPropProblem, FAR * LPSPropProblem;
  413. typedef struct _SPropProblemArray
  414. {
  415. ULONG cProblem;
  416. SPropProblem aProblem[MAPI_DIM];
  417. } SPropProblemArray, FAR * LPSPropProblemArray;
  418. #define CbNewSPropProblemArray(_cprob) \
  419. (offsetof(SPropProblemArray,aProblem) + (_cprob)*sizeof(SPropProblem))
  420. #define CbSPropProblemArray(_lparray) \
  421. (offsetof(SPropProblemArray,aProblem) + \
  422. (UINT) ((_lparray)->cProblem*sizeof(SPropProblem)))
  423. #define SizedSPropProblemArray(_cprob, _name) \
  424. struct _SPropProblemArray_ ## _name \
  425. { \
  426. ULONG cProblem; \
  427. SPropProblem aProblem[_cprob]; \
  428. } _name
  429. /*
  430. * ENTRYLIST
  431. */
  432. typedef SBinaryArray ENTRYLIST, FAR *LPENTRYLIST;
  433. /*
  434. * FLATENTRYLIST
  435. * MTSID
  436. * FLATMTSIDLIST
  437. */
  438. typedef struct {
  439. ULONG cb;
  440. BYTE abEntry[MAPI_DIM];
  441. } FLATENTRY, FAR *LPFLATENTRY;
  442. typedef struct {
  443. ULONG cEntries;
  444. ULONG cbEntries;
  445. BYTE abEntries[MAPI_DIM];
  446. } FLATENTRYLIST, FAR *LPFLATENTRYLIST;
  447. typedef struct {
  448. ULONG cb;
  449. BYTE ab[MAPI_DIM];
  450. } MTSID, FAR *LPMTSID;
  451. typedef struct {
  452. ULONG cMTSIDs;
  453. ULONG cbMTSIDs;
  454. BYTE abMTSIDs[MAPI_DIM];
  455. } FLATMTSIDLIST, FAR *LPFLATMTSIDLIST;
  456. #define CbNewFLATENTRY(_cb) (offsetof(FLATENTRY,abEntry) + (_cb))
  457. #define CbFLATENTRY(_lpentry) (offsetof(FLATENTRY,abEntry) + (_lpentry)->cb)
  458. #define CbNewFLATENTRYLIST(_cb) (offsetof(FLATENTRYLIST,abEntries) + (_cb))
  459. #define CbFLATENTRYLIST(_lplist) (offsetof(FLATENTRYLIST,abEntries) + (_lplist)->cbEntries)
  460. #define CbNewMTSID(_cb) (offsetof(MTSID,ab) + (_cb))
  461. #define CbMTSID(_lpentry) (offsetof(MTSID,ab) + (_lpentry)->cb)
  462. #define CbNewFLATMTSIDLIST(_cb) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_cb))
  463. #define CbFLATMTSIDLIST(_lplist) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_lplist)->cbMTSIDs)
  464. /* No SizedXXX macros for these types. */
  465. /* ------------------------------ */
  466. /* ADRENTRY, ADRLIST */
  467. typedef struct _ADRENTRY
  468. {
  469. ULONG ulReserved1; /* Never used */
  470. ULONG cValues;
  471. LPSPropValue rgPropVals;
  472. } ADRENTRY, FAR * LPADRENTRY;
  473. typedef struct _ADRLIST
  474. {
  475. ULONG cEntries;
  476. ADRENTRY aEntries[MAPI_DIM];
  477. } ADRLIST, FAR * LPADRLIST;
  478. #define CbNewADRLIST(_centries) \
  479. (offsetof(ADRLIST,aEntries) + (_centries)*sizeof(ADRENTRY))
  480. #define CbADRLIST(_lpadrlist) \
  481. (offsetof(ADRLIST,aEntries) + (UINT)(_lpadrlist)->cEntries*sizeof(ADRENTRY))
  482. #define SizedADRLIST(_centries, _name) \
  483. struct _ADRLIST_ ## _name \
  484. { \
  485. ULONG cEntries; \
  486. ADRENTRY aEntries[_centries]; \
  487. } _name
  488. /* ------------------------------ */
  489. /* SRow, SRowSet */
  490. typedef struct _SRow
  491. {
  492. ULONG ulAdrEntryPad; /* Pad so SRow's can map to ADRENTRY's */
  493. ULONG cValues; /* Count of property values */
  494. LPSPropValue lpProps; /* Property value array */
  495. } SRow, FAR * LPSRow;
  496. typedef struct _SRowSet
  497. {
  498. ULONG cRows; /* Count of rows */
  499. SRow aRow[MAPI_DIM]; /* Array of rows */
  500. } SRowSet, FAR * LPSRowSet;
  501. #define CbNewSRowSet(_crow) (offsetof(SRowSet,aRow) + (_crow)*sizeof(SRow))
  502. #define CbSRowSet(_lprowset) (offsetof(SRowSet,aRow) + \
  503. (UINT)((_lprowset)->cRows*sizeof(SRow)))
  504. #define SizedSRowSet(_crow, _name) \
  505. struct _SRowSet_ ## _name \
  506. { \
  507. ULONG cRows; \
  508. SRow aRow[_crow]; \
  509. } _name
  510. /* MAPI Allocation Routines ------------------------------------------------ */
  511. typedef SCODE (STDMETHODCALLTYPE ALLOCATEBUFFER)(
  512. ULONG cbSize,
  513. LPVOID FAR * lppBuffer
  514. );
  515. typedef SCODE (STDMETHODCALLTYPE ALLOCATEMORE)(
  516. ULONG cbSize,
  517. LPVOID lpObject,
  518. LPVOID FAR * lppBuffer
  519. );
  520. typedef ULONG (STDAPICALLTYPE FREEBUFFER)(
  521. LPVOID lpBuffer
  522. );
  523. typedef ALLOCATEBUFFER FAR *LPALLOCATEBUFFER;
  524. typedef ALLOCATEMORE FAR * LPALLOCATEMORE;
  525. typedef FREEBUFFER FAR * LPFREEBUFFER;
  526. /* MAPI Component Object Model Macros -------------------------------------- */
  527. #if defined(MAPI_IF) && (!defined(__cplusplus) || defined(CINTERFACE))
  528. #define DECLARE_MAPI_INTERFACE(iface) \
  529. typedef struct iface##Vtbl iface##Vtbl, FAR * iface; \
  530. struct iface##Vtbl
  531. #define DECLARE_MAPI_INTERFACE_(iface, baseiface) \
  532. DECLARE_MAPI_INTERFACE(iface)
  533. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface) \
  534. typedef struct iface##Vtbl iface##Vtbl, FAR * iface, FAR * FAR * piface;
  535. #else
  536. #define DECLARE_MAPI_INTERFACE(iface) \
  537. DECLARE_INTERFACE(iface)
  538. #define DECLARE_MAPI_INTERFACE_(iface, baseiface) \
  539. DECLARE_INTERFACE_(iface, baseiface)
  540. #ifdef __cplusplus
  541. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface) \
  542. interface iface; typedef iface FAR * piface
  543. #else
  544. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface) \
  545. typedef interface iface iface, FAR * piface
  546. #endif
  547. #endif
  548. #define MAPIMETHOD(method) MAPIMETHOD_(HRESULT, method)
  549. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  550. #define MAPIMETHOD_DECLARE(type, method, prefix) \
  551. STDMETHODIMP_(type) prefix##method
  552. #define MAPIMETHOD_TYPEDEF(type, method, prefix) \
  553. typedef type (STDMETHODCALLTYPE prefix##method##_METHOD)
  554. #define MAPI_IUNKNOWN_METHODS(IPURE) \
  555. MAPIMETHOD(QueryInterface) \
  556. (THIS_ REFIID riid, LPVOID FAR * ppvObj) IPURE; \
  557. MAPIMETHOD_(ULONG,AddRef) (THIS) IPURE; \
  558. MAPIMETHOD_(ULONG,Release) (THIS) IPURE; \
  559. #undef IMPL
  560. #define IMPL
  561. /* Pointers to MAPI Interfaces --------------------------------------------- */
  562. typedef const IID FAR * LPCIID;
  563. DECLARE_MAPI_INTERFACE_PTR(IMsgStore, LPMDB);
  564. DECLARE_MAPI_INTERFACE_PTR(IMAPIFolder, LPMAPIFOLDER);
  565. DECLARE_MAPI_INTERFACE_PTR(IMessage, LPMESSAGE);
  566. DECLARE_MAPI_INTERFACE_PTR(IAttach, LPATTACH);
  567. DECLARE_MAPI_INTERFACE_PTR(IAddrBook, LPADRBOOK);
  568. DECLARE_MAPI_INTERFACE_PTR(IABContainer, LPABCONT);
  569. DECLARE_MAPI_INTERFACE_PTR(IMailUser, LPMAILUSER);
  570. DECLARE_MAPI_INTERFACE_PTR(IDistList, LPDISTLIST);
  571. DECLARE_MAPI_INTERFACE_PTR(IMAPIStatus, LPMAPISTATUS);
  572. DECLARE_MAPI_INTERFACE_PTR(IMAPITable, LPMAPITABLE);
  573. DECLARE_MAPI_INTERFACE_PTR(IProfSect, LPPROFSECT);
  574. DECLARE_MAPI_INTERFACE_PTR(IMAPIProp, LPMAPIPROP);
  575. DECLARE_MAPI_INTERFACE_PTR(IMAPIContainer, LPMAPICONTAINER);
  576. DECLARE_MAPI_INTERFACE_PTR(IMAPIAdviseSink, LPMAPIADVISESINK);
  577. DECLARE_MAPI_INTERFACE_PTR(IMAPIProgress, LPMAPIPROGRESS);
  578. DECLARE_MAPI_INTERFACE_PTR(IProviderAdmin, LPPROVIDERADMIN);
  579. /* Extended MAPI Error Information ----------------------------------------- */
  580. typedef struct _MAPIERROR
  581. {
  582. ULONG ulVersion;
  583. LPTSTR lpszError;
  584. LPTSTR lpszComponent;
  585. ULONG ulLowLevelError;
  586. ULONG ulContext;
  587. } MAPIERROR, FAR * LPMAPIERROR;
  588. /* IMAPIAdviseSink Interface ----------------------------------------------- */
  589. /*
  590. * Notification event types. The event types can be combined in a bitmask
  591. * for filtering. Each one has a parameter structure associated with it:
  592. *
  593. * fnevCriticalError ERROR_NOTIFICATION
  594. * fnevNewMail NEWMAIL_NOTIFICATION
  595. * fnevObjectCreated OBJECT_NOTIFICATION
  596. * fnevObjectDeleted OBJECT_NOTIFICATION
  597. * fnevObjectModified OBJECT_NOTIFICATION
  598. * fnevObjectCopied OBJECT_NOTIFICATION
  599. * fnevSearchComplete OBJECT_NOTIFICATION
  600. * fnevTableModified TABLE_NOTIFICATION
  601. * fnevStatusObjectModified ?
  602. *
  603. * fnevExtended EXTENDED_NOTIFICATION
  604. */
  605. #define fnevCriticalError ((ULONG) 0x00000001)
  606. #define fnevNewMail ((ULONG) 0x00000002)
  607. #define fnevObjectCreated ((ULONG) 0x00000004)
  608. #define fnevObjectDeleted ((ULONG) 0x00000008)
  609. #define fnevObjectModified ((ULONG) 0x00000010)
  610. #define fnevObjectMoved ((ULONG) 0x00000020)
  611. #define fnevObjectCopied ((ULONG) 0x00000040)
  612. #define fnevSearchComplete ((ULONG) 0x00000080)
  613. #define fnevTableModified ((ULONG) 0x00000100)
  614. #define fnevStatusObjectModified ((ULONG) 0x00000200)
  615. #define fnevReservedForMapi ((ULONG) 0x40000000)
  616. #define fnevExtended ((ULONG) 0x80000000)
  617. /* TABLE_NOTIFICATION event types passed in ulTableEvent */
  618. #define TABLE_CHANGED 1
  619. #define TABLE_ERROR 2
  620. #define TABLE_ROW_ADDED 3
  621. #define TABLE_ROW_DELETED 4
  622. #define TABLE_ROW_MODIFIED 5
  623. #define TABLE_SORT_DONE 6
  624. #define TABLE_RESTRICT_DONE 7
  625. #define TABLE_SETCOL_DONE 8
  626. #define TABLE_RELOAD 9
  627. /* Event Structures */
  628. typedef struct _ERROR_NOTIFICATION
  629. {
  630. ULONG cbEntryID;
  631. LPENTRYID lpEntryID;
  632. SCODE scode;
  633. ULONG ulFlags; /* 0 or MAPI_UNICODE */
  634. LPMAPIERROR lpMAPIError; /* Detailed error information */
  635. } ERROR_NOTIFICATION;
  636. typedef struct _NEWMAIL_NOTIFICATION
  637. {
  638. ULONG cbEntryID;
  639. LPENTRYID lpEntryID; /* identifies the new message */
  640. ULONG cbParentID;
  641. LPENTRYID lpParentID; /* identifies the folder it lives in */
  642. ULONG ulFlags; /* 0 or MAPI_UNICODE */
  643. LPTSTR lpszMessageClass; /* message class (UNICODE or string8) */
  644. ULONG ulMessageFlags; /* copy of PR_MESSAGE_FLAGS */
  645. } NEWMAIL_NOTIFICATION;
  646. typedef struct _OBJECT_NOTIFICATION
  647. {
  648. ULONG cbEntryID;
  649. LPENTRYID lpEntryID; /* EntryID of object */
  650. ULONG ulObjType; /* Type of object */
  651. ULONG cbParentID;
  652. LPENTRYID lpParentID; /* EntryID of parent object */
  653. ULONG cbOldID;
  654. LPENTRYID lpOldID; /* EntryID of old object */
  655. ULONG cbOldParentID;
  656. LPENTRYID lpOldParentID; /* EntryID of old parent */
  657. LPSPropTagArray lpPropTagArray;
  658. } OBJECT_NOTIFICATION;
  659. typedef struct _TABLE_NOTIFICATION
  660. {
  661. ULONG ulTableEvent; /* Identifies WHICH table event */
  662. HRESULT hResult; /* Value for TABLE_ERROR */
  663. SPropValue propIndex; /* This row's "index property" */
  664. SPropValue propPrior; /* Preceding row's "index property" */
  665. SRow row; /* New data of added/modified row */
  666. ULONG ulPad; /* Force to 8-byte boundary */
  667. } TABLE_NOTIFICATION;
  668. typedef struct _EXTENDED_NOTIFICATION
  669. {
  670. ULONG ulEvent; /* extended event code */
  671. ULONG cb; /* size of event parameters */
  672. LPBYTE pbEventParameters; /* event parameters */
  673. } EXTENDED_NOTIFICATION;
  674. typedef struct
  675. {
  676. ULONG cbEntryID;
  677. LPENTRYID lpEntryID;
  678. ULONG cValues;
  679. LPSPropValue lpPropVals;
  680. } STATUS_OBJECT_NOTIFICATION;
  681. typedef struct _NOTIFICATION
  682. {
  683. ULONG ulEventType; /* notification type, i.e. fnevSomething */
  684. ULONG ulAlignPad; /* Force to 8-byte boundary */
  685. union
  686. {
  687. ERROR_NOTIFICATION err;
  688. NEWMAIL_NOTIFICATION newmail;
  689. OBJECT_NOTIFICATION obj;
  690. TABLE_NOTIFICATION tab;
  691. EXTENDED_NOTIFICATION ext;
  692. STATUS_OBJECT_NOTIFICATION statobj;
  693. } info;
  694. } NOTIFICATION, FAR * LPNOTIFICATION;
  695. /* Interface used for registering and issuing notification callbacks. */
  696. #define MAPI_IMAPIADVISESINK_METHODS(IPURE) \
  697. MAPIMETHOD_(ULONG, OnNotify) \
  698. (THIS_ ULONG cNotif, \
  699. LPNOTIFICATION lpNotifications) IPURE; \
  700. #undef INTERFACE
  701. #define INTERFACE IMAPIAdviseSink
  702. DECLARE_MAPI_INTERFACE_(IMAPIAdviseSink, IUnknown)
  703. {
  704. BEGIN_INTERFACE
  705. MAPI_IUNKNOWN_METHODS(PURE)
  706. MAPI_IMAPIADVISESINK_METHODS(PURE)
  707. };
  708. /* Callback function type for MAPIAllocAdviseSink */
  709. typedef long (STDAPICALLTYPE NOTIFCALLBACK) (
  710. LPVOID lpvContext,
  711. ULONG cNotification,
  712. LPNOTIFICATION lpNotifications);
  713. typedef NOTIFCALLBACK FAR * LPNOTIFCALLBACK;
  714. /*
  715. * Message name for the 16-bit MAPI notififcation engine.
  716. * This can be used in 16-bit applications to force processing
  717. * of notification callbacks.
  718. */
  719. #ifdef WIN16
  720. #define szMAPINotificationMsg "MAPI Notify window message"
  721. #endif
  722. /* IMAPIProgress Interface ------------------------------------------------- */
  723. /* Flag values for the progress indicator */
  724. #define MAPI_TOP_LEVEL ((ULONG) 0x00000001)
  725. #define MAPI_IMAPIPROGRESS_METHODS(IPURE) \
  726. MAPIMETHOD(Progress) \
  727. (THIS_ ULONG ulValue, \
  728. ULONG ulCount, \
  729. ULONG ulTotal) IPURE; \
  730. MAPIMETHOD(GetFlags) \
  731. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  732. MAPIMETHOD(GetMax) \
  733. (THIS_ ULONG FAR * lpulMax) IPURE; \
  734. MAPIMETHOD(GetMin) \
  735. (THIS_ ULONG FAR * lpulMin) IPURE; \
  736. MAPIMETHOD(SetLimits) \
  737. (THIS_ LPULONG lpulMin, \
  738. LPULONG lpulMax, \
  739. LPULONG lpulFlags) IPURE; \
  740. #undef INTERFACE
  741. #define INTERFACE IMAPIProgress
  742. DECLARE_MAPI_INTERFACE_(IMAPIProgress, IUnknown)
  743. {
  744. BEGIN_INTERFACE
  745. MAPI_IUNKNOWN_METHODS(PURE)
  746. MAPI_IMAPIPROGRESS_METHODS(PURE)
  747. };
  748. /* IMAPIProp Interface ----------------------------------------------------- */
  749. /* GetLastError */
  750. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  751. /*
  752. * Version:
  753. */
  754. #define MAPI_ERROR_VERSION 0x00000000L
  755. /* GetPropList */
  756. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  757. /* GetProps */
  758. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  759. /* SaveChanges */
  760. #define KEEP_OPEN_READONLY ((ULONG) 0x00000001)
  761. #define KEEP_OPEN_READWRITE ((ULONG) 0x00000002)
  762. #define FORCE_SAVE ((ULONG) 0x00000004)
  763. /* define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  764. /* OpenProperty - ulFlags */
  765. /****** MAPI_MODIFY ((ULONG) 0x00000001) above */
  766. #define MAPI_CREATE ((ULONG) 0x00000002)
  767. #define STREAM_APPEND ((ULONG) 0x00000004)
  768. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  769. /* OpenProperty - ulInterfaceOptions, IID_IMAPITable */
  770. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  771. /* CopyTo, CopyProps */
  772. #define MAPI_MOVE ((ULONG) 0x00000001)
  773. #define MAPI_NOREPLACE ((ULONG) 0x00000002)
  774. #define MAPI_DECLINE_OK ((ULONG) 0x00000004)
  775. #ifndef MAPI_DIALOG /* also defined in mapi.h */
  776. #define MAPI_DIALOG ((ULONG) 0x00000008)
  777. #endif
  778. #ifndef MAPI_USE_DEFAULT /* also defined in mapi.h */
  779. #define MAPI_USE_DEFAULT 0x00000040 /* Use default profile in logon */
  780. #endif
  781. /* Flags used in GetIDsFromNames */
  782. /****** MAPI_CREATE ((ULONG) 0x00000002) above */
  783. /* Flags used in GetNamesFromIDs (bit fields) */
  784. #define MAPI_NO_STRINGS ((ULONG) 0x00000001)
  785. #define MAPI_NO_IDS ((ULONG) 0x00000002)
  786. /* Union discriminator */
  787. #define MNID_ID 0
  788. #define MNID_STRING 1
  789. typedef struct _MAPINAMEID
  790. {
  791. LPGUID lpguid;
  792. ULONG ulKind;
  793. union {
  794. LONG lID;
  795. LPWSTR lpwstrName;
  796. } Kind;
  797. } MAPINAMEID, FAR * LPMAPINAMEID;
  798. #define MAPI_IMAPIPROP_METHODS(IPURE) \
  799. MAPIMETHOD(GetLastError) \
  800. (THIS_ HRESULT hResult, \
  801. ULONG ulFlags, \
  802. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  803. MAPIMETHOD(SaveChanges) \
  804. (THIS_ ULONG ulFlags) IPURE; \
  805. MAPIMETHOD(GetProps) \
  806. (THIS_ LPSPropTagArray lpPropTagArray, \
  807. ULONG ulFlags, \
  808. ULONG FAR * lpcValues, \
  809. LPSPropValue FAR * lppPropArray) IPURE; \
  810. MAPIMETHOD(GetPropList) \
  811. (THIS_ ULONG ulFlags, \
  812. LPSPropTagArray FAR * lppPropTagArray) IPURE; \
  813. MAPIMETHOD(OpenProperty) \
  814. (THIS_ ULONG ulPropTag, \
  815. LPCIID lpiid, \
  816. ULONG ulInterfaceOptions, \
  817. ULONG ulFlags, \
  818. LPUNKNOWN FAR * lppUnk) IPURE; \
  819. MAPIMETHOD(SetProps) \
  820. (THIS_ ULONG cValues, \
  821. LPSPropValue lpPropArray, \
  822. LPSPropProblemArray FAR * lppProblems) IPURE; \
  823. MAPIMETHOD(DeleteProps) \
  824. (THIS_ LPSPropTagArray lpPropTagArray, \
  825. LPSPropProblemArray FAR * lppProblems) IPURE; \
  826. MAPIMETHOD(CopyTo) \
  827. (THIS_ ULONG ciidExclude, \
  828. LPCIID rgiidExclude, \
  829. LPSPropTagArray lpExcludeProps, \
  830. ULONG ulUIParam, \
  831. LPMAPIPROGRESS lpProgress, \
  832. LPCIID lpInterface, \
  833. LPVOID lpDestObj, \
  834. ULONG ulFlags, \
  835. LPSPropProblemArray FAR * lppProblems) IPURE; \
  836. MAPIMETHOD(CopyProps) \
  837. (THIS_ LPSPropTagArray lpIncludeProps, \
  838. ULONG ulUIParam, \
  839. LPMAPIPROGRESS lpProgress, \
  840. LPCIID lpInterface, \
  841. LPVOID lpDestObj, \
  842. ULONG ulFlags, \
  843. LPSPropProblemArray FAR * lppProblems) IPURE; \
  844. MAPIMETHOD(GetNamesFromIDs) \
  845. (THIS_ LPSPropTagArray FAR * lppPropTags, \
  846. LPGUID lpPropSetGuid, \
  847. ULONG ulFlags, \
  848. ULONG FAR * lpcPropNames, \
  849. LPMAPINAMEID FAR * FAR * lpppPropNames) IPURE; \
  850. MAPIMETHOD(GetIDsFromNames) \
  851. (THIS_ ULONG cPropNames, \
  852. LPMAPINAMEID FAR * lppPropNames, \
  853. ULONG ulFlags, \
  854. LPSPropTagArray FAR * lppPropTags) IPURE; \
  855. #undef INTERFACE
  856. #define INTERFACE IMAPIProp
  857. DECLARE_MAPI_INTERFACE_(IMAPIProp, IUnknown)
  858. {
  859. BEGIN_INTERFACE
  860. MAPI_IUNKNOWN_METHODS(PURE)
  861. MAPI_IMAPIPROP_METHODS(PURE)
  862. };
  863. /* IMAPITable Interface ---------------------------------------------------- */
  864. /* Table status */
  865. #define TBLSTAT_COMPLETE ((ULONG) 0)
  866. #define TBLSTAT_QCHANGED ((ULONG) 7)
  867. #define TBLSTAT_SORTING ((ULONG) 9)
  868. #define TBLSTAT_SORT_ERROR ((ULONG) 10)
  869. #define TBLSTAT_SETTING_COLS ((ULONG) 11)
  870. #define TBLSTAT_SETCOL_ERROR ((ULONG) 13)
  871. #define TBLSTAT_RESTRICTING ((ULONG) 14)
  872. #define TBLSTAT_RESTRICT_ERROR ((ULONG) 15)
  873. /* Table Type */
  874. #define TBLTYPE_SNAPSHOT ((ULONG) 0)
  875. #define TBLTYPE_KEYSET ((ULONG) 1)
  876. #define TBLTYPE_DYNAMIC ((ULONG) 2)
  877. /* Sort order */
  878. /* bit 0: set if descending, clear if ascending */
  879. #define TABLE_SORT_ASCEND ((ULONG) 0x00000000)
  880. #define TABLE_SORT_DESCEND ((ULONG) 0x00000001)
  881. #define TABLE_SORT_COMBINE ((ULONG) 0x00000002)
  882. /* Data structures */
  883. typedef struct _SSortOrder
  884. {
  885. ULONG ulPropTag; /* Column to sort on */
  886. ULONG ulOrder; /* Ascending, descending, combine to left */
  887. } SSortOrder, FAR * LPSSortOrder;
  888. typedef struct _SSortOrderSet
  889. {
  890. ULONG cSorts; /* Number of sort columns in aSort below*/
  891. ULONG cCategories; /* 0 for non-categorized, up to cSorts */
  892. ULONG cExpanded; /* 0 if no categories start expanded, */
  893. /* up to cExpanded */
  894. SSortOrder aSort[MAPI_DIM]; /* The sort orders */
  895. } SSortOrderSet, FAR * LPSSortOrderSet;
  896. #define CbNewSSortOrderSet(_csort) \
  897. (offsetof(SSortOrderSet,aSort) + (_csort)*sizeof(SSortOrder))
  898. #define CbSSortOrderSet(_lpset) \
  899. (offsetof(SSortOrderSet,aSort) + \
  900. (UINT)((_lpset)->cSorts*sizeof(SSortOrder)))
  901. #define SizedSSortOrderSet(_csort, _name) \
  902. struct _SSortOrderSet_ ## _name \
  903. { \
  904. ULONG cSorts; \
  905. ULONG cCategories; \
  906. ULONG cExpanded; \
  907. SSortOrder aSort[_csort]; \
  908. } _name
  909. typedef ULONG BOOKMARK;
  910. #define BOOKMARK_BEGINNING ((BOOKMARK) 0) /* Before first row */
  911. #define BOOKMARK_CURRENT ((BOOKMARK) 1) /* Before current row */
  912. #define BOOKMARK_END ((BOOKMARK) 2) /* After last row */
  913. /* Fuzzy Level */
  914. #define FL_FULLSTRING ((ULONG) 0x00000000)
  915. #define FL_SUBSTRING ((ULONG) 0x00000001)
  916. #define FL_PREFIX ((ULONG) 0x00000002)
  917. #define FL_IGNORECASE ((ULONG) 0x00010000)
  918. #define FL_IGNORENONSPACE ((ULONG) 0x00020000)
  919. #define FL_LOOSE ((ULONG) 0x00040000)
  920. /* Restrictions */
  921. typedef struct _SRestriction FAR * LPSRestriction;
  922. /* Restriction types */
  923. #define RES_AND ((ULONG) 0x00000000)
  924. #define RES_OR ((ULONG) 0x00000001)
  925. #define RES_NOT ((ULONG) 0x00000002)
  926. #define RES_CONTENT ((ULONG) 0x00000003)
  927. #define RES_PROPERTY ((ULONG) 0x00000004)
  928. #define RES_COMPAREPROPS ((ULONG) 0x00000005)
  929. #define RES_BITMASK ((ULONG) 0x00000006)
  930. #define RES_SIZE ((ULONG) 0x00000007)
  931. #define RES_EXIST ((ULONG) 0x00000008)
  932. #define RES_SUBRESTRICTION ((ULONG) 0x00000009)
  933. #define RES_COMMENT ((ULONG) 0x0000000A)
  934. /* Relational operators. These apply to all property comparison restrictions. */
  935. #define RELOP_LT ((ULONG) 0) /* < */
  936. #define RELOP_LE ((ULONG) 1) /* <= */
  937. #define RELOP_GT ((ULONG) 2) /* > */
  938. #define RELOP_GE ((ULONG) 3) /* >= */
  939. #define RELOP_EQ ((ULONG) 4) /* == */
  940. #define RELOP_NE ((ULONG) 5) /* != */
  941. #define RELOP_RE ((ULONG) 6) /* LIKE (Regular expression) */
  942. /* Bitmask operators, for RES_BITMASK only. */
  943. #define BMR_EQZ ((ULONG) 0) /* ==0 */
  944. #define BMR_NEZ ((ULONG) 1) /* !=0 */
  945. /* Subobject identifiers for RES_SUBRESTRICTION only. See MAPITAGS.H. */
  946. /* #define PR_MESSAGE_RECIPIENTS PROP_TAG(PT_OBJECT,0x0E12) */
  947. /* #define PR_MESSAGE_ATTACHMENTS PROP_TAG(PT_OBJECT,0x0E13) */
  948. typedef struct _SAndRestriction
  949. {
  950. ULONG cRes;
  951. LPSRestriction lpRes;
  952. } SAndRestriction;
  953. typedef struct _SOrRestriction
  954. {
  955. ULONG cRes;
  956. LPSRestriction lpRes;
  957. } SOrRestriction;
  958. typedef struct _SNotRestriction
  959. {
  960. ULONG ulReserved;
  961. LPSRestriction lpRes;
  962. } SNotRestriction;
  963. typedef struct _SContentRestriction
  964. {
  965. ULONG ulFuzzyLevel;
  966. ULONG ulPropTag;
  967. LPSPropValue lpProp;
  968. } SContentRestriction;
  969. typedef struct _SBitMaskRestriction
  970. {
  971. ULONG relBMR;
  972. ULONG ulPropTag;
  973. ULONG ulMask;
  974. } SBitMaskRestriction;
  975. typedef struct _SPropertyRestriction
  976. {
  977. ULONG relop;
  978. ULONG ulPropTag;
  979. LPSPropValue lpProp;
  980. } SPropertyRestriction;
  981. typedef struct _SComparePropsRestriction
  982. {
  983. ULONG relop;
  984. ULONG ulPropTag1;
  985. ULONG ulPropTag2;
  986. } SComparePropsRestriction;
  987. typedef struct _SSizeRestriction
  988. {
  989. ULONG relop;
  990. ULONG ulPropTag;
  991. ULONG cb;
  992. } SSizeRestriction;
  993. typedef struct _SExistRestriction
  994. {
  995. ULONG ulReserved1;
  996. ULONG ulPropTag;
  997. ULONG ulReserved2;
  998. } SExistRestriction;
  999. typedef struct _SSubRestriction
  1000. {
  1001. ULONG ulSubObject;
  1002. LPSRestriction lpRes;
  1003. } SSubRestriction;
  1004. typedef struct _SCommentRestriction
  1005. {
  1006. ULONG cValues; /* # of properties in lpProp */
  1007. LPSRestriction lpRes;
  1008. LPSPropValue lpProp;
  1009. } SCommentRestriction;
  1010. typedef struct _SRestriction
  1011. {
  1012. ULONG rt; /* Restriction type */
  1013. union
  1014. {
  1015. SComparePropsRestriction resCompareProps; /* first */
  1016. SAndRestriction resAnd;
  1017. SOrRestriction resOr;
  1018. SNotRestriction resNot;
  1019. SContentRestriction resContent;
  1020. SPropertyRestriction resProperty;
  1021. SBitMaskRestriction resBitMask;
  1022. SSizeRestriction resSize;
  1023. SExistRestriction resExist;
  1024. SSubRestriction resSub;
  1025. SCommentRestriction resComment;
  1026. } res;
  1027. } SRestriction;
  1028. /* SComparePropsRestriction is first in the union so that */
  1029. /* static initializations of 3-value restriction work. */
  1030. /* Flags of the methods of IMAPITable */
  1031. /* QueryColumn */
  1032. #define TBL_ALL_COLUMNS ((ULONG) 0x00000001)
  1033. /* QueryRows */
  1034. /* Possible values for PR_ROW_TYPE (for categorization) */
  1035. #define TBL_LEAF_ROW ((ULONG) 1)
  1036. #define TBL_EMPTY_CATEGORY ((ULONG) 2)
  1037. #define TBL_EXPANDED_CATEGORY ((ULONG) 3)
  1038. #define TBL_COLLAPSED_CATEGORY ((ULONG) 4)
  1039. /* Table wait flag */
  1040. #define TBL_NOWAIT ((ULONG) 0x00000001)
  1041. /* alternative name for TBL_NOWAIT */
  1042. #define TBL_ASYNC ((ULONG) 0x00000001)
  1043. #define TBL_BATCH ((ULONG) 0x00000002)
  1044. /* FindRow */
  1045. #define DIR_BACKWARD ((ULONG) 0x00000001)
  1046. /* Table cursor states */
  1047. #define TBL_NOADVANCE ((ULONG) 0x00000001)
  1048. #define MAPI_IMAPITABLE_METHODS(IPURE) \
  1049. MAPIMETHOD(GetLastError) \
  1050. (THIS_ HRESULT hResult, \
  1051. ULONG ulFlags, \
  1052. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  1053. MAPIMETHOD(Advise) \
  1054. (THIS_ ULONG ulEventMask, \
  1055. LPMAPIADVISESINK lpAdviseSink, \
  1056. ULONG FAR * lpulConnection) IPURE; \
  1057. MAPIMETHOD(Unadvise) \
  1058. (THIS_ ULONG ulConnection) IPURE; \
  1059. MAPIMETHOD(GetStatus) \
  1060. (THIS_ ULONG FAR * lpulTableStatus, \
  1061. ULONG FAR * lpulTableType) IPURE; \
  1062. MAPIMETHOD(SetColumns) \
  1063. (THIS_ LPSPropTagArray lpPropTagArray, \
  1064. ULONG ulFlags) IPURE; \
  1065. MAPIMETHOD(QueryColumns) \
  1066. (THIS_ ULONG ulFlags, \
  1067. LPSPropTagArray FAR * lpPropTagArray) IPURE; \
  1068. MAPIMETHOD(GetRowCount) \
  1069. (THIS_ ULONG ulFlags, \
  1070. ULONG FAR * lpulCount) IPURE; \
  1071. MAPIMETHOD(SeekRow) \
  1072. (THIS_ BOOKMARK bkOrigin, \
  1073. LONG lRowCount, \
  1074. LONG FAR * lplRowsSought) IPURE; \
  1075. MAPIMETHOD(SeekRowApprox) \
  1076. (THIS_ ULONG ulNumerator, \
  1077. ULONG ulDenominator) IPURE; \
  1078. MAPIMETHOD(QueryPosition) \
  1079. (THIS_ ULONG FAR * lpulRow, \
  1080. ULONG FAR * lpulNumerator, \
  1081. ULONG FAR * lpulDenominator) IPURE; \
  1082. MAPIMETHOD(FindRow) \
  1083. (THIS_ LPSRestriction lpRestriction, \
  1084. BOOKMARK bkOrigin, \
  1085. ULONG ulFlags) IPURE; \
  1086. MAPIMETHOD(Restrict) \
  1087. (THIS_ LPSRestriction lpRestriction, \
  1088. ULONG ulFlags) IPURE; \
  1089. MAPIMETHOD(CreateBookmark) \
  1090. (THIS_ BOOKMARK FAR * lpbkPosition) IPURE; \
  1091. MAPIMETHOD(FreeBookmark) \
  1092. (THIS_ BOOKMARK bkPosition) IPURE; \
  1093. MAPIMETHOD(SortTable) \
  1094. (THIS_ LPSSortOrderSet lpSortCriteria, \
  1095. ULONG ulFlags) IPURE; \
  1096. MAPIMETHOD(QuerySortOrder) \
  1097. (THIS_ LPSSortOrderSet FAR * lppSortCriteria) IPURE; \
  1098. MAPIMETHOD(QueryRows) \
  1099. (THIS_ LONG lRowCount, \
  1100. ULONG ulFlags, \
  1101. LPSRowSet FAR * lppRows) IPURE; \
  1102. MAPIMETHOD(Abort) (THIS) IPURE; \
  1103. MAPIMETHOD(ExpandRow) \
  1104. (THIS_ ULONG cbInstanceKey, \
  1105. LPBYTE pbInstanceKey, \
  1106. ULONG ulRowCount, \
  1107. ULONG ulFlags, \
  1108. LPSRowSet FAR * lppRows, \
  1109. ULONG FAR * lpulMoreRows) IPURE; \
  1110. MAPIMETHOD(CollapseRow) \
  1111. (THIS_ ULONG cbInstanceKey, \
  1112. LPBYTE pbInstanceKey, \
  1113. ULONG ulFlags, \
  1114. ULONG FAR * lpulRowCount) IPURE; \
  1115. MAPIMETHOD(WaitForCompletion) \
  1116. (THIS_ ULONG ulFlags, \
  1117. ULONG ulTimeout, \
  1118. ULONG FAR * lpulTableStatus) IPURE; \
  1119. MAPIMETHOD(GetCollapseState) \
  1120. (THIS_ ULONG ulFlags, \
  1121. ULONG cbInstanceKey, \
  1122. LPBYTE lpbInstanceKey, \
  1123. ULONG FAR * lpcbCollapseState, \
  1124. LPBYTE FAR * lppbCollapseState) IPURE; \
  1125. MAPIMETHOD(SetCollapseState) \
  1126. (THIS_ ULONG ulFlags, \
  1127. ULONG cbCollapseState, \
  1128. LPBYTE pbCollapseState, \
  1129. BOOKMARK FAR * lpbkLocation) IPURE; \
  1130. #undef INTERFACE
  1131. #define INTERFACE IMAPITable
  1132. DECLARE_MAPI_INTERFACE_(IMAPITable, IUnknown)
  1133. {
  1134. BEGIN_INTERFACE
  1135. MAPI_IUNKNOWN_METHODS(PURE)
  1136. MAPI_IMAPITABLE_METHODS(PURE)
  1137. };
  1138. /* IProfSect Interface ----------------------------------------------------- */
  1139. /* Standard section for public profile properties */
  1140. #define PS_PROFILE_PROPERTIES_INIT \
  1141. { 0x98, 0x15, 0xAC, 0x08, 0xAA, 0xB0, 0x10, 0x1A, \
  1142. 0x8C, 0x93, 0x08, 0x00, 0x2B, 0x2A, 0x56, 0xC2 }
  1143. #define MAPI_IPROFSECT_METHODS(IPURE)
  1144. #undef INTERFACE
  1145. #define INTERFACE IProfSect
  1146. DECLARE_MAPI_INTERFACE_(IProfSect, IMAPIProp)
  1147. {
  1148. BEGIN_INTERFACE
  1149. MAPI_IUNKNOWN_METHODS(PURE)
  1150. MAPI_IMAPIPROP_METHODS(PURE)
  1151. MAPI_IPROFSECT_METHODS(PURE)
  1152. };
  1153. /* IMAPIStatus Interface --------------------------------------------------- */
  1154. /* Values for PR_RESOURCE_TYPE, _METHODS, _FLAGS */
  1155. #define MAPI_STORE_PROVIDER ((ULONG) 33) /* Message Store */
  1156. #define MAPI_AB ((ULONG) 34) /* Address Book */
  1157. #define MAPI_AB_PROVIDER ((ULONG) 35) /* Address Book Provider */
  1158. #define MAPI_TRANSPORT_PROVIDER ((ULONG) 36) /* Transport Provider */
  1159. #define MAPI_SPOOLER ((ULONG) 37) /* Message Spooler */
  1160. #define MAPI_PROFILE_PROVIDER ((ULONG) 38) /* Profile Provider */
  1161. #define MAPI_SUBSYSTEM ((ULONG) 39) /* Overall Subsystem Status */
  1162. #define MAPI_HOOK_PROVIDER ((ULONG) 40) /* Spooler Hook */
  1163. #define STATUS_VALIDATE_STATE ((ULONG) 0x00000001)
  1164. #define STATUS_SETTINGS_DIALOG ((ULONG) 0x00000002)
  1165. #define STATUS_CHANGE_PASSWORD ((ULONG) 0x00000004)
  1166. #define STATUS_FLUSH_QUEUES ((ULONG) 0x00000008)
  1167. #define STATUS_DEFAULT_OUTBOUND ((ULONG) 0x00000001)
  1168. #define STATUS_DEFAULT_STORE ((ULONG) 0x00000002)
  1169. #define STATUS_PRIMARY_IDENTITY ((ULONG) 0x00000004)
  1170. #define STATUS_SIMPLE_STORE ((ULONG) 0x00000008)
  1171. #define STATUS_XP_PREFER_LAST ((ULONG) 0x00000010)
  1172. #define STATUS_NO_PRIMARY_IDENTITY ((ULONG) 0x00000020)
  1173. #define STATUS_NO_DEFAULT_STORE ((ULONG) 0x00000040)
  1174. #define STATUS_TEMP_SECTION ((ULONG) 0x00000080)
  1175. #define STATUS_OWN_STORE ((ULONG) 0x00000100)
  1176. /****** HOOK_INBOUND ((ULONG) 0x00000200) Defined in MAPIHOOK.H */
  1177. /****** HOOK_OUTBOUND ((ULONG) 0x00000400) Defined in MAPIHOOK.H */
  1178. #define STATUS_NEED_IPM_TREE ((ULONG) 0x00000800)
  1179. /*
  1180. * PR_STATUS_CODE bit. Low 16 bits for common values; High 16 bits
  1181. * for provider type-specific values. (DCR 304)
  1182. */
  1183. #define STATUS_AVAILABLE ((ULONG) 0x00000001)
  1184. #define STATUS_OFFLINE ((ULONG) 0x00000002)
  1185. #define STATUS_FAILURE ((ULONG) 0x00000004)
  1186. /* Transport values of PR_STATUS_CODE */
  1187. #define STATUS_INBOUND_ENABLED ((ULONG) 0x00010000)
  1188. #define STATUS_INBOUND_ACTIVE ((ULONG) 0x00020000)
  1189. #define STATUS_INBOUND_FLUSH ((ULONG) 0x00040000)
  1190. #define STATUS_OUTBOUND_ENABLED ((ULONG) 0x00100000)
  1191. #define STATUS_OUTBOUND_ACTIVE ((ULONG) 0x00200000)
  1192. #define STATUS_OUTBOUND_FLUSH ((ULONG) 0x00400000)
  1193. #define STATUS_REMOTE_ACCESS ((ULONG) 0x00800000)
  1194. /* ValidateState flags */
  1195. #define SUPPRESS_UI ((ULONG) 0x00000001)
  1196. #define REFRESH_XP_HEADER_CACHE ((ULONG) 0x00010000)
  1197. #define PROCESS_XP_HEADER_CACHE ((ULONG) 0x00020000)
  1198. #define FORCE_XP_CONNECT ((ULONG) 0x00040000)
  1199. #define FORCE_XP_DISCONNECT ((ULONG) 0x00080000)
  1200. #define CONFIG_CHANGED ((ULONG) 0x00100000)
  1201. #define ABORT_XP_HEADER_OPERATION ((ULONG) 0x00200000)
  1202. #define SHOW_XP_SESSION_UI ((ULONG) 0x00400000)
  1203. /* SettingsDialog flags */
  1204. #define UI_READONLY ((ULONG) 0x00000001)
  1205. /* FlushQueues flags */
  1206. #define FLUSH_UPLOAD ((ULONG) 0x00000002)
  1207. #define FLUSH_DOWNLOAD ((ULONG) 0x00000004)
  1208. #define FLUSH_FORCE ((ULONG) 0x00000008)
  1209. #define FLUSH_NO_UI ((ULONG) 0x00000010)
  1210. #define MAPI_IMAPISTATUS_METHODS(IPURE) \
  1211. MAPIMETHOD(ValidateState) \
  1212. (THIS_ ULONG ulUIParam, \
  1213. ULONG ulFlags) IPURE; \
  1214. MAPIMETHOD(SettingsDialog) \
  1215. (THIS_ ULONG ulUIParam, \
  1216. ULONG ulFlags) IPURE; \
  1217. MAPIMETHOD(ChangePassword) \
  1218. (THIS_ LPTSTR lpOldPass, \
  1219. LPTSTR lpNewPass, \
  1220. ULONG ulFlags) IPURE; \
  1221. MAPIMETHOD(FlushQueues) \
  1222. (THIS_ ULONG ulUIParam, \
  1223. ULONG cbTargetTransport, \
  1224. LPENTRYID lpTargetTransport, \
  1225. ULONG ulFlags) IPURE; \
  1226. #undef INTERFACE
  1227. #define INTERFACE IMAPIStatus
  1228. DECLARE_MAPI_INTERFACE_(IMAPIStatus, IMAPIProp)
  1229. {
  1230. BEGIN_INTERFACE
  1231. MAPI_IUNKNOWN_METHODS(PURE)
  1232. MAPI_IMAPIPROP_METHODS(PURE)
  1233. MAPI_IMAPISTATUS_METHODS(PURE)
  1234. };
  1235. /* IMAPIContainer Interface ------------------------------------------------ */
  1236. /* Flags for OpenEntry() */
  1237. /****** MAPI_MODIFY ((ULONG) 0x00000001) above */
  1238. #define MAPI_BEST_ACCESS ((ULONG) 0x00000010)
  1239. /* GetContentsTable() */
  1240. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1241. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1242. /****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */
  1243. /* GetHierarchyTable() */
  1244. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1245. #define CONVENIENT_DEPTH ((ULONG) 0x00000001)
  1246. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1247. /* GetSearchCriteria */
  1248. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1249. #define SEARCH_RUNNING ((ULONG) 0x00000001)
  1250. #define SEARCH_REBUILD ((ULONG) 0x00000002)
  1251. #define SEARCH_RECURSIVE ((ULONG) 0x00000004)
  1252. #define SEARCH_FOREGROUND ((ULONG) 0x00000008)
  1253. /* SetSearchCriteria */
  1254. #define STOP_SEARCH ((ULONG) 0x00000001)
  1255. #define RESTART_SEARCH ((ULONG) 0x00000002)
  1256. #define RECURSIVE_SEARCH ((ULONG) 0x00000004)
  1257. #define SHALLOW_SEARCH ((ULONG) 0x00000008)
  1258. #define FOREGROUND_SEARCH ((ULONG) 0x00000010)
  1259. #define BACKGROUND_SEARCH ((ULONG) 0x00000020)
  1260. #define MAPI_IMAPICONTAINER_METHODS(IPURE) \
  1261. MAPIMETHOD(GetContentsTable) \
  1262. (THIS_ ULONG ulFlags, \
  1263. LPMAPITABLE FAR * lppTable) IPURE; \
  1264. MAPIMETHOD(GetHierarchyTable) \
  1265. (THIS_ ULONG ulFlags, \
  1266. LPMAPITABLE FAR * lppTable) IPURE; \
  1267. MAPIMETHOD(OpenEntry) \
  1268. (THIS_ ULONG cbEntryID, \
  1269. LPENTRYID lpEntryID, \
  1270. LPCIID lpInterface, \
  1271. ULONG ulFlags, \
  1272. ULONG FAR * lpulObjType, \
  1273. LPUNKNOWN FAR * lppUnk) IPURE; \
  1274. MAPIMETHOD(SetSearchCriteria) \
  1275. (THIS_ LPSRestriction lpRestriction, \
  1276. LPENTRYLIST lpContainerList, \
  1277. ULONG ulSearchFlags) IPURE; \
  1278. MAPIMETHOD(GetSearchCriteria) \
  1279. (THIS_ ULONG ulFlags, \
  1280. LPSRestriction FAR * lppRestriction, \
  1281. LPENTRYLIST FAR * lppContainerList, \
  1282. ULONG FAR * lpulSearchState)IPURE; \
  1283. #undef INTERFACE
  1284. #define INTERFACE IMAPIContainer
  1285. DECLARE_MAPI_INTERFACE_(IMAPIContainer, IMAPIProp)
  1286. {
  1287. BEGIN_INTERFACE
  1288. MAPI_IUNKNOWN_METHODS(PURE)
  1289. MAPI_IMAPIPROP_METHODS(PURE)
  1290. MAPI_IMAPICONTAINER_METHODS(PURE)
  1291. };
  1292. /* IABContainer Interface -------------------------------------------------- */
  1293. /*
  1294. * IABContainer PR_CONTAINER_FLAGS values
  1295. * If AB_UNMODIFIABLE and AB_MODIFIABLE are both set, it means the container
  1296. * doesn't know if it's modifiable or not, and the client should
  1297. * try to modify the contents but we won't expect it to work.
  1298. * If the AB_RECIPIENTS flag is set and neither AB_MODIFIABLE or AB_UNMODIFIABLE
  1299. * bits are set, it is an error.
  1300. */
  1301. typedef struct _flaglist
  1302. {
  1303. ULONG cFlags;
  1304. ULONG ulFlag[MAPI_DIM];
  1305. } FlagList, FAR * LPFlagList;
  1306. /*
  1307. * Container flags
  1308. */
  1309. #define AB_RECIPIENTS ((ULONG) 0x00000001)
  1310. #define AB_SUBCONTAINERS ((ULONG) 0x00000002)
  1311. #define AB_MODIFIABLE ((ULONG) 0x00000004)
  1312. #define AB_UNMODIFIABLE ((ULONG) 0x00000008)
  1313. #define AB_FIND_ON_OPEN ((ULONG) 0x00000010)
  1314. /* CreateEntry() */
  1315. #define CREATE_CHECK_DUP_STRICT ((ULONG) 0x00000001)
  1316. #define CREATE_CHECK_DUP_LOOSE ((ULONG) 0x00000002)
  1317. #define CREATE_REPLACE ((ULONG) 0x00000004)
  1318. /* ResolveNames() - ulFlags */
  1319. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1320. /* ResolveNames() - rgulFlags */
  1321. #define MAPI_UNRESOLVED ((ULONG) 0x00000000)
  1322. #define MAPI_AMBIGUOUS ((ULONG) 0x00000001)
  1323. #define MAPI_RESOLVED ((ULONG) 0x00000002)
  1324. #define MAPI_IABCONTAINER_METHODS(IPURE) \
  1325. MAPIMETHOD(CreateEntry) \
  1326. (THIS_ ULONG cbEntryID, \
  1327. LPENTRYID lpEntryID, \
  1328. ULONG ulCreateFlags, \
  1329. LPMAPIPROP FAR * lppMAPIPropEntry) IPURE; \
  1330. MAPIMETHOD(CopyEntries) \
  1331. (THIS_ LPENTRYLIST lpEntries, \
  1332. ULONG ulUIParam, \
  1333. LPMAPIPROGRESS lpProgress, \
  1334. ULONG ulFlags) IPURE; \
  1335. MAPIMETHOD(DeleteEntries) \
  1336. (THIS_ LPENTRYLIST lpEntries, \
  1337. ULONG ulFlags) IPURE; \
  1338. MAPIMETHOD(ResolveNames) \
  1339. (THIS_ LPSPropTagArray lpPropTagArray, \
  1340. ULONG ulFlags, \
  1341. LPADRLIST lpAdrList, \
  1342. LPFlagList lpFlagList) IPURE; \
  1343. #undef INTERFACE
  1344. #define INTERFACE IABContainer
  1345. DECLARE_MAPI_INTERFACE_(IABContainer, IMAPIContainer)
  1346. {
  1347. BEGIN_INTERFACE
  1348. MAPI_IUNKNOWN_METHODS(PURE)
  1349. MAPI_IMAPIPROP_METHODS(PURE)
  1350. MAPI_IMAPICONTAINER_METHODS(PURE)
  1351. MAPI_IABCONTAINER_METHODS(PURE)
  1352. };
  1353. /* IMailUser Interface ----------------------------------------------------- */
  1354. /* Values of PR_NDR_DIAG_CODE */
  1355. #define MAPI_DIAG(_code) ((LONG) _code)
  1356. #define MAPI_DIAG_NO_DIAGNOSTIC MAPI_DIAG( -1 )
  1357. #define MAPI_DIAG_OR_NAME_UNRECOGNIZED MAPI_DIAG( 0 )
  1358. #define MAPI_DIAG_OR_NAME_AMBIGUOUS MAPI_DIAG( 1 )
  1359. #define MAPI_DIAG_MTS_CONGESTED MAPI_DIAG( 2 )
  1360. #define MAPI_DIAG_LOOP_DETECTED MAPI_DIAG( 3 )
  1361. #define MAPI_DIAG_RECIPIENT_UNAVAILABLE MAPI_DIAG( 4 )
  1362. #define MAPI_DIAG_MAXIMUM_TIME_EXPIRED MAPI_DIAG( 5 )
  1363. #define MAPI_DIAG_EITS_UNSUPPORTED MAPI_DIAG( 6 )
  1364. #define MAPI_DIAG_CONTENT_TOO_LONG MAPI_DIAG( 7 )
  1365. #define MAPI_DIAG_IMPRACTICAL_TO_CONVERT MAPI_DIAG( 8 )
  1366. #define MAPI_DIAG_PROHIBITED_TO_CONVERT MAPI_DIAG( 9 )
  1367. #define MAPI_DIAG_CONVERSION_UNSUBSCRIBED MAPI_DIAG( 10 )
  1368. #define MAPI_DIAG_PARAMETERS_INVALID MAPI_DIAG( 11 )
  1369. #define MAPI_DIAG_CONTENT_SYNTAX_IN_ERROR MAPI_DIAG( 12 )
  1370. #define MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD MAPI_DIAG( 13 )
  1371. #define MAPI_DIAG_NUMBER_CONSTRAINT_VIOLATD MAPI_DIAG( 14 )
  1372. #define MAPI_DIAG_CONTENT_TYPE_UNSUPPORTED MAPI_DIAG( 15 )
  1373. #define MAPI_DIAG_TOO_MANY_RECIPIENTS MAPI_DIAG( 16 )
  1374. #define MAPI_DIAG_NO_BILATERAL_AGREEMENT MAPI_DIAG( 17 )
  1375. #define MAPI_DIAG_CRITICAL_FUNC_UNSUPPORTED MAPI_DIAG( 18 )
  1376. #define MAPI_DIAG_CONVERSION_LOSS_PROHIB MAPI_DIAG( 19 )
  1377. #define MAPI_DIAG_LINE_TOO_LONG MAPI_DIAG( 20 )
  1378. #define MAPI_DIAG_PAGE_TOO_LONG MAPI_DIAG( 21 )
  1379. #define MAPI_DIAG_PICTORIAL_SYMBOL_LOST MAPI_DIAG( 22 )
  1380. #define MAPI_DIAG_PUNCTUATION_SYMBOL_LOST MAPI_DIAG( 23 )
  1381. #define MAPI_DIAG_ALPHABETIC_CHARACTER_LOST MAPI_DIAG( 24 )
  1382. #define MAPI_DIAG_MULTIPLE_INFO_LOSSES MAPI_DIAG( 25 )
  1383. #define MAPI_DIAG_REASSIGNMENT_PROHIBITED MAPI_DIAG( 26 )
  1384. #define MAPI_DIAG_REDIRECTION_LOOP_DETECTED MAPI_DIAG( 27 )
  1385. #define MAPI_DIAG_EXPANSION_PROHIBITED MAPI_DIAG( 28 )
  1386. #define MAPI_DIAG_SUBMISSION_PROHIBITED MAPI_DIAG( 29 )
  1387. #define MAPI_DIAG_EXPANSION_FAILED MAPI_DIAG( 30 )
  1388. #define MAPI_DIAG_RENDITION_UNSUPPORTED MAPI_DIAG( 31 )
  1389. #define MAPI_DIAG_MAIL_ADDRESS_INCORRECT MAPI_DIAG( 32 )
  1390. #define MAPI_DIAG_MAIL_OFFICE_INCOR_OR_INVD MAPI_DIAG( 33 )
  1391. #define MAPI_DIAG_MAIL_ADDRESS_INCOMPLETE MAPI_DIAG( 34 )
  1392. #define MAPI_DIAG_MAIL_RECIPIENT_UNKNOWN MAPI_DIAG( 35 )
  1393. #define MAPI_DIAG_MAIL_RECIPIENT_DECEASED MAPI_DIAG( 36 )
  1394. #define MAPI_DIAG_MAIL_ORGANIZATION_EXPIRED MAPI_DIAG( 37 )
  1395. #define MAPI_DIAG_MAIL_REFUSED MAPI_DIAG( 38 )
  1396. #define MAPI_DIAG_MAIL_UNCLAIMED MAPI_DIAG( 39 )
  1397. #define MAPI_DIAG_MAIL_RECIPIENT_MOVED MAPI_DIAG( 40 )
  1398. #define MAPI_DIAG_MAIL_RECIPIENT_TRAVELLING MAPI_DIAG( 41 )
  1399. #define MAPI_DIAG_MAIL_RECIPIENT_DEPARTED MAPI_DIAG( 42 )
  1400. #define MAPI_DIAG_MAIL_NEW_ADDRESS_UNKNOWN MAPI_DIAG( 43 )
  1401. #define MAPI_DIAG_MAIL_FORWARDING_UNWANTED MAPI_DIAG( 44 )
  1402. #define MAPI_DIAG_MAIL_FORWARDING_PROHIB MAPI_DIAG( 45 )
  1403. #define MAPI_DIAG_SECURE_MESSAGING_ERROR MAPI_DIAG( 46 )
  1404. #define MAPI_DIAG_DOWNGRADING_IMPOSSIBLE MAPI_DIAG( 47 )
  1405. #define MAPI_IMAILUSER_METHODS(IPURE)
  1406. #undef INTERFACE
  1407. #define INTERFACE IMailUser
  1408. DECLARE_MAPI_INTERFACE_(IMailUser, IMAPIProp)
  1409. {
  1410. BEGIN_INTERFACE
  1411. MAPI_IUNKNOWN_METHODS(PURE)
  1412. MAPI_IMAPIPROP_METHODS(PURE)
  1413. MAPI_IMAILUSER_METHODS(PURE)
  1414. };
  1415. /* IDistList Interface ----------------------------------------------------- */
  1416. #define MAPI_IDISTLIST_METHODS(IPURE) \
  1417. MAPIMETHOD(CreateEntry) \
  1418. (THIS_ ULONG cbEntryID, \
  1419. LPENTRYID lpEntryID, \
  1420. ULONG ulCreateFlags, \
  1421. LPMAPIPROP FAR * lppMAPIPropEntry) IPURE; \
  1422. MAPIMETHOD(CopyEntries) \
  1423. (THIS_ LPENTRYLIST lpEntries, \
  1424. ULONG ulUIParam, \
  1425. LPMAPIPROGRESS lpProgress, \
  1426. ULONG ulFlags) IPURE; \
  1427. MAPIMETHOD(DeleteEntries) \
  1428. (THIS_ LPENTRYLIST lpEntries, \
  1429. ULONG ulFlags) IPURE; \
  1430. MAPIMETHOD(ResolveNames) \
  1431. (THIS_ LPSPropTagArray lpPropTagArray, \
  1432. ULONG ulFlags, \
  1433. LPADRLIST lpAdrList, \
  1434. LPFlagList lpFlagList) IPURE; \
  1435. #undef INTERFACE
  1436. #define INTERFACE IDistList
  1437. DECLARE_MAPI_INTERFACE_(IDistList, IMAPIContainer)
  1438. {
  1439. BEGIN_INTERFACE
  1440. MAPI_IUNKNOWN_METHODS(PURE)
  1441. MAPI_IMAPIPROP_METHODS(PURE)
  1442. MAPI_IMAPICONTAINER_METHODS(PURE)
  1443. MAPI_IDISTLIST_METHODS(PURE)
  1444. };
  1445. /* IMAPIFolder Interface --------------------------------------------------- */
  1446. /* IMAPIFolder folder type (enum) */
  1447. #define FOLDER_ROOT ((ULONG) 0x00000000)
  1448. #define FOLDER_GENERIC ((ULONG) 0x00000001)
  1449. #define FOLDER_SEARCH ((ULONG) 0x00000002)
  1450. /* CreateMessage */
  1451. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1452. /****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */
  1453. /* CopyMessages */
  1454. #define MESSAGE_MOVE ((ULONG) 0x00000001)
  1455. #define MESSAGE_DIALOG ((ULONG) 0x00000002)
  1456. /****** MAPI_DECLINE_OK ((ULONG) 0x00000004) above */
  1457. /* CreateFolder */
  1458. #define OPEN_IF_EXISTS ((ULONG) 0x00000001)
  1459. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1460. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1461. /* DeleteFolder */
  1462. #define DEL_MESSAGES ((ULONG) 0x00000001)
  1463. #define FOLDER_DIALOG ((ULONG) 0x00000002)
  1464. #define DEL_FOLDERS ((ULONG) 0x00000004)
  1465. /* EmptyFolder */
  1466. #define DEL_ASSOCIATED ((ULONG) 0x00000008)
  1467. /* CopyFolder */
  1468. #define FOLDER_MOVE ((ULONG) 0x00000001)
  1469. /****** FOLDER_DIALOG ((ULONG) 0x00000002) above */
  1470. /****** MAPI_DECLINE_OK ((ULONG) 0x00000004) above */
  1471. #define COPY_SUBFOLDERS ((ULONG) 0x00000010)
  1472. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1473. /* SetReadFlags */
  1474. /****** SUPPRESS_RECEIPT ((ULONG) 0x00000001) below */
  1475. /****** MESSAGE_DIALOG ((ULONG) 0x00000002) above */
  1476. /****** CLEAR_READ_FLAG ((ULONG) 0x00000004) below */
  1477. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1478. #define GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010)
  1479. /* GetMessageStatus */
  1480. #define MSGSTATUS_HIGHLIGHTED ((ULONG) 0x00000001)
  1481. #define MSGSTATUS_TAGGED ((ULONG) 0x00000002)
  1482. #define MSGSTATUS_HIDDEN ((ULONG) 0x00000004)
  1483. #define MSGSTATUS_DELMARKED ((ULONG) 0x00000008)
  1484. /* Bits for remote message status */
  1485. #define MSGSTATUS_REMOTE_DOWNLOAD ((ULONG) 0x00001000)
  1486. #define MSGSTATUS_REMOTE_DELETE ((ULONG) 0x00002000)
  1487. /* SaveContentsSort */
  1488. #define RECURSIVE_SORT ((ULONG) 0x00000002)
  1489. /* PR_STATUS property */
  1490. #define FLDSTATUS_HIGHLIGHTED ((ULONG) 0x00000001)
  1491. #define FLDSTATUS_TAGGED ((ULONG) 0x00000002)
  1492. #define FLDSTATUS_HIDDEN ((ULONG) 0x00000004)
  1493. #define FLDSTATUS_DELMARKED ((ULONG) 0x00000008)
  1494. #define MAPI_IMAPIFOLDER_METHODS(IPURE) \
  1495. MAPIMETHOD(CreateMessage) \
  1496. (THIS_ LPCIID lpInterface, \
  1497. ULONG ulFlags, \
  1498. LPMESSAGE FAR * lppMessage) IPURE; \
  1499. MAPIMETHOD(CopyMessages) \
  1500. (THIS_ LPENTRYLIST lpMsgList, \
  1501. LPCIID lpInterface, \
  1502. LPVOID lpDestFolder, \
  1503. ULONG ulUIParam, \
  1504. LPMAPIPROGRESS lpProgress, \
  1505. ULONG ulFlags) IPURE; \
  1506. MAPIMETHOD(DeleteMessages) \
  1507. (THIS_ LPENTRYLIST lpMsgList, \
  1508. ULONG ulUIParam, \
  1509. LPMAPIPROGRESS lpProgress, \
  1510. ULONG ulFlags) IPURE; \
  1511. MAPIMETHOD(CreateFolder) \
  1512. (THIS_ ULONG ulFolderType, \
  1513. LPTSTR lpszFolderName, \
  1514. LPTSTR lpszFolderComment, \
  1515. LPCIID lpInterface, \
  1516. ULONG ulFlags, \
  1517. LPMAPIFOLDER FAR * lppFolder) IPURE; \
  1518. MAPIMETHOD(CopyFolder) \
  1519. (THIS_ ULONG cbEntryID, \
  1520. LPENTRYID lpEntryID, \
  1521. LPCIID lpInterface, \
  1522. LPVOID lpDestFolder, \
  1523. LPTSTR lpszNewFolderName, \
  1524. ULONG ulUIParam, \
  1525. LPMAPIPROGRESS lpProgress, \
  1526. ULONG ulFlags) IPURE; \
  1527. MAPIMETHOD(DeleteFolder) \
  1528. (THIS_ ULONG cbEntryID, \
  1529. LPENTRYID lpEntryID, \
  1530. ULONG ulUIParam, \
  1531. LPMAPIPROGRESS lpProgress, \
  1532. ULONG ulFlags) IPURE; \
  1533. MAPIMETHOD(SetReadFlags) \
  1534. (THIS_ LPENTRYLIST lpMsgList, \
  1535. ULONG ulUIParam, \
  1536. LPMAPIPROGRESS lpProgress, \
  1537. ULONG ulFlags) IPURE; \
  1538. MAPIMETHOD(GetMessageStatus) \
  1539. (THIS_ ULONG cbEntryID, \
  1540. LPENTRYID lpEntryID, \
  1541. ULONG ulFlags, \
  1542. ULONG FAR * lpulMessageStatus) IPURE; \
  1543. MAPIMETHOD(SetMessageStatus) \
  1544. (THIS_ ULONG cbEntryID, \
  1545. LPENTRYID lpEntryID, \
  1546. ULONG ulNewStatus, \
  1547. ULONG ulNewStatusMask, \
  1548. ULONG FAR * lpulOldStatus) IPURE; \
  1549. MAPIMETHOD(SaveContentsSort) \
  1550. (THIS_ LPSSortOrderSet lpSortCriteria, \
  1551. ULONG ulFlags) IPURE; \
  1552. MAPIMETHOD(EmptyFolder) \
  1553. (THIS_ ULONG ulUIParam, \
  1554. LPMAPIPROGRESS lpProgress, \
  1555. ULONG ulFlags) IPURE; \
  1556. #undef INTERFACE
  1557. #define INTERFACE IMAPIFolder
  1558. DECLARE_MAPI_INTERFACE_(IMAPIFolder, IMAPIContainer)
  1559. {
  1560. BEGIN_INTERFACE
  1561. MAPI_IUNKNOWN_METHODS(PURE)
  1562. MAPI_IMAPIPROP_METHODS(PURE)
  1563. MAPI_IMAPICONTAINER_METHODS(PURE)
  1564. MAPI_IMAPIFOLDER_METHODS(PURE)
  1565. };
  1566. /* IMsgStore Interface ----------------------------------------------------- */
  1567. /* PR_STORE_SUPPORT_MASK bits */
  1568. #define STORE_ENTRYID_UNIQUE ((ULONG) 0x00000001)
  1569. #define STORE_READONLY ((ULONG) 0x00000002)
  1570. #define STORE_SEARCH_OK ((ULONG) 0x00000004)
  1571. #define STORE_MODIFY_OK ((ULONG) 0x00000008)
  1572. #define STORE_CREATE_OK ((ULONG) 0x00000010)
  1573. #define STORE_ATTACH_OK ((ULONG) 0x00000020)
  1574. #define STORE_OLE_OK ((ULONG) 0x00000040)
  1575. #define STORE_SUBMIT_OK ((ULONG) 0x00000080)
  1576. #define STORE_NOTIFY_OK ((ULONG) 0x00000100)
  1577. #define STORE_MV_PROPS_OK ((ULONG) 0x00000200)
  1578. #define STORE_CATEGORIZE_OK ((ULONG) 0x00000400)
  1579. #define STORE_RTF_OK ((ULONG) 0x00000800)
  1580. #define STORE_RESTRICTION_OK ((ULONG) 0x00001000)
  1581. #define STORE_SORT_OK ((ULONG) 0x00002000)
  1582. /* OpenEntry() */
  1583. /****** MAPI_MODIFY ((ULONG) 0x00000001) above */
  1584. /****** MAPI_BEST_ACCESS ((ULONG) 0x00000010) above */
  1585. /* SetReceiveFolder() */
  1586. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1587. /* GetReceiveFolder() */
  1588. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1589. /* GetReceiveFolderTable() */
  1590. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1591. /* StoreLogoff() */
  1592. #define LOGOFF_NO_WAIT ((ULONG) 0x00000001)
  1593. #define LOGOFF_ORDERLY ((ULONG) 0x00000002)
  1594. #define LOGOFF_PURGE ((ULONG) 0x00000004)
  1595. #define LOGOFF_ABORT ((ULONG) 0x00000008)
  1596. #define LOGOFF_QUIET ((ULONG) 0x00000010)
  1597. #define LOGOFF_COMPLETE ((ULONG) 0x00010000)
  1598. #define LOGOFF_INBOUND ((ULONG) 0x00020000)
  1599. #define LOGOFF_OUTBOUND ((ULONG) 0x00040000)
  1600. #define LOGOFF_OUTBOUND_QUEUE ((ULONG) 0x00080000)
  1601. /* SetLockState() */
  1602. #define MSG_LOCKED ((ULONG) 0x00000001)
  1603. #define MSG_UNLOCKED ((ULONG) 0x00000000)
  1604. /* Flag bits for PR_VALID_FOLDER_MASK */
  1605. #define FOLDER_IPM_SUBTREE_VALID ((ULONG) 0x00000001)
  1606. #define FOLDER_IPM_INBOX_VALID ((ULONG) 0x00000002)
  1607. #define FOLDER_IPM_OUTBOX_VALID ((ULONG) 0x00000004)
  1608. #define FOLDER_IPM_WASTEBASKET_VALID ((ULONG) 0x00000008)
  1609. #define FOLDER_IPM_SENTMAIL_VALID ((ULONG) 0x00000010)
  1610. #define FOLDER_VIEWS_VALID ((ULONG) 0x00000020)
  1611. #define FOLDER_COMMON_VIEWS_VALID ((ULONG) 0x00000040)
  1612. #define FOLDER_FINDER_VALID ((ULONG) 0x00000080)
  1613. #define MAPI_IMSGSTORE_METHODS(IPURE) \
  1614. MAPIMETHOD(Advise) \
  1615. (THIS_ ULONG cbEntryID, \
  1616. LPENTRYID lpEntryID, \
  1617. ULONG ulEventMask, \
  1618. LPMAPIADVISESINK lpAdviseSink, \
  1619. ULONG FAR * lpulConnection) IPURE; \
  1620. MAPIMETHOD(Unadvise) \
  1621. (THIS_ ULONG ulConnection) IPURE; \
  1622. MAPIMETHOD(CompareEntryIDs) \
  1623. (THIS_ ULONG cbEntryID1, \
  1624. LPENTRYID lpEntryID1, \
  1625. ULONG cbEntryID2, \
  1626. LPENTRYID lpEntryID2, \
  1627. ULONG ulFlags, \
  1628. ULONG FAR * lpulResult) IPURE; \
  1629. MAPIMETHOD(OpenEntry) \
  1630. (THIS_ ULONG cbEntryID, \
  1631. LPENTRYID lpEntryID, \
  1632. LPCIID lpInterface, \
  1633. ULONG ulFlags, \
  1634. ULONG FAR * lpulObjType, \
  1635. LPUNKNOWN FAR * lppUnk) IPURE; \
  1636. MAPIMETHOD(SetReceiveFolder) \
  1637. (THIS_ LPTSTR lpszMessageClass, \
  1638. ULONG ulFlags, \
  1639. ULONG cbEntryID, \
  1640. LPENTRYID lpEntryID) IPURE; \
  1641. MAPIMETHOD(GetReceiveFolder) \
  1642. (THIS_ LPTSTR lpszMessageClass, \
  1643. ULONG ulFlags, \
  1644. ULONG FAR * lpcbEntryID, \
  1645. LPENTRYID FAR * lppEntryID, \
  1646. LPTSTR FAR * lppszExplicitClass) IPURE; \
  1647. MAPIMETHOD(GetReceiveFolderTable) \
  1648. (THIS_ ULONG ulFlags, \
  1649. LPMAPITABLE FAR * lppTable) IPURE; \
  1650. MAPIMETHOD(StoreLogoff) \
  1651. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  1652. MAPIMETHOD(AbortSubmit) \
  1653. (THIS_ ULONG cbEntryID, \
  1654. LPENTRYID lpEntryID, \
  1655. ULONG ulFlags) IPURE; \
  1656. MAPIMETHOD(GetOutgoingQueue) \
  1657. (THIS_ ULONG ulFlags, \
  1658. LPMAPITABLE FAR * lppTable) IPURE; \
  1659. MAPIMETHOD(SetLockState) \
  1660. (THIS_ LPMESSAGE lpMessage, \
  1661. ULONG ulLockState) IPURE; \
  1662. MAPIMETHOD(FinishedMsg) \
  1663. (THIS_ ULONG ulFlags, \
  1664. ULONG cbEntryID, \
  1665. LPENTRYID lpEntryID) IPURE; \
  1666. MAPIMETHOD(NotifyNewMail) \
  1667. (THIS_ LPNOTIFICATION lpNotification) IPURE; \
  1668. #undef INTERFACE
  1669. #define INTERFACE IMsgStore
  1670. DECLARE_MAPI_INTERFACE_(IMsgStore, IMAPIProp)
  1671. {
  1672. BEGIN_INTERFACE
  1673. MAPI_IUNKNOWN_METHODS(PURE)
  1674. MAPI_IMAPIPROP_METHODS(PURE)
  1675. MAPI_IMSGSTORE_METHODS(PURE)
  1676. };
  1677. /* IMessage Interface ------------------------------------------------------ */
  1678. /* SubmitMessage */
  1679. #define FORCE_SUBMIT ((ULONG) 0x00000001)
  1680. /* Flags defined in PR_MESSAGE_FLAGS */
  1681. #define MSGFLAG_READ ((ULONG) 0x00000001)
  1682. #define MSGFLAG_UNMODIFIED ((ULONG) 0x00000002)
  1683. #define MSGFLAG_SUBMIT ((ULONG) 0x00000004)
  1684. #define MSGFLAG_UNSENT ((ULONG) 0x00000008)
  1685. #define MSGFLAG_HASATTACH ((ULONG) 0x00000010)
  1686. #define MSGFLAG_FROMME ((ULONG) 0x00000020)
  1687. #define MSGFLAG_ASSOCIATED ((ULONG) 0x00000040)
  1688. #define MSGFLAG_RESEND ((ULONG) 0x00000080)
  1689. /* Flags defined in PR_SUBMIT_FLAGS */
  1690. #define SUBMITFLAG_LOCKED ((ULONG) 0x00000001)
  1691. #define SUBMITFLAG_PREPROCESS ((ULONG) 0x00000002)
  1692. /* GetAttachmentTable() */
  1693. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1694. /* GetRecipientTable() */
  1695. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  1696. /* ModifyRecipients */
  1697. /* ((ULONG) 0x00000001 is not a valid flag on ModifyRecipients. */
  1698. #define MODRECIP_ADD ((ULONG) 0x00000002)
  1699. #define MODRECIP_MODIFY ((ULONG) 0x00000004)
  1700. #define MODRECIP_REMOVE ((ULONG) 0x00000008)
  1701. /* SetReadFlag */
  1702. #define SUPPRESS_RECEIPT ((ULONG) 0x00000001)
  1703. #define CLEAR_READ_FLAG ((ULONG) 0x00000004)
  1704. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
  1705. /****** GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010) above */
  1706. /* DeleteAttach */
  1707. #define ATTACH_DIALOG ((ULONG) 0x00000001)
  1708. /* PR_SECURITY values */
  1709. #define SECURITY_SIGNED ((ULONG) 0x00000001)
  1710. #define SECURITY_ENCRYPTED ((ULONG) 0x00000002)
  1711. /* PR_PRIORITY values */
  1712. #define PRIO_URGENT ((long) 1)
  1713. #define PRIO_NORMAL ((long) 0)
  1714. #define PRIO_NONURGENT ((long) -1)
  1715. /* PR_SENSITIVITY values */
  1716. #define SENSITIVITY_NONE ((ULONG) 0x00000000)
  1717. #define SENSITIVITY_PERSONAL ((ULONG) 0x00000001)
  1718. #define SENSITIVITY_PRIVATE ((ULONG) 0x00000002)
  1719. #define SENSITIVITY_COMPANY_CONFIDENTIAL ((ULONG) 0x00000003)
  1720. /* PR_IMPORTANCE values */
  1721. #define IMPORTANCE_LOW ((long) 0)
  1722. #define IMPORTANCE_NORMAL ((long) 1)
  1723. #define IMPORTANCE_HIGH ((long) 2)
  1724. #define MAPI_IMESSAGE_METHODS(IPURE) \
  1725. MAPIMETHOD(GetAttachmentTable) \
  1726. (THIS_ ULONG ulFlags, \
  1727. LPMAPITABLE FAR * lppTable) IPURE; \
  1728. MAPIMETHOD(OpenAttach) \
  1729. (THIS_ ULONG ulAttachmentNum, \
  1730. LPCIID lpInterface, \
  1731. ULONG ulFlags, \
  1732. LPATTACH FAR * lppAttach) IPURE; \
  1733. MAPIMETHOD(CreateAttach) \
  1734. (THIS_ LPCIID lpInterface, \
  1735. ULONG ulFlags, \
  1736. ULONG FAR * lpulAttachmentNum, \
  1737. LPATTACH FAR * lppAttach) IPURE; \
  1738. MAPIMETHOD(DeleteAttach) \
  1739. (THIS_ ULONG ulAttachmentNum, \
  1740. ULONG ulUIParam, \
  1741. LPMAPIPROGRESS lpProgress, \
  1742. ULONG ulFlags) IPURE; \
  1743. MAPIMETHOD(GetRecipientTable) \
  1744. (THIS_ ULONG ulFlags, \
  1745. LPMAPITABLE FAR * lppTable) IPURE; \
  1746. MAPIMETHOD(ModifyRecipients) \
  1747. (THIS_ ULONG ulFlags, \
  1748. LPADRLIST lpMods) IPURE; \
  1749. MAPIMETHOD(SubmitMessage) \
  1750. (THIS_ ULONG ulFlags) IPURE; \
  1751. MAPIMETHOD(SetReadFlag) \
  1752. (THIS_ ULONG ulFlags) IPURE; \
  1753. #undef INTERFACE
  1754. #define INTERFACE IMessage
  1755. DECLARE_MAPI_INTERFACE_(IMessage, IMAPIProp)
  1756. {
  1757. BEGIN_INTERFACE
  1758. MAPI_IUNKNOWN_METHODS(PURE)
  1759. MAPI_IMAPIPROP_METHODS(PURE)
  1760. MAPI_IMESSAGE_METHODS(PURE)
  1761. };
  1762. /* IAttach Interface ------------------------------------------------------- */
  1763. /* IAttach attachment methods: PR_ATTACH_METHOD values */
  1764. #define NO_ATTACHMENT ((ULONG) 0x00000000)
  1765. #define ATTACH_BY_VALUE ((ULONG) 0x00000001)
  1766. #define ATTACH_BY_REFERENCE ((ULONG) 0x00000002)
  1767. #define ATTACH_BY_REF_RESOLVE ((ULONG) 0x00000003)
  1768. #define ATTACH_BY_REF_ONLY ((ULONG) 0x00000004)
  1769. #define ATTACH_EMBEDDED_MSG ((ULONG) 0x00000005)
  1770. #define ATTACH_OLE ((ULONG) 0x00000006)
  1771. #define MAPI_IATTACH_METHODS(IPURE)
  1772. #undef INTERFACE
  1773. #define INTERFACE IAttach
  1774. DECLARE_MAPI_INTERFACE_(IAttach, IMAPIProp)
  1775. {
  1776. BEGIN_INTERFACE
  1777. MAPI_IUNKNOWN_METHODS(PURE)
  1778. MAPI_IMAPIPROP_METHODS(PURE)
  1779. MAPI_IATTACH_METHODS(PURE)
  1780. };
  1781. /* --------------------------------- */
  1782. /* Address Book interface definition */
  1783. /* ADRPARM ulFlags - top 4 bits used for versioning */
  1784. #define GET_ADRPARM_VERSION(ulFlags) (((ULONG)ulFlags) & 0xF0000000)
  1785. #define SET_ADRPARM_VERSION(ulFlags, ulVersion) (((ULONG)ulVersion) | (((ULONG)ulFlags) & 0x0FFFFFFF))
  1786. /* Current versions of ADRPARM */
  1787. #define ADRPARM_HELP_CTX ((ULONG) 0x00000000)
  1788. /* ulFlags - bit fields */
  1789. #define DIALOG_MODAL ((ULONG) 0x00000001)
  1790. #define DIALOG_SDI ((ULONG) 0x00000002)
  1791. #define DIALOG_OPTIONS ((ULONG) 0x00000004)
  1792. #define ADDRESS_ONE ((ULONG) 0x00000008)
  1793. #define AB_SELECTONLY ((ULONG) 0x00000010)
  1794. #define AB_RESOLVE ((ULONG) 0x00000020)
  1795. /* --------------------------------- */
  1796. /* PR_DISPLAY_TYPEs */
  1797. /*
  1798. * These standard display types are
  1799. * by default handled by MAPI.
  1800. * They have default icons associated
  1801. * with them.
  1802. */
  1803. /* For address book contents tables */
  1804. #define DT_MAILUSER ((ULONG) 0x00000000)
  1805. #define DT_DISTLIST ((ULONG) 0x00000001)
  1806. #define DT_FORUM ((ULONG) 0x00000002)
  1807. #define DT_AGENT ((ULONG) 0x00000003)
  1808. #define DT_ORGANIZATION ((ULONG) 0x00000004)
  1809. #define DT_PRIVATE_DISTLIST ((ULONG) 0x00000005)
  1810. #define DT_REMOTE_MAILUSER ((ULONG) 0x00000006)
  1811. /* For address book hierarchy tables */
  1812. #define DT_MODIFIABLE ((ULONG) 0x00010000)
  1813. #define DT_GLOBAL ((ULONG) 0x00020000)
  1814. #define DT_LOCAL ((ULONG) 0x00030000)
  1815. #define DT_WAN ((ULONG) 0x00040000)
  1816. #define DT_NOT_SPECIFIC ((ULONG) 0x00050000)
  1817. /* For folder hierarchy tables */
  1818. #define DT_FOLDER ((ULONG) 0x01000000)
  1819. #define DT_FOLDER_LINK ((ULONG) 0x02000000)
  1820. /* Accelerator callback for DIALOG_SDI form of AB UI */
  1821. typedef BOOL (STDMETHODCALLTYPE ACCELERATEABSDI)(ULONG ulUIParam,
  1822. LPVOID lpvmsg);
  1823. typedef ACCELERATEABSDI FAR * LPFNABSDI;
  1824. /* Callback to application telling it that the DIALOG_SDI form of the */
  1825. /* AB UI has been dismissed. This is so that the above LPFNABSDI */
  1826. /* function doesn't keep being called. */
  1827. typedef void (STDMETHODCALLTYPE DISMISSMODELESS)(ULONG ulUIParam,
  1828. LPVOID lpvContext);
  1829. typedef DISMISSMODELESS FAR * LPFNDISMISS;
  1830. /*
  1831. * Prototype for the client function hooked to an optional button on
  1832. * the address book dialog
  1833. */
  1834. typedef SCODE (STDMETHODCALLTYPE FAR * LPFNBUTTON)(
  1835. ULONG ulUIParam,
  1836. LPVOID lpvContext,
  1837. ULONG cbEntryID,
  1838. LPENTRYID lpSelection,
  1839. ULONG ulFlags
  1840. );
  1841. /* Parameters for the address book dialog */
  1842. typedef struct _ADRPARM
  1843. {
  1844. ULONG cbABContEntryID;
  1845. LPENTRYID lpABContEntryID;
  1846. ULONG ulFlags;
  1847. LPVOID lpReserved;
  1848. ULONG ulHelpContext;
  1849. LPTSTR lpszHelpFileName;
  1850. LPFNABSDI lpfnABSDI;
  1851. LPFNDISMISS lpfnDismiss;
  1852. LPVOID lpvDismissContext;
  1853. LPTSTR lpszCaption;
  1854. LPTSTR lpszNewEntryTitle;
  1855. LPTSTR lpszDestWellsTitle;
  1856. ULONG cDestFields;
  1857. ULONG nDestFieldFocus;
  1858. LPTSTR FAR * lppszDestTitles;
  1859. ULONG FAR * lpulDestComps;
  1860. LPSRestriction lpContRestriction;
  1861. LPSRestriction lpHierRestriction;
  1862. } ADRPARM, FAR * LPADRPARM;
  1863. /* ------------ */
  1864. /* Random flags */
  1865. /* Flag for deferred error */
  1866. #define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008)
  1867. /* Flag for creating and using Folder Associated Information Messages */
  1868. #define MAPI_ASSOCIATED ((ULONG) 0x00000040)
  1869. /* Flags for OpenMessageStore() */
  1870. #define MDB_NO_DIALOG ((ULONG) 0x00000001)
  1871. #define MDB_WRITE ((ULONG) 0x00000004)
  1872. /****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) above */
  1873. /****** MAPI_BEST_ACCESS ((ULONG) 0x00000010) above */
  1874. #define MDB_TEMPORARY ((ULONG) 0x00000020)
  1875. #define MDB_NO_MAIL ((ULONG) 0x00000080)
  1876. /* Flags for OpenAddressBook */
  1877. #define AB_NO_DIALOG ((ULONG) 0x00000001)
  1878. /* IMAPIControl Interface -------------------------------------------------- */
  1879. /* Interface used in controls (particularly the button) defined by */
  1880. /* Display Tables. */
  1881. /* Flags for GetState */
  1882. #define MAPI_ENABLED ((ULONG) 0x00000000)
  1883. #define MAPI_DISABLED ((ULONG) 0x00000001)
  1884. #define MAPI_IMAPICONTROL_METHODS(IPURE) \
  1885. MAPIMETHOD(GetLastError) \
  1886. (THIS_ HRESULT hResult, \
  1887. ULONG ulFlags, \
  1888. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  1889. MAPIMETHOD(Activate) \
  1890. (THIS_ ULONG ulFlags, \
  1891. ULONG ulUIParam) IPURE; \
  1892. MAPIMETHOD(GetState) \
  1893. (THIS_ ULONG ulFlags, \
  1894. ULONG FAR * lpulState) IPURE; \
  1895. #undef INTERFACE
  1896. #define INTERFACE IMAPIControl
  1897. DECLARE_MAPI_INTERFACE_(IMAPIControl, IUnknown)
  1898. {
  1899. BEGIN_INTERFACE
  1900. MAPI_IUNKNOWN_METHODS(PURE)
  1901. MAPI_IMAPICONTROL_METHODS(PURE)
  1902. };
  1903. DECLARE_MAPI_INTERFACE_PTR(IMAPIControl, LPMAPICONTROL);
  1904. /* Display Tables ---------------------------------------------------------- */
  1905. /* Flags used in display tables - that is, PR_CONTROL_FLAGS */
  1906. #define DT_MULTILINE ((ULONG) 0x00000001)
  1907. #define DT_EDITABLE ((ULONG) 0x00000002)
  1908. #define DT_REQUIRED ((ULONG) 0x00000004)
  1909. #define DT_SET_IMMEDIATE ((ULONG) 0x00000008)
  1910. #define DT_PASSWORD_EDIT ((ULONG) 0x00000010)
  1911. #define DT_ACCEPT_DBCS ((ULONG) 0x00000020)
  1912. #define DT_SET_SELECTION ((ULONG) 0x00000040)
  1913. /* Display Table structures */
  1914. #define DTCT_LABEL ((ULONG) 0x00000000)
  1915. #define DTCT_EDIT ((ULONG) 0x00000001)
  1916. #define DTCT_LBX ((ULONG) 0x00000002)
  1917. #define DTCT_COMBOBOX ((ULONG) 0x00000003)
  1918. #define DTCT_DDLBX ((ULONG) 0x00000004)
  1919. #define DTCT_CHECKBOX ((ULONG) 0x00000005)
  1920. #define DTCT_GROUPBOX ((ULONG) 0x00000006)
  1921. #define DTCT_BUTTON ((ULONG) 0x00000007)
  1922. #define DTCT_PAGE ((ULONG) 0x00000008)
  1923. #define DTCT_RADIOBUTTON ((ULONG) 0x00000009)
  1924. #define DTCT_INKEDIT ((ULONG) 0x0000000A)
  1925. #define DTCT_MVLISTBOX ((ULONG) 0x0000000B)
  1926. #define DTCT_MVDDLBX ((ULONG) 0x0000000C)
  1927. /* Labels */
  1928. /* Valid ulFlags:
  1929. * MAPI_UNICODE
  1930. */
  1931. typedef struct _DTBLLABEL
  1932. {
  1933. ULONG ulbLpszLabelName;
  1934. ULONG ulFlags;
  1935. } DTBLLABEL, FAR * LPDTBLLABEL;
  1936. #define SizedDtblLabel(n,u) \
  1937. struct _DTBLLABEL_ ## u \
  1938. { \
  1939. DTBLLABEL dtbllabel; \
  1940. TCHAR lpszLabelName[n]; \
  1941. } u
  1942. /* Simple Text Edits */
  1943. /* Valid ulFlags:
  1944. * MAPI_UNICODE
  1945. */
  1946. typedef struct _DTBLEDIT
  1947. {
  1948. ULONG ulbLpszCharsAllowed;
  1949. ULONG ulFlags;
  1950. ULONG ulNumCharsAllowed;
  1951. ULONG ulPropTag;
  1952. } DTBLEDIT, FAR * LPDTBLEDIT;
  1953. #define SizedDtblEdit(n,u) \
  1954. struct _DTBLEDIT_ ## u \
  1955. { \
  1956. DTBLEDIT dtbledit; \
  1957. TCHAR lpszCharsAllowed[n]; \
  1958. } u
  1959. /* Ink Aware Edits */
  1960. /* Valid ulFlags:
  1961. * MAPI_UNICODE
  1962. */
  1963. typedef struct _DTBLINKEDIT
  1964. {
  1965. ULONG ulbLpszCharsAllowed;
  1966. ULONG ulFlags;
  1967. ULONG ulNumCharsAllowed;
  1968. ULONG ulTextPropTag;
  1969. ULONG ulInkDataPropTag;
  1970. } DTBLINKEDIT, FAR * LPDTBLINKEDIT;
  1971. #define SizedDtblInkEdit(n,u) \
  1972. struct _DTBLINKEDIT_ ## u \
  1973. { \
  1974. DTBLINKEDIT dtblinkedit; \
  1975. TCHAR lpszCharsAllowed[n]; \
  1976. } u
  1977. /* List Box */
  1978. /* Valid ulFlags:
  1979. */
  1980. #define MAPI_NO_HBAR ((ULONG) 0x00000001)
  1981. #define MAPI_NO_VBAR ((ULONG) 0x00000002)
  1982. typedef struct _DTBLLBX
  1983. {
  1984. ULONG ulFlags;
  1985. ULONG ulPRSetProperty;
  1986. ULONG ulPRTableName;
  1987. } DTBLLBX, FAR * LPDTBLLBX;
  1988. /* Combo Box */
  1989. /* Valid ulFlags:
  1990. * MAPI_UNICODE
  1991. */
  1992. typedef struct _DTBLCOMBOBOX
  1993. {
  1994. ULONG ulbLpszCharsAllowed;
  1995. ULONG ulFlags;
  1996. ULONG ulNumCharsAllowed;
  1997. ULONG ulPRPropertyName;
  1998. ULONG ulPRTableName;
  1999. } DTBLCOMBOBOX, FAR * LPDTBLCOMBOBOX;
  2000. #define SizedDtblComboBox(n,u) \
  2001. struct _DTBLCOMBOBOX_ ## u \
  2002. { \
  2003. DTBLCOMBOBOX dtblcombobox; \
  2004. TCHAR lpszCharsAllowed[n]; \
  2005. } u
  2006. /* Drop Down */
  2007. /* Valid ulFlags:
  2008. * none
  2009. */
  2010. typedef struct _DTBLDDLBX
  2011. {
  2012. ULONG ulFlags;
  2013. ULONG ulPRDisplayProperty;
  2014. ULONG ulPRSetProperty;
  2015. ULONG ulPRTableName;
  2016. } DTBLDDLBX, FAR * LPDTBLDDLBX;
  2017. /* Check Box */
  2018. /* Valid ulFlags:
  2019. * MAPI_UNICODE
  2020. */
  2021. typedef struct _DTBLCHECKBOX
  2022. {
  2023. ULONG ulbLpszLabel;
  2024. ULONG ulFlags;
  2025. ULONG ulPRPropertyName;
  2026. } DTBLCHECKBOX, FAR * LPDTBLCHECKBOX;
  2027. #define SizedDtblCheckBox(n,u) \
  2028. struct _DTBLCHECKBOX_ ## u \
  2029. { \
  2030. DTBLCHECKBOX dtblcheckbox; \
  2031. TCHAR lpszLabel[n]; \
  2032. } u
  2033. /* Group Box */
  2034. /* Valid ulFlags:
  2035. * MAPI_UNICODE
  2036. */
  2037. typedef struct _DTBLGROUPBOX
  2038. {
  2039. ULONG ulbLpszLabel;
  2040. ULONG ulFlags;
  2041. } DTBLGROUPBOX, FAR * LPDTBLGROUPBOX;
  2042. #define SizedDtblGroupBox(n,u) \
  2043. struct _DTBLGROUPBOX_ ## u \
  2044. { \
  2045. DTBLGROUPBOX dtblgroupbox; \
  2046. TCHAR lpszLabel[n]; \
  2047. } u
  2048. /* Button control */
  2049. /* Valid ulFlags:
  2050. * MAPI_UNICODE
  2051. */
  2052. typedef struct _DTBLBUTTON
  2053. {
  2054. ULONG ulbLpszLabel;
  2055. ULONG ulFlags;
  2056. ULONG ulPRControl;
  2057. } DTBLBUTTON, FAR * LPDTBLBUTTON;
  2058. #define SizedDtblButton(n,u) \
  2059. struct _DTBLBUTTON_ ## u \
  2060. { \
  2061. DTBLBUTTON dtblbutton; \
  2062. TCHAR lpszLabel[n]; \
  2063. } u
  2064. /* Pages */
  2065. /* Valid ulFlags:
  2066. * MAPI_UNICODE
  2067. */
  2068. typedef struct _DTBLPAGE
  2069. {
  2070. ULONG ulbLpszLabel;
  2071. ULONG ulFlags;
  2072. ULONG ulbLpszComponent;
  2073. ULONG ulContext;
  2074. } DTBLPAGE, FAR * LPDTBLPAGE;
  2075. #define SizedDtblPage(n,n1,u) \
  2076. struct _DTBLPAGE_ ## u \
  2077. { \
  2078. DTBLPAGE dtblpage; \
  2079. TCHAR lpszLabel[n]; \
  2080. TCHAR lpszComponent[n1]; \
  2081. } u
  2082. /* Radio button */
  2083. /* Valid ulFlags:
  2084. * MAPI_UNICODE
  2085. */
  2086. typedef struct _DTBLRADIOBUTTON
  2087. {
  2088. ULONG ulbLpszLabel;
  2089. ULONG ulFlags;
  2090. ULONG ulcButtons;
  2091. ULONG ulPropTag;
  2092. long lReturnValue;
  2093. } DTBLRADIOBUTTON, FAR * LPDTBLRADIOBUTTON;
  2094. #define SizedDtblRadioButton(n,u) \
  2095. struct _DTBLRADIOBUTTON_ ## u \
  2096. { \
  2097. DTBLRADIOBUTTON dtblradiobutton; \
  2098. TCHAR lpszLabel[n]; \
  2099. } u
  2100. /* MultiValued listbox */
  2101. /* Valid ulFlags:
  2102. * none
  2103. */
  2104. typedef struct _DTBLMVLISTBOX
  2105. {
  2106. ULONG ulFlags;
  2107. ULONG ulMVPropTag;
  2108. } DTBLMVLISTBOX, FAR * LPDTBLMVLISTBOX;
  2109. /* MultiValued dropdown */
  2110. /* Valid ulFlags:
  2111. * none
  2112. */
  2113. typedef struct _DTBLMVDDLBX
  2114. {
  2115. ULONG ulFlags;
  2116. ULONG ulMVPropTag;
  2117. } DTBLMVDDLBX, FAR * LPDTBLMVDDLBX;
  2118. /* IProviderAdmin Interface ---------------------------------------------- */
  2119. /* Flags for ConfigureMsgService */
  2120. #define UI_SERVICE 0x00000002
  2121. #define SERVICE_UI_ALWAYS 0x00000002 /* Duplicate UI_SERVICE for consistency and compatibility */
  2122. #define SERVICE_UI_ALLOWED 0x00000010
  2123. #define UI_CURRENT_PROVIDER_FIRST 0x00000004
  2124. /* MSG_SERVICE_UI_READ_ONLY 0x00000008 - in MAPISPI.H */
  2125. /* GetProviderTable() */
  2126. /****** MAPI_UNICODE ((ULONG) 0x80000000) above */
  2127. /* Values for PR_RESOURCE_FLAGS in message service table */
  2128. #define MAPI_IPROVIDERADMIN_METHODS(IPURE) \
  2129. MAPIMETHOD(GetLastError) \
  2130. (THIS_ HRESULT hResult, \
  2131. ULONG ulFlags, \
  2132. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  2133. MAPIMETHOD(GetProviderTable) \
  2134. (THIS_ ULONG ulFlags, \
  2135. LPMAPITABLE FAR * lppTable) IPURE; \
  2136. MAPIMETHOD(CreateProvider) \
  2137. (THIS_ LPTSTR lpszProvider, \
  2138. ULONG cValues, \
  2139. LPSPropValue lpProps, \
  2140. ULONG ulUIParam, \
  2141. ULONG ulFlags, \
  2142. MAPIUID FAR * lpUID) IPURE; \
  2143. MAPIMETHOD(DeleteProvider) \
  2144. (THIS_ LPMAPIUID lpUID) IPURE; \
  2145. MAPIMETHOD(OpenProfileSection) \
  2146. (THIS_ LPMAPIUID lpUID, \
  2147. LPCIID lpInterface, \
  2148. ULONG ulFlags, \
  2149. LPPROFSECT FAR * lppProfSect) IPURE; \
  2150. #undef INTERFACE
  2151. #define INTERFACE IProviderAdmin
  2152. DECLARE_MAPI_INTERFACE_(IProviderAdmin, IUnknown)
  2153. {
  2154. BEGIN_INTERFACE
  2155. MAPI_IUNKNOWN_METHODS(PURE)
  2156. MAPI_IPROVIDERADMIN_METHODS(PURE)
  2157. };
  2158. #ifdef __cplusplus
  2159. } /* extern "C" */
  2160. #endif
  2161. #endif /* MAPIDEFS_H */