home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / mapidefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  101.3 KB  |  2,655 lines

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